diff --git a/aljabar-projek/.gitignore b/aljabar-projek/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/aljabar-projek/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/aljabar-projek/README.md b/aljabar-projek/README.md new file mode 100644 index 0000000..c3c21da --- /dev/null +++ b/aljabar-projek/README.md @@ -0,0 +1,75 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) + +## React Compiler + +The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information. + +Note: This will impact Vite dev & build performances. + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/aljabar-projek/eslint.config.js b/aljabar-projek/eslint.config.js new file mode 100644 index 0000000..5e6b472 --- /dev/null +++ b/aljabar-projek/eslint.config.js @@ -0,0 +1,23 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/aljabar-projek/index.html b/aljabar-projek/index.html new file mode 100644 index 0000000..704a8da --- /dev/null +++ b/aljabar-projek/index.html @@ -0,0 +1,13 @@ + + + + + + + aljabar-projek + + +
+ + + diff --git a/aljabar-projek/package-lock.json b/aljabar-projek/package-lock.json new file mode 100644 index 0000000..e8ff7ff --- /dev/null +++ b/aljabar-projek/package-lock.json @@ -0,0 +1,3386 @@ +{ + "name": "aljabar-projek", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "aljabar-projek", + "version": "0.0.0", + "dependencies": { + "react": "^19.2.4", + "react-dom": "^19.2.4" + }, + "devDependencies": { + "@babel/core": "^7.29.0", + "@eslint/js": "^9.39.4", + "@rolldown/plugin-babel": "^0.2.1", + "@types/babel__core": "^7.20.5", + "@types/node": "^24.12.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "babel-plugin-react-compiler": "^1.0.0", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.57.0", + "vite": "^8.0.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz", + "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz", + "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz", + "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.2.tgz", + "integrity": "sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.123.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.123.0.tgz", + "integrity": "sha512-YtECP/y8Mj1lSHiUWGSRzy/C6teUKlS87dEfuVKT09LgQbUsBW1rNg+MiJ4buGu3yuADV60gbIvo9/HplA56Ew==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.13.tgz", + "integrity": "sha512-5ZiiecKH2DXAVJTNN13gNMUcCDg4Jy8ZjbXEsPnqa248wgOVeYRX0iqXXD5Jz4bI9BFHgKsI2qmyJynstbmr+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.13.tgz", + "integrity": "sha512-tz/v/8G77seu8zAB3A5sK3UFoOl06zcshEzhUO62sAEtrEuW/H1CcyoupOrD+NbQJytYgA4CppXPzlrmp4JZKA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.13.tgz", + "integrity": "sha512-8DakphqOz8JrMYWTJmWA+vDJxut6LijZ8Xcdc4flOlAhU7PNVwo2MaWBF9iXjJAPo5rC/IxEFZDhJ3GC7NHvug==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.13.tgz", + "integrity": "sha512-4wBQFfjDuXYN/SVI8inBF3Aa+isq40rc6VMFbk5jcpolUBTe5cYnMsHZ51nFWsx3PVyyNN3vgoESki0Hmr/4BA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.13.tgz", + "integrity": "sha512-JW/e4yPIXLms+jmnbwwy5LA/LxVwZUWLN8xug+V200wzaVi5TEGIWQlh8o91gWYFxW609euI98OCCemmWGuPrw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-ZfKWpXiUymDnavepCaM6KG/uGydJ4l2nBmMxg60Ci4CbeefpqjPWpfaZM7PThOhk2dssqBAcwLc6rAyr0uTdXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.13.tgz", + "integrity": "sha512-bmRg3O6Z0gq9yodKKWCIpnlH051sEfdVwt+6m5UDffAQMUUqU0xjnQqqAUm+Gu7ofAAly9DqiQDtKu2nPDEABA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-8Wtnbw4k7pMYN9B/mOEAsQ8HOiq7AZ31Ig4M9BKn2So4xRaFEhtCSa4ZJaOutOWq50zpgR4N5+L/opnlaCx8wQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-D/0Nlo8mQuxSMohNJUF2lDXWRsFDsHldfRRgD9bRgktj+EndGPj4DOV37LqDKPYS+osdyhZEH7fTakTAEcW7qg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-eRrPvat2YaVQcwwKi/JzOP6MKf1WRnOCr+VaI3cTWz3ZoLcP/654z90lVCJ4dAuMEpPdke0n+qyAqXDZdIC4rA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.13.tgz", + "integrity": "sha512-PsdONiFRp8hR8KgVjTWjZ9s7uA3uueWL0t74/cKHfM4dR5zXYv4AjB8BvA+QDToqxAFg4ZkcVEqeu5F7inoz5w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.13.tgz", + "integrity": "sha512-hCNXgC5dI3TVOLrPT++PKFNZ+1EtS0mLQwfXXXSUD/+rGlB65gZDwN/IDuxLpQP4x8RYYHqGomlUXzpO8aVI2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.13.tgz", + "integrity": "sha512-viLS5C5et8NFtLWw9Sw3M/w4vvnVkbWkO7wSNh3C+7G1+uCkGpr6PcjNDSFcNtmXY/4trjPBqUfcOL+P3sWy/g==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/core": "1.9.1", + "@emnapi/runtime": "1.9.1", + "@napi-rs/wasm-runtime": "^1.1.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.13.tgz", + "integrity": "sha512-Fqa3Tlt1xL4wzmAYxGNFV36Hb+VfPc9PYU+E25DAnswXv3ODDu/yyWjQDbXMo5AGWkQVjLgQExuVu8I/UaZhPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.13.tgz", + "integrity": "sha512-/pLI5kPkGEi44TDlnbio3St/5gUFeN51YWNAk/Gnv6mEQBOahRBh52qVFVBpmrnU01n2yysvBML9Ynu7K4kGAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/plugin-babel": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.2.tgz", + "integrity": "sha512-q9pE8+47bQNHb5eWVcE6oXppA+JTSwvnrhH53m0ZuHuK5MLvwsLoWrWzBTFQqQ06BVxz1gp0HblLsch8o6pvZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=22.12.0 || ^24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.29.0 || ^8.0.0-rc.1", + "@babel/plugin-transform-runtime": "^7.29.0 || ^8.0.0-rc.1", + "@babel/runtime": "^7.27.0 || ^8.0.0-rc.1", + "rolldown": "^1.0.0-rc.5", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@babel/plugin-transform-runtime": { + "optional": true + }, + "@babel/runtime": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz", + "integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.12.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.2.tgz", + "integrity": "sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.58.0.tgz", + "integrity": "sha512-RLkVSiNuUP1C2ROIWfqX+YcUfLaSnxGE/8M+Y57lopVwg9VTYYfhuz15Yf1IzCKgZj6/rIbYTmJCUSqr76r0Wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.58.0", + "@typescript-eslint/type-utils": "8.58.0", + "@typescript-eslint/utils": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.58.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.58.0.tgz", + "integrity": "sha512-rLoGZIf9afaRBYsPUMtvkDWykwXwUPL60HebR4JgTI8mxfFe2cQTu3AGitANp4b9B2QlVru6WzjgB2IzJKiCSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.58.0", + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.58.0.tgz", + "integrity": "sha512-8Q/wBPWLQP1j16NxoPNIKpDZFMaxl7yWIoqXWYeWO+Bbd2mjgvoF0dxP2jKZg5+x49rgKdf7Ck473M8PC3V9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.58.0", + "@typescript-eslint/types": "^8.58.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.58.0.tgz", + "integrity": "sha512-W1Lur1oF50FxSnNdGp3Vs6P+yBRSmZiw4IIjEeYxd8UQJwhUF0gDgDD/W/Tgmh73mxgEU3qX0Bzdl/NGuSPEpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.58.0.tgz", + "integrity": "sha512-doNSZEVJsWEu4htiVC+PR6NpM+pa+a4ClH9INRWOWCUzMst/VA9c4gXq92F8GUD1rwhNvRLkgjfYtFXegXQF7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.58.0.tgz", + "integrity": "sha512-aGsCQImkDIqMyx1u4PrVlbi/krmDsQUs4zAcCV6M7yPcPev+RqVlndsJy9kJ8TLihW9TZ0kbDAzctpLn5o+lOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0", + "@typescript-eslint/utils": "8.58.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.58.0.tgz", + "integrity": "sha512-O9CjxypDT89fbHxRfETNoAnHj/i6IpRK0CvbVN3qibxlLdo5p5hcLmUuCCrHMpxiWSwKyI8mCP7qRNYuOJ0Uww==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.58.0.tgz", + "integrity": "sha512-7vv5UWbHqew/dvs+D3e1RvLv1v2eeZ9txRHPnEEBUgSNLx5ghdzjHa0sgLWYVKssH+lYmV0JaWdoubo0ncGYLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.58.0", + "@typescript-eslint/tsconfig-utils": "8.58.0", + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/visitor-keys": "8.58.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", + "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.58.0.tgz", + "integrity": "sha512-RfeSqcFeHMHlAWzt4TBjWOAtoW9lnsAGiP3GbaX9uVgTYYrMbVnGONEfUCiSss+xMHFl+eHZiipmA8WkQ7FuNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.58.0", + "@typescript-eslint/types": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.58.0.tgz", + "integrity": "sha512-XJ9UD9+bbDo4a4epraTwG3TsNPeiB9aShrUneAVXy8q4LuwowN+qu89/6ByLMINqvIMeI9H9hOHQtg/ijrYXzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.58.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", + "integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.7" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/babel-plugin-react-compiler": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz", + "integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.15", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.15.tgz", + "integrity": "sha512-1nfKCq9wuAZFTkA2ey/3OXXx7GzFjLdkTiFVNwlJ9WqdI706CZRIhEqjuwanjMIja+84jDLa9rcyZDPDiVkASQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001785", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001785.tgz", + "integrity": "sha512-blhOL/WNR+Km1RI/LCVAvA73xplXA7ZbjzI4YkMK9pa6T/P3F2GxjNpEkyw5repTw9IvkyrjyHpwjnhZ5FOvYQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.331", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.331.tgz", + "integrity": "sha512-IbxXrsTlD3hRodkLnbxAPP4OuJYdWCeM3IOdT+CpcMoIwIoDfCmRpEtSPfwBXxVkg9xmBeY7Lz2Eo2TDn/HC3Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.2.tgz", + "integrity": "sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": "^9 || ^10" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.4.0.tgz", + "integrity": "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.37", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", + "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", + "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rolldown": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.13.tgz", + "integrity": "sha512-bvVj8YJmf0rq4pSFmH7laLa6pYrhghv3PRzrCdRAr23g66zOKVJ4wkvFtgohtPLWmthgg8/rkaqRHrpUEh0Zbw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@oxc-project/types": "=0.123.0", + "@rolldown/pluginutils": "1.0.0-rc.13" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-rc.13", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.13", + "@rolldown/binding-darwin-x64": "1.0.0-rc.13", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.13", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.13", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.13", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.13", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.13", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.13", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.13", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.13" + } + }, + "node_modules/rolldown/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.13.tgz", + "integrity": "sha512-3ngTAv6F/Py35BsYbeeLeecvhMKdsKm4AoOETVhAA+Qc8nrA2I0kF7oa93mE9qnIurngOSpMnQ0x2nQY2FPviA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.58.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.58.0.tgz", + "integrity": "sha512-e2TQzKfaI85fO+F3QywtX+tCTsu/D3WW5LVU6nz8hTFKFZ8yBJ6mSYRpXqdR3mFjPWmO0eWsTa5f+UpAOe/FMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.58.0", + "@typescript-eslint/parser": "8.58.0", + "@typescript-eslint/typescript-estree": "8.58.0", + "@typescript-eslint/utils": "8.58.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.3.tgz", + "integrity": "sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.8", + "rolldown": "1.0.0-rc.12", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.0", + "esbuild": "^0.27.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@oxc-project/types": { + "version": "0.122.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.122.0.tgz", + "integrity": "sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.12.tgz", + "integrity": "sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.12.tgz", + "integrity": "sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.12.tgz", + "integrity": "sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.12.tgz", + "integrity": "sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.12.tgz", + "integrity": "sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.12.tgz", + "integrity": "sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.12.tgz", + "integrity": "sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.12.tgz", + "integrity": "sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.12.tgz", + "integrity": "sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.12.tgz", + "integrity": "sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.12.tgz", + "integrity": "sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.12.tgz", + "integrity": "sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite/node_modules/rolldown": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.12.tgz", + "integrity": "sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.122.0", + "@rolldown/pluginutils": "1.0.0-rc.12" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-rc.12", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.12", + "@rolldown/binding-darwin-x64": "1.0.0-rc.12", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.12", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.12", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.12", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.12", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.12", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.12", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.12", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/aljabar-projek/package.json b/aljabar-projek/package.json new file mode 100644 index 0000000..4b007a7 --- /dev/null +++ b/aljabar-projek/package.json @@ -0,0 +1,34 @@ +{ + "name": "aljabar-projek", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "react": "^19.2.4", + "react-dom": "^19.2.4" + }, + "devDependencies": { + "@babel/core": "^7.29.0", + "@eslint/js": "^9.39.4", + "@rolldown/plugin-babel": "^0.2.1", + "@types/babel__core": "^7.20.5", + "@types/node": "^24.12.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "babel-plugin-react-compiler": "^1.0.0", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.57.0", + "vite": "^8.0.1" + } +} diff --git a/aljabar-projek/public/favicon.svg b/aljabar-projek/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/aljabar-projek/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/aljabar-projek/public/icons.svg b/aljabar-projek/public/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/aljabar-projek/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aljabar-projek/src/App.css b/aljabar-projek/src/App.css new file mode 100644 index 0000000..f90339d --- /dev/null +++ b/aljabar-projek/src/App.css @@ -0,0 +1,184 @@ +.counter { + font-size: 16px; + padding: 5px 10px; + border-radius: 5px; + color: var(--accent); + background: var(--accent-bg); + border: 2px solid transparent; + transition: border-color 0.3s; + margin-bottom: 24px; + + &:hover { + border-color: var(--accent-border); + } + &:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.hero { + position: relative; + + .base, + .framework, + .vite { + inset-inline: 0; + margin: 0 auto; + } + + .base { + width: 170px; + position: relative; + z-index: 0; + } + + .framework, + .vite { + position: absolute; + } + + .framework { + z-index: 1; + top: 34px; + height: 28px; + transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) + scale(1.4); + } + + .vite { + z-index: 0; + top: 107px; + height: 26px; + width: auto; + transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) + scale(0.8); + } +} + +#center { + display: flex; + flex-direction: column; + gap: 25px; + place-content: center; + place-items: center; + flex-grow: 1; + + @media (max-width: 1024px) { + padding: 32px 20px 24px; + gap: 18px; + } +} + +#next-steps { + display: flex; + border-top: 1px solid var(--border); + text-align: left; + + & > div { + flex: 1 1 0; + padding: 32px; + @media (max-width: 1024px) { + padding: 24px 20px; + } + } + + .icon { + margin-bottom: 16px; + width: 22px; + height: 22px; + } + + @media (max-width: 1024px) { + flex-direction: column; + text-align: center; + } +} + +#docs { + border-right: 1px solid var(--border); + + @media (max-width: 1024px) { + border-right: none; + border-bottom: 1px solid var(--border); + } +} + +#next-steps ul { + list-style: none; + padding: 0; + display: flex; + gap: 8px; + margin: 32px 0 0; + + .logo { + height: 18px; + } + + a { + color: var(--text-h); + font-size: 16px; + border-radius: 6px; + background: var(--social-bg); + display: flex; + padding: 6px 12px; + align-items: center; + gap: 8px; + text-decoration: none; + transition: box-shadow 0.3s; + + &:hover { + box-shadow: var(--shadow); + } + .button-icon { + height: 18px; + width: 18px; + } + } + + @media (max-width: 1024px) { + margin-top: 20px; + flex-wrap: wrap; + justify-content: center; + + li { + flex: 1 1 calc(50% - 8px); + } + + a { + width: 100%; + justify-content: center; + box-sizing: border-box; + } + } +} + +#spacer { + height: 88px; + border-top: 1px solid var(--border); + @media (max-width: 1024px) { + height: 48px; + } +} + +.ticks { + position: relative; + width: 100%; + + &::before, + &::after { + content: ''; + position: absolute; + top: -4.5px; + border: 5px solid transparent; + } + + &::before { + left: 0; + border-left-color: var(--border); + } + &::after { + right: 0; + border-right-color: var(--border); + } +} diff --git a/aljabar-projek/src/App.tsx b/aljabar-projek/src/App.tsx new file mode 100644 index 0000000..46a5992 --- /dev/null +++ b/aljabar-projek/src/App.tsx @@ -0,0 +1,121 @@ +import { useState } from 'react' +import reactLogo from './assets/react.svg' +import viteLogo from './assets/vite.svg' +import heroImg from './assets/hero.png' +import './App.css' + +function App() { + const [count, setCount] = useState(0) + + return ( + <> +
+
+ + React logo + Vite logo +
+
+

Get started

+

+ Edit src/App.tsx and save to test HMR +

+
+ +
+ +
+ +
+
+ +

Documentation

+

Your questions, answered

+ +
+
+ +

Connect with us

+

Join the Vite community

+ +
+
+ +
+
+ + ) +} + +export default App diff --git a/aljabar-projek/src/assets/hero.png b/aljabar-projek/src/assets/hero.png new file mode 100644 index 0000000..cc51a3d Binary files /dev/null and b/aljabar-projek/src/assets/hero.png differ diff --git a/aljabar-projek/src/assets/react.svg b/aljabar-projek/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/aljabar-projek/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/aljabar-projek/src/assets/vite.svg b/aljabar-projek/src/assets/vite.svg new file mode 100644 index 0000000..5101b67 --- /dev/null +++ b/aljabar-projek/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/aljabar-projek/src/index.css b/aljabar-projek/src/index.css new file mode 100644 index 0000000..5fb3313 --- /dev/null +++ b/aljabar-projek/src/index.css @@ -0,0 +1,111 @@ +:root { + --text: #6b6375; + --text-h: #08060d; + --bg: #fff; + --border: #e5e4e7; + --code-bg: #f4f3ec; + --accent: #aa3bff; + --accent-bg: rgba(170, 59, 255, 0.1); + --accent-border: rgba(170, 59, 255, 0.5); + --social-bg: rgba(244, 243, 236, 0.5); + --shadow: + rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px; + + --sans: system-ui, 'Segoe UI', Roboto, sans-serif; + --heading: system-ui, 'Segoe UI', Roboto, sans-serif; + --mono: ui-monospace, Consolas, monospace; + + font: 18px/145% var(--sans); + letter-spacing: 0.18px; + color-scheme: light dark; + color: var(--text); + background: var(--bg); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + @media (max-width: 1024px) { + font-size: 16px; + } +} + +@media (prefers-color-scheme: dark) { + :root { + --text: #9ca3af; + --text-h: #f3f4f6; + --bg: #16171d; + --border: #2e303a; + --code-bg: #1f2028; + --accent: #c084fc; + --accent-bg: rgba(192, 132, 252, 0.15); + --accent-border: rgba(192, 132, 252, 0.5); + --social-bg: rgba(47, 48, 58, 0.5); + --shadow: + rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px; + } + + #social .button-icon { + filter: invert(1) brightness(2); + } +} + +#root { + width: 1126px; + max-width: 100%; + margin: 0 auto; + text-align: center; + border-inline: 1px solid var(--border); + min-height: 100svh; + display: flex; + flex-direction: column; + box-sizing: border-box; +} + +body { + margin: 0; +} + +h1, +h2 { + font-family: var(--heading); + font-weight: 500; + color: var(--text-h); +} + +h1 { + font-size: 56px; + letter-spacing: -1.68px; + margin: 32px 0; + @media (max-width: 1024px) { + font-size: 36px; + margin: 20px 0; + } +} +h2 { + font-size: 24px; + line-height: 118%; + letter-spacing: -0.24px; + margin: 0 0 8px; + @media (max-width: 1024px) { + font-size: 20px; + } +} +p { + margin: 0; +} + +code, +.counter { + font-family: var(--mono); + display: inline-flex; + border-radius: 4px; + color: var(--text-h); +} + +code { + font-size: 15px; + line-height: 135%; + padding: 4px 8px; + background: var(--code-bg); +} diff --git a/aljabar-projek/src/main.tsx b/aljabar-projek/src/main.tsx new file mode 100644 index 0000000..bef5202 --- /dev/null +++ b/aljabar-projek/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.tsx' + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/aljabar-projek/tsconfig.app.json b/aljabar-projek/tsconfig.app.json new file mode 100644 index 0000000..af516fc --- /dev/null +++ b/aljabar-projek/tsconfig.app.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2023", + "useDefineForClassFields": true, + "lib": ["ES2023", "DOM", "DOM.Iterable"], + "module": "ESNext", + "types": ["vite/client"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/aljabar-projek/tsconfig.json b/aljabar-projek/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/aljabar-projek/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/aljabar-projek/tsconfig.node.json b/aljabar-projek/tsconfig.node.json new file mode 100644 index 0000000..8a67f62 --- /dev/null +++ b/aljabar-projek/tsconfig.node.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/aljabar-projek/vite.config.ts b/aljabar-projek/vite.config.ts new file mode 100644 index 0000000..d1203cd --- /dev/null +++ b/aljabar-projek/vite.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite' +import react, { reactCompilerPreset } from '@vitejs/plugin-react' +import babel from '@rolldown/plugin-babel' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + react(), + babel({ presets: [reactCompilerPreset()] }) + ], +}) diff --git a/frontend/aljabar.html b/frontend/aljabar.html index 782c214..c7cf4d8 100644 --- a/frontend/aljabar.html +++ b/frontend/aljabar.html @@ -17,7 +17,7 @@

Masukkan soal (contoh: (x+2)^2 atau x^2-9):

-

+

diff --git a/node_modules/algebrite/package.json b/node_modules/algebrite/package.json new file mode 100644 index 0000000..1957fd2 --- /dev/null +++ b/node_modules/algebrite/package.json @@ -0,0 +1,42 @@ +{ + "name": "algebrite", + "//": "also change the version in the Algebrite variable at the top of defs file", + "version": "1.4.0", + "description": "Computer Algebra System in Coffeescript", + "main": "dist/algebrite.js", + "directories": { + "test": "tests" + }, + "scripts": { + "microtest": "cat runtime/defs.coffee sources/*.coffee runtime/alloc.coffee runtime/find.coffee runtime/init.coffee runtime/mcmp.coffee runtime/otherCFunctions.coffee runtime/count.coffee runtime/run.coffee runtime/stack.coffee runtime/symbol.coffee runtime/zombocom.coffee runtime/freeze.coffee test-harness.coffee run-micro-tests.coffee | coffee -cs | node", + "test": "cat runtime/defs.coffee sources/*.coffee runtime/alloc.coffee runtime/find.coffee runtime/init.coffee runtime/mcmp.coffee runtime/otherCFunctions.coffee runtime/count.coffee runtime/run.coffee runtime/stack.coffee runtime/symbol.coffee runtime/zombocom.coffee runtime/freeze.coffee tests/*.coffee test-harness.coffee run-tests.coffee | coffee -cs | node", + "build": "cat runtime/defs.coffee sources/*.coffee runtime/alloc.coffee runtime/find.coffee runtime/init.coffee runtime/mcmp.coffee runtime/otherCFunctions.coffee runtime/count.coffee runtime/run.coffee runtime/stack.coffee runtime/symbol.coffee runtime/zombocom.coffee runtime/freeze.coffee | coffee -sc > dist/algebrite.js", + "build-for-browser": "cat runtime/defs.coffee sources/*.coffee runtime/alloc.coffee runtime/find.coffee runtime/init.coffee runtime/mcmp.coffee runtime/otherCFunctions.coffee runtime/count.coffee runtime/run.coffee runtime/stack.coffee runtime/symbol.coffee runtime/zombocom.coffee runtime/freeze.coffee | coffee -sc > dist/algebrite.js; browserify ./sources/mainForWebPage.js -o ./dist/algebrite.bundle-for-browser.js", + "//": "this one is useful to check things quickly in the sandbox. Use after build-for-browser.", + "browser-tests": "cat runtime/defs.coffee sources/*.coffee runtime/alloc.coffee runtime/find.coffee runtime/init.coffee runtime/mcmp.coffee runtime/otherCFunctions.coffee runtime/count.coffee runtime/run.coffee runtime/stack.coffee runtime/symbol.coffee runtime/zombocom.coffee runtime/freeze.coffee tests/*.coffee test-harness.coffee run-tests.coffee | coffee -sc > dist/algebrite.js; browserify ./sources/mainForWebPage.js -o ./dist/algebrite.bundle-for-browser.js", + "copy-to-sandbox": "[ -d \"../Algebrite-website/\" ] && cp ./dist/algebrite.bundle-for-browser.js ../Algebrite-website/dist/ || echo \"Error: Algebrite-website directory not found, check the path in the package.json file\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/davidedc/Algebrite.git" + }, + "keywords": [ + "cas", + "algebra", + "computer", + "algebra", + "system", + "eigenmath", + "math", + "symbolic" + ], + "author": "Davide Della Casa", + "license": "MIT", + "bugs": { + "url": "https://github.com/davidedc/Algebrite/issues" + }, + "homepage": "https://github.com/davidedc/Algebrite#readme", + "dependencies": { + "big-integer": "^1.6.32" + } +} diff --git a/node_modules/algebrite/run-micro-tests.coffee b/node_modules/algebrite/run-micro-tests.coffee new file mode 100644 index 0000000..4c2141e --- /dev/null +++ b/node_modules/algebrite/run-micro-tests.coffee @@ -0,0 +1,13 @@ + + +# quick and dirty way to run a few tests + +run_test [ + + "1+1", + "2", + +] + + +# alert "passed tests: " + ok_tests + " / failed tests: " + ko_tests diff --git a/node_modules/algebrite/run-tests.coffee b/node_modules/algebrite/run-tests.coffee new file mode 100644 index 0000000..4c88793 --- /dev/null +++ b/node_modules/algebrite/run-tests.coffee @@ -0,0 +1,130 @@ +# self test functions + +test_low_level = -> + run("clearall"); # to initialize stack and memory + + if exec("factor","(x^2-1)").toString() == "(x-1)*(x+1)" + console.log "exec text ok" + else + console.log "exec text failed" + + test_clearall() + test_inv() + test_printlatex() + test_mixedprint() + test_inner() + test_transpose() + test_signs_in_rationals() + test_madd() + test_msub() + test_mmul() + test_mdiv() + test_mmod() + test_mprime() + test_mgcd() + test_mpow() + test_mroot() + test_dependencies() + test_assignments() + test_strings() + test_test() + test_check() + +# use the window.selftest version +# for running the tests from the +# browser console ("run npm build-for-browser") +#window.selftest = -> +selftest = -> + test_low_level() + test_pattern() + test_abs() + test_sum() + test_product() + test_for() + test_exp() + test_expand() + test_factorpoly() + test_subst() + test_simplify() + + test_multiply() + test_scan() + test_power() + test_factor_number(); # long + test_tensor() + test_bake() + test_adj() + test_arg() + test_approxratio() + test_besselj() + test_bessely() + test_ceiling() + test_choose() + test_circexp() + test_clock() + test_cofactor() + test_condense() + test_contract() + test_defint(); # very long + test_denominator() + test_derivative() + test_dirac() + test_erf() + test_erfc() + test_expcos() + test_expsin() + test_float() + test_floor() + test_gamma() + test_gcd() + test_imag() + test_lcm() + test_log() + test_mod() + test_nroots() + test_numerator() + test_outer() + test_polar() + test_quotient() + test_rationalize() + test_real() + test_rect() + test_round() + test_sgn() + test_taylor() + test_zero() + test_hermite() + test_laguerre() + test_legendre() + test_binomial() + test_divisors() + test_coeff() + test_sin() + test_cos() + test_tan() + test_sinh() + test_cosh() + test_tanh() + test_arcsin() + test_arcsinh() + test_arccos() + test_arccosh() + test_arctan() + test_arctanh() + test_index() + test_isprime() + test_eigen() + test_shape() + mini_test() + test_quickfactor() + test_integral() + test_roots() + + + # alert "passed tests: " + ok_tests + " / failed tests: " + ko_tests + return + +# remove this selftest() +# for running the tests from the +# browser console ("run npm build-for-browser") +selftest() diff --git a/node_modules/algebrite/runtime/alloc.coffee b/node_modules/algebrite/runtime/alloc.coffee new file mode 100644 index 0000000..6701f3f --- /dev/null +++ b/node_modules/algebrite/runtime/alloc.coffee @@ -0,0 +1,194 @@ + + +### +// up to 100 blocks of 100,000 atoms + +#define M 100 +#define N 100000 + +U *mem[M] +int mcount + +U *free_list +int free_count + +U * +alloc(void) +{ + U *p + if (free_count == 0) { + if (mcount == 0) + alloc_mem() + else { + gc() + if (free_count < N * mcount / 2) + alloc_mem() + } + if (free_count == 0) + stop("atom space exhausted") + } + p = free_list + free_list = free_list->u.cons.cdr + free_count-- + return p +} +### + +allocatedId = 0 +alloc_tensor = (nelem) -> + i = 0 + p = new U() + p.k = TENSOR + p.tensor = new tensor() + + p.tensor.nelem = nelem + for i in [0...nelem] + p.tensor.elem[i] = zero + + p.tensor.allocatedId = allocatedId + #if allocatedId == 9 + # debugger + allocatedId++ + + check_tensor_dimensions p + + return p + +### +// garbage collector + +void +gc(void) +{ + int i, j + U *p + + // tag everything + + for (i = 0; i < mcount; i++) { + p = mem[i] + for (j = 0; j < N; j++) + p[j].tag = 1 + } + + // untag what's used + + untag(p0) + untag(p1) + untag(p2) + untag(p3) + untag(p4) + untag(p5) + untag(p6) + untag(p7) + untag(p8) + untag(p9) + + untag(one) + untag(zero) + untag(imaginaryunit) + + for (i = 0; i < NSYM; i++) { + untag(binding[i]) + untag(arglist[i]) + } + + for (i = 0; i < tos; i++) + untag(stack[i]) + + for (i = (int) (frame - stack); i < TOS; i++) + untag(stack[i]) + + // collect everything that's still tagged + + free_count = 0 + + for (i = 0; i < mcount; i++) { + p = mem[i] + for (j = 0; j < N; j++) { + if (p[j].tag == 0) + continue + // still tagged so it's unused, put on free list + switch (p[j].k) { + case TENSOR: + free(p[j].u.tensor) + break + case STR: + free(p[j].u.str) + break + case NUM: + mfree(p[j].u.q.a) + mfree(p[j].u.q.b) + break + } + p[j].k = CONS; // so no double free occurs above + p[j].u.cons.cdr = free_list + free_list = p + j + free_count++ + } + } +} + +void +untag(U *p) +{ + int i + + if (iscons(p)) { + do { + if (p->tag == 0) + return + p->tag = 0 + untag(p->u.cons.car) + p = p->u.cons.cdr + } while (iscons(p)) + untag(p) + return + } + + if (p->tag) { + p->tag = 0 + if (istensor(p)) { + for (i = 0; i < p->u.tensor->nelem; i++) + untag(p->u.tensor->elem[i]) + } + } +} + +// get memory for 100,000 atoms + +void +alloc_mem(void) +{ + int i + U *p + if (mcount == M) + return + p = (U *) malloc(N * sizeof (struct U)) + if (p == NULL) + return + mem[mcount++] = p + for (i = 0; i < N; i++) { + p[i].k = CONS; // so no free in gc + p[i].u.cons.cdr = p + i + 1 + } + p[N - 1].u.cons.cdr = free_list + free_list = p + free_count += N +} + +void +print_mem_info(void) +{ + char buf[100] + + sprintf(buf, "%d blocks (%d bytes/block)\n", N * mcount, (int) sizeof (U)) + printstr(buf) + + sprintf(buf, "%d free\n", free_count) + printstr(buf) + + sprintf(buf, "%d used\n", N * mcount - free_count) + printstr(buf) +} +### diff --git a/node_modules/algebrite/runtime/count.coffee b/node_modules/algebrite/runtime/count.coffee new file mode 100644 index 0000000..d51fff2 --- /dev/null +++ b/node_modules/algebrite/runtime/count.coffee @@ -0,0 +1,43 @@ +count = (p) -> + if (iscons(p)) + n = 0 + while (iscons(p)) + n += count(car(p)) + 1 + p = cdr(p) + else + n = 1 + return n + +# this probably works out to be +# more general than just counting symbols, it can +# probably count instances of anything you pass as +# first argument but didn't try it. +countOccurrencesOfSymbol = (needle,p) -> + n = 0 + if (iscons(p)) + while (iscons(p)) + n += countOccurrencesOfSymbol(needle,car(p)) + p = cdr(p) + else + if equal(needle,p) + n = 1 + return n + + +# returns the total number of elements +# in an expression +countsize = (p) -> + n = 0 + + if (istensor(p)) + for i in [0...p.tensor.nelem] + n += p.tensor.elem[i] + else if (iscons(p)) + while (iscons(p)) + n += count(car(p)) + 1 + p = cdr(p) + else + n = 1 + + return n + diff --git a/node_modules/algebrite/runtime/defs.coffee b/node_modules/algebrite/runtime/defs.coffee new file mode 100644 index 0000000..c8717f5 --- /dev/null +++ b/node_modules/algebrite/runtime/defs.coffee @@ -0,0 +1,630 @@ +bigInt = require('big-integer') + +# also change the version in the package.json file +version = "1.4.0" + +SELFTEST = 1 + + +# size of the symbol table +NSYM = 1000 + +DEBUG = false +PRINTOUTRESULT = false + +# printing-related constants +PRINTMODE_LATEX = "PRINTMODE_LATEX" +PRINTMODE_2DASCII = "PRINTMODE_2DASCII" +PRINTMODE_COMPUTER = "PRINTMODE_COMPUTER" +PRINTMODE_HUMAN = "PRINTMODE_HUMAN" +PRINTMODE_LIST = "PRINTMODE_LIST" + +# when the user uses the generic "print" statement +# this setting kicks-in. +printMode = PRINTMODE_COMPUTER + +dontCreateNewRadicalsInDenominatorWhenEvalingMultiplication = true +recursionLevelNestedRadicalsRemoval = 0 +do_simplify_nested_radicals = true +avoidCalculatingPowersIntoArctans = true + +# Symbolic expressions are built by connecting U structs. +# +# For example, (a b + c) is built like this: +# +# _______ _______ _______ +# |CONS |--->|CONS |----------------------------->|CONS | +# | | | | | | +# |_______| |_______| |_______| +# | | | +# ___v___ ___v___ _______ _______ ___v___ +# |ADD | |CONS |--->|CONS |--->|CONS | |SYM c | +# | | | | | | | | | | +# |_______| |_______| |_______| |_______| |_______| +# | | | +# ___v___ ___v___ ___v___ +# |MUL | |SYM a | |SYM b | +# | | | | | | +# |_______| |_______| |_______| + + + +class rational + a: null # a bigInteger + b: null # a bigInteger + +class U + cons: null # will have a car and cdr + printname: "" + str: "" + tensor: null + # rational number a over b + q: null # will point to a rational + d: 0.0 # a double + k: 0 + tag: 0 + + toString: -> print_expr(this) + toLatexString: -> collectLatexStringFromReturnValue(this) + + constructor: -> + @cons = {} + @cons.car = null + @cons.cdr = null + @q = new rational() + + +errorMessage = "" + + +# the following enum is for struct U, member k + +CONS = 0 +NUM = 1 +DOUBLE = 2 +STR = 3 +TENSOR = 4 +SYM = 5 + +# the following enum is for indexing the symbol table + +# standard functions first, then nil, then everything else + +counter = 0 +ABS = counter++ +ADD = counter++ +ADJ = counter++ +AND = counter++ +APPROXRATIO = counter++ +ARCCOS = counter++ +ARCCOSH = counter++ +ARCSIN = counter++ +ARCSINH = counter++ +ARCTAN = counter++ +ARCTANH = counter++ +ARG = counter++ +ATOMIZE = counter++ +BESSELJ = counter++ +BESSELY = counter++ +BINDING = counter++ +BINOMIAL = counter++ +CEILING = counter++ +CHECK = counter++ +CHOOSE = counter++ +CIRCEXP = counter++ +CLEAR = counter++ +CLEARALL = counter++ +CLEARPATTERNS = counter++ +CLOCK = counter++ +COEFF = counter++ +COFACTOR = counter++ +CONDENSE = counter++ +CONJ = counter++ +CONTRACT = counter++ +COS = counter++ +COSH = counter++ +DECOMP = counter++ +DEFINT = counter++ +DEGREE = counter++ +DENOMINATOR = counter++ +DERIVATIVE = counter++ +DET = counter++ +DIM = counter++ +DIRAC = counter++ +DIVISORS = counter++ +DO = counter++ +DOT = counter++ +DRAW = counter++ +DSOLVE = counter++ +EIGEN = counter++ +EIGENVAL = counter++ +EIGENVEC = counter++ +ERF = counter++ +ERFC = counter++ +EVAL = counter++ +EXP = counter++ +EXPAND = counter++ +EXPCOS = counter++ +EXPSIN = counter++ +FACTOR = counter++ +FACTORIAL = counter++ +FACTORPOLY = counter++ +FILTER = counter++ +FLOATF = counter++ +FLOOR = counter++ +FOR = counter++ +FUNCTION = counter++ +GAMMA = counter++ +GCD = counter++ +HERMITE = counter++ +HILBERT = counter++ +IMAG = counter++ +INDEX = counter++ +INNER = counter++ +INTEGRAL = counter++ +INV = counter++ +INVG = counter++ +ISINTEGER = counter++ +ISPRIME = counter++ +LAGUERRE = counter++ +# LAPLACE = counter++ +LCM = counter++ +LEADING = counter++ +LEGENDRE = counter++ +LOG = counter++ +LOOKUP = counter++ +MOD = counter++ +MULTIPLY = counter++ +NOT = counter++ +NROOTS = counter++ +NUMBER = counter++ +NUMERATOR = counter++ +OPERATOR = counter++ +OR = counter++ +OUTER = counter++ +PATTERN = counter++ +PATTERNSINFO = counter++ +POLAR = counter++ +POWER = counter++ +PRIME = counter++ +PRINT_LEAVE_E_ALONE = counter++ +PRINT_LEAVE_X_ALONE = counter++ +PRINT = counter++ +PRINT2DASCII = counter++ +PRINTFULL = counter++ +PRINTLATEX = counter++ +PRINTLIST = counter++ +PRINTPLAIN = counter++ +PRODUCT = counter++ +QUOTE = counter++ +QUOTIENT = counter++ +RANK = counter++ +RATIONALIZE = counter++ +REAL = counter++ +ROUND = counter++ +YYRECT = counter++ +ROOTS = counter++ +SETQ = counter++ +SGN = counter++ +SILENTPATTERN = counter++ +SIMPLIFY = counter++ +SIN = counter++ +SINH = counter++ +SHAPE = counter++ +SQRT = counter++ +STOP = counter++ +SUBST = counter++ +SUM = counter++ +SYMBOLSINFO = counter++ +TAN = counter++ +TANH = counter++ +TAYLOR = counter++ +TEST = counter++ +TESTEQ = counter++ +TESTGE = counter++ +TESTGT = counter++ +TESTLE = counter++ +TESTLT = counter++ +TRANSPOSE = counter++ +UNIT = counter++ +ZERO = counter++ + +# ALL THE SYMBOLS ABOVE NIL ARE KEYWORDS, +# WHICH MEANS THAT USER CANNOT REDEFINE THEM +NIL = counter++ # nil goes here, after standard functions +LAST = counter++ + +LAST_PRINT = counter++ +LAST_2DASCII_PRINT = counter++ +LAST_FULL_PRINT = counter++ +LAST_LATEX_PRINT = counter++ +LAST_LIST_PRINT = counter++ +LAST_PLAIN_PRINT = counter++ + +AUTOEXPAND = counter++ +BAKE = counter++ +ASSUME_REAL_VARIABLES = counter++ +TRACE = counter++ +FORCE_FIXED_PRINTOUT = counter++ +MAX_FIXED_PRINTOUT_DIGITS = counter++ + +YYE = counter++ + +DRAWX = counter++ # special purpose internal symbols +METAA = counter++ +METAB = counter++ +METAX = counter++ +SECRETX = counter++ + +VERSION = counter++ + +PI = counter++ +SYMBOL_A = counter++ +SYMBOL_B = counter++ +SYMBOL_C = counter++ +SYMBOL_D = counter++ +SYMBOL_I = counter++ +SYMBOL_J = counter++ +SYMBOL_N = counter++ +SYMBOL_R = counter++ +SYMBOL_S = counter++ +SYMBOL_T = counter++ +SYMBOL_X = counter++ +SYMBOL_Y = counter++ +SYMBOL_Z = counter++ +SYMBOL_IDENTITY_MATRIX = counter++ + +SYMBOL_A_UNDERSCORE = counter++ +SYMBOL_B_UNDERSCORE = counter++ +SYMBOL_X_UNDERSCORE = counter++ + +C1 = counter++ +C2 = counter++ +C3 = counter++ +C4 = counter++ +C5 = counter++ +C6 = counter++ + +USR_SYMBOLS = counter++ # this must be last + +E = YYE + +# TOS cannot be arbitrarily large because the OS seg faults on deep recursion. +# For example, a circular evaluation like x=x+1 can cause a seg fault. +# At this setting (100,000) the evaluation stack overruns before seg fault. + +TOS = 100000 + +BUF = 10000 + +MAX_PROGRAM_SIZE = 100001 +MAXPRIMETAB = 10000 +MAX_CONSECUTIVE_APPLICATIONS_OF_ALL_RULES = 5 +MAX_CONSECUTIVE_APPLICATIONS_OF_SINGLE_RULE = 10 + +#define _USE_MATH_DEFINES // for MS C++ + +MAXDIM = 24 + +# needed for the mechanism to +# find all dependencies between variables +# in a script +symbolsDependencies = {} +symbolsHavingReassignments = [] +symbolsInExpressionsWithoutAssignments = [] +patternHasBeenFound = false + +predefinedSymbolsInGlobalScope_doNotTrackInDependencies = [ + "rationalize" + "abs" + "e" + "i" + "pi" + "sin" + "ceiling" + "cos" + "roots" + "integral" + "derivative" + "defint" + "sqrt" + "eig" + "cov" + "deig" + "dcov" + "float" + "floor" + "product" + "root" + "round" + "sum" + "test" + "unit" +] + +# you can do some little simplifications +# at parse time, such as calculating away +# immediately simple operations on +# constants, removing 1s from products +# etc. +parse_time_simplifications = true + +chainOfUserSymbolsNotFunctionsBeingEvaluated = [] + +stringsEmittedByUserPrintouts = "" + +# flag use to potentially switch on/off some quirks "deep" +# in the code due to call from Algebra block. +# Currently not used. +called_from_Algebra_block = false + + +class tensor + ndim: 0 # number of dimensions + dim: null # dimension length, for each dimension + nelem: 0 # total number of elements + elem: null # an array containing all the data + + constructor: -> + @dim = (0 for [0..MAXDIM]) + @elem = [] + + +class display + h: 0 + w: 0 + n: 0 + a: [] # will contain an array of c,x,y (color,x,y) + + +class text_metric + ascent: 0 + descent: 0 + width: 0 + + +tos = 0 # top of stack +expanding = 0 +evaluatingAsFloats = 0 +evaluatingPolar = 0 +fmt_x = 0 +fmt_index = 0 +fmt_level = 0 +verbosing = 0 + + + +primetab = do -> + primes = [2] + i = 3 + while primes.length < MAXPRIMETAB + j = 0 + ceil = Math.sqrt(i) + while j < primes.length and primes[j] <= ceil + if i % primes[j] == 0 + j = -1 + break + j++ + if j != -1 + primes.push(i) + i += 2 + primes[MAXPRIMETAB] = 0 + return primes + + + +esc_flag = 0 +draw_flag = 0 +mtotal = 0 +trigmode = 0 +logbuf = "" +program_buf = "" + +# will contain the variable names +symtab = [] +# will contain the contents of the variable +# in the corresponding position in symtab array +binding = [] +isSymbolReclaimable = [] + +arglist = [] # will contain U +stack = [] # will contain *U +frame = 0 +p0 = null # will contain U +p1 = null # will contain U +p2 = null # will contain U +p3 = null # will contain U +p4 = null # will contain U +p5 = null # will contain U +p6 = null # will contain U +p7 = null # will contain U +p8 = null # will contain U +p9 = null # will contain U + +zero = null # will contain U +one = null # will contain U +one_as_double = null +imaginaryunit = null # will contain U + +out_buf = "" +out_count = 0 +test_flag = 0 +codeGen = false +draw_stop_return = null # extern jmp_buf ????? +userSimplificationsInListForm = [] +userSimplificationsInStringForm = [] + +transpose_unicode = 7488 +dotprod_unicode = 183 + +symbol = (x) -> (symtab[x]) +iscons = (p) -> (p.k == CONS) +isrational = (p) -> (p.k == NUM) +isdouble = (p) -> (p.k == DOUBLE) +isNumericAtom = (p) -> (isrational(p) || isdouble(p)) +isstr = (p) -> (p.k == STR) +istensor = (p) -> (if !p? then debugger else p.k == TENSOR) + + +# because of recursion, we consider a scalar to be +# a tensor, so a numeric scalar will return true +isNumericAtomOrTensor = (p) -> + if isNumericAtom(p) or p == symbol(SYMBOL_IDENTITY_MATRIX) + return 1 + + if !istensor(p) and !isNumericAtom(p) + #console.log "p not an atom nor a tensor: " + p + return 0 + + n = p.tensor.nelem + a = p.tensor.elem + + for i in [0...n] + if !isNumericAtomOrTensor(a[i]) + #console.log "non-numeric element: " + a[i] + return 0 + return 1 + +issymbol = (p) -> (p.k == SYM) +iskeyword = (p) -> (issymbol(p) && symnum(p) < NIL) + +car = (p) -> if iscons(p) then p.cons.car else symbol(NIL) +cdr = (p) -> if iscons(p) then p.cons.cdr else symbol(NIL) +caar = (p) -> car(car(p)) +cadr = (p) -> car(cdr(p)) +cdar = (p) -> cdr(car(p)) +cddr = (p) -> cdr(cdr(p)) +caadr = (p) -> car(car(cdr(p))) +caddr = (p) -> car(cdr(cdr(p))) +cadar = (p) -> car(cdr(car(p))) +cdadr = (p) -> cdr(car(cdr(p))) +cddar = (p) -> cdr(cdr(car(p))) +cdddr = (p) -> cdr(cdr(cdr(p))) +caaddr = (p) -> car(car(cdr(cdr(p)))) +cadadr = (p) -> car(cdr(car(cdr(p)))) +caddar = (p) -> car(cdr(cdr(car(p)))) +cdaddr = (p) -> cdr(car(cdr(cdr(p)))) +cadddr = (p) -> car(cdr(cdr(cdr(p)))) +cddddr = (p) -> cdr(cdr(cdr(cdr(p)))) +caddddr = (p) -> car(cdr(cdr(cdr(cdr(p))))) +cadaddr = (p) -> car(cdr(car(cdr(cdr(p))))) +cddaddr = (p) -> cdr(cdr(car(cdr(cdr(p))))) +caddadr = (p) -> car(cdr(cdr(car(cdr(p))))) +cdddaddr = (p) -> cdr(cdr(cdr(car(cdr(cdr(p)))))) +caddaddr = (p) -> car(cdr(cdr(car(cdr(cdr(p)))))) + +# not used yet +listLength = (p) -> + startCount = -1 + + while iscons(p) + p = cdr(p) + startCount++ + + return startCount + +# not used yet +nthCadr = (p,n) -> + startCount = 0 + + while startCount <= n + p = cdr(p) + startCount++ + + return car(p) + +isadd = (p) -> (car(p) == symbol(ADD)) +ismultiply = (p) -> (car(p) == symbol(MULTIPLY)) +ispower = (p) -> (car(p) == symbol(POWER)) +isfactorial = (p) -> (car(p) == symbol(FACTORIAL)) +isinnerordot = (p) -> ((car(p) == symbol(INNER)) or (car(p) == symbol(DOT))) +istranspose = (p) -> (car(p) == symbol(TRANSPOSE)) +isinv = (p) -> (car(p) == symbol(INV)) +# TODO this is a bit of a shallow check, we should +# check when we are passed an actual tensor and possibly +# cache the test result. +isidentitymatrix = (p) -> (p == symbol(SYMBOL_IDENTITY_MATRIX)) + +MSIGN = (p) -> + if p.isPositive() + return 1 + else if p.isZero() + return 0 + else + return -1 + +MLENGTH = (p) -> p.toString().length + +MZERO = (p) -> p.isZero() +MEQUAL = (p, n) -> + if !p? + debugger + p.equals(n) + + +reset_after_error = -> + moveTos 0 + esc_flag = 0 + draw_flag = 0 + frame = TOS + evaluatingAsFloats = 0 + evaluatingPolar = 0 + + +$ = (exports ? this) + +$.version = version + +$.isadd = isadd +$.ismultiply = ismultiply +$.ispower = ispower +$.isfactorial = isfactorial + + + +$.car = car +$.cdr = cdr +$.caar = caar +$.cadr = cadr +$.cdar = cdar +$.cddr = cddr +$.caadr = caadr +$.caddr = caddr +$.cadar = cadar +$.cdadr = cdadr +$.cddar = cddar +$.cdddr = cdddr +$.caaddr = caaddr +$.cadadr = cadadr +$.caddar = caddar +$.cdaddr = cdaddr +$.cadddr = cadddr +$.cddddr = cddddr +$.caddddr = caddddr +$.cadaddr = cadaddr +$.cddaddr = cddaddr +$.caddadr = caddadr +$.cdddaddr = cdddaddr +$.caddaddr = caddaddr + + + +$.symbol = symbol +$.iscons = iscons +$.isrational = isrational +$.isdouble = isdouble +$.isNumericAtom = isNumericAtom +$.isstr = isstr +$.istensor = istensor +$.issymbol = issymbol +$.iskeyword = iskeyword + + + + +$.CONS = CONS +$.NUM = NUM +$.DOUBLE = DOUBLE +$.STR = STR +$.TENSOR = TENSOR +$.SYM = SYM diff --git a/node_modules/algebrite/runtime/find.coffee b/node_modules/algebrite/runtime/find.coffee new file mode 100644 index 0000000..d4c950c --- /dev/null +++ b/node_modules/algebrite/runtime/find.coffee @@ -0,0 +1,76 @@ +# returns 1 if expr p contains expr q, otherweise returns 0 + + + +Find = (p, q) -> + + i = 0 + if (equal(p, q)) + return 1 + + if (istensor(p)) + for i in [0...p.tensor.nelem] + if (Find(p.tensor.elem[i], q)) + return 1 + return 0 + + while (iscons(p)) + if (Find(car(p), q)) + return 1 + p = cdr(p) + + return 0 + +# find stuff like (-1)^(something (but disregard +# imaginary units which are in the form (-1)^(1/2)) +findPossibleClockForm = (p) -> + + i = 0 + + if isimaginaryunit(p) + return 0 + + if (car(p) == symbol(POWER) and !isinteger(caddr(p1))) + if Find(cadr(p), imaginaryunit) + #console.log "found i^fraction " + p + return 1 + + if (car(p) == symbol(POWER) && equaln(cadr(p), -1) && !isinteger(caddr(p1))) + #console.log "found -1^fraction in " + p + return 1 + + if (istensor(p)) + for i in [0...p.tensor.nelem] + if (findPossibleClockForm(p.tensor.elem[i])) + return 1 + return 0 + + while (iscons(p)) + if (findPossibleClockForm(car(p))) + return 1 + p = cdr(p) + + return 0 + +# find stuff like (e)^(i something) +findPossibleExponentialForm = (p) -> + + i = 0 + + if car(p) == symbol(POWER) && cadr(p)== symbol(E) + return Find(caddr(p),imaginaryunit) + + if (istensor(p)) + for i in [0...p.tensor.nelem] + if (findPossibleExponentialForm(p.tensor.elem[i])) + return 1 + return 0 + + while (iscons(p)) + if (findPossibleExponentialForm(car(p))) + return 1 + p = cdr(p) + + return 0 + +$.Find = Find \ No newline at end of file diff --git a/node_modules/algebrite/runtime/freeze.coffee b/node_modules/algebrite/runtime/freeze.coffee new file mode 100644 index 0000000..dfe3fc4 --- /dev/null +++ b/node_modules/algebrite/runtime/freeze.coffee @@ -0,0 +1,65 @@ + +freeze = -> + + frozenSymbols = [] + frozenContents = [] + frozenPatterns = [] + frozenHash = "" + + for i in [0...symtab.length] + #if symtab[i].printname == "" + # if isSymbolReclaimable[i] == false + # break + # else + # continue + if isSymbolReclaimable[i] == false + frozenSymbols.push symtab[i] + frozenContents.push binding[i] + + # just clone them + frozenPatterns= userSimplificationsInListForm.slice(0) + + return [frozenSymbols, frozenContents, frozenPatterns, zero, one, imaginaryunit, getStateHash()] + +unfreeze = (frozen) -> + [frozenSymbols, frozenContents, frozenPatterns, zero, one, imaginaryunit ] = frozen + + #clear_symbols() + + for i in [0...frozenSymbols.length] + symtab[i] = frozenSymbols[i] + binding[i] = frozenContents[i] + + userSimplificationsInListForm = frozenPatterns.slice(0) + + +compareState = (previousHash) -> + + frozenHash = getStateHash() + + if frozenHash == previousHash + return true + else + return false + +getStateHash = -> + frozenHash = "" + + for i in [NIL+1...symtab.length] + if symtab[i].printname == "" + if isSymbolReclaimable[i] == false + break + else + continue + + symtabi = print_list(symtab[i]) + bindingi = print_list(binding[i]) + + frozenHash += " //" + symtabi + " : " + bindingi + + for i in userSimplificationsInListForm + frozenHash += " pattern: " + i + + + if DEBUG then console.log "frozenHash: " + frozenHash + return frozenHash diff --git a/node_modules/algebrite/runtime/init.coffee b/node_modules/algebrite/runtime/init.coffee new file mode 100644 index 0000000..63f4ef1 --- /dev/null +++ b/node_modules/algebrite/runtime/init.coffee @@ -0,0 +1,334 @@ + + +init = -> + #debugger + #console.log "DOING AN INIT ========================================================================" + i = 0 + flag = 0 + + reset_after_error() + chainOfUserSymbolsNotFunctionsBeingEvaluated = [] + + if (flag) + return # already initted + + flag = 1 + + + # total clearout of symbol table + for i in [0...NSYM] + symtab[i] = new U() + symtab[i].k = SYM + binding[i] = symtab[i] + isSymbolReclaimable[i] = false + + defn() + +### cross ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept, script_defined + +Parameters +---------- +u,v + +General description +------------------- +Returns the cross product of vectors u and v. + +### + +### curl ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept, script_defined + +Parameters +---------- +u + +General description +------------------- +Returns the curl of vector u. + +### + +defn_str = [ + "version=\"" + version + "\"", + "e=exp(1)", + "i=sqrt(-1)", + "autoexpand=1", + "assumeRealVariables=1", + "trange=[-pi,pi]", + "xrange=[-10,10]", + "yrange=[-10,10]", + "last=0", + "trace=0", + "forceFixedPrintout=1", + "maxFixedPrintoutDigits=6", + "printLeaveEAlone=1", + "printLeaveXAlone=0", + # cross definition + "cross(u,v)=[u[2]*v[3]-u[3]*v[2],u[3]*v[1]-u[1]*v[3],u[1]*v[2]-u[2]*v[1]]", + # curl definition + "curl(v)=[d(v[3],y)-d(v[2],z),d(v[1],z)-d(v[3],x),d(v[2],x)-d(v[1],y)]", + # div definition + "div(v)=d(v[1],x)+d(v[2],y)+d(v[3],z)", + # Note that we use the mathematics / Javascript / Mathematica + # convention that "log" is indeed the natural logarithm. + # + # In engineering, biology, astronomy, "log" can stand instead + # for the "common" logarithm i.e. base 10. Also note that Google + # calculations use log for the common logarithm. + "ln(x)=log(x)", +] + +defn = -> + p0 = symbol(NIL) + p1 = symbol(NIL) + p2 = symbol(NIL) + p3 = symbol(NIL) + p4 = symbol(NIL) + p5 = symbol(NIL) + p6 = symbol(NIL) + p7 = symbol(NIL) + p8 = symbol(NIL) + p9 = symbol(NIL) + + std_symbol("abs", ABS) + std_symbol("add", ADD) + std_symbol("adj", ADJ) + std_symbol("and", AND) + std_symbol("approxratio", APPROXRATIO) + std_symbol("arccos", ARCCOS) + std_symbol("arccosh", ARCCOSH) + std_symbol("arcsin", ARCSIN) + std_symbol("arcsinh", ARCSINH) + std_symbol("arctan", ARCTAN) + std_symbol("arctanh", ARCTANH) + std_symbol("arg", ARG) + std_symbol("atomize", ATOMIZE) + std_symbol("besselj", BESSELJ) + std_symbol("bessely", BESSELY) + std_symbol("binding", BINDING) + std_symbol("binomial", BINOMIAL) + std_symbol("ceiling", CEILING) + std_symbol("check", CHECK) + std_symbol("choose", CHOOSE) + std_symbol("circexp", CIRCEXP) + std_symbol("clear", CLEAR) + std_symbol("clearall", CLEARALL) + std_symbol("clearpatterns", CLEARPATTERNS) + std_symbol("clock", CLOCK) + std_symbol("coeff", COEFF) + std_symbol("cofactor", COFACTOR) + std_symbol("condense", CONDENSE) + std_symbol("conj", CONJ) + std_symbol("contract", CONTRACT) + std_symbol("cos", COS) + std_symbol("cosh", COSH) + std_symbol("decomp", DECOMP) + std_symbol("defint", DEFINT) + std_symbol("deg", DEGREE) + std_symbol("denominator", DENOMINATOR) + std_symbol("det", DET) + std_symbol("derivative", DERIVATIVE) + std_symbol("dim", DIM) + std_symbol("dirac", DIRAC) + std_symbol("divisors", DIVISORS) + std_symbol("do", DO) + std_symbol("dot", DOT) + std_symbol("draw", DRAW) + std_symbol("dsolve", DSOLVE) + std_symbol("erf", ERF) + std_symbol("erfc", ERFC) + std_symbol("eigen", EIGEN) + std_symbol("eigenval", EIGENVAL) + std_symbol("eigenvec", EIGENVEC) + std_symbol("eval", EVAL) + std_symbol("exp", EXP) + std_symbol("expand", EXPAND) + std_symbol("expcos", EXPCOS) + std_symbol("expsin", EXPSIN) + std_symbol("factor", FACTOR) + std_symbol("factorial", FACTORIAL) + std_symbol("factorpoly", FACTORPOLY) + std_symbol("filter", FILTER) + std_symbol("float", FLOATF) + std_symbol("floor", FLOOR) + std_symbol("for", FOR) + std_symbol("function", FUNCTION) + std_symbol("Gamma", GAMMA) + std_symbol("gcd", GCD) + std_symbol("hermite", HERMITE) + std_symbol("hilbert", HILBERT) + std_symbol("imag", IMAG) + std_symbol("component", INDEX) + std_symbol("inner", INNER) + std_symbol("integral", INTEGRAL) + std_symbol("inv", INV) + std_symbol("invg", INVG) + std_symbol("isinteger", ISINTEGER) + std_symbol("isprime", ISPRIME) + std_symbol("laguerre", LAGUERRE) + # std_symbol("laplace", LAPLACE) + std_symbol("lcm", LCM) + std_symbol("leading", LEADING) + std_symbol("legendre", LEGENDRE) + std_symbol("log", LOG) + std_symbol("lookup", LOOKUP) + std_symbol("mod", MOD) + std_symbol("multiply", MULTIPLY) + std_symbol("not", NOT) + std_symbol("nroots", NROOTS) + std_symbol("number", NUMBER) + std_symbol("numerator", NUMERATOR) + std_symbol("operator", OPERATOR) + std_symbol("or", OR) + std_symbol("outer", OUTER) + std_symbol("pattern", PATTERN) + std_symbol("patternsinfo", PATTERNSINFO) + std_symbol("polar", POLAR) + std_symbol("power", POWER) + std_symbol("prime", PRIME) + std_symbol("print", PRINT) + std_symbol("print2dascii", PRINT2DASCII) + std_symbol("printcomputer", PRINTFULL) + std_symbol("printlatex", PRINTLATEX) + std_symbol("printlist", PRINTLIST) + std_symbol("printhuman", PRINTPLAIN) + std_symbol("printLeaveEAlone", PRINT_LEAVE_E_ALONE) + std_symbol("printLeaveXAlone", PRINT_LEAVE_X_ALONE) + std_symbol("product", PRODUCT) + std_symbol("quote", QUOTE) + std_symbol("quotient", QUOTIENT) + std_symbol("rank", RANK) + std_symbol("rationalize", RATIONALIZE) + std_symbol("real", REAL) + std_symbol("rect", YYRECT) + std_symbol("roots", ROOTS) + std_symbol("round", ROUND) + std_symbol("equals", SETQ) + std_symbol("sgn", SGN) + std_symbol("silentpattern", SILENTPATTERN) + std_symbol("simplify", SIMPLIFY) + std_symbol("sin", SIN) + std_symbol("sinh", SINH) + std_symbol("shape", SHAPE) + std_symbol("sqrt", SQRT) + std_symbol("stop", STOP) + std_symbol("subst", SUBST) + std_symbol("sum", SUM) + std_symbol("symbolsinfo", SYMBOLSINFO) + std_symbol("tan", TAN) + std_symbol("tanh", TANH) + std_symbol("taylor", TAYLOR) + std_symbol("test", TEST) + std_symbol("testeq", TESTEQ) + std_symbol("testge", TESTGE) + std_symbol("testgt", TESTGT) + std_symbol("testle", TESTLE) + std_symbol("testlt", TESTLT) + std_symbol("transpose", TRANSPOSE) + std_symbol("unit", UNIT) + std_symbol("zero", ZERO) + + std_symbol("nil", NIL) + + std_symbol("autoexpand", AUTOEXPAND) + std_symbol("bake", BAKE) + std_symbol("assumeRealVariables", ASSUME_REAL_VARIABLES) + + + std_symbol("last", LAST) + + std_symbol("lastprint", LAST_PRINT) + std_symbol("last2dasciiprint", LAST_2DASCII_PRINT) + std_symbol("lastfullprint", LAST_FULL_PRINT) + std_symbol("lastlatexprint", LAST_LATEX_PRINT) + std_symbol("lastlistprint", LAST_LIST_PRINT) + std_symbol("lastplainprint", LAST_PLAIN_PRINT) + + std_symbol("trace", TRACE) + + std_symbol("forceFixedPrintout", FORCE_FIXED_PRINTOUT) + std_symbol("maxFixedPrintoutDigits", MAX_FIXED_PRINTOUT_DIGITS) + + std_symbol("~", YYE) # tilde so sort puts it after other symbols + + std_symbol("$DRAWX", DRAWX) # special purpose internal symbols + std_symbol("$METAA", METAA) + std_symbol("$METAB", METAB) + std_symbol("$METAX", METAX) + std_symbol("$SECRETX", SECRETX) + + std_symbol("version", VERSION) + + std_symbol("pi", PI) + std_symbol("a", SYMBOL_A) + std_symbol("b", SYMBOL_B) + std_symbol("c", SYMBOL_C) + std_symbol("d", SYMBOL_D) + std_symbol("i", SYMBOL_I) + std_symbol("j", SYMBOL_J) + std_symbol("n", SYMBOL_N) + std_symbol("r", SYMBOL_R) + std_symbol("s", SYMBOL_S) + std_symbol("t", SYMBOL_T) + std_symbol("x", SYMBOL_X) + std_symbol("y", SYMBOL_Y) + std_symbol("z", SYMBOL_Z) + std_symbol("I", SYMBOL_IDENTITY_MATRIX) + + std_symbol("a_", SYMBOL_A_UNDERSCORE) + std_symbol("b_", SYMBOL_B_UNDERSCORE) + std_symbol("x_", SYMBOL_X_UNDERSCORE) + + std_symbol("$C1", C1) + std_symbol("$C2", C2) + std_symbol("$C3", C3) + std_symbol("$C4", C4) + std_symbol("$C5", C5) + std_symbol("$C6", C6) + + defineSomeHandyConstants() + + + # don't add all these functions to the + # symbolsDependencies, clone the original + originalCodeGen = codeGen + codeGen = false + + for defn_i in [0...defn_str.length] + definitionOfInterest = defn_str[defn_i] + scan(definitionOfInterest) + if DEBUG + console.log "... evaling " + definitionOfInterest + console.log("top of stack:") + console.log print_list(stack[tos-1]) + Eval() + pop() + + # restore the symbol dependencies as they were before. + codeGen = originalCodeGen + +defineSomeHandyConstants = -> + zero = new_integer 0 + one = new_integer 1 + + push_double(1.0) + one_as_double = pop() + + # i is the square root of -1 i.e. -1 ^ 1/2 + push_symbol(POWER) + if DEBUG then console.log print_list(stack[tos-1]) + push_integer(-1) + if DEBUG then console.log print_list(stack[tos-1]) + push_rational(1, 2) + if DEBUG then console.log print_list(stack[tos-1]) + list(3) + if DEBUG then console.log print_list(stack[tos-1]) + imaginaryunit = pop() # must be untagged in gc diff --git a/node_modules/algebrite/runtime/mcmp.coffee b/node_modules/algebrite/runtime/mcmp.coffee new file mode 100644 index 0000000..8a49619 --- /dev/null +++ b/node_modules/algebrite/runtime/mcmp.coffee @@ -0,0 +1,21 @@ +# Bignum compare +# +# returns +# +# -1 a < b +# +# 0 a = b +# +# 1 a > b + + + +mcmp = (a,b) -> + return a.compare b + +# a is a bigint, n is a normal int +mcmpint = (a,n) -> + b = bigInt(n) + t = mcmp(a, b) + return t + diff --git a/node_modules/algebrite/runtime/otherCFunctions.coffee b/node_modules/algebrite/runtime/otherCFunctions.coffee new file mode 100644 index 0000000..f1b1d4f --- /dev/null +++ b/node_modules/algebrite/runtime/otherCFunctions.coffee @@ -0,0 +1,93 @@ + +strcmp = (str1, str2) -> + if str1 == str2 then 0 else if str1 > str2 then 1 else -1 + + +doubleToReasonableString = (d) -> + + # when generating code, print out + # the standard JS Number printout + if codeGen + return "" + d + + + if (isZeroAtomOrTensor(get_binding(symbol(FORCE_FIXED_PRINTOUT)))) + stringRepresentation = "" + d + # manipulate the string so that it can be parsed by + # Algebrite (something like 1.23e-123 wouldn't cut it because + # that would be parsed as 1.23*e - 123) + + if printMode == PRINTMODE_LATEX + # 1.0\mathrm{e}{-10} looks much better than the plain 1.0e-10 + if /\d*\.\d*e.*/gm.test(stringRepresentation) + stringRepresentation = stringRepresentation.replace(/e(.*)/gm, "\\mathrm{e}{$1}"); + else + # if there is no dot in the mantissa, add it so we see it's + # a double and not a perfect number + # e.g. 1e-10 becomes 1.0\mathrm{e}{-10} + stringRepresentation = stringRepresentation.replace(/(\d+)e(.*)/gm, "$1.0\\mathrm{e}{$2}"); + else + if /\d*\.\d*e.*/gm.test(stringRepresentation) + stringRepresentation = stringRepresentation.replace(/e(.*)/gm, "*10^($1)"); + else + # if there is no dot in the mantissa, add it so we see it's + # a double and not a perfect number + # e.g. 1e-10 becomes 1.0e-10 + stringRepresentation = stringRepresentation.replace(/(\d+)e(.*)/gm, "$1.0*10^($2)"); + + else + push(get_binding(symbol(MAX_FIXED_PRINTOUT_DIGITS))) + maxFixedPrintoutDigits = pop_integer() + #console.log "maxFixedPrintoutDigits: " + maxFixedPrintoutDigits + #console.log "type: " + typeof(maxFixedPrintoutDigits) + #console.log "toFixed: " + d.toFixed(maxFixedPrintoutDigits) + + stringRepresentation = "" + d.toFixed(maxFixedPrintoutDigits) + + # remove any trailing zeroes after the dot + # see https://stackoverflow.com/questions/26299160/using-regex-how-do-i-remove-the-trailing-zeros-from-a-decimal-number + stringRepresentation = stringRepresentation.replace(/(\.\d*?[1-9])0+$/gm, "$1") + # in case there are only zeroes after the dot, removes the dot too + stringRepresentation = stringRepresentation.replace(/\.0+$/gm, "") + + # we actually want to give a hint to user that + # it's a double, so add a trailing ".0" if there + # is no decimal point + if stringRepresentation.indexOf(".") == -1 + stringRepresentation += ".0" + + if parseFloat(stringRepresentation) != d + stringRepresentation = d.toFixed(maxFixedPrintoutDigits) + "..." + + + return stringRepresentation + +# does nothing +clear_term = -> + +# s is a string here anyways +isspace = (s) -> + if !s? then return false + return s == ' ' or s == '\t' or s == '\n' or s == '\v' or s == '\f' or s == '\r' + +isdigit = (str) -> + if !str? then return false + return /^\d+$/.test(str) + +isalpha = (str) -> + if !str? then return false + #Check for non-alphabetic characters and space + return (str.search(/[^A-Za-z]/) == -1) + +isalphaOrUnderscore = (str) -> + if !str? then return false + #Check for non-alphabetic characters and space + return (str.search(/[^A-Za-z_]/) == -1) + +isunderscore = (str) -> + if !str? then return false + return (str.search(/_/) == -1) + +isalnumorunderscore = (str) -> + if !str? then return false + return (isalphaOrUnderscore(str) or isdigit(str)) diff --git a/node_modules/algebrite/runtime/run.coffee b/node_modules/algebrite/runtime/run.coffee new file mode 100644 index 0000000..5cf939b --- /dev/null +++ b/node_modules/algebrite/runtime/run.coffee @@ -0,0 +1,795 @@ + + +#jmp_buf stop_return, draw_stop_return + +# s is a string here +stop = (s) -> + #if (draw_flag == 2) + # longjmp(draw_stop_return, 1) + #else + errorMessage += "Stop: " + errorMessage += s + #debugger + message = errorMessage + + errorMessage = '' + moveTos 0 + + throw new Error(message) + + #longjmp(stop_return, 1) + +# Figuring out dependencies is key to automatically +# generating a method signature when generating JS code +# from algebrite scripts. +# This is important because the user can keep using normal Algebrite +# scripting without special notations. +# Basically the process consists of figuring out +# the "ground variables" that are needed to compute each variable. +# Now there are two ways of doing this: +# * at parse time +# * after running the scripts +# Doing it at parse time means that we can't track simplifications +# canceling-out some variables for example. But on the other side +# it's very quick and the user can somehow see what the signature is +# going to look like (assuming tha code is rather simple), or anyways +# is going to easily make sense of the generated signature. +# Doing it after execution on the other hand would allow us to see +# if some variable cancel-out. But if variables cancel out then +# they might do so according to some run-time behaviour that the user +# might struggle to keep track of. +# So the effort for the user to make sense of the signature in the first case +# is similar to the effort of keeping tab of types in a typed language. +# While in the second case the effort is similar to running the +# code and simplifications in her head. +# +# If we just want to compute the dependencies, we don't need to do +# anything costly, we don't "run" the code and we don't simplify +# the code. Just finding the plain dependencies +# TODO change the name of this function, as it doesn't just find the +# dependencies. It also runs it and generates the JS code. +findDependenciesInScript = (stringToBeParsed, dontGenerateCode) -> + + if DEBUG then console.log "stringToBeParsed: " + stringToBeParsed + + timeStartFromAlgebra = new Date().getTime() + + inited = true + codeGen = true + symbolsDependencies = {} + symbolsHavingReassignments = [] + symbolsInExpressionsWithoutAssignments = [] + patternHasBeenFound = false + indexOfPartRemainingToBeParsed = 0 + + allReturnedPlainStrings = "" + allReturnedLatexStrings = "" + + n = 0 + + # we are going to store the dependencies _of the block as a whole_ + # so all affected variables in the whole block are lumped + # together, and same for the variable that affect those, we + # lump them all together. + dependencyInfo = + affectsVariables: [] + affectedBy: [] + + + stringToBeRun = stringToBeParsed + + + # parse the input. This collects the + # dependency information + while (1) + try + errorMessage = "" + check_stack() + if DEBUG then console.log "findDependenciesInScript: scanning" + n = scan(stringToBeParsed.substring(indexOfPartRemainingToBeParsed)) + if DEBUG then console.log "scanned" + pop() + check_stack() + catch error + if PRINTOUTRESULT then console.log error + errorMessage = error + "" + #debugger + reset_after_error() + break + + if (n == 0) + break + + indexOfPartRemainingToBeParsed += n + + testableString = "" + + # print out all local dependencies as collected by this + # parsing pass + if DEBUG then console.log "all local dependencies ----------------" + testableString += "All local dependencies: " + for key, value of symbolsDependencies + if DEBUG then console.log "variable " + key + " depends on: " + dependencyInfo.affectsVariables.push key + testableString += " variable " + key + " depends on: " + for i in value + if DEBUG then console.log " " + i + if i[0] != "'" + dependencyInfo.affectedBy.push i + testableString += i + ", " + testableString += "; " + testableString += ". " + + # print out the symbols with re-assignments: + if DEBUG then console.log "Symbols with reassignments ----------------" + testableString += "Symbols with reassignments: " + for key in symbolsHavingReassignments + if dependencyInfo.affectedBy.indexOf(key) == -1 + dependencyInfo.affectedBy.push key + testableString += key + ", " + testableString += ". " + + # print out the symbols that appear in expressions without assignments + if DEBUG then console.log "Symbols in expressions without assignments ----------------" + testableString += "Symbols in expressions without assignments: " + for key in symbolsInExpressionsWithoutAssignments + if dependencyInfo.affectedBy.indexOf(key) == -1 + dependencyInfo.affectedBy.push key + testableString += key + ", " + testableString += ". " + + # ALL Algebrite code is affected by any pattern changing + dependencyInfo.affectedBy.push "PATTERN_DEPENDENCY" + + if patternHasBeenFound + dependencyInfo.affectsVariables.push "PATTERN_DEPENDENCY" + testableString += " - PATTERN_DEPENDENCY inserted - " + + # print out all global dependencies as collected by this + # parsing pass + if DEBUG then console.log "All dependencies recursively ----------------" + testableString += "All dependencies recursively: " + + scriptEvaluation = ["",""] + generatedCode = "" + readableSummaryOfGeneratedCode = "" + + if errorMessage == "" and !dontGenerateCode + + try + allReturnedPlainStrings = "" + allReturnedLatexStrings = "" + scriptEvaluation = run(stringToBeParsed, true) + allReturnedPlainStrings = "" + allReturnedLatexStrings = "" + catch error + if PRINTOUTRESULT then console.log error + errorMessage = error + "" + #debugger + init() + + if errorMessage == "" + for key of symbolsDependencies + + + codeGen = true + if DEBUG then console.log " variable " + key + " is: " + get_binding(usr_symbol(key)).toString() + codeGen = false + if DEBUG then console.log " variable " + key + " depends on: " + testableString += " variable " + key + " depends on: " + + recursedDependencies = [] + variablesWithCycles = [] + cyclesDescriptions = [] + + recursiveDependencies key, recursedDependencies, [], variablesWithCycles, [], cyclesDescriptions + + for i in variablesWithCycles + if DEBUG then console.log " --> cycle through " + i + + for i in recursedDependencies + if DEBUG then console.log " " + i + testableString += i + ", " + testableString += "; " + + for i in cyclesDescriptions + testableString += " " + i + ", " + + if DEBUG then console.log " code generation:" + key + " is: " + get_binding(usr_symbol(key)).toString() + + # we really want to make an extra effort + # to generate simplified code, so + # run a "simplify" on the content of each + # variable that we are generating code for. + # Note that the variable + # will still point to un-simplified structures, + # we only simplify the generated code. + push get_binding(usr_symbol(key)) + + # Since we go and simplify all variables we meet, + # we have to replace each variable passed as a parameter + # with something entirely new, so that there is no chance + # that it might evoke previous values in the external scope + # as in this case: + # a = 2 + # f(a) = a+1+b + # we don't want 'a' in the body of f to be simplified to 2 + # There are two cases: 1) the variable actually was already in + # the symbol table, in which case there is going to be this new + # one prepended with AVOID_BINDING_TO_EXTERNAL_SCOPE_VALUE, and + # we'll have to remove up this variable later. + # OR 2) the variable wasn't already in the symbol table, in which + # case we directly create this one, which means that we'll have + # to rename it later to the correct name without the prepended + # part. + + replacementsFrom = [] + replacementsTo = [] + + for eachDependency in recursedDependencies + if eachDependency[0] == "'" + deQuotedDep = eachDependency.substring(1) + originalUserSymbol = usr_symbol(deQuotedDep) + newUserSymbol = usr_symbol("AVOID_BINDING_TO_EXTERNAL_SCOPE_VALUE"+deQuotedDep) + replacementsFrom.push originalUserSymbol + replacementsTo.push newUserSymbol + push(originalUserSymbol) + push(newUserSymbol) + subst() + if DEBUG then console.log "after substitution: " + stack[tos-1] + + try + simplifyForCodeGeneration() + catch error + if PRINTOUTRESULT then console.log error + errorMessage = error + "" + #debugger + init() + + for indexOfEachReplacement in [0...replacementsFrom.length] + #console.log "replacing back " + replacementsTo[indexOfEachReplacement] + " into: " + replacementsFrom[indexOfEachReplacement] + push(replacementsTo[indexOfEachReplacement]) + push(replacementsFrom[indexOfEachReplacement]) + subst() + + clearRenamedVariablesToAvoidBindingToExternalScope() + + if errorMessage == "" + toBePrinted = pop() + + # we have to get all the variables used on the right side + # here. I.e. to print the arguments it's better to look at the + # actual method body after simplification. + userVariablesMentioned = [] + collectUserSymbols(toBePrinted, userVariablesMentioned) + + allReturnedPlainStrings = "" + allReturnedLatexStrings = "" + codeGen = true + generatedBody = toBePrinted.toString() + codeGen = false + + origPrintMode = printMode + printMode = PRINTMODE_LATEX + + bodyForReadableSummaryOfGeneratedCode = toBePrinted.toString() + + printMode = origPrintMode + + if variablesWithCycles.indexOf(key) != -1 + generatedCode += "// " + key + " is part of a cyclic dependency, no code generated." + readableSummaryOfGeneratedCode += "#" + key + " is part of a cyclic dependency, no code generated." + else + + ### + # using this paragraph instead of the following one + # creates methods signatures that + # are slightly less efficient + # i.e. variables compare even if they are + # simplified away. + # In theory these signatures are more stable, but + # in practice signatures vary quite a bit anyways + # depending on previous assignments for example, + # so it's unclear whether going for stability + # is sensible at all.. + if recursedDependencies.length != 0 + parameters = "(" + for i in recursedDependencies + if i.indexOf("'") != 0 + parameters += i + ", " + else + if recursedDependencies.indexOf(i.substring(1)) == -1 + parameters += i.substring(1) + ", " + ### + + + # remove all native functions from the + # parameters as well. + userVariablesMentioned = userVariablesMentioned.filter (x) -> + predefinedSymbolsInGlobalScope_doNotTrackInDependencies.indexOf(x + "") == -1 + + # remove the variable that are not in the dependency list + # i.e. only allow the variables that are in the dependency list + userVariablesMentioned = userVariablesMentioned.filter (x) -> + recursedDependencies.indexOf(x + "") != -1 or + recursedDependencies.indexOf("\'" + x + "") != -1 + + if userVariablesMentioned.length != 0 + parameters = "(" + for i in userVariablesMentioned + if i.printname != key + parameters += i.printname + ", " + + # eliminate the last ", " for printout clarity + parameters = parameters.replace /, $/gm , "" + parameters += ")" + generatedCode += key + " = function " + parameters + " { return ( " + generatedBody + " ); }" + readableSummaryOfGeneratedCode += key + parameters + " = " + bodyForReadableSummaryOfGeneratedCode + else + generatedCode += key + " = " + generatedBody + ";" + readableSummaryOfGeneratedCode += key + " = " + bodyForReadableSummaryOfGeneratedCode + + generatedCode += "\n" + readableSummaryOfGeneratedCode += "\n" + + if DEBUG then console.log " " + generatedCode + + # eliminate the last new line + generatedCode = generatedCode.replace /\n$/gm , "" + readableSummaryOfGeneratedCode = readableSummaryOfGeneratedCode.replace /\n$/gm , "" + + + # cleanup + symbolsDependencies = {} + symbolsHavingReassignments = [] + patternHasBeenFound = false + symbolsInExpressionsWithoutAssignments = [] + + if DEBUG then console.log "testable string: " + testableString + + if TIMING_DEBUGS + console.log "findDependenciesInScript time for: " + stringToBeRun + " : "+ ((new Date().getTime()) - timeStartFromAlgebra) + "ms" + + return [testableString, scriptEvaluation[0], generatedCode, readableSummaryOfGeneratedCode, scriptEvaluation[1], errorMessage, dependencyInfo] + +recursiveDependencies = (variableToBeChecked, arrayWhereDependenciesWillBeAdded, variablesAlreadyFleshedOut, variablesWithCycles, chainBeingChecked, cyclesDescriptions) -> + variablesAlreadyFleshedOut.push variableToBeChecked + + # recursive dependencies can only be descended if the variable is not bound to a parameter + if symbolsDependencies[chainBeingChecked[chainBeingChecked.length-1]]? + if symbolsDependencies[chainBeingChecked[chainBeingChecked.length-1]].indexOf("'"+variableToBeChecked) != -1 + if DEBUG then console.log "can't keep following the chain of " + variableToBeChecked + " because it's actually a variable bound to a parameter" + if arrayWhereDependenciesWillBeAdded.indexOf("'"+variableToBeChecked) == -1 and arrayWhereDependenciesWillBeAdded.indexOf(variableToBeChecked) == -1 + arrayWhereDependenciesWillBeAdded.push variableToBeChecked + return arrayWhereDependenciesWillBeAdded + + chainBeingChecked.push variableToBeChecked + + if !symbolsDependencies[variableToBeChecked]? + # end case: the passed variable has no dependencies + # so there is nothing else to do + if arrayWhereDependenciesWillBeAdded.indexOf(variableToBeChecked) == -1 + arrayWhereDependenciesWillBeAdded.push variableToBeChecked + return arrayWhereDependenciesWillBeAdded + else + # recursion case: we have to dig deeper + for i in symbolsDependencies[variableToBeChecked] + + # check that there is no recursion in dependencies + # we do that by keeping a list of variables that + # have already been "fleshed-out". If we encounter + # any of those "fleshed-out" variables while + # fleshing out, then there is a cycle + + if chainBeingChecked.indexOf(i) != -1 + if DEBUG then console.log " found cycle:" + cyclesDescription = "" + for k in chainBeingChecked + if variablesWithCycles.indexOf(k) == -1 + variablesWithCycles.push k + if DEBUG then console.log k + " --> " + cyclesDescription += k + " --> " + if DEBUG then console.log " ... then " + i + " again" + cyclesDescription += " ... then " + i + " again" + cyclesDescriptions.push cyclesDescription + #if DEBUG then console.log " --> cycle through " + i + # we want to flesh-out i but it's already been + # fleshed-out, just add it to the variables + # with cycles and move on + # todo refactor this, there are two copies of these two lines + if variablesWithCycles.indexOf(i) == -1 + variablesWithCycles.push i + else + # flesh-out i recursively + recursiveDependencies i, arrayWhereDependenciesWillBeAdded, variablesAlreadyFleshedOut, variablesWithCycles, chainBeingChecked, cyclesDescriptions + chainBeingChecked.pop() + #variablesAlreadyFleshedOut.pop() + + return arrayWhereDependenciesWillBeAdded + + + +# parses and runs one statement/expression at a time +inited = false + +latexErrorSign = "\\rlap{\\large\\color{red}\\bigtriangleup}{\\ \\ \\tiny\\color{red}!}" +turnErrorMessageToLatex = (theErrorMessage) -> + theErrorMessage = theErrorMessage.replace(/\n/g,"") + theErrorMessage = theErrorMessage.replace(/_/g, "} \\_ \\text{"); + theErrorMessage = theErrorMessage.replace(new RegExp(String.fromCharCode(transpose_unicode), 'g'), "}{}^{T}\\text{"); + theErrorMessage = theErrorMessage.replace(new RegExp(String.fromCharCode(dotprod_unicode), 'g'),"}\\cdot \\text{"); + theErrorMessage = theErrorMessage.replace("Stop:","} \\quad \\text{Stop:"); + theErrorMessage = theErrorMessage.replace("->","} \\rightarrow \\text{"); + theErrorMessage = theErrorMessage.replace("?","}\\enspace " + latexErrorSign + " \\enspace \\text{"); + theErrorMessage = "$$\\text{" + theErrorMessage.replace(/\n/g,"") + "}$$" + #console.log "theErrorMessage: " + theErrorMessage + return theErrorMessage + +# there are around a dozen different unicodes that +# represent some sort of middle dot, let's catch the most +# common and turn them into what we can process +normaliseDots = (stringToNormalise) -> + stringToNormalise = stringToNormalise.replace(new RegExp(String.fromCharCode(8901), 'g'), String.fromCharCode(dotprod_unicode)); + stringToNormalise = stringToNormalise.replace(new RegExp(String.fromCharCode(8226), 'g'), String.fromCharCode(dotprod_unicode)); + stringToNormalise = stringToNormalise.replace(new RegExp(String.fromCharCode(12539), 'g'), String.fromCharCode(dotprod_unicode)); + stringToNormalise = stringToNormalise.replace(new RegExp(String.fromCharCode(55296), 'g'), String.fromCharCode(dotprod_unicode)); + stringToNormalise = stringToNormalise.replace(new RegExp(String.fromCharCode(65381), 'g'), String.fromCharCode(dotprod_unicode)); + return stringToNormalise + + +TIMING_DEBUGS = false + +run = (stringToBeRun, generateLatex = false) -> + + timeStart = new Date().getTime() + + #stringToBeRun = stringToBeRun + "\n" + stringToBeRun = normaliseDots stringToBeRun + + #console.log "run running: " + stringToBeRun + + if stringToBeRun == "selftest" + selftest() + return + + #if (setjmp(stop_return)) + # return + + if !inited + inited = true + init() + + i = 0 + n = 0 + indexOfPartRemainingToBeParsed = 0 + + allReturnedPlainStrings = "" + allReturnedLatexStrings = "" + + while (1) + # while we can keep scanning commands out of the + # passed input AND we can execute them... + + try + errorMessage = "" + check_stack() + n = scan(stringToBeRun.substring(indexOfPartRemainingToBeParsed)) + p1 = pop() + check_stack() + catch error + if PRINTOUTRESULT then console.log error + #debugger + allReturnedPlainStrings += error.message + if generateLatex + #debugger + theErrorMessage = turnErrorMessageToLatex error.message + allReturnedLatexStrings += theErrorMessage + reset_after_error() + + break + + + + if (n == 0) + break + + # if debug mode then print the source text + + #if (equaln(get_binding(symbol(TRACE)), 1)) { + # for (i = 0 i < n i++) + # if (s[i] != '\r') + # printchar(s[i]) + # if (s[n - 1] != '\n') # n is not zero, see above + # printchar('\n') + #} + + indexOfPartRemainingToBeParsed += n + + push(p1) + #debugger + errorWhileExecution = false + try + stringsEmittedByUserPrintouts = "" + top_level_eval() + #console.log "emitted string after top_level_eval(): >" + stringsEmittedByUserPrintouts + "<" + #console.log "allReturnedPlainStrings string after top_level_eval(): >" + allReturnedPlainStrings + "<" + + p2 = pop() + check_stack() + + if (isstr(p2)) + if DEBUG then console.log(p2.str) + if DEBUG then console.log("\n") + + # if the return value is nil there isn't much point + # in adding "nil" to the printout + if (p2 == symbol(NIL)) + #collectedPlainResult = stringsEmittedByUserPrintouts + collectedPlainResult = stringsEmittedByUserPrintouts + if generateLatex + collectedLatexResult = "$$" + stringsEmittedByUserPrintouts + "$$" + else + #console.log "emitted string before collectPlainStringFromReturnValue: >" + stringsEmittedByUserPrintouts + "<" + #console.log "allReturnedPlainStrings string before collectPlainStringFromReturnValue: >" + allReturnedPlainStrings + "<" + collectedPlainResult = print_expr(p2) + collectedPlainResult += "\n" + #console.log "collectedPlainResult: >" + collectedPlainResult + "<" + if generateLatex + collectedLatexResult = "$$" + collectLatexStringFromReturnValue(p2) + "$$" + if DEBUG then console.log "collectedLatexResult: " + collectedLatexResult + + allReturnedPlainStrings += collectedPlainResult + if generateLatex then allReturnedLatexStrings += collectedLatexResult + + if PRINTOUTRESULT + if DEBUG then console.log "printline" + if DEBUG then console.log collectedPlainResult + #alert collectedPlainResult + if PRINTOUTRESULT + if DEBUG then console.log "display:" + print2dascii(p2) + + if generateLatex then allReturnedLatexStrings += "\n" + + catch error + errorWhileExecution = true + collectedPlainResult = error.message + if generateLatex then collectedLatexResult = turnErrorMessageToLatex error.message + + if PRINTOUTRESULT then console.log collectedPlainResult + + allReturnedPlainStrings += collectedPlainResult + if collectedPlainResult != "" + allReturnedPlainStrings += "\n" + + if generateLatex + allReturnedLatexStrings += collectedLatexResult + allReturnedLatexStrings += "\n" + + init() + + if allReturnedPlainStrings[allReturnedPlainStrings.length-1] == "\n" + allReturnedPlainStrings = allReturnedPlainStrings.substring(0,allReturnedPlainStrings.length-1) + + if generateLatex + if allReturnedLatexStrings[allReturnedLatexStrings.length-1] == "\n" + allReturnedLatexStrings = allReturnedLatexStrings.substring(0,allReturnedLatexStrings.length-1) + + if generateLatex + if DEBUG then console.log "allReturnedLatexStrings: " + allReturnedLatexStrings + stringToBeReturned = [allReturnedPlainStrings, allReturnedLatexStrings] + else + stringToBeReturned = allReturnedPlainStrings + + if TIMING_DEBUGS + timingDebugWrite = "run time on: " + stringToBeRun + " : " + (new Date().getTime() - timeStart) + "ms" + console.log timingDebugWrite + + allReturnedPlainStrings = "" + allReturnedLatexStrings = "" + return stringToBeReturned + +check_stack = -> + if (tos != 0) + debugger + stop("stack error") + if (frame != TOS) + debugger + stop("frame error") + if chainOfUserSymbolsNotFunctionsBeingEvaluated.length != 0 + debugger + stop("symbols evaluation still ongoing?") + if evaluatingAsFloats != 0 + debugger + stop("numeric evaluation still ongoing?") + if evaluatingPolar != 0 + debugger + stop("evaluation of polar still ongoing?") + +# cannot reference symbols yet + +# returns nil on stack if no result to print + +top_level_eval = -> + if DEBUG then console.log "#### top level eval" + + trigmode = 0 + + shouldAutoexpand = symbol(AUTOEXPAND) + + if (isZeroAtomOrTensor(get_binding(shouldAutoexpand))) + expanding = 0 + else + expanding = 1 + + originalArgument = top() + Eval() + evalledArgument = top() + + # "draw", "for" and "setq" return "nil", there is no result to print + if (evalledArgument == symbol(NIL)) + return + + # update "last" to contain the last result + set_binding(symbol(LAST), evalledArgument) + + if (!isZeroAtomOrTensor(get_binding(symbol(BAKE)))) + bake() + evalledArgument = top() + + # If user asked explicitly asked to evaluate "i" or "j" and + # they represent the imaginary unit (-1)^(1/2), then + # show (-1)^(1/2). + if ((originalArgument == symbol(SYMBOL_I) || originalArgument == symbol(SYMBOL_J)) && isimaginaryunit(evalledArgument)) + return + # In all other cases, replace all instances of (-1)^(1/2) in the result + # with the symbol "i" or "j" depending on which one + # represents the imaginary unit + else if (isimaginaryunit(get_binding(symbol(SYMBOL_J)))) + push(imaginaryunit) + push_symbol(SYMBOL_J) + subst() + else if (isimaginaryunit(get_binding(symbol(SYMBOL_I)))) + push(imaginaryunit) + push_symbol(SYMBOL_I) + subst() + + +check_esc_flag = -> + if (esc_flag) + stop("esc key") + +# this is called when the whole notebook is re-run +# so we get the chance of clearing the whole state from +# scratch. +# In practice, the state we need to clear that persists +# across blocks are only the patterns, so +# just eject those. +clearAlgebraEnvironment = -> + #console.log "CLEARING clearAlgebraEnvironment =============================================================" + do_clearall() + +computeDependenciesFromAlgebra = (codeFromAlgebraBlock) -> + if DEBUG then console.log "computeDependenciesFromAlgebra!!!" + # return findDependenciesInScript(codeFromAlgebraBlock, true)[6] + + # TODO this part below is duplicated from computeResultsAndJavaScriptFromAlgebra + # ...should refactor. + originalcodeFromAlgebraBlock = codeFromAlgebraBlock + keepState = true + called_from_Algebra_block = true + + #console.log "codeFromAlgebraBlock: " + codeFromAlgebraBlock + + codeFromAlgebraBlock = normaliseDots codeFromAlgebraBlock + + if !keepState + userSimplificationsInListForm = [] + userSimplificationsInProgramForm = "" + for i in userSimplificationsInListForm + #console.log "silentpattern(" + car(i) + ","+cdr(i)+")" + userSimplificationsInProgramForm += "silentpattern(" + car(i) + ","+ car(cdr(i)) + "," + car(cdr(cdr(i))) + ")\n" + + do_clearall() + codeFromAlgebraBlock = userSimplificationsInProgramForm + codeFromAlgebraBlock + if DEBUG then console.log "codeFromAlgebraBlock including patterns: " + codeFromAlgebraBlock + + if DEBUG + console.log "computeDependenciesFromAlgebra: patterns in the list --------------- " + for i in userSimplificationsInListForm + console.log car(i) + ","+cdr(i)+")" + console.log "...end of list --------------- " + + + called_from_Algebra_block = false + + return findDependenciesInScript(codeFromAlgebraBlock, true)[6] + +computeResultsAndJavaScriptFromAlgebra = (codeFromAlgebraBlock) -> + + + originalcodeFromAlgebraBlock = codeFromAlgebraBlock + keepState = true + called_from_Algebra_block = true + + timeStartFromAlgebra = new Date().getTime() + + if TIMING_DEBUGS + console.log " --------- computeResultsAndJavaScriptFromAlgebra input: " + codeFromAlgebraBlock + " at: " + (new Date()) + + # we start "clean" each time: + # clear all the symbols and then re-define + # the "starting" symbols. + + #console.log "codeFromAlgebraBlock: " + codeFromAlgebraBlock + + codeFromAlgebraBlock = normaliseDots codeFromAlgebraBlock + + + + stringToBeRun = codeFromAlgebraBlock + + if DEBUG + console.log "computeResultsAndJavaScriptFromAlgebra: patterns in the list --------------- " + for i in userSimplificationsInListForm + console.log car(i) + ","+cdr(i)+")" + console.log "...end of list --------------- " + + if !keepState + userSimplificationsInListForm = [] + userSimplificationsInProgramForm = "" + for i in userSimplificationsInListForm + #console.log "silentpattern(" + car(i) + ","+cdr(i)+")" + userSimplificationsInProgramForm += "silentpattern(" + car(i) + ","+ car(cdr(i)) + "," + car(cdr(cdr(i))) + ")\n" + + do_clearall() + codeFromAlgebraBlock = userSimplificationsInProgramForm + codeFromAlgebraBlock + if DEBUG then console.log "codeFromAlgebraBlock including patterns: " + codeFromAlgebraBlock + + #debugger + [testableStringIsIgnoredHere,result,code,readableSummaryOfCode, latexResult, errorMessage, dependencyInfo] = + findDependenciesInScript(codeFromAlgebraBlock) + + called_from_Algebra_block = false + + if readableSummaryOfCode != "" or errorMessage != "" + result += "\n" + readableSummaryOfCode + if errorMessage != "" + result += "\n" + errorMessage + result = result.replace /\n/g,"\n\n" + + latexResult += "\n" + "$$" + readableSummaryOfCode + "$$" + if errorMessage != "" + latexResult += turnErrorMessageToLatex errorMessage + latexResult = latexResult.replace /\n/g,"\n\n" + + # remove empty results altogether from latex output, which happens + # for example for assignments to variables or + # functions definitions + latexResult = latexResult.replace /\n*/,"" + latexResult = latexResult.replace /\$\$\$\$\n*/g,"" + + code = code.replace /Math\./g,"" + code = code.replace /\n/g,"\n\n" + + #console.log "code: " + code + #console.log "result: " + result + #console.log "latexResult: " + latexResult + + if TIMING_DEBUGS + console.log "computeResultsAndJavaScriptFromAlgebra time (total time from notebook and back) for: " + stringToBeRun + " : "+ ((new Date().getTime()) - timeStartFromAlgebra) + "ms" + + #code: "// no code generated yet\n//try again later" + #code: "console.log('some passed code is run'); window.something = 1;" + code: code + + # TODO temporarily pass latex in place of standard result too + result: latexResult + latexResult: latexResult + dependencyInfo: dependencyInfo + +(exports ? this).run = run +(exports ? this).findDependenciesInScript = findDependenciesInScript +(exports ? this).computeDependenciesFromAlgebra = computeDependenciesFromAlgebra +(exports ? this).computeResultsAndJavaScriptFromAlgebra = computeResultsAndJavaScriptFromAlgebra +(exports ? this).clearAlgebraEnvironment = clearAlgebraEnvironment diff --git a/node_modules/algebrite/runtime/stack.coffee b/node_modules/algebrite/runtime/stack.coffee new file mode 100644 index 0000000..5b16032 --- /dev/null +++ b/node_modules/algebrite/runtime/stack.coffee @@ -0,0 +1,155 @@ +# _______ +# | | <- stack +# | | +# |_______| +# | | <- stack + tos +# | | +# | | +# |_______| +# | | <- frame +# |_______| +# <- stack + TOS +# +# The stack grows from low memory towards high memory. This is so that +# multiple expressions can be pushed on the stack and then accessed as an +# array. +# +# The frame area holds local variables and grows from high memory towards +# low memory. The frame area makes local variables visible to the garbage +# collector. + + + +tos = 0 + +# p is a U +nil_symbols = 0 +push = (p) -> + if !p? + debugger + if p.isZero? + debugger + + #console.log "pushing " + #console.log print_list(p) + + if p == symbol(NIL) + nil_symbols++ + if DEBUG then console.log "pushing symbol(NIL) #" + nil_symbols + #if nil_symbols == 111 + # debugger + if (tos >= frame) + stop("stack overflow") + stack[tos++] = p + +# returns a U + +moveTos = (stackPos) -> + if tos <= stackPos + # we are moving the stack pointer + # "up" the stack (as if we were doing a push) + tos = stackPos + return + # we are moving the stack pointer + # "down" the stack i.e. as if we were + # doing a pop, we can zero- + # out all the elements that we pass + # so we can reclaim the memory + while tos > stackPos + stack[tos] = null + tos-- + return + +top = -> + stack[tos-1] + +pop = -> + #popsNum++ + #console.log "pop #" + popsNum + if (tos == 0) + debugger + stop("stack underflow") + if !stack[tos-1]? + debugger + elementToBeReturned = stack[--tos] + + # give a chance to the garbage + # collection to reclaim space + # This is JS-specific, it would + # actually make the C garbage + # collector useless. + stack[tos] = null + + return elementToBeReturned + +# n is an integer +push_frame = (n) -> + i = 0 + frame -= n + if (frame < tos) + debugger + stop("frame overflow, circular reference?") + for i in [0...n] + stack[frame + i] = symbol(NIL) + +# n is an integer +pop_frame = (n) -> + frame += n + if (frame > TOS) + stop("frame underflow") + +save = -> + frame -= 10 + if (frame < tos) + debugger + stop("frame overflow, circular reference?") + stack[frame + 0] = p0 + stack[frame + 1] = p1 + stack[frame + 2] = p2 + stack[frame + 3] = p3 + stack[frame + 4] = p4 + stack[frame + 5] = p5 + stack[frame + 6] = p6 + stack[frame + 7] = p7 + stack[frame + 8] = p8 + stack[frame + 9] = p9 + +restore = -> + if (frame > TOS - 10) + stop("frame underflow") + p0 = stack[frame + 0] + p1 = stack[frame + 1] + p2 = stack[frame + 2] + p3 = stack[frame + 3] + p4 = stack[frame + 4] + p5 = stack[frame + 5] + p6 = stack[frame + 6] + p7 = stack[frame + 7] + p8 = stack[frame + 8] + p9 = stack[frame + 9] + frame += 10 + +# Local U * is OK here because there is no functional path to the garbage collector. + +swap = -> + #U *p, *q + # p and q are both Us + p = pop() + q = pop() + push(p) + push(q) + +# Local U * is OK here because there is no functional path to the garbage collector. + +dupl = -> + #U *p + p = pop() + push(p) + push(p) + +$.dupl = dupl +$.swap = swap +$.restore = restore +$.save = save +$.push = push +$.pop = pop diff --git a/node_modules/algebrite/runtime/symbol.coffee b/node_modules/algebrite/runtime/symbol.coffee new file mode 100644 index 0000000..feb6eb4 --- /dev/null +++ b/node_modules/algebrite/runtime/symbol.coffee @@ -0,0 +1,259 @@ +# The symbol table is a simple array of struct U. + + + +# put symbol at index n +Eval_symbolsinfo = -> + symbolsinfoToBePrinted = symbolsinfo() + + if symbolsinfoToBePrinted != "" + push new_string(symbolsinfoToBePrinted) + else + push_symbol(NIL) + +symbolsinfo = -> + symbolsinfoToBePrinted = "" + for i in [NIL+1...symtab.length] + if symtab[i].printname == "" + if isSymbolReclaimable[i] == false + break + else + continue + symtabi = symtab[i] + "" + bindingi = (binding[i] + "").substring(0,4) + symbolsinfoToBePrinted += "symbol: " + symtabi + " size: " + countsize(binding[i]) + " value: " + bindingi + "...\n" + return symbolsinfoToBePrinted + + + +# s is a string, n is an int +# TODO: elsewhere when we create a symbol we +# rather prefer to create a new entry. Here we just +# reuse the existing one. If that can never be a problem +# then explain why, otherwise do create a new entry. +std_symbol = (s, n, latexPrint) -> + p = symtab[n] + if !p? + debugger + p.printname = s + if latexPrint? + p.latexPrint = latexPrint + else + p.latexPrint = s + +# symbol lookup, or symbol creation if symbol doesn't exist yet +# this happens often from the scanner. When the scanner sees something +# like myVar = 2, it create a tree (SETQ ("myVar" symbol as created/looked up here (2))) +# user-defined functions also have a usr symbol. +# +# Note that some symbols like, say, "abs", +# are picked up by the scanner directly as keywords, +# so they are not looked up via this. +# So in fact you could redefine abs to be abs(x) = x +# but still abs would be picked up by the scanner as a particular +# node type and calls to abs() will be always to the "native" abs +# +# Also note that some symbols such as "zero" are (strangely) not picked up by +# the scanner as special nodes, rather they are identified as keywords +# (e.g. not redefinable) at time of symbol lookup (in Eval_sym) and +# evalled, where eval has a case for ZERO. +# +# Also note that there are a number of symbols, such as a,b,c,x,y,z,... +# that are actually created by std_symbols. +# They are not special node types (like abs), they are normal symbols +# that are looked up, but the advantage is that since they are often +# used internally by algebrite, we create the symbol in advance and +# we can reference the symbol entry in a clean way +# (e.g. symbol(SYMBOL_X)) rather than +# by looking up a string. + +# s is a string +usr_symbol = (s) -> + + #console.log "usr_symbol of " + s + #if s == "aaa" + # debugger + + # find either the existing symbol, or if we + # reach an empty symbol (printname == "") then + # re-use that location. + i = 0 + for i in [0...NSYM] + if (s == symtab[i].printname) + # found the symbol + return symtab[i] + if (symtab[i].printname == "") + # found an entry in the symbol table + # with no printname, exit the loop + # and re-use this location + break + if (i == NSYM) + stop("symbol table overflow") + + + symtab[i] = new U() + symtab[i].k = SYM + symtab[i].printname = s + # say that we just created the symbol + # then, binding[the new symbol entry] + # by default points to the symbol. + # So the value of an unassigned symbol will + # be just its name. + binding[i] = symtab[i] + isSymbolReclaimable[i] = false + + return symtab[i] + +# get the symbol's printname + +# p is a U +get_printname = (p) -> + if (p.k != SYM) + stop("symbol error") + return p.printname + + +# p and q are both U +# there are two Us at play here. One belongs to the +# symtab array and is the variable name. +# The other one is the U with the content, and that +# one will go in the corresponding "binding" array entry. +set_binding = (p, q) -> + if (p.k != SYM) + stop("symbol error") + + + #console.log "setting binding of " + p.toString() + " to: " + q.toString() + #if p.toString() == "aaa" + # debugger + + indexFound = symtab.indexOf(p) + ### + if indexFound == -1 + debugger + for i in [0...symtab.length] + if p.printname == symtab[i].printname + indexFound = i + console.log "remedied an index not found!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + break + ### + + if symtab.indexOf(p, indexFound + 1) != -1 + console.log("ops, more than one element!") + debugger + if DEBUG then console.log("lookup >> set_binding lookup " + indexFound) + isSymbolReclaimable[indexFound] = false + binding[indexFound] = q + +# p is a U +get_binding = (p) -> + if (p.k != SYM) + stop("symbol error") + + #console.log "getting binding of " + p.toString() + #if p.toString() == "aaa" + # debugger + + indexFound = symtab.indexOf(p) + ### + if indexFound == -1 + debugger + for i in [0...symtab.length] + if p.printname == symtab[i].printname + indexFound = i + console.log "remedied an index not found!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + break + ### + + if symtab.indexOf(p, indexFound + 1) != -1 + console.log("ops, more than one element!") + debugger + if DEBUG then console.log("lookup >> get_binding lookup " + indexFound) + #if indexFound == 139 + # debugger + #if indexFound == 137 + # debugger + return binding[indexFound] + +# the concept of user symbol is a little fuzzy +# beucase mathematics is full of symbols that actually +# have a special meaning, e.g. e,i,I in some cases j... +is_usr_symbol = (p) -> + if (p.k != SYM) + return false + theSymnum = symnum(p) + # see "defs" file for the naming of the symbols + if theSymnum > PI and theSymnum != SYMBOL_I and theSymnum != SYMBOL_IDENTITY_MATRIX + return true + return false + +# get symbol's number from ptr +# p is U +lookupsTotal = 0 +symnum = (p) -> + lookupsTotal++ + if (p.k != SYM) + stop("symbol error") + indexFound = symtab.indexOf(p) + if symtab.indexOf(p, indexFound + 1) != -1 + console.log("ops, more than one element!") + debugger + if DEBUG then console.log("lookup >> symnum lookup " + indexFound + " lookup # " + lookupsTotal) + #if lookupsTotal == 21 + # debugger + #if indexFound == 79 + # debugger + return indexFound + +# push indexed symbol + +# k is an int +push_symbol = (k) -> + push(symtab[k]) + +clear_symbols = -> + # we can clear just what's assignable. + # everything before NIL is not assignable, + # so there is no need to clear it. + for i in [NIL+1...NSYM] + + # stop at the first empty + # entry that is not reclaimable + if symtab[i].printname == "" + if isSymbolReclaimable[i] == false + break + else + continue + + symtab[i] = new U() + symtab[i].k = SYM + binding[i] = symtab[i] + isSymbolReclaimable[i] = false + #symtab[i].printname = "" + #binding[i] = symtab[i] + + +# collect all the variables in a tree +collectUserSymbols = (p, accumulator = []) -> + + if is_usr_symbol(p) + if accumulator.indexOf(p) == -1 + accumulator.push p + return + + if (istensor(p)) + for i in [0...p.tensor.nelem] + collectUserSymbols p.tensor.elem[i], accumulator + return + + while (iscons(p)) + collectUserSymbols(car(p), accumulator) + p = cdr(p) + + return + +$.get_binding = get_binding +$.set_binding = set_binding +$.usr_symbol = usr_symbol +$.symbolsinfo = symbolsinfo +$.collectUserSymbols = collectUserSymbols diff --git a/node_modules/algebrite/runtime/zombocom.coffee b/node_modules/algebrite/runtime/zombocom.coffee new file mode 100644 index 0000000..77bc00c --- /dev/null +++ b/node_modules/algebrite/runtime/zombocom.coffee @@ -0,0 +1,70 @@ + + +if !inited + inited = true + init() + + +$.init = init + +parse_internal = (argu) -> + if typeof argu == 'string' + scan(argu) + # now its in the stack + else if typeof argu == 'number' + if argu % 1 == 0 + push_integer(argu) + else + push_double(argu) + else if argu instanceof U + # hey look its a U + push(argu) + else + console.warn('unknown argument type', argu) + push(symbol(NIL)) + +parse = (argu) -> + try + parse_internal(argu) + data = pop() + check_stack() + catch error + reset_after_error() + throw error + return data + +# exec handles the running ia JS of all the algebrite +# functions. The function name is passed in "name" and +# the corresponding function is pushed at the top of the stack +exec = (name, argus...) -> + fn = get_binding(usr_symbol(name)) + check_stack() + push(fn) + + for argu in argus + parse_internal(argu) + + list(1 + argus.length) + + p1 = pop() + push(p1) + + try + top_level_eval() + result = pop() + check_stack() + catch error + reset_after_error() + throw error + + return result + + +$.exec = exec +$.parse = parse + +do -> + builtin_fns = ["abs", "add", "adj", "and", "approxratio", "arccos", "arccosh", "arcsin", "arcsinh", "arctan", "arctanh", "arg", "atomize", "besselj", "bessely", "binding", "binomial", "ceiling", "check", "choose", "circexp", "clear", "clearall", "clearpatterns", "clock", "coeff", "cofactor", "condense", "conj", "contract", "cos", "cosh", "decomp", "defint", "deg", "denominator", "det", "derivative", "dim", "dirac", "divisors", "do", "dot", "draw", "dsolve", "eigen", "eigenval", "eigenvec", "erf", "erfc", "eval", "exp", "expand", "expcos", "expsin", "factor", "factorial", "factorpoly", "filter", "float", "floor", "for", "Gamma", "gcd", "hermite", "hilbert", "imag", "component", "inner", "integral", "inv", "invg", "isinteger", "isprime", "laguerre", "lcm", "leading", "legendre", "log", "mod", "multiply", "not", "nroots", "number", "numerator", "operator", "or", "outer", "pattern", "patternsinfo", "polar", "power", "prime", "print", "print2dascii", "printcomputer", "printlatex", "printlist", "printhuman", "product", "quote", "quotient", "rank", "rationalize", "real", "rect", "roots", "round", "equals", "shape", "sgn", "silentpattern", "simplify", "sin", "sinh", "sqrt", "stop", "subst", "sum", "symbolsinfo", "tan", "tanh", "taylor", "test", "testeq", "testge", "testgt", "testle", "testlt", "transpose", "unit", "zero"] + + for fn in builtin_fns + $[fn] = exec.bind(this, fn) diff --git a/node_modules/algebrite/sources/abs.coffee b/node_modules/algebrite/sources/abs.coffee new file mode 100644 index 0000000..5d9ae09 --- /dev/null +++ b/node_modules/algebrite/sources/abs.coffee @@ -0,0 +1,285 @@ +#(docs are generated from top-level comments, keep an eye on the formatting!) + +### abs ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the absolute value of a real number, the magnitude of a complex number, or the vector length. + +### + +### + Absolute value of a number,or magnitude of complex z, or norm of a vector + + z abs(z) + - ------ + + a a + + -a a + + (-1)^a 1 + + exp(a + i b) exp(a) + + a b abs(a) abs(b) + + a + i b sqrt(a^2 + b^2) + +Notes + + 1. Handles mixed polar and rectangular forms, e.g. 1 + exp(i pi/3) + + 2. jean-francois.debroux reports that when z=(a+i*b)/(c+i*d) then + + abs(numerator(z)) / abs(denominator(z)) + + must be used to get the correct answer. Now the operation is + automatic. +### + + +DEBUG_ABS = false + +Eval_abs = -> + push(cadr(p1)) + Eval() + abs() + +absValFloat = -> + Eval() + absval() + Eval(); # normalize + zzfloat() + # zzfloat of an abs doesn't necessarily result in a double + # , for example if there are variables. But + # in many of the tests there should be indeed + # a float, these two lines come handy to highlight + # when that doesn't happen for those tests. + #if !isdouble(stack[tos-1]) + # stop("absValFloat should return a double and instead got: " + stack[tos-1]) + +abs = -> + theArgument = top() + if DEBUG_ABS then console.trace ">>>> ABS of " + theArgument + numerator() + if DEBUG_ABS then console.log "ABS numerator " + stack[tos-1] + absval() + if DEBUG_ABS then console.log "ABSVAL numerator: " + stack[tos-1] + + push(theArgument) + denominator() + if DEBUG_ABS then console.log "ABS denominator: " + stack[tos-1] + absval() + if DEBUG_ABS then console.log "ABSVAL denominator: " + stack[tos-1] + + divide() + if DEBUG_ABS then console.log "ABSVAL divided: " + stack[tos-1] + + if DEBUG_ABS then console.log "<<<<<<< ABS" + +absval = -> + save() + p1 = pop() + input = p1 + + if DEBUG_ABS then console.log "ABS of " + p1 + + + # handle all the "number" cases first ----------------------------------------- + if (isZeroAtomOrTensor(p1)) + if DEBUG_ABS then console.log " abs: " + p1 + " just zero" + push(zero) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + if (isnegativenumber(p1)) + if DEBUG_ABS then console.log " abs: " + p1 + " just a negative" + push(p1) + negate() + restore() + return + + if (ispositivenumber(p1)) + if DEBUG_ABS then console.log " abs: " + p1 + " just a positive" + push(p1) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + if (p1 == symbol(PI)) + if DEBUG_ABS then console.log " abs: " + p1 + " of PI" + push(p1) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + # ??? should there be a shortcut case here for the imaginary unit? + + # now handle decomposition cases ---------------------------------------------- + + # we catch the "add", "power", "multiply" cases first, + # before falling back to the + # negative/positive cases because there are some + # simplification thay we might be able to do. + # Note that for this routine to give a correct result, this + # must be a sum where a complex number appears. + # If we apply this to "a+b", we get an incorrect result. + if (car(p1) == symbol(ADD) and ( + findPossibleClockForm(p1) or + findPossibleExponentialForm(p1) or + Find(p1,imaginaryunit)) + ) + if DEBUG_ABS then console.log " abs: " + p1 + " is a sum" + if DEBUG_ABS then console.log "abs of a sum" + # sum + push(p1) + rect() # convert polar terms, if any + p1 = pop() + push(p1) + real() + push_integer(2) + power() + push(p1) + imag() + push_integer(2) + power() + add() + push_rational(1, 2) + power() + simplify_trig() + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + if (car(p1) == symbol(POWER) && equaln(cadr(p1), -1)) + if DEBUG_ABS then console.log " abs: " + p1 + " is -1 to any power" + # -1 to any power + if evaluatingAsFloats + if DEBUG_ABS then console.log " abs: numeric, so result is 1.0" + push_double(1.0) + else + if DEBUG_ABS then console.log " abs: symbolic, so result is 1" + push_integer(1) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + # abs(a^b) is equal to abs(a)^b IF b is positive + if (car(p1) == symbol(POWER) && ispositivenumber(caddr(p1))) + if DEBUG_ABS then console.log " abs: " + p1 + " is something to the power of a positive number" + push cadr(p1) + abs() + push caddr(p1) + power() + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + # abs(e^something) + if (car(p1) == symbol(POWER) && cadr(p1) == symbol(E)) + if DEBUG_ABS then console.log " abs: " + p1 + " is an exponential" + # exponential + push(caddr(p1)) + real() + exponential() + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + if (car(p1) == symbol(MULTIPLY)) + if DEBUG_ABS then console.log " abs: " + p1 + " is a product" + # product + anyFactorsYet = false + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + absval() + if anyFactorsYet + multiply() + anyFactorsYet = true + p1 = cdr(p1) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + if (car(p1) == symbol(ABS)) + if DEBUG_ABS then console.log " abs: " + p1 + " is abs of a abs" + # abs of a abs + push_symbol(ABS) + push cadr(p1) + list(2) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + + ### + # Evaluation via zzfloat() + # ...while this is in theory a powerful mechanism, I've commented it + # out because I've refined this method enough to not need this. + # Evaling via zzfloat() is in principle more problematic because it could + # require further evaluations which could end up in further "abs" which + # would end up in infinite loops. Better not use it if not necessary. + + # we look directly at the float evaluation of the argument + # to see if we end up with a number, which would mean that there + # is no imaginary component and we can just return the input + # (or its negation) as the result. + push p1 + zzfloat() + floatEvaluation = pop() + + if (isnegativenumber(floatEvaluation)) + if DEBUG_ABS then console.log " abs: " + p1 + " just a negative" + push(p1) + negate() + restore() + return + + if (ispositivenumber(floatEvaluation)) + if DEBUG_ABS then console.log " abs: " + p1 + " just a positive" + push(p1) + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + return + ### + + if (istensor(p1)) + absval_tensor() + restore() + return + + if (isnegativeterm(p1) || (car(p1) == symbol(ADD) && isnegativeterm(cadr(p1)))) + push(p1) + negate() + p1 = pop() + + if DEBUG_ABS then console.log " abs: " + p1 + " is nothing decomposable" + push_symbol(ABS) + push(p1) + list(2) + + if DEBUG_ABS then console.log " --> ABS of " + input + " : " + stack[tos-1] + restore() + +# also called the "norm" of a vector +absval_tensor = -> + if (p1.tensor.ndim != 1) + stop("abs(tensor) with tensor rank > 1") + push(p1) + push(p1) + conjugate() + inner() + push_rational(1, 2) + power() + simplify() + Eval() diff --git a/node_modules/algebrite/sources/add.coffee b/node_modules/algebrite/sources/add.coffee new file mode 100644 index 0000000..62dd9e2 --- /dev/null +++ b/node_modules/algebrite/sources/add.coffee @@ -0,0 +1,335 @@ +### + Symbolic addition + + Terms in a sum are combined if they are identical modulo rational + coefficients. + + For example, A + 2A becomes 3A. + + However, the sum A + sqrt(2) A is not modified. + + Combining terms can lead to second-order effects. + + For example, consider the case of + + 1/sqrt(2) A + 3/sqrt(2) A + sqrt(2) A + + The first two terms are combined to yield 2 sqrt(2) A. + + This result can now be combined with the third term to yield + + 3 sqrt(2) A +### + + + +flag = 0 + +Eval_add = -> + h = tos + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + p2 = pop() + push_terms(p2) + p1 = cdr(p1) + add_terms(tos - h) + +# Add n terms, returns one expression on the stack. + +stackAddsCount = 0 +add_terms = (n) -> + stackAddsCount++ + i = 0 + + h = tos - n + + s = h + + # ensure no infinite loop, use "for" + + if DEBUG then console.log "stack before adding terms #" + stackAddsCount + #if stackAddsCount == 137 + # debugger + + if DEBUG + for i in [0...tos] + console.log print_list stack[i] + + for i in [0...10] + + if (n < 2) + break + + flag = 0 + + + #qsort(s, n, sizeof (U *), cmp_terms) + subsetOfStack = stack.slice(h,h+n) + subsetOfStack.sort(cmp_terms) + stack = stack.slice(0,h).concat(subsetOfStack).concat(stack.slice(h+n)) + + if (flag == 0) + break + + n = combine_terms(h, n) + + moveTos h + n + + switch (n) + when 0 + if evaluatingAsFloats then push_double(0.0) else push(zero) + when 1 + else + list(n) + p1 = pop() + push_symbol(ADD) + push(p1) + cons() + + if DEBUG then console.log "stack after adding terms #" + stackAddsCount + #if stackAddsCount == 5 + # debugger + + if DEBUG + for i in [0...tos] + console.log print_list stack[i] + +# Compare terms for order, clobbers p1 and p2. + +cmp_terms_count = 0 +cmp_terms = (p1, p2) -> + cmp_terms_count++ + #if cmp_terms_count == 52 + # debugger + + i = 0 + # numbers can be combined + + if (isNumericAtom(p1) && isNumericAtom(p2)) + flag = 1 + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns 0" + return 0 + + # congruent tensors can be combined + + if (istensor(p1) && istensor(p2)) + if (p1.tensor.ndim < p2.tensor.ndim) + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns -1" + return -1 + if (p1.tensor.ndim > p2.tensor.ndim) + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns 1" + return 1 + for i in [0...p1.tensor.ndim] + if (p1.tensor.dim[i] < p2.tensor.dim[i]) + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns -1" + return -1 + if (p1.tensor.dim[i] > p2.tensor.dim[i]) + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns 1" + return 1 + flag = 1 + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns 0" + return 0 + + if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + if (isNumericAtom(car(p1))) + p1 = cdr(p1) + if (cdr(p1) == symbol(NIL)) + p1 = car(p1) + + if (car(p2) == symbol(MULTIPLY)) + p2 = cdr(p2) + if (isNumericAtom(car(p2))) + p2 = cdr(p2) + if (cdr(p2) == symbol(NIL)) + p2 = car(p2) + + t = cmp_expr(p1, p2) + + if (t == 0) + flag = 1 + + #if DEBUG then console.log "cmp_terms #" + cmp_terms_count + " returns " + t + return t + +### + Compare adjacent terms in s[] and combine if possible. + + Returns the number of terms remaining in s[]. + + n number of terms in s[] initially +### + +combine_terms = (s, n) -> + + #debugger + + # I had to turn the coffeescript for loop into + # a more mundane while loop because the i + # variable was changed from within the body, + # which is something that is not supposed to + # happen in the coffeescript 'vector' form. + # Also this means I had to add a 'i++' jus before + # the end of the body and before the "continue"s + i=0 + while i < (n-1) + check_esc_flag() + + p3 = stack[s+i] + p4 = stack[s+i + 1] + + if (istensor(p3) && istensor(p4)) + push(p3) + push(p4) + tensor_plus_tensor() + p1 = pop() + if (p1 != symbol(NIL)) + stack[s+i] = p1 + for j in [(i + 1)...(n - 1)] + stack[s+j] = stack[s+j + 1] + n-- + i-- + + i++ + continue + + if (istensor(p3) || istensor(p4)) + + i++ + continue + + if (isNumericAtom(p3) && isNumericAtom(p4)) + push(p3) + push(p4) + add_numbers() + p1 = pop() + if (isZeroAtomOrTensor(p1)) + for j in [i...(n - 2)] + stack[s+j] = stack[s+j + 2] + n -= 2 + else + stack[s+i] = p1 + for j in [(i + 1)...(n - 1)] + stack[s+j] = stack[s+j + 1] + n-- + i-- + + i++ + continue + + if (isNumericAtom(p3) || isNumericAtom(p4)) + + i++ + continue + + if evaluatingAsFloats + p1 = one_as_double + p2 = one_as_double + else + p1 = one + p2 = one + + t = 0 + + if (car(p3) == symbol(MULTIPLY)) + p3 = cdr(p3) + t = 1; # p3 is now denormal + if (isNumericAtom(car(p3))) + p1 = car(p3) + p3 = cdr(p3) + if (cdr(p3) == symbol(NIL)) + p3 = car(p3) + t = 0 + + if (car(p4) == symbol(MULTIPLY)) + p4 = cdr(p4) + if (isNumericAtom(car(p4))) + p2 = car(p4) + p4 = cdr(p4) + if (cdr(p4) == symbol(NIL)) + p4 = car(p4) + + if (!equal(p3, p4)) + + i++ + continue + + push(p1) + push(p2) + add_numbers() + + p1 = pop() + + if (isZeroAtomOrTensor(p1)) + for j in [i...(n - 2)] + stack[s+j] = stack[s+j + 2] + n -= 2 + i-- + + i++ + continue + + push(p1) + + if (t) + push(symbol(MULTIPLY)) + push(p3) + cons() + else + push(p3) + + multiply() + + stack[s+i] = pop() + + for j in [(i + 1)...(n - 1)] + stack[s+j] = stack[s+j + 1] + + n-- + i-- + + # this i++ is to match the while + i++ + + return n + +push_terms = (p) -> + if (car(p) == symbol(ADD)) + p = cdr(p) + while (iscons(p)) + push(car(p)) + p = cdr(p) + # omit zeroes + else if (!isZeroAtom(p)) + push(p) + +# add two expressions + +add = -> + save() + p2 = pop() + p1 = pop() + h = tos + push_terms(p1) + push_terms(p2) + add_terms(tos - h) + restore() + +add_all = (k) -> + i = 0 + save() + s = tos - k + h = tos + for i in [0...k] + push_terms(stack[s+i]) + add_terms(tos - h) + p1 = pop() + moveTos tos - k + push(p1) + restore() + +subtract = -> + negate() + add() diff --git a/node_modules/algebrite/sources/adj.coffee b/node_modules/algebrite/sources/adj.coffee new file mode 100644 index 0000000..e704c4a --- /dev/null +++ b/node_modules/algebrite/sources/adj.coffee @@ -0,0 +1,54 @@ +### adj ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m + +General description +------------------- +Returns the adjunct of matrix m. The inverse of m is equal to adj(m) divided by det(m). + +### + + +Eval_adj = -> + push(cadr(p1)) + Eval() + adj() + +adj = -> + i = 0 + j = 0 + n = 0 + + save() + + p1 = pop() + + if (istensor(p1) && p1.tensor.ndim == 2 && p1.tensor.dim[0] == p1.tensor.dim[1]) + doNothing = 1 + else + stop("adj: square matrix expected") + + n = p1.tensor.dim[0] + + p2 = alloc_tensor(n * n) + + p2.tensor.ndim = 2 + p2.tensor.dim[0] = n + p2.tensor.dim[1] = n + + for i in [0...n] + for j in [0...n] + cofactor(p1, n, i, j) + p2.tensor.elem[n * j + i] = pop(); # transpose + + push(p2) + + restore() + + diff --git a/node_modules/algebrite/sources/approxratio.coffee b/node_modules/algebrite/sources/approxratio.coffee new file mode 100644 index 0000000..4ae8fa2 --- /dev/null +++ b/node_modules/algebrite/sources/approxratio.coffee @@ -0,0 +1,1047 @@ +### + Guesses a rational for each float in the passed expression +### + + +Eval_approxratio = -> + theArgument = cadr(p1) + push(theArgument) + approxratioRecursive() + +approxratioRecursive = -> + i = 0 + save() + p1 = pop(); # expr + if (istensor(p1)) + p4 = alloc_tensor(p1.tensor.nelem) + p4.tensor.ndim = p1.tensor.ndim + for i in [0...p1.tensor.ndim] + p4.tensor.dim[i] = p1.tensor.dim[i] + for i in [0...p1.tensor.nelem] + push(p1.tensor.elem[i]) + approxratioRecursive() + p4.tensor.elem[i] = pop() + + check_tensor_dimensions p4 + + push(p4) + else if p1.k == DOUBLE + push(p1) + approxOneRatioOnly() + else if (iscons(p1)) + push(car(p1)) + approxratioRecursive() + push(cdr(p1)) + approxratioRecursive() + cons() + else + push(p1) + restore() + +approxOneRatioOnly = -> + zzfloat() + supposedlyTheFloat = pop() + if supposedlyTheFloat.k == DOUBLE + theFloat = supposedlyTheFloat.d + splitBeforeAndAfterDot = theFloat.toString().split(".") + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + theRatio = floatToRatioRoutine(theFloat,precision) + push_rational(theRatio[0], theRatio[1]) + else + push_integer(theFloat) + return + + # we didn't manage, just leave unexpressed + push_symbol(APPROXRATIO) + push(theArgument) + list(2) + +# original routine by John Kennedy, see +# https://web.archive.org/web/20111027100847/http://homepage.smc.edu/kennedy_john/DEC2FRAC.PDF +# courtesy of Michael Borcherds +# who ported this to JavaScript under MIT licence +# also see +# https://github.com/geogebra/geogebra/blob/master/common/src/main/java/org/geogebra/common/kernel/algos/AlgoFractionText.java +# potential other ways to do this: +# https://rosettacode.org/wiki/Convert_decimal_number_to_rational +# http://www.homeschoolmath.net/teaching/rational_numbers.php +# http://stackoverflow.com/questions/95727/how-to-convert-floats-to-human-readable-fractions + +floatToRatioRoutine = (decimal, AccuracyFactor) -> + FractionNumerator = undefined + FractionDenominator = undefined + DecimalSign = undefined + Z = undefined + PreviousDenominator = undefined + ScratchValue = undefined + ret = [ + 0 + 0 + ] + if isNaN(decimal) + return ret + # return 0/0 + if decimal == Infinity + ret[0] = 1 + ret[1] = 0 + # 1/0 + return ret + if decimal == -Infinity + ret[0] = -1 + ret[1] = 0 + # -1/0 + return ret + if decimal < 0.0 + DecimalSign = -1.0 + else + DecimalSign = 1.0 + decimal = Math.abs(decimal) + if Math.abs(decimal - Math.floor(decimal)) < AccuracyFactor + # handles exact integers including 0 + FractionNumerator = decimal * DecimalSign + FractionDenominator = 1.0 + ret[0] = FractionNumerator + ret[1] = FractionDenominator + return ret + if decimal < 1.0e-19 + # X = 0 already taken care of + FractionNumerator = DecimalSign + FractionDenominator = 9999999999999999999.0 + ret[0] = FractionNumerator + ret[1] = FractionDenominator + return ret + if decimal > 1.0e19 + FractionNumerator = 9999999999999999999.0 * DecimalSign + FractionDenominator = 1.0 + ret[0] = FractionNumerator + ret[1] = FractionDenominator + return ret + Z = decimal + PreviousDenominator = 0.0 + FractionDenominator = 1.0 + loop + Z = 1.0 / (Z - Math.floor(Z)) + ScratchValue = FractionDenominator + FractionDenominator = FractionDenominator * Math.floor(Z) + PreviousDenominator + PreviousDenominator = ScratchValue + FractionNumerator = Math.floor(decimal * FractionDenominator + 0.5) + # Rounding Function + unless Math.abs(decimal - (FractionNumerator / FractionDenominator)) > AccuracyFactor and Z != Math.floor(Z) + break + FractionNumerator = DecimalSign * FractionNumerator + ret[0] = FractionNumerator + ret[1] = FractionDenominator + ret + +approx_just_an_integer = 0 +approx_sine_of_rational = 1 +approx_sine_of_pi_times_rational = 2 +approx_rationalOfPi = 3 +approx_radicalOfRatio = 4 +approx_nothingUseful = 5 +approx_ratioOfRadical = 6 +approx_rationalOfE = 7 +approx_logarithmsOfRationals = 8 +approx_rationalsOfLogarithms = 9 + +approxRationalsOfRadicals = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + # simple radicals. + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + for i in [2,3,5,6,7,8,10] + for j in [1..10] + #console.log "i,j: " + i + "," + j + hypothesis = Math.sqrt(i)/j + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + if error < 2 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * sqrt( " + i + " ) / " + j + #console.log result + " error: " + error + bestResultSoFar = [result, approx_ratioOfRadical, likelyMultiplier, i, j] + + return bestResultSoFar + +approxRadicalsOfRationals = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + # simple radicals. + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + # this one catches things like Math.sqrt(3/4), but + # things like Math.sqrt(1/2) are caught by the paragraph + # above (and in a better form) + for i in [1,2,3,5,6,7,8,10] + for j in [1,2,3,5,6,7,8,10] + #console.log "i,j: " + i + "," + j + hypothesis = Math.sqrt(i/j) + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + if error < 2 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * (sqrt( " + i + " / " + j + " )" + #console.log result + " error: " + error + bestResultSoFar = [result, approx_radicalOfRatio, likelyMultiplier, i, j] + + return bestResultSoFar + +approxRadicals = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + # simple radicals. + + # we always prefer a rational of a radical of an integer + # to a radical of a rational. Radicals of rationals generate + # radicals at the denominator which we'd rather avoid + + approxRationalsOfRadicalsResult = approxRationalsOfRadicals theFloat + if approxRationalsOfRadicalsResult? + return approxRationalsOfRadicalsResult + + approxRadicalsOfRationalsResult = approxRadicalsOfRationals theFloat + if approxRadicalsOfRationalsResult? + return approxRadicalsOfRationalsResult + + return null + +approxLogs = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + # we always prefer a rational of a log to a log of + # a rational + + approxRationalsOfLogsResult = approxRationalsOfLogs theFloat + if approxRationalsOfLogsResult? + return approxRationalsOfLogsResult + + approxLogsOfRationalsResult = approxLogsOfRationals theFloat + if approxLogsOfRationalsResult? + return approxLogsOfRationalsResult + + return null + +approxRationalsOfLogs = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + # simple rationals of logs + for i in [2..5] + for j in [1..5] + #console.log "i,j: " + i + "," + j + hypothesis = Math.log(i)/j + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + + # it does happen that due to roundings + # a "higher multiple" is picked, which is obviously + # unintended. + # E.g. 1 * log(1 / 3 ) doesn't match log( 3 ) BUT + # it matches -5 * log( 3 ) / 5 + # so we avoid any case where the multiplier is a multiple + # of the divisor. + if likelyMultiplier != 1 and Math.abs(Math.floor(likelyMultiplier/j)) == Math.abs(likelyMultiplier/j) + continue + + if error < 2.2 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * log( " + i + " ) / " + j + #console.log result + " error: " + error + bestResultSoFar = [result, approx_rationalsOfLogarithms, likelyMultiplier, i, j] + + return bestResultSoFar + +approxLogsOfRationals = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + # simple logs of rationals + for i in [1..5] + for j in [1..5] + #console.log "i,j: " + i + "," + j + hypothesis = Math.log(i/j) + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + if error < 1.96 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * log( " + i + " / " + j + " )" + #console.log result + " error: " + error + bestResultSoFar = [result, approx_logarithmsOfRationals, likelyMultiplier, i, j] + + return bestResultSoFar + +approxRationalsOfPowersOfE = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + # simple rationals of a few powers of e + for i in [1..2] + for j in [1..12] + #console.log "i,j: " + i + "," + j + hypothesis = Math.pow(Math.E,i)/j + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + if error < 2 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * (e ^ " + i + " ) / " + j + #console.log result + " error: " + error + bestResultSoFar = [result, approx_rationalOfE, likelyMultiplier, i, j] + + return bestResultSoFar + +approxRationalsOfPowersOfPI = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + bestResultSoFar = null + + # here we do somethng a little special: since + # the powers of pi can get quite big, there might + # be multiple hypothesis where more of the + # magnitude is shifted to the multiplier, and some + # where more of the magnitude is shifted towards the + # exponent of pi. So we prefer the hypotheses with the + # lower multiplier since it's likely to insert more + # information. + minimumComplexity = Number.MAX_VALUE + + # simple rationals of a few powers of PI + for i in [1..5] + for j in [1..12] + #console.log "i,j: " + i + "," + j + hypothesis = Math.pow(Math.PI,i)/j + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + if error < 2 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * (pi ^ " + i + " ) / " + j + " )" + #console.log result + " error: " + error + bestResultSoFar = [result, approx_rationalOfPi, likelyMultiplier, i, j] + + #console.log "approxRationalsOfPowersOfPI returning: " + bestResultSoFar + return bestResultSoFar + +approxTrigonometric = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + # we always prefer a sin of a rational without the PI + + approxSineOfRationalsResult = approxSineOfRationals theFloat + if approxSineOfRationalsResult? + return approxSineOfRationalsResult + + approxSineOfRationalMultiplesOfPIResult = approxSineOfRationalMultiplesOfPI theFloat + if approxSineOfRationalMultiplesOfPIResult? + return approxSineOfRationalMultiplesOfPIResult + + return null + +approxSineOfRationals = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + # we only check very simple rationals because they begin to get tricky + # quickly, also they collide often with the "rational of pi" hypothesis. + # For example sin(11) is veeery close to 1 (-0.99999020655) + # (see: http://mathworld.wolfram.com/AlmostInteger.html ) + # we stop at rationals that mention up to 10 + for i in [1..4] + for j in [1..4] + #console.log "i,j: " + i + "," + j + fraction = i/j + hypothesis = Math.sin(fraction) + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + if error < 2 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * sin( " + i + "/" + j + " )" + #console.log result + " error: " + error + bestResultSoFar = [result, approx_sine_of_rational, likelyMultiplier, i, j] + + return bestResultSoFar + +approxSineOfRationalMultiplesOfPI = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + bestResultSoFar = null + minimumComplexity = Number.MAX_VALUE + + # check rational multiples of pi + for i in [1..13] + for j in [1..13] + #console.log "i,j: " + i + "," + j + fraction = i/j + hypothesis = Math.sin(Math.PI * fraction) + #console.log "hypothesis: " + hypothesis + if Math.abs(hypothesis) > 1e-10 + ratio = theFloat/hypothesis + likelyMultiplier = Math.round(ratio) + #console.log "ratio: " + ratio + error = Math.abs(1 - ratio/likelyMultiplier) + else + ratio = 1 + likelyMultiplier = 1 + error = Math.abs(theFloat - hypothesis) + #console.log "error: " + error + # magic number 23 comes from the case sin(pi/10) + if error < 23 * precision + complexity = simpleComplexityMeasure likelyMultiplier, i, j + if complexity < minimumComplexity + #console.log "MINIMUM MULTIPLIER SO FAR" + minimumComplexity = complexity + result = likelyMultiplier + " * sin( " + i + "/" + j + " * pi )" + #console.log result + " error: " + error + bestResultSoFar = [result, approx_sine_of_pi_times_rational, likelyMultiplier, i, j] + + return bestResultSoFar + +approxAll = (theFloat) -> + splitBeforeAndAfterDot = theFloat.toString().split(".") + + if splitBeforeAndAfterDot.length == 2 + numberOfDigitsAfterTheDot = splitBeforeAndAfterDot[1].length + precision = 1/Math.pow(10,numberOfDigitsAfterTheDot) + else + return ["" + Math.floor(theFloat), approx_just_an_integer, Math.floor(theFloat), 1, 2] + + console.log "precision: " + precision + + constantsSumMin = Number.MAX_VALUE + constantsSum = 0 + bestApproxSoFar = null + + LOG_EXPLANATIONS = true + + approxRadicalsResult = approxRadicals theFloat + if approxRadicalsResult? + constantsSum = simpleComplexityMeasure approxRadicalsResult + if constantsSum < constantsSumMin + if LOG_EXPLANATIONS then console.log "better explanation by approxRadicals: " + approxRadicalsResult + " complexity: " + constantsSum + constantsSumMin = constantsSum + bestApproxSoFar = approxRadicalsResult + else + if LOG_EXPLANATIONS then console.log "subpar explanation by approxRadicals: " + approxRadicalsResult + " complexity: " + constantsSum + + approxLogsResult = approxLogs(theFloat) + if approxLogsResult? + constantsSum = simpleComplexityMeasure approxLogsResult + if constantsSum < constantsSumMin + if LOG_EXPLANATIONS then console.log "better explanation by approxLogs: " + approxLogsResult + " complexity: " + constantsSum + constantsSumMin = constantsSum + bestApproxSoFar = approxLogsResult + else + if LOG_EXPLANATIONS then console.log "subpar explanation by approxLogs: " + approxLogsResult + " complexity: " + constantsSum + + approxRationalsOfPowersOfEResult = approxRationalsOfPowersOfE(theFloat) + if approxRationalsOfPowersOfEResult? + constantsSum = simpleComplexityMeasure approxRationalsOfPowersOfEResult + if constantsSum < constantsSumMin + if LOG_EXPLANATIONS then console.log "better explanation by approxRationalsOfPowersOfE: " + approxRationalsOfPowersOfEResult + " complexity: " + constantsSum + constantsSumMin = constantsSum + bestApproxSoFar = approxRationalsOfPowersOfEResult + else + if LOG_EXPLANATIONS then console.log "subpar explanation by approxRationalsOfPowersOfE: " + approxRationalsOfPowersOfEResult + " complexity: " + constantsSum + + approxRationalsOfPowersOfPIResult = approxRationalsOfPowersOfPI(theFloat) + if approxRationalsOfPowersOfPIResult? + constantsSum = simpleComplexityMeasure approxRationalsOfPowersOfPIResult + if constantsSum < constantsSumMin + if LOG_EXPLANATIONS then console.log "better explanation by approxRationalsOfPowersOfPI: " + approxRationalsOfPowersOfPIResult + " complexity: " + constantsSum + constantsSumMin = constantsSum + bestApproxSoFar = approxRationalsOfPowersOfPIResult + else + if LOG_EXPLANATIONS then console.log "subpar explanation by approxRationalsOfPowersOfPI: " + approxRationalsOfPowersOfPIResult + " complexity: " + constantsSum + + approxTrigonometricResult = approxTrigonometric(theFloat) + if approxTrigonometricResult? + constantsSum = simpleComplexityMeasure approxTrigonometricResult + if constantsSum < constantsSumMin + if LOG_EXPLANATIONS then console.log "better explanation by approxTrigonometric: " + approxTrigonometricResult + " complexity: " + constantsSum + constantsSumMin = constantsSum + bestApproxSoFar = approxTrigonometricResult + else + if LOG_EXPLANATIONS then console.log "subpar explanation by approxTrigonometric: " + approxTrigonometricResult + " complexity: " + constantsSum + + + return bestApproxSoFar + +simpleComplexityMeasure = (aResult, b, c) -> + + theSum = null + + if aResult instanceof Array + + # we want PI and E to somewhat increase the + # complexity of the expression, so basically they count + # more than any integer lower than 3, i.e. we consider + # 1,2,3 to be more fundamental than PI or E. + switch aResult[1] + when approx_sine_of_pi_times_rational + theSum = 4 + # exponents of PI and E need to be penalised as well + # otherwise they come to explain any big number + # so we count them just as much as the multiplier + when approx_rationalOfPi + theSum = Math.pow(4,Math.abs(aResult[3])) * Math.abs(aResult[2]) + when approx_rationalOfE + theSum = Math.pow(3,Math.abs(aResult[3])) * Math.abs(aResult[2]) + else theSum = 0 + + theSum += Math.abs(aResult[2]) * (Math.abs(aResult[3]) + Math.abs(aResult[4])) + else + theSum += Math.abs(aResult) * (Math.abs(b) + Math.abs(c)) + + # heavily discount unit constants + + if aResult[2] == 1 + theSum -= 1 + else + theSum += 1 + + if aResult[3] == 1 + theSum -= 1 + else + theSum += 1 + + if aResult[4] == 1 + theSum -= 1 + else + theSum += 1 + + if theSum < 0 + theSum = 0 + + return theSum + + +testApprox = () -> + + for i in [2,3,5,6,7,8,10] + for j in [2,3,5,6,7,8,10] + if i == j then continue # this is just 1 + console.log "testapproxRadicals testing: " + "1 * sqrt( " + i + " ) / " + j + fraction = i/j + value = Math.sqrt(i)/j + returned = approxRadicals(value) + returnedValue = returned[2] * Math.sqrt(returned[3])/returned[4] + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail testapproxRadicals: " + "1 * sqrt( " + i + " ) / " + j + " . obtained: " + returned + + for i in [2,3,5,6,7,8,10] + for j in [2,3,5,6,7,8,10] + if i == j then continue # this is just 1 + console.log "testapproxRadicals testing with 4 digits: " + "1 * sqrt( " + i + " ) / " + j + fraction = i/j + originalValue = Math.sqrt(i)/j + value = originalValue.toFixed(4) + returned = approxRadicals(value) + returnedValue = returned[2] * Math.sqrt(returned[3])/returned[4] + if Math.abs(originalValue - returnedValue) > 1e-15 + console.log "fail testapproxRadicals with 4 digits: " + "1 * sqrt( " + i + " ) / " + j + " . obtained: " + returned + + for i in [2,3,5,6,7,8,10] + for j in [2,3,5,6,7,8,10] + if i == j then continue # this is just 1 + console.log "testapproxRadicals testing: " + "1 * sqrt( " + i + " / " + j + " )" + fraction = i/j + value = Math.sqrt(i/j) + returned = approxRadicals(value) + if returned? + returnedValue = returned[2] * Math.sqrt(returned[3]/returned[4]) + if returned[1] == approx_radicalOfRatio and Math.abs(value - returnedValue) > 1e-15 + console.log "fail testapproxRadicals: " + "1 * sqrt( " + i + " / " + j + " ) . obtained: " + returned + + for i in [1,2,3,5,6,7,8,10] + for j in [1,2,3,5,6,7,8,10] + if i == 1 and j == 1 then continue + console.log "testapproxRadicals testing with 4 digits:: " + "1 * sqrt( " + i + " / " + j + " )" + fraction = i/j + originalValue = Math.sqrt(i/j) + value = originalValue.toFixed(4) + returned = approxRadicals(value) + returnedValue = returned[2] * Math.sqrt(returned[3]/returned[4]) + if returned[1] == approx_radicalOfRatio and Math.abs(originalValue - returnedValue) > 1e-15 + console.log "fail testapproxRadicals with 4 digits:: " + "1 * sqrt( " + i + " / " + j + " ) . obtained: " + returned + + for i in [1..5] + for j in [1..5] + console.log "testApproxAll testing: " + "1 * log(" + i + " ) / " + j + fraction = i/j + value = Math.log(i)/j + returned = approxAll(value) + returnedValue = returned[2] * Math.log(returned[3])/returned[4] + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail testApproxAll: " + "1 * log(" + i + " ) / " + j + " . obtained: " + returned + + for i in [1..5] + for j in [1..5] + console.log "testApproxAll testing with 4 digits: " + "1 * log(" + i + " ) / " + j + fraction = i/j + originalValue = Math.log(i)/j + value = originalValue.toFixed(4) + returned = approxAll(value) + returnedValue = returned[2] * Math.log(returned[3])/returned[4] + if Math.abs(originalValue - returnedValue) > 1e-15 + console.log "fail testApproxAll with 4 digits: " + "1 * log(" + i + " ) / " + j + " . obtained: " + returned + + for i in [1..5] + for j in [1..5] + console.log "testApproxAll testing: " + "1 * log(" + i + " / " + j + " )" + fraction = i/j + value = Math.log(i/j) + returned = approxAll(value) + returnedValue = returned[2] * Math.log(returned[3]/returned[4]) + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail testApproxAll: " + "1 * log(" + i + " / " + j + " )" + " . obtained: " + returned + + for i in [1..5] + for j in [1..5] + console.log "testApproxAll testing with 4 digits: " + "1 * log(" + i + " / " + j + " )" + fraction = i/j + originalValue = Math.log(i/j) + value = originalValue.toFixed(4) + returned = approxAll(value) + returnedValue = returned[2] * Math.log(returned[3]/returned[4]) + if Math.abs(originalValue - returnedValue) > 1e-15 + console.log "fail testApproxAll with 4 digits: " + "1 * log(" + i + " / " + j + " )" + " . obtained: " + returned + + for i in [1..2] + for j in [1..12] + console.log "testApproxAll testing: " + "1 * (e ^ " + i + " ) / " + j + fraction = i/j + value = Math.pow(Math.E,i)/j + returned = approxAll(value) + returnedValue = returned[2] * Math.pow(Math.E,returned[3])/returned[4] + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail testApproxAll: " + "1 * (e ^ " + i + " ) / " + j + " . obtained: " + returned + + for i in [1..2] + for j in [1..12] + console.log "approxRationalsOfPowersOfE testing with 4 digits: " + "1 * (e ^ " + i + " ) / " + j + fraction = i/j + originalValue = Math.pow(Math.E,i)/j + value = originalValue.toFixed(4) + returned = approxRationalsOfPowersOfE(value) + returnedValue = returned[2] * Math.pow(Math.E,returned[3])/returned[4] + if Math.abs(originalValue - returnedValue) > 1e-15 + console.log "fail approxRationalsOfPowersOfE with 4 digits: " + "1 * (e ^ " + i + " ) / " + j + " . obtained: " + returned + + for i in [1..2] + for j in [1..12] + console.log "testApproxAll testing: " + "1 * pi ^ " + i + " / " + j + fraction = i/j + value = Math.pow(Math.PI,i)/j + returned = approxAll(value) + returnedValue = returned[2] * Math.pow(Math.PI,returned[3])/returned[4] + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail testApproxAll: " + "1 * pi ^ " + i + " / " + j + " ) . obtained: " + returned + + for i in [1..2] + for j in [1..12] + console.log "approxRationalsOfPowersOfPI testing with 4 digits: " + "1 * pi ^ " + i + " / " + j + fraction = i/j + originalValue = Math.pow(Math.PI,i)/j + value = originalValue.toFixed(4) + returned = approxRationalsOfPowersOfPI(value) + returnedValue = returned[2] * Math.pow(Math.PI,returned[3])/returned[4] + if Math.abs(originalValue - returnedValue) > 1e-15 + console.log "fail approxRationalsOfPowersOfPI with 4 digits: " + "1 * pi ^ " + i + " / " + j + " ) . obtained: " + returned + + for i in [1..4] + for j in [1..4] + console.log "testApproxAll testing: " + "1 * sin( " + i + "/" + j + " )" + fraction = i/j + value = Math.sin(fraction) + returned = approxAll(value) + returnedFraction = returned[3]/returned[4] + returnedValue = returned[2] * Math.sin(returnedFraction) + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail testApproxAll: " + "1 * sin( " + i + "/" + j + " ) . obtained: " + returned + + # 5 digits create no problem + for i in [1..4] + for j in [1..4] + console.log "testApproxAll testing with 5 digits: " + "1 * sin( " + i + "/" + j + " )" + fraction = i/j + originalValue = Math.sin(fraction) + value = originalValue.toFixed(5) + returned = approxAll(value) + if !returned? + console.log "fail testApproxAll with 5 digits: " + "1 * sin( " + i + "/" + j + " ) . obtained: undefined " + returnedFraction = returned[3]/returned[4] + returnedValue = returned[2] * Math.sin(returnedFraction) + error = Math.abs(originalValue - returnedValue) + if error > 1e-14 + console.log "fail testApproxAll with 5 digits: " + "1 * sin( " + i + "/" + j + " ) . obtained: " + returned + " error: " + error + + # 4 digits create two collisions + for i in [1..4] + for j in [1..4] + + console.log "testApproxAll testing with 4 digits: " + "1 * sin( " + i + "/" + j + " )" + fraction = i/j + originalValue = Math.sin(fraction) + value = originalValue.toFixed(4) + returned = approxAll(value) + if !returned? + console.log "fail testApproxAll with 4 digits: " + "1 * sin( " + i + "/" + j + " ) . obtained: undefined " + returnedFraction = returned[3]/returned[4] + returnedValue = returned[2] * Math.sin(returnedFraction) + error = Math.abs(originalValue - returnedValue) + if error > 1e-14 + console.log "fail testApproxAll with 4 digits: " + "1 * sin( " + i + "/" + j + " ) . obtained: " + returned + " error: " + error + + value = 0 + if approxAll(value)[0] != "0" then console.log "fail testApproxAll: 0" + + value = 0.0 + if approxAll(value)[0] != "0" then console.log "fail testApproxAll: 0.0" + + value = 0.00 + if approxAll(value)[0] != "0" then console.log "fail testApproxAll: 0.00" + + value = 0.000 + if approxAll(value)[0] != "0" then console.log "fail testApproxAll: 0.000" + + value = 0.0000 + if approxAll(value)[0] != "0" then console.log "fail testApproxAll: 0.0000" + + value = 1 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1" + + value = 1.0 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1.0" + + value = 1.00 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1.00" + + value = 1.000 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1.000" + + value = 1.0000 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1.0000" + + value = 1.00000 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1.00000" + + value = Math.sqrt(2) + if approxAll(value)[0] != "1 * sqrt( 2 ) / 1" then console.log "fail testApproxAll: Math.sqrt(2)" + + value = 1.41 + if approxAll(value)[0] != "1 * sqrt( 2 ) / 1" then console.log "fail testApproxAll: 1.41" + + # if we narrow down to a particular family then we can get + # an OK guess even with few digits, expecially for really "famous" numbers + + value = 1.4 + if approxRadicals(value)[0] != "1 * sqrt( 2 ) / 1" then console.log "fail approxRadicals: 1.4" + + value = 0.6 + if approxLogs(value)[0] != "1 * log( 2 ) / 1" then console.log "fail approxLogs: 0.6" + + value = 0.69 + if approxLogs(value)[0] != "1 * log( 2 ) / 1" then console.log "fail approxLogs: 0.69" + + value = 0.7 + if approxLogs(value)[0] != "1 * log( 2 ) / 1" then console.log "fail approxLogs: 0.7" + + value = 1.09 + if approxLogs(value)[0] != "1 * log( 3 ) / 1" then console.log "fail approxLogs: 1.09" + + value = 1.09 + if approxAll(value)[0] != "1 * log( 3 ) / 1" then console.log "fail approxAll: 1.09" + + value = 1.098 + if approxAll(value)[0] != "1 * log( 3 ) / 1" then console.log "fail approxAll: 1.098" + + value = 1.1 + if approxAll(value)[0] != "1 * log( 3 ) / 1" then console.log "fail approxAll: 1.1" + + value = 1.11 + if approxAll(value)[0] != "1 * log( 3 ) / 1" then console.log "fail approxAll: 1.11" + + value = Math.sqrt(3) + if approxAll(value)[0] != "1 * sqrt( 3 ) / 1" then console.log "fail testApproxAll: Math.sqrt(3)" + + value = 1.0000 + if approxAll(value)[0] != "1" then console.log "fail testApproxAll: 1.0000" + + + value = 3.141592 + if approxAll(value)[0] != "1 * (pi ^ 1 ) / 1 )" then console.log "fail testApproxAll: 3.141592" + + value = 31.41592 + if approxAll(value)[0] != "10 * (pi ^ 1 ) / 1 )" then console.log "fail testApproxAll: 31.41592" + + value = 314.1592 + if approxAll(value)[0] != "100 * (pi ^ 1 ) / 1 )" then console.log "fail testApproxAll: 314.1592" + + value = 31415926.53589793 + if approxAll(value)[0] != "10000000 * (pi ^ 1 ) / 1 )" then console.log "fail testApproxAll: 31415926.53589793" + + value = Math.sqrt(2) + if approxTrigonometric(value)[0] != "2 * sin( 1/4 * pi )" then console.log "fail approxTrigonometric: Math.sqrt(2)" + + value = Math.sqrt(3) + if approxTrigonometric(value)[0] != "2 * sin( 1/3 * pi )" then console.log "fail approxTrigonometric: Math.sqrt(3)" + + value = (Math.sqrt(6) - Math.sqrt(2))/4 + if approxAll(value)[0] != "1 * sin( 1/12 * pi )" then console.log "fail testApproxAll: (Math.sqrt(6) - Math.sqrt(2))/4" + + value = Math.sqrt(2 - Math.sqrt(2))/2 + if approxAll(value)[0] != "1 * sin( 1/8 * pi )" then console.log "fail testApproxAll: Math.sqrt(2 - Math.sqrt(2))/2" + + value = (Math.sqrt(6) + Math.sqrt(2))/4 + if approxAll(value)[0] != "1 * sin( 5/12 * pi )" then console.log "fail testApproxAll: (Math.sqrt(6) + Math.sqrt(2))/4" + + value = Math.sqrt(2 + Math.sqrt(3))/2 + if approxAll(value)[0] != "1 * sin( 5/12 * pi )" then console.log "fail testApproxAll: Math.sqrt(2 + Math.sqrt(3))/2" + + value = (Math.sqrt(5) - 1)/4 + if approxAll(value)[0] != "1 * sin( 1/10 * pi )" then console.log "fail testApproxAll: (Math.sqrt(5) - 1)/4" + + value = Math.sqrt(10 - 2*Math.sqrt(5))/4 + if approxAll(value)[0] != "1 * sin( 1/5 * pi )" then console.log "fail testApproxAll: Math.sqrt(10 - 2*Math.sqrt(5))/4" + + # this has a radical form but it's too long to write + value = Math.sin(Math.PI/7) + if approxAll(value)[0] != "1 * sin( 1/7 * pi )" then console.log "fail testApproxAll: Math.sin(Math.PI/7)" + + # this has a radical form but it's too long to write + value = Math.sin(Math.PI/9) + if approxAll(value)[0] != "1 * sin( 1/9 * pi )" then console.log "fail testApproxAll: Math.sin(Math.PI/9)" + + value = 1836.15267 + if approxRationalsOfPowersOfPI(value)[0] != "6 * (pi ^ 5 ) / 1 )" then console.log "fail approxRationalsOfPowersOfPI: 1836.15267" + + + for i in [1..13] + for j in [1..13] + console.log "approxTrigonometric testing: " + "1 * sin( " + i + "/" + j + " * pi )" + fraction = i/j + value = Math.sin(Math.PI * fraction) + # we specifically search for sines of rational multiples of PI + # because too many of them would be picked up as simple + # rationals. + returned = approxTrigonometric(value) + returnedFraction = returned[3]/returned[4] + returnedValue = returned[2] * Math.sin(Math.PI * returnedFraction) + if Math.abs(value - returnedValue) > 1e-15 + console.log "fail approxTrigonometric: " + "1 * sin( " + i + "/" + j + " * pi ) . obtained: " + returned + + for i in [1..13] + for j in [1..13] + + # with four digits, there are two collisions with the + # "simple fraction" argument hypotesis, which we prefer since + # it's a simpler expression, so let's skip those + # two tests + if i == 5 and j == 11 or + i == 6 and j == 11 + continue + + console.log "approxTrigonometric testing with 4 digits: " + "1 * sin( " + i + "/" + j + " * pi )" + fraction = i/j + originalValue = Math.sin(Math.PI * fraction) + value = originalValue.toFixed(4) + # we specifically search for sines of rational multiples of PI + # because too many of them would be picked up as simple + # rationals. + returned = approxTrigonometric(value) + returnedFraction = returned[3]/returned[4] + returnedValue = returned[2] * Math.sin(Math.PI * returnedFraction) + error = Math.abs(originalValue - returnedValue) + if error > 1e-14 + console.log "fail approxTrigonometric with 4 digits: " + "1 * sin( " + i + "/" + j + " * pi ) . obtained: " + returned + " error: " + error + + console.log "testApprox done" + +$.approxRadicals = approxRadicals +$.approxRationalsOfLogs = approxRationalsOfLogs +$.approxAll = approxAll +$.testApprox = testApprox diff --git a/node_modules/algebrite/sources/arccos.coffee b/node_modules/algebrite/sources/arccos.coffee new file mode 100644 index 0000000..75c1f15 --- /dev/null +++ b/node_modules/algebrite/sources/arccos.coffee @@ -0,0 +1,152 @@ +### arccos ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the inverse cosine of x. + +### + + +Eval_arccos = -> + push(cadr(p1)) + Eval() + arccos() + +arccos = -> + n = 0 + d = 0.0 + + save() + + p1 = pop() + + if (car(p1) == symbol(COS)) + push(cadr(p1)) + restore() + return + + if (isdouble(p1)) + errno = 0 + d = Math.acos(p1.d) + if (errno) + stop("arccos function argument is not in the interval [-1,1]") + push_double(d) + restore() + return + + # if p1 == 1/sqrt(2) then return 1/4*pi (45 degrees) + # second if catches the other way of saying it, sqrt(2)/2 + + if (isoneoversqrttwo(p1)) or + (car(p1) == symbol(MULTIPLY) && equalq(car(cdr(p1)), 1,2) and car(car(cdr(cdr(p1)))) == symbol(POWER) && equaln(car(cdr(car(cdr(cdr(p1))))),2) && equalq(car(cdr(cdr(car(cdr(cdr(p1)))))), 1, 2)) + if evaluatingAsFloats + push_double(Math.PI / 4.0) + else + push_rational(1, 4) + push_symbol(PI) + multiply() + restore() + return + + # if p1 == -1/sqrt(2) then return 3/4*pi (135 degrees) + # second if catches the other way of saying it, -sqrt(2)/2 + + if (isminusoneoversqrttwo(p1)) or + (car(p1) == symbol(MULTIPLY) && equalq(car(cdr(p1)), -1,2) and car(car(cdr(cdr(p1)))) == symbol(POWER) && equaln(car(cdr(car(cdr(cdr(p1))))),2) && equalq(car(cdr(cdr(car(cdr(cdr(p1)))))), 1, 2)) + if evaluatingAsFloats + push_double(Math.PI * 3.0 / 4.0) + else + push_rational(3, 4) + push_symbol(PI) + multiply() + restore() + return + + # if p1 == sqrt(3)/2 then return 1/6*pi (30 degrees) + if (issqrtthreeovertwo(p1)) + if evaluatingAsFloats + push_double(Math.PI / 6.0) + else + push_rational(1, 6) + push_symbol(PI) + multiply() + restore() + return + + # if p1 == -sqrt(3)/2 then return 5/6*pi (150 degrees) + if (isminussqrtthreeovertwo(p1)) + if evaluatingAsFloats + push_double(5.0 * Math.PI / 6.0) + else + push_rational(5, 6) + push_symbol(PI) + multiply() + restore() + return + + if (!isrational(p1)) + push_symbol(ARCCOS) + push(p1) + list(2) + restore() + return + + push(p1) + push_integer(2) + multiply() + n = pop_integer() + + switch (n) + + when -2 + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + + when -1 + if evaluatingAsFloats + push_double(Math.PI * 2.0 / 3.0) + else + push_rational(2, 3) + push_symbol(PI) + multiply() + + when 0 + if evaluatingAsFloats + push_double(Math.PI / 2.0) + else + push_rational(1, 2) + push_symbol(PI) + multiply() + + when 1 + if evaluatingAsFloats + push_double(Math.PI / 3.0) + else + push_rational(1, 3) + push_symbol(PI) + multiply() + + when 2 + if evaluatingAsFloats + push_double(0.0) + else + push(zero) + + else + push_symbol(ARCCOS) + push(p1) + list(2) + + restore() + + diff --git a/node_modules/algebrite/sources/arccosh.coffee b/node_modules/algebrite/sources/arccosh.coffee new file mode 100644 index 0000000..ff52eb9 --- /dev/null +++ b/node_modules/algebrite/sources/arccosh.coffee @@ -0,0 +1,50 @@ +### arccosh ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the inverse hyperbolic cosine of x. + +### + +Eval_arccosh = -> + push(cadr(p1)) + Eval() + arccosh() + +arccosh = -> + d = 0.0 + save() + p1 = pop() + if (car(p1) == symbol(COSH)) + push(cadr(p1)) + restore() + return + + if (isdouble(p1)) + d = p1.d + if (d < 1.0) + stop("arccosh function argument is less than 1.0") + d = Math.log(d + Math.sqrt(d * d - 1.0)) + push_double(d) + restore() + return + + if (isplusone(p1)) + push(zero) + restore() + return + + push_symbol(ARCCOSH) + push(p1) + list(2) + restore() + + diff --git a/node_modules/algebrite/sources/arcsin.coffee b/node_modules/algebrite/sources/arcsin.coffee new file mode 100644 index 0000000..c5a6061 --- /dev/null +++ b/node_modules/algebrite/sources/arcsin.coffee @@ -0,0 +1,151 @@ +### arcsin ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the inverse sine of x. + +### + +Eval_arcsin = -> + push(cadr(p1)) + Eval() + arcsin() + +arcsin = -> + n = 0 + d = 0 + + save() + + p1 = pop() + + if (car(p1) == symbol(SIN)) + push(cadr(p1)) + restore() + return + + if (isdouble(p1)) + errno = 0 + d = Math.asin(p1.d) + if (errno) + stop("arcsin function argument is not in the interval [-1,1]") + push_double(d) + restore() + return + + # if p1 == 1/sqrt(2) then return 1/4*pi (45 degrees) + # second if catches the other way of saying it, sqrt(2)/2 + + if (isoneoversqrttwo(p1)) or + (car(p1) == symbol(MULTIPLY) && equalq(car(cdr(p1)), 1,2) and car(car(cdr(cdr(p1)))) == symbol(POWER) && equaln(car(cdr(car(cdr(cdr(p1))))),2) && equalq(car(cdr(cdr(car(cdr(cdr(p1)))))), 1, 2)) + push_rational(1, 4) + push_symbol(PI) + multiply() + restore() + return + + # if p1 == -1/sqrt(2) then return -1/4*pi (-45 degrees) + # second if catches the other way of saying it, -sqrt(2)/2 + + if (isminusoneoversqrttwo(p1)) or + (car(p1) == symbol(MULTIPLY) && equalq(car(cdr(p1)), -1,2) and car(car(cdr(cdr(p1)))) == symbol(POWER) && equaln(car(cdr(car(cdr(cdr(p1))))),2) && equalq(car(cdr(cdr(car(cdr(cdr(p1)))))), 1, 2)) + if evaluatingAsFloats + push_double(-Math.PI / 4.0) + else + push_rational(-1, 4) + push_symbol(PI) + multiply() + restore() + return + + # if p1 == sqrt(3)/2 then return 1/3*pi (60 degrees) + if (issqrtthreeovertwo(p1)) + if evaluatingAsFloats + push_double(Math.PI / 3.0) + else + push_rational(1, 3) + push_symbol(PI) + multiply() + restore() + return + + # if p1 == -sqrt(3)/2 then return -1/3*pi (-60 degrees) + if (isminussqrtthreeovertwo(p1)) + if evaluatingAsFloats + push_double(-Math.PI / 3.0) + else + push_rational(-1, 3) + push_symbol(PI) + multiply() + restore() + return + + if (!isrational(p1)) + push_symbol(ARCSIN) + push(p1) + list(2) + restore() + return + + push(p1) + push_integer(2) + multiply() + n = pop_integer() + + switch (n) + + when -2 + if evaluatingAsFloats + push_double(-Math.PI / 2.0) + else + push_rational(-1, 2) + push_symbol(PI) + multiply() + + when -1 + if evaluatingAsFloats + push_double(-Math.PI / 6.0) + else + push_rational(-1, 6) + push_symbol(PI) + multiply() + + when 0 + if evaluatingAsFloats + push_double(0.0) + else + push(zero) + + when 1 + if evaluatingAsFloats + push_double(Math.PI / 6.0) + else + push_rational(1, 6) + push_symbol(PI) + multiply() + + when 2 + if evaluatingAsFloats + push_double(Math.PI / 2.0) + else + push_rational(1, 2) + push_symbol(PI) + multiply() + + else + push_symbol(ARCSIN) + push(p1) + list(2) + + restore() + + + diff --git a/node_modules/algebrite/sources/arcsinh.coffee b/node_modules/algebrite/sources/arcsinh.coffee new file mode 100644 index 0000000..c6b3cd5 --- /dev/null +++ b/node_modules/algebrite/sources/arcsinh.coffee @@ -0,0 +1,48 @@ +### arcsinh ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the inverse hyperbolic sine of x. + +### + +Eval_arcsinh = -> + push(cadr(p1)) + Eval() + arcsinh() + +arcsinh = -> + d = 0.0 + save() + p1 = pop() + if (car(p1) == symbol(SINH)) + push(cadr(p1)) + restore() + return + + if (isdouble(p1)) + d = p1.d + d = Math.log(d + Math.sqrt(d * d + 1.0)) + push_double(d) + restore() + return + + if (isZeroAtomOrTensor(p1)) + push(zero) + restore() + return + + push_symbol(ARCSINH) + push(p1) + list(2) + restore() + + diff --git a/node_modules/algebrite/sources/arctan.coffee b/node_modules/algebrite/sources/arctan.coffee new file mode 100644 index 0000000..bab6756 --- /dev/null +++ b/node_modules/algebrite/sources/arctan.coffee @@ -0,0 +1,114 @@ +### arctan ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the inverse tangent of x. + +### + +Eval_arctan = -> + push(cadr(p1)) + Eval() + arctan() + +arctan = -> + d = 0 + + save() + + p1 = pop() + + if (car(p1) == symbol(TAN)) + push(cadr(p1)) + restore() + return + + if (isdouble(p1)) + errno = 0 + d = Math.atan(p1.d) + if (errno) + stop("arctan function error") + push_double(d) + restore() + return + + if (isZeroAtomOrTensor(p1)) + push(zero) + restore() + return + + if (isnegative(p1)) + push(p1) + negate() + arctan() + negate() + restore() + return + + # arctan(sin(a) / cos(a)) ? + + if (Find(p1, symbol(SIN)) && Find(p1, symbol(COS))) + push(p1) + numerator() + p2 = pop() + push(p1) + denominator() + p3 = pop() + if (car(p2) == symbol(SIN) && car(p3) == symbol(COS) && equal(cadr(p2), cadr(p3))) + push(cadr(p2)) + restore() + return + + # arctan(1/sqrt(3)) -> pi/6 + # second if catches the other way of saying it, sqrt(3)/3 + + if (car(p1) == symbol(POWER) && equaln(cadr(p1), 3) && equalq(caddr(p1), -1, 2)) or + (car(p1) == symbol(MULTIPLY) && equalq(car(cdr(p1)), 1,3) and car(car(cdr(cdr(p1)))) == symbol(POWER) && equaln(car(cdr(car(cdr(cdr(p1))))),3) && equalq(car(cdr(cdr(car(cdr(cdr(p1)))))), 1, 2)) + push_rational(1, 6) + if evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + multiply() + restore() + return + + # arctan(1) -> pi/4 + + if (equaln(p1, 1)) + push_rational(1, 4) + if evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + multiply() + restore() + return + + # arctan(sqrt(3)) -> pi/3 + + if (car(p1) == symbol(POWER) && equaln(cadr(p1), 3) && equalq(caddr(p1), 1, 2)) + push_rational(1, 3) + if evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + multiply() + restore() + return + + push_symbol(ARCTAN) + push(p1) + list(2) + + restore() + + diff --git a/node_modules/algebrite/sources/arctanh.coffee b/node_modules/algebrite/sources/arctanh.coffee new file mode 100644 index 0000000..d915931 --- /dev/null +++ b/node_modules/algebrite/sources/arctanh.coffee @@ -0,0 +1,51 @@ +### arctanh ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the inverse hyperbolic tangent of x. + +### + +Eval_arctanh = -> + push(cadr(p1)) + Eval() + arctanh() + +arctanh = -> + d = 0.0 + save() + p1 = pop() + if (car(p1) == symbol(TANH)) + push(cadr(p1)) + restore() + return + + if (isdouble(p1)) + d = p1.d + if (d < -1.0 || d > 1.0) + stop("arctanh function argument is not in the interval [-1,1]") + d = Math.log((1.0 + d) / (1.0 - d)) / 2.0 + push_double(d) + restore() + return + + if (isZeroAtomOrTensor(p1)) + push(zero) + restore() + return + + push_symbol(ARCTANH) + push(p1) + list(2) + restore() + + + diff --git a/node_modules/algebrite/sources/arg.coffee b/node_modules/algebrite/sources/arg.coffee new file mode 100644 index 0000000..114b29f --- /dev/null +++ b/node_modules/algebrite/sources/arg.coffee @@ -0,0 +1,192 @@ +### arg ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +z + +General description +------------------- +Returns the angle of complex z. + +### + +### + Argument (angle) of complex z + + z arg(z) + - ------ + + a 0 + + -a -pi See note 3 below + + (-1)^a a pi + + exp(a + i b) b + + a b arg(a) + arg(b) + + a + i b arctan(b/a) + +Result by quadrant + + z arg(z) + - ------ + + 1 + i 1/4 pi + + 1 - i -1/4 pi + + -1 + i 3/4 pi + + -1 - i -3/4 pi + +Notes + + 1. Handles mixed polar and rectangular forms, e.g. 1 + exp(i pi/3) + + 2. Symbols in z are assumed to be positive and real. + + 3. Negative direction adds -pi to angle. + + Example: z = (-1)^(1/3), abs(z) = 1/3 pi, abs(-z) = -2/3 pi + + 4. jean-francois.debroux reports that when z=(a+i*b)/(c+i*d) then + + arg(numerator(z)) - arg(denominator(z)) + + must be used to get the correct answer. Now the operation is + automatic. +### + +DEBUG_ARG = false + +Eval_arg = -> + push(cadr(p1)) + Eval() + arg() + +arg = -> + save() + p1 = pop() + push(p1) + numerator() + yyarg() + push(p1) + denominator() + yyarg() + subtract() + restore() + +#define RE p2 +#define IM p3 + +yyarg = -> + save() + p1 = pop() + + # case of plain number + if (ispositivenumber(p1) or p1 == symbol(PI)) + if isdouble(p1) or evaluatingAsFloats + push_double(0) + else + push_integer(0) + else if (isnegativenumber(p1)) + if isdouble(p1) or evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + negate() + + # you'd think that something like + # arg(a) is always 0 when a is real but no, + # arg(a) is pi when a is negative so we have + # to leave unexpressed + else if (issymbol(p1)) + push_symbol(ARG) + push(p1) + list(2) + + else if (car(p1) == symbol(POWER) && equaln(cadr(p1), -1)) + # -1 to a power + if evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + push(caddr(p1)) + multiply() + else if (car(p1) == symbol(POWER) && cadr(p1) == symbol(E)) + # exponential + push(caddr(p1)) + imag() + # arg(a^(1/2)) is always equal to 1/2 * arg(a) + # this can obviously be made more generic TODO + else if (car(p1) == symbol(POWER) && isoneovertwo(caddr(p1))) + if DEBUG_ARG then console.log "arg of a sqrt: " + p1 + if DEBUG_ARG then debugger + push(cadr(p1)) + arg() + if DEBUG_ARG then console.log " = 1/2 * " + stack[tos-1] + push(caddr(p1)) + multiply() + else if (car(p1) == symbol(MULTIPLY)) + # product of factors + push_integer(0) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + arg() + add() + p1 = cdr(p1) + else if (car(p1) == symbol(ADD)) + # sum of terms + push(p1) + rect() + p1 = pop() + push(p1) + real() + p2 = pop() + push(p1) + imag() + p3 = pop() + if (isZeroAtomOrTensor(p2)) + if evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + if (isnegative(p3)) + negate() + else + push(p3) + push(p2) + divide() + arctan() + if (isnegative(p2)) + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + if (isnegative(p3)) + subtract(); # quadrant 1 -> 3 + else + add(); # quadrant 4 -> 2 + else + + if (!isZeroAtomOrTensor(get_binding(symbol(ASSUME_REAL_VARIABLES)))) + # if we assume all passed values are real + push_integer(0) + else + # if we don't assume all passed values are real, all + # we con do is to leave unexpressed + push_symbol(ARG) + push(p1) + list(2) + + + restore() + + diff --git a/node_modules/algebrite/sources/bake.coffee b/node_modules/algebrite/sources/bake.coffee new file mode 100644 index 0000000..ce126e3 --- /dev/null +++ b/node_modules/algebrite/sources/bake.coffee @@ -0,0 +1,159 @@ +# pretty print + + + +bake = -> + h = 0 + s = 0 + t = 0 + x = 0 + y = 0 + z = 0 + + expanding++ + + save() + + p1 = pop() + + s = ispolyexpandedform(p1, symbol(SYMBOL_S)) + t = ispolyexpandedform(p1, symbol(SYMBOL_T)) + x = ispolyexpandedform(p1, symbol(SYMBOL_X)) + y = ispolyexpandedform(p1, symbol(SYMBOL_Y)) + z = ispolyexpandedform(p1, symbol(SYMBOL_Z)) + + if (s == 1 && t == 0 && x == 0 && y == 0 && z == 0) + p2 = symbol(SYMBOL_S) + bake_poly() + else if (s == 0 && t == 1 && x == 0 && y == 0 && z == 0) + p2 = symbol(SYMBOL_T) + bake_poly() + else if (s == 0 && t == 0 && x == 1 && y == 0 && z == 0) + p2 = symbol(SYMBOL_X) + bake_poly() + else if (s == 0 && t == 0 && x == 0 && y == 1 && z == 0) + p2 = symbol(SYMBOL_Y) + bake_poly() + else if (s == 0 && t == 0 && x == 0 && y == 0 && z == 1) + p2 = symbol(SYMBOL_Z) + bake_poly() + # don't bake the contents of some constructs such as "for" + # because we don't want to evaluate the body of + # such constructs "statically", i.e. without fully running + # the loops. + else if (iscons(p1)) and car(p1) != symbol(FOR) + h = tos + push(car(p1)) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + bake() + p1 = cdr(p1) + list(tos - h) + else + push(p1) + + restore() + + expanding-- + +polyform = -> + h = 0 + + save() + + p2 = pop() + p1 = pop() + + if (ispolyexpandedform(p1, p2)) + bake_poly() + else if (iscons(p1)) + h = tos + push(car(p1)) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + polyform() + p1 = cdr(p1) + list(tos - h) + else + push(p1) + + restore() + +bake_poly = -> + h = 0 + i = 0 + k = 0 + n = 0 + #U **a + a = tos + k = coeff(p2, p1) + h = tos + for i in[(k - 1)..0] by -1 + p1 = stack[a+i] + bake_poly_term(i) + n = tos - h + if (n > 1) + list(n) + push(symbol(ADD)) + swap() + cons() + p1 = pop() + moveTos tos - k + push(p1) + +# p1 points to coefficient of p2 ^ k + +# k is an int +bake_poly_term = (k) -> + h = 0 + n = 0 + + if (isZeroAtomOrTensor(p1)) + return + + # constant term? + + if (k == 0) + if (car(p1) == symbol(ADD)) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + p1 = cdr(p1) + else + push(p1) + return + + h = tos + + # coefficient + + if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + p1 = cdr(p1) + else if (!equaln(p1, 1)) + push(p1) + + # x ^ k + + if (k == 1) + push(p2) + else + push(symbol(POWER)) + push(p2) + push_integer(k) + list(3) + + n = tos - h + + if (n > 1) + list(n) + push(symbol(MULTIPLY)) + swap() + cons() + + diff --git a/node_modules/algebrite/sources/besselj.coffee b/node_modules/algebrite/sources/besselj.coffee new file mode 100644 index 0000000..9eda8bb --- /dev/null +++ b/node_modules/algebrite/sources/besselj.coffee @@ -0,0 +1,193 @@ +### besselj ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x,n + +General description +------------------- + +Returns a solution to the Bessel differential equation (Bessel function of first kind). + +Recurrence relation: + + besselj(x,n) = (2/x) (n-1) besselj(x,n-1) - besselj(x,n-2) + + besselj(x,1/2) = sqrt(2/pi/x) sin(x) + + besselj(x,-1/2) = sqrt(2/pi/x) cos(x) + +For negative n, reorder the recurrence relation as: + + besselj(x,n-2) = (2/x) (n-1) besselj(x,n-1) - besselj(x,n) + +Substitute n+2 for n to obtain + + besselj(x,n) = (2/x) (n+1) besselj(x,n+1) - besselj(x,n+2) + +Examples: + + besselj(x,3/2) = (1/x) besselj(x,1/2) - besselj(x,-1/2) + + besselj(x,-3/2) = -(1/x) besselj(x,-1/2) - besselj(x,1/2) + +### + + + +Eval_besselj = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + besselj() + +besselj = -> + save() + yybesselj() + restore() + +#define X p1 +#define N p2 +#define SGN p3 + +yybesselj = -> + d = 0.0 + n = 0 + + p2 = pop() + p1 = pop() + + push(p2) + n = pop_integer() + + # numerical result + + if (isdouble(p1) && !isNaN(n)) + d = jn(n, p1.d) + push_double(d) + return + + # bessej(0,0) = 1 + + if (isZeroAtomOrTensor(p1) && isZeroAtomOrTensor(p2)) + push_integer(1) + return + + # besselj(0,n) = 0 + + if (isZeroAtomOrTensor(p1) && !isNaN(n)) + push_integer(0) + return + + # half arguments + + if (p2.k == NUM && MEQUAL(p2.q.b, 2)) + + # n = 1/2 + + if (MEQUAL(p2.q.a, 1)) + if evaluatingAsFloats + push_double(2.0 / Math.PI) + else + push_integer(2) + push_symbol(PI) + divide() + push(p1) + divide() + push_rational(1, 2) + power() + push(p1) + sine() + multiply() + return + + # n = -1/2 + + if (MEQUAL(p2.q.a, -1)) + if evaluatingAsFloats + push_double(2.0 / Math.PI) + else + push_integer(2) + push_symbol(PI) + divide() + push(p1) + divide() + push_rational(1, 2) + power() + push(p1) + cosine() + multiply() + return + + # besselj(x,n) = (2/x) (n-sgn(n)) besselj(x,n-sgn(n)) - besselj(x,n-2*sgn(n)) + + push_integer(MSIGN(p2.q.a)) + p3 = pop() + + push_integer(2) + push(p1) + divide() + push(p2) + push(p3) + subtract() + multiply() + push(p1) + push(p2) + push(p3) + subtract() + besselj() + multiply() + push(p1) + push(p2) + push_integer(2) + push(p3) + multiply() + subtract() + besselj() + subtract() + + return + + #if 0 # test cases needed + if (isnegativeterm(p1)) + push(p1) + negate() + push(p2) + power() + push(p1) + push(p2) + negate() + power() + multiply() + push_symbol(BESSELJ) + push(p1) + negate() + push(p2) + list(3) + multiply() + return + + if (isnegativeterm(p2)) + push_integer(-1) + push(p2) + power() + push_symbol(BESSELJ) + push(p1) + push(p2) + negate() + list(3) + multiply() + return + #endif + + push(symbol(BESSELJ)) + push(p1) + push(p2) + list(3) + + diff --git a/node_modules/algebrite/sources/bessely.coffee b/node_modules/algebrite/sources/bessely.coffee new file mode 100644 index 0000000..61d4e9d --- /dev/null +++ b/node_modules/algebrite/sources/bessely.coffee @@ -0,0 +1,66 @@ +### bessely ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x,n + +General description +------------------- + +Bessel function of second kind. + +### + + +Eval_bessely = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + bessely() + +bessely = -> + save() + yybessely() + restore() + +#define X p1 +#define N p2 + +yybessely = -> + d = 0.0 + n = 0 + + p2 = pop() + p1 = pop() + + push(p2) + n = pop_integer() + + if (isdouble(p1) && !isNaN(n)) + d = yn(n, p1.d) + push_double(d) + return + + if (isnegativeterm(p2)) + push_integer(-1) + push(p2) + power() + push_symbol(BESSELY) + push(p1) + push(p2) + negate() + list(3) + multiply() + return + + push_symbol(BESSELY) + push(p1) + push(p2) + list(3) + return + diff --git a/node_modules/algebrite/sources/bignum.coffee b/node_modules/algebrite/sources/bignum.coffee new file mode 100644 index 0000000..89d2ada --- /dev/null +++ b/node_modules/algebrite/sources/bignum.coffee @@ -0,0 +1,712 @@ + + + +#double convert_rational_to_double(U *) +#double convert_bignum_to_double(unsigned int *) +#int ge(unsigned int *, unsigned int *, int) + + + +mint = (a) -> + return bigInt a + +isSmall = (a) -> + a.geq(Number.MIN_SAFE_INTEGER) && a.leq(Number.MAX_SAFE_INTEGER) + +# b is +1 or -1, a is a bigint +setSignTo = (a,b) -> + if a.isPositive() + if b < 0 + return a.multiply bigInt -1 + else + # a is negative + if b > 0 + return a.multiply bigInt -1 + return a + + +makeSignSameAs = (a,b) -> + if a.isPositive() + if b.isNegative() + return a.multiply bigInt -1 + else + # a is negative + if b.isPositive() + return a.multiply bigInt -1 + return a + +makePositive = (a) -> + if a.isNegative() + return a.multiply bigInt -1 + return a + +# n is an int +### +mtotal = 0 +MP_MIN_SIZE = 2 +MP_MAX_FREE = 1000 + +mnew = (n) -> + if (n < MP_MIN_SIZE) + n = MP_MIN_SIZE + if (n == MP_MIN_SIZE && mfreecount) + p = free_stack[--mfreecount] + else + p = [] #(unsigned int *) malloc((n + 3) * sizeof (int)) + #if (p == 0) + # stop("malloc failure") + p[0] = n + mtotal += n + return p[3] +### + +# p is the index of array of ints +# !!! array wasn't passed here +### +free_stack = [] + +mfree = (array, p) -> + p -= 3 + mtotal -= array[p] + if (array[p] == MP_MIN_SIZE && mfreecount < MP_MAX_FREE) + free_stack[mfreecount++] = p + else + free(p) +### + +# convert int to bignum + +# n is an int +### +mint = (n) -> + p = mnew(1) + if (n < 0) + # !!! this is FU + # MSIGN(p) = -1 + fu = true + else + # !!! this is FU + #MSIGN(p) = 1 + fu = true + # !!! this is FU + #MLENGTH(p) = 1 + p[0] = Math.abs(n) + return p +### + +# copy bignum + +# a is an array of ints +### +mcopy = (a) -> + #unsigned int *b + + b = mnew(MLENGTH(a)) + + # !!! fu + #MSIGN(b) = MSIGN(a) + #MLENGTH(b) = MLENGTH(a) + + for i in [0...MLENGTH(a)] + b[i] = a[i] + + return b +### + + +### +# +# ge not invoked from anywhere - is you need ge +# just use the bigNum's ge implementation +# leaving it here just in case I decide to backport to C +# +# a >= b ? +# and and b arrays of ints, len is an int +ge = (a, b, len) -> + i = 0 + for i in [0...len] + if (a[i] == b[i]) + continue + else + break + if (a[i] >= b[i]) + return 1 + else + return 0 +### + +add_numbers = -> + a = 1.0 + b = 1.0 + + #if DEBUG then console.log("add_numbers adding numbers: " + print_list(stack[tos - 1]) + " and " + print_list(stack[tos - 2])) + + if (isrational(stack[tos - 1]) && isrational(stack[tos - 2])) + qadd() + return + + save() + + p2 = pop() + p1 = pop() + + if (isdouble(p1)) + a = p1.d + else + a = convert_rational_to_double(p1) + + if (isdouble(p2)) + b = p2.d + else + b = convert_rational_to_double(p2) + + theResult = a+b + push_double(theResult) + + restore() + +subtract_numbers = -> + a = 0.0 + b = 0.0 + + if (isrational(stack[tos - 1]) && isrational(stack[tos - 2])) + qsub() + return + + save() + + p2 = pop() + p1 = pop() + + if (isdouble(p1)) + a = p1.d + else + a = convert_rational_to_double(p1) + + if (isdouble(p2)) + b = p2.d + else + b = convert_rational_to_double(p2) + + push_double(a - b) + + restore() + +multiply_numbers = -> + a = 0.0 + b = 0.0 + + if (isrational(stack[tos - 1]) && isrational(stack[tos - 2])) + qmul() + return + + save() + + p2 = pop() + p1 = pop() + + if (isdouble(p1)) + a = p1.d + else + a = convert_rational_to_double(p1) + + if (isdouble(p2)) + b = p2.d + else + b = convert_rational_to_double(p2) + + push_double(a * b) + + restore() + +divide_numbers = -> + a = 0.0 + b = 0.0 + + if (isrational(stack[tos - 1]) && isrational(stack[tos - 2])) + qdiv() + return + + save() + + p2 = pop() + p1 = pop() + + if (isZeroAtomOrTensor(p2)) + stop("divide by zero") + + if (isdouble(p1)) + a = p1.d + else + a = convert_rational_to_double(p1) + + if (isdouble(p2)) + b = p2.d + else + b = convert_rational_to_double(p2) + + push_double(a / b) + + restore() + +invert_number = -> + #unsigned int *a, *b + + save() + + p1 = pop() + + if (isZeroAtomOrTensor(p1)) + stop("divide by zero") + + if (isdouble(p1)) + push_double(1 / p1.d) + restore() + return + + a = bigInt(p1.q.a) + b = bigInt(p1.q.b) + + b = makeSignSameAs(b,a) + a = setSignTo(a,1) + + p1 = new U() + p1.k = NUM + p1.q.a = b + p1.q.b = a + + push(p1) + + restore() + +# a and b are Us +compare_rationals = (a, b) -> + t = 0 + #unsigned int *ab, *ba + ab = mmul(a.q.a, b.q.b) + ba = mmul(a.q.b, b.q.a) + t = mcmp(ab, ba) + return t + +# a and b are Us +compare_numbers = (a,b) -> + x = 0.0 + y = 0.0 + if (isrational(a) && isrational(b)) + return compare_rationals(a, b) + if (isdouble(a)) + x = a.d + else + x = convert_rational_to_double(a) + if (isdouble(b)) + y = b.d + else + y = convert_rational_to_double(b) + if (x < y) + return -1 + if (x > y) + return 1 + return 0 + +negate_number = -> + save() + p1 = pop() + if (isZeroAtomOrTensor(p1)) + push(p1) + restore() + return + + switch (p1.k) + when NUM + p2 = new U() + p2.k = NUM + p2.q.a = bigInt(p1.q.a.multiply(bigInt.minusOne)) + p2.q.b = bigInt(p1.q.b) + push(p2) + when DOUBLE + push_double(-p1.d) + else + stop("bug caught in mp_negate_number") + restore() + +bignum_truncate = -> + #unsigned int *a + + save() + + p1 = pop() + + a = mdiv(p1.q.a, p1.q.b) + + p1 = new U() + + p1.k = NUM + + p1.q.a = a + p1.q.b = bigInt(1) + + push(p1) + + restore() + +mp_numerator = -> + save() + + p1 = pop() + + if (p1.k != NUM) + push(one) + restore() + return + + p2 = new U() + + p2.k = NUM + + p2.q.a = bigInt(p1.q.a) + p2.q.b = bigInt(1) + + push(p2) + + restore() + +mp_denominator = -> + save() + + p1 = pop() + + if (p1.k != NUM) + push(one) + restore() + return + + p2 = new U() + p2.k = NUM + p2.q.a = bigInt(p1.q.b) + p2.q.b = bigInt(1) + + push(p2) + + restore() + +# expo is an integer +bignum_power_number = (expo) -> + #unsigned int *a, *b, *t + + save() + + p1 = pop() + + a = mpow(p1.q.a, Math.abs(expo)) + b = mpow(p1.q.b, Math.abs(expo)) + + if (expo < 0) + # swap a and b + t = a + a = b + b = t + + a = makeSignSameAs(a,b) + b = setSignTo(b,1) + + p1 = new U() + + p1.k = NUM + + p1.q.a = a + p1.q.b = b + + push(p1) + + restore() + +# p an array of ints +convert_bignum_to_double = (p) -> + return p.toJSNumber() + +# p is a U +convert_rational_to_double = (p) -> + if !p.q? + debugger + quotientAndRemainder = p.q.a.divmod(p.q.b) + result = quotientAndRemainder.quotient + quotientAndRemainder.remainder / p.q.b.toJSNumber() + + return result + +# n an integer +new_integer = (n) -> + theNewInteger = new U() + theNewInteger.k = NUM + theNewInteger.q.a = bigInt(n) + theNewInteger.q.b = bigInt(1) + return theNewInteger + +# n an integer +push_integer = (n) -> + if DEBUG then console.log "pushing integer " + n + push new_integer(n) + +# d a double +push_double = (d) -> + save() + p1 = new U() + p1.k = DOUBLE + p1.d = d + push(p1) + restore() + +# a,b parts of a rational +push_rational = (a,b) -> + ### + save() + p1 = new U() + p1.k = NUM + p1.q.a = bigInt(a) + p1.q.b = bigInt(b) + ## FIXME -- normalize ## + push(p1) + restore() + ### + + p = new U() + p.k = NUM + p.q.a = bigInt(a) + p.q.b = bigInt(b) + push(p) + +pop_integer = -> + n = NaN + + save() + + p1 = pop() + + switch (p1.k) + + when NUM + if (isinteger(p1) && isSmall(p1.q.a)) + n = p1.q.a.toJSNumber() + + when DOUBLE + if DEBUG + console.log "popping integer but double is found" + if Math.floor(p1.d) == p1.d + if DEBUG + console.log "...altough it's an integer" + n = p1.d + + restore() + return n + +# p is a U, flag is an int +print_double = (p,flag) -> + accumulator = "" + buf = doubleToReasonableString(p.d) + if (flag == 1 && buf == '-') + accumulator += print_str(buf + 1) + else + accumulator += print_str(buf) + return accumulator + +# s is a string +bignum_scan_integer = (s) -> + #unsigned int *a + #char sign + + save() + scounter = 0 + + sign_ = s[scounter] + + if (sign_ == '+' || sign_ == '-') + scounter++ + + # !!!! some mess in here, added an argument + a = bigInt(s.substring(scounter)) + + p1 = new U() + + p1.k = NUM + + p1.q.a = a + p1.q.b = bigInt(1) + + push(p1) + + if (sign_ == '-') + negate() + + restore() + +# s a string +bignum_scan_float = (s) -> + push_double(parseFloat(s)) + +# gives the capability of printing the unsigned +# value. This is handy because printing of the sign +# might be taken care of "upstream" +# e.g. when printing a base elevated to a negative exponent +# prints the inverse of the base powered to the unsigned +# exponent. +# p is a U +print_number = (p, signed) -> + accumulator = "" + + denominatorString = "" + buf = "" + switch (p.k) + when NUM + aAsString = p.q.a.toString() + if !signed + if aAsString[0] == "-" + aAsString = aAsString.substring(1) + + if (printMode == PRINTMODE_LATEX and isfraction(p)) + aAsString = "\\frac{"+aAsString+"}{" + + accumulator += aAsString + + if (isfraction(p)) + if printMode != PRINTMODE_LATEX + accumulator += ("/") + denominatorString = p.q.b.toString() + if printMode == PRINTMODE_LATEX then denominatorString += "}" + + accumulator += denominatorString + + when DOUBLE + aAsString = doubleToReasonableString(p.d) + if !signed + if aAsString[0] == "-" + aAsString = aAsString.substring(1) + + accumulator += aAsString + + return accumulator + +gcd_numbers = -> + save() + + p2 = pop() + p1 = pop() + +# if (!isinteger(p1) || !isinteger(p2)) +# stop("integer args expected for gcd") + + p3 = new U() + + p3.k = NUM + + p3.q.a = mgcd(p1.q.a, p2.q.a) + p3.q.b = mgcd(p1.q.b, p2.q.b) + + p3.q.a = setSignTo(p3.q.a,1) + + push(p3) + + restore() + +pop_double = -> + d = 0.0 + save() + p1 = pop() + switch (p1.k) + when NUM + d = convert_rational_to_double(p1) + when DOUBLE + d = p1.d + else + d = 0.0 + restore() + return d + +bignum_float = -> + d = 0.0 + d = convert_rational_to_double(pop()) + push_double(d) + +#static unsigned int *__factorial(int) + +# n is an int +bignum_factorial = (n) -> + save() + p1 = new U() + p1.k = NUM + p1.q.a = __factorial(n) + p1.q.b = bigInt(1) + push(p1) + restore() + +# n is an int +__factorial = (n) -> + i = 0 + #unsigned int *a, *b, *t + + if (n == 0 || n == 1) + a = bigInt(1) + return a + + a = bigInt(2) + + b = bigInt(0) + + if 3 <= n + for i in [3..n] + b = bigInt(i) + t = mmul(a, b) + a = t + + + return a + +mask = [ + 0x00000001, + 0x00000002, + 0x00000004, + 0x00000008, + 0x00000010, + 0x00000020, + 0x00000040, + 0x00000080, + 0x00000100, + 0x00000200, + 0x00000400, + 0x00000800, + 0x00001000, + 0x00002000, + 0x00004000, + 0x00008000, + 0x00010000, + 0x00020000, + 0x00040000, + 0x00080000, + 0x00100000, + 0x00200000, + 0x00400000, + 0x00800000, + 0x01000000, + 0x02000000, + 0x04000000, + 0x08000000, + 0x10000000, + 0x20000000, + 0x40000000, + 0x80000000, +] + +# unsigned int *x, unsigned int k +mp_set_bit = (x, k) -> + console.log "not implemented yet" + debugger + x[k / 32] |= mask[k % 32] + +# unsigned int *x, unsigned int k +mp_clr_bit = (x,k) -> + console.log "not implemented yet" + debugger + x[k / 32] &= ~mask[k % 32] + +# unsigned int *a +mshiftright = (a) -> + a = a.shiftRight() + diff --git a/node_modules/algebrite/sources/binomial.coffee b/node_modules/algebrite/sources/binomial.coffee new file mode 100644 index 0000000..d59dc77 --- /dev/null +++ b/node_modules/algebrite/sources/binomial.coffee @@ -0,0 +1,63 @@ +# Binomial coefficient +# +# Input: tos-2 n +# +# tos-1 k +# +# Output: Binomial coefficient on stack +# +# binomial(n, k) = n! / k! / (n - k)! +# +# The binomial coefficient vanishes for k < 0 or k > n. (A=B, p. 19) + + + + +Eval_binomial = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + binomial() + +binomial = -> + save() + ybinomial() + restore() + +#define N p1 +#define K p2 + +ybinomial = -> + p2 = pop() + p1 = pop() + + if (BINOM_check_args() == 0) + push(zero) + return + + push(p1) + factorial() + + push(p2) + factorial() + + divide() + + push(p1) + push(p2) + subtract() + factorial() + + divide() + +BINOM_check_args = -> + if (isNumericAtom(p1) && lessp(p1, zero)) + return 0 + else if (isNumericAtom(p2) && lessp(p2, zero)) + return 0 + else if (isNumericAtom(p1) && isNumericAtom(p2) && lessp(p1, p2)) + return 0 + else + return 1 + diff --git a/node_modules/algebrite/sources/ceiling.coffee b/node_modules/algebrite/sources/ceiling.coffee new file mode 100644 index 0000000..224b7c5 --- /dev/null +++ b/node_modules/algebrite/sources/ceiling.coffee @@ -0,0 +1,61 @@ +### ceiling ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- + +Returns the smallest integer not less than x. + +### + + +Eval_ceiling = -> + push(cadr(p1)) + Eval() + ceiling() + +ceiling = -> + save() + yyceiling() + restore() + +yyceiling = -> + d = 0.0 + + p1 = pop() + + if (!isNumericAtom(p1)) + push_symbol(CEILING) + push(p1) + list(2) + return + + if (isdouble(p1)) + d = Math.ceil(p1.d) + push_double(d) + return + + if (isinteger(p1)) + push(p1) + return + + p3 = new U() + p3.k = NUM + p3.q.a = mdiv(p1.q.a, p1.q.b) + p3.q.b = mint(1) + push(p3) + + if (isnegativenumber(p1)) + doNothing = 1 + else + push_integer(1) + add() + + diff --git a/node_modules/algebrite/sources/choose.coffee b/node_modules/algebrite/sources/choose.coffee new file mode 100644 index 0000000..1308010 --- /dev/null +++ b/node_modules/algebrite/sources/choose.coffee @@ -0,0 +1,76 @@ +### choose ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +n,k + +General description +------------------- + +Returns the number of combinations of n items taken k at a time. + +For example, the number of five card hands is choose(52,5) + +``` + n! + choose(n,k) = ------------- + k! (n - k)! +``` +### + + +Eval_choose = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + choose() + +# Result vanishes for k < 0 or k > n. (A=B, p. 19) + +#define N p1 +#define K p2 + +choose = -> + save() + + p2 = pop() + p1 = pop() + + if (choose_check_args() == 0) + push_integer(0) + restore() + return + + push(p1) + factorial() + + push(p2) + factorial() + + divide() + + push(p1) + push(p2) + subtract() + factorial() + + divide() + + restore() + +choose_check_args = -> + if (isNumericAtom(p1) && lessp(p1, zero)) + return 0 + else if (isNumericAtom(p2) && lessp(p2, zero)) + return 0 + else if (isNumericAtom(p1) && isNumericAtom(p2) && lessp(p1, p2)) + return 0 + else + return 1 + + diff --git a/node_modules/algebrite/sources/circexp.coffee b/node_modules/algebrite/sources/circexp.coffee new file mode 100644 index 0000000..704dd91 --- /dev/null +++ b/node_modules/algebrite/sources/circexp.coffee @@ -0,0 +1,140 @@ +### circexp ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- + +Returns expression x with circular and hyperbolic functions converted to exponential forms. Sometimes this will simplify an expression. + +### + + +Eval_circexp = -> + push(cadr(p1)) + Eval() + + circexp() + + # normalize + + Eval() + +circexp = -> + i = 0 + h = 0 + save() + p1 = pop() + + if (car(p1) == symbol(COS)) + push(cadr(p1)) + expcos() + restore() + return + + if (car(p1) == symbol(SIN)) + push(cadr(p1)) + expsin() + restore() + return + + if (car(p1) == symbol(TAN)) + p1 = cadr(p1) + push(imaginaryunit) + push(p1) + multiply() + exponential() + p2 = pop() + push(imaginaryunit) + push(p1) + multiply() + negate() + exponential() + p3 = pop() + push(p3) + push(p2) + subtract() + push(imaginaryunit) + multiply() + push(p2) + push(p3) + add() + divide() + restore() + return + + if (car(p1) == symbol(COSH)) + p1 = cadr(p1) + push(p1) + exponential() + push(p1) + negate() + exponential() + add() + push_rational(1, 2) + multiply() + restore() + return + + if (car(p1) == symbol(SINH)) + p1 = cadr(p1) + push(p1) + exponential() + push(p1) + negate() + exponential() + subtract() + push_rational(1, 2) + multiply() + restore() + return + + if (car(p1) == symbol(TANH)) + p1 = cadr(p1) + push(p1) + push_integer(2) + multiply() + exponential() + p1 = pop() + push(p1) + push_integer(1) + subtract() + push(p1) + push_integer(1) + add() + divide() + restore() + return + + if (iscons(p1)) + h = tos + while (iscons(p1)) + push(car(p1)) + circexp() + p1 = cdr(p1) + list(tos - h) + restore() + return + + if (p1.k == TENSOR) + push(p1) + copy_tensor() + p1 = pop() + for i in [0...p1.tensor.nelem] + push(p1.tensor.elem[i]) + circexp() + p1.tensor.elem[i] = pop() + push(p1) + restore() + return + + push(p1) + restore() + + diff --git a/node_modules/algebrite/sources/clear.coffee b/node_modules/algebrite/sources/clear.coffee new file mode 100644 index 0000000..5045029 --- /dev/null +++ b/node_modules/algebrite/sources/clear.coffee @@ -0,0 +1,87 @@ +### clearall ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + + +General description +------------------- + +Completely wipes all variables from the environment. + + +### + + +Eval_clearall = -> + do_clearall() + push(symbol(NIL)) + +do_clearall = -> + if (test_flag == 0) + clear_term() + + do_clearPatterns() + clear_symbols() + defn() + codeGen = false + +# clearall from application GUI code +clearall = -> + run("clearall") + +# this transformation is done in run.coffee, see there +# for more info. +clearRenamedVariablesToAvoidBindingToExternalScope = -> + for i in [0...symtab.length] + if symtab[i].printname.indexOf("AVOID_BINDING_TO_EXTERNAL_SCOPE_VALUE") != -1 + # just clear it + symtab[i].k = SYM + symtab[i].printname = "" + binding[i] = symtab[i] + isSymbolReclaimable[i] = true + +### clear ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- + +Completely wipes a variable from the environment (while doing x = quote(x) just unassigns it). + +### + + +Eval_clear = -> + p2 = cdr(p1) + + while (iscons(p2)) + variableToBeCleared = car(p2) + #console.log variableToBeCleared + "" + + + if (variableToBeCleared.k != SYM) + stop("symbol error") + + #console.log "getting binding of " + p.toString() + #if p.toString() == "aaa" + # debugger + + indexFound = symtab.indexOf(variableToBeCleared) + symtab[indexFound].k = SYM + symtab[indexFound].printname = "" + binding[indexFound] = symtab[indexFound] + isSymbolReclaimable[indexFound] = true + + + p2 = cdr(p2) + + push(symbol(NIL)) diff --git a/node_modules/algebrite/sources/clock.coffee b/node_modules/algebrite/sources/clock.coffee new file mode 100644 index 0000000..45cac5f --- /dev/null +++ b/node_modules/algebrite/sources/clock.coffee @@ -0,0 +1,78 @@ +### + Convert complex z to clock form + + Input: push z + + Output: Result on stack + + clock(z) = abs(z) * (-1) ^ (arg(z) / pi) + + For example, clock(exp(i pi/3)) gives the result (-1)^(1/3) +### + +# P.S. I couldn't find independent definition/aknowledgment +# of the naming "clock form" anywhere on the web, seems like a +# naming specific to eigenmath. +# Clock form is another way to express a complex number, and +# it has three advantages +# 1) it's uniform with how for example +# i is expressed i.e. (-1)^(1/2) +# 2) it's very compact +# 3) it's a straighforward notation for roots of 1 and -1 + + +DEBUG_CLOCKFORM = false + +Eval_clock = -> + push(cadr(p1)) + Eval() + clockform() + +clockform = -> + save() + #if 1 + p1 = pop() + push(p1) + abs() + if DEBUG_CLOCKFORM then console.log "clockform: abs of " + p1 + " : " + stack[tos-1] + + # pushing the expression (-1)^... but note + # that we can't use "power", as "power" evaluates + # clock forms into rectangular form (see "-1 ^ rational" + # section in power) + push_symbol(POWER) + + push_integer(-1) + + push(p1) + arg() + if DEBUG_CLOCKFORM then console.log "clockform: arg of " + p1 + " : " + stack[tos-1] + if evaluatingAsFloats + push_double(Math.PI) + else + push(symbol(PI)) + divide() + if DEBUG_CLOCKFORM then console.log "clockform: divide : " + stack[tos-1] + list(3) + + if DEBUG_CLOCKFORM then console.log "clockform: power : " + stack[tos-1] + multiply() + if DEBUG_CLOCKFORM then console.log "clockform: multiply : " + stack[tos-1] + #else + ### + p1 = pop() + push(p1) + abs() + push(symbol(E)) + push(p1) + arg() + push(imaginaryunit) + multiply() + power() + multiply() + ### + #endif + restore() + + + diff --git a/node_modules/algebrite/sources/coeff.coffee b/node_modules/algebrite/sources/coeff.coffee new file mode 100644 index 0000000..2ffb59f --- /dev/null +++ b/node_modules/algebrite/sources/coeff.coffee @@ -0,0 +1,111 @@ +### coeff ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +p,x,n + +General description +------------------- +Returns the coefficient of x^n in polynomial p. The x argument can be omitted for polynomials in x. + +### + + + +#define P p1 +#define X p2 +#define N p3 + +Eval_coeff = -> + push(cadr(p1)); # 1st arg, p + Eval() + + push(caddr(p1)); # 2nd arg, x + Eval() + + push(cadddr(p1)); # 3rd arg, n + Eval() + + p3 = pop(); # p3 is N + p2 = pop(); # p2 is X + p1 = pop(); # p1 is P + + if (p3 == symbol(NIL)) # p3 is N # only 2 args? + p3 = p2; # p2 is X # p3 is N + p2 = symbol(SYMBOL_X); # p2 is X + + push(p1); # p1 is P # divide p by x^n + push(p2); # p2 is X + push(p3); # p3 is N + power() + divide() + + push(p2); # p2 is X # keep the constant part + filter() + +#----------------------------------------------------------------------------- +# +# Put polynomial coefficients on the stack +# +# Input: as per params +# +# Output: Returns number of coefficients on stack +# +# tos-n Coefficient of x^0 +# +# tos-1 Coefficient of x^(n-1) +# +#----------------------------------------------------------------------------- + +coeff = (variable, polynomial)-> + + if DEBUG then console.log "coeff: " + variable + " " + polynomial + + # works like this: + # 1) find the constant (by just evaluating the pol setting the variable to zero) + # 2) set aside the found constant: it's one of the coefficients to return + # 3) take the polynomial and remove the constant + # 4) divide that by variable, lowering the degree by one + # 5) go back to 1) until degree is zero + + coeffsCount = 0 + + while true + + push(polynomial) + push(variable) + push(zero) + subst() + Eval() + + constant = pop() + + # this will be a coefficient that will be returned + push(constant) + coeffsCount++ + + push(polynomial) + push(constant) + subtract() + + polynomialWithoutConstant = pop() + + if (equal(polynomialWithoutConstant, zero)) + if DEBUG then console.log "coeff: result: " + coeffsCount + return coeffsCount + + push(polynomialWithoutConstant) + push(variable) + prev_expanding = expanding + expanding = 1 + divide() + expanding = prev_expanding + #console.log("just divided: " + stack[tos-1].toString()) + # this is now the new polynomial with degree decreased by 1 + polynomial = pop() + + diff --git a/node_modules/algebrite/sources/cofactor.coffee b/node_modules/algebrite/sources/cofactor.coffee new file mode 100644 index 0000000..78b0293 --- /dev/null +++ b/node_modules/algebrite/sources/cofactor.coffee @@ -0,0 +1,57 @@ +### cofactor ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m,i,j + +General description +------------------- +Cofactor of a matrix component. +Let c be the cofactor matrix of matrix m, i.e. tranpose(c) = adj(m). +This function returns c[i,j]. + +### + + +Eval_cofactor = -> + + i = 0 + j = 0 + n = 0 + push(cadr(p1)) + Eval() + p2 = pop() + if (istensor(p2) && p2.tensor.ndim == 2 && p2.tensor.dim[0] == p2.tensor.dim[1]) + doNothing = 1 + else + stop("cofactor: 1st arg: square matrix expected") + n = p2.tensor.dim[0] + push(caddr(p1)) + Eval() + i = pop_integer() + if (i < 1 || i > n) + stop("cofactor: 2nd arg: row index expected") + push(cadddr(p1)) + Eval() + j = pop_integer() + if (j < 1 || j > n) + stop("cofactor: 3rd arg: column index expected") + cofactor(p2, n, i - 1, j - 1) + +cofactor = (p, n, row, col) -> + i = 0 + j = 0 + for i in [0...n] + for j in [0...n] + if (i != row && j != col) + push(p.tensor.elem[n * i + j]) + determinant(n - 1) + if ((row + col) % 2) + negate() + + + diff --git a/node_modules/algebrite/sources/condense.coffee b/node_modules/algebrite/sources/condense.coffee new file mode 100644 index 0000000..9ff34bc --- /dev/null +++ b/node_modules/algebrite/sources/condense.coffee @@ -0,0 +1,66 @@ +# Condense an expression by factoring common terms. + + +Eval_condense = -> + push(cadr(p1)) + Eval() + Condense() + +Condense = -> + prev_expanding = expanding + expanding = 0 + save() + yycondense() + restore() + expanding = prev_expanding + +yycondense = -> + #expanding = 0 + + p1 = pop() + + if (car(p1) != symbol(ADD)) + push(p1) + return + + # get gcd of all terms + + p3 = cdr(p1) + push(car(p3)) + p3 = cdr(p3) + while (iscons(p3)) + push(car(p3)) + if DEBUG then console.log "calculating gcd between: " + stack[tos - 1] + " and " + stack[tos - 2] + gcd() + if DEBUG then console.log "partial gcd: " + stack[tos - 1] + p3 = cdr(p3) + + if DEBUG then console.log "condense: this is the gcd of all the terms: " + stack[tos - 1] + + # divide each term by gcd + + inverse() + p2 = pop() + push(zero) + p3 = cdr(p1) + while (iscons(p3)) + push(p2) + push(car(p3)) + #multiply() + multiply_noexpand() + add() + p3 = cdr(p3) + + # We multiplied above w/o expanding so some factors cancelled. + + # Now we expand which normalizes the result and, in some cases, + # simplifies it too (see test case H). + + yyexpand() + + # multiply result by gcd + + push(p2) + divide() + + diff --git a/node_modules/algebrite/sources/conj.coffee b/node_modules/algebrite/sources/conj.coffee new file mode 100644 index 0000000..68fa700 --- /dev/null +++ b/node_modules/algebrite/sources/conj.coffee @@ -0,0 +1,38 @@ +### conj ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +z + +General description +------------------- +Returns the complex conjugate of z. + +### + + +Eval_conj = -> + push(cadr(p1)) + Eval() + p1 = pop() + push(p1) + if (!Find(p1, imaginaryunit)) # example: (-1)^(1/3) + polar() + conjugate() + clockform() + else + conjugate() + + +# careful is you pass this one an expression with +# i (instead of (-1)^(1/2)) then this doesn't work! +conjugate = -> + push(imaginaryunit) + push(imaginaryunit) + negate() + subst() + Eval() diff --git a/node_modules/algebrite/sources/cons.coffee b/node_modules/algebrite/sources/cons.coffee new file mode 100644 index 0000000..62c2522 --- /dev/null +++ b/node_modules/algebrite/sources/cons.coffee @@ -0,0 +1,29 @@ +# Cons two things on the stack. + + + +consCount = 0 +cons = -> + consCount++ + if DEBUG then console.log "cons tos: " + tos + " # " + consCount + #if consCount == 444 + # debugger + # auto var ok, no opportunity for garbage collection after p = alloc() + p = new U() + p.k = CONS + p.cons.cdr = pop() + if p == p.cons.cdr + debugger + console.log "something wrong p == its cdr" + + p.cons.car = pop() + + + ### + console.log "cons new cdr.k = " + p.cons.cdr.k + "\nor more in detail:" + console.log print_list p.cons.cdr + console.log "cons new car.k = " + p.cons.car.k + "\nor more in detail:" + console.log print_list p.cons.car + ### + + push(p) diff --git a/node_modules/algebrite/sources/contract.coffee b/node_modules/algebrite/sources/contract.coffee new file mode 100644 index 0000000..b9d9f00 --- /dev/null +++ b/node_modules/algebrite/sources/contract.coffee @@ -0,0 +1,134 @@ +### contract ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +a,i,j + +General description +------------------- +Contract across tensor indices i.e. returns "a" summed over indices i and j. +If i and j are omitted then 1 and 2 are used. +contract(m) is equivalent to the trace of matrix m. + +### + + + +Eval_contract = -> + push(cadr(p1)) + Eval() + if (cddr(p1) == symbol(NIL)) + push_integer(1) + push_integer(2) + else + push(caddr(p1)) + Eval() + push(cadddr(p1)) + Eval() + contract() + +contract = -> + save() + yycontract() + restore() + +yycontract = -> + h = 0 + i = 0 + j = 0 + k = 0 + l = 0 + m = 0 + n = 0 + ndim = 0 + nelem = 0 + ai = [] + an = [] + + p3 = pop() + p2 = pop() + p1 = pop() + + if (!istensor(p1)) + if (!isZeroAtomOrTensor(p1)) + stop("contract: tensor expected, 1st arg is not a tensor") + push(zero) + return + + push(p2) + l = pop_integer() + + push(p3) + m = pop_integer() + + ndim = p1.tensor.ndim + + if (l < 1 || l > ndim || m < 1 || m > ndim || l == m \ + || p1.tensor.dim[l - 1] != p1.tensor.dim[m - 1]) + stop("contract: index out of range") + + l-- + m-- + + n = p1.tensor.dim[l] + + # nelem is the number of elements in "b" + + nelem = 1 + for i in [0...ndim] + if (i != l && i != m) + nelem *= p1.tensor.dim[i] + + #console.log "nelem:" + nelem + p2 = alloc_tensor(nelem) + #console.log "p2:" + p2 + + p2.tensor.ndim = ndim - 2 + + j = 0 + for i in [0...ndim] + if (i != l && i != m) + p2.tensor.dim[j++] = p1.tensor.dim[i] + + + a = p1.tensor.elem + b = p2.tensor.elem + + #console.log "a: " + a + #console.log "b: " + b + + for i in [0...ndim] + ai[i] = 0 + an[i] = p1.tensor.dim[i] + + for i in [0...nelem] + push(zero) + for j in [0...n] + ai[l] = j + ai[m] = j + h = 0 + for k in [0...ndim] + h = (h * an[k]) + ai[k] + push(a[h]) + #console.log "a[h]: " + a[h] + add() + #console.log "tos: " + stack[tos-1] + b[i] = pop() + #console.log "b[i]: " + b[i] + for j in [(ndim - 1)..0] + if (j == l || j == m) + continue + if (++ai[j] < an[j]) + break + ai[j] = 0 + + if (nelem == 1) + push(b[0]) + else + push(p2) + + #console.log "returning: " + stack[tos-1] diff --git a/node_modules/algebrite/sources/cos.coffee b/node_modules/algebrite/sources/cos.coffee new file mode 100644 index 0000000..2cf553c --- /dev/null +++ b/node_modules/algebrite/sources/cos.coffee @@ -0,0 +1,166 @@ +### cos ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the cosine of x. + +### + + +Eval_cos = -> + push(cadr(p1)) + Eval() + cosine() + +cosine = -> + save() + p1 = pop() + if (car(p1) == symbol(ADD)) + cosine_of_angle_sum() + else + cosine_of_angle() + restore() + +# Use angle sum formula for special angles. + +#define A p3 +#define B p4 + +cosine_of_angle_sum = -> + p2 = cdr(p1) + while (iscons(p2)) + p4 = car(p2); # p4 is B + if (isnpi(p4)) # p4 is B + push(p1) + push(p4); # p4 is B + subtract() + p3 = pop(); # p3 is A + push(p3); # p3 is A + cosine() + push(p4); # p4 is B + cosine() + multiply() + push(p3); # p3 is A + sine() + push(p4); # p4 is B + sine() + multiply() + subtract() + return + p2 = cdr(p2) + cosine_of_angle() + +cosine_of_angle = -> + + if (car(p1) == symbol(ARCCOS)) + push(cadr(p1)) + return + + if (isdouble(p1)) + d = Math.cos(p1.d) + if (Math.abs(d) < 1e-10) + d = 0.0 + push_double(d) + return + + # cosine function is symmetric, cos(-x) = cos(x) + + if (isnegative(p1)) + push(p1) + negate() + p1 = pop() + + # cos(arctan(x)) = 1 / sqrt(1 + x^2) + + # see p. 173 of the CRC Handbook of Mathematical Sciences + + if (car(p1) == symbol(ARCTAN)) + push_integer(1) + push(cadr(p1)) + push_integer(2) + power() + add() + push_rational(-1, 2) + power() + return + + # multiply by 180/pi to go from radians to degrees. + # we go from radians to degrees because it's much + # easier to calculate symbolic results of most (not all) "classic" + # angles (e.g. 30,45,60...) if we calculate the degrees + # and the we do a switch on that. + # Alternatively, we could look at the fraction of pi + # (e.g. 60 degrees is 1/3 pi) but that's more + # convoluted as we'd need to look at both numerator and + # denominator. + + push(p1) + push_integer(180) + multiply() + + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + + divide() + + n = pop_integer() + + # most "good" (i.e. compact) trigonometric results + # happen for a round number of degrees. There are some exceptions + # though, e.g. 22.5 degrees, which we don't capture here. + if (n < 0 || isNaN(n)) + push(symbol(COS)) + push(p1) + list(2) + return + + switch (n % 360) + when 90, 270 + push_integer(0) + when 60, 300 + push_rational(1, 2) + when 120, 240 + push_rational(-1, 2) + when 45, 315 + push_rational(1, 2) + push_integer(2) + push_rational(1, 2) + power() + multiply() + when 135, 225 + push_rational(-1, 2) + push_integer(2) + push_rational(1, 2) + power() + multiply() + when 30, 330 + push_rational(1, 2) + push_integer(3) + push_rational(1, 2) + power() + multiply() + when 150, 210 + push_rational(-1, 2) + push_integer(3) + push_rational(1, 2) + power() + multiply() + when 0 + push_integer(1) + when 180 + push_integer(-1) + else + push(symbol(COS)) + push(p1) + list(2) + diff --git a/node_modules/algebrite/sources/cosh.coffee b/node_modules/algebrite/sources/cosh.coffee new file mode 100644 index 0000000..2d9d35c --- /dev/null +++ b/node_modules/algebrite/sources/cosh.coffee @@ -0,0 +1,51 @@ +### cosh ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the hyperbolic cosine of x + +``` + exp(x) + exp(-x) + cosh(x) = ---------------- + 2 +``` + +### + +Eval_cosh = -> + push(cadr(p1)) + Eval() + ycosh() + +ycosh = -> + save() + yycosh() + restore() + +yycosh = -> + d = 0.0 + p1 = pop() + if (car(p1) == symbol(ARCCOSH)) + push(cadr(p1)) + return + if (isdouble(p1)) + d = Math.cosh(p1.d) + if (Math.abs(d) < 1e-10) + d = 0.0 + push_double(d) + return + if (isZeroAtomOrTensor(p1)) + push(one) + return + push_symbol(COSH) + push(p1) + list(2) + diff --git a/node_modules/algebrite/sources/decomp.coffee b/node_modules/algebrite/sources/decomp.coffee new file mode 100644 index 0000000..bb22efd --- /dev/null +++ b/node_modules/algebrite/sources/decomp.coffee @@ -0,0 +1,176 @@ +# this function extract parts subtrees from a tree. +# It is used in two +# places that have to do with pattern matching. +# One is for integrals, where an expression or its +# subparts are matched against cases in an +# integrals table. +# Another one is for applyging tranformation patterns +# defined via PATTERN, again patterns are applied to +# either the whole expression or any of its parts. + + + +# unclear to me at the moment +# why this is exposed as something that can +# be evalled. Never called. + +Eval_decomp = -> + save() + console.log "Eval_decomp is being called!!!!!!!!!!!!!!!!!!!!" + h = tos + push(symbol(NIL)) + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + p1 = pop() + if (p1 == symbol(NIL)) + guess() + else + push(p1) + decomp(false) + list(tos - h) + restore() + + +pushTryNotToDuplicate = (toBePushed) -> + if tos > 0 + if DEBUG then console.log "comparing " + toBePushed + " to: " + stack[tos-1] + if equal(toBePushed, stack[tos-1]) + if DEBUG then console.log "skipping " + toBePushed + " because it's already on stack " + return + push(toBePushed) + + +# returns constant expressions on the stack + +decomp = (generalTransform) -> + save() + + p2 = pop() + p1 = pop() + + if DEBUG then console.log "DECOMPOSING " + p1 + + # is the entire expression constant? + + if generalTransform + if !iscons(p1) + if DEBUG then console.log " ground thing: " + p1 + pushTryNotToDuplicate p1 + restore() + return + else + if (Find(p1, p2) == 0) + if DEBUG then console.log " entire expression is constant" + pushTryNotToDuplicate(p1) + #push(p1); # may need later for pushing both +a, -a + #negate() + restore() + return + + # sum? + + if (isadd(p1)) + decomp_sum(generalTransform) + restore() + return + + # product? + + if (ismultiply(p1)) + decomp_product(generalTransform) + restore() + return + + # naive decomp if not sum or product + + if DEBUG then console.log " naive decomp" + p3 = cdr(p1) + if DEBUG then console.log "startig p3: " + p3 + while (iscons(p3)) + + # for a general transformations, + # we want to match any part of the tree so + # we need to push the subtree as well + # as recurse to its parts + if generalTransform + push(car(p3)) + + if DEBUG then console.log "recursive decomposition" + push(car(p3)) + + if DEBUG then console.log "car(p3): " + car(p3) + push(p2) + if DEBUG then console.log "p2: " + p2 + decomp(generalTransform) + p3 = cdr(p3) + + restore() + +decomp_sum = (generalTransform) -> + if DEBUG then console.log " decomposing the sum " + h = 0 + + + # decomp terms involving x + + p3 = cdr(p1) + + while (iscons(p3)) + if (Find(car(p3), p2) or generalTransform) + push(car(p3)) + push(p2) + decomp(generalTransform) + p3 = cdr(p3) + + # add together all constant terms + + h = tos + + p3 = cdr(p1) + + while (iscons(p3)) + if (Find(car(p3), p2) == 0) + pushTryNotToDuplicate(car(p3)) + p3 = cdr(p3) + + if (tos - h) + add_all(tos - h) + p3 = pop() + pushTryNotToDuplicate(p3) + push(p3) + negate(); # need both +a, -a for some integrals + +decomp_product = (generalTransform) -> + if DEBUG then console.log " decomposing the product " + h = 0 + + # decomp factors involving x + + p3 = cdr(p1) + + while (iscons(p3)) + if (Find(car(p3), p2) or generalTransform) + push(car(p3)) + push(p2) + decomp(generalTransform) + p3 = cdr(p3) + + # multiply together all constant factors + + h = tos + + p3 = cdr(p1) + + while (iscons(p3)) + if (Find(car(p3), p2) == 0) + pushTryNotToDuplicate(car(p3)) + p3 = cdr(p3) + + if (tos - h) + multiply_all(tos - h) + #p3 = pop(); # may need later for pushing both +a, -a + #push(p3) + #push(p3) + #negate() diff --git a/node_modules/algebrite/sources/define.coffee b/node_modules/algebrite/sources/define.coffee new file mode 100644 index 0000000..d969bbe --- /dev/null +++ b/node_modules/algebrite/sources/define.coffee @@ -0,0 +1,80 @@ +# Store a function definition +# +# Example: +# +# f(x,y)=x^y +# +# For this definition, p1 points to the following structure. +# +# p1 +# | +# ___v__ ______ ______ +# |CONS |->|CONS |--------------------->|CONS | +# |______| |______| |______| +# | | | +# ___v__ ___v__ ______ ______ ___v__ ______ ______ +# |SETQ | |CONS |->|CONS |->|CONS | |CONS |->|CONS |->|CONS | +# |______| |______| |______| |______| |______| |______| |______| +# | | | | | | +# ___v__ ___v__ ___v__ ___v__ ___v__ ___v__ +# |SYM f | |SYM x | |SYM y | |POWER | |SYM x | |SYM y | +# |______| |______| |______| |______| |______| |______| +# +# the result (in f) is a FUNCTION node +# that contains both the body and the argument list. +# +# We have +# +# caadr(p1) points to the function name i.e. f +# cdadr(p1) points to the arguments i.e. the list (x y) +# caddr(p1) points to the function body i.e. (power x y) + + + +#define F p3 # F points to the function name +#define A p4 # A points to the argument list +#define B p5 # B points to the function body + +define_user_function = -> + p3 = caadr(p1); # p3 is F + p4 = cdadr(p1); # p4 is A + p5 = caddr(p1); # p5 is B + + if (!issymbol(p3)) # p3 is F + stop("function name?") + + # evaluate function body (maybe) + + if (car(p5) == symbol(EVAL)) # p5 is B + push(cadr(p5)); # p5 is B + Eval() + p5 = pop(); # p5 is B + + # note how, unless explicitly forced by an eval, + # (handled by the if just above) + # we don't eval/simplify + # the body. + # Why? because it's the easiest way + # to solve scope problems i.e. + # x = 0 + # f(x) = x + 1 + # f(4) # would reply 1 + # which would need to otherwise + # be solved by some scope device + # somehow + push_symbol(FUNCTION) + push p5 + push p4 + list(3) + p5 = pop() + + + set_binding(p3, p5); # p3 is F (function name) # p4 is A # p5 is B + + # return value is nil + + push_symbol(NIL) + +Eval_function_reference = -> + push p1 + diff --git a/node_modules/algebrite/sources/defint.coffee b/node_modules/algebrite/sources/defint.coffee new file mode 100644 index 0000000..21d8679 --- /dev/null +++ b/node_modules/algebrite/sources/defint.coffee @@ -0,0 +1,91 @@ +### defint ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +f,x,a,b[,y,c,d...] + +General description +------------------- +Returns the definite integral of f with respect to x evaluated from "a" to b. +The argument list can be extended for multiple integrals (or "iterated +integrals"), for example a double integral (which can represent for +example a volume under a surface), or a triple integral, etc. For +example, defint(f,x,a,b,y,c,d). + +### + + + +#define F p2 +#define X p3 +#define A p4 +#define B p5 + +Eval_defint = -> + push(cadr(p1)) + Eval() + p2 = pop() # p2 is F + + p1 = cddr(p1) + + # defint can handle multiple + # integrals, so we loop over the + # multiple integrals here + while (iscons(p1)) + + push(car(p1)) + p1 = cdr(p1) + Eval() + p3 = pop() # p3 is X + + push(car(p1)) + p1 = cdr(p1) + Eval() + p4 = pop() # p4 is A + + push(car(p1)) + p1 = cdr(p1) + Eval() + p5 = pop() # p5 is B + + # obtain the primitive of F against the + # specified variable X + # note that the primitive changes over + # the calculation of the multiple + # integrals. + push(p2) + push(p3) + integral() + p2 = pop() # contains the antiderivative of F + + # evaluate the integral in A + push(p2) + push(p3) + push(p5) + subst() + Eval() + + # evaluate the integral in B + push(p2) + push(p3) + push(p4) + subst() + Eval() + + # integral between B and A is the + # subtraction. Note that this could + # be a number but also a function. + # and we might have to integrate this + # number/function again doing the while + # loop again if this is a multiple + # integral. + subtract() + p2 = pop() + + push(p2) + + diff --git a/node_modules/algebrite/sources/degree.coffee b/node_modules/algebrite/sources/degree.coffee new file mode 100644 index 0000000..69c9b5b --- /dev/null +++ b/node_modules/algebrite/sources/degree.coffee @@ -0,0 +1,69 @@ +### deg ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +p,x + +General description +------------------- +Returns the degree of polynomial p(x). + +### + + +Eval_degree = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + p1 = pop() + if (p1 == symbol(NIL)) + guess() + else + push(p1) + degree() + +#----------------------------------------------------------------------------- +# +# Find the degree of a polynomial +# +# Input: tos-2 p(x) +# +# tos-1 x +# +# Output: Result on stack +# +# Note: Finds the largest numerical power of x. Does not check for +# weirdness in p(x). +# +#----------------------------------------------------------------------------- + +#define POLY p1 +#define X p2 +#define DEGREE p3 + +degree = -> + save() + p2 = pop() + p1 = pop() + p3 = zero + yydegree(p1) + push(p3) + restore() + +yydegree = (p) -> + if (equal(p, p2)) + if (isZeroAtomOrTensor(p3)) + p3 = one + else if (car(p) == symbol(POWER)) + if (equal(cadr(p), p2) && isNumericAtom(caddr(p)) && lessp(p3, caddr(p))) + p3 = caddr(p) + else if (iscons(p)) + p = cdr(p) + while (iscons(p)) + yydegree(car(p)) + p = cdr(p) diff --git a/node_modules/algebrite/sources/denominator.coffee b/node_modules/algebrite/sources/denominator.coffee new file mode 100644 index 0000000..cd87a6e --- /dev/null +++ b/node_modules/algebrite/sources/denominator.coffee @@ -0,0 +1,50 @@ +### denominator ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +x + +General description +------------------- +Returns the denominator of expression x. + +### + + +Eval_denominator = -> + push(cadr(p1)) + Eval() + denominator() + +denominator = -> + h = 0 + + theArgument = pop() + #console.trace "denominator of: " + theArgument + + if (car(theArgument) == symbol(ADD)) + push(theArgument) + rationalize() + theArgument = pop() + + if (car(theArgument) == symbol(MULTIPLY) and !isplusone(car(cdr(theArgument)))) + h = tos + theArgument = cdr(theArgument) + while (iscons(theArgument)) + push(car(theArgument)) + denominator() + theArgument = cdr(theArgument) + multiply_all(tos - h) + else if (isrational(theArgument)) + push(theArgument) + mp_denominator() + else if (car(theArgument) == symbol(POWER) && isnegativeterm(caddr(theArgument))) + push(theArgument) + reciprocate() + else + push(one) + diff --git a/node_modules/algebrite/sources/derivative.coffee b/node_modules/algebrite/sources/derivative.coffee new file mode 100644 index 0000000..7573e71 --- /dev/null +++ b/node_modules/algebrite/sources/derivative.coffee @@ -0,0 +1,684 @@ +# derivative + + + +#define F p3 +#define X p4 +#define N p5 + +Eval_derivative = -> + + # evaluate 1st arg to get function F + + i = 0 + p1 = cdr(p1) + push(car(p1)) + Eval() + + # evaluate 2nd arg and then... + + # example result of 2nd arg what to do + # + # d(f) nil guess X, N = nil + # d(f,2) 2 guess X, N = 2 + # d(f,x) x X = x, N = nil + # d(f,x,2) x X = x, N = 2 + # d(f,x,y) x X = x, N = y + + p1 = cdr(p1) + push(car(p1)) + Eval() + + p2 = pop() + if (p2 == symbol(NIL)) + guess() + push(symbol(NIL)) + else if (isNumericAtom(p2)) + guess() + push(p2) + else + push(p2) + p1 = cdr(p1) + push(car(p1)) + Eval() + + p5 = pop(); # p5 is N + p4 = pop(); # p4 is X + p3 = pop(); # p3 is F + + while (1) + + # p5 (N) might be a symbol instead of a number + + if (isNumericAtom(p5)) # p5 is N + push(p5); # p5 is N + n = pop_integer() + if (isNaN(n)) + stop("nth derivative: check n") + else + n = 1 + + push(p3); # p3 is F + + if (n >= 0) + for i in [0...n] + push(p4); # p4 is X + derivative() + else + n = -n + for i in [0...n] + push(p4); # p4 is X + integral() + + p3 = pop(); # p3 is F + + # if p5 (N) is nil then arglist is exhausted + + if (p5 == symbol(NIL)) # p5 is N + break + + # otherwise... + + # N arg1 what to do + # + # number nil break + # number number N = arg1, continue + # number symbol X = arg1, N = arg2, continue + # + # symbol nil X = N, N = nil, continue + # symbol number X = N, N = arg1, continue + # symbol symbol X = N, N = arg1, continue + + if (isNumericAtom(p5)) # p5 is N + p1 = cdr(p1) + push(car(p1)) + Eval() + p5 = pop(); # p5 is N + if (p5 == symbol(NIL)) # p5 is N + break; # arglist exhausted + if (isNumericAtom(p5)) # p5 is N + doNothing = 1 # N = arg1 + else + p4 = p5; # p5 is N # p4 is X # X = arg1 + p1 = cdr(p1) + push(car(p1)) + Eval() + p5 = pop(); # p5 is N # N = arg2 + else + p4 = p5; # p5 is N # p4 is X # X = N + p1 = cdr(p1) + push(car(p1)) + Eval() + p5 = pop(); # p5 is N # N = arg1 + + push(p3); # p3 is F # final result + +derivative = -> + save() + p2 = pop() + p1 = pop() + if (isNumericAtom(p2)) + stop("undefined function") + if (istensor(p1)) + if (istensor(p2)) + d_tensor_tensor() + else + d_tensor_scalar() + else + if (istensor(p2)) + d_scalar_tensor() + else + d_scalar_scalar() + restore() + +d_scalar_scalar = -> + if (issymbol(p2)) + d_scalar_scalar_1() + else + # Example: d(sin(cos(x)),cos(x)) + # Replace cos(x) <- X, find derivative, then do X <- cos(x) + push(p1); # sin(cos(x)) + push(p2); # cos(x) + push(symbol(SECRETX)); # X + subst(); # sin(cos(x)) -> sin(X) + push(symbol(SECRETX)); # X + derivative() + push(symbol(SECRETX)); # X + push(p2); # cos(x) + subst(); # cos(X) -> cos(cos(x)) + +d_scalar_scalar_1 = -> + # d(x,x)? + + if (equal(p1, p2)) + push(one) + return + + # d(a,x)? + + if (!iscons(p1)) + push(zero) + return + + if (isadd(p1)) + dsum() + return + + if (car(p1) == symbol(MULTIPLY)) + dproduct() + return + + if (car(p1) == symbol(POWER)) + dpower() + return + + if (car(p1) == symbol(DERIVATIVE)) + dd() + return + + if (car(p1) == symbol(LOG)) + dlog() + return + + if (car(p1) == symbol(SIN)) + dsin() + return + + if (car(p1) == symbol(COS)) + dcos() + return + + if (car(p1) == symbol(TAN)) + dtan() + return + + if (car(p1) == symbol(ARCSIN)) + darcsin() + return + + if (car(p1) == symbol(ARCCOS)) + darccos() + return + + if (car(p1) == symbol(ARCTAN)) + darctan() + return + + if (car(p1) == symbol(SINH)) + dsinh() + return + + if (car(p1) == symbol(COSH)) + dcosh() + return + + if (car(p1) == symbol(TANH)) + dtanh() + return + + if (car(p1) == symbol(ARCSINH)) + darcsinh() + return + + if (car(p1) == symbol(ARCCOSH)) + darccosh() + return + + if (car(p1) == symbol(ARCTANH)) + darctanh() + return + + if (car(p1) == symbol(ABS)) + dabs() + return + + if (car(p1) == symbol(SGN)) + dsgn() + return + + if (car(p1) == symbol(HERMITE)) + dhermite() + return + + if (car(p1) == symbol(ERF)) + derf() + return + + if (car(p1) == symbol(ERFC)) + derfc() + return + + if (car(p1) == symbol(BESSELJ)) + if (isZeroAtomOrTensor(caddr(p1))) + dbesselj0() + else + dbesseljn() + return + + if (car(p1) == symbol(BESSELY)) + if (isZeroAtomOrTensor(caddr(p1))) + dbessely0() + else + dbesselyn() + return + + if (car(p1) == symbol(INTEGRAL) && caddr(p1) == p2) + derivative_of_integral() + return + + dfunction() + +dsum = -> + h = tos + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + derivative() + p1 = cdr(p1) + add_all(tos - h) + +dproduct = -> + i = 0 + j = 0 + n = 0 + n = length(p1) - 1 + for i in [0...n] + p3 = cdr(p1) + for j in [0...n] + push(car(p3)) + if (i == j) + push(p2) + derivative() + p3 = cdr(p3) + multiply_all(n) + add_all(n) + +#----------------------------------------------------------------------------- +# +# v +# y = u +# +# log y = v log u +# +# 1 dy v du dv +# - -- = - -- + (log u) -- +# y dx u dx dx +# +# dy v v du dv +# -- = u (- -- + (log u) --) +# dx u dx dx +# +#----------------------------------------------------------------------------- + +dpower = -> + push(caddr(p1)); # v/u + push(cadr(p1)) + divide() + + push(cadr(p1)); # du/dx + push(p2) + derivative() + + multiply() + + push(cadr(p1)); # log u + logarithm() + + push(caddr(p1)); # dv/dx + push(p2) + derivative() + + multiply() + + add() + + push(p1); # u^v + + multiply() + +dlog = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + divide() + +# derivative of derivative +# +# example: d(d(f(x,y),y),x) +# +# p1 = d(f(x,y),y) +# +# p2 = x +# +# cadr(p1) = f(x,y) +# +# caddr(p1) = y + +dd = -> + # d(f(x,y),x) + + push(cadr(p1)) + push(p2) + derivative() + + p3 = pop() + + if (car(p3) == symbol(DERIVATIVE)) + + # sort dx terms + + push_symbol(DERIVATIVE) + push_symbol(DERIVATIVE) + push(cadr(p3)) + + if (lessp(caddr(p3), caddr(p1))) + push(caddr(p3)) + list(3) + push(caddr(p1)) + else + push(caddr(p1)) + list(3) + push(caddr(p3)) + + list(3) + + else + push(p3) + push(caddr(p1)) + derivative() + +# derivative of a generic function + +dfunction = -> + p3 = cdr(p1); # p3 is the argument list for the function + + if (p3 == symbol(NIL) || Find(p3, p2)) + push_symbol(DERIVATIVE) + push(p1) + push(p2) + list(3) + else + push(zero) + +dsin = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + cosine() + multiply() + +dcos = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + sine() + multiply() + negate() + +dtan = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + cosine() + push_integer(-2) + power() + multiply() + +darcsin = -> + push(cadr(p1)) + push(p2) + derivative() + push_integer(1) + push(cadr(p1)) + push_integer(2) + power() + subtract() + push_rational(-1, 2) + power() + multiply() + +darccos = -> + push(cadr(p1)) + push(p2) + derivative() + push_integer(1) + push(cadr(p1)) + push_integer(2) + power() + subtract() + push_rational(-1, 2) + power() + multiply() + negate() + +# Without simplify With simplify +# +# d(arctan(y/x),x) -y/(x^2*(y^2/x^2+1)) -y/(x^2+y^2) +# +# d(arctan(y/x),y) 1/(x*(y^2/x^2+1)) x/(x^2+y^2) + +darctan = -> + push(cadr(p1)) + push(p2) + derivative() + push_integer(1) + push(cadr(p1)) + push_integer(2) + power() + add() + inverse() + multiply() + simplify() + +dsinh = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + ycosh() + multiply() + +dcosh = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + ysinh() + multiply() + +dtanh = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + ycosh() + push_integer(-2) + power() + multiply() + +darcsinh = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + push_integer(2) + power() + push_integer(1) + add() + push_rational(-1, 2) + power() + multiply() + +darccosh = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + push_integer(2) + power() + push_integer(-1) + add() + push_rational(-1, 2) + power() + multiply() + +darctanh = -> + push(cadr(p1)) + push(p2) + derivative() + push_integer(1) + push(cadr(p1)) + push_integer(2) + power() + subtract() + inverse() + multiply() + +dabs = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + sgn() + multiply() + +dsgn = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + dirac() + multiply() + push_integer(2) + multiply() + +dhermite = -> + push(cadr(p1)) + push(p2) + derivative() + push_integer(2) + push(caddr(p1)) + multiply() + multiply() + push(cadr(p1)) + push(caddr(p1)) + push_integer(-1) + add() + hermite() + multiply() + +derf = -> + push(cadr(p1)) + push_integer(2) + power() + push_integer(-1) + multiply() + exponential() + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + push_rational(-1,2) + power() + multiply() + push_integer(2) + multiply() + push(cadr(p1)) + push(p2) + derivative() + multiply() + +derfc = -> + push(cadr(p1)) + push_integer(2) + power() + push_integer(-1) + multiply() + exponential() + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + push_rational(-1,2) + power() + multiply() + push_integer(-2) + multiply() + push(cadr(p1)) + push(p2) + derivative() + multiply() + +dbesselj0 = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + push_integer(1) + besselj() + multiply() + push_integer(-1) + multiply() + +dbesseljn = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + push(caddr(p1)) + push_integer(-1) + add() + besselj() + push(caddr(p1)) + push_integer(-1) + multiply() + push(cadr(p1)) + divide() + push(cadr(p1)) + push(caddr(p1)) + besselj() + multiply() + add() + multiply() + +dbessely0 = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + push_integer(1) + besselj() + multiply() + push_integer(-1) + multiply() + +dbesselyn = -> + push(cadr(p1)) + push(p2) + derivative() + push(cadr(p1)) + push(caddr(p1)) + push_integer(-1) + add() + bessely() + push(caddr(p1)) + push_integer(-1) + multiply() + push(cadr(p1)) + divide() + push(cadr(p1)) + push(caddr(p1)) + bessely() + multiply() + add() + multiply() + +derivative_of_integral = -> + push(cadr(p1)) + + diff --git a/node_modules/algebrite/sources/det.coffee b/node_modules/algebrite/sources/det.coffee new file mode 100644 index 0000000..416963e --- /dev/null +++ b/node_modules/algebrite/sources/det.coffee @@ -0,0 +1,289 @@ +### det ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m + +General description +------------------- +Returns the determinant of matrix m. +Uses Gaussian elimination for numerical matrices. + +Example: + + det(((1,2),(3,4))) + > -2 + +### + + +DET_check_arg = -> + if (!istensor(p1)) + return 0 + else if (p1.tensor.ndim != 2) + return 0 + else if (p1.tensor.dim[0] != p1.tensor.dim[1]) + return 0 + else + return 1 + +det = -> + i = 0 + n = 0 + #U **a + + save() + + p1 = pop() + + if (DET_check_arg() == 0) + push_symbol(DET) + push(p1) + list(2) + restore() + return + + n = p1.tensor.nelem + + a = p1.tensor.elem + + for i in [0...n] + if (!isNumericAtom(a[i])) + break + + if (i == n) + yydetg() + else + for i in [0...p1.tensor.nelem] + push(p1.tensor.elem[i]) + determinant(p1.tensor.dim[0]) + + restore() + +# determinant of n * n matrix elements on the stack + +determinant = (n) -> + h = 0 + i = 0 + j = 0 + k = 0 + q = 0 + s = 0 + sign_ = 0 + t = 0 + + a = [] + #int *a, *c, *d + + h = tos - n * n + + #a = (int *) malloc(3 * n * sizeof (int)) + + #if (a == NULL) + # out_of_memory() + + for i in [0...n] + a[i] = i + a[i+n] = 0 + a[i+n+n] = 1 + + sign_ = 1 + + push(zero) + + while 1 + + if (sign_ == 1) + push_integer(1) + else + push_integer(-1) + + for i in [0...n] + k = n * a[i] + i + push(stack[h + k]) + multiply(); # FIXME -- problem here + + add() + + # next permutation (Knuth's algorithm P) + + j = n - 1 + s = 0 + + breakFromOutherWhile = false + while 1 + q = a[n+j] + a[n+n+j] + if (q < 0) + a[n+n+j] = -a[n+n+j] + j-- + continue + if (q == j + 1) + if (j == 0) + breakFromOutherWhile = true + break + s++ + a[n+n+j] = -a[n+n+j] + j-- + continue + break + + if breakFromOutherWhile + break + + t = a[j - a[n+j] + s] + a[j - a[n+j] + s] = a[j - q + s] + a[j - q + s] = t + a[n+j] = q + + sign_ = -sign_ + + + stack[h] = stack[tos - 1] + + moveTos h + 1 + +#----------------------------------------------------------------------------- +# +# Input: Matrix on stack +# +# Output: Determinant on stack +# +# Note: +# +# Uses Gaussian elimination which is faster for numerical matrices. +# +# Gaussian Elimination works by walking down the diagonal and clearing +# out the columns below it. +# +#----------------------------------------------------------------------------- + +detg = -> + save() + + p1 = pop() + + if (DET_check_arg() == 0) + push_symbol(DET) + push(p1) + list(2) + restore() + return + + yydetg() + + restore() + +yydetg = -> + i = 0 + n = 0 + + n = p1.tensor.dim[0] + + for i in [0...(n * n)] + push(p1.tensor.elem[i]) + + lu_decomp(n) + + moveTos tos - n * n + + push(p1) + +#----------------------------------------------------------------------------- +# +# Input: n * n matrix elements on stack +# +# Output: p1 determinant +# +# p2 mangled +# +# upper diagonal matrix on stack +# +#----------------------------------------------------------------------------- + +M = (h,n,i, j) -> + stack[h + n * (i) + (j)] + +setM = (h,n,i,j,value) -> + stack[h + n * (i) + (j)] = value + +lu_decomp = (n) -> + d = 0 + h = 0 + i = 0 + j = 0 + + h = tos - n * n + + p1 = one + + for d in [0...(n - 1)] + + # diagonal element zero? + + if (equal(M(h,n,d, d), zero)) + + # find a new row + + for i in [(d + 1)...n] + if (!equal(M(h,n,i, d), zero)) + break + + if (i == n) + p1 = zero + break + + # exchange rows + + for j in [d...n] + p2 = M(h,n,d, j) + setM(h,n,d, j, M(h,n,i, j)) + setM(h,n,i, j, p2) + + # negate det + + push(p1) + negate() + p1 = pop() + + # update det + + push(p1) + push(M(h,n,d, d)) + multiply() + p1 = pop() + + # update lower diagonal matrix + + for i in [(d + 1)...n] + + # multiplier + + push(M(h,n,i, d)) + push(M(h,n,d, d)) + divide() + negate() + + p2 = pop() + + # update one row + + setM(h,n,i, d, zero); # clear column below pivot d + + for j in [(d + 1)...n] + push(M(h,n,d, j)) + push(p2) + multiply() + push(M(h,n,i, j)) + add() + setM(h,n,i, j, pop()) + + # last diagonal element + + push(p1) + push(M(h,n,n - 1, n - 1)) + multiply() + p1 = pop() diff --git a/node_modules/algebrite/sources/dirac.coffee b/node_modules/algebrite/sources/dirac.coffee new file mode 100644 index 0000000..ddd3cb3 --- /dev/null +++ b/node_modules/algebrite/sources/dirac.coffee @@ -0,0 +1,69 @@ +#----------------------------------------------------------------------------- +# +# Author : philippe.billet@noos.fr +# +# Dirac function dirac(x) +# dirac(-x)=dirac(x) +# dirac(b-a)=dirac(a-b) +#----------------------------------------------------------------------------- + + + +Eval_dirac = -> + push(cadr(p1)) + Eval() + dirac() + +dirac = -> + save() + ydirac() + restore() + +#define p1 p1 + +ydirac = -> + + p1 = pop() + + + + if (isdouble(p1)) + if (p1.d == 0) + push_integer(1) + return + else + push_integer(0) + return + + if (isrational(p1)) + if (MZERO(mmul(p1.q.a,p1.q.b))) + push_integer(1) + return + else + push_integer(0) + return + + + if (car(p1) == symbol(POWER)) + push_symbol(DIRAC) + push(cadr(p1)) + list(2) + return + + if (isnegativeterm(p1)) + push_symbol(DIRAC) + push(p1) + negate() + list(2) + return + + if (isnegativeterm(p1) || (car(p1) == symbol(ADD) && isnegativeterm(cadr(p1)))) + push(p1) + negate() + p1 = pop() + + + push_symbol(DIRAC) + push(p1) + list(2) + diff --git a/node_modules/algebrite/sources/divisors.coffee b/node_modules/algebrite/sources/divisors.coffee new file mode 100644 index 0000000..a3ccfc4 --- /dev/null +++ b/node_modules/algebrite/sources/divisors.coffee @@ -0,0 +1,236 @@ +#----------------------------------------------------------------------------- +# +# Generate all divisors of a term +# +# Input: Term on stack (factor * factor * ...) +# +# Output: Divisors on stack +# +#----------------------------------------------------------------------------- + + + + +divisors = -> + i = 0 + h = 0 + n = 0 + save() + h = tos - 1 + divisors_onstack() + n = tos - h + + #qsort(stack + h, n, sizeof (U *), __cmp) + subsetOfStack = stack.slice(h,h+n) + subsetOfStack.sort(cmp_expr) + stack = stack.slice(0,h).concat(subsetOfStack).concat(stack.slice(h+n)) + + p1 = alloc_tensor(n) + p1.tensor.ndim = 1 + p1.tensor.dim[0] = n + for i in [0...n] + p1.tensor.elem[i] = stack[h + i] + moveTos h + push(p1) + restore() + +divisors_onstack = -> + h = 0 + i = 0 + k = 0 + n = 0 + + save() + + p1 = pop() + + h = tos + + # push all of the term's factors + + if (isNumericAtom(p1)) + push(p1) + factor_small_number() + else if (car(p1) == symbol(ADD)) + push(p1) + __factor_add() + #printf(">>>\n") + #for (i = h; i < tos; i++) + #print(stdout, stack[i]) + #printf("<<<\n") + else if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + if (isNumericAtom(car(p1))) + push(car(p1)) + factor_small_number() + p1 = cdr(p1) + while (iscons(p1)) + p2 = car(p1) + if (car(p2) == symbol(POWER)) + push(cadr(p2)) + push(caddr(p2)) + else + push(p2) + push(one) + p1 = cdr(p1) + else if (car(p1) == symbol(POWER)) + push(cadr(p1)) + push(caddr(p1)) + else + push(p1) + push(one) + + k = tos + + # contruct divisors by recursive descent + + push(one) + + gen(h, k) + + # move + + n = tos - k + + for i in [0...n] + stack[h + i] = stack[k + i] + + moveTos h + n + + restore() + +#----------------------------------------------------------------------------- +# +# Generate divisors +# +# Input: Base-exponent pairs on stack +# +# h first pair +# +# k just past last pair +# +# Output: Divisors on stack +# +# For example, factor list 2 2 3 1 results in 6 divisors, +# +# 1 +# 3 +# 2 +# 6 +# 4 +# 12 +# +#----------------------------------------------------------------------------- + +#define ACCUM p1 +#define BASE p2 +#define EXPO p3 + +gen = (h,k) -> + expo = 0 + i = 0 + + save() + + p1 = pop() + + if (h == k) + push(p1) + restore() + return + + p2 = stack[h + 0] + p3 = stack[h + 1] + + push(p3) + expo = pop_integer() + + if (!isNaN(expo)) + for i in [0..Math.abs(expo)] + push(p1) + push(p2) + push_integer(sign(expo) * i) + power() + multiply() + gen(h + 2, k) + + restore() + +#----------------------------------------------------------------------------- +# +# Factor ADD expression +# +# Input: Expression on stack +# +# Output: Factors on stack +# +# Each factor consists of two expressions, the factor itself followed +# by the exponent. +# +#----------------------------------------------------------------------------- + +__factor_add = -> + save() + + p1 = pop() + + # get gcd of all terms + + p3 = cdr(p1) + push(car(p3)) + p3 = cdr(p3) + while (iscons(p3)) + push(car(p3)) + gcd() + p3 = cdr(p3) + + # check gcd + + p2 = pop() + if (isplusone(p2)) + push(p1) + push(one) + restore() + return + + # push factored gcd + + if (isNumericAtom(p2)) + push(p2) + factor_small_number() + else if (car(p2) == symbol(MULTIPLY)) + p3 = cdr(p2) + if (isNumericAtom(car(p3))) + push(car(p3)) + factor_small_number() + else + push(car(p3)) + push(one) + p3 = cdr(p3) + while (iscons(p3)) + push(car(p3)) + push(one) + p3 = cdr(p3) + else + push(p2) + push(one) + + # divide each term by gcd + + push(p2) + inverse() + p2 = pop() + + push(zero) + p3 = cdr(p1) + while (iscons(p3)) + push(p2) + push(car(p3)) + multiply() + add() + p3 = cdr(p3) + + push(one) + + restore() + diff --git a/node_modules/algebrite/sources/dpow.coffee b/node_modules/algebrite/sources/dpow.coffee new file mode 100644 index 0000000..0fb43c0 --- /dev/null +++ b/node_modules/algebrite/sources/dpow.coffee @@ -0,0 +1,45 @@ +# power function for double precision floating point + + + +dpow = -> + a = 0.0 + b = 0.0 + base = 0.0 + expo = 0.0 + result = 0.0 + theta = 0.0 + + expo = pop_double() + base = pop_double() + + # divide by zero? + + if (base == 0.0 && expo < 0.0) + stop("divide by zero") + + # nonnegative base or integer power? + + if (base >= 0.0 || (expo % 1.0) == 0.0) + result = Math.pow(base, expo) + push_double(result) + return + + result = Math.pow(Math.abs(base), expo) + + theta = Math.PI * expo + + # this ensures the real part is 0.0 instead of a tiny fraction + + if ((expo % 0.5) == 0.0) + a = 0.0 + b = Math.sin(theta) + else + a = Math.cos(theta) + b = Math.sin(theta) + + push_double(a * result) + push_double(b * result) + push(imaginaryunit) + multiply() + add() diff --git a/node_modules/algebrite/sources/eigen.coffee b/node_modules/algebrite/sources/eigen.coffee new file mode 100644 index 0000000..3d6885c --- /dev/null +++ b/node_modules/algebrite/sources/eigen.coffee @@ -0,0 +1,541 @@ +### eigen ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m + +General description +------------------- +Compute eigenvalues and eigenvectors. Matrix m must be both numerical and symmetric. +The eigenval function returns a matrix with the eigenvalues along the diagonal. +The eigenvec function returns a matrix with the eigenvectors arranged as row vectors. +The eigen function does not return anything but stores the eigenvalue matrix in D +and the eigenvector matrix in Q. + +Input: stack[tos - 1] symmetric matrix + +Output: D diagnonal matrix + Q eigenvector matrix + +D and Q have the property that + + A == dot(transpose(Q),D,Q) + +where A is the original matrix. + +The eigenvalues are on the diagonal of D. +The eigenvectors are row vectors in Q. + +The eigenvalue relation: + + A X = lambda X + +can be checked as follows: + + lambda = D[1,1] + X = Q[1] + dot(A,X) - lambda X + +Example 1. Check the relation AX = lambda X where lambda is an eigenvalue and X is the associated eigenvector. + +Enter: + + A = hilbert(3) + + eigen(A) + + lambda = D[1,1] + + X = Q[1] + + dot(A,X) - lambda X + +Result: + + -1.16435e-14 + + -6.46705e-15 + + -4.55191e-15 + +Example 2: Check the relation A = QTDQ. + +Enter: + + A - dot(transpose(Q),D,Q) + +Result: + + 6.27365e-12 -1.58236e-11 1.81902e-11 + + -1.58236e-11 -1.95365e-11 2.56514e-12 + + 1.81902e-11 2.56514e-12 1.32627e-11 + +### + + + +#define D(i, j) yydd[EIG_N * (i) + (j)] +#define Q(i, j) yyqq[EIG_N * (i) + (j)] + +EIG_N = 0 +EIG_yydd = [] +EIG_yyqq = [] + +Eval_eigen = -> + if (EIG_check_arg() == 0) + stop("eigen: argument is not a square matrix") + + eigen(EIGEN) + + p1 = usr_symbol("D") + set_binding(p1, p2) + + p1 = usr_symbol("Q") + set_binding(p1, p3) + + push(symbol(NIL)) + +### eigenval ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m + +General description +------------------- +Compute eigenvalues of m. See "eigen" for more info. + +### + +Eval_eigenval = -> + if (EIG_check_arg() == 0) + push_symbol(EIGENVAL) + push(p1) + list(2) + return + + eigen(EIGENVAL) + + push(p2) + +### eigenvec ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m + +General description +------------------- +Compute eigenvectors of m. See "eigen" for more info. + +### + +Eval_eigenvec = -> + if (EIG_check_arg() == 0) + push_symbol(EIGENVEC) + push(p1) + list(2) + return + + eigen(EIGENVEC) + + push(p3) + +EIG_check_arg = -> + i = 0 + j = 0 + + push(cadr(p1)) + Eval() + yyfloat() + Eval() + p1 = pop() + + if (!istensor(p1)) + return 0 + + if (p1.tensor.ndim != 2 || p1.tensor.dim[0] != p1.tensor.dim[1]) + stop("eigen: argument is not a square matrix") + + EIG_N = p1.tensor.dim[0] + + for i in [0...EIG_N] + for j in [0...EIG_N] + if (!isdouble(p1.tensor.elem[EIG_N * i + j])) + stop("eigen: matrix is not numerical") + + for i in [0...(EIG_N-1)] + for j in [(i+1)...EIG_N] + if (Math.abs(p1.tensor.elem[EIG_N * i + j].d - p1.tensor.elem[EIG_N * j + i].d) > 1e-10) + stop("eigen: matrix is not symmetrical") + + return 1 + +#----------------------------------------------------------------------------- +# +# Input: p1 matrix +# +# Output: p2 eigenvalues +# +# p3 eigenvectors +# +#----------------------------------------------------------------------------- + +eigen = (op) -> + i = 0 + j = 0 + + # malloc working vars + + #EIG_yydd = (double *) malloc(n * n * sizeof (double)) + for i in [0...(EIG_N*EIG_N)] + EIG_yydd[i] = 0.0 + + #if (EIG_yydd == NULL) + # stop("malloc failure") + + #EIG_yyqq = (double *) malloc(n * n * sizeof (double)) + for i in [0...(EIG_N*EIG_N)] + EIG_yyqq[i] = 0.0 + + #if (EIG_yyqq == NULL) + # stop("malloc failure") + + # initialize D + + for i in [0...EIG_N] + EIG_yydd[EIG_N * (i) + (i)] = p1.tensor.elem[EIG_N * i + i].d + for j in [(i+1)...EIG_N] + EIG_yydd[EIG_N * (i) + (j)] = p1.tensor.elem[EIG_N * i + j].d + EIG_yydd[EIG_N * (j) + (i)] = p1.tensor.elem[EIG_N * i + j].d + + # initialize Q + + for i in [0...EIG_N] + EIG_yyqq[EIG_N * (i) + (i)] = 1.0 + for j in [(i+1)...EIG_N] + EIG_yyqq[EIG_N * (i) + (j)] = 0.0 + EIG_yyqq[EIG_N * (j) + (i)] = 0.0 + + # step up to 100 times + + for i in [0...100] + if (step() == 0) + break + + if (i == 100) + printstr("\nnote: eigen did not converge\n") + + # p2 = D + + if (op == EIGEN || op == EIGENVAL) + + push(p1) + copy_tensor() + p2 = pop() + + for i in [0...EIG_N] + for j in [0...EIG_N] + push_double(EIG_yydd[EIG_N * (i) + (j)]) + p2.tensor.elem[EIG_N * i + j] = pop() + + # p3 = Q + + if (op == EIGEN || op == EIGENVEC) + + push(p1) + copy_tensor() + p3 = pop() + + for i in [0...EIG_N] + for j in [0...EIG_N] + push_double(EIG_yyqq[EIG_N * (i) + (j)]) + p3.tensor.elem[EIG_N * i + j] = pop() + + # free working vars + + +#----------------------------------------------------------------------------- +# +# Example: p = 1, q = 3 +# +# c 0 s 0 +# +# 0 1 0 0 +# G = +# -s 0 c 0 +# +# 0 0 0 1 +# +# The effect of multiplying G times A is... +# +# row 1 of A = c (row 1 of A ) + s (row 3 of A ) +# n+1 n n +# +# row 3 of A = c (row 3 of A ) - s (row 1 of A ) +# n+1 n n +# +# In terms of components the overall effect is... +# +# row 1 = c row 1 + s row 3 +# +# A[1,1] = c A[1,1] + s A[3,1] +# +# A[1,2] = c A[1,2] + s A[3,2] +# +# A[1,3] = c A[1,3] + s A[3,3] +# +# A[1,4] = c A[1,4] + s A[3,4] +# +# row 3 = c row 3 - s row 1 +# +# A[3,1] = c A[3,1] - s A[1,1] +# +# A[3,2] = c A[3,2] - s A[1,2] +# +# A[3,3] = c A[3,3] - s A[1,3] +# +# A[3,4] = c A[3,4] - s A[1,4] +# +# T +# The effect of multiplying A times G is... +# +# col 1 of A = c (col 1 of A ) + s (col 3 of A ) +# n+1 n n +# +# col 3 of A = c (col 3 of A ) - s (col 1 of A ) +# n+1 n n +# +# In terms of components the overall effect is... +# +# col 1 = c col 1 + s col 3 +# +# A[1,1] = c A[1,1] + s A[1,3] +# +# A[2,1] = c A[2,1] + s A[2,3] +# +# A[3,1] = c A[3,1] + s A[3,3] +# +# A[4,1] = c A[4,1] + s A[4,3] +# +# col 3 = c col 3 - s col 1 +# +# A[1,3] = c A[1,3] - s A[1,1] +# +# A[2,3] = c A[2,3] - s A[2,1] +# +# A[3,3] = c A[3,3] - s A[3,1] +# +# A[4,3] = c A[4,3] - s A[4,1] +# +# What we want to do is just compute the upper triangle of A since we +# know the lower triangle is identical. +# +# In other words, we just want to update components A[i,j] where i < j. +# +#----------------------------------------------------------------------------- +# +# Example: p = 2, q = 5 +# +# p q +# +# j=1 j=2 j=3 j=4 j=5 j=6 +# +# i=1 . A[1,2] . . A[1,5] . +# +# p i=2 A[2,1] A[2,2] A[2,3] A[2,4] A[2,5] A[2,6] +# +# i=3 . A[3,2] . . A[3,5] . +# +# i=4 . A[4,2] . . A[4,5] . +# +# q i=5 A[5,1] A[5,2] A[5,3] A[5,4] A[5,5] A[5,6] +# +# i=6 . A[6,2] . . A[6,5] . +# +#----------------------------------------------------------------------------- +# +# This is what B = GA does: +# +# row 2 = c row 2 + s row 5 +# +# B[2,1] = c * A[2,1] + s * A[5,1] +# B[2,2] = c * A[2,2] + s * A[5,2] +# B[2,3] = c * A[2,3] + s * A[5,3] +# B[2,4] = c * A[2,4] + s * A[5,4] +# B[2,5] = c * A[2,5] + s * A[5,5] +# B[2,6] = c * A[2,6] + s * A[5,6] +# +# row 5 = c row 5 - s row 2 +# +# B[5,1] = c * A[5,1] + s * A[2,1] +# B[5,2] = c * A[5,2] + s * A[2,2] +# B[5,3] = c * A[5,3] + s * A[2,3] +# B[5,4] = c * A[5,4] + s * A[2,4] +# B[5,5] = c * A[5,5] + s * A[2,5] +# B[5,6] = c * A[5,6] + s * A[2,6] +# +# T +# This is what BG does: +# +# col 2 = c col 2 + s col 5 +# +# B[1,2] = c * A[1,2] + s * A[1,5] +# B[2,2] = c * A[2,2] + s * A[2,5] +# B[3,2] = c * A[3,2] + s * A[3,5] +# B[4,2] = c * A[4,2] + s * A[4,5] +# B[5,2] = c * A[5,2] + s * A[5,5] +# B[6,2] = c * A[6,2] + s * A[6,5] +# +# col 5 = c col 5 - s col 2 +# +# B[1,5] = c * A[1,5] - s * A[1,2] +# B[2,5] = c * A[2,5] - s * A[2,2] +# B[3,5] = c * A[3,5] - s * A[3,2] +# B[4,5] = c * A[4,5] - s * A[4,2] +# B[5,5] = c * A[5,5] - s * A[5,2] +# B[6,5] = c * A[6,5] - s * A[6,2] +# +#----------------------------------------------------------------------------- +# +# Step 1: Just do upper triangle (i < j), B[2,5] = 0 +# +# B[1,2] = c * A[1,2] + s * A[1,5] +# +# B[2,3] = c * A[2,3] + s * A[5,3] +# B[2,4] = c * A[2,4] + s * A[5,4] +# B[2,6] = c * A[2,6] + s * A[5,6] +# +# B[1,5] = c * A[1,5] - s * A[1,2] +# B[3,5] = c * A[3,5] - s * A[3,2] +# B[4,5] = c * A[4,5] - s * A[4,2] +# +# B[5,6] = c * A[5,6] + s * A[2,6] +# +#----------------------------------------------------------------------------- +# +# Step 2: Transpose where i > j since A[i,j] == A[j,i] +# +# B[1,2] = c * A[1,2] + s * A[1,5] +# +# B[2,3] = c * A[2,3] + s * A[3,5] +# B[2,4] = c * A[2,4] + s * A[4,5] +# B[2,6] = c * A[2,6] + s * A[5,6] +# +# B[1,5] = c * A[1,5] - s * A[1,2] +# B[3,5] = c * A[3,5] - s * A[2,3] +# B[4,5] = c * A[4,5] - s * A[2,4] +# +# B[5,6] = c * A[5,6] + s * A[2,6] +# +#----------------------------------------------------------------------------- +# +# Step 3: Same as above except reorder +# +# k < p (k = 1) +# +# A[1,2] = c * A[1,2] + s * A[1,5] +# A[1,5] = c * A[1,5] - s * A[1,2] +# +# p < k < q (k = 3..4) +# +# A[2,3] = c * A[2,3] + s * A[3,5] +# A[3,5] = c * A[3,5] - s * A[2,3] +# +# A[2,4] = c * A[2,4] + s * A[4,5] +# A[4,5] = c * A[4,5] - s * A[2,4] +# +# q < k (k = 6) +# +# A[2,6] = c * A[2,6] + s * A[5,6] +# A[5,6] = c * A[5,6] - s * A[2,6] +# +#----------------------------------------------------------------------------- + +step = -> + i = 0 + j = 0 + count = 0 + + # for each upper triangle "off-diagonal" component do step2 + + for i in [0...(EIG_N-1)] + for j in [(i+1)...EIG_N] + if (EIG_yydd[EIG_N * (i) + (j)] != 0.0) + step2(i, j) + count++ + + return count + +step2 = (p,q) -> + k = 0 + t = 0.0 + theta = 0.0 + c = 0.0 + cc = 0.0 + s = 0.0 + ss = 0.0 + + # compute c and s + + # from Numerical Recipes (except they have a_qq - a_pp) + + theta = 0.5 * (EIG_yydd[EIG_N * (p) + (p)] - EIG_yydd[EIG_N * (q) + (q)]) / EIG_yydd[EIG_N * (p) + (q)] + + t = 1.0 / (Math.abs(theta) + Math.sqrt(theta * theta + 1.0)) + + if (theta < 0.0) + t = -t + + c = 1.0 / Math.sqrt(t * t + 1.0) + + s = t * c + + # D = GD + + # which means "add rows" + + for k in [0...EIG_N] + cc = EIG_yydd[EIG_N * (p) + (k)] + ss = EIG_yydd[EIG_N * (q) + (k)] + EIG_yydd[EIG_N * (p) + (k)] = c * cc + s * ss + EIG_yydd[EIG_N * (q) + (k)] = c * ss - s * cc + + # D = D transpose(G) + + # which means "add columns" + + for k in [0...EIG_N] + cc = EIG_yydd[EIG_N * (k) + (p)] + ss = EIG_yydd[EIG_N * (k) + (q)] + EIG_yydd[EIG_N * (k) + (p)] = c * cc + s * ss + EIG_yydd[EIG_N * (k) + (q)] = c * ss - s * cc + + # Q = GQ + + # which means "add rows" + + for k in [0...EIG_N] + cc = EIG_yyqq[EIG_N * (p) + (k)] + ss = EIG_yyqq[EIG_N * (q) + (k)] + EIG_yyqq[EIG_N * (p) + (k)] = c * cc + s * ss + EIG_yyqq[EIG_N * (q) + (k)] = c * ss - s * cc + + EIG_yydd[EIG_N * (p) + (q)] = 0.0 + EIG_yydd[EIG_N * (q) + (p)] = 0.0 + + diff --git a/node_modules/algebrite/sources/erf.coffee b/node_modules/algebrite/sources/erf.coffee new file mode 100644 index 0000000..d61ec44 --- /dev/null +++ b/node_modules/algebrite/sources/erf.coffee @@ -0,0 +1,60 @@ +### erf ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Authors +------- +philippe.billet@noos.fr + +Parameters +---------- +x + +General description +------------------- +Error function erf(x). +erf(-x)=erf(x) + +### + + + +Eval_erf = -> + push(cadr(p1)) + Eval() + yerf() + +yerf = -> + save() + yyerf() + restore() + +yyerf = -> + d = 0.0 + + p1 = pop() + + if (isdouble(p1)) + d = 1.0 - erfc(p1.d) + push_double(d) + return + + if isZeroAtomOrTensor(p1) + push(zero) + return + + if (isnegativeterm(p1)) + push_symbol(ERF) + push(p1) + negate() + list(2) + negate() + return + + push_symbol(ERF) + push(p1) + list(2) + return + diff --git a/node_modules/algebrite/sources/erfc.coffee b/node_modules/algebrite/sources/erfc.coffee new file mode 100644 index 0000000..80b2bfa --- /dev/null +++ b/node_modules/algebrite/sources/erfc.coffee @@ -0,0 +1,61 @@ +#----------------------------------------------------------------------------- +# +# Author : philippe.billet@noos.fr +# +# erfc(x) +# +# GW Added erfc() from Numerical Recipes in C +# +#----------------------------------------------------------------------------- + + + +Eval_erfc = -> + push(cadr(p1)) + Eval() + yerfc() + +yerfc = -> + save() + yyerfc() + restore() + +yyerfc = -> + d = 0.0 + + p1 = pop() + + if (isdouble(p1)) + d = erfc(p1.d) + push_double(d) + return + + if isZeroAtomOrTensor(p1) + push(one) + return + + push_symbol(ERFC) + push(p1) + list(2) + return + +# from Numerical Recipes in C +erfc = (x) -> + if x == 0 + return 1.0 + + t = 0.0 + z = 0.0 + ans = 0.0 + + z = Math.abs(x) + t = 1.0 / (1.0 + 0.5 * z) + + ans=t*Math.exp(-z*z-1.26551223+t*(1.00002368+t*(0.37409196+t*(0.09678418+ + t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+ + t*(-0.82215223+t*0.17087277))))))))) + + if x >= 0.0 + return ans + else + return 2.0-ans diff --git a/node_modules/algebrite/sources/eval.coffee b/node_modules/algebrite/sources/eval.coffee new file mode 100644 index 0000000..9b54c0e --- /dev/null +++ b/node_modules/algebrite/sources/eval.coffee @@ -0,0 +1,716 @@ +# Evaluate an expression, for example... +# +# push(p1) +# Eval() +# p2 = pop() + + + +Eval = -> + check_esc_flag() + save() + p1 = pop() + if !p1? + debugger + + if !evaluatingAsFloats and isfloating(p1) + willEvaluateAsFloats = true + evaluatingAsFloats++ + + switch (p1.k) + when CONS + Eval_cons() + when NUM + if evaluatingAsFloats + push_double(convert_rational_to_double(p1)) + else + push(p1) + when DOUBLE, STR + push(p1) + when TENSOR + Eval_tensor() + when SYM + Eval_sym() + else + stop("atom?") + + if willEvaluateAsFloats + evaluatingAsFloats-- + + restore() + +Eval_sym = -> + + # note that function calls are not processed here + # because, since they have an argument (at least an empty one) + # they are actually CONs, which is a branch of the + # switch before the one that calls this function + + # bare keyword? + # If it's a keyword, then we don't look + # at the binding array, because keywords + # are not redefinable. + if (iskeyword(p1)) + push(p1) + push(symbol(LAST)) + list(2) + Eval() + return + else if (p1 == symbol(PI) and evaluatingAsFloats) + push_double(Math.PI) + return + + # Evaluate symbol's binding + p2 = get_binding(p1) + if DEBUG then console.log "looked up: " + p1 + " which contains: " + p2 + + push(p2) + + + # differently from standard Lisp, + # here the evaluation is not + # one-step only, rather it keeps evaluating + # "all the way" until a symbol is + # defined as itself. + # Uncomment these two lines to get Lisp + # behaviour (and break most tests) + if (p1 != p2) + + # detect recursive lookup of symbols, which would otherwise + # cause a stack overflow. + # Note that recursive functions will still work because + # as mentioned at the top, this method doesn't look + # up and evaluate function calls. + positionIfSymbolAlreadyBeingEvaluated = chainOfUserSymbolsNotFunctionsBeingEvaluated.indexOf(p1) + if positionIfSymbolAlreadyBeingEvaluated != -1 + cycleString = "" + for i in [positionIfSymbolAlreadyBeingEvaluated...chainOfUserSymbolsNotFunctionsBeingEvaluated.length] + cycleString += chainOfUserSymbolsNotFunctionsBeingEvaluated[i].printname + " -> " + cycleString += p1.printname + + stop("recursive evaluation of symbols: " + cycleString) + return + + chainOfUserSymbolsNotFunctionsBeingEvaluated.push(p1) + + + Eval() + + chainOfUserSymbolsNotFunctionsBeingEvaluated.pop() + +Eval_cons = -> + + cons_head = car(p1) + + # normally the cons_head is a symbol, + # but sometimes in the case of + # functions we don't have a symbol, + # we have to evaluate something to get to the + # symbol. For example if a function is inside + # a tensor, then we need to evaluate an index + # access first to get to the function. + # In those cases, we find an EVAL here, + # so we proceed to EVAL + if car(cons_head) == symbol(EVAL) + Eval_user_function() + return + + # If we didn't fall in the EVAL case above + # then at this point we must have a symbol. + if (!issymbol(cons_head)) + stop("cons?") + + switch (symnum(cons_head)) + when ABS then Eval_abs() + when ADD then Eval_add() + when ADJ then Eval_adj() + when AND then Eval_and() + when ARCCOS then Eval_arccos() + when ARCCOSH then Eval_arccosh() + when ARCSIN then Eval_arcsin() + when ARCSINH then Eval_arcsinh() + when ARCTAN then Eval_arctan() + when ARCTANH then Eval_arctanh() + when ARG then Eval_arg() + when ATOMIZE then Eval_atomize() + when BESSELJ then Eval_besselj() + when BESSELY then Eval_bessely() + when BINDING then Eval_binding() + when BINOMIAL then Eval_binomial() + when CEILING then Eval_ceiling() + when CHECK then Eval_check() + when CHOOSE then Eval_choose() + when CIRCEXP then Eval_circexp() + when CLEAR then Eval_clear() + when CLEARALL then Eval_clearall() + when CLEARPATTERNS then Eval_clearpatterns() + when CLOCK then Eval_clock() + when COEFF then Eval_coeff() + when COFACTOR then Eval_cofactor() + when CONDENSE then Eval_condense() + when CONJ then Eval_conj() + when CONTRACT then Eval_contract() + when COS then Eval_cos() + when COSH then Eval_cosh() + when DECOMP then Eval_decomp() + when DEGREE then Eval_degree() + when DEFINT then Eval_defint() + when DENOMINATOR then Eval_denominator() + when DERIVATIVE then Eval_derivative() + when DET then Eval_det() + when DIM then Eval_dim() + when DIRAC then Eval_dirac() + when DIVISORS then Eval_divisors() + when DO then Eval_do() + when DOT then Eval_inner() + when DRAW then Eval_draw() + when DSOLVE then Eval_dsolve() + when EIGEN then Eval_eigen() + when EIGENVAL then Eval_eigenval() + when EIGENVEC then Eval_eigenvec() + when ERF then Eval_erf() + when ERFC then Eval_erfc() + when EVAL then Eval_Eval() + when EXP then Eval_exp() + when EXPAND then Eval_expand() + when EXPCOS then Eval_expcos() + when EXPSIN then Eval_expsin() + when FACTOR then Eval_factor() + when FACTORIAL then Eval_factorial() + when FACTORPOLY then Eval_factorpoly() + when FILTER then Eval_filter() + when FLOATF then Eval_float() + when APPROXRATIO then Eval_approxratio() + when FLOOR then Eval_floor() + when FOR then Eval_for() + # this is invoked only when we + # evaluate a function that is NOT being called + # e.g. when f is a function as we do + # g = f + when FUNCTION then Eval_function_reference() + when GAMMA then Eval_gamma() + when GCD then Eval_gcd() + when HERMITE then Eval_hermite() + when HILBERT then Eval_hilbert() + when IMAG then Eval_imag() + when INDEX then Eval_index() + when INNER then Eval_inner() + when INTEGRAL then Eval_integral() + when INV then Eval_inv() + when INVG then Eval_invg() + when ISINTEGER then Eval_isinteger() + when ISPRIME then Eval_isprime() + when LAGUERRE then Eval_laguerre() + # when LAPLACE then Eval_laplace() + when LCM then Eval_lcm() + when LEADING then Eval_leading() + when LEGENDRE then Eval_legendre() + when LOG then Eval_log() + when LOOKUP then Eval_lookup() + when MOD then Eval_mod() + when MULTIPLY then Eval_multiply() + when NOT then Eval_not() + when NROOTS then Eval_nroots() + when NUMBER then Eval_number() + when NUMERATOR then Eval_numerator() + when OPERATOR then Eval_operator() + when OR then Eval_or() + when OUTER then Eval_outer() + when PATTERN then Eval_pattern() + when PATTERNSINFO then Eval_patternsinfo() + when POLAR then Eval_polar() + when POWER then Eval_power() + when PRIME then Eval_prime() + when PRINT then Eval_print() + when PRINT2DASCII then Eval_print2dascii() + when PRINTFULL then Eval_printcomputer() + when PRINTLATEX then Eval_printlatex() + when PRINTLIST then Eval_printlist() + when PRINTPLAIN then Eval_printhuman() + when PRODUCT then Eval_product() + when QUOTE then Eval_quote() + when QUOTIENT then Eval_quotient() + when RANK then Eval_rank() + when RATIONALIZE then Eval_rationalize() + when REAL then Eval_real() + when ROUND then Eval_round() + when YYRECT then Eval_rect() + when ROOTS then Eval_roots() + when SETQ then Eval_setq() + when SGN then Eval_sgn() + when SILENTPATTERN then Eval_silentpattern() + when SIMPLIFY then Eval_simplify() + when SIN then Eval_sin() + when SINH then Eval_sinh() + when SHAPE then Eval_shape() + when SQRT then Eval_sqrt() + when STOP then Eval_stop() + when SUBST then Eval_subst() + when SUM then Eval_sum() + when SYMBOLSINFO then Eval_symbolsinfo() + when TAN then Eval_tan() + when TANH then Eval_tanh() + when TAYLOR then Eval_taylor() + when TEST then Eval_test() + when TESTEQ then Eval_testeq() + when TESTGE then Eval_testge() + when TESTGT then Eval_testgt() + when TESTLE then Eval_testle() + when TESTLT then Eval_testlt() + when TRANSPOSE then Eval_transpose() + when UNIT then Eval_unit() + when ZERO then Eval_zero() + else + Eval_user_function() + +Eval_binding = -> + push(get_binding(cadr(p1))) + +### check ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +p + +General description +------------------- +Returns whether the predicate p is true/false or unknown: +0 if false, 1 if true or remains unevaluated if unknown. +Note that if "check" is passed an assignment, it turns it into a test, +i.e. check(a = b) is turned into check(a==b) +so "a" is not assigned anything. +Like in many programming languages, "check" also gives truthyness/falsyness +for numeric values. In which case, "true" is returned for non-zero values. +Potential improvements: "check" can't evaluate strings yet. + +### + +Eval_check = -> + # check the argument + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined cadr(p1) + + if !checkResult? + # returned null: unknown result + # leave the whole check unevalled + push p1 + else + # returned 1 or 0 + push_integer(checkResult) + + +Eval_det = -> + push(cadr(p1)) + Eval() + det() + + +### dim ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +m,n + +General description +------------------- +Returns the cardinality of the nth index of tensor "m". + +### + +Eval_dim = -> + #int n + push(cadr(p1)) + Eval() + p2 = pop() + if (iscons(cddr(p1))) + push(caddr(p1)) + Eval() + n = pop_integer() + else + n = 1 + if (!istensor(p2)) + push_integer(1) # dim of scalar is 1 + else if (n < 1 || n > p2.tensor.ndim) + push(p1) + else + push_integer(p2.tensor.dim[n - 1]) + +Eval_divisors = -> + push(cadr(p1)) + Eval() + divisors() + +### do ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +a,b,... + +General description +------------------- +Evaluates each argument from left to right. Returns the result of the last argument. + +### + +Eval_do = -> + push(car(p1)) + p1 = cdr(p1) + while (iscons(p1)) + pop() + push(car(p1)) + Eval() + p1 = cdr(p1) + +Eval_dsolve = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + push(cadddr(p1)) + Eval() + dsolve() + +# for example, Eval(f,x,2) + +Eval_Eval = -> + push(cadr(p1)) + Eval() + p1 = cddr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + push(cadr(p1)) + Eval() + subst() + p1 = cddr(p1) + Eval() + +# exp evaluation: it replaces itself with +# a POWER(E,something) node and evals that one +Eval_exp = -> + push(cadr(p1)) + Eval() + exponential() + +Eval_factorial = -> + push(cadr(p1)) + Eval() + factorial() + +Eval_factorpoly = -> + p1 = cdr(p1) + push(car(p1)) + Eval() + p1 = cdr(p1) + push(car(p1)) + Eval() + factorpoly() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + factorpoly() + p1 = cdr(p1) + +Eval_hermite = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + hermite() + +Eval_hilbert = -> + push(cadr(p1)) + Eval() + hilbert() + +Eval_index = -> + h = tos + orig = p1 + + # look into the head of the list, + # when evaluated it should be a tensor + p1 = cdr(p1) + push car(p1) + Eval() + theTensor = stack[tos-1] + + if isNumericAtom(theTensor) + stop("trying to access a scalar as a tensor") + + if !istensor(theTensor) + # the tensor is not allocated yet, so + # leaving the expression unevalled + moveTos h + push orig + return + + # we examined the head of the list which + # was the tensor, now look into + # the indexes + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + if !isintegerorintegerfloat(stack[tos-1]) + # index with something other than + # an integer + moveTos h + push orig + return + p1 = cdr(p1) + index_function(tos - h) + +Eval_inv = -> + push(cadr(p1)) + Eval() + inv() + +Eval_invg = -> + push(cadr(p1)) + Eval() + invg() + +Eval_isinteger = -> + push(cadr(p1)) + Eval() + p1 = pop() + if (isrational(p1)) + if (isinteger(p1)) + push(one) + else + push(zero) + return + if (isdouble(p1)) + n = Math.floor(p1.d) + if (n == p1.d) + push(one) + else + push(zero) + return + push_symbol(ISINTEGER) + push(p1) + list(2) + +Eval_number = -> + push(cadr(p1)) + Eval() + p1 = pop() + if (p1.k == NUM || p1.k == DOUBLE) + push_integer(1) + else + push_integer(0) + +Eval_operator = -> + h = tos + push_symbol(OPERATOR) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + p1 = cdr(p1) + list(tos - h) + +# quote definition +Eval_quote = -> + push(cadr(p1)) + +# rank definition +Eval_rank = -> + push(cadr(p1)) + Eval() + p1 = pop() + if (istensor(p1)) + push_integer(p1.tensor.ndim) + else + push(zero) + +# Evaluates the right side and assigns the +# result of the evaluation to the left side. +# It's called setq because it stands for "set quoted" from Lisp, +# see: +# http://stackoverflow.com/questions/869529/difference-between-set-setq-and-setf-in-common-lisp +# Note that this also takes case of assigning to a tensor +# element, which is something that setq wouldn't do +# in list, see comments further down below. + +# Example: +# f = x +# // f evaluates to x, so x is assigned to g really +# // rather than actually f being assigned to g +# g = f +# f = y +# g +# > x + +Eval_setq = -> + # case of tensor + if (caadr(p1) == symbol(INDEX)) + setq_indexed() + return + + # case of function definition + if (iscons(cadr(p1))) + define_user_function() + return + + if (!issymbol(cadr(p1))) + stop("symbol assignment: error in symbol") + + push(caddr(p1)) + Eval() + p2 = pop() + set_binding(cadr(p1), p2) + + # An assignment returns nothing. + # This is unlike most programming languages + # where an assignment does return the + # assigned value. + # TODO Could be changed. + push(symbol(NIL)) + +# Here "setq" is a misnomer because +# setq wouldn't work in Lisp to set array elements +# since setq stands for "set quoted" and you wouldn't +# quote an array element access. +# You'd rather use setf, which is a macro that can +# assign a value to anything. +# (setf (aref YourArray 2) "blue") +# see +# http://stackoverflow.com/questions/18062016/common-lisp-how-to-set-an-element-in-a-2d-array +#----------------------------------------------------------------------------- +# +# Example: a[1] = b +# +# p1 *-------*-----------------------* +# | | | +# setq *-------*-------* b +# | | | +# index a 1 +# +# cadadr(p1) -> a +# +#----------------------------------------------------------------------------- + +setq_indexed = -> + p4 = cadadr(p1) + # console.log "p4: " + p4 + if (!issymbol(p4)) + # this is likely to happen when one tries to + # do assignments like these + # 1[2] = 3 + # or + # f(x)[1] = 2 + # or + # [[1,2],[3,4]][5] = 6 + # + # In other words, one can only do + # a straight assignment like + # existingMatrix[index] = something + stop("indexed assignment: expected a symbol name") + h = tos + push(caddr(p1)) + Eval() + p2 = cdadr(p1) + while (iscons(p2)) + push(car(p2)) + Eval() + p2 = cdr(p2) + set_component(tos - h) + p3 = pop() + set_binding(p4, p3) + push(symbol(NIL)) + + +Eval_sqrt = -> + push(cadr(p1)) + Eval() + push_rational(1, 2) + power() + +Eval_stop = -> + stop("user stop") + +Eval_subst = -> + push(cadddr(p1)) + Eval() + push(caddr(p1)) + Eval() + push(cadr(p1)) + Eval() + subst() + Eval() # normalize + +# always returns a matrix with rank 2 +# i.e. two dimensions, +# the passed parameter is the size +Eval_unit = -> + i = 0 + n = 0 + push(cadr(p1)) + Eval() + n = pop_integer() + + if isNaN(n) + push(p1) + return + + if (n < 1) + push(p1) + return + + p1 = alloc_tensor(n * n) + p1.tensor.ndim = 2 + p1.tensor.dim[0] = n + p1.tensor.dim[1] = n + for i in [0...n] + p1.tensor.elem[n * i + i] = one + check_tensor_dimensions p1 + push(p1) + +Eval_noexpand = -> + prev_expanding = expanding + expanding = 0 + Eval() + expanding = prev_expanding + +# like Eval() except "=" (assignment) is treated +# as "==" (equality test) +# This is because +# * this allows users to be lazy and just +# use "=" instead of "==" as per more common +# mathematical notation +# * in many places we don't expect an assignment +# e.g. we don't expect to test the zero-ness +# of an assignment or the truth value of +# an assignment +# Note that these are questionable assumptions +# as for example in most programming languages one +# can indeed test the value of an assignment (the +# value is just the evaluation of the right side) + +Eval_predicate = -> + save() + p1 = top() + if (car(p1) == symbol(SETQ)) + # replace the assignment in the + # head with an equality test + pop() + push_symbol(TESTEQ) + push cadr(p1) + push caddr(p1) + list 3 + + Eval() + restore() diff --git a/node_modules/algebrite/sources/expand.coffee b/node_modules/algebrite/sources/expand.coffee new file mode 100644 index 0000000..a948a68 --- /dev/null +++ b/node_modules/algebrite/sources/expand.coffee @@ -0,0 +1,533 @@ +# Partial fraction expansion +# +# Example +# +# expand(1/(x^3+x^2),x) +# +# 1 1 1 +# ---- - --- + ------- +# 2 x x + 1 +# x + + + +Eval_expand = -> + + # 1st arg + + push(cadr(p1)) + Eval() + + # 2nd arg + + push(caddr(p1)) + Eval() + + p2 = pop() + if (p2 == symbol(NIL)) + guess() + else + push(p2) + + expand() + +#define A p2 +#define B p3 +#define C p4 +#define F p5 +#define P p6 +#define Q p7 +#define T p8 +#define X p9 + +expand = -> + + save() + + p9 = pop() + p5 = pop() + + if (istensor(p5)) + expand_tensor() + restore() + return + + # if sum of terms then sum over the expansion of each term + + if (car(p5) == symbol(ADD)) + push_integer(0) + p1 = cdr(p5) + while (iscons(p1)) + push(car(p1)) + push(p9) + expand() + add() + p1 = cdr(p1) + restore() + return + + # B = numerator + + push(p5) + numerator() + p3 = pop() + + # A = denominator + + push(p5) + denominator() + p2 = pop() + + remove_negative_exponents() + + # Q = quotient + + push(p3) + push(p2) + push(p9) + + # if the denominator is one then always bail out + # also bail out if the denominator is not one but + # it's not anything recognizable as a polynomial. + if isone(p3) || isone(p2) + if !ispolyexpandedform(p2,p9) || isone(p2) + pop() + pop() + pop() + push(p5) + # p5 is the original input, leave unchanged + restore() + return + + divpoly() + p7 = pop() + + # remainder B = B - A * Q + + push(p3) + push(p2) + push(p7) + multiply() + subtract() + p3 = pop() + + # if the remainder is zero then we're done + + if (isZeroAtomOrTensor(p3)) + push(p7) + restore() + return + + # A = factor(A) + + #console.log("expand - to be factored: " + p2) + push(p2) + push(p9) + factorpoly() + p2 = pop() + #console.log("expand - factored to: " + p2) + + expand_get_C() + expand_get_B() + expand_get_A() + + if (istensor(p4)) + push(p4) + prev_expanding = expanding + expanding = 1 + inv() + expanding = prev_expanding + push(p3) + inner() + push(p2) + inner() + else + push(p3) + push(p4) + prev_expanding = expanding + expanding = 1 + divide() + expanding = prev_expanding + push(p2) + multiply() + + push(p7) + add() + + restore() + +expand_tensor = -> + i = 0 + push(p5) + copy_tensor() + p5 = pop() + for i in [0...p5.tensor.nelem] + push(p5.tensor.elem[i]) + push(p9) + expand() + p5.tensor.elem[i] = pop() + push(p5) + +remove_negative_exponents = -> + h = 0 + i = 0 + j = 0 + k = 0 + n = 0 + + h = tos + factors(p2) + factors(p3) + n = tos - h + + # find the smallest exponent + + j = 0 + for i in [0...n] + p1 = stack[h + i] + if (car(p1) != symbol(POWER)) + continue + if (cadr(p1) != p9) + continue + push(caddr(p1)) + k = pop_integer() + if (isNaN(k)) + continue + if (k < j) + j = k + + moveTos h + + if (j == 0) + return + + # A = A / X^j + + push(p2) + push(p9) + push_integer(-j) + power() + multiply() + p2 = pop() + + # B = B / X^j + + push(p3) + push(p9) + push_integer(-j) + power() + multiply() + p3 = pop() + +# Returns the expansion coefficient matrix C. +# +# Example: +# +# B 1 +# --- = ----------- +# A 2 +# x (x + 1) +# +# We have +# +# B Y1 Y2 Y3 +# --- = ---- + ---- + ------- +# A 2 x x + 1 +# x +# +# Our task is to solve for the unknowns Y1, Y2, and Y3. +# +# Multiplying both sides by A yields +# +# AY1 AY2 AY3 +# B = ----- + ----- + ------- +# 2 x x + 1 +# x +# +# Let +# +# A A A +# W1 = ---- W2 = --- W3 = ------- +# 2 x x + 1 +# x +# +# Then the coefficient matrix C is +# +# coeff(W1,x,0) coeff(W2,x,0) coeff(W3,x,0) +# +# C = coeff(W1,x,1) coeff(W2,x,1) coeff(W3,x,1) +# +# coeff(W1,x,2) coeff(W2,x,2) coeff(W3,x,2) +# +# It follows that +# +# coeff(B,x,0) Y1 +# +# coeff(B,x,1) = C Y2 +# +# coeff(B,x,2) = Y3 +# +# Hence +# +# Y1 coeff(B,x,0) +# -1 +# Y2 = C coeff(B,x,1) +# +# Y3 coeff(B,x,2) + +expand_get_C = -> + h = 0 + i = 0 + j = 0 + n = 0 + #U **a + h = tos + if (car(p2) == symbol(MULTIPLY)) + p1 = cdr(p2) + while (iscons(p1)) + p5 = car(p1) + expand_get_CF() + p1 = cdr(p1) + else + p5 = p2 + expand_get_CF() + n = tos - h + if (n == 1) + p4 = pop() + return + p4 = alloc_tensor(n * n) + p4.tensor.ndim = 2 + p4.tensor.dim[0] = n + p4.tensor.dim[1] = n + a = h + for i in [0...n] + for j in [0...n] + push(stack[a+j]) + push(p9) + push_integer(i) + power() + prev_expanding = expanding + expanding = 1 + divide() + expanding = prev_expanding + push(p9) + filter() + p4.tensor.elem[n * i + j] = pop() + moveTos tos - n + +# The following table shows the push order for simple roots, repeated roots, +# and inrreducible factors. +# +# Factor F Push 1st Push 2nd Push 3rd Push 4th +# +# +# A +# x --- +# x +# +# +# 2 A A +# x ---- --- +# 2 x +# x +# +# +# A +# x + 1 ------- +# x + 1 +# +# +# 2 A A +# (x + 1) ---------- ------- +# 2 x + 1 +# (x + 1) +# +# +# 2 A Ax +# x + x + 1 ------------ ------------ +# 2 2 +# x + x + 1 x + x + 1 +# +# +# 2 2 A Ax A Ax +# (x + x + 1) --------------- --------------- ------------ ------------ +# 2 2 2 2 2 2 +# (x + x + 1) (x + x + 1) x + x + 1 x + x + 1 +# +# +# For T = A/F and F = P^N we have +# +# +# Factor F Push 1st Push 2nd Push 3rd Push 4th +# +# x T +# +# 2 +# x T TP +# +# +# x + 1 T +# +# 2 +# (x + 1) T TP +# +# 2 +# x + x + 1 T TX +# +# 2 2 +# (x + x + 1) T TX TP TPX +# +# +# Hence we want to push in the order +# +# T * (P ^ i) * (X ^ j) +# +# for all i, j such that +# +# i = 0, 1, ..., N - 1 +# +# j = 0, 1, ..., deg(P) - 1 +# +# where index j runs first. + +expand_get_CF = -> + d = 0 + i = 0 + j = 0 + n = 0 + + if (!Find(p5, p9)) + return + prev_expanding = expanding + expanding = 1 + trivial_divide() + expanding = prev_expanding + if (car(p5) == symbol(POWER)) + push(caddr(p5)) + n = pop_integer() + p6 = cadr(p5) + else + n = 1 + p6 = p5 + + push(p6) + push(p9) + degree() + d = pop_integer() + for i in [0...n] + for j in [0...d] + push(p8) + push(p6) + push_integer(i) + power() + prev_expanding = expanding + expanding = 1 + multiply() + expanding = prev_expanding + push(p9) + push_integer(j) + power() + prev_expanding = expanding + expanding = 1 + multiply() + expanding = prev_expanding + +# Returns T = A/F where F is a factor of A. + +trivial_divide = -> + h = 0 + if (car(p2) == symbol(MULTIPLY)) + h = tos + p0 = cdr(p2) + while (iscons(p0)) + if (!equal(car(p0), p5)) + push(car(p0)) + Eval(); # force expansion of (x+1)^2, f.e. + p0 = cdr(p0) + multiply_all(tos - h) + else + push_integer(1) + p8 = pop() + +# Returns the expansion coefficient vector B. + +expand_get_B = -> + i = 0 + n = 0 + if (!istensor(p4)) + return + n = p4.tensor.dim[0] + p8 = alloc_tensor(n) + p8.tensor.ndim = 1 + p8.tensor.dim[0] = n + for i in [0...n] + push(p3) + push(p9) + push_integer(i) + power() + prev_expanding = expanding + expanding = 1 + divide() + expanding = prev_expanding + push(p9) + filter() + p8.tensor.elem[i] = pop() + p3 = p8 + +# Returns the expansion fractions in A. + +expand_get_A = -> + h = 0 + i = 0 + n = 0 + if (!istensor(p4)) + push(p2) + reciprocate() + p2 = pop() + return + h = tos + if (car(p2) == symbol(MULTIPLY)) + p8 = cdr(p2) + while (iscons(p8)) + p5 = car(p8) + expand_get_AF() + p8 = cdr(p8) + else + p5 = p2 + expand_get_AF() + n = tos - h + p8 = alloc_tensor(n) + p8.tensor.ndim = 1 + p8.tensor.dim[0] = n + for i in [0...n] + p8.tensor.elem[i] = stack[h + i] + moveTos h + p2 = p8 + +expand_get_AF = -> + d = 0 + i = 0 + j = 0 + n = 1 + if (!Find(p5, p9)) + return + if (car(p5) == symbol(POWER)) + push(caddr(p5)) + n = pop_integer() + p5 = cadr(p5) + push(p5) + push(p9) + degree() + d = pop_integer() + for i in [n...0] + for j in [0...d] + push(p5) + push_integer(i) + power() + reciprocate() + push(p9) + push_integer(j) + power() + multiply() + + diff --git a/node_modules/algebrite/sources/expcos.coffee b/node_modules/algebrite/sources/expcos.coffee new file mode 100644 index 0000000..1809864 --- /dev/null +++ b/node_modules/algebrite/sources/expcos.coffee @@ -0,0 +1,34 @@ +# Do the exponential cosine function. + + + +Eval_expcos = -> + push(cadr(p1)) + Eval() + expcos() + +expcos = -> + save() + + p1 = pop() + + push(imaginaryunit) + push(p1) + multiply() + exponential() + push_rational(1, 2) + multiply() + + push(imaginaryunit) + negate() + push(p1) + multiply() + exponential() + push_rational(1, 2) + multiply() + + add() + + restore() + + diff --git a/node_modules/algebrite/sources/expsin.coffee b/node_modules/algebrite/sources/expsin.coffee new file mode 100644 index 0000000..576af35 --- /dev/null +++ b/node_modules/algebrite/sources/expsin.coffee @@ -0,0 +1,38 @@ +# Do the exponential sine function. + + + +Eval_expsin = -> + push(cadr(p1)) + Eval() + expsin() + +expsin = -> + save() + + p1 = pop() + + push(imaginaryunit) + push(p1) + multiply() + exponential() + push(imaginaryunit) + divide() + push_rational(1, 2) + multiply() + + push(imaginaryunit) + negate() + push(p1) + multiply() + exponential() + push(imaginaryunit) + divide() + push_rational(1, 2) + multiply() + + subtract() + + restore() + + diff --git a/node_modules/algebrite/sources/factor.coffee b/node_modules/algebrite/sources/factor.coffee new file mode 100644 index 0000000..cabd9bd --- /dev/null +++ b/node_modules/algebrite/sources/factor.coffee @@ -0,0 +1,121 @@ +# factor a polynomial or integer + + + +Eval_factor = -> + push(cadr(p1)) + Eval() + + push(caddr(p1)) + Eval() + + p2 = pop() + if (p2 == symbol(NIL)) + guess() + else + push(p2) + + factor() + + # more factoring? + + p1 = cdddr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + factor_again() + p1 = cdr(p1) + +factor_again = -> + + save() + + p2 = pop() + p1 = pop() + + h = tos + + if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + factor_term() + p1 = cdr(p1) + else + push(p1) + push(p2) + factor_term() + + n = tos - h + + if (n > 1) + multiply_all_noexpand(n) + + restore() + +factor_term = -> + save() + factorpoly() + p1 = pop() + if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + p1 = cdr(p1) + else + push(p1) + restore() + +factor = -> + save() + p2 = pop() + p1 = pop() + if (isinteger(p1)) + push(p1) + factor_number(); # see pollard.cpp + else + push(p1) + push(p2) + factorpoly() + restore() + +# for factoring small integers (2^32 or less) + +factor_small_number = -> + + i = 0 + save() + + n = pop_integer() + + if (isNaN(n)) + stop("number too big to factor") + + if (n < 0) + n = -n + + for i in [0...MAXPRIMETAB] + + d = primetab[i] + + if (d > n / d) + break + + expo = 0 + + while (n % d == 0) + n /= d + expo++ + + if (expo) + push_integer(d) + push_integer(expo) + + if (n > 1) + push_integer(n) + push_integer(1) + + restore() + + diff --git a/node_modules/algebrite/sources/factorial.coffee b/node_modules/algebrite/sources/factorial.coffee new file mode 100644 index 0000000..6972ef1 --- /dev/null +++ b/node_modules/algebrite/sources/factorial.coffee @@ -0,0 +1,170 @@ + + + +factorial = -> + n = 0 + save() + p1 = pop() + push(p1) + n = pop_integer() + if (n < 0 || isNaN(n)) + push_symbol(FACTORIAL) + push(p1) + list(2) + restore() + return + bignum_factorial(n) + restore() + + +# simplification rules for factorials (m < n) +# +# (e + 1) * factorial(e) -> factorial(e + 1) +# +# factorial(e) / e -> factorial(e - 1) +# +# e / factorial(e) -> 1 / factorial(e - 1) +# +# factorial(e + n) +# ---------------- -> (e + m + 1)(e + m + 2)...(e + n) +# factorial(e + m) +# +# factorial(e + m) 1 +# ---------------- -> -------------------------------- +# factorial(e + n) (e + m + 1)(e + m + 2)...(e + n) + +# this function is not actually used, but +# all these simplifications +# do happen automatically via simplify +simplifyfactorials = -> + x = 0 + + save() + + x = expanding + expanding = 0 + + p1 = pop() + + if (car(p1) == symbol(ADD)) + push(zero) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + simplifyfactorials() + add() + p1 = cdr(p1) + expanding = x + restore() + return + + if (car(p1) == symbol(MULTIPLY)) + sfac_product() + expanding = x + restore() + return + + push(p1) + + expanding = x + restore() + +sfac_product = -> + i = 0 + j = 0 + n = 0 + + s = tos + + p1 = cdr(p1) + n = 0 + while (iscons(p1)) + push(car(p1)) + p1 = cdr(p1) + n++ + + for i in [0...(n - 1)] + if (stack[s + i] == symbol(NIL)) + continue + for j in [(i + 1)...n] + if (stack[s + j] == symbol(NIL)) + continue + sfac_product_f(s, i, j) + + push(one) + + for i in [0...n] + if (stack[s+i] == symbol(NIL)) + continue + push(stack[s+i]) + multiply() + + p1 = pop() + + moveTos tos - n + + push(p1) + +sfac_product_f = (s,a,b) -> + i = 0 + n = 0 + + p1 = stack[s + a] + p2 = stack[s + b] + + if (ispower(p1)) + p3 = caddr(p1) + p1 = cadr(p1) + else + p3 = one + + if (ispower(p2)) + p4 = caddr(p2) + p2 = cadr(p2) + else + p4 = one + + if (isfactorial(p1) && isfactorial(p2)) + + # Determine if the powers cancel. + + push(p3) + push(p4) + add() + yyexpand() + n = pop_integer() + if (n != 0) + return + + # Find the difference between the two factorial args. + + # For example, the difference between (a + 2)! and a! is 2. + + push(cadr(p1)) + push(cadr(p2)) + subtract() + yyexpand(); # to simplify + + n = pop_integer() + if (n == 0 || isNaN(n)) + return + if (n < 0) + n = -n + p5 = p1 + p1 = p2 + p2 = p5 + p5 = p3 + p3 = p4 + p4 = p5 + + push(one) + + for i in [1..n] + push(cadr(p2)) + push_integer(i) + add() + push(p3) + power() + multiply() + stack[s+a] = pop() + stack[s+b] = symbol(NIL) diff --git a/node_modules/algebrite/sources/factorpoly.coffee b/node_modules/algebrite/sources/factorpoly.coffee new file mode 100644 index 0000000..145fad3 --- /dev/null +++ b/node_modules/algebrite/sources/factorpoly.coffee @@ -0,0 +1,582 @@ +# Factor a polynomial + +factorpoly = -> + if DEBUG then console.log "factorpoly: " + stack[tos-1].toString() + " " + stack[tos-2].toString() + + save() + + variable = pop() + polynomial = pop() + + if !Find(polynomial, variable) or + !ispolyexpandedform(polynomial, variable) or + !issymbol(variable) + push(polynomial) + + else + yyfactorpoly(variable, polynomial) + + restore() + +#----------------------------------------------------------------------------- +# +# Input: tos-2 true polynomial +# +# tos-1 free variable +# +# Output: factored polynomial on stack +# +#----------------------------------------------------------------------------- + +yyfactorpoly = (variable, polynomial) -> + + if DEBUG + firstParam = variable + secondParam = polynomial + console.log "yyfactorpoly: " + firstParam + " " + secondParam + + + save() + + h = tos + + if (isfloating(polynomial)) + stop("floating point numbers in polynomial") + + polycoeff = tos + + factpoly_expo = coeff(variable, polynomial) - 1 + + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " factpoly_expo before rationalize_coefficients: " + factpoly_expo + partOfPolynomialFactoredSoFar = rationalize_coefficients(h) + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " factpoly_expo after rationalize_coefficients: " + factpoly_expo + + # for univariate polynomials we could do factpoly_expo > 1 + + whichRootsAreWeFinding = "real" + remainingPoly = null + while (factpoly_expo > 0) + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " factpoly_expo inside while loop: " + factpoly_expo + + if (isZeroAtomOrTensor(stack[polycoeff+0])) + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " isZeroAtomOrTensor" + A = one + B = zero + else + #console.log("trying to find a " + whichRootsAreWeFinding + " root") + if whichRootsAreWeFinding == "real" + [foundRealRoot,A,B] = get_factor_from_real_root(variable, factpoly_expo, polycoeff) + else if whichRootsAreWeFinding == "complex" + [foundComplexRoot,A] = get_factor_from_complex_root(remainingPoly, factpoly_expo, polycoeff) + + if whichRootsAreWeFinding == "real" + if foundRealRoot == 0 + whichRootsAreWeFinding = "complex" + continue + else + # build the 1-degree polynomial out of the + # real solution that was just found. + push(A) # A + push(variable) # x + multiply() + push(B) # B + add() + AxPlusB = pop() + + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " success\nFACTOR=" + AxPlusB + + # factor out negative sign (not req'd because A > 1) + #if 0 + ### + if (isnegativeterm(A)) + push(AxPlusB) + negate() + AxPlusB = pop() + push(partOfPolynomialFactoredSoFar) + negate_noexpand() + partOfPolynomialFactoredSoFar = pop() + ### + #endif + + # partOfPolynomialFactoredSoFar is the part of the polynomial that was factored so far, + # add the newly found factor to it. Note that we are not actually + # multiplying the polynomials fully, we are just leaving them + # expressed as (P1)*(P2), we are not expanding the product. + push(partOfPolynomialFactoredSoFar) + push(AxPlusB) + multiply_noexpand() + partOfPolynomialFactoredSoFar = pop() + + # ok now on stack we have the coefficients of the + # remaining part of the polynomial still to factor. + # Divide it by the newly-found factor so that + # the stack then contains the coefficients of the + # polynomial part still left to factor. + yydivpoly(factpoly_expo, polycoeff, A, B) + + while (factpoly_expo and isZeroAtomOrTensor(stack[polycoeff+factpoly_expo])) + factpoly_expo-- + + push(zero) + for i in [0..factpoly_expo] + push(stack[polycoeff+i]) + push(variable) # the free variable + push_integer(i) + power() + multiply() + add() + remainingPoly = pop() + #console.log("real branch remainingPoly: " + remainingPoly) + + else if whichRootsAreWeFinding == "complex" + if foundComplexRoot == 0 + break + else + # build the 2-degree polynomial out of the + # real solution that was just found. + push(A) # A + push(variable) # x + subtract() + #console.log("first factor: " + stack[tos-1].toString()) + + push(A) # A + conjugate() + push(variable) # x + subtract() + #console.log("second factor: " + stack[tos-1].toString()) + + multiply() + + #if (factpoly_expo > 0 && isnegativeterm(stack[polycoeff+factpoly_expo])) + # negate() + # negate_noexpand() + + secondDegreePloly = pop() + + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " success\nFACTOR=" + secondDegreePloly + + # factor out negative sign (not req'd because A > 1) + #if 0 + ### + if (isnegativeterm(A)) + push(secondDegreePloly) + negate() + secondDegreePloly = pop() + push(partOfPolynomialFactoredSoFar) + negate_noexpand() + partOfPolynomialFactoredSoFar = pop() + ### + #endif + + # partOfPolynomialFactoredSoFar is the part of the polynomial that was factored so far, + # add the newly found factor to it. Note that we are not actually + # multiplying the polynomials fully, we are just leaving them + # expressed as (P1)*(P2), we are not expanding the product. + + push(partOfPolynomialFactoredSoFar) + previousFactorisation = pop() + + #console.log("previousFactorisation: " + previousFactorisation) + + push(partOfPolynomialFactoredSoFar) + push(secondDegreePloly) + multiply_noexpand() + partOfPolynomialFactoredSoFar = pop() + + #console.log("new prospective factorisation: " + partOfPolynomialFactoredSoFar) + + + # build the polynomial of the unfactored part + #console.log("build the polynomial of the unfactored part factpoly_expo: " + factpoly_expo) + + if !remainingPoly? + push(zero) + for i in [0..factpoly_expo] + push(stack[polycoeff+i]) + push(variable) # the free variable + push_integer(i) + power() + multiply() + add() + remainingPoly = pop() + #console.log("original polynomial (dividend): " + remainingPoly) + + dividend = remainingPoly + #push(dividend) + #degree() + #startingDegree = pop() + push(dividend) + + #console.log("dividing " + stack[tos-1].toString() + " by " + secondDegreePloly) + push(secondDegreePloly) # divisor + push(variable) # X + divpoly() + remainingPoly = pop() + + push(remainingPoly) + push(secondDegreePloly) # divisor + multiply() + checkingTheDivision = pop() + + if !equal(checkingTheDivision, dividend) + + #push(dividend) + #gcd_sum() + #console.log("gcd top of stack: " + stack[tos-1].toString()) + + + if DEBUG then console.log("we found a polynomial based on complex root and its conj but it doesn't divide the poly, quitting") + if DEBUG then console.log("so just returning previousFactorisation times dividend: " + previousFactorisation + " * " + dividend) + push(previousFactorisation) + push(dividend) + + prev_expanding = expanding + expanding = 0 + yycondense() + expanding = prev_expanding + + multiply_noexpand() + partOfPolynomialFactoredSoFar = pop() + stack[h] = partOfPolynomialFactoredSoFar + moveTos h + 1 + restore() + return + + #console.log("result: (still to be factored) " + remainingPoly) + + #push(remainingPoly) + #degree() + #remainingDegree = pop() + + ### + if compare_numbers(startingDegree, remainingDegree) + # ok even if we found a complex root that + # together with the conjugate generates a poly in Z, + # that doesn't mean that the division would end up in Z. + # Example: 1+x^2+x^4+x^6 has +i and -i as one of its roots + # so a factor is 1+x^2 ( = (x+i)*(x-i)) + # BUT + ### + + + for i in [0..factpoly_expo] + pop() + + coeff(variable, remainingPoly) + + + factpoly_expo -= 2 + #console.log("factpoly_expo: " + factpoly_expo) + + + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " building the remaining unfactored part of the polynomial" + + push(zero) + for i in [0..factpoly_expo] + push(stack[polycoeff+i]) + push(variable) # the free variable + push_integer(i) + power() + multiply() + add() + polynomial = pop() + + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " remaining unfactored part of the polynomial: " + polynomial.toString() + + push(polynomial) + + prev_expanding = expanding + expanding = 0 + yycondense() + expanding = prev_expanding + + polynomial = pop() + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " new poly with extracted common factor: " + polynomial.toString() + #debugger + + # factor out negative sign + + if (factpoly_expo > 0 && isnegativeterm(stack[polycoeff+factpoly_expo])) + push(polynomial) + #prev_expanding = expanding + #expanding = 1 + negate() + #expanding = prev_expanding + polynomial = pop() + push(partOfPolynomialFactoredSoFar) + negate_noexpand() + partOfPolynomialFactoredSoFar = pop() + + push(partOfPolynomialFactoredSoFar) + push(polynomial) + multiply_noexpand() + partOfPolynomialFactoredSoFar = pop() + + if DEBUG then console.log "yyfactorpoly: " + firstParam + " " + secondParam + " result: " + partOfPolynomialFactoredSoFar + + stack[h] = partOfPolynomialFactoredSoFar + + moveTos h + 1 + + restore() + +rationalize_coefficients = (h) -> + + # LCM of all polynomial coefficients + + ratio = one + for i in [h...tos] + push(stack[i]) + denominator() + push(ratio) + lcm() + ratio = pop() + + # multiply each coefficient by RESULT + + for i in [h...tos] + push(ratio) + push(stack[i]) + multiply() + stack[i] = pop() + + # reciprocate RESULT + + push(ratio) + reciprocate() + ratioInverse = pop() + if DEBUG then console.log "rationalize_coefficients result: " + ratioInverse.toString() + return ratioInverse + +get_factor_from_real_root = (variable, factpoly_expo, polycoeff)-> + + if DEBUG then console.log "get_factor_from_real_root" + + i = 0 + j = 0 + h = 0 + a0 = 0 + an = 0 + na0 = 0 + nan = 0 + + if DEBUG + push(zero) + for i in [0..factpoly_expo] + push(stack[polycoeff+i]) + push(variable) + push_integer(i) + power() + multiply() + add() + polynomial = pop() + console.log("POLY=" + polynomial) + + h = tos + + an = tos + push(stack[polycoeff+factpoly_expo]) + + divisors_onstack() + + nan = tos - an + + a0 = tos + push(stack[polycoeff+0]) + divisors_onstack() + na0 = tos - a0 + + if DEBUG + console.log("divisors of base term") + for i in [0...na0] + console.log(", " + stack[a0 + i]) + console.log("divisors of leading term") + for i in [0...nan] + console.log(", " + stack[an + i]) + + # try roots + + for rootsTries_i in [0...nan] + for rootsTries_j in [0...na0] + + #if DEBUG then console.log "nan: " + nan + " na0: " + na0 + " i: " + rootsTries_i + " j: " + rootsTries_j + + testNumerator = stack[an + rootsTries_i] + testDenominator = stack[a0 + rootsTries_j] + + push(testDenominator) + push(testNumerator) + divide() + negate() + testValue = pop() + + evalPolyResult = Evalpoly(factpoly_expo, polycoeff, testValue) + + if DEBUG + console.log("try A=" + testNumerator) + console.log(", B=" + testDenominator) + console.log(", root " + variable) + console.log("=-B/A=" + testValue) + console.log(", POLY(" + testValue) + console.log(")=" + evalPolyResult) + + if (isZeroAtomOrTensor(evalPolyResult)) + moveTos h + if DEBUG then console.log "get_factor_from_real_root returning 1" + return [1, testNumerator, testDenominator] + + push(testDenominator) + negate() + testDenominator = pop() + + push(testValue) + negate() + testValue = pop() + + evalPolyResult = Evalpoly(factpoly_expo, polycoeff, testValue) + + if DEBUG + console.log("try A=" + testNumerator) + console.log(", B=" + testDenominator) + console.log(", root " + variable) + console.log("=-B/A=" + testValue) + console.log(", POLY(" + testValue) + console.log(")=" + evalPolyResult) + + if (isZeroAtomOrTensor(evalPolyResult)) + moveTos h + if DEBUG then console.log "get_factor_from_real_root returning 1" + return [1, testNumerator, testDenominator] + + moveTos h + + if DEBUG then console.log "get_factor_from_real_root returning" + return [0, null, null] + +get_factor_from_complex_root = (remainingPoly, factpoly_expo, polycoeff) -> + + i = 0 + j = 0 + h = 0 + a0 = 0 + an = 0 + na0 = 0 + nan = 0 + + if factpoly_expo <= 2 + if DEBUG then console.log("no more factoring via complex roots to be found in polynomial of degree <= 2") + return [0,null] + + if DEBUG then console.log("complex root finding for POLY=" + remainingPoly) + + h = tos + an = tos + + # trying -1^(2/3) which generates a polynomial in Z + # generates x^2 + 2x + 1 + push_integer(-1) + push_rational(2,3) + power() + rect() + testValue = pop() + if DEBUG then console.log("complex root finding: trying with " + testValue) + push(testValue) + evalPolyResult = Evalpoly(factpoly_expo, polycoeff, testValue) + if DEBUG then console.log("complex root finding result: " + evalPolyResult) + if (isZeroAtomOrTensor(evalPolyResult)) + moveTos h + if DEBUG then console.log "get_factor_from_complex_root returning 1" + return [1,testValue] + + # trying 1^(2/3) which generates a polynomial in Z + # http://www.wolframalpha.com/input/?i=(1)%5E(2%2F3) + # generates x^2 - 2x + 1 + push_integer(1) + push_rational(2,3) + power() + rect() + testValue = pop() + if DEBUG then console.log("complex root finding: trying with " + testValue) + push(testValue) + evalPolyResult = Evalpoly(factpoly_expo, polycoeff, testValue) + if DEBUG then console.log("complex root finding result: " + evalPolyResult) + if (isZeroAtomOrTensor(evalPolyResult)) + moveTos h + if DEBUG then console.log "get_factor_from_complex_root returning 1" + return [1,testValue] + + + # trying some simple complex numbers. All of these + # generate polynomials in Z + for rootsTries_i in [-10..10] + for rootsTries_j in [1..5] + push_integer(rootsTries_i) + push_integer(rootsTries_j) + push(imaginaryunit) + multiply() + add() + rect() + testValue = pop() + if DEBUG then console.log("complex root finding: trying simple complex combination " + testValue) + + + push(testValue) + + evalPolyResult = Evalpoly(factpoly_expo, polycoeff, testValue) + + #console.log("complex root finding result: " + evalPolyResult) + if (isZeroAtomOrTensor(evalPolyResult)) + moveTos h + if DEBUG then console.log "found complex root: " + evalPolyResult + return [1,testValue] + + moveTos h + + if DEBUG then console.log "get_factor_from_complex_root returning 0" + return [0,null] + +#----------------------------------------------------------------------------- +# +# Divide a polynomial by Ax+B +# +# Input: on stack: polycoeff Dividend coefficients +# +# factpoly_expo as parameter +# +# A as parameter +# +# B as parameter +# +# Output: on stack: polycoeff Contains quotient coefficients +# +#----------------------------------------------------------------------------- + +yydivpoly = (factpoly_expo, polycoeff, A, B) -> + Q = zero + for i in [factpoly_expo...0] + push(stack[polycoeff+i]) + stack[polycoeff+i] = Q + push(A) + divide() + Q = pop() + push(stack[polycoeff+i - 1]) + push(Q) + push(B) + multiply() + subtract() + stack[polycoeff+i - 1] = pop() + stack[polycoeff+0] = Q + if DEBUG then console.log "yydivpoly Q: " + Q.toString() + +Evalpoly = (factpoly_expo, polycoeff, evaluateAt) -> + push(zero) + for i in [factpoly_expo..0] + push(evaluateAt) + multiply() + push(stack[polycoeff+i]) + #if DEBUG + # console.log("Evalpoly top of stack:") + # console.log stack[tos-i].toString() + add() + return pop() + diff --git a/node_modules/algebrite/sources/factors.coffee b/node_modules/algebrite/sources/factors.coffee new file mode 100644 index 0000000..4b9737b --- /dev/null +++ b/node_modules/algebrite/sources/factors.coffee @@ -0,0 +1,42 @@ +# Push expression factors onto the stack. For example... +# +# Input +# +# 2 +# 3x + 2x + 1 +# +# Output on stack +# +# [ 3 ] +# [ x^2 ] +# [ 2 ] +# [ x ] +# [ 1 ] +# +# but not necessarily in that order. Returns the number of factors. + + + +# Local U *p is OK here because no functional path to garbage collector. + +factors = (p) -> + h = tos + if (car(p) == symbol(ADD)) + p = cdr(p) + while (iscons(p)) + push_term_factors(car(p)) + p = cdr(p) + else + push_term_factors(p) + return tos - h + +# Local U *p is OK here because no functional path to garbage collector. + +push_term_factors = (p) -> + if (car(p) == symbol(MULTIPLY)) + p = cdr(p) + while (iscons(p)) + push(car(p)) + p = cdr(p) + else + push(p) diff --git a/node_modules/algebrite/sources/filter.coffee b/node_modules/algebrite/sources/filter.coffee new file mode 100644 index 0000000..dc0effb --- /dev/null +++ b/node_modules/algebrite/sources/filter.coffee @@ -0,0 +1,71 @@ +### +Remove terms that involve a given symbol or expression. For example... + + filter(x^2 + x + 1, x) => 1 + + filter(x^2 + x + 1, x^2) => x + 1 +### + + + +Eval_filter = -> + p1 = cdr(p1) + push(car(p1)) + Eval() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + filter() + p1 = cdr(p1) + +### + For example... + + push(F) + push(X) + filter() + F = pop() +### + +filter = -> + save() + p2 = pop() + p1 = pop() + filter_main() + restore() + +filter_main = -> + if (car(p1) == symbol(ADD)) + filter_sum() + else if (istensor(p1)) + filter_tensor() + else if (Find(p1, p2)) + push_integer(0) + else + push(p1) + +filter_sum = -> + push_integer(0) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + filter() + add() + p1 = cdr(p1) + +filter_tensor = -> + i = 0 + n = 0 + n = p1.tensor.nelem + p3 = alloc_tensor(n) + p3.tensor.ndim = p1.tensor.ndim + for i in [0...p1.tensor.ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + for i in [0...n] + push(p1.tensor.elem[i]) + push(p2) + filter() + p3.tensor.elem[i] = pop() + push(p3) diff --git a/node_modules/algebrite/sources/float.coffee b/node_modules/algebrite/sources/float.coffee new file mode 100644 index 0000000..9838e52 --- /dev/null +++ b/node_modules/algebrite/sources/float.coffee @@ -0,0 +1,77 @@ + + +Eval_float = -> + evaluatingAsFloats++ + push(cadr(p1)) + Eval() + yyfloat() + Eval(); # normalize + evaluatingAsFloats-- + +checkFloatHasWorkedOutCompletely = (nodeToCheck) -> + numberOfPowers = countOccurrencesOfSymbol(symbol(POWER),nodeToCheck) + numberOfPIs = countOccurrencesOfSymbol(symbol(PI),nodeToCheck) + numberOfEs = countOccurrencesOfSymbol(symbol(E),nodeToCheck) + numberOfMults = countOccurrencesOfSymbol(symbol(MULTIPLY),nodeToCheck) + numberOfSums = countOccurrencesOfSymbol(symbol(ADD),nodeToCheck) + if DEBUG + console.log " ... numberOfPowers: " + numberOfPowers + console.log " ... numberOfPIs: " + numberOfPIs + console.log " ... numberOfEs: " + numberOfEs + console.log " ... numberOfMults: " + numberOfMults + console.log " ... numberOfSums: " + numberOfSums + if numberOfPowers > 1 or numberOfPIs > 0 or numberOfEs > 0 or numberOfMults > 1 or numberOfSums > 1 + stop("float: some unevalued parts in " + nodeToCheck) + +zzfloat = -> + save() + evaluatingAsFloats++ + #p1 = pop() + #push(cadr(p1)) + #push(p1) + Eval() + yyfloat() + Eval(); # normalize + evaluatingAsFloats-- + restore() + # zzfloat doesn't necessarily result in a double + # , for example if there are variables. But + # in many of the tests there should be indeed + # a float, this line comes handy to highlight + # when that doesn't happen for those tests. + #checkFloatHasWorkedOutCompletely(stack[tos-1]) + +yyfloat = -> + i = 0 + h = 0 + evaluatingAsFloats++ + save() + p1 = pop() + if (iscons(p1)) + h = tos + while (iscons(p1)) + push(car(p1)) + yyfloat() + p1 = cdr(p1) + list(tos - h) + else if (p1.k == TENSOR) + push(p1) + copy_tensor() + p1 = pop() + for i in [0...p1.tensor.nelem] + push(p1.tensor.elem[i]) + yyfloat() + p1.tensor.elem[i] = pop() + push(p1) + else if (p1.k == NUM) + push(p1) + bignum_float() + else if (p1 == symbol(PI)) + push_double(Math.PI) + else if (p1 == symbol(E)) + push_double(Math.E) + else + push(p1) + restore() + evaluatingAsFloats-- + diff --git a/node_modules/algebrite/sources/floor.coffee b/node_modules/algebrite/sources/floor.coffee new file mode 100644 index 0000000..5c2d6d9 --- /dev/null +++ b/node_modules/algebrite/sources/floor.coffee @@ -0,0 +1,43 @@ + + +Eval_floor = -> + push(cadr(p1)) + Eval() + yfloor() + +yfloor = -> + save() + yyfloor() + restore() + +yyfloor = -> + d = 0.0 + + p1 = pop() + + if (!isNumericAtom(p1)) + push_symbol(FLOOR) + push(p1) + list(2) + return + + if (isdouble(p1)) + d = Math.floor(p1.d) + push_double(d) + return + + if (isinteger(p1)) + push(p1) + return + + p3 = new U() + p3.k = NUM + p3.q.a = mdiv(p1.q.a, p1.q.b) + p3.q.b = mint(1) + push(p3) + + if (isnegativenumber(p1)) + push_integer(-1) + add() + + diff --git a/node_modules/algebrite/sources/for.coffee b/node_modules/algebrite/sources/for.coffee new file mode 100644 index 0000000..f660937 --- /dev/null +++ b/node_modules/algebrite/sources/for.coffee @@ -0,0 +1,66 @@ +# 'for' function + +### +x=0 +y=2 +for(do(x=sqrt(2+x),y=2*y/x),k,1,9) +float(y) + +X: k +B: 1...9 + +1st parameter is the body +2nd parameter is the variable to loop with +3rd and 4th are the limits + + +### + +#define A p3 +#define B p4 +#define I p5 +#define X p6 + +Eval_for = -> + i = 0 + j = 0 + k = 0 + + loopingVariable = caddr(p1) + if (!issymbol(loopingVariable)) + stop("for: 2nd arg should be the variable to loop over") + + push(cadddr(p1)) + Eval() + j = pop_integer() + if (isNaN(j)) + push p1 + return + + push(caddddr(p1)) + Eval() + k = pop_integer() + if (isNaN(k)) + push p1 + return + + + # remember contents of the index + # variable so we can put it back after the loop + p4 = get_binding(loopingVariable) + + for i in [j..k] + push_integer(i) + p5 = pop() + set_binding(loopingVariable, p5) + push(cadr(p1)) + Eval() + pop() + + # put back the index variable to original content + set_binding(loopingVariable, p4) + + # return value + + push_symbol(NIL) + diff --git a/node_modules/algebrite/sources/gamma.coffee b/node_modules/algebrite/sources/gamma.coffee new file mode 100644 index 0000000..9c2616b --- /dev/null +++ b/node_modules/algebrite/sources/gamma.coffee @@ -0,0 +1,107 @@ +#----------------------------------------------------------------------------- +# +# Author : philippe.billet@noos.fr +# +# Gamma function gamma(x) +# +#----------------------------------------------------------------------------- + + + + +Eval_gamma = -> + push(cadr(p1)) + Eval() + gamma() + +gamma = -> + save() + gammaf() + restore() + +gammaf = -> + # double d + + p1 = pop() + + if (isrational(p1) && MEQUAL(p1.q.a, 1) && MEQUAL(p1.q.b, 2)) + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + push_rational(1,2) + power() + return + + if (isrational(p1) && MEQUAL(p1.q.a, 3) && MEQUAL(p1.q.b, 2)) + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + push_rational(1,2) + power() + push_rational(1,2) + multiply() + return + + # if (p1->k == DOUBLE) { + # d = exp(lgamma(p1.d)) + # push_double(d) + # return + # } + + if (isnegativeterm(p1)) + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + push_integer(-1) + multiply() + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + push(p1) + multiply() + sine() + push(p1) + multiply() + push(p1) + negate() + gamma() + multiply() + divide() + return + + if (car(p1) == symbol(ADD)) + gamma_of_sum() + return + + + push_symbol(GAMMA) + push(p1) + list(2) + return + +gamma_of_sum = -> + p3 = cdr(p1) + if (isrational(car(p3)) && MEQUAL(car(p3).q.a, 1) && MEQUAL(car(p3).q.b, 1)) + push(cadr(p3)) + push(cadr(p3)) + gamma() + multiply() + else + if (isrational(car(p3)) && MEQUAL(car(p3).q.a, -1) && MEQUAL(car(p3).q.b, 1)) + push(cadr(p3)) + gamma() + push(cadr(p3)) + push_integer(-1) + add() + divide() + else + push_symbol(GAMMA) + push(p1) + list(2) + return + + diff --git a/node_modules/algebrite/sources/gcd.coffee b/node_modules/algebrite/sources/gcd.coffee new file mode 100644 index 0000000..9da4f16 --- /dev/null +++ b/node_modules/algebrite/sources/gcd.coffee @@ -0,0 +1,306 @@ +# Greatest common denominator +# can also be run on polynomials, however +# it works only on the integers and it works +# by factoring the polynomials (not Euclidean algorithm) + +Eval_gcd = -> + p1 = cdr(p1) + push(car(p1)) + Eval() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + gcd() + p1 = cdr(p1) + +gcd = -> + prev_expanding = expanding + save() + gcd_main() + restore() + expanding = prev_expanding + +gcd_main = -> + expanding = 1 + + p2 = pop() + p1 = pop() + + if DEBUG then console.log "gcd_main: p1: " + p1 + " p2: " + p2 + + if (equal(p1, p2)) + push(p1) + return + + if (isrational(p1) && isrational(p2)) + push(p1) + push(p2) + gcd_numbers() + return + + + if (polyVar = areunivarpolysfactoredorexpandedform(p1, p2)) + gcd_polys(polyVar) + return + + + if (car(p1) == symbol(ADD) && car(p2) == symbol(ADD)) + gcd_sum_sum() + return + + if (car(p1) == symbol(ADD)) + gcd_sum(p1) + p1 = pop() + + if (car(p2) == symbol(ADD)) + gcd_sum(p2) + p2 = pop() + + if (car(p1) == symbol(MULTIPLY)) + gcd_sum_product() + return + + if (car(p2) == symbol(MULTIPLY)) + gcd_product_sum() + return + + if (car(p1) == symbol(MULTIPLY) && car(p2) == symbol(MULTIPLY)) + gcd_product_product() + return + + gcd_powers_with_same_base() + + +areunivarpolysfactoredorexpandedform = (p1, p2) -> + if DEBUG then console.log "areunivarpolysfactoredorexpandedform: p1: " + p1 + " p2: " + p2 + if polyVar = isunivarpolyfactoredorexpandedform(p1) + if isunivarpolyfactoredorexpandedform(p2,polyVar) + return polyVar + return false + +gcd_polys = (polyVar) -> + if DEBUG then console.log "gcd_polys: p1: " + p1 + " polyVar: " + polyVar + # gcd of factors + push(p1) + push polyVar + factorpoly() + p1 = pop() + push(p2) + push polyVar + factorpoly() + p2 = pop() + if DEBUG then console.log "GCD: factored polys:" + if DEBUG then console.log " p1:" + p1.toString() + if DEBUG then console.log " p2:" + p2.toString() + + # In case one of two polynomials can be factored, + # (and only in that case), then + # we'll need to run gcd_factors on the two polynomials. + # (In case neither of them can be factored there is no gcd). + # However, gcd_factors expects two _products_ , and + # in case _one_ of the polynomials can't be factored it will look + # like a sum instead of a product. + # So, we'll have to make that sum to look like a factor: + # let's just turn it into a product with 1. + + # in case one of the two polys has been factored... + if car(p1) == symbol(MULTIPLY) or car(p2) == symbol(MULTIPLY) + + # then make sure that if one of them is a single + # factor, we take the sum and wrap it into a + # multiplication by 1 + + if car(p1) != symbol(MULTIPLY) + push_symbol(MULTIPLY); + push(p1); + push(one); + list(3); + p1 = pop() + + if car(p2) != symbol(MULTIPLY) + push_symbol(MULTIPLY); + push(p2); + push(one); + list(3); + p2 = pop() + + if (car(p1) == symbol(MULTIPLY) && car(p2) == symbol(MULTIPLY)) + gcd_product_product() + return + + gcd_powers_with_same_base() + + return true + + +gcd_product_product = -> + push(one) + p3 = cdr(p1) + while (iscons(p3)) + p4 = cdr(p2) + while (iscons(p4)) + push(car(p3)) + push(car(p4)) + gcd() + multiply() + p4 = cdr(p4) + p3 = cdr(p3) + + +gcd_powers_with_same_base = -> + + if (car(p1) == symbol(POWER)) + p3 = caddr(p1) # exponent + p1 = cadr(p1) # base + else + p3 = one + + if (car(p2) == symbol(POWER)) + p4 = caddr(p2) # exponent + p2 = cadr(p2) # base + else + p4 = one + + if (!equal(p1, p2)) + push(one) + return + + # are both exponents numerical? + + if (isNumericAtom(p3) && isNumericAtom(p4)) + push(p1) + if (lessp(p3, p4)) + push(p3) + else + push(p4) + power() + return + + # are the exponents multiples of eah other? + + push(p3) + push(p4) + divide() + + p5 = pop() + + if (isNumericAtom(p5)) + + push(p1) + + # choose the smallest exponent + + if (car(p3) == symbol(MULTIPLY) && isNumericAtom(cadr(p3))) + p5 = cadr(p3) + else + p5 = one + + if (car(p4) == symbol(MULTIPLY) && isNumericAtom(cadr(p4))) + p6 = cadr(p4) + else + p6 = one + + if (lessp(p5, p6)) + push(p3) + else + push(p4) + + power() + return + + push(p3) + push(p4) + subtract() + + p5 = pop() + + if (!isNumericAtom(p5)) + push(one) + return + + # can't be equal because of test near beginning + + push(p1) + + if (isnegativenumber(p5)) + push(p3) + else + push(p4) + + power() + +# in this case gcd is used as a composite function, i.e. gcd(gcd(gcd... + +gcd_sum_sum = -> + if (length(p1) != length(p2)) + push(one) + return + + p3 = cdr(p1) + push(car(p3)) + p3 = cdr(p3) + while (iscons(p3)) + push(car(p3)) + gcd() + p3 = cdr(p3) + p3 = pop() + + p4 = cdr(p2) + push(car(p4)) + p4 = cdr(p4) + while (iscons(p4)) + push(car(p4)) + gcd() + p4 = cdr(p4) + p4 = pop() + + push(p1) + push(p3) + divide() + p5 = pop() + + push(p2) + push(p4) + divide() + p6 = pop() + + if (equal(p5, p6)) + push(p5) + push(p3) + push(p4) + gcd() + multiply() + else + push(one) + +gcd_sum = (p) -> + p = cdr(p) + push(car(p)) + p = cdr(p) + while (iscons(p)) + push(car(p)) + gcd() + p = cdr(p) + +gcd_sum_product = -> + push(one) + p3 = cdr(p1) + while (iscons(p3)) + push(car(p3)) + push(p2) + gcd() + multiply() + p3 = cdr(p3) + +gcd_product_sum = -> + push(one) + p4 = cdr(p2) + while (iscons(p4)) + push(p1) + push(car(p4)) + gcd() + multiply() + p4 = cdr(p4) + + diff --git a/node_modules/algebrite/sources/guess.coffee b/node_modules/algebrite/sources/guess.coffee new file mode 100644 index 0000000..52c9d62 --- /dev/null +++ b/node_modules/algebrite/sources/guess.coffee @@ -0,0 +1,19 @@ +# Guess which symbol to use for derivative, integral, etc. + + + +guess = -> + p = pop() + push(p) + if (Find(p, symbol(SYMBOL_X))) + push_symbol(SYMBOL_X) + else if (Find(p, symbol(SYMBOL_Y))) + push_symbol(SYMBOL_Y) + else if (Find(p, symbol(SYMBOL_Z))) + push_symbol(SYMBOL_Z) + else if (Find(p, symbol(SYMBOL_T))) + push_symbol(SYMBOL_T) + else if (Find(p, symbol(SYMBOL_S))) + push_symbol(SYMBOL_S) + else + push_symbol(SYMBOL_X) diff --git a/node_modules/algebrite/sources/hermite.coffee b/node_modules/algebrite/sources/hermite.coffee new file mode 100644 index 0000000..492b532 --- /dev/null +++ b/node_modules/algebrite/sources/hermite.coffee @@ -0,0 +1,83 @@ +#----------------------------------------------------------------------------- +# +# Hermite polynomial +# +# Input: tos-2 x (can be a symbol or expr) +# +# tos-1 n +# +# Output: Result on stack +# +#----------------------------------------------------------------------------- + + + +hermite = -> + save() + yyhermite() + restore() + +# uses the recurrence relation H(x,n+1)=2*x*H(x,n)-2*n*H(x,n-1) + +#define X p1 +#define N p2 +#define Y p3 +#define Y1 p4 +#define Y0 p5 + +yyhermite = -> + + n = 0 + + p2 = pop() + p1 = pop() + + push(p2) + n = pop_integer() + + if (n < 0 || isNaN(n)) + push_symbol(HERMITE) + push(p1) + push(p2) + list(3) + return + + if (issymbol(p1)) + yyhermite2(n) + else + p3 = p1; # do this when X is an expr + p1 = symbol(SECRETX) + yyhermite2(n) + p1 = p3 + push(symbol(SECRETX)) + push(p1) + subst() + Eval() + +yyhermite2 = (n) -> + i = 0 + + push_integer(1) + push_integer(0) + + p4 = pop() + + for i in [0...n] + + p5 = p4 + + p4 = pop() + + push(p1) + push(p4) + multiply() + + push_integer(i) + push(p5) + multiply() + + subtract() + + push_integer(2) + multiply() + diff --git a/node_modules/algebrite/sources/hilbert.coffee b/node_modules/algebrite/sources/hilbert.coffee new file mode 100644 index 0000000..79dc7ad --- /dev/null +++ b/node_modules/algebrite/sources/hilbert.coffee @@ -0,0 +1,45 @@ +#----------------------------------------------------------------------------- +# +# Create a Hilbert matrix +# +# Input: Dimension on stack +# +# Output: Hilbert matrix on stack +# +# Example: +# +# > hilbert(5) +# ((1,1/2,1/3,1/4),(1/2,1/3,1/4,1/5),(1/3,1/4,1/5,1/6),(1/4,1/5,1/6,1/7)) +# +#----------------------------------------------------------------------------- + + + +#define A p1 +#define N p2 + +#define AELEM(i, j) A->u.tensor->elem[i * n + j] + +hilbert = -> + i = 0 + j = 0 + n = 0 + save() + p2 = pop() + push(p2) + n = pop_integer() + if (n < 2) + push_symbol(HILBERT) + push(p2) + list(2) + restore() + return + push_zero_matrix(n, n) + p1 = pop() + for i in [0...n] + for j in [0...n] + push_integer(i + j + 1) + inverse() + p1.tensor.elem[i * n + j] = pop() + push(p1) + restore() diff --git a/node_modules/algebrite/sources/imag.coffee b/node_modules/algebrite/sources/imag.coffee new file mode 100644 index 0000000..3a668a2 --- /dev/null +++ b/node_modules/algebrite/sources/imag.coffee @@ -0,0 +1,39 @@ +### + Returns the coefficient of the imaginary part of complex z + + z imag(z) + - ------- + + a + i b b + + exp(i a) sin(a) +### + +DEBUG_IMAG = false + +Eval_imag = -> + push(cadr(p1)) + Eval() + imag() + +imag = -> + save() + rect() + p1 = pop() + + if DEBUG_IMAG then console.log "IMAGE of " + p1 + + push(p1) + push(p1) + conjugate() + if DEBUG_IMAG then console.log " image: conjugate result: " + stack[tos-1] + + subtract() + push_integer(2) + divide() + if DEBUG_IMAG then console.log " image: 1st divide result: " + stack[tos-1] + push(imaginaryunit) + divide() + if DEBUG_IMAG then console.log " image: 2nd divide result: " + stack[tos-1] + restore() + diff --git a/node_modules/algebrite/sources/index.coffee b/node_modules/algebrite/sources/index.coffee new file mode 100644 index 0000000..25185b2 --- /dev/null +++ b/node_modules/algebrite/sources/index.coffee @@ -0,0 +1,186 @@ + + +# n is the total number of things on the stack. The first thing on the stack +# is the object to be indexed, followed by the indices themselves. + +# called by Eval_index +index_function = (n) -> + i = 0 + k = 0 + m = 0 + ndim = 0 + nelem = 0 + t = 0 + + save() + s = tos - n + p1 = stack[s] + + + ndim = p1.tensor.ndim + + m = n - 1 + + if (m > ndim) + stop("too many indices for tensor") + + k = 0 + + for i in [0...m] + push(stack[s + i + 1]) + t = pop_integer() + if (t < 1 || t > p1.tensor.dim[i]) + stop("index out of range") + k = k * p1.tensor.dim[i] + t - 1 + + if (ndim == m) + moveTos tos - n + push(p1.tensor.elem[k]) + restore() + return + + for i in [m...ndim] + k = k * p1.tensor.dim[i] + 0 + + nelem = 1 + + for i in [m...ndim] + nelem *= p1.tensor.dim[i] + + p2 = alloc_tensor(nelem) + + p2.tensor.ndim = ndim - m + + for i in [m...ndim] + p2.tensor.dim[i - m] = p1.tensor.dim[i] + + for i in [0...nelem] + p2.tensor.elem[i] = p1.tensor.elem[k + i] + + check_tensor_dimensions p1 + check_tensor_dimensions p2 + + moveTos tos - n + push(p2) + restore() + +#----------------------------------------------------------------------------- +# +# Input: n Number of args on stack +# +# tos-n Right-hand value +# +# tos-n+1 Left-hand value +# +# tos-n+2 First index +# +# . +# . +# . +# +# tos-1 Last index +# +# Output: Result on stack +# +#----------------------------------------------------------------------------- + +#define LVALUE p1 +#define RVALUE p2 +#define TMP p3 + +set_component = (n) -> + i = 0 + k = 0 + m = 0 + ndim = 0 + t = 0 + + save() + + if (n < 3) + stop("error in indexed assign") + + s = tos - n + + p2 = stack[s]; # p2 is RVALUE + + p1 = stack[s+1]; # p1 is LVALUE + + if (!istensor(p1)) # p1 is LVALUE + stop("error in indexed assign: assigning to something that is not a tensor") + + ndim = p1.tensor.ndim; # p1 is LVALUE + + m = n - 2 + + if (m > ndim) + stop("error in indexed assign") + + k = 0 + + for i in [0...m] + push(stack[ s + i + 2]) + t = pop_integer() + if (t < 1 || t > p1.tensor.dim[i]) # p1 is LVALUE + stop("error in indexed assign\n") + k = k * p1.tensor.dim[i] + t - 1 + + for i in [m...ndim] + k = k * p1.tensor.dim[i] + 0 + + # copy + + p3 = alloc_tensor(p1.tensor.nelem); # p1 is LVALUE # p3 is TMP + + p3.tensor.ndim = p1.tensor.ndim; # p1 is LVALUE # p3 is TMP + + for i in [0...p1.tensor.ndim] + p3.tensor.dim[i] = p1.tensor.dim[i]; # p1 is LVALUE # p3 is TMP + + for i in [0...p1.tensor.nelem] + p3.tensor.elem[i] = p1.tensor.elem[i]; # p1 is LVALUE # p3 is TMP + + check_tensor_dimensions p1 + check_tensor_dimensions p3 + + p1 = p3; # p1 is LVALUE # p3 is TMP + + if (ndim == m) + if (istensor(p2)) # p2 is RVALUE + stop("error in indexed assign") + p1.tensor.elem[k] = p2; # p1 is LVALUE # p2 is RVALUE + + check_tensor_dimensions p1 + + moveTos tos - n + push(p1); # p1 is LVALUE + restore() + return + + + # see if the rvalue matches + + if (!istensor(p2)) # p2 is RVALUE + stop("error in indexed assign") + + if (ndim - m != p2.tensor.ndim) # p2 is RVALUE + stop("error in indexed assign") + + for i in [0...p2.tensor.ndim] # p2 is RVALUE + if (p1.tensor.dim[m + i] != p2.tensor.dim[i]) # p1 is LVALUE # p2 is RVALUE + stop("error in indexed assign") + + # copy rvalue + + for i in [0...p2.tensor.nelem] # p2 is RVALUE + p1.tensor.elem[k + i] = p2.tensor.elem[i]; # p1 is LVALUE # p2 is RVALUE + + check_tensor_dimensions p1 + check_tensor_dimensions p2 + + moveTos tos - n + + push(p1); # p1 is LVALUE + + restore() + diff --git a/node_modules/algebrite/sources/inner.coffee b/node_modules/algebrite/sources/inner.coffee new file mode 100644 index 0000000..9a66027 --- /dev/null +++ b/node_modules/algebrite/sources/inner.coffee @@ -0,0 +1,473 @@ +### dot ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +a,b,... + +General description +------------------- + +The inner (or dot) operator gives products of vectors, +matrices, and tensors. + +Note that for Algebrite, the elements of a vector/matrix +can only be scalars. This allows for example to flesh out +matrix multiplication using the usual multiplication. +So for example block-representations are not allowed. + +There is an aweful lot of confusion between sw packages on +what dot and inner do. + +First off, the "dot" operator is different from the +mathematical notion of dot product, which can be +slightly confusing. + +The mathematical notion of dot product is here: + http://mathworld.wolfram.com/DotProduct.html + +However, "dot" does that and a bunch of other things, +i.e. in Algebrite +dot/inner does what the dot of Mathematica does, i.e.: + +scalar product of vectors: + + inner((a, b, c), (x, y, z)) + > a x + b y + c z + +products of matrices and vectors: + + inner(((a, b), (c,d)), (x, y)) + > (a x + b y,c x + d y) + + inner((x, y), ((a, b), (c,d))) + > (a x + c y,b x + d y) + + inner((x, y), ((a, b), (c,d)), (r, s)) + > a r x + b s x + c r y + d s y + +matrix product: + + inner(((a,b),(c,d)),((r,s),(t,u))) + > ((a r + b t,a s + b u),(c r + d t,c s + d u)) + +the "dot/inner" operator is associative and +distributive but not commutative. + +In Mathematica, Inner is a generalisation of Dot where +the user can specify the multiplication and the addition +operators. +But here in Algebrite they do the same thing. + + https://reference.wolfram.com/language/ref/Dot.html + https://reference.wolfram.com/language/ref/Inner.html + + http://uk.mathworks.com/help/matlab/ref/dot.html + http://uk.mathworks.com/help/matlab/ref/mtimes.html + +### + + + +Eval_inner = -> + + + # if there are more than two arguments then + # reduce it to a more standard version + # of two arguments, which means we need to + # transform the arguments into a tree of + # inner products e.g. + # inner(a,b,c) becomes inner(a,inner(b,c)) + # this is so we can get to a standard binary-tree + # version that is simpler to manipulate. + theArguments = [] + theArguments.push car(cdr(p1)) + secondArgument = car(cdr(cdr(p1))) + if secondArgument == symbol(NIL) + stop("pattern needs at least a template and a transformed version") + + moretheArguments = cdr(cdr(p1)) + while moretheArguments != symbol(NIL) + theArguments.push car(moretheArguments) + moretheArguments = cdr(moretheArguments) + + # make it so e.g. inner(a,b,c) becomes inner(a,inner(b,c)) + if theArguments.length > 2 + push_symbol(INNER) + push theArguments[theArguments.length-2] + push theArguments[theArguments.length-1] + list(3) + for i in [2...theArguments.length] + push_symbol(INNER) + swap() + push theArguments[theArguments.length-i-1] + swap() + list(3) + p1 = pop() + Eval_inner() + return + + + + + # TODO we have to take a look at the whole + # sequence of operands and make simplifications + # on that... + operands = [] + get_innerprod_factors(p1, operands) + + #console.log "printing operands --------" + #for i in [0...operands.length] + # console.log "operand " + i + " : " + operands[i] + + refinedOperands = [] + # removing all identity matrices + for i in [0...operands.length] + if operands[i] == symbol(SYMBOL_IDENTITY_MATRIX) + continue + else refinedOperands.push operands[i] + operands = refinedOperands + + refinedOperands = [] + if operands.length > 1 + # removing all consecutive pairs of inverses + # so we can answer that inv(a)·a results in the + # identity matrix. We want to catch symbolic inverses + # not numeric inverses, those will just take care + # of themselves when multiplied + shift = 0 + for i in [0...operands.length] + #console.log "comparing if " + operands[i+shift] + " and " + operands[i+shift+1] + " are inverses of each other" + if (i+shift+1) <= (operands.length - 1) + #console.log "isNumericAtomOrTensor " + operands[i+shift] + " : " + isNumericAtomOrTensor(operands[i+shift]) + #console.log "isNumericAtomOrTensor " + operands[i+shift+1] + " : " + isNumericAtomOrTensor(operands[i+shift+1]) + if !(isNumericAtomOrTensor(operands[i+shift]) or isNumericAtomOrTensor(operands[i+shift+1])) + push operands[i+shift] + Eval() + inv() + push operands[i+shift+1] + Eval() + subtract() + difference = pop() + #console.log "result: " + difference + if (isZeroAtomOrTensor(difference)) + shift+=1 + else + refinedOperands.push operands[i+shift] + else + refinedOperands.push operands[i+shift] + + else + break + + #console.log "i: " + i + " shift: " + shift + " operands.length: " + operands.length + + if i+shift == operands.length - 2 + #console.log "adding last operand 2 " + refinedOperands.push operands[operands.length-1] + if i+shift >= operands.length - 1 + break + operands = refinedOperands + + #console.log "refined operands --------" + #for i in [0...refinedOperands.length] + # console.log "refined operand " + i + " : " + refinedOperands[i] + + + #console.log "stack[tos-1]: " + stack[tos-1] + + # now rebuild the arguments, just using the + # refined operands + push symbol(INNER) + #console.log "rebuilding the argument ----" + + if operands.length > 0 + for i in [0...operands.length] + #console.log "pushing " + operands[i] + push operands[i] + else + pop() + push symbol(SYMBOL_IDENTITY_MATRIX) + return + #console.log "list(operands.length): " + (operands.length+1) + list(operands.length + 1) + p1 = pop() + + + p1 = cdr(p1) + push(car(p1)) + Eval() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + inner() + p1 = cdr(p1) + +# inner definition +inner = -> + save() + p2 = pop() + p1 = pop() + + # more in general, when a and b are scalars, + # inner(a*M1, b*M2) is equal to + # a*b*inner(M1,M2), but of course we can only + # "bring out" in a and b the scalars, because + # it's the only commutative part. + # that's going to be trickier to do in general + # but let's start with just the signs. + if isnegativeterm(p2) and isnegativeterm(p1) + push p2 + negate() + p2 = pop() + push p1 + negate() + p1 = pop() + + # since inner is associative, + # put it in a canonical form i.e. + # inner(inner(a,b),c) -> + # inner(a,inner(b,c)) + # so that we can recognise when they + # are equal. + if isinnerordot(p1) + arg1 = car(cdr(p1)) #a + arg2 = car(cdr(cdr(p1))) #b + arg3 = p2 + p1 = arg1 + push arg2 + push arg3 + inner() + p2 = pop() + + # Check if one of the operands is the identity matrix + # we could maybe use Eval_testeq here but + # this seems to suffice? + if p1 == symbol(SYMBOL_IDENTITY_MATRIX) + push p2 + restore() + return + else if p2 == symbol(SYMBOL_IDENTITY_MATRIX) + push p1 + restore() + return + + + if (istensor(p1) && istensor(p2)) + inner_f() + else + + # simple check if the two consecutive elements are one the + # (symbolic) inv of the other. If they are, the answer is + # the identity matrix + if !(isNumericAtomOrTensor(p1) or isNumericAtomOrTensor(p2)) + push p1 + push p2 + inv() + subtract() + subtractionResult = pop() + if (isZeroAtomOrTensor(subtractionResult)) + push_symbol(SYMBOL_IDENTITY_MATRIX) + restore() + return + + + # if either operand is a sum then distribute + # (if we are in expanding mode) + if (expanding && isadd(p1)) + p1 = cdr(p1) + push(zero) + while (iscons(p1)) + push(car(p1)) + push(p2) + inner() + add() + p1 = cdr(p1) + restore() + return + + if (expanding && isadd(p2)) + p2 = cdr(p2) + push(zero) + while (iscons(p2)) + push(p1) + push(car(p2)) + inner() + add() + p2 = cdr(p2) + restore() + return + + push(p1) + push(p2) + + + # there are 8 remaining cases here, since each of the + # two arguments can only be a scalar/tensor/unknown + # and the tensor - tensor case was caught + # upper in the code + if (istensor(p1) and isNumericAtom(p2)) + # one case covered by this branch: + # tensor - scalar + tensor_times_scalar() + else if (isNumericAtom(p1) and istensor(p2)) + # one case covered by this branch: + # scalar - tensor + scalar_times_tensor() + else + if (isNumericAtom(p1) or isNumericAtom(p2)) + # three cases covered by this branch: + # unknown - scalar + # scalar - unknown + # scalar - scalar + # in these cases a normal multiplication + # will be OK + multiply() + else + # three cases covered by this branch: + # unknown - unknown + # unknown - tensor + # tensor - unknown + # in this case we can't use normal + # multiplication. + pop() + pop() + push_symbol(INNER) + push(p1) + push(p2) + list(3) + restore() + return + + + restore() + +# inner product of tensors p1 and p2 +inner_f = -> + + i = 0 + n = p1.tensor.dim[p1.tensor.ndim - 1] + + if (n != p2.tensor.dim[0]) + debugger + stop("inner: tensor dimension check") + + ndim = p1.tensor.ndim + p2.tensor.ndim - 2 + + if (ndim > MAXDIM) + stop("inner: rank of result exceeds maximum") + + a = p1.tensor.elem + b = p2.tensor.elem + + #--------------------------------------------------------------------- + # + # ak is the number of rows in tensor A + # + # bk is the number of columns in tensor B + # + # Example: + # + # A[3][3][4] B[4][4][3] + # + # 3 3 ak = 3 * 3 = 9 + # + # 4 3 bk = 4 * 3 = 12 + # + #--------------------------------------------------------------------- + + ak = 1 + for i in [0...(p1.tensor.ndim - 1)] + ak *= p1.tensor.dim[i] + + bk = 1 + for i in [1...p2.tensor.ndim] + bk *= p2.tensor.dim[i] + + p3 = alloc_tensor(ak * bk) + + c = p3.tensor.elem + + # new method copied from ginac http://www.ginac.de/ + for i in [0...ak] + for j in [0...n] + if (isZeroAtomOrTensor(a[i * n + j])) + continue + for k in [0...bk] + push(a[i * n + j]) + push(b[j * bk + k]) + multiply() + push(c[i * bk + k]) + add() + c[i * bk + k] = pop() + + #--------------------------------------------------------------------- + # + # Note on understanding "k * bk + j" + # + # k * bk because each element of a column is bk locations apart + # + # + j because the beginnings of all columns are in the first bk + # locations + # + # Example: n = 2, bk = 6 + # + # b111 <- 1st element of 1st column + # b112 <- 1st element of 2nd column + # b113 <- 1st element of 3rd column + # b121 <- 1st element of 4th column + # b122 <- 1st element of 5th column + # b123 <- 1st element of 6th column + # + # b211 <- 2nd element of 1st column + # b212 <- 2nd element of 2nd column + # b213 <- 2nd element of 3rd column + # b221 <- 2nd element of 4th column + # b222 <- 2nd element of 5th column + # b223 <- 2nd element of 6th column + # + #--------------------------------------------------------------------- + + if (ndim == 0) + push(p3.tensor.elem[0]) + else + p3.tensor.ndim = ndim + j = 0 + for i in [0...(p1.tensor.ndim - 1)] + p3.tensor.dim[i] = p1.tensor.dim[i] + j = p1.tensor.ndim - 1 + for i in [0...(p2.tensor.ndim - 1)] + p3.tensor.dim[j + i] = p2.tensor.dim[i + 1] + push(p3) + +# Algebrite.run('c·(b+a)ᵀ·inv((a+b)ᵀ)·d').toString(); +# Algebrite.run('c*(b+a)ᵀ·inv((a+b)ᵀ)·d').toString(); +# Algebrite.run('(c·(b+a)ᵀ)·(inv((a+b)ᵀ)·d)').toString(); +get_innerprod_factors = (tree, factors_accumulator) -> + # console.log "extracting inner prod. factors from " + tree + + if !iscons(tree) + add_factor_to_accumulator(tree, factors_accumulator) + return + + if cdr(tree) == symbol(NIL) + tree = get_innerprod_factors(car(tree), factors_accumulator) + return + + if isinnerordot(tree) + # console.log "there is inner at top, recursing on the operands" + get_innerprod_factors(car(cdr(tree)),factors_accumulator) + get_innerprod_factors(cdr(cdr(tree)),factors_accumulator) + return + + add_factor_to_accumulator(tree, factors_accumulator) + +add_factor_to_accumulator = (tree, factors_accumulator) -> + if tree != symbol(NIL) + # console.log ">> adding to factors_accumulator: " + tree + factors_accumulator.push(tree) + diff --git a/node_modules/algebrite/sources/integral.coffee b/node_modules/algebrite/sources/integral.coffee new file mode 100644 index 0000000..366f340 --- /dev/null +++ b/node_modules/algebrite/sources/integral.coffee @@ -0,0 +1,1071 @@ +### + Table of integrals + +The symbol f is just a dummy symbol for creating a list f(A,B,C,C,...) where + + A is the template expression + + B is the result expression + + C is an optional list of conditional expressions +### + +itab = [ + # 1 + "f(a,a*x)", + # 9 (need a caveat for 7 so we can put 9 after 7) + "f(1/x,log(x))", + # 7 + "f(x^a,x^(a+1)/(a+1))", + # five specialisations of case 7 for speed. + # Covers often-occurring exponents: each of + # these case ends up in a dedicated entry, so we + # only have to do one sure-shot match. + "f(x^(-2),-x^(-1))", + "f(x^(-1/2),2*x^(1/2))", + "f(x^(1/2),2/3*x^(3/2))", + "f(x,x^2/2)", + "f(x^2,x^3/3)", + # 12 + "f(exp(a*x),1/a*exp(a*x))", + "f(exp(a*x+b),1/a*exp(a*x+b))", + "f(x*exp(a*x^2),exp(a*x^2)/(2*a))", + "f(x*exp(a*x^2+b),exp(a*x^2+b)/(2*a))", + # 14 + "f(log(a*x),x*log(a*x)-x)", + # 15 + "f(a^x,a^x/log(a),or(not(number(a)),a>0))", + # 16 + "f(1/(a+x^2),1/sqrt(a)*arctan(x/sqrt(a)),or(not(number(a)),a>0))", + # 17 + "f(1/(a-x^2),1/sqrt(a)*arctanh(x/sqrt(a)))", + # 19 + "f(1/sqrt(a-x^2),arcsin(x/(sqrt(a))))", + # 20 + "f(1/sqrt(a+x^2),log(x+sqrt(a+x^2)))", + # 27 + "f(1/(a+b*x),1/b*log(a+b*x))", + # 28 + "f(1/(a+b*x)^2,-1/(b*(a+b*x)))", + # 29 + "f(1/(a+b*x)^3,-1/(2*b)*1/(a+b*x)^2)", + # 30 + "f(x/(a+b*x),x/b-a*log(a+b*x)/b/b)", + # 31 + "f(x/(a+b*x)^2,1/b^2*(log(a+b*x)+a/(a+b*x)))", + # 33 + "f(x^2/(a+b*x),1/b^2*(1/2*(a+b*x)^2-2*a*(a+b*x)+a^2*log(a+b*x)))", + # 34 + "f(x^2/(a+b*x)^2,1/b^3*(a+b*x-2*a*log(a+b*x)-a^2/(a+b*x)))", + # 35 + "f(x^2/(a+b*x)^3,1/b^3*(log(a+b*x)+2*a/(a+b*x)-1/2*a^2/(a+b*x)^2))", + # 37 + "f(1/x*1/(a+b*x),-1/a*log((a+b*x)/x))", + # 38 + "f(1/x*1/(a+b*x)^2,1/a*1/(a+b*x)-1/a^2*log((a+b*x)/x))", + # 39 + "f(1/x*1/(a+b*x)^3,1/a^3*(1/2*((2*a+b*x)/(a+b*x))^2+log(x/(a+b*x))))", + # 40 + "f(1/x^2*1/(a+b*x),-1/(a*x)+b/a^2*log((a+b*x)/x))", + # 41 + "f(1/x^3*1/(a+b*x),(2*b*x-a)/(2*a^2*x^2)+b^2/a^3*log(x/(a+b*x)))", + # 42 + "f(1/x^2*1/(a+b*x)^2,-(a+2*b*x)/(a^2*x*(a+b*x))+2*b/a^3*log((a+b*x)/x))", + # 60 + "f(1/(a+b*x^2),1/sqrt(a*b)*arctan(x*sqrt(a*b)/a),or(not(number(a*b)),a*b>0))", + # 61 + "f(1/(a+b*x^2),1/(2*sqrt(-a*b))*log((a+x*sqrt(-a*b))/(a-x*sqrt(-a*b))),or(not(number(a*b)),a*b<0))", + # 62 is the same as 60 + # 63 + "f(x/(a+b*x^2),1/2*1/b*log(a+b*x^2))", + #64 + "f(x^2/(a+b*x^2),x/b-a/b*integral(1/(a+b*x^2),x))", + #65 + "f(1/(a+b*x^2)^2,x/(2*a*(a+b*x^2))+1/2*1/a*integral(1/(a+b*x^2),x))", + #66 is covered by 61 + #70 + "f(1/x*1/(a+b*x^2),1/2*1/a*log(x^2/(a+b*x^2)))", + #71 + "f(1/x^2*1/(a+b*x^2),-1/(a*x)-b/a*integral(1/(a+b*x^2),x))", + #74 + "f(1/(a+b*x^3),1/3*1/a*(a/b)^(1/3)*(1/2*log(((a/b)^(1/3)+x)^3/(a+b*x^3))+sqrt(3)*arctan((2*x-(a/b)^(1/3))*(a/b)^(-1/3)/sqrt(3))))", + #76 + "f(x^2/(a+b*x^3),1/3*1/b*log(a+b*x^3))", + # float(defint(1/(2+3*X^4),X,0,pi)) gave wrong result. + # Also, the tests related to the indefinite integral + # fail since we rationalise expressions "better", so I'm thinking + # to take this out completely as it seemed to give the + # wrong results in the first place. + #77 + #"f(1/(a+b*x^4),1/2*1/a*(a/b/4)^(1/4)*(1/2*log((x^2+2*(a/b/4)^(1/4)*x+2*(a/b/4)^(1/2))/(x^2-2*(a/b/4)^(1/4)*x+2*(a/b/4)^(1/2)))+arctan(2*(a/b/4)^(1/4)*x/(2*(a/b/4)^(1/2)-x^2))),or(not(number(a*b)),a*b>0))", + #78 + #"f(1/(a+b*x^4),1/2*(-a/b)^(1/4)/a*(1/2*log((x+(-a/b)^(1/4))/(x-(-a/b)^(1/4)))+arctan(x*(-a/b)^(-1/4))),or(not(number(a*b)),a*b<0))", + #79 + "f(x/(a+b*x^4),1/2*sqrt(b/a)/b*arctan(x^2*sqrt(b/a)),or(not(number(a*b)),a*b>0))", + #80 + "f(x/(a+b*x^4),1/4*sqrt(-b/a)/b*log((x^2-sqrt(-a/b))/(x^2+sqrt(-a/b))),or(not(number(a*b)),a*b<0))", + + # float(defint(X^2/(2+3*X^4),X,0,pi)) gave wrong result. + # Also, the tests related to the indefinite integral + # fail since we rationalise expressions "better", so I'm thinking + # to take this out completely as it seemed to give the + # wrong results in the first place. + #81 + #"f(x^2/(a+b*x^4),1/4*1/b*(a/b/4)^(-1/4)*(1/2*log((x^2-2*(a/b/4)^(1/4)*x+2*sqrt(a/b/4))/(x^2+2*(a/b/4)^(1/4)*x+2*sqrt(a/b/4)))+arctan(2*(a/b/4)^(1/4)*x/(2*sqrt(a/b/4)-x^2))),or(not(number(a*b)),a*b>0))", + #82 + #"f(x^2/(a+b*x^4),1/4*1/b*(-a/b)^(-1/4)*(log((x-(-a/b)^(1/4))/(x+(-a/b)^(1/4)))+2*arctan(x*(-a/b)^(-1/4))),or(not(number(a*b)),a*b<0))", + #83 + "f(x^3/(a+b*x^4),1/4*1/b*log(a+b*x^4))", + #124 + "f(sqrt(a+b*x),2/3*1/b*sqrt((a+b*x)^3))", + #125 + "f(x*sqrt(a+b*x),-2*(2*a-3*b*x)*sqrt((a+b*x)^3)/15/b^2)", + #126 + "f(x^2*sqrt(a+b*x),2*(8*a^2-12*a*b*x+15*b^2*x^2)*sqrt((a+b*x)^3)/105/b^3)", + #128 + "f(sqrt(a+b*x)/x,2*sqrt(a+b*x)+a*integral(1/x*1/sqrt(a+b*x),x))", + #129 + "f(sqrt(a+b*x)/x^2,-sqrt(a+b*x)/x+b/2*integral(1/x*1/sqrt(a+b*x),x))", + #131 + "f(1/sqrt(a+b*x),2*sqrt(a+b*x)/b)", + #132 + "f(x/sqrt(a+b*x),-2/3*(2*a-b*x)*sqrt(a+b*x)/b^2)", + #133 + "f(x^2/sqrt(a+b*x),2/15*(8*a^2-4*a*b*x+3*b^2*x^2)*sqrt(a+b*x)/b^3)", + #135 + "f(1/x*1/sqrt(a+b*x),1/sqrt(a)*log((sqrt(a+b*x)-sqrt(a))/(sqrt(a+b*x)+sqrt(a))),or(not(number(a)),a>0))", + #136 + "f(1/x*1/sqrt(a+b*x),2/sqrt(-a)*arctan(sqrt(-(a+b*x)/a)),or(not(number(a)),a<0))", + #137 + "f(1/x^2*1/sqrt(a+b*x),-sqrt(a+b*x)/a/x-1/2*b/a*integral(1/x*1/sqrt(a+b*x),x))", + #156 + "f(sqrt(x^2+a),1/2*(x*sqrt(x^2+a)+a*log(x+sqrt(x^2+a))))", + #157 + "f(1/sqrt(x^2+a),log(x+sqrt(x^2+a)))", + #158 + "f(1/x*1/sqrt(x^2+a),arcsec(x/sqrt(-a))/sqrt(-a),or(not(number(a)),a<0))", + #159 + "f(1/x*1/sqrt(x^2+a),-1/sqrt(a)*log((sqrt(a)+sqrt(x^2+a))/x),or(not(number(a)),a>0))", + #160 + "f(sqrt(x^2+a)/x,sqrt(x^2+a)-sqrt(a)*log((sqrt(a)+sqrt(x^2+a))/x),or(not(number(a)),a>0))", + #161 + "f(sqrt(x^2+a)/x,sqrt(x^2+a)-sqrt(-a)*arcsec(x/sqrt(-a)),or(not(number(a)),a<0))", + #162 + "f(x/sqrt(x^2+a),sqrt(x^2+a))", + #163 + "f(x*sqrt(x^2+a),1/3*sqrt((x^2+a)^3))", + #164 need an unexpanded version? + "f(sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/4*(x*sqrt((x^2+a^(1/3))^3)+3/2*a^(1/3)*x*sqrt(x^2+a^(1/3))+3/2*a^(2/3)*log(x+sqrt(x^2+a^(1/3)))))", + # match doesn't work for the following + "f(sqrt(-a+x^6-3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/4*(x*sqrt((x^2-a^(1/3))^3)-3/2*a^(1/3)*x*sqrt(x^2-a^(1/3))+3/2*a^(2/3)*log(x+sqrt(x^2-a^(1/3)))))", + #165 + "f(1/sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),x/a^(1/3)/sqrt(x^2+a^(1/3)))", + #166 + "f(x/sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),-1/sqrt(x^2+a^(1/3)))", + #167 + "f(x*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/5*sqrt((x^2+a^(1/3))^5))", + #168 + "f(x^2*sqrt(x^2+a),1/4*x*sqrt((x^2+a)^3)-1/8*a*x*sqrt(x^2+a)-1/8*a^2*log(x+sqrt(x^2+a)))", + #169 + "f(x^3*sqrt(x^2+a),(1/5*x^2-2/15*a)*sqrt((x^2+a)^3),and(number(a),a>0))", + #170 + "f(x^3*sqrt(x^2+a),sqrt((x^2+a)^5)/5-a*sqrt((x^2+a)^3)/3,and(number(a),a<0))", + #171 + "f(x^2/sqrt(x^2+a),1/2*x*sqrt(x^2+a)-1/2*a*log(x+sqrt(x^2+a)))", + #172 + "f(x^3/sqrt(x^2+a),1/3*sqrt((x^2+a)^3)-a*sqrt(x^2+a))", + #173 + "f(1/x^2*1/sqrt(x^2+a),-sqrt(x^2+a)/a/x)", + #174 + "f(1/x^3*1/sqrt(x^2+a),-1/2*sqrt(x^2+a)/a/x^2+1/2*log((sqrt(a)+sqrt(x^2+a))/x)/a^(3/2),or(not(number(a)),a>0))", + #175 + "f(1/x^3*1/sqrt(x^2-a),1/2*sqrt(x^2-a)/a/x^2+1/2*1/(a^(3/2))*arcsec(x/(a^(1/2))),or(not(number(a)),a>0))", + #176+ + "f(x^2*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/6*x*sqrt((x^2+a^(1/3))^5)-1/24*a^(1/3)*x*sqrt((x^2+a^(1/3))^3)-1/16*a^(2/3)*x*sqrt(x^2+a^(1/3))-1/16*a*log(x+sqrt(x^2+a^(1/3))),or(not(number(a)),a>0))", + #176- + "f(x^2*sqrt(-a-3*a^(1/3)*x^4+3*a^(2/3)*x^2+x^6),1/6*x*sqrt((x^2-a^(1/3))^5)+1/24*a^(1/3)*x*sqrt((x^2-a^(1/3))^3)-1/16*a^(2/3)*x*sqrt(x^2-a^(1/3))+1/16*a*log(x+sqrt(x^2-a^(1/3))),or(not(number(a)),a>0))", + #177+ + "f(x^3*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/7*sqrt((x^2+a^(1/3))^7)-1/5*a^(1/3)*sqrt((x^2+a^(1/3))^5),or(not(number(a)),a>0))", + #177- + "f(x^3*sqrt(-a-3*a^(1/3)*x^4+3*a^(2/3)*x^2+x^6),1/7*sqrt((x^2-a^(1/3))^7)+1/5*a^(1/3)*sqrt((x^2-a^(1/3))^5),or(not(number(a)),a>0))", + #196 + "f(1/(x-a)/sqrt(x^2-a^2),-sqrt(x^2-a^2)/a/(x-a))", + #197 + "f(1/(x+a)/sqrt(x^2-a^2),sqrt(x^2-a^2)/a/(x+a))", + #200+ + "f(sqrt(a-x^2),1/2*(x*sqrt(a-x^2)+a*arcsin(x/sqrt(abs(a)))))", + #201 (seems to be handled somewhere else) + #202 + "f(1/x*1/sqrt(a-x^2),-1/sqrt(a)*log((sqrt(a)+sqrt(a-x^2))/x),or(not(number(a)),a>0))", + #203 + "f(sqrt(a-x^2)/x,sqrt(a-x^2)-sqrt(a)*log((sqrt(a)+sqrt(a-x^2))/x),or(not(number(a)),a>0))", + #204 + "f(x/sqrt(a-x^2),-sqrt(a-x^2))", + #205 + "f(x*sqrt(a-x^2),-1/3*sqrt((a-x^2)^3))", + #210 + "f(x^2*sqrt(a-x^2),-x/4*sqrt((a-x^2)^3)+1/8*a*(x*sqrt(a-x^2)+a*arcsin(x/sqrt(a))),or(not(number(a)),a>0))", + #211 + "f(x^3*sqrt(a-x^2),(-1/5*x^2-2/15*a)*sqrt((a-x^2)^3),or(not(number(a)),a>0))", + #214 + "f(x^2/sqrt(a-x^2),-x/2*sqrt(a-x^2)+a/2*arcsin(x/sqrt(a)),or(not(number(a)),a>0))", + #215 + "f(1/x^2*1/sqrt(a-x^2),-sqrt(a-x^2)/a/x,or(not(number(a)),a>0))", + #216 + "f(sqrt(a-x^2)/x^2,-sqrt(a-x^2)/x-arcsin(x/sqrt(a)),or(not(number(a)),a>0))", + #217 + "f(sqrt(a-x^2)/x^3,-1/2*sqrt(a-x^2)/x^2+1/2*log((sqrt(a)+sqrt(a-x^2))/x)/sqrt(a),or(not(number(a)),a>0))", + #218 + "f(sqrt(a-x^2)/x^4,-1/3*sqrt((a-x^2)^3)/a/x^3,or(not(number(a)),a>0))", + # 273 + "f(sqrt(a*x^2+b),x*sqrt(a*x^2+b)/2+b*log(x*sqrt(a)+sqrt(a*x^2+b))/2/sqrt(a),and(number(a),a>0))", + # 274 + "f(sqrt(a*x^2+b),x*sqrt(a*x^2+b)/2+b*arcsin(x*sqrt(-a/b))/2/sqrt(-a),and(number(a),a<0))", + # 290 + "f(sin(a*x),-cos(a*x)/a)", + # 291 + "f(cos(a*x),sin(a*x)/a)", + # 292 + "f(tan(a*x),-log(cos(a*x))/a)", + # 293 + "f(1/tan(a*x),log(sin(a*x))/a)", + # 294 + "f(1/cos(a*x),log(tan(pi/4+a*x/2))/a)", + # 295 + "f(1/sin(a*x),log(tan(a*x/2))/a)", + # 296 + "f(sin(a*x)^2,x/2-sin(2*a*x)/(4*a))", + # 297 + "f(sin(a*x)^3,-cos(a*x)*(sin(a*x)^2+2)/(3*a))", + # 298 + "f(sin(a*x)^4,3/8*x-sin(2*a*x)/(4*a)+sin(4*a*x)/(32*a))", + # 302 + "f(cos(a*x)^2,x/2+sin(2*a*x)/(4*a))", + # 303 + "f(cos(a*x)^3,sin(a*x)*(cos(a*x)^2+2)/(3*a))", + # 304 + "f(cos(a*x)^4,3/8*x+sin(2*a*x)/(4*a)+sin(4*a*x)/(32*a))", + # 308 + "f(1/sin(a*x)^2,-1/(a*tan(a*x)))", + # 312 + "f(1/cos(a*x)^2,tan(a*x)/a)", + # 318 + "f(sin(a*x)*cos(a*x),sin(a*x)^2/(2*a))", + # 320 + "f(sin(a*x)^2*cos(a*x)^2,-sin(4*a*x)/(32*a)+x/8)", + # 326 + "f(sin(a*x)/cos(a*x)^2,1/(a*cos(a*x)))", + # 327 + "f(sin(a*x)^2/cos(a*x),(log(tan(pi/4+a*x/2))-sin(a*x))/a)", + # 328 + "f(cos(a*x)/sin(a*x)^2,-1/(a*sin(a*x)))", + # 329 + "f(1/(sin(a*x)*cos(a*x)),log(tan(a*x))/a)", + # 330 + "f(1/(sin(a*x)*cos(a*x)^2),(1/cos(a*x)+log(tan(a*x/2)))/a)", + # 331 + "f(1/(sin(a*x)^2*cos(a*x)),(log(tan(pi/4+a*x/2))-1/sin(a*x))/a)", + # 333 + "f(1/(sin(a*x)^2*cos(a*x)^2),-2/(a*tan(2*a*x)))", + # 335 + "f(sin(a+b*x),-cos(a+b*x)/b)", + # 336 + "f(cos(a+b*x),sin(a+b*x)/b)", + # 337+ (with the addition of b) + "f(1/(b+b*sin(a*x)),-tan(pi/4-a*x/2)/a/b)", + # 337- (with the addition of b) + "f(1/(b-b*sin(a*x)),tan(pi/4+a*x/2)/a/b)", + # 338 (with the addition of b) + "f(1/(b+b*cos(a*x)),tan(a*x/2)/a/b)", + # 339 (with the addition of b) + "f(1/(b-b*cos(a*x)),-1/tan(a*x/2)/a/b)", + # 340 + "f(1/(a+b*sin(x)),1/sqrt(b^2-a^2)*log((a*tan(x/2)+b-sqrt(b^2-a^2))/(a*tan(x/2)+b+sqrt(b^2-a^2))),b^2-a^2)", # check that b^2-a^2 is not zero + # 341 + "f(1/(a+b*cos(x)),1/sqrt(b^2-a^2)*log((sqrt(b^2-a^2)*tan(x/2)+a+b)/(sqrt(b^2-a^2)*tan(x/2)-a-b)),b^2-a^2)", # check that b^2-a^2 is not zero + # 389 + "f(x*sin(a*x),sin(a*x)/a^2-x*cos(a*x)/a)", + # 390 + "f(x^2*sin(a*x),2*x*sin(a*x)/a^2-(a^2*x^2-2)*cos(a*x)/a^3)", + # 393 + "f(x*cos(a*x),cos(a*x)/a^2+x*sin(a*x)/a)", + # 394 + "f(x^2*cos(a*x),2*x*cos(a*x)/a^2+(a^2*x^2-2)*sin(a*x)/a^3)", + # 441 + "f(arcsin(a*x),x*arcsin(a*x)+sqrt(1-a^2*x^2)/a)", + # 442 + "f(arccos(a*x),x*arccos(a*x)-sqrt(1-a^2*x^2)/a)", + # 443 + "f(arctan(a*x),x*arctan(a*x)-1/2*log(1+a^2*x^2)/a)", + # 485 (with addition of a) + # however commenting out since it's a duplicate of 14 + # "f(log(a*x),x*log(a*x)-x)", + # 486 (with addition of a) + "f(x*log(a*x),x^2*log(a*x)/2-x^2/4)", + # 487 (with addition of a) + "f(x^2*log(a*x),x^3*log(a*x)/3-1/9*x^3)", + # 489 + "f(log(x)^2,x*log(x)^2-2*x*log(x)+2*x)", + # 493 (with addition of a) + "f(1/x*1/(a+log(x)),log(a+log(x)))", + # 499 + "f(log(a*x+b),(a*x+b)*log(a*x+b)/a-x)", + # 500 + "f(log(a*x+b)/x^2,a/b*log(x)-(a*x+b)*log(a*x+b)/b/x)", + # 554 + "f(sinh(x),cosh(x))", + # 555 + "f(cosh(x),sinh(x))", + # 556 + "f(tanh(x),log(cosh(x)))", + # 560 + "f(x*sinh(x),x*cosh(x)-sinh(x))", + # 562 + "f(x*cosh(x),x*sinh(x)-cosh(x))", + # 566 + "f(sinh(x)^2,sinh(2*x)/4-x/2)", + # 569 + "f(tanh(x)^2,x-tanh(x))", + # 572 + "f(cosh(x)^2,sinh(2*x)/4+x/2)", + # ? + "f(x^3*exp(a*x^2),exp(a*x^2)*(x^2/a-1/(a^2))/2)", + # ? + "f(x^3*exp(a*x^2+b),exp(a*x^2)*exp(b)*(x^2/a-1/(a^2))/2)", + # ? + "f(exp(a*x^2),-i*sqrt(pi)*erf(i*sqrt(a)*x)/sqrt(a)/2)", + # ? + "f(erf(a*x),x*erf(a*x)+exp(-a^2*x^2)/a/sqrt(pi))", + + # these are needed for the surface integral in the manual + + "f(x^2*(1-x^2)^(3/2),(x*sqrt(1-x^2)*(-8*x^4+14*x^2-3)+3*arcsin(x))/48)", + "f(x^2*(1-x^2)^(5/2),(x*sqrt(1-x^2)*(48*x^6-136*x^4+118*x^2-15)+15*arcsin(x))/384)", + "f(x^4*(1-x^2)^(3/2),(-x*sqrt(1-x^2)*(16*x^6-24*x^4+2*x^2+3)+3*arcsin(x))/128)", + + "f(x*exp(a*x),exp(a*x)*(a*x-1)/(a^2))", + "f(x*exp(a*x+b),exp(a*x+b)*(a*x-1)/(a^2))", + + "f(x^2*exp(a*x),exp(a*x)*(a^2*x^2-2*a*x+2)/(a^3))", + "f(x^2*exp(a*x+b),exp(a*x+b)*(a^2*x^2-2*a*x+2)/(a^3))", + + "f(x^3*exp(a*x),exp(a*x)*x^3/a-3/a*integral(x^2*exp(a*x),x))", + "f(x^3*exp(a*x+b),exp(a*x+b)*x^3/a-3/a*integral(x^2*exp(a*x+b),x))", + 0 + +] + + +#define F p3 +#define X p4 +#define N p5 + +Eval_integral = -> + i = 0 + n = 0 + + # evaluate 1st arg to get function F + + p1 = cdr(p1) + push(car(p1)) + Eval() + + # evaluate 2nd arg and then... + + # example result of 2nd arg what to do + # + # integral(f) nil guess X, N = nil + # integral(f,2) 2 guess X, N = 2 + # integral(f,x) x X = x, N = nil + # integral(f,x,2) x X = x, N = 2 + # integral(f,x,y) x X = x, N = y + + p1 = cdr(p1) + push(car(p1)) + Eval() + + p2 = pop() + if (p2 == symbol(NIL)) + guess() + push(symbol(NIL)) + else if (isNumericAtom(p2)) + guess() + push(p2) + else + push(p2) + p1 = cdr(p1) + push(car(p1)) + Eval() + + p5 = pop() + p4 = pop() + p3 = pop() + + while (1) + + # N might be a symbol instead of a number + + if (isNumericAtom(p5)) + push(p5) + n = pop_integer() + if (isNaN(n)) + stop("nth integral: check n") + else + n = 1 + + push(p3) + + if (n >= 0) + for i in [0...n] + push(p4) + integral() + else + n = -n + for i in [0...n] + push(p4) + derivative() + + p3 = pop() + + # if N is nil then arglist is exhausted + + if (p5 == symbol(NIL)) + break + + # otherwise... + + # N arg1 what to do + # + # number nil break + # number number N = arg1, continue + # number symbol X = arg1, N = arg2, continue + # + # symbol nil X = N, N = nil, continue + # symbol number X = N, N = arg1, continue + # symbol symbol X = N, N = arg1, continue + + if (isNumericAtom(p5)) + p1 = cdr(p1) + push(car(p1)) + Eval() + p5 = pop() + if (p5 == symbol(NIL)) + break; # arglist exhausted + if (isNumericAtom(p5)) + doNothing = 1 # N = arg1 + else + p4 = p5; # X = arg1 + p1 = cdr(p1) + push(car(p1)) + Eval() + p5 = pop(); # N = arg2 + else + p4 = p5; # X = N + p1 = cdr(p1) + push(car(p1)) + Eval() + p5 = pop(); # N = arg1 + + push(p3); # final result + +integral = -> + save() + p2 = pop() + p1 = pop() + if (car(p1) == symbol(ADD)) + integral_of_sum() + else if (car(p1) == symbol(MULTIPLY)) + integral_of_product() + else + integral_of_form() + p1 = pop() + if (Find(p1, symbol(INTEGRAL))) + stop("integral: sorry, could not find a solution") + push(p1) + simplify(); # polish the result + Eval(); # normalize the result + restore() + +integral_of_sum = -> + p1 = cdr(p1) + push(car(p1)) + push(p2) + integral() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + integral() + add() + p1 = cdr(p1) + +integral_of_product = -> + push(p1) + push(p2) + partition() + p1 = pop(); # pop variable part + integral_of_form() + multiply(); # multiply constant part + +integral_of_form = -> + hc = italu_hashcode(p1, p2).toFixed(6) + tab = hashed_itab[hc] + # console.log('hashcode('+p1+', '+p2+') = ' + hc + ' '+!!tab); + if (!tab) + # debugger + # italu_hashcode(p1, p2) + push_symbol(INTEGRAL) + push(p1) + push(p2) + list(3) + return + push(p1) # free variable + push(p2) # input expression + transform(tab, false) + p3 = pop() + if (p3 == symbol(NIL)) + push_symbol(INTEGRAL) + push(p1) + push(p2) + list(3) + else + push(p3) + + +# Implementation of hash codes based on ITALU (An Integral Table Look-Up) +# https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19680004891.pdf +# see Appendix A, page 153 + +# The first two values are from the ITALU paper. +# The others are just arbitrary constants. +hashcode_values = + 'x':0.95532, + 'constexp':1.43762, + 'constant':1.14416593629414332, + 'constbase':1.20364122304218824, + 'sin': 1.73305482518303221, + 'arcsin': 1.6483368529465804, + 'cos': 1.058672123686340116, + 'arccos': 1.8405225918106694, + 'tan': 1.12249437762925064, + 'arctan': 1.1297397925394962, + 'sinh':1.8176164926060078, + 'cosh':1.9404934661708022, + 'tanh':1.6421307715103121, + 'log':1.47744370135492387, + 'erf':1.0825269225702916, + +italu_hashcode = (u, x) -> + if (issymbol(u)) + if (equal(u, x)) + return hashcode_values.x + else + return hashcode_values.constant + else if (iscons(u)) + switch (symnum(car(u))) + when ADD then return hash_addition(cdr(u),x) + when MULTIPLY then return hash_multiplication(cdr(u), x) + when POWER then return hash_power(cadr(u), caddr(u), x) + when EXP then return hash_power(symbol(E), cadr(u), x) + when SQRT + push_double(0.5) + half = pop() + return hash_power(cadr(u), half, x) + else return hash_function(u, x) + + return hashcode_values.constant + +hash_function = (u, x) -> + if !Find(cadr(u), x) + return hashcode_values.constant + name = car(u) + arg_hash = italu_hashcode(cadr(u), x) + base = hashcode_values[name.printname] + if (!base) + throw new Error('Unsupported function ' + name.printname) + return Math.pow(base, arg_hash) + +hash_addition = (terms, x) -> + term_set = {} + while (iscons(terms)) + term = car(terms) + terms = cdr(terms) + term_hash = 0 + if Find(term, x) + term_hash = italu_hashcode(term, x) + else + # The original algorithm would skip this, + # but recording that it was present helps + # prevent collisions. + term_hash = hashcode_values.constant + term_set[term_hash.toFixed(6)] = true + sum = 0 + for own k,v of term_set + sum = sum + parseFloat(k,10) + return sum + +hash_multiplication = (terms, x) -> + product = 1 + while (iscons(terms)) + term = car(terms) + terms = cdr(terms) + if (Find(term, x)) + product = product * italu_hashcode(term, x) + return product + +hash_power = (base, power, x) -> + base_hash = hashcode_values.constant + exp_hash = hashcode_values.constexp + if (Find(base, x)) + base_hash = italu_hashcode(base, x) + if (Find(power, x)) + exp_hash = italu_hashcode(power, x) + else + # constant to constant = constant + if base_hash == hashcode_values.constant + return hashcode_values.constant + if isminusone(power) + exp_hash = -1 + else if isoneovertwo(power) + exp_hash = 0.5 + else if isminusoneovertwo(power) + exp_hash = -0.5 + else if equalq(power, 2, 1) + exp_hash = 2 + else if equalq(power, -2, 1) + exp_hash = -2 + return Math.pow(base_hash, exp_hash) + +make_hashed_itab = () -> + tab = {} + for s in itab + if !s + break + scan_meta(s) + f = pop() + u = cadr(f) + h = italu_hashcode(u, symbol(METAX)) + key = h.toFixed(6) + if (!tab[key]) + tab[key]=[] + tab[key].push(s) + console.log('hashed_itab = '+JSON.stringify(tab, null, 2)) + return tab + +$.make_hashed_itab = make_hashed_itab + +# pre-calculated hashed integral table. +# in case the integral table is changed, use this +# Algebrite.make_hashed_itab() +# and copy the resulting JSON in here. +hashed_itab = { + "1.144166": [ + "f(a,a*x)" + ], + "1.046770": [ + "f(1/x,log(x))" + ], + "0.936400": [ + "f(x^a,x^(a+1)/(a+1))" + ], + "1.095727": [ + "f(x^(-2),-x^(-1))" + ], + "1.023118": [ + "f(x^(-1/2),2*x^(1/2))" + ], + "0.977405": [ + "f(x^(1/2),2/3*x^(3/2))" + ], + "0.955320": [ + "f(x,x^2/2)" + ], + "0.912636": [ + "f(x^2,x^3/3)" + ], + "1.137302": [ + "f(exp(a*x),1/a*exp(a*x))", + "f(a^x,a^x/log(a),or(not(number(a)),a>0))" + ], + "1.326774": [ + "f(exp(a*x+b),1/a*exp(a*x+b))" + ], + "1.080259": [ + "f(x*exp(a*x^2),exp(a*x^2)/(2*a))" + ], + "1.260228": [ + "f(x*exp(a*x^2+b),exp(a*x^2+b)/(2*a))" + ], + "1.451902": [ + "f(log(a*x),x*log(a*x)-x)" + ], + "0.486192": [ + "f(1/(a+x^2),1/sqrt(a)*arctan(x/sqrt(a)),or(not(number(a)),a>0))", + "f(1/(a-x^2),1/sqrt(a)*arctanh(x/sqrt(a)))", + "f(1/(a+b*x^2),1/sqrt(a*b)*arctan(x*sqrt(a*b)/a),or(not(number(a*b)),a*b>0))", + "f(1/(a+b*x^2),1/(2*sqrt(-a*b))*log((a+x*sqrt(-a*b))/(a-x*sqrt(-a*b))),or(not(number(a*b)),a*b<0))" + ], + "0.697274": [ + "f(1/sqrt(a-x^2),arcsin(x/(sqrt(a))))", + "f(1/sqrt(a+x^2),log(x+sqrt(a+x^2)))", + "f(1/sqrt(x^2+a),log(x+sqrt(x^2+a)))" + ], + "0.476307": [ + "f(1/(a+b*x),1/b*log(a+b*x))" + ], + "0.226868": [ + "f(1/(a+b*x)^2,-1/(b*(a+b*x)))" + ], + "2.904531": [ + "f(1/(a+b*x)^3,-1/(2*b)*1/(a+b*x)^2)" + ], + "0.455026": [ + "f(x/(a+b*x),x/b-a*log(a+b*x)/b/b)" + ], + "0.216732": [ + "f(x/(a+b*x)^2,1/b^2*(log(a+b*x)+a/(a+b*x)))" + ], + "0.434695": [ + "f(x^2/(a+b*x),1/b^2*(1/2*(a+b*x)^2-2*a*(a+b*x)+a^2*log(a+b*x)))" + ], + "0.207048": [ + "f(x^2/(a+b*x)^2,1/b^3*(a+b*x-2*a*log(a+b*x)-a^2/(a+b*x)))" + ], + "2.650781": [ + "f(x^2/(a+b*x)^3,1/b^3*(log(a+b*x)+2*a/(a+b*x)-1/2*a^2/(a+b*x)^2))" + ], + "0.498584": [ + "f(1/x*1/(a+b*x),-1/a*log((a+b*x)/x))" + ], + "0.237479": [ + "f(1/x*1/(a+b*x)^2,1/a*1/(a+b*x)-1/a^2*log((a+b*x)/x))" + ], + "3.040375": [ + "f(1/x*1/(a+b*x)^3,1/a^3*(1/2*((2*a+b*x)/(a+b*x))^2+log(x/(a+b*x))))" + ], + "0.521902": [ + "f(1/x^2*1/(a+b*x),-1/(a*x)+b/a^2*log((a+b*x)/x))" + ], + "0.446014": [ + "f(1/x^3*1/(a+b*x),(2*b*x-a)/(2*a^2*x^2)+b^2/a^3*log(x/(a+b*x)))" + ], + "0.248586": [ + "f(1/x^2*1/(a+b*x)^2,-(a+2*b*x)/(a^2*x*(a+b*x))+2*b/a^3*log((a+b*x)/x))" + ], + "0.464469": [ + "f(x/(a+b*x^2),1/2*1/b*log(a+b*x^2))" + ], + "0.443716": [ + "f(x^2/(a+b*x^2),x/b-a/b*integral(1/(a+b*x^2),x))" + ], + "0.236382": [ + "f(1/(a+b*x^2)^2,x/(2*a*(a+b*x^2))+1/2*1/a*integral(1/(a+b*x^2),x))" + ], + "0.508931": [ + "f(1/x*1/(a+b*x^2),1/2*1/a*log(x^2/(a+b*x^2)))" + ], + "0.532733": [ + "f(1/x^2*1/(a+b*x^2),-1/(a*x)-b/a*integral(1/(a+b*x^2),x))" + ], + "0.480638": [ + "f(1/(a+b*x^3),1/3*1/a*(a/b)^(1/3)*(1/2*log(((a/b)^(1/3)+x)^3/(a+b*x^3))+sqrt(3)*arctan((2*x-(a/b)^(1/3))*(a/b)^(-1/3)/sqrt(3))))" + ], + "0.438648": [ + "f(x^2/(a+b*x^3),1/3*1/b*log(a+b*x^3))" + ], + "0.459164": [ + "f(x/(a+b*x^4),1/2*sqrt(b/a)/b*arctan(x^2*sqrt(b/a)),or(not(number(a*b)),a*b>0))", + "f(x/(a+b*x^4),1/4*sqrt(-b/a)/b*log((x^2-sqrt(-a/b))/(x^2+sqrt(-a/b))),or(not(number(a*b)),a*b<0))" + ], + "0.450070": [ + "f(x^3/(a+b*x^4),1/4*1/b*log(a+b*x^4))" + ], + "1.448960": [ + "f(sqrt(a+b*x),2/3*1/b*sqrt((a+b*x)^3))" + ], + "1.384221": [ + "f(x*sqrt(a+b*x),-2*(2*a-3*b*x)*sqrt((a+b*x)^3)/15/b^2)" + ], + "1.322374": [ + "f(x^2*sqrt(a+b*x),2*(8*a^2-12*a*b*x+15*b^2*x^2)*sqrt((a+b*x)^3)/105/b^3)" + ], + "1.516728": [ + "f(sqrt(a+b*x)/x,2*sqrt(a+b*x)+a*integral(1/x*1/sqrt(a+b*x),x))" + ], + "1.587665": [ + "f(sqrt(a+b*x)/x^2,-sqrt(a+b*x)/x+b/2*integral(1/x*1/sqrt(a+b*x),x))" + ], + "0.690150": [ + "f(1/sqrt(a+b*x),2*sqrt(a+b*x)/b)" + ], + "0.659314": [ + "f(x/sqrt(a+b*x),-2/3*(2*a-b*x)*sqrt(a+b*x)/b^2)" + ], + "0.629856": [ + "f(x^2/sqrt(a+b*x),2/15*(8*a^2-4*a*b*x+3*b^2*x^2)*sqrt(a+b*x)/b^3)" + ], + "0.722428": [ + "f(1/x*1/sqrt(a+b*x),1/sqrt(a)*log((sqrt(a+b*x)-sqrt(a))/(sqrt(a+b*x)+sqrt(a))),or(not(number(a)),a>0))", + "f(1/x*1/sqrt(a+b*x),2/sqrt(-a)*arctan(sqrt(-(a+b*x)/a)),or(not(number(a)),a<0))" + ], + "0.756216": [ + "f(1/x^2*1/sqrt(a+b*x),-sqrt(a+b*x)/a/x-1/2*b/a*integral(1/x*1/sqrt(a+b*x),x))" + ], + "1.434156": [ + "f(sqrt(x^2+a),1/2*(x*sqrt(x^2+a)+a*log(x+sqrt(x^2+a))))", + "f(sqrt(a-x^2),1/2*(x*sqrt(a-x^2)+a*arcsin(x/sqrt(abs(a)))))", + "f(sqrt(a*x^2+b),x*sqrt(a*x^2+b)/2+b*log(x*sqrt(a)+sqrt(a*x^2+b))/2/sqrt(a),and(number(a),a>0))", + "f(sqrt(a*x^2+b),x*sqrt(a*x^2+b)/2+b*arcsin(x*sqrt(-a/b))/2/sqrt(-a),and(number(a),a<0))" + ], + "0.729886": [ + "f(1/x*1/sqrt(x^2+a),arcsec(x/sqrt(-a))/sqrt(-a),or(not(number(a)),a<0))", + "f(1/x*1/sqrt(x^2+a),-1/sqrt(a)*log((sqrt(a)+sqrt(x^2+a))/x),or(not(number(a)),a>0))", + "f(1/x*1/sqrt(a-x^2),-1/sqrt(a)*log((sqrt(a)+sqrt(a-x^2))/x),or(not(number(a)),a>0))" + ], + "1.501230": [ + "f(sqrt(x^2+a)/x,sqrt(x^2+a)-sqrt(a)*log((sqrt(a)+sqrt(x^2+a))/x),or(not(number(a)),a>0))", + "f(sqrt(x^2+a)/x,sqrt(x^2+a)-sqrt(-a)*arcsec(x/sqrt(-a)),or(not(number(a)),a<0))", + "f(sqrt(a-x^2)/x,sqrt(a-x^2)-sqrt(a)*log((sqrt(a)+sqrt(a-x^2))/x),or(not(number(a)),a>0))" + ], + "0.666120": [ + "f(x/sqrt(x^2+a),sqrt(x^2+a))", + "f(x/sqrt(a-x^2),-sqrt(a-x^2))" + ], + "1.370077": [ + "f(x*sqrt(x^2+a),1/3*sqrt((x^2+a)^3))", + "f(x*sqrt(a-x^2),-1/3*sqrt((a-x^2)^3))" + ], + "1.730087": [ + "f(sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/4*(x*sqrt((x^2+a^(1/3))^3)+3/2*a^(1/3)*x*sqrt(x^2+a^(1/3))+3/2*a^(2/3)*log(x+sqrt(x^2+a^(1/3)))))", + "f(sqrt(-a+x^6-3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/4*(x*sqrt((x^2-a^(1/3))^3)-3/2*a^(1/3)*x*sqrt(x^2-a^(1/3))+3/2*a^(2/3)*log(x+sqrt(x^2-a^(1/3)))))" + ], + "0.578006": [ + "f(1/sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),x/a^(1/3)/sqrt(x^2+a^(1/3)))" + ], + "0.552180": [ + "f(x/sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),-1/sqrt(x^2+a^(1/3)))" + ], + "1.652787": [ + "f(x*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/5*sqrt((x^2+a^(1/3))^5))" + ], + "1.308862": [ + "f(x^2*sqrt(x^2+a),1/4*x*sqrt((x^2+a)^3)-1/8*a*x*sqrt(x^2+a)-1/8*a^2*log(x+sqrt(x^2+a)))", + "f(x^2*sqrt(a-x^2),-x/4*sqrt((a-x^2)^3)+1/8*a*(x*sqrt(a-x^2)+a*arcsin(x/sqrt(a))),or(not(number(a)),a>0))" + ], + "1.342944": [ + "f(x^3*sqrt(x^2+a),(1/5*x^2-2/15*a)*sqrt((x^2+a)^3),and(number(a),a>0))", + "f(x^3*sqrt(x^2+a),sqrt((x^2+a)^5)/5-a*sqrt((x^2+a)^3)/3,and(number(a),a<0))", + "f(x^3*sqrt(a-x^2),(-1/5*x^2-2/15*a)*sqrt((a-x^2)^3),or(not(number(a)),a>0))", + "f(sqrt(a-x^2)/x^3,-1/2*sqrt(a-x^2)/x^2+1/2*log((sqrt(a)+sqrt(a-x^2))/x)/sqrt(a),or(not(number(a)),a>0))", + "f(sqrt(a-x^2)/x^4,-1/3*sqrt((a-x^2)^3)/a/x^3,or(not(number(a)),a>0))" + ], + "0.636358": [ + "f(x^2/sqrt(x^2+a),1/2*x*sqrt(x^2+a)-1/2*a*log(x+sqrt(x^2+a)))", + "f(x^2/sqrt(a-x^2),-x/2*sqrt(a-x^2)+a/2*arcsin(x/sqrt(a)),or(not(number(a)),a>0))" + ], + "0.652928": [ + "f(x^3/sqrt(x^2+a),1/3*sqrt((x^2+a)^3)-a*sqrt(x^2+a))", + "f(1/x^3*1/sqrt(x^2+a),-1/2*sqrt(x^2+a)/a/x^2+1/2*log((sqrt(a)+sqrt(x^2+a))/x)/a^(3/2),or(not(number(a)),a>0))", + "f(1/x^3*1/sqrt(x^2-a),1/2*sqrt(x^2-a)/a/x^2+1/2*1/(a^(3/2))*arcsec(x/(a^(1/2))),or(not(number(a)),a>0))" + ], + "0.764022": [ + "f(1/x^2*1/sqrt(x^2+a),-sqrt(x^2+a)/a/x)", + "f(1/x^2*1/sqrt(a-x^2),-sqrt(a-x^2)/a/x,or(not(number(a)),a>0))" + ], + "1.578940": [ + "f(x^2*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/6*x*sqrt((x^2+a^(1/3))^5)-1/24*a^(1/3)*x*sqrt((x^2+a^(1/3))^3)-1/16*a^(2/3)*x*sqrt(x^2+a^(1/3))-1/16*a*log(x+sqrt(x^2+a^(1/3))),or(not(number(a)),a>0))", + "f(x^2*sqrt(-a-3*a^(1/3)*x^4+3*a^(2/3)*x^2+x^6),1/6*x*sqrt((x^2-a^(1/3))^5)+1/24*a^(1/3)*x*sqrt((x^2-a^(1/3))^3)-1/16*a^(2/3)*x*sqrt(x^2-a^(1/3))+1/16*a*log(x+sqrt(x^2-a^(1/3))),or(not(number(a)),a>0))" + ], + "1.620055": [ + "f(x^3*sqrt(a+x^6+3*a^(1/3)*x^4+3*a^(2/3)*x^2),1/7*sqrt((x^2+a^(1/3))^7)-1/5*a^(1/3)*sqrt((x^2+a^(1/3))^5),or(not(number(a)),a>0))", + "f(x^3*sqrt(-a-3*a^(1/3)*x^4+3*a^(2/3)*x^2+x^6),1/7*sqrt((x^2-a^(1/3))^7)+1/5*a^(1/3)*sqrt((x^2-a^(1/3))^5),or(not(number(a)),a>0))" + ], + "0.332117": [ + "f(1/(x-a)/sqrt(x^2-a^2),-sqrt(x^2-a^2)/a/(x-a))", + "f(1/(x+a)/sqrt(x^2-a^2),sqrt(x^2-a^2)/a/(x+a))" + ], + "1.571443": [ + "f(sqrt(a-x^2)/x^2,-sqrt(a-x^2)/x-arcsin(x/sqrt(a)),or(not(number(a)),a>0))" + ], + "1.690994": [ + "f(sin(a*x),-cos(a*x)/a)" + ], + "1.055979": [ + "f(cos(a*x),sin(a*x)/a)" + ], + "1.116714": [ + "f(tan(a*x),-log(cos(a*x))/a)" + ], + "0.895484": [ + "f(1/tan(a*x),log(sin(a*x))/a)" + ], + "0.946989": [ + "f(1/cos(a*x),log(tan(pi/4+a*x/2))/a)" + ], + "0.591368": [ + "f(1/sin(a*x),log(tan(a*x/2))/a)" + ], + "2.859462": [ + "f(sin(a*x)^2,x/2-sin(2*a*x)/(4*a))" + ], + "2.128050": [ + "f(sin(a*x)^3,-cos(a*x)*(sin(a*x)^2+2)/(3*a))", + "f(sin(a*x)^4,3/8*x-sin(2*a*x)/(4*a)+sin(4*a*x)/(32*a))" + ], + "1.115091": [ + "f(cos(a*x)^2,x/2+sin(2*a*x)/(4*a))" + ], + "1.081452": [ + "f(cos(a*x)^3,sin(a*x)*(cos(a*x)^2+2)/(3*a))", + "f(cos(a*x)^4,3/8*x+sin(2*a*x)/(4*a)+sin(4*a*x)/(32*a))" + ], + "0.349716": [ + "f(1/sin(a*x)^2,-1/(a*tan(a*x)))" + ], + "0.896788": [ + "f(1/cos(a*x)^2,tan(a*x)/a)" + ], + "1.785654": [ + "f(sin(a*x)*cos(a*x),sin(a*x)^2/(2*a))" + ], + "3.188560": [ + "f(sin(a*x)^2*cos(a*x)^2,-sin(4*a*x)/(32*a)+x/8)" + ], + "1.516463": [ + "f(sin(a*x)/cos(a*x)^2,1/(a*cos(a*x)))" + ], + "2.707879": [ + "f(sin(a*x)^2/cos(a*x),(log(tan(pi/4+a*x/2))-sin(a*x))/a)" + ], + "0.369293": [ + "f(cos(a*x)/sin(a*x)^2,-1/(a*sin(a*x)))" + ], + "0.560019": [ + "f(1/(sin(a*x)*cos(a*x)),log(tan(a*x))/a)" + ], + "0.530332": [ + "f(1/(sin(a*x)*cos(a*x)^2),(1/cos(a*x)+log(tan(a*x/2)))/a)" + ], + "0.331177": [ + "f(1/(sin(a*x)^2*cos(a*x)),(log(tan(pi/4+a*x/2))-1/sin(a*x))/a)" + ], + "0.313621": [ + "f(1/(sin(a*x)^2*cos(a*x)^2),-2/(a*tan(2*a*x)))" + ], + "3.172365": [ + "f(sin(a+b*x),-cos(a+b*x)/b)" + ], + "1.127162": [ + "f(cos(a+b*x),sin(a+b*x)/b)" + ], + "0.352714": [ + "f(1/(b+b*sin(a*x)),-tan(pi/4-a*x/2)/a/b)", + "f(1/(b-b*sin(a*x)),tan(pi/4+a*x/2)/a/b)", + "f(1/(a+b*sin(x)),1/sqrt(b^2-a^2)*log((a*tan(x/2)+b-sqrt(b^2-a^2))/(a*tan(x/2)+b+sqrt(b^2-a^2))),b^2-a^2)" + ], + "0.454515": [ + "f(1/(b+b*cos(a*x)),tan(a*x/2)/a/b)", + "f(1/(b-b*cos(a*x)),-1/tan(a*x/2)/a/b)", + "f(1/(a+b*cos(x)),1/sqrt(b^2-a^2)*log((sqrt(b^2-a^2)*tan(x/2)+a+b)/(sqrt(b^2-a^2)*tan(x/2)-a-b)),b^2-a^2)" + ], + "1.615441": [ + "f(x*sin(a*x),sin(a*x)/a^2-x*cos(a*x)/a)" + ], + "1.543263": [ + "f(x^2*sin(a*x),2*x*sin(a*x)/a^2-(a^2*x^2-2)*cos(a*x)/a^3)" + ], + "1.008798": [ + "f(x*cos(a*x),cos(a*x)/a^2+x*sin(a*x)/a)" + ], + "0.963724": [ + "f(x^2*cos(a*x),2*x*cos(a*x)/a^2+(a^2*x^2-2)*sin(a*x)/a^3)" + ], + "1.611938": [ + "f(arcsin(a*x),x*arcsin(a*x)+sqrt(1-a^2*x^2)/a)" + ], + "1.791033": [ + "f(arccos(a*x),x*arccos(a*x)-sqrt(1-a^2*x^2)/a)" + ], + "1.123599": [ + "f(arctan(a*x),x*arctan(a*x)-1/2*log(1+a^2*x^2)/a)" + ], + "1.387031": [ + "f(x*log(a*x),x^2*log(a*x)/2-x^2/4)" + ], + "1.325058": [ + "f(x^2*log(a*x),x^3*log(a*x)/3-1/9*x^3)" + ], + "2.108018": [ + "f(log(x)^2,x*log(x)^2-2*x*log(x)+2*x)" + ], + "0.403214": [ + "f(1/x*1/(a+log(x)),log(a+log(x)))" + ], + "2.269268": [ + "f(log(a*x+b),(a*x+b)*log(a*x+b)/a-x)" + ], + "2.486498": [ + "f(log(a*x+b)/x^2,a/b*log(x)-(a*x+b)*log(a*x+b)/b/x)" + ], + "1.769733": [ + "f(sinh(x),cosh(x))" + ], + "1.883858": [ + "f(cosh(x),sinh(x))" + ], + "1.606140": [ + "f(tanh(x),log(cosh(x)))" + ], + "1.690661": [ + "f(x*sinh(x),x*cosh(x)-sinh(x))" + ], + "1.799688": [ + "f(x*cosh(x),x*sinh(x)-cosh(x))" + ], + "3.131954": [ + "f(sinh(x)^2,sinh(2*x)/4-x/2)" + ], + "2.579685": [ + "f(tanh(x)^2,x-tanh(x))" + ], + "3.548923": [ + "f(cosh(x)^2,sinh(2*x)/4+x/2)" + ], + "1.058866": [ + "f(x^3*exp(a*x^2),exp(a*x^2)*(x^2/a-1/(a^2))/2)" + ], + "1.235270": [ + "f(x^3*exp(a*x^2+b),exp(a*x^2)*exp(b)*(x^2/a-1/(a^2))/2)" + ], + "1.130783": [ + "f(exp(a*x^2),-i*sqrt(pi)*erf(i*sqrt(a)*x)/sqrt(a)/2)" + ], + "1.078698": [ + "f(erf(a*x),x*erf(a*x)+exp(-a^2*x^2)/a/sqrt(pi))" + ], + "2.573650": [ + "f(x^2*(1-x^2)^(3/2),(x*sqrt(1-x^2)*(-8*x^4+14*x^2-3)+3*arcsin(x))/48)", + "f(x^2*(1-x^2)^(5/2),(x*sqrt(1-x^2)*(48*x^6-136*x^4+118*x^2-15)+15*arcsin(x))/384)" + ], + "2.640666": [ + "f(x^4*(1-x^2)^(3/2),(-x*sqrt(1-x^2)*(16*x^6-24*x^4+2*x^2+3)+3*arcsin(x))/128)" + ], + "1.086487": [ + "f(x*exp(a*x),exp(a*x)*(a*x-1)/(a^2))" + ], + "1.267493": [ + "f(x*exp(a*x+b),exp(a*x+b)*(a*x-1)/(a^2))" + ], + "1.037943": [ + "f(x^2*exp(a*x),exp(a*x)*(a^2*x^2-2*a*x+2)/(a^3))" + ], + "1.210862": [ + "f(x^2*exp(a*x+b),exp(a*x+b)*(a^2*x^2-2*a*x+2)/(a^3))" + ], + "1.064970": [ + "f(x^3*exp(a*x),exp(a*x)*x^3/a-3/a*integral(x^2*exp(a*x),x))" + ], + "1.242392": [ + "f(x^3*exp(a*x+b),exp(a*x+b)*x^3/a-3/a*integral(x^2*exp(a*x+b),x))" + ] +} diff --git a/node_modules/algebrite/sources/inv.coffee b/node_modules/algebrite/sources/inv.coffee new file mode 100644 index 0000000..d5fadf4 --- /dev/null +++ b/node_modules/algebrite/sources/inv.coffee @@ -0,0 +1,257 @@ +#----------------------------------------------------------------------------- +# +# Input: Matrix on stack (must have two dimensions but +# it can be non-numerical) +# +# Output: Inverse on stack +# +# Example: +# +# > inv(((1,2),(3,4)) +# ((-2,1),(3/2,-1/2)) +# +# > inv(((a,b),(c,d)) +# ((d / (a d - b c),-b / (a d - b c)),(-c / (a d - b c),a / (a d - b c))) +# +# Note: +# +# THIS IS DIFFERENT FROM INVERSE OF AN EXPRESSION (inv) +# Uses Gaussian elimination for numerical matrices. +# +#----------------------------------------------------------------------------- + + + +INV_check_arg = -> + if (!istensor(p1)) + return 0 + else if (p1.tensor.ndim != 2) + return 0 + else if (p1.tensor.dim[0] != p1.tensor.dim[1]) + return 0 + else + return 1 + +inv = -> + i = 0 + n = 0 + #U **a + + save() + + p1 = pop() + + # an inv just goes away when + # applied to another inv + if (isinv(p1)) + push car(cdr(p1)) + restore() + return + + # inverse goes away in case + # of identity matrix + if isidentitymatrix(p1) + push p1 + restore() + return + + # distribute the inverse of a dot + # if in expanding mode + # note that the distribution happens + # in reverse. + # The dot operator is not + # commutative, so, it matters. + if (expanding && isinnerordot(p1)) + p1 = cdr(p1) + accumulator = [] + while (iscons(p1)) + accumulator.push car(p1) + p1 = cdr(p1) + + for eachEntry in [accumulator.length-1..0] + push(accumulator[eachEntry]) + inv() + if eachEntry != accumulator.length-1 + inner() + + restore() + return + + + if (INV_check_arg() == 0) + push_symbol(INV) + push(p1) + list(2) + restore() + return + + + if isNumericAtomOrTensor p1 + yyinvg() + else + push(p1) + adj() + push(p1) + det() + p2 = pop() + if (isZeroAtomOrTensor(p2)) + stop("inverse of singular matrix") + push(p2) + divide() + + restore() + +invg = -> + save() + + p1 = pop() + + if (INV_check_arg() == 0) + push_symbol(INVG) + push(p1) + list(2) + restore() + return + + yyinvg() + + restore() + +# inverse using gaussian elimination + +yyinvg = -> + h = 0 + i = 0 + j = 0 + n = 0 + + n = p1.tensor.dim[0] + + h = tos + + for i in [0...n] + for j in [0...n] + if (i == j) + push(one) + else + push(zero) + + for i in [0...(n * n)] + push(p1.tensor.elem[i]) + + INV_decomp(n) + + p1 = alloc_tensor(n * n) + + p1.tensor.ndim = 2 + p1.tensor.dim[0] = n + p1.tensor.dim[1] = n + + for i in [0...(n * n)] + p1.tensor.elem[i] = stack[h + i] + + moveTos tos - 2 * n * n + + push(p1) + +#----------------------------------------------------------------------------- +# +# Input: n * n unit matrix on stack +# +# n * n operand on stack +# +# Output: n * n inverse matrix on stack +# +# n * n garbage on stack +# +# p2 mangled +# +#----------------------------------------------------------------------------- + +#define A(i, j) stack[a + n * (i) + (j)] +#define U(i, j) stack[u + n * (i) + (j)] + +INV_decomp = (n) -> + a = 0 + d = 0 + i = 0 + j = 0 + u = 0 + + a = tos - n * n + + u = a - n * n + + for d in [0...n] + + # diagonal element zero? + + if (equal( (stack[a + n * (d) + (d)]) , zero)) + + # find a new row + + for i in [(d + 1)...n] + if (!equal( (stack[a + n * (i) + (d)]) , zero)) + break + + if (i == n) + stop("inverse of singular matrix") + + # exchange rows + + for j in [0...n] + + p2 = stack[a + n * (d) + (j)] + stack[a + n * (d) + (j)] = stack[a + n * (i) + (j)] + stack[a + n * (i) + (j)] = p2 + + p2 = stack[u + n * (d) + (j)] + stack[u + n * (d) + (j)] = stack[u + n * (i) + (j)] + stack[u + n * (i) + (j)] = p2 + + # multiply the pivot row by 1 / pivot + + p2 = stack[a + n * (d) + (d)] + + for j in [0...n] + + if (j > d) + push(stack[a + n * (d) + (j)]) + push(p2) + divide() + stack[a + n * (d) + (j)] = pop() + + push(stack[u + n * (d) + (j)]) + push(p2) + divide() + stack[u + n * (d) + (j)] = pop() + + # clear out the column above and below the pivot + + for i in [0...n] + + if (i == d) + continue + + # multiplier + + p2 = stack[a + n * (i) + (d)] + + # add pivot row to i-th row + + for j in [0...n] + + if (j > d) + push(stack[a + n * (i) + (j)]) + push(stack[a + n * (d) + (j)]) + push(p2) + multiply() + subtract() + stack[a + n * (i) + (j)] = pop() + + push(stack[u + n * (i) + (j)]) + push(stack[u + n * (d) + (j)]) + push(p2) + multiply() + subtract() + stack[u + n * (i) + (j)] = pop() diff --git a/node_modules/algebrite/sources/is.coffee b/node_modules/algebrite/sources/is.coffee new file mode 100644 index 0000000..a964486 --- /dev/null +++ b/node_modules/algebrite/sources/is.coffee @@ -0,0 +1,628 @@ + + +DEBUG_IS = false + +# jsBoolToToInt = (p) -> +# if p then 1 else 0 + +# p is a U +# this routine is a simple check on whether we have +# a basic zero in our hands. It doesn't perform any +# calculations or simplifications. +isZeroAtom = (p) -> + switch (p.k) + when NUM + MZERO(p.q.a) + when DOUBLE + p.d == 0.0 + else + false + +# p is a U +# this routine is a simple check on whether we have +# a basic zero in our hands. It doesn't perform any +# calculations or simplifications. +isZeroTensor = (p) -> + if p.k != TENSOR + return 0 + + for i in [0...p.tensor.nelem] + if (!isZeroAtomOrTensor(p.tensor.elem[i])) + return 0 + return 1 + +# p is a U +# this routine is a simple check on whether we have +# a basic zero in our hands. It doesn't perform any +# calculations or simplifications. +isZeroAtomOrTensor = (p) -> + isZeroAtom(p) or isZeroTensor(p) + +# This is a key routine to try to determine whether +# the argument looks like zero/false, or non-zero/true, +# or undetermined. +# This is useful in two instances: +# * to determine if a predicate is true/false +# * to determine if particular quantity is zero +# Note that if one wants to check if we have a simple +# zero atom or tensor in our hands, then the isZeroAtomOrTensor +# routine is sufficient. +isZeroLikeOrNonZeroLikeOrUndetermined = (valueOrPredicate) -> + # push the argument + push(valueOrPredicate) + + # just like Eval but turns assignments into + # equality checks + Eval_predicate() + evalledArgument = pop() + + # OK first check if we already have + # a simple zero (or simple zero tensor) + if isZeroAtomOrTensor evalledArgument + return 0 + + # also check if we have a simple numeric value, or a tensor + # full of simple numeric values (i.e. straight doubles or fractions). + # In such cases, since we + # just excluded they are zero, then we take it as + # a "true" + if isNumericAtomOrTensor evalledArgument + return 1 + + # if we are here we are in the case of value that + # is not a zero and not a simple numeric value. + # e.g. stuff like + # 'sqrt(2)', or 'sin(45)' or '1+i', or 'a' + # so in such cases let's try to do a float() + # so we might get down to a simple numeric value + # in some of those cases + + push evalledArgument + zzfloat() + evalledArgument = pop() + + # anything that could be calculated down to a simple + # numeric value is now indeed either a + # double OR a double with an imaginary component + # e.g. 2.0 or 2.4 + i*5.6 + # (Everything else are things that don't have a numeric + # value e.g. 'a+b') + + # So, let's take care of the case where we have + # a simple numeric value with NO imaginary component, + # things like sqrt(2) or sin(PI) + # by doing the simple numeric + # values checks again + + if isZeroAtomOrTensor evalledArgument + return 0 + + if isNumericAtomOrTensor evalledArgument + return 1 + + # here we still have cases of simple numeric values + # WITH an imaginary component e.g. '1+i', + # or things that don't have a numeric value e.g. 'a' + + # so now let's take care of the imaginary numbers: + # since we JUST have to spot "zeros" we can just + # calculate the absolute value and re-do all the checks + # we just did + + if Find(evalledArgument, imaginaryunit) + push evalledArgument + absValFloat() + + Eval_predicate() + evalledArgument = pop() + + # re-do the simple-number checks... + + if isZeroAtomOrTensor evalledArgument + return 0 + + if isNumericAtomOrTensor evalledArgument + return 1 + + # here we have stuff that is not reconducible to any + # numeric value (or tensor with numeric values) e.g. + # 'a+b', so it just means that we just don't know the + # truth value, so we have + # to leave the whole thing unevalled + return null + + +# p is a U +isnegativenumber = (p) -> + switch (p.k) + when NUM + if (MSIGN(p.q.a) == -1) + return 1 + when DOUBLE + if (p.d < 0.0) + return 1 + return 0 + +# p is a U +ispositivenumber = (p) -> + switch (p.k) + when NUM + if (MSIGN(p.q.a) == 1) + return 1 + when DOUBLE + if (p.d > 0.0) + return 1 + return 0 + +# p is a U +isplustwo = (p) -> + switch (p.k) + when NUM + if (MEQUAL(p.q.a, 2) && MEQUAL(p.q.b, 1)) + return 1 + when DOUBLE + if (p.d == 2.0) + return 1 + return 0 + +# p is a U +isplusone = (p) -> + switch (p.k) + when NUM + if (MEQUAL(p.q.a, 1) && MEQUAL(p.q.b, 1)) + return 1 + when DOUBLE + if (p.d == 1.0) + return 1 + return 0 + +isminusone = (p) -> + switch (p.k) + when NUM + if (MEQUAL(p.q.a, -1) && MEQUAL(p.q.b, 1)) + return 1 + when DOUBLE + if (p.d == -1.0) + return 1 + return 0 + +isone = (p) -> + return isplusone(p) or isminusone(p) + +isinteger = (p) -> + if (p.k == NUM && MEQUAL(p.q.b, 1)) + return 1 + else + return 0 + +isintegerorintegerfloat = (p) -> + if p.k == DOUBLE + if (p.d == Math.round(p.d)) + return 1 + return 0 + return isinteger(p) + +isnonnegativeinteger = (p) -> + if (isrational(p) && MEQUAL(p.q.b, 1) && MSIGN(p.q.a) == 1) + return 1 + else + return 0 + +isposint = (p) -> + if (isinteger(p) && MSIGN(p.q.a) == 1) + return 1 + else + return 0 + +# -------------------------------------- + +isunivarpolyfactoredorexpandedform = (p,x) -> + if DEBUG then console.log "isunivarpolyfactoredorexpandedform: p: " + p + " x: " + x + + if !x? + push p + guess() + x = pop() + pop() + + if ispolyfactoredorexpandedform(p,x) and (Find(p, symbol(SYMBOL_X)) + Find(p, symbol(SYMBOL_Y)) + Find(p, symbol(SYMBOL_Z)) == 1) + return x + else + return 0 + +# -------------------------------------- +# sometimes we want to check if we have a poly in our +# hands, however it's in factored form and we don't +# want to expand it. + +ispolyfactoredorexpandedform = (p,x) -> + return ispolyfactoredorexpandedform_factor(p, x) + +ispolyfactoredorexpandedform_factor = (p,x) -> + if (car(p) == symbol(MULTIPLY)) + p = cdr(p) + while (iscons(p)) + if DEBUG then console.log "ispolyfactoredorexpandedform_factor testing " + car(p) + if (!ispolyfactoredorexpandedform_power(car(p), x)) + if DEBUG then console.log "... tested negative:" + car(p) + return 0 + p = cdr(p) + return 1 + else + return ispolyfactoredorexpandedform_power(p, x) + +ispolyfactoredorexpandedform_power = (p,x) -> + if (car(p) == symbol(POWER)) + if DEBUG then console.log "ispolyfactoredorexpandedform_power (isposint(caddr(p)) " + (isposint(caddr(p)) + if DEBUG then console.log "ispolyfactoredorexpandedform_power ispolyexpandedform_expr(cadr(p), x)) " + ispolyexpandedform_expr(cadr(p), x)) + return (isposint(caddr(p)) and ispolyexpandedform_expr(cadr(p), x)) + else + if DEBUG then console.log "ispolyfactoredorexpandedform_power not a power, testing if this is exp form: " + p + return ispolyexpandedform_expr(p, x) + +# -------------------------------------- + +ispolyexpandedform = (p,x) -> + if (Find(p, x)) + return ispolyexpandedform_expr(p, x) + else + return 0 + + +ispolyexpandedform_expr = (p,x) -> + if (car(p) == symbol(ADD)) + p = cdr(p) + while (iscons(p)) + if (!ispolyexpandedform_term(car(p), x)) + return 0 + p = cdr(p) + return 1 + else + return ispolyexpandedform_term(p, x) + +ispolyexpandedform_term = (p,x) -> + if (car(p) == symbol(MULTIPLY)) + p = cdr(p) + while (iscons(p)) + if (!ispolyexpandedform_factor(car(p), x)) + return 0 + p = cdr(p) + return 1 + else + return ispolyexpandedform_factor(p, x) + +ispolyexpandedform_factor = (p,x) -> + if (equal(p, x)) + return 1 + if (car(p) == symbol(POWER) && equal(cadr(p), x)) + if (isposint(caddr(p))) + return 1 + else + return 0 + if (Find(p, x)) + return 0 + else + return 1 + +# -------------------------------------- + +isnegativeterm = (p) -> + if (isnegativenumber(p)) + return 1 + else if (car(p) == symbol(MULTIPLY) && isnegativenumber(cadr(p))) + return 1 + else + return 0 + +hasNegativeRationalExponent = (p) -> + if (car(p) == symbol(POWER) \ + && isrational(car(cdr(cdr(p)))) \ + && isnegativenumber(car(cdr(p)))) + if DEBUG_IS then console.log "hasNegativeRationalExponent: " + p.toString() + " has imaginary component" + return 1 + else + if DEBUG_IS then console.log "hasNegativeRationalExponent: " + p.toString() + " has NO imaginary component" + return 0 + +isimaginarynumberdouble = (p) -> + if ((car(p) == symbol(MULTIPLY) \ + && length(p) == 3 \ + && isdouble(cadr(p)) \ + && hasNegativeRationalExponent(caddr(p))) \ + || equal(p, imaginaryunit)) + return 1 + else + return 0 + +isimaginarynumber = (p) -> + if ((car(p) == symbol(MULTIPLY) \ + && length(p) == 3 \ + && isNumericAtom(cadr(p)) \ + && equal(caddr(p), imaginaryunit)) \ + || equal(p, imaginaryunit) \ + || hasNegativeRationalExponent(caddr(p)) + ) + if DEBUG_IS then console.log "isimaginarynumber: " + p.toString() + " is imaginary number" + return 1 + else + if DEBUG_IS then console.log "isimaginarynumber: " + p.toString() + " isn't an imaginary number" + return 0 + +iscomplexnumberdouble = (p) -> + if ((car(p) == symbol(ADD) \ + && length(p) == 3 \ + && isdouble(cadr(p)) \ + && isimaginarynumberdouble(caddr(p))) \ + || isimaginarynumberdouble(p)) + return 1 + else + return 0 + +iscomplexnumber = (p) -> + if DEBUG_IS then debugger + if ((car(p) == symbol(ADD) \ + && length(p) == 3 \ + && isNumericAtom(cadr(p)) \ + && isimaginarynumber(caddr(p))) \ + || isimaginarynumber(p)) + if DEBUG then console.log "iscomplexnumber: " + p.toString() + " is imaginary number" + return 1 + else + if DEBUG then console.log "iscomplexnumber: " + p.toString() + " is imaginary number" + return 0 + +iseveninteger = (p) -> + if isinteger(p) && p.q.a.isEven() + return 1 + else + return 0 + +isnegative = (p) -> + if (car(p) == symbol(ADD) && isnegativeterm(cadr(p))) + return 1 + else if (isnegativeterm(p)) + return 1 + else + return 0 + +# returns 1 if there's a symbol somewhere. +# not used anywhere. +# NOTE: PI and POWER are symbols, +# so for example 2^3 would be symbolic +# while -1^(1/2) i.e. 'i' is not, so this can +# be tricky to use. +issymbolic = (p) -> + if (issymbol(p)) + return 1 + else + while (iscons(p)) + if (issymbolic(car(p))) + return 1 + p = cdr(p) + return 0 + +# i.e. 2, 2^3, etc. +isintegerfactor = (p) -> + isinteger(p) || # note that and takes precedence over or + car(p) == symbol(POWER) and + isinteger(cadr(p)) and + isinteger(caddr(p)) + +isNumberOneOverSomething = (p) -> + isfraction(p) and + MEQUAL(p.q.a.abs(), 1) + + +isoneover = (p) -> + car(p) == symbol(POWER) and + isminusone(caddr(p)) + +isfraction = (p) -> + p.k == NUM && !MEQUAL(p.q.b, 1) + +# p is a U, n an int +equaln = (p,n) -> + switch (p.k) + when NUM + MEQUAL(p.q.a, n) && MEQUAL(p.q.b, 1) + when DOUBLE + p.d == n + else + false + +# p is a U, a and b ints +equalq = (p, a, b) -> + switch (p.k) + when NUM + MEQUAL(p.q.a, a) && MEQUAL(p.q.b, b) + when DOUBLE + p.d == a / b + else + false + +# 1/2 ? +isoneovertwo = (p) -> + equalq(p, 1, 2) + +# -1/2 ? +isminusoneovertwo = (p) -> + equalq(p, -1, 2) + +# 1/sqrt(2) ? +isoneoversqrttwo = (p) -> + car(p) == symbol(POWER) and + equaln(cadr(p), 2) and + equalq(caddr(p), -1, 2) + +# -1/sqrt(2) ? +isminusoneoversqrttwo = (p) -> + car(p) == symbol(MULTIPLY) and + equaln(cadr(p), -1) and + isoneoversqrttwo(caddr(p)) and + length(p) == 3 + +# sqrt(3)/2 ? +issqrtthreeovertwo = (p) -> + car(p) == symbol(MULTIPLY) and + isoneovertwo(cadr(p)) and + issqrtthree(caddr(p)) and + length(p) == 3 + +# -sqrt(3)/2 ? +isminussqrtthreeovertwo = (p) -> + car(p) == symbol(MULTIPLY) and + isminusoneovertwo(cadr(p)) and + issqrtthree(caddr(p)) and + length(p) == 3 + +# p == sqrt(3) ? +issqrtthree = (p) -> + car(p) == symbol(POWER) and + equaln(cadr(p), 3) and + isoneovertwo(caddr(p)) + +isfloating = (p) -> + if p.k == DOUBLE or p == symbol(FLOATF) + return 1 + while (iscons(p)) + if (isfloating(car(p))) + return 1 + p = cdr(p) + return 0 + +isimaginaryunit = (p) -> + if (equal(p, imaginaryunit)) + return 1 + else + return 0 + +# n/2 * i * pi ? + +# return value: + +# 0 no + +# 1 1 + +# 2 -1 + +# 3 i + +# 4 -i + +isquarterturn = (p) -> + n = 0 + minussign = 0 + + if (car(p) != symbol(MULTIPLY)) + return 0 + + if (equal(cadr(p), imaginaryunit)) + + if (caddr(p) != symbol(PI)) + return 0 + + if (length(p) != 3) + return 0 + + return 2 + + if (!isNumericAtom(cadr(p))) + return 0 + + if (!equal(caddr(p), imaginaryunit)) + return 0 + + if (cadddr(p) != symbol(PI)) + return 0 + + if (length(p) != 4) + return 0 + + push(cadr(p)) + push_integer(2) + multiply() + + n = pop_integer() + + if (isNaN(n)) + return 0 + + if (n < 1) + minussign = 1 + n = -n + + switch (n % 4) + when 0 + n = 1 + when 1 + if (minussign) + n = 4 + else + n = 3 + when 2 + n = 2 + when 3 + if (minussign) + n = 3 + else + n = 4 + + return n + +# special multiple of pi? + +# returns for the following multiples of pi... + +# -4/2 -3/2 -2/2 -1/2 1/2 2/2 3/2 4/2 + +# 4 1 2 3 1 2 3 4 + +isnpi = (p) -> + n = 0 + if (p == symbol(PI)) + return 2 + if (car(p) == symbol(MULTIPLY) \ + && isNumericAtom(cadr(p)) \ + && caddr(p) == symbol(PI) \ + && length(p) == 3) + doNothing = 0 + else + return 0 + push(cadr(p)) + push_integer(2) + multiply() + n = pop_integer() + if (isNaN(n)) + return 0 + if (n < 0) + n = 4 - (-n) % 4 + else + n = 1 + (n - 1) % 4 + return n + + + +$.isZeroAtomOrTensor = isZeroAtomOrTensor +$.isnegativenumber = isnegativenumber +$.isplusone = isplusone +$.isminusone = isminusone +$.isinteger = isinteger +$.isnonnegativeinteger = isnonnegativeinteger +$.isposint = isposint +$.isnegativeterm = isnegativeterm +$.isimaginarynumber = isimaginarynumber +$.iscomplexnumber = iscomplexnumber +$.iseveninteger = iseveninteger +$.isnegative = isnegative +$.issymbolic = issymbolic +$.isintegerfactor = isintegerfactor +$.isoneover = isoneover +$.isfraction = isfraction +$.isoneoversqrttwo = isoneoversqrttwo +$.isminusoneoversqrttwo = isminusoneoversqrttwo +$.isfloating = isfloating +$.isimaginaryunit = isimaginaryunit +$.isquarterturn = isquarterturn +$.isnpi = isnpi + diff --git a/node_modules/algebrite/sources/isprime.coffee b/node_modules/algebrite/sources/isprime.coffee new file mode 100644 index 0000000..bd02636 --- /dev/null +++ b/node_modules/algebrite/sources/isprime.coffee @@ -0,0 +1,11 @@ + + +Eval_isprime = -> + push(cadr(p1)) + Eval() + p1 = pop() + if (isnonnegativeinteger(p1) && mprime(p1.q.a)) + push_integer(1) + else + push_integer(0) + diff --git a/node_modules/algebrite/sources/laguerre.coffee b/node_modules/algebrite/sources/laguerre.coffee new file mode 100644 index 0000000..3a15611 --- /dev/null +++ b/node_modules/algebrite/sources/laguerre.coffee @@ -0,0 +1,127 @@ +### + Laguerre function + +Example + + laguerre(x,3) + +Result + + 1 3 3 2 + - --- x + --- x - 3 x + 1 + 6 2 + +The computation uses the following recurrence relation. + + L(x,0,k) = 1 + + L(x,1,k) = -x + k + 1 + + n*L(x,n,k) = (2*(n-1)+1-x+k)*L(x,n-1,k) - (n-1+k)*L(x,n-2,k) + +In the "for" loop i = n-1 so the recurrence relation becomes + + (i+1)*L(x,n,k) = (2*i+1-x+k)*L(x,n-1,k) - (i+k)*L(x,n-2,k) +### + + + +Eval_laguerre = -> + # 1st arg + + push(cadr(p1)) + Eval() + + # 2nd arg + + push(caddr(p1)) + Eval() + + # 3rd arg + + push(cadddr(p1)) + Eval() + + p2 = pop() + if (p2 == symbol(NIL)) + push_integer(0) + else + push(p2) + + laguerre() + +#define X p1 +#define N p2 +#define K p3 +#define Y p4 +#define Y0 p5 +#define Y1 p6 + +laguerre = -> + n = 0 + save() + + p3 = pop() + p2 = pop() + p1 = pop() + + push(p2) + n = pop_integer() + + if (n < 0 || isNaN(n)) + push_symbol(LAGUERRE) + push(p1) + push(p2) + push(p3) + list(4) + restore() + return + + if (issymbol(p1)) + laguerre2(n) + else + p4 = p1; # do this when p1 is an expr + p1 = symbol(SECRETX) + laguerre2(n) + p1 = p4 + push(symbol(SECRETX)) + push(p1) + subst() + Eval() + + restore() + +laguerre2 = (n) -> + i = 0 + + push_integer(1) + push_integer(0) + + p6 = pop() + + for i in [0...n] + + p5 = p6 + + p6 = pop() + + push_integer(2 * i + 1) + push(p1) + subtract() + push(p3) + add() + push(p6) + multiply() + + push_integer(i) + push(p3) + add() + push(p5) + multiply() + + subtract() + + push_integer(i + 1) + divide() + + diff --git a/node_modules/algebrite/sources/lcm.coffee b/node_modules/algebrite/sources/lcm.coffee new file mode 100644 index 0000000..901947b --- /dev/null +++ b/node_modules/algebrite/sources/lcm.coffee @@ -0,0 +1,40 @@ +# Find the least common multiple of two expressions. + + + +Eval_lcm = -> + p1 = cdr(p1) + push(car(p1)) + Eval() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + lcm() + p1 = cdr(p1) + +lcm = -> + prev_expanding = expanding + save() + yylcm() + restore() + expanding = prev_expanding + +yylcm = -> + expanding = 1 + + p2 = pop() + p1 = pop() + + push(p1) + push(p2) + gcd() + + push(p1) + divide() + + push(p2) + divide() + + inverse() + diff --git a/node_modules/algebrite/sources/leading.coffee b/node_modules/algebrite/sources/leading.coffee new file mode 100644 index 0000000..b2d2fa6 --- /dev/null +++ b/node_modules/algebrite/sources/leading.coffee @@ -0,0 +1,51 @@ +### + Return the leading coefficient of a polynomial. + +Example + + leading(5x^2+x+1,x) + +Result + + 5 + +The result is undefined if P is not a polynomial. +### + +Eval_leading = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + p1 = pop() + if (p1 == symbol(NIL)) + guess() + else + push(p1) + leading() + +#define P p1 +#define X p2 +#define N p3 + +leading = -> + save() + + p2 = pop() + p1 = pop() + + push(p1) # N = degree of P + push(p2) + degree() + p3 = pop() + + push(p1) # divide through by X ^ N + push(p2) + push(p3) + power() + divide() + + push(p2) # remove terms that depend on X + filter() + + restore() diff --git a/node_modules/algebrite/sources/legendre.coffee b/node_modules/algebrite/sources/legendre.coffee new file mode 100644 index 0000000..4ac8925 --- /dev/null +++ b/node_modules/algebrite/sources/legendre.coffee @@ -0,0 +1,179 @@ +### + Legendre function + +Example + + legendre(x,3,0) + +Result + + 5 3 3 + --- x - --- x + 2 2 + +The computation uses the following recurrence relation. + + P(x,0) = 1 + + P(x,1) = x + + n*P(x,n) = (2*(n-1)+1)*x*P(x,n-1) - (n-1)*P(x,n-2) + +In the "for" loop we have i = n-1 so the recurrence relation becomes + + (i+1)*P(x,n) = (2*i+1)*x*P(x,n-1) - i*P(x,n-2) + +For m > 0 + + P(x,n,m) = (-1)^m * (1-x^2)^(m/2) * d^m/dx^m P(x,n) +### + + + +Eval_legendre = -> + # 1st arg + + push(cadr(p1)) + Eval() + + # 2nd arg + + push(caddr(p1)) + Eval() + + # 3rd arg (optional) + + push(cadddr(p1)) + Eval() + + p2 = pop() + if (p2 == symbol(NIL)) + push_integer(0) + else + push(p2) + + legendre() + +#define X p1 +#define N p2 +#define M p3 +#define Y p4 +#define Y0 p5 +#define Y1 p6 + + +legendre = -> + save() + __legendre() + restore() + +__legendre = -> + m = 0 + n = 0 + + p3 = pop() + p2 = pop() + p1 = pop() + + push(p2) + n = pop_integer() + + push(p3) + m = pop_integer() + + if (n < 0 || isNaN(n) || m < 0 || isNaN(m)) + push_symbol(LEGENDRE) + push(p1) + push(p2) + push(p3) + list(4) + return + + if (issymbol(p1)) + __legendre2(n, m) + else + p4 = p1; # do this when X is an expr + p1 = symbol(SECRETX) + __legendre2(n, m) + p1 = p4 + push(symbol(SECRETX)) + push(p1) + subst() + Eval() + + __legendre3(m) + +__legendre2 = (n, m) -> + i = 0 + + push_integer(1) + push_integer(0) + + p6 = pop() + + # i=1 p5 = 0 + # p6 = 1 + # ((2*i+1)*x*p6 - i*p5) / i = x + # + # i=2 p5 = 1 + # p6 = x + # ((2*i+1)*x*p6 - i*p5) / i = -1/2 + 3/2*x^2 + # + # i=3 p5 = x + # p6 = -1/2 + 3/2*x^2 + # ((2*i+1)*x*p6 - i*p5) / i = -3/2*x + 5/2*x^3 + + for i in [0...n] + + p5 = p6 + + p6 = pop() + + push_integer(2 * i + 1) + push(p1) + multiply() + push(p6) + multiply() + + push_integer(i) + push(p5) + multiply() + + subtract() + + push_integer(i + 1) + divide() + + for i in [0...m] + push(p1) + derivative() + +# moveTos tos * (-1)^m * (1-x^2)^(m/2) + +__legendre3 = (m) -> + if (m == 0) + return + + if (car(p1) == symbol(COS)) + push(cadr(p1)) + sine() + square() + else if (car(p1) == symbol(SIN)) + push(cadr(p1)) + cosine() + square() + else + push_integer(1) + push(p1) + square() + subtract() + + push_integer(m) + push_rational(1, 2) + multiply() + power() + multiply() + + if (m % 2) + negate() + diff --git a/node_modules/algebrite/sources/list.coffee b/node_modules/algebrite/sources/list.coffee new file mode 100644 index 0000000..0c62c1d --- /dev/null +++ b/node_modules/algebrite/sources/list.coffee @@ -0,0 +1,10 @@ +# Create a list from n things on the stack. + + + +# n is an integer +list = (n) -> + listIterator = 0 + push(symbol(NIL)) + for listIterator in [0...n] + cons() diff --git a/node_modules/algebrite/sources/log.coffee b/node_modules/algebrite/sources/log.coffee new file mode 100644 index 0000000..9c9fc49 --- /dev/null +++ b/node_modules/algebrite/sources/log.coffee @@ -0,0 +1,88 @@ +# Natural logarithm. +# +# Note that we use the mathematics / Javascript / Mathematica +# convention that "log" is indeed the natural logarithm. +# +# In engineering, biology, astronomy, "log" can stand instead +# for the "common" logarithm i.e. base 10. Also note that Google +# calculations use log for the common logarithm. + + +Eval_log = -> + push(cadr(p1)) + Eval() + logarithm() + +logarithm = -> + save() + yylog() + restore() + +yylog = -> + d = 0.0 + + p1 = pop() + + if (p1 == symbol(E)) + push_integer(1) + return + + if (equaln(p1, 1)) + push_integer(0) + return + + if (isnegativenumber(p1)) + push(p1) + negate() + logarithm() + push(imaginaryunit) + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + multiply() + add() + return + + if (isdouble(p1)) + d = Math.log(p1.d) + push_double(d) + return + + # rational number and not an integer? + + if (isfraction(p1)) + push(p1) + numerator() + logarithm() + push(p1) + denominator() + logarithm() + subtract() + return + + # log(a ^ b) --> b log(a) + + if (car(p1) == symbol(POWER)) + push(caddr(p1)) + push(cadr(p1)) + logarithm() + multiply() + return + + # log(a * b) --> log(a) + log(b) + + if (car(p1) == symbol(MULTIPLY)) + push_integer(0) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + logarithm() + add() + p1 = cdr(p1) + return + + push_symbol(LOG) + push(p1) + list(2) + diff --git a/node_modules/algebrite/sources/lookup.coffee b/node_modules/algebrite/sources/lookup.coffee new file mode 100644 index 0000000..7f1d33b --- /dev/null +++ b/node_modules/algebrite/sources/lookup.coffee @@ -0,0 +1,119 @@ +# now this might be a little confusing, so a +# clarification is in order. +# First off, at the scripting level most things +# as they are handled get evalled. +# That means that they are recursively "calculated" +# as much as possible, i.e. variables are recursively +# looked up for their values, operators are applied, +# functions are ivoked, etc. +# I.e. while scripting, most things are +# evalled all the times. +# e.g. if I type +# x = 1+1 +# then x is actually assigned 2, not 1+1 +# Something that helps a little is "quote", e.g. +# If I assign +# x = quote(1+1) +# then x actually contains 1+1, not 2. +# But then x is evaluated as soon as I type +# x // gives "2" as x is evaluated +# +# Evaluation is great, but sometimes one wants +# to look at the actual structure of an expression +# or a content of a variable, without those +# being evaluated first. +# +# for example I might type +# x = a + b +# a = 1 +# b = 2 +# and from this point on printing the actual +# structure of x is impossible, because from +# now on any evaluation of x will give "3" +# You might say "but you have x defined up there, +# what's the point of printing it out?", to which +# the answer is that one might do further +# substitutions or transformations of special kind +# to x. One might want to look at the structure +# and it might be complex or impossible. +# +# So this function does that. +# If it's passed a variable, then it +# DOES NOT eval the variable, RATHER +# it prints the content of the variable without +# evaluating it. +# In the other cases it works like "quote" e.g. +# it just gives the argument as is, again without +# evaluating it. +# +# In the following examples, for brevity, I just +# use +# x = quote(1+2) +# instead of this: +# x = a + b +# a = 1 +# b = 2 +# to put a structure in x that is easy to see whether +# it's avaulated or not. +# +# So lookup allows this: +# x = quote(1+2) +# print(lookup(x)) # gives 1+2 +# +# Note that there would be potentially a way +# to achieve a similar result, you could do: +# x = quote(quote(1+2)) +# print(x) +# but you can't always control x to contain +# two quotes like that... +# note how two "quotes" are needed because +# if you just put one, then +# x would indeed contain 1+2 instead of 3, +# but then print would evaluate that to 3: +# x = quote(1+2) # now x contains 1+2, not 3 +# print(x) # but x evaluated here to 3 +# +# Other workarounds would not work: +# x = quote(1+2) +# print(quote(x)) +# would not work because quote(x) literally means 'x' +# so 'x' is printed instead of its content. +# +# Note also that lookup allows you to copy +# the structure of a variable to another: +# x = a + b +# a = 1 +# b = 2 +# now: +# y = x # y contains the number 3 and prints to 3 +# y = lookup(x) # y contains "a+b" and prints to 3 +# y = quote(x) # y contains "x" and prints to 3 +# note that in the first and second case y is +# independent from x, i.e. changing x doesn't change y +# while in the last case it is. +# +# Another similar simple example is when doing something +# like this: +# x = y +# y = z +# x +# => gives z +# lookup(x) +# => gives y +# i.e. lookup allows you to see the immediate +# content of x, rather than the evaluation which +# would end up in x -> y -> z +# Note that if you invert the order of the assignments i.e. +# y = z +# x = y +# Then at this point x immediately contains z, since the +# assignment x = y is not quoted, hence y is evaluated to z +# when assigned to x. +# lookup(x) +# => gives z + +Eval_lookup = -> + p1 = cadr(p1) + if !iscons(p1) and cadr(p1).k == SYM + p1 = get_binding(p1) + push p1 \ No newline at end of file diff --git a/node_modules/algebrite/sources/madd.coffee b/node_modules/algebrite/sources/madd.coffee new file mode 100644 index 0000000..40742bf --- /dev/null +++ b/node_modules/algebrite/sources/madd.coffee @@ -0,0 +1,27 @@ +# Bignum addition and subtraction + + + +#static unsigned int *addf(unsigned int *, unsigned int *) +#static unsigned int *subf(unsigned int *, unsigned int *) +#static int ucmp(unsigned int *, unsigned int *) + +madd = (a, b) -> + + return a.add b + +msub = (a, b) -> + return a.subtract b + +addf = (a, b) -> + + return a.add b + +subf = (a, b) -> + return a.subtract b + +# unsigned compare + +ucmp = (a,b) -> + return a.compareAbs b + diff --git a/node_modules/algebrite/sources/mainForWebPage.js b/node_modules/algebrite/sources/mainForWebPage.js new file mode 100644 index 0000000..99fa227 --- /dev/null +++ b/node_modules/algebrite/sources/mainForWebPage.js @@ -0,0 +1 @@ +window.Algebrite = require('../dist/algebrite') \ No newline at end of file diff --git a/node_modules/algebrite/sources/mgcd.coffee b/node_modules/algebrite/sources/mgcd.coffee new file mode 100644 index 0000000..fc77071 --- /dev/null +++ b/node_modules/algebrite/sources/mgcd.coffee @@ -0,0 +1,25 @@ +#----------------------------------------------------------------------------- +# +# Bignum GCD +# +# Uses the binary GCD algorithm. +# +# See "The Art of Computer Programming" p. 338. +# +# mgcd always returns a positive value +# +# mgcd(0, 0) = 0 +# +# mgcd(u, 0) = |u| +# +# mgcd(0, v) = |v| +# +#----------------------------------------------------------------------------- + + + +mgcd = (u,v) -> + return bigInt.gcd(u,v) + +#if SELFTEST + diff --git a/node_modules/algebrite/sources/misc.coffee b/node_modules/algebrite/sources/misc.coffee new file mode 100644 index 0000000..0a32a8a --- /dev/null +++ b/node_modules/algebrite/sources/misc.coffee @@ -0,0 +1,199 @@ + + +# s is a string +new_string = (s) -> + theNewString = new U() + theNewString.k = STR + theNewString.str = s + return theNewString + +out_of_memory = -> + stop("out of memory") + +# both ints +push_zero_matrix = (i,j) -> + push(alloc_tensor(i * j)) + stack[tos - 1].tensor.ndim = 2 + stack[tos - 1].tensor.dim[0] = i + stack[tos - 1].tensor.dim[1] = j + +push_identity_matrix = (n) -> + push_zero_matrix(n, n) + for i in [0...n] + stack[tos - 1].tensor.elem[i * n + i] = one + + check_tensor_dimensions stack[tos - 1] + +push_cars = (p) -> + while (iscons(p)) + push(car(p)) + p = cdr(p) + +# see cmp_expr definition, this +# function alone just does simple structure comparison +# or compares numbers (either rationals or integers or doubles) +# but can't be used alone to test +# more complex mathematical equalities... +equal = (p1,p2) -> + if (cmp_expr(p1, p2) == 0) + return 1 + else + return 0 + +lessp = (p1,p2) -> + if (cmp_expr(p1, p2) < 0) + return 1 + else + return 0 + +sign = (n) -> + if (n < 0) + return -1 + else if (n > 0) + return 1 + else + return 0 + +# compares whether two expressions +# have the same structure. +# For example this method alone +# would compare "1+1" and "2" +# as different. +# It just so happens though that one oftens +# evaluates the two sides before passing them +# to this function, so chances are that the two +# sides have the same normal form. +# Even a simple evaluation might not cut it +# though... a simplification of both sides +# would then help. And even that might not +# cut it in some cases... +cmp_expr = (p1, p2) -> + n = 0 + + if (p1 == p2) + return 0 + + if (p1 == symbol(NIL)) + return -1 + + if (p2 == symbol(NIL)) + return 1 + + if (isNumericAtom(p1) && isNumericAtom(p2)) + return sign(compare_numbers(p1, p2)) + + if (isNumericAtom(p1)) + return -1 + + if (isNumericAtom(p2)) + return 1 + + if (isstr(p1) && isstr(p2)) + return sign(strcmp(p1.str,p2.str)) + + if (isstr(p1)) + return -1 + + if (isstr(p2)) + return 1 + + if (issymbol(p1) && issymbol(p2)) + return sign(strcmp(get_printname(p1),get_printname(p2))) + + if (issymbol(p1)) + return -1 + + if (issymbol(p2)) + return 1 + + if (istensor(p1) && istensor(p2)) + return compare_tensors(p1, p2) + + if (istensor(p1)) + return -1 + + if (istensor(p2)) + return 1 + + # recursion here + while (iscons(p1) && iscons(p2)) + n = cmp_expr(car(p1), car(p2)) + if (n != 0) + return n + p1 = cdr(p1) + p2 = cdr(p2) + + if (iscons(p2)) + return -1 + + if (iscons(p1)) + return 1 + + return 0 + +length = (p) -> + n = 0 + while (iscons(p)) + p = cdr(p) + n++ + return n + +unique = (p) -> + save() + p1 = symbol(NIL) + p2 = symbol(NIL) + unique_f(p) + if (p2 != symbol(NIL)) + p1 = symbol(NIL) + p = p1 + restore() + return p + +unique_f = (p) -> + if (isstr(p)) + if (p1 == symbol(NIL)) + p1 = p + else if (p != p1) + p2 = p + return + while (iscons(p)) + unique_f(car(p)) + if (p2 != symbol(NIL)) + return + p = cdr(p) + + +ssqrt = -> + push_rational(1, 2) + power() + +yyexpand = -> + prev_expanding = expanding + expanding = 1 + Eval() + expanding = prev_expanding + +exponential = -> + push_symbol(E) + swap() + power() + +square = -> + push_integer(2) + power() + +#__cmp = (p1, p2) -> +# return cmp_expr(p1, p2) + +# n an integer +sort_stack = (n) -> + #qsort(stack + tos - n, n, sizeof (U *), __cmp) + + h = tos - n + subsetOfStack = stack.slice(h,h+n) + subsetOfStack.sort(cmp_expr) + stack = stack.slice(0,h).concat(subsetOfStack).concat(stack.slice(h+n)) + + +$.equal = equal +$.length = length diff --git a/node_modules/algebrite/sources/mmul.coffee b/node_modules/algebrite/sources/mmul.coffee new file mode 100644 index 0000000..42b7aff --- /dev/null +++ b/node_modules/algebrite/sources/mmul.coffee @@ -0,0 +1,75 @@ +# Bignum multiplication and division + + + + + +mmul = (a, b) -> + return a.multiply b + + +mdiv = (a, b) -> + return a.divide b + +# a = a + b + +### +static void +addf(unsigned int *a, unsigned int *b, int len) +{ + int i + long long t = 0; # can be signed or unsigned + for (i = 0; i < len; i++) { + t += (long long) a[i] + b[i] + a[i] = (unsigned int) t + t >>= 32 + } +} + +// a = a - b + +static void +subf(unsigned int *a, unsigned int *b, int len) +{ + int i + long long t = 0; # must be signed + for (i = 0; i < len; i++) { + t += (long long) a[i] - b[i] + a[i] = (unsigned int) t + t >>= 32 + } +} + +// a = b * c + +// 0xffffffff + 0xffffffff * 0xffffffff == 0xffffffff00000000 + +static void +mulf(unsigned int *a, unsigned int *b, int len, unsigned int c) +{ + int i + unsigned long long t = 0; # must be unsigned + for (i = 0; i < len; i++) { + t += (unsigned long long) b[i] * c + a[i] = (unsigned int) t + t >>= 32 + } + a[i] = (unsigned int) t +} +### + +mmod = (a,b) -> + return a.mod b + +# return both quotient and remainder of a/b +# we'd have this method as divmod(number) +# but obviously doesn't change the passed parameters + +mdivrem = (a,b) -> + toReturn = a.divmod b + return [toReturn.quotient, toReturn.remainder] + +#if SELFTEST + +# small integer tests + diff --git a/node_modules/algebrite/sources/mod.coffee b/node_modules/algebrite/sources/mod.coffee new file mode 100644 index 0000000..fd27965 --- /dev/null +++ b/node_modules/algebrite/sources/mod.coffee @@ -0,0 +1,55 @@ + + +Eval_mod = -> + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + mod() + +mod = -> + n = 0 + + save() + + p2 = pop() + p1 = pop() + + if (isZeroAtomOrTensor(p2)) + stop("mod function: divide by zero") + + if (!isNumericAtom(p1) || !isNumericAtom(p2)) + push_symbol(MOD) + push(p1) + push(p2) + list(3) + restore() + return + + if (isdouble(p1)) + push(p1) + n = pop_integer() + if (isNaN(n)) + stop("mod function: cannot convert float value to integer") + push_integer(n) + p1 = pop() + + if (isdouble(p2)) + push(p2) + n = pop_integer() + if (isNaN(n)) + stop("mod function: cannot convert float value to integer") + push_integer(n) + p2 = pop() + + if (!isinteger(p1) || !isinteger(p2)) + stop("mod function: integer arguments expected") + + p3 = new U() + p3.k = NUM + p3.q.a = mmod(p1.q.a, p2.q.a) + p3.q.b = mint(1) + push(p3) + + restore() + diff --git a/node_modules/algebrite/sources/mpow.coffee b/node_modules/algebrite/sources/mpow.coffee new file mode 100644 index 0000000..3a9799f --- /dev/null +++ b/node_modules/algebrite/sources/mpow.coffee @@ -0,0 +1,11 @@ +# Bignum power + + + +# a is a bigint, n is a small normal int +mpow = (a,n) -> + + return a.pow n + +#if SELFTEST + diff --git a/node_modules/algebrite/sources/mprime.coffee b/node_modules/algebrite/sources/mprime.coffee new file mode 100644 index 0000000..fd3a32a --- /dev/null +++ b/node_modules/algebrite/sources/mprime.coffee @@ -0,0 +1,13 @@ +# Bignum prime test (returns 1 if prime, 0 if not) + +# Uses Algorithm P (probabilistic primality test) from p. 395 of +# "The Art of Computer Programming, Volume 2" by Donald E. Knuth. + + + + +mprime = (n) -> + return n.isProbablePrime() + +#if SELFTEST + diff --git a/node_modules/algebrite/sources/mroot.coffee b/node_modules/algebrite/sources/mroot.coffee new file mode 100644 index 0000000..6a6c1b4 --- /dev/null +++ b/node_modules/algebrite/sources/mroot.coffee @@ -0,0 +1,63 @@ +#----------------------------------------------------------------------------- +# +# Bignum root +# +# Returns null pointer if not perfect root. +# +# The sign of the radicand is ignored. +# +#----------------------------------------------------------------------------- + + +mroot = (n, index) -> + # this doesn't quite work + #return n.pow(1/index + 0.0000000000000001) + + # sign of radicand ignored + n = n.abs() + + i = 0 + j = 0 + k = 0 + + if (index == 0) + stop("root index is zero") + + # count number of bits + k = 0 + while n.shiftRight(k) > 0 + k++ + + if (k == 0) + return mint(0) + + # initial guess + + k = Math.floor((k - 1) / index) + + j = Math.floor(k / 32 + 1) + x = bigInt(j) + + for i in [0...j] + # zero-out the ith bit + x = x.and(bigInt(1).shiftLeft(i).not()) + + while (k >= 0) + # set the kth bit + x = x.or(bigInt(1).shiftLeft(k)) + + y = mpow(x, index) + switch (mcmp(y, n)) + when 0 + return x + when 1 + #mp_clr_bit(x, k) + # clear the kth bit + x = x.and(bigInt(1).shiftLeft(k).not()) + k-- + + return 0 + + +#if SELFTEST + diff --git a/node_modules/algebrite/sources/multiply.coffee b/node_modules/algebrite/sources/multiply.coffee new file mode 100644 index 0000000..074763e --- /dev/null +++ b/node_modules/algebrite/sources/multiply.coffee @@ -0,0 +1,619 @@ +# Symbolic multiplication + +# multiplication is commutative, so it can't be used +# e.g. on two matrices. +# But it can be used, say, on a scalar and a matrix., +# so the output of a multiplication is not +# always a scalar. + +#extern void append(void) +#static void parse_p1(void) +#static void parse_p2(void) +#static void __normalize_radical_factors(int) + +DEBUG_MULTIPLY = false + +Eval_multiply = -> + push(cadr(p1)) + Eval() + p1 = cddr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + multiply() + p1 = cdr(p1) + +# this one doesn't eval the factors, +# so you pass i*(-1)^(1/2), it wouldnt't +# give -1, because i is not evalled +multiply = -> + if (esc_flag) + stop("escape key stop") + if (isNumericAtom(stack[tos - 2]) && isNumericAtom(stack[tos - 1])) + multiply_numbers() + else + save() + yymultiply() + restore() + +yymultiply = -> + h = 0 + i = 0 + n = 0 + + # pop operands + + p2 = pop() + p1 = pop() + + h = tos + + # is either operand zero? + + if (isZeroAtom(p1) || isZeroAtom(p2)) + if evaluatingAsFloats then push_double(0.0) else push(zero) + return + + # is either operand a sum? + + #console.log("yymultiply: expanding: " + expanding) + if (expanding && isadd(p1)) + p1 = cdr(p1) + if evaluatingAsFloats then push_double(0.0) else push(zero) + while (iscons(p1)) + push(car(p1)) + push(p2) + multiply() + add() + p1 = cdr(p1) + return + + if (expanding && isadd(p2)) + p2 = cdr(p2) + if evaluatingAsFloats then push_double(0.0) else push(zero) + while (iscons(p2)) + push(p1) + push(car(p2)) + multiply() + add() + p2 = cdr(p2) + return + + # scalar times tensor? + + if (!istensor(p1) && istensor(p2)) + push(p1) + push(p2) + scalar_times_tensor() + return + + # tensor times scalar? + + if (istensor(p1) && !istensor(p2)) + push(p1) + push(p2) + tensor_times_scalar() + return + + # adjust operands + + if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + else + push(p1) + list(1) + p1 = pop() + + if (car(p2) == symbol(MULTIPLY)) + p2 = cdr(p2) + else + push(p2) + list(1) + p2 = pop() + + # handle numerical coefficients + + if (isNumericAtom(car(p1)) && isNumericAtom(car(p2))) + push(car(p1)) + push(car(p2)) + multiply_numbers() + p1 = cdr(p1) + p2 = cdr(p2) + else if (isNumericAtom(car(p1))) + push(car(p1)) + p1 = cdr(p1) + else if (isNumericAtom(car(p2))) + push(car(p2)) + p2 = cdr(p2) + else + if evaluatingAsFloats then push_double(1.0) else push(one) + + parse_p1() + parse_p2() + + while (iscons(p1) && iscons(p2)) + + # if (car(p1)->gamma && car(p2)->gamma) { + # combine_gammas(h) + # p1 = cdr(p1) + # p2 = cdr(p2) + # parse_p1() + # parse_p2() + # continue + # } + + if (caar(p1) == symbol(OPERATOR) && caar(p2) == symbol(OPERATOR)) + push_symbol(OPERATOR) + push(cdar(p1)) + push(cdar(p2)) + append() + cons() + p1 = cdr(p1) + p2 = cdr(p2) + parse_p1() + parse_p2() + continue + + switch (cmp_expr(p3, p4)) + when -1 + push(car(p1)) + p1 = cdr(p1) + parse_p1() + when 1 + push(car(p2)) + p2 = cdr(p2) + parse_p2() + when 0 + combine_factors(h) + p1 = cdr(p1) + p2 = cdr(p2) + parse_p1() + parse_p2() + else + stop("internal error 2") + + # push remaining factors, if any + + while (iscons(p1)) + push(car(p1)) + p1 = cdr(p1) + + while (iscons(p2)) + push(car(p2)) + p2 = cdr(p2) + + # normalize radical factors + + # example: 2*2(-1/2) -> 2^(1/2) + + # must be done after merge because merge may produce radical + + # example: 2^(1/2-a)*2^a -> 2^(1/2) + + __normalize_radical_factors(h) + + # this hack should not be necessary, unless power returns a multiply + + #for (i = h; i < tos; i++) { + # if (car(stack[i]) == symbol(MULTIPLY)) { + # multiply_all(tos - h) + # return + # } + #} + + if (expanding) + for i in [h...tos] + if (isadd(stack[i])) + multiply_all(tos - h) + return + + # n is the number of result factors on the stack + + n = tos - h + + if (n == 1) + return + + # discard integer 1 + + if (isrational(stack[h]) && equaln(stack[h], 1)) + if (n == 2) + p7 = pop() + pop() + push(p7) + else + stack[h] = symbol(MULTIPLY) + list(n) + return + + list(n) + p7 = pop() + push_symbol(MULTIPLY) + push(p7) + cons() + +# Decompose a factor into base and power. +# +# input: car(p1) factor +# +# output: p3 factor's base +# +# p5 factor's power (possibly 1) + +parse_p1 = -> + p3 = car(p1) + p5 = if evaluatingAsFloats then one_as_double else one + if (car(p3) == symbol(POWER)) + p5 = caddr(p3) + p3 = cadr(p3) + +# Decompose a factor into base and power. +# +# input: car(p2) factor +# +# output: p4 factor's base +# +# p6 factor's power (possibly 1) + +parse_p2 = -> + p4 = car(p2) + p6 = if evaluatingAsFloats then one_as_double else one + if (car(p4) == symbol(POWER)) + p6 = caddr(p4) + p4 = cadr(p4) + +# h an integer +combine_factors = (h) -> + push(p4) + push(p5) + push(p6) + add() + power() + p7 = pop() + if (isNumericAtom(p7)) + push(stack[h]) + push(p7) + multiply_numbers() + stack[h] = pop() + else if (car(p7) == symbol(MULTIPLY)) + # power can return number * factor (i.e. -1 * i) + if (isNumericAtom(cadr(p7)) && cdddr(p7) == symbol(NIL)) + push(stack[h]) + push(cadr(p7)) + multiply_numbers() + stack[h] = pop() + push(caddr(p7)) + else + push(p7) + else + push(p7) + +gp = [ + [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,1,-6,-7,-8,-3,-4,-5,13,14,15,-16,9,10,11,-12], + [0,0,6,-1,-11,10,-2,-15,14,12,-5,4,-9,16,-8,7,-13], + [0,0,7,11,-1,-9,15,-2,-13,5,12,-3,-10,8,16,-6,-14], + [0,0,8,-10,9,-1,-14,13,-2,-4,3,12,-11,-7,6,16,-15], + [0,0,3,2,15,-14,1,11,-10,16,-8,7,13,12,-5,4,9], + [0,0,4,-15,2,13,-11,1,9,8,16,-6,14,5,12,-3,10], + [0,0,5,14,-13,2,10,-9,1,-7,6,16,15,-4,3,12,11], + [0,0,13,12,-5,4,16,-8,7,-1,-11,10,-3,-2,-15,14,-6], + [0,0,14,5,12,-3,8,16,-6,11,-1,-9,-4,15,-2,-13,-7], + [0,0,15,-4,3,12,-7,6,16,-10,9,-1,-5,-14,13,-2,-8], + [0,0,16,-9,-10,-11,-13,-14,-15,-3,-4,-5,1,-6,-7,-8,2], + [0,0,9,-16,8,-7,-12,5,-4,-2,-15,14,6,-1,-11,10,3], + [0,0,10,-8,-16,6,-5,-12,3,15,-2,-13,7,11,-1,-9,4], + [0,0,11,7,-6,-16,4,-3,-12,-14,13,-2,8,-10,9,-1,5], + [0,0,12,13,14,15,9,10,11,-6,-7,-8,-2,-3,-4,-5,-1] +] + +#if 0 + +# h an int +combine_gammas = (h) -> + n = gp[Math.floor(p1.gamma)][Math.floor(p2.gamma)] + if (n < 0) + n = -n + push(stack[h]) + negate() + stack[h] = pop() + if (n > 1) + push(_gamma[n]) + +# this is useful for example when you are just adding/removing +# factors from an already factored quantity. +# e.g. if you factored x^2 + 3x + 2 into (x+1)(x+2) +# and you want to divide by (x+1) , i.e. you multiply by (x-1)^-1, +# then there is no need to expand. + +multiply_noexpand = -> + prev_expanding = expanding + expanding = 0 + multiply() + expanding = prev_expanding + +# multiply n factors on stack + +# n an integer +multiply_all = (n) -> + i = 0 + if (n == 1) + return + if (n == 0) + push if evaluatingAsFloats then one_as_double else one + return + h = tos - n + push(stack[h]) + for i in [1...n] + push(stack[h + i]) + multiply() + stack[h] = pop() + moveTos h + 1 + +# n an integer +multiply_all_noexpand = (n) -> + prev_expanding = expanding + expanding = 0 + multiply_all(n) + expanding = prev_expanding + +#----------------------------------------------------------------------------- +# +# Symbolic division, or numeric division if doubles are found. +# +# Input: Dividend and divisor on stack +# +# Output: Quotient on stack +# +#----------------------------------------------------------------------------- + +divide = -> + if (isNumericAtom(stack[tos - 2]) && isNumericAtom(stack[tos - 1])) + divide_numbers() + else + inverse() + multiply() + +# this is different from inverse of a matrix (inv)! +inverse = -> + if (isNumericAtom(stack[tos - 1])) + invert_number() + else + push_integer(-1) + power() + +reciprocate = -> + inverse() + +negate = -> + if (isNumericAtom(stack[tos - 1])) + negate_number() + else + if evaluatingAsFloats then push_double(-1.0) else push_integer(-1) + multiply() + +negate_expand = -> + prev_expanding = expanding + expanding = 1 + negate() + expanding = prev_expanding + +negate_noexpand = -> + prev_expanding = expanding + expanding = 0 + negate() + expanding = prev_expanding + +#----------------------------------------------------------------------------- +# +# Normalize radical factors +# +# Input: stack[h] Coefficient factor, possibly 1 +# +# stack[h + 1] Second factor +# +# stack[tos - 1] Last factor +# +# Output: Reduced coefficent and normalized radicals (maybe) +# +# Example: 2*2^(-1/2) -> 2^(1/2) +# +# (power number number) is guaranteed to have the following properties: +# +# 1. Base is an integer +# +# 2. Absolute value of exponent < 1 +# +# These properties are assured by the power function. +# +#----------------------------------------------------------------------------- + +#define A p1 +#define B p2 + +#define BASE p3 +#define EXPO p4 + +#define TMP p5 + + +# h is an int +__normalize_radical_factors = (h) -> + + i = 0 + # if coeff is 1 or floating then don't bother + + if (isplusone(stack[h]) || isminusone(stack[h]) || isdouble(stack[h])) + return + + # if no radicals then don't bother + + for i in [(h + 1)...tos] + if (__is_radical_number(stack[i])) + break + + if (i == tos) + return + + # ok, try to simplify + + save() + + # numerator + + push(stack[h]) + mp_numerator() + if DEBUG_MULTIPLY then console.log("__normalize_radical_factors numerator: " + stack[tos-1]) + p1 = pop(); # p1 is A + + for i in [(h + 1)...tos] + + if (isplusone(p1) || isminusone(p1)) # p1 is A + break + + if (!__is_radical_number(stack[i])) + continue + + p3 = cadr(stack[i]); #p3 is BASE + p4 = caddr(stack[i]); #p4 is EXPO + + # exponent must be negative + + if (!isnegativenumber(p4)) #p4 is EXPO + continue + + # numerator divisible by p3 (base)? + + push(p1); # p1 is A + push(p3); #p3 is BASE + divide() + + p5 = pop(); #p5 is TMP + + if (!isinteger(p5)) #p5 is TMP + continue + + # reduce numerator + + p1 = p5; # p1 is A #p5 is TMP + + # invert radical + + push_symbol(POWER) + push(p3); #p3 is BASE + push if evaluatingAsFloats then one_as_double else one + push(p4); #p4 is EXPO + add() + list(3) + stack[i] = pop() + + # denominator + + push(stack[h]) + mp_denominator() + if DEBUG_MULTIPLY then console.log("__normalize_radical_factors denominator: " + stack[tos-1]) + p2 = pop(); # p2 is B + + for i in [(h + 1)...tos] + + if (isplusone(p2)) # p2 is B + break + + if (!__is_radical_number(stack[i])) + continue + + p3 = cadr(stack[i]); #p3 is BASE + p4 = caddr(stack[i]); #p4 is EXPO + + # exponent must be positive + + if (isnegativenumber(p4)) #p4 is EXPO + continue + + # denominator divisible by p3? #p3 is BASE + + push(p2); # p2 is B + push(p3); #p3 is BASE + divide() + + p5 = pop(); #p5 is TMP + + if (!isinteger(p5)) #p5 is TMP + continue + if DEBUG_MULTIPLY then console.log("__new radical p5: " + p5.toString()) + if DEBUG_MULTIPLY then console.log("__new radical top stack: " + stack[tos-1]) + + # reduce denominator + + p2 = p5; # p2 is B #p5 is TMP + + # invert radical + + push_symbol(POWER) + push(p3); #p3 is BASE + push(p4); #p4 is EXPO + if DEBUG_MULTIPLY then console.log("__new radical p3: " + p3.toString()) + if DEBUG_MULTIPLY then console.log("__new radical p4: " + p4.toString()) + push(one) + subtract() + + if dontCreateNewRadicalsInDenominatorWhenEvalingMultiplication + if (isinteger(p3) and !isinteger(stack[tos-1]) and isnegativenumber(stack[tos - 1])) + # bail out, + # we want to avoid going ahead with the subtraction of + # the exponents, because that would turn a perfectly good + # integer exponent in the denominator into a fractional one + # i.e. a radical. + # Note that this only prevents new radicals ending up + # in the denominator, it doesn't fix existing ones. + pop() + pop() + pop() + + push(p1); # p1 is A + push(p3); #p3 is BASE + divide() + p1 = pop() + + break + if DEBUG_MULTIPLY then console.log("__new radical exponent: " + stack[tos-1]) + + list(3) + stack[i] = pop() + + # reconstitute the coefficient + + push(p1); # p1 is A + push(p2); # p2 is B + divide() + stack[h] = pop() + + restore() + +# don't include i +# p is a U +# TODO should this be in is.coffee ? +__is_radical_number = (p) -> + # don't use i + car(p) == symbol(POWER) && isNumericAtom(cadr(p)) && isfraction(caddr(p)) && !isminusone(cadr(p)) + +#----------------------------------------------------------------------------- +# +# > a*hilbert(2) +# ((a,1/2*a),(1/2*a,1/3*a)) +# +# Note that "a" is presumed to be a scalar. Is this correct? +# +# Yes, because "*" has no meaning if "a" is a tensor. +# To multiply tensors, "dot" or "outer" should be used. +# +# > dot(a,hilbert(2)) +# dot(a,((1,1/2),(1/2,1/3))) +# +# In this case "a" could be a scalar or tensor so the result is not +# expanded. +# +#----------------------------------------------------------------------------- + + diff --git a/node_modules/algebrite/sources/nroots.coffee b/node_modules/algebrite/sources/nroots.coffee new file mode 100644 index 0000000..768e0a4 --- /dev/null +++ b/node_modules/algebrite/sources/nroots.coffee @@ -0,0 +1,260 @@ +# find the roots of a polynomial numerically + + + +NROOTS_YMAX = 101 +NROOTS_DELTA = 1.0e-6 +NROOTS_EPSILON = 1.0e-9 +NROOTS_ABS = (z) -> + return Math.sqrt((z).r * (z).r + (z).i * (z).i) + +# random between -2 and 2 +theRandom = 0.0 + +NROOTS_RANDOM = -> + #theRandom += 0.2 + #return theRandom + return 4.0 * Math.random() - 2.0 + +class numericRootOfPolynomial + r: 0.0 + i: 0.0 + +nroots_a = new numericRootOfPolynomial() +nroots_b = new numericRootOfPolynomial() +nroots_x = new numericRootOfPolynomial() +nroots_y = new numericRootOfPolynomial() +nroots_fa = new numericRootOfPolynomial() +nroots_fb = new numericRootOfPolynomial() +nroots_dx = new numericRootOfPolynomial() +nroots_df = new numericRootOfPolynomial() +nroots_c = [] +for initNRoots in [0...NROOTS_YMAX] + nroots_c[initNRoots] = new numericRootOfPolynomial() + +Eval_nroots = -> + h = 0 + i = 0 + k = 0 + n = 0 + + push(cadr(p1)) + Eval() + + push(caddr(p1)) + Eval() + p2 = pop() + if (p2 == symbol(NIL)) + guess() + else + push(p2) + + p2 = pop() + p1 = pop() + + if (!ispolyexpandedform(p1, p2)) + stop("nroots: polynomial?") + + # mark the stack + + h = tos + + # get the coefficients + + n = coeff(p2, p1) + if (n > NROOTS_YMAX) + stop("nroots: degree?") + + # convert the coefficients to real and imaginary doubles + + for i in [0...n] + push(stack[h + i]) + real() + yyfloat() + Eval() + p1 = pop() + push(stack[h + i]) + imag() + yyfloat() + Eval() + p2 = pop() + if (!isdouble(p1) || !isdouble(p2)) + stop("nroots: coefficients?") + nroots_c[i].r = p1.d + nroots_c[i].i = p2.d + + # pop the coefficients + + moveTos h + + # n is the number of coefficients, n = deg(p) + 1 + + monic(n) + + for k in [n...1] by -1 + findroot(k) + if (Math.abs(nroots_a.r) < NROOTS_DELTA) + nroots_a.r = 0.0 + if (Math.abs(nroots_a.i) < NROOTS_DELTA) + nroots_a.i = 0.0 + push_double(nroots_a.r) + push_double(nroots_a.i) + push(imaginaryunit) + multiply() + add() + NROOTS_divpoly(k) + + # now make n equal to the number of roots + + n = tos - h + + if (n > 1) + sort_stack(n) + p1 = alloc_tensor(n) + p1.tensor.ndim = 1 + p1.tensor.dim[0] = n + for i in [0...n] + p1.tensor.elem[i] = stack[h + i] + moveTos h + push(p1) + +# divide the polynomial by its leading coefficient + +monic = (n) -> + k = 0 + t = 0.0 + nroots_y.r = nroots_c[n - 1].r + nroots_y.i = nroots_c[n - 1].i + t = nroots_y.r * nroots_y.r + nroots_y.i * nroots_y.i + for k in [0...(n - 1)] + nroots_c[k].r = (nroots_c[k].r * nroots_y.r + nroots_c[k].i * nroots_y.i) / t + nroots_c[k].i = (nroots_c[k].i * nroots_y.r - nroots_c[k].r * nroots_y.i) / t + nroots_c[n - 1].r = 1.0 + nroots_c[n - 1].i = 0.0 + +# uses the secant method + +findroot = (n) -> + j = 0 + k = 0 + t = 0.0 + + if (NROOTS_ABS(nroots_c[0]) < NROOTS_DELTA) + nroots_a.r = 0.0 + nroots_a.i = 0.0 + return + + for j in [0...100] + + nroots_a.r = NROOTS_RANDOM() + nroots_a.i = NROOTS_RANDOM() + + compute_fa(n) + + nroots_b.r = nroots_a.r + nroots_b.i = nroots_a.i + + nroots_fb.r = nroots_fa.r + nroots_fb.i = nroots_fa.i + + nroots_a.r = NROOTS_RANDOM() + nroots_a.i = NROOTS_RANDOM() + + for k in [0...1000] + + compute_fa(n) + + nrabs = NROOTS_ABS(nroots_fa) + if DEBUG then console.log "nrabs: " + nrabs + if ( nrabs < NROOTS_EPSILON) + return + + if (NROOTS_ABS(nroots_fa) < NROOTS_ABS(nroots_fb)) + nroots_x.r = nroots_a.r + nroots_x.i = nroots_a.i + + nroots_a.r = nroots_b.r + nroots_a.i = nroots_b.i + + nroots_b.r = nroots_x.r + nroots_b.i = nroots_x.i + + nroots_x.r = nroots_fa.r + nroots_x.i = nroots_fa.i + + nroots_fa.r = nroots_fb.r + nroots_fa.i = nroots_fb.i + + nroots_fb.r = nroots_x.r + nroots_fb.i = nroots_x.i + + # dx = nroots_b - nroots_a + + nroots_dx.r = nroots_b.r - nroots_a.r + nroots_dx.i = nroots_b.i - nroots_a.i + + # df = fb - fa + + nroots_df.r = nroots_fb.r - nroots_fa.r + nroots_df.i = nroots_fb.i - nroots_fa.i + + # y = dx / df + + t = nroots_df.r * nroots_df.r + nroots_df.i * nroots_df.i + + if (t == 0.0) + break + + nroots_y.r = (nroots_dx.r * nroots_df.r + nroots_dx.i * nroots_df.i) / t + nroots_y.i = (nroots_dx.i * nroots_df.r - nroots_dx.r * nroots_df.i) / t + + # a = b - y * fb + + nroots_a.r = nroots_b.r - (nroots_y.r * nroots_fb.r - nroots_y.i * nroots_fb.i) + nroots_a.i = nroots_b.i - (nroots_y.r * nroots_fb.i + nroots_y.i * nroots_fb.r) + + stop("nroots: convergence error") + +compute_fa = (n) -> + k = 0 + t = 0.0 + + # x = a + + nroots_x.r = nroots_a.r + nroots_x.i = nroots_a.i + + # fa = c0 + c1 * x + + nroots_fa.r = nroots_c[0].r + nroots_c[1].r * nroots_x.r - nroots_c[1].i * nroots_x.i + nroots_fa.i = nroots_c[0].i + nroots_c[1].r * nroots_x.i + nroots_c[1].i * nroots_x.r + + for k in [2...n] + + # x = a * x + + t = nroots_a.r * nroots_x.r - nroots_a.i * nroots_x.i + nroots_x.i = nroots_a.r * nroots_x.i + nroots_a.i * nroots_x.r + nroots_x.r = t + + # fa += c[k] * x + + nroots_fa.r += nroots_c[k].r * nroots_x.r - nroots_c[k].i * nroots_x.i + nroots_fa.i += nroots_c[k].r * nroots_x.i + nroots_c[k].i * nroots_x.r + +# divide the polynomial by x - a + +NROOTS_divpoly = (n) -> + k = 0 + for k in [(n - 1)...0] + nroots_c[k - 1].r += nroots_c[k].r * nroots_a.r - nroots_c[k].i * nroots_a.i + nroots_c[k - 1].i += nroots_c[k].i * nroots_a.r + nroots_c[k].r * nroots_a.i + + if (NROOTS_ABS(nroots_c[0]) > NROOTS_DELTA) + stop("nroots: residual error") + + for k in [0...(n - 1)] + nroots_c[k].r = nroots_c[k + 1].r + nroots_c[k].i = nroots_c[k + 1].i + + diff --git a/node_modules/algebrite/sources/numerator.coffee b/node_modules/algebrite/sources/numerator.coffee new file mode 100644 index 0000000..93ab3f5 --- /dev/null +++ b/node_modules/algebrite/sources/numerator.coffee @@ -0,0 +1,38 @@ + + +Eval_numerator = -> + push(cadr(p1)) + Eval() + numerator() + +numerator = -> + h = 0 + + theArgument = pop() + + + if (car(theArgument) == symbol(ADD)) + push(theArgument) + #console.trace "rationalising " + rationalize() + theArgument = pop() + #console.log "rationalised: " + theArgument + + if (car(theArgument) == symbol(MULTIPLY) and !isplusone(car(cdr(theArgument)))) + h = tos + theArgument = cdr(theArgument) + #console.log "theArgument inside multiply: " + theArgument + #console.log "first term: " + car(theArgument) + + while (iscons(theArgument)) + push(car(theArgument)) + numerator() + theArgument = cdr(theArgument) + multiply_all(tos - h) + else if (isrational(theArgument)) + push(theArgument) + mp_numerator() + else if (car(theArgument) == symbol(POWER) && isnegativeterm(caddr(theArgument))) + push(one) + else + push(theArgument) diff --git a/node_modules/algebrite/sources/outer.coffee b/node_modules/algebrite/sources/outer.coffee new file mode 100644 index 0000000..71be3a1 --- /dev/null +++ b/node_modules/algebrite/sources/outer.coffee @@ -0,0 +1,70 @@ +# Outer product of tensors + + + +Eval_outer = -> + p1 = cdr(p1) + push(car(p1)) + Eval() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + Eval() + outer() + p1 = cdr(p1) + +outer = -> + save() + p2 = pop() + p1 = pop() + if (istensor(p1) && istensor(p2)) + yyouter() + else + push(p1) + push(p2) + if (istensor(p1)) + tensor_times_scalar() + else if (istensor(p2)) + scalar_times_tensor() + else + multiply() + restore() + +yyouter = -> + i = 0 + j = 0 + k = 0 + ndim = 0 + nelem = 0 + + ndim = p1.tensor.ndim + p2.tensor.ndim + + if (ndim > MAXDIM) + stop("outer: rank of result exceeds maximum") + + nelem = p1.tensor.nelem * p2.tensor.nelem + + p3 = alloc_tensor(nelem) + + p3.tensor.ndim = ndim + + for i in [0...p1.tensor.ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + + j = i + + for i in [0...p2.tensor.ndim] + p3.tensor.dim[j + i] = p2.tensor.dim[i] + + k = 0 + + for i in [0...p1.tensor.nelem] + for j in [0...p2.tensor.nelem] + push(p1.tensor.elem[i]) + push(p2.tensor.elem[j]) + multiply() + p3.tensor.elem[k++] = pop() + + push(p3) + + diff --git a/node_modules/algebrite/sources/partition.coffee b/node_modules/algebrite/sources/partition.coffee new file mode 100644 index 0000000..ccbcad3 --- /dev/null +++ b/node_modules/algebrite/sources/partition.coffee @@ -0,0 +1,48 @@ +### + Partition a term + + Input stack: + + term (factor or product of factors) + + free variable + + Output stack: + + constant expression + + variable expression +### + + + +partition = -> + save() + + p2 = pop() + p1 = pop() + + push_integer(1) + + p3 = pop() + p4 = p3 + + p1 = cdr(p1) + + while (iscons(p1)) + if (Find(car(p1), p2)) + push(p4) + push(car(p1)) + multiply() + p4 = pop() + else + push(p3) + push(car(p1)) + multiply() + p3 = pop() + p1 = cdr(p1) + + push(p3) + push(p4) + + restore() diff --git a/node_modules/algebrite/sources/pattern.coffee b/node_modules/algebrite/sources/pattern.coffee new file mode 100644 index 0000000..23e4969 --- /dev/null +++ b/node_modules/algebrite/sources/pattern.coffee @@ -0,0 +1,91 @@ +### + Add a pattern i.e. a substitution rule. + Substitution rule needs a template as first argument + and what to transform it to as second argument. + Optional third argument is a boolean test which + adds conditions to when the rule is applied. +### + +# same as Eval_pattern but only leaves +# NIL on stack at return, hence gives no +# printout +Eval_silentpattern = -> + Eval_pattern() + pop() + push_symbol(NIL) + +Eval_pattern = -> + # check that the parameters are allright + if !iscons(cdr(p1)) + stop("pattern needs at least a template and a transformed version") + firstArgument = car(cdr(p1)) + secondArgument = car(cdr(cdr(p1))) + if secondArgument == symbol(NIL) + stop("pattern needs at least a template and a transformed version") + # third argument is optional and contains the tests + if !iscons(cdr(cdr(p1))) + thirdArgument = symbol(NIL) + else + thirdArgument = car(cdr(cdr(cdr(p1)))) + + if equal(firstArgument, secondArgument) + stop("recursive pattern") + + # console.log "Eval_pattern of " + cdr(p1) + # this is likely to create garbage collection + # problems in the C version as it's an + # untracked reference + stringKey = "template: " + print_list(firstArgument) + stringKey += " tests: " + print_list(thirdArgument) + if DEBUG then console.log "pattern stringkey: " + stringKey + + patternPosition = userSimplificationsInStringForm.indexOf stringKey + # if pattern is not there yet, add it, otherwise replace it + if patternPosition == -1 + #console.log "adding pattern because it doesn't exist: " + cdr(p1) + userSimplificationsInStringForm.push(stringKey) + userSimplificationsInListForm.push(cdr(p1)) + else + if DEBUG then console.log "pattern already exists, replacing. " + cdr(p1) + userSimplificationsInStringForm[patternPosition] = stringKey + userSimplificationsInListForm[patternPosition] = cdr(p1) + + # return the pattern node itself so we can + # give some printout feedback + push_symbol(PATTERN) + push cdr(p1) + list(2) + + +### + Clear all patterns +### + + +do_clearPatterns = -> + userSimplificationsInListForm = [] + userSimplificationsInStringForm = [] + +Eval_clearpatterns = -> + # this is likely to create garbage collection + # problems in the C version as it's an + # untracked reference + do_clearPatterns() + + # return nothing + push_symbol(NIL) + + +Eval_patternsinfo = -> + patternsinfoToBePrinted = patternsinfo() + + if patternsinfoToBePrinted != "" + push new_string(patternsinfoToBePrinted) + else + push_symbol(NIL) + +patternsinfo = -> + patternsinfoToBePrinted = "" + for i in userSimplificationsInListForm + patternsinfoToBePrinted += userSimplificationsInListForm + "\n" + return patternsinfoToBePrinted diff --git a/node_modules/algebrite/sources/polar.coffee b/node_modules/algebrite/sources/polar.coffee new file mode 100644 index 0000000..95b86ff --- /dev/null +++ b/node_modules/algebrite/sources/polar.coffee @@ -0,0 +1,37 @@ +### +Convert complex z to polar form + + Input: push z + + Output: Result on stack + + polar(z) = abs(z) * exp(i * arg(z)) +### + + + +Eval_polar = -> + push(cadr(p1)) + Eval() + polar() + +polar = -> + # there are points where we turn polar + # representations into rect, we set a "stack flag" + # here to avoid that, so we don't undo the + # work that we are trying to do. + evaluatingPolar++ + save() + p1 = pop() + push(p1) + abs() + push(imaginaryunit) + push(p1) + arg() + multiply() + exponential() + multiply() + evaluatingPolar-- + restore() + + diff --git a/node_modules/algebrite/sources/pollard.coffee b/node_modules/algebrite/sources/pollard.coffee new file mode 100644 index 0000000..3a5f63e --- /dev/null +++ b/node_modules/algebrite/sources/pollard.coffee @@ -0,0 +1,175 @@ +# Factor using the Pollard rho method + + + +n_factor_number = 0 + +factor_number = -> + h = 0 + + save() + + p1 = pop() + + # 0 or 1? + + if (equaln(p1, 0) || equaln(p1, 1) || equaln(p1, -1)) + push(p1) + restore() + return + + n_factor_number = p1.q.a + + h = tos + + factor_a() + + if (tos - h > 1) + list(tos - h) + push_symbol(MULTIPLY) + swap() + cons() + + restore() + +# factor using table look-up, then switch to rho method if necessary + +# From TAOCP Vol. 2 by Knuth, p. 380 (Algorithm A) + +factor_a = -> + k = 0 + + if (n_factor_number.isNegative()) + n_factor_number = setSignTo(n_factor_number, 1) + push_integer(-1) + + for k in [0...10000] + + try_kth_prime(k) + + # if n_factor_number is 1 then we're done + + if (n_factor_number.compare(1) == 0) + return + + factor_b() + +try_kth_prime = (k) -> + count = 0 + + d = mint(primetab[k]) + + count = 0 + + while (1) + + # if n_factor_number is 1 then we're done + + if (n_factor_number.compare(1) == 0) + if (count) + push_factor(d, count) + return + + [q,r] = mdivrem(n_factor_number, d) + + # continue looping while remainder is zero + + if (r.isZero()) + count++ + n_factor_number = q + else + break + + if (count) + push_factor(d, count) + + # q = n_factor_number/d, hence if q < d then + # n_factor_number < d^2 so n_factor_number is prime + + if (mcmp(q, d) == -1) + push_factor(n_factor_number, 1) + n_factor_number = mint(1) + + +# From TAOCP Vol. 2 by Knuth, p. 385 (Algorithm B) + +factor_b = -> + k = 0 + l = 0 + + bigint_one = mint(1) + x = mint(5) + xprime = mint(2) + + k = 1 + l = 1 + + while (1) + + if (mprime(n_factor_number)) + push_factor(n_factor_number, 1) + return 0 + + while (1) + + if (esc_flag) + stop("esc") + + # g = gcd(x' - x, n_factor_number) + + t = msub(xprime, x) + t = setSignTo(t,1) + g = mgcd(t, n_factor_number) + + if (MEQUAL(g, 1)) + if (--k == 0) + xprime = x + l *= 2 + k = l + + # x = (x ^ 2 + 1) mod n_factor_number + + t = mmul(x, x) + x = madd(t, bigint_one) + t = mmod(x, n_factor_number) + x = t + + continue + + push_factor(g, 1) + + if (mcmp(g, n_factor_number) == 0) + return -1 + + # n_factor_number = n_factor_number / g + + t = mdiv(n_factor_number, g) + n_factor_number = t + + # x = x mod n_factor_number + + t = mmod(x, n_factor_number) + x = t + + # xprime = xprime mod n_factor_number + + t = mmod(xprime, n_factor_number) + xprime = t + + break + +push_factor = (d, count) -> + p1 = new U() + p1.k = NUM + p1.q.a = d + p1.q.b = mint(1) + push(p1) + if (count > 1) + push_symbol(POWER) + swap() + p1 = new U() + p1.k = NUM + p1.q.a = mint(count) + p1.q.b = mint(1) + push(p1) + list(3) diff --git a/node_modules/algebrite/sources/power.coffee b/node_modules/algebrite/sources/power.coffee new file mode 100644 index 0000000..4471025 --- /dev/null +++ b/node_modules/algebrite/sources/power.coffee @@ -0,0 +1,566 @@ +### Power function + + Input: push Base + + push Exponent + + Output: Result on stack +### + +DEBUG_POWER = false + +Eval_power = -> + if DEBUG_POWER then debugger + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + power() + +power = -> + save() + yypower() + restore() + +yypower = -> + if DEBUG_POWER then debugger + n = 0 + + p2 = pop() # exponent + p1 = pop() # base + + inputExp = p2 + inputBase = p1 + #debugger + + if DEBUG_POWER + console.log("POWER: " + p1 + " ^ " + p2) + + # first, some very basic simplifications right away + + # 1 ^ a -> 1 + # a ^ 0 -> 1 + if (equal(p1, one) || isZeroAtomOrTensor(p2)) + if evaluatingAsFloats then push_double(1.0) else push(one) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # a ^ 1 -> a + if (equal(p2, one)) + push(p1) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # -1 ^ -1 -> -1 + if (isminusone(p1) and isminusone(p2)) + if evaluatingAsFloats then push_double(1.0) else push(one) + negate() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # -1 ^ 1/2 -> i + if (isminusone(p1) and (isoneovertwo(p2))) + push(imaginaryunit) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # -1 ^ -1/2 -> -i + if (isminusone(p1) and isminusoneovertwo(p2)) + push(imaginaryunit) + negate() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # -1 ^ rational + if (isminusone(p1) and !isdouble(p1) and isrational(p2) and !isinteger(p2) and ispositivenumber(p2) and !evaluatingAsFloats) + if DEBUG_POWER then console.log(" power: -1 ^ rational") + if DEBUG_POWER then console.log " trick: p2.q.a , p2.q.b " + p2.q.a + " , " + p2.q.b + if p2.q.a < p2.q.b + push_symbol(POWER) + push(p1) + push(p2) + list(3) + else + push_symbol(MULTIPLY) + + push(p1) + + push_symbol(POWER) + push(p1) + push_rational(p2.q.a.mod(p2.q.b), p2.q.b) + list(3) + + list(3) + if DEBUG_POWER then console.log " trick applied : " + stack[tos-1] + + # evaluates clock form into + # rectangular form. This seems to give + # slightly better form to some test results. + rect() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + + # both base and exponent are rational numbers? + + if (isrational(p1) && isrational(p2)) + if DEBUG_POWER then console.log(" power: isrational(p1) && isrational(p2)") + push(p1) + push(p2) + qpow() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # both base and exponent are either rational or double? + if (isNumericAtom(p1) && isNumericAtom(p2)) + if DEBUG_POWER then console.log " power: both base and exponent are either rational or double " + if DEBUG_POWER then console.log("POWER - isNumericAtom(p1) && isNumericAtom(p2)") + push(p1) + push(p2) + dpow() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + if (istensor(p1)) + if DEBUG_POWER then console.log " power: istensor(p1) " + power_tensor() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # if we only assume variables to be real, then |a|^2 = a^2 + # (if x is complex this doesn't hold e.g. i, which makes 1 and -1 + if (car(p1) == symbol(ABS) && iseveninteger(p2) and !isZeroAtomOrTensor(get_binding(symbol(ASSUME_REAL_VARIABLES)))) + if DEBUG_POWER then console.log " power: even power of absolute of real value " + push(cadr(p1)) + push(p2) + power() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # e^log(...) + if (p1 == symbol(E) && car(p2) == symbol(LOG)) + push(cadr(p2)) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # e^some_float + if (p1 == symbol(E) && isdouble(p2)) + if DEBUG_POWER then console.log " power: p1 == symbol(E) && isdouble(p2) " + push_double(Math.exp(p2.d)) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # complex number in exponential form, get it to rectangular + # but only if we are not in the process of calculating a polar form, + # otherwise we'd just undo the work we want to do + if (p1 == symbol(E) && Find(p2, imaginaryunit) != 0 and Find(p2, symbol(PI))!= 0 and !evaluatingPolar) + push_symbol(POWER) + push(p1) + push(p2) + list(3) + if DEBUG_POWER then console.log " power: turning complex exponential to rect: " + stack[tos-1] + rect() + + hopefullySimplified = pop(); # put new (hopefully simplified expr) in p2 + if Find(hopefullySimplified, symbol(PI)) == 0 + if DEBUG_POWER then console.log " power: turned complex exponential to rect: " + hopefullySimplified + push hopefullySimplified + return + + + # (a * b) ^ c -> (a ^ c) * (b ^ c) + # note that we can't in general do this, for example + # sqrt(x*y) != x^(1/2) y^(1/2) (counterexample" x = -1 and y = -1) + # BUT we can carve-out here some cases where this + # transformation is correct + + if (car(p1) == symbol(MULTIPLY) && isinteger(p2)) + if DEBUG_POWER then console.log " power: (a * b) ^ c -> (a ^ c) * (b ^ c) " + p1 = cdr(p1) + push(car(p1)) + push(p2) + power() + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + power() + multiply() + p1 = cdr(p1) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # (a ^ b) ^ c -> a ^ (b * c) + # note that we can't in general do this, for example + # sqrt(x^y) != x^(1/2 y) (counterexample x = -1) + # BUT we can carve-out here some cases where this + # transformation is correct + + + # simple numeric check to see if a is a number > 0 + is_a_moreThanZero = false + if isNumericAtom(cadr(p1)) + is_a_moreThanZero = sign(compare_numbers(cadr(p1), zero)) + + if (car(p1) == symbol(POWER) && ( + isinteger(p2) or # when c is an integer + is_a_moreThanZero # when a is >= 0 + )) + push(cadr(p1)) + push(caddr(p1)) + push(p2) + multiply() + power() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + b_isEven_and_c_isItsInverse = false + if iseveninteger(caddr(p1)) + push caddr(p1) + push p2 + multiply() + + isThisOne = pop() + if isone(isThisOne) + b_isEven_and_c_isItsInverse = true + + if (car(p1) == symbol(POWER) && b_isEven_and_c_isItsInverse) + if DEBUG_POWER then console.log " power: car(p1) == symbol(POWER) && b_isEven_and_c_isItsInverse " + push(cadr(p1)) + abs() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + + # when expanding, + # (a + b) ^ n -> (a + b) * (a + b) ... + + if (expanding && isadd(p1) && isNumericAtom(p2)) + push(p2) + n = pop_integer() + if (n > 1 && !isNaN(n)) + if DEBUG_POWER then console.log " power: expanding && isadd(p1) && isNumericAtom(p2) " + power_sum(n) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # sin(x) ^ 2n -> (1 - cos(x) ^ 2) ^ n + + if (trigmode == 1 && car(p1) == symbol(SIN) && iseveninteger(p2)) + if DEBUG_POWER then console.log " power: trigmode == 1 && car(p1) == symbol(SIN) && iseveninteger(p2) " + push_integer(1) + push(cadr(p1)) + cosine() + push_integer(2) + power() + subtract() + push(p2) + push_rational(1, 2) + multiply() + power() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # cos(x) ^ 2n -> (1 - sin(x) ^ 2) ^ n + + if (trigmode == 2 && car(p1) == symbol(COS) && iseveninteger(p2)) + if DEBUG_POWER then console.log " power: trigmode == 2 && car(p1) == symbol(COS) && iseveninteger(p2) " + push_integer(1) + push(cadr(p1)) + sine() + push_integer(2) + power() + subtract() + push(p2) + push_rational(1, 2) + multiply() + power() + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + + # complex number? (just number, not expression) + + + if (iscomplexnumber(p1)) + + if DEBUG_POWER then console.log " power - handling the case (a + ib) ^ n" + # integer power? + + # n will be negative here, positive n already handled + + if (isinteger(p2)) + + # / \ n + # -n | a - ib | + # (a + ib) = | -------- | + # | 2 2 | + # \ a + b / + + push(p1) + conjugate() + p3 = pop() + push(p3) + + # gets the denominator + push(p3) + push(p1) + multiply() + + divide() + + if !isone(p2) + push(p2) + negate() + power() + + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # noninteger or floating power? + + if (isNumericAtom(p2)) + push(p1) + abs() + push(p2) + power() + push_integer(-1) + push(p1) + arg() + push(p2) + multiply() + if evaluatingAsFloats or (iscomplexnumberdouble(p1) and isdouble(p2)) + # remember that the "double" type is + # toxic, i.e. it propagates, so we do + # need to evaluate PI to its actual double + # value + push_double(Math.PI) + else + #console.log("power pushing PI when p1 is: " + p1 + " and p2 is:" + p2) + push(symbol(PI)) + divide() + power() + multiply() + + # if we calculate the power making use of arctan: + # * it prevents nested radicals from being simplified + # * results become really hard to manipulate afterwards + # * we can't go back to other forms. + # so leave the power as it is. + if avoidCalculatingPowersIntoArctans + if Find(stack[tos-1], symbol(ARCTAN)) + pop() + push_symbol(POWER) + push(p1) + push(p2) + list(3) + + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + return + + # + #push(p1) + #abs() + #push(p2) + #power() + #push(symbol(E)) + #push(p1) + #arg() + #push(p2) + #multiply() + #push(imaginaryunit) + #multiply() + #power() + #multiply() + # + + if (simplify_polar()) + if DEBUG_POWER then console.log " power: using simplify_polar" + return + + + + if DEBUG_POWER then console.log " power: nothing can be done " + push_symbol(POWER) + push(p1) + push(p2) + list(3) + if DEBUG_POWER then console.log " power of " + inputBase + " ^ " + inputExp + ": " + stack[tos-1] + +#----------------------------------------------------------------------------- +# +# Compute the power of a sum +# +# Input: p1 sum +# +# n exponent +# +# Output: Result on stack +# +# Note: +# +# Uses the multinomial series (see Math World) +# +# n n! n1 n2 nk +# (a1 + a2 + ... + ak) = sum (--------------- a1 a2 ... ak ) +# n1! n2! ... nk! +# +# The sum is over all n1 ... nk such that n1 + n2 + ... + nk = n. +# +#----------------------------------------------------------------------------- + +# first index is the term number 0..k-1, second index is the exponent 0..n + +#define A(i, j) frame[(i) * (n + 1) + (j)] + +power_sum = (n) -> + a = [] + i = 0 + j = 0 + k = 0 + + # number of terms in the sum + + k = length(p1) - 1 + + # local frame + + push_frame(k * (n + 1)) + + # array of powers + + p1 = cdr(p1) + for i in [0...k] + for j in [0..n] + push(car(p1)) + push_integer(j) + power() + stack[frame + (i) * (n + 1) + (j)] = pop() + p1 = cdr(p1) + + push_integer(n) + factorial() + p1 = pop() + + for i in [0...k] + a[i] = 0 + + push(zero) + + multinomial_sum(k, n, a, 0, n) + + pop_frame(k * (n + 1)) + +#----------------------------------------------------------------------------- +# +# Compute multinomial sum +# +# Input: k number of factors +# +# n overall exponent +# +# a partition array +# +# i partition array index +# +# m partition remainder +# +# p1 n! +# +# A factor array +# +# Output: Result on stack +# +# Note: +# +# Uses recursive descent to fill the partition array. +# +#----------------------------------------------------------------------------- + +#int k, int n, int *a, int i, int m +multinomial_sum = (k,n,a,i,m) -> + j = 0 + + if (i < k - 1) + for j in [0..m] + a[i] = j + multinomial_sum(k, n, a, i + 1, m - j) + return + + a[i] = m + + # coefficient + + push(p1) + + for j in [0...k] + push_integer(a[j]) + factorial() + divide() + + # factors + + for j in [0...k] + push(stack[frame + (j) * (n + 1) + a[j]]) + multiply() + + add() + +# exp(n/2 i pi) ? + +# p2 is the exponent expression + +# clobbers p3 + +simplify_polar = -> + n = 0 + + n = isquarterturn(p2) + + switch(n) + when 0 + doNothing = 1 + when 1 + push_integer(1) + return 1 + when 2 + push_integer(-1) + return 1 + when 3 + push(imaginaryunit) + return 1 + when 4 + push(imaginaryunit) + negate() + return 1 + + if (car(p2) == symbol(ADD)) + p3 = cdr(p2) + while (iscons(p3)) + n = isquarterturn(car(p3)) + if (n) + break + p3 = cdr(p3) + switch (n) + when 0 + return 0 + when 1 + push_integer(1) + when 2 + push_integer(-1) + when 3 + push(imaginaryunit) + when 4 + push(imaginaryunit) + negate() + push(p2) + push(car(p3)) + subtract() + exponential() + multiply() + return 1 + + return 0 + + + diff --git a/node_modules/algebrite/sources/prime.coffee b/node_modules/algebrite/sources/prime.coffee new file mode 100644 index 0000000..7da9a0b --- /dev/null +++ b/node_modules/algebrite/sources/prime.coffee @@ -0,0 +1,22 @@ +#----------------------------------------------------------------------------- +# +# Look up the nth prime +# +# Input: n on stack (0 < n < 10001) +# +# Output: nth prime on stack +# +#----------------------------------------------------------------------------- + +Eval_prime = -> + push(cadr(p1)) + Eval() + prime() + +prime = -> + n = 0 + n = pop_integer() + if (n < 1 || n > MAXPRIMETAB) + stop("prime: Argument out of range.") + n = primetab[n - 1] + push_integer(n) diff --git a/node_modules/algebrite/sources/print.coffee b/node_modules/algebrite/sources/print.coffee new file mode 100644 index 0000000..877e000 --- /dev/null +++ b/node_modules/algebrite/sources/print.coffee @@ -0,0 +1,1492 @@ +power_str = "^" +codeGen = false + +# this is only invoked when user invokes +# "print" explicitly +Eval_print = -> + stringsEmittedByUserPrintouts += _print(cdr(p1), printMode) + push(symbol(NIL)); + +# this is only invoked when user invokes +# "print2dascii" explicitly +Eval_print2dascii = -> + stringsEmittedByUserPrintouts +=_print(cdr(p1),PRINTMODE_2DASCII) + push(symbol(NIL)); + +# this is only invoked when user invokes +# "printcomputer" explicitly +Eval_printcomputer = -> + stringsEmittedByUserPrintouts +=_print(cdr(p1),PRINTMODE_COMPUTER) + push(symbol(NIL)); + +# this is only invoked when user invokes +# "printlatex" explicitly +Eval_printlatex = -> + stringsEmittedByUserPrintouts +=_print(cdr(p1),PRINTMODE_LATEX) + push(symbol(NIL)); + +# this is only invoked when user invokes +# "printhuman" explicitly +Eval_printhuman = -> + # test flag needs to be suspended + # because otherwise "printcomputer" mode + # will happen. + original_test_flag = test_flag + test_flag = 0 + stringsEmittedByUserPrintouts +=_print(cdr(p1),PRINTMODE_HUMAN) + test_flag = original_test_flag + push(symbol(NIL)); + +# this is only invoked when user invokes +# "printlist" explicitly +Eval_printlist = -> + beenPrinted = _print(cdr(p1),PRINTMODE_LIST) + stringsEmittedByUserPrintouts += beenPrinted + push(symbol(NIL)) + + +_print = (p, passedPrintMode) -> + accumulator = "" + + while (iscons(p)) + + push(car(p)); + Eval(); + p2 = pop(); + + # display single symbol as "symbol = result" + + # but don't display "symbol = symbol" + + ### + if (issymbol(car(p)) && car(p) != p2) + push_symbol(SETQ); + push(car(p)); + push(p2); + list(3); + p2 = pop(); + ### + + origPrintMode = printMode + if passedPrintMode == PRINTMODE_COMPUTER + printMode = PRINTMODE_COMPUTER + accumulator = printline(p2); + rememberPrint(accumulator, LAST_FULL_PRINT) + else if passedPrintMode == PRINTMODE_HUMAN + printMode = PRINTMODE_HUMAN + accumulator = printline(p2); + rememberPrint(accumulator, LAST_PLAIN_PRINT) + else if passedPrintMode == PRINTMODE_2DASCII + printMode = PRINTMODE_2DASCII + accumulator = print2dascii(p2); + rememberPrint(accumulator, LAST_2DASCII_PRINT) + else if passedPrintMode == PRINTMODE_LATEX + printMode = PRINTMODE_LATEX + accumulator = printline(p2); + rememberPrint(accumulator, LAST_LATEX_PRINT) + else if passedPrintMode == PRINTMODE_LIST + printMode = PRINTMODE_LIST + accumulator = print_list(p2); + rememberPrint(accumulator, LAST_LIST_PRINT) + printMode = origPrintMode + + + p = cdr(p); + + if DEBUG then console.log "emttedString from display: " + stringsEmittedByUserPrintouts + return accumulator + +rememberPrint = (theString, theTypeOfPrint) -> + scan('"' + theString + '"') + parsedString = pop() + set_binding(symbol(theTypeOfPrint), parsedString) + +print_str = (s) -> + if DEBUG then console.log "emttedString from print_str: " + stringsEmittedByUserPrintouts + return s + +print_char = (c) -> + return c + +collectLatexStringFromReturnValue = (p) -> + origPrintMode = printMode + printMode = PRINTMODE_LATEX + originalCodeGen = codeGen + codeGen = false + returnedString = print_expr(p) + # some variables might contain underscores, escape those + returnedString = returnedString.replace(/_/g, "\\_"); + printMode = origPrintMode + codeGen = originalCodeGen + if DEBUG then console.log "emttedString from collectLatexStringFromReturnValue: " + stringsEmittedByUserPrintouts + return returnedString + +printline = (p) -> + accumulator = "" + accumulator += print_expr(p) + return accumulator + + +print_base_of_denom = (p1) -> + accumulator = "" + if (isfraction(p1) || car(p1) == symbol(ADD) || car(p1) == symbol(MULTIPLY) || car(p1) == symbol(POWER) || lessp(p1, zero)) # p1 is BASE + accumulator += print_char('(') + accumulator += print_expr(p1); # p1 is BASE + accumulator += print_char(')') + else + accumulator += print_expr(p1); # p1 is BASE + return accumulator + +print_expo_of_denom = (p2) -> + accumulator = "" + if (isfraction(p2) || car(p2) == symbol(ADD) || car(p2) == symbol(MULTIPLY) || car(p2) == symbol(POWER)) # p2 is EXPO + accumulator += print_char('(') + accumulator += print_expr(p2); # p2 is EXPO + accumulator += print_char(')') + else + accumulator += print_expr(p2); # p2 is EXPO + return accumulator + +# prints stuff after the divide symbol "/" + +# d is the number of denominators + +#define BASE p1 +#define EXPO p2 + +print_denom = (p, d) -> + accumulator = "" + save() + + p1 = cadr(p); # p1 is BASE + p2 = caddr(p); # p2 is EXPO + + # i.e. 1 / (2^(1/3)) + + # get the cases like BASE^(-1) out of + # the way, they just become 1/BASE + if (isminusone(p2)) # p2 is EXPO + accumulator += print_base_of_denom p1 + restore() + return accumulator + + if (d == 1) # p2 is EXPO + accumulator += print_char('(') + + # prepare the exponent + # (needs to be negated) + # before printing it out + push(p2); # p2 is EXPO + negate() + p2 = pop(); # p2 is EXPO + accumulator += print_power(p1,p2) + if (d == 1) + accumulator += print_char(')') + restore() + return accumulator + + +#define A p3 +#define B p4 + +print_a_over_b = (p) -> + accumulator = "" + flag = 0 + n = 0 + d = 0 + + save() + + # count numerators and denominators + + n = 0 + d = 0 + + p1 = cdr(p) + p2 = car(p1) + + if (isrational(p2)) + push(p2) + mp_numerator() + absval() + p3 = pop(); # p3 is A + push(p2) + mp_denominator() + p4 = pop(); # p4 is B + if (!isplusone(p3)) # p3 is A + n++ + if (!isplusone(p4)) # p4 is B + d++ + p1 = cdr(p1) + else + p3 = one; # p3 is A + p4 = one; # p4 is B + + while (iscons(p1)) + p2 = car(p1) + if (is_denominator(p2)) + d++ + else + n++ + p1 = cdr(p1) + + #debugger + if printMode == PRINTMODE_LATEX + accumulator += print_str('\\frac{') + + if (n == 0) + accumulator += print_char('1') + else + flag = 0 + p1 = cdr(p) + if (isrational(car(p1))) + p1 = cdr(p1) + if (!isplusone(p3)) # p3 is A + accumulator += print_factor(p3); # p3 is A + flag = 1 + while (iscons(p1)) + p2 = car(p1) + if (is_denominator(p2)) + doNothing = 1 + else + if (flag) + accumulator += print_multiply_sign() + accumulator += print_factor(p2) + flag = 1 + p1 = cdr(p1) + + if printMode == PRINTMODE_LATEX + accumulator += print_str('}{') + else if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str(" / ") + else + accumulator += print_str("/") + + if (d > 1 and printMode != PRINTMODE_LATEX) + accumulator += print_char('(') + + + flag = 0 + p1 = cdr(p) + + if (isrational(car(p1))) + p1 = cdr(p1) + + if (!isplusone(p4)) # p4 is B + accumulator += print_factor(p4); # p4 is B + flag = 1 + + while (iscons(p1)) + p2 = car(p1) + if (is_denominator(p2)) + if (flag) + accumulator += print_multiply_sign() + accumulator += print_denom(p2, d) + flag = 1 + p1 = cdr(p1) + + if (d > 1 and printMode != PRINTMODE_LATEX) + accumulator += print_char(')') + + if printMode == PRINTMODE_LATEX + accumulator += print_str('}') + + restore() + return accumulator + + +print_expr = (p) -> + accumulator = "" + if (isadd(p)) + p = cdr(p) + if (sign_of_term(car(p)) == '-') + accumulator += print_str("-") + accumulator += print_term(car(p)) + p = cdr(p) + while (iscons(p)) + if (sign_of_term(car(p)) == '+') + if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str(" + ") + else + accumulator += print_str("+") + else + if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str(" - ") + else + accumulator += print_str("-") + accumulator += print_term(car(p)) + p = cdr(p) + else + if (sign_of_term(p) == '-') + accumulator += print_str("-") + accumulator += print_term(p) + return accumulator + +sign_of_term = (p) -> + accumulator = "" + if (car(p) == symbol(MULTIPLY) && isNumericAtom(cadr(p)) && lessp(cadr(p), zero)) + accumulator += '-' + else if (isNumericAtom(p) && lessp(p, zero)) + accumulator += '-' + else + accumulator += '+' + return accumulator + +print_term = (p) -> + accumulator = "" + if (car(p) == symbol(MULTIPLY) && any_denominators(p)) + accumulator += print_a_over_b(p) + return accumulator + + if (car(p) == symbol(MULTIPLY)) + p = cdr(p) + + # coeff -1? + + if (isminusone(car(p))) + # print_char('-') + p = cdr(p) + + + previousFactorWasANumber = false + + # print the first factor ------------ + if isNumericAtom(car(p)) + previousFactorWasANumber = true + + # this numberOneOverSomething thing is so that + # we show things of the form + # numericFractionOfForm1/something * somethingElse + # as + # somethingElse / something + # so for example 1/2 * sqrt(2) is rendered as + # sqrt(2)/2 + # rather than the first form, which looks confusing. + # NOTE that you might want to avoid this + # when printing polynomials, as it could be nicer + # to show the numeric coefficients well separated from + # the variable, but we'll see when we'll + # come to it if it's an issue. + numberOneOverSomething = false + if printMode == PRINTMODE_LATEX and iscons(cdr(p)) and isNumberOneOverSomething(car(p)) + numberOneOverSomething = true + denom = car(p).q.b.toString() + + + if numberOneOverSomething + origAccumulator = accumulator + accumulator = "" + else + accumulator += print_factor(car(p)) + + p = cdr(p) + + # print all the other factors ------- + while (iscons(p)) + # check if we end up having a case where two numbers + # are next to each other. In those cases, latex needs + # to insert a \cdot otherwise they end up + # right next to each other and read like one big number + if printMode == PRINTMODE_LATEX + if previousFactorWasANumber + # if what comes next is a power and the base + # is a number, then we are in the case + # of consecutive numbers. + # Note that sqrt() i.e when exponent is 1/2 + # doesn't count because the radical gives + # a nice graphical separation already. + if caar(p) == symbol(POWER) + if isNumericAtom(car(cdr(car(p)))) + # rule out square root + if !isfraction(car(cdr(cdr(car(p))))) + accumulator += " \\cdot " + accumulator += print_multiply_sign() + accumulator += print_factor(car(p),false,true) + + previousFactorWasANumber = false + if isNumericAtom(car(p)) + previousFactorWasANumber = true + + p = cdr(p) + + if numberOneOverSomething + accumulator = origAccumulator + "\\frac{" + accumulator + "}{" + denom + "}" + + else + accumulator += print_factor(p) + return accumulator + +print_subexpr = (p) -> + accumulator = "" + accumulator += print_char('(') + accumulator += print_expr(p) + accumulator += print_char(')') + return accumulator + +print_factorial_function = (p) -> + accumulator = "" + p = cadr(p) + if (isfraction(p) || car(p) == symbol(ADD) || car(p) == symbol(MULTIPLY) || car(p) == symbol(POWER) || car(p) == symbol(FACTORIAL)) + accumulator += print_subexpr(p) + else + accumulator += print_expr(p) + accumulator += print_char('!') + return accumulator + +print_ABS_latex = (p) -> + accumulator = "" + accumulator += print_str("\\left |") + accumulator += print_expr(cadr(p)) + accumulator += print_str(" \\right |") + return accumulator + +print_BINOMIAL_latex = (p) -> + accumulator = "" + accumulator += print_str("\\binom{") + accumulator += print_expr(cadr(p)) + accumulator += print_str("}{") + accumulator += print_expr(caddr(p)) + accumulator += print_str("} ") + return accumulator + +print_DOT_latex = (p) -> + accumulator = "" + accumulator += print_expr(cadr(p)) + accumulator += print_str(" \\cdot ") + accumulator += print_expr(caddr(p)) + return accumulator + +print_DOT_codegen = (p) -> + accumulator = "dot(" + accumulator += print_expr(cadr(p)) + accumulator += ", " + accumulator += print_expr(caddr(p)) + accumulator += ")" + return accumulator + +print_SIN_codegen = (p) -> + accumulator = "Math.sin(" + accumulator += print_expr(cadr(p)) + accumulator += ")" + return accumulator + +print_COS_codegen = (p) -> + accumulator = "Math.cos(" + accumulator += print_expr(cadr(p)) + accumulator += ")" + return accumulator + +print_TAN_codegen = (p) -> + accumulator = "Math.tan(" + accumulator += print_expr(cadr(p)) + accumulator += ")" + return accumulator + +print_ARCSIN_codegen = (p) -> + accumulator = "Math.asin(" + accumulator += print_expr(cadr(p)) + accumulator += ")" + return accumulator + +print_ARCCOS_codegen = (p) -> + accumulator = "Math.acos(" + accumulator += print_expr(cadr(p)) + accumulator += ")" + return accumulator + +print_ARCTAN_codegen = (p) -> + accumulator = "Math.atan(" + accumulator += print_expr(cadr(p)) + accumulator += ")" + return accumulator + +print_SQRT_latex = (p) -> + accumulator = "" + accumulator += print_str("\\sqrt{") + accumulator += print_expr(cadr(p)) + accumulator += print_str("} ") + return accumulator + +print_TRANSPOSE_latex = (p) -> + accumulator = "" + accumulator += print_str("{") + if iscons(cadr(p)) + accumulator += print_str('(') + accumulator += print_expr(cadr(p)) + if iscons(cadr(p)) + accumulator += print_str(')') + accumulator += print_str("}") + accumulator += print_str("^T") + return accumulator + +print_TRANSPOSE_codegen = (p) -> + accumulator = "" + accumulator += print_str("transpose(") + accumulator += print_expr(cadr(p)) + accumulator += print_str(')') + return accumulator + +print_UNIT_codegen = (p) -> + accumulator = "" + accumulator += print_str("identity(") + accumulator += print_expr(cadr(p)) + accumulator += print_str(')') + return accumulator + +print_INV_latex = (p) -> + accumulator = "" + accumulator += print_str("{") + if iscons(cadr(p)) + accumulator += print_str('(') + accumulator += print_expr(cadr(p)) + if iscons(cadr(p)) + accumulator += print_str(')') + accumulator += print_str("}") + accumulator += print_str("^{-1}") + return accumulator + +print_INV_codegen = (p) -> + accumulator = "" + accumulator += print_str("inv(") + accumulator += print_expr(cadr(p)) + accumulator += print_str(')') + return accumulator + +print_DEFINT_latex = (p) -> + accumulator = "" + functionBody = car(cdr(p)) + + p = cdr(p) + originalIntegral = p + numberOfIntegrals = 0 + + while iscons(cdr(cdr(p))) + numberOfIntegrals++ + theIntegral = cdr(cdr(p)) + + accumulator += print_str("\\int^{") + accumulator += print_expr(car(cdr(theIntegral))) + accumulator += print_str("}_{") + accumulator += print_expr(car(theIntegral)) + accumulator += print_str("} \\! ") + p = cdr(theIntegral) + + accumulator += print_expr(functionBody) + accumulator += print_str(" \\,") + + p = originalIntegral + + for i in [1..numberOfIntegrals] + theVariable = cdr(p) + accumulator += print_str(" \\mathrm{d} ") + accumulator += print_expr(car(theVariable)) + if i < numberOfIntegrals + accumulator += print_str(" \\, ") + p = cdr(cdr(theVariable)) + return accumulator + + + +print_tensor = (p) -> + accumulator = "" + accumulator += print_tensor_inner(p, 0, 0)[1] + return accumulator + +# j scans the dimensions +# k is an increment for all the printed elements +# since they are all together in sequence in one array +print_tensor_inner = (p, j, k) -> + accumulator = "" + + accumulator += print_str("[") + + # only the last dimension prints the actual elements + # e.g. in a matrix, the first dimension contains + # vectors, not elements, and the second dimension + # actually contains the elements + + # if not the last dimension, we are just printing wrappers + # and recursing down i.e. we print the next dimension + if (j < p.tensor.ndim - 1) + for i in [0...p.tensor.dim[j]] + [k, retString] = print_tensor_inner(p, j + 1, k) + accumulator += retString + # add separator between elements dimensions + # "above" the inner-most dimension + if i != p.tensor.dim[j] - 1 + accumulator += print_str(",") + # if we reached the last dimension, we print the actual + # elements + else + for i in [0...p.tensor.dim[j]] + accumulator += print_expr(p.tensor.elem[k]) + # add separator between elements in the + # inner-most dimension + if i != p.tensor.dim[j] - 1 + accumulator += print_str(",") + k++ + + accumulator += print_str("]") + return [k, accumulator] + +print_tensor_latex = (p) -> + accumulator = "" + if p.tensor.ndim <= 2 + accumulator += print_tensor_inner_latex(true, p, 0, 0)[1] + return accumulator + +# firstLevel is needed because printing a matrix +# is not exactly an elegant recursive procedure: +# the vector on the first level prints the latex +# "wrap", while the vectors that make up the +# rows don't. so it's a bit asymmetric and this +# flag helps. +# j scans the dimensions +# k is an increment for all the printed elements +# since they are all together in sequence in one array +print_tensor_inner_latex = (firstLevel, p, j, k) -> + accumulator = "" + + # open the outer latex wrap + if firstLevel + accumulator += "\\begin{bmatrix} " + + # only the last dimension prints the actual elements + # e.g. in a matrix, the first dimension contains + # vectors, not elements, and the second dimension + # actually contains the elements + + # if not the last dimension, we are just printing wrappers + # and recursing down i.e. we print the next dimension + if (j < p.tensor.ndim - 1) + for i in [0...p.tensor.dim[j]] + [k, retString] = print_tensor_inner_latex(0, p, j + 1, k) + accumulator += retString + if i != p.tensor.dim[j] - 1 + # add separator between rows + accumulator += print_str(" \\\\ ") + # if we reached the last dimension, we print the actual + # elements + else + for i in [0...p.tensor.dim[j]] + accumulator += print_expr(p.tensor.elem[k]) + # separator between elements in each row + if i != p.tensor.dim[j] - 1 + accumulator += print_str(" & ") + k++ + + + # close the outer latex wrap + if firstLevel + accumulator += " \\end{bmatrix}" + + return [k, accumulator] + +print_SUM_latex = (p) -> + accumulator = "\\sum_{" + accumulator += print_expr(caddr(p)) + accumulator += "=" + accumulator += print_expr(cadddr(p)) + accumulator += "}^{" + accumulator += print_expr(caddddr(p)) + accumulator += "}{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + return accumulator + +print_SUM_codegen = (p) -> + + body = cadr(p) + variable = caddr(p) + lowerlimit = cadddr(p) + upperlimit = caddddr(p) + + accumulator = + "(function(){" + + " var " + variable + "; " + + " var holderSum = 0; " + + " var lowerlimit = " + print_expr(lowerlimit) + "; " + + " var upperlimit = " + print_expr(upperlimit) + "; " + + " for (" + variable + " = lowerlimit; " + variable + " < upperlimit; " + variable + "++) { " + + " holderSum += " + print_expr(body) + ";" + + " } "+ + " return holderSum;" + + "})()" + + return accumulator + +print_TEST_latex = (p) -> + accumulator = "\\left\\{ \\begin{array}{ll}" + + p = cdr(p) + while (iscons(p)) + + # odd number of parameters means that the + # last argument becomes the default case + # i.e. the one without a test. + if (cdr(p) == symbol(NIL)) + accumulator += "{" + accumulator += print_expr(car(p)) + accumulator += "} & otherwise " + accumulator += " \\\\\\\\" + break + + accumulator += "{" + accumulator += print_expr(cadr(p)) + accumulator += "} & if & " + accumulator += print_expr(car(p)) + accumulator += " \\\\\\\\" + + # test unsuccessful, continue to the + # next pair of test,value + p = cddr(p) + accumulator = accumulator.substring(0, accumulator.length - 4); + accumulator += "\\end{array} \\right." + +print_TEST_codegen = (p) -> + + accumulator = "(function(){" + + p = cdr(p) + howManyIfs = 0 + while (iscons(p)) + + # odd number of parameters means that the + # last argument becomes the default case + # i.e. the one without a test. + if (cdr(p) == symbol(NIL)) + accumulator += "else {" + accumulator += "return (" + print_expr(car(p)) + ");" + accumulator += "}" + break + + if howManyIfs + accumulator += " else " + + accumulator += "if (" + print_expr(car(p)) + "){" + accumulator += "return (" + print_expr(cadr(p)) + ");" + accumulator += "}" + + # test unsuccessful, continue to the + # next pair of test,value + howManyIfs++ + p = cddr(p) + + accumulator += "})()" + + return accumulator + + +print_TESTLT_latex = (p) -> + accumulator = "{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + accumulator += " < " + accumulator += "{" + accumulator += print_expr(caddr(p)) + accumulator += "}" + +print_TESTLE_latex = (p) -> + accumulator = "{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + accumulator += " \\leq " + accumulator += "{" + accumulator += print_expr(caddr(p)) + accumulator += "}" + +print_TESTGT_latex = (p) -> + accumulator = "{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + accumulator += " > " + accumulator += "{" + accumulator += print_expr(caddr(p)) + accumulator += "}" + +print_TESTGE_latex = (p) -> + accumulator = "{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + accumulator += " \\geq " + accumulator += "{" + accumulator += print_expr(caddr(p)) + accumulator += "}" + +print_TESTEQ_latex = (p) -> + accumulator = "{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + accumulator += " = " + accumulator += "{" + accumulator += print_expr(caddr(p)) + accumulator += "}" + +print_FOR_codegen = (p) -> + body = cadr(p) + variable = caddr(p) + lowerlimit = cadddr(p) + upperlimit = caddddr(p) + + accumulator = + "(function(){" + + " var " + variable + "; " + + " var lowerlimit = " + print_expr(lowerlimit) + "; " + + " var upperlimit = " + print_expr(upperlimit) + "; " + + " for (" + variable + " = lowerlimit; " + variable + " < upperlimit; " + variable + "++) { " + + " " + print_expr(body) + + " } "+ + "})()" + + return accumulator + +print_DO_codegen = (p) -> + accumulator = "" + + p = cdr(p) + while iscons(p) + accumulator += print_expr(car(p)) + p = cdr(p) + + return accumulator + +print_SETQ_codegen = (p) -> + accumulator = "" + accumulator += print_expr(cadr(p)) + accumulator += " = " + accumulator += print_expr(caddr(p)) + accumulator += "; " + return accumulator + + +print_PRODUCT_latex = (p) -> + accumulator = "\\prod_{" + accumulator += print_expr(caddr(p)) + accumulator += "=" + accumulator += print_expr(cadddr(p)) + accumulator += "}^{" + accumulator += print_expr(caddddr(p)) + accumulator += "}{" + accumulator += print_expr(cadr(p)) + accumulator += "}" + return accumulator + +print_PRODUCT_codegen = (p) -> + + body = cadr(p) + variable = caddr(p) + lowerlimit = cadddr(p) + upperlimit = caddddr(p) + + accumulator = + "(function(){" + + " var " + variable + "; " + + " var holderProduct = 1; " + + " var lowerlimit = " + print_expr(lowerlimit) + "; " + + " var upperlimit = " + print_expr(upperlimit) + "; " + + " for (" + variable + " = lowerlimit; " + variable + " < upperlimit; " + variable + "++) { " + + " holderProduct *= " + print_expr(body) + ";" + + " } "+ + " return holderProduct;" + + "})()" + + return accumulator + + +print_base = (p) -> + accumulator = "" + if (isadd(cadr(p)) || caadr(p) == symbol(MULTIPLY) || caadr(p) == symbol(POWER) || isnegativenumber(cadr(p))) + accumulator += print_str('(') + accumulator += print_expr(cadr(p)) + accumulator += print_str(')') + else if (isNumericAtom(cadr(p)) && (lessp(cadr(p), zero) || isfraction(cadr(p)))) + accumulator += print_str('(') + accumulator += print_factor(cadr(p)) + accumulator += print_str(')') + else + accumulator += print_factor(cadr(p)) + return accumulator + +print_exponent = (p) -> + accumulator = "" + if (iscons(caddr(p)) || isfraction(caddr(p)) || (isNumericAtom(caddr(p)) && lessp(caddr(p), zero))) + accumulator += print_str('(') + accumulator += print_expr(caddr(p)) + accumulator += print_str(')') + else + accumulator += print_factor(caddr(p)) + return accumulator + +print_power = (base, exponent) -> + accumulator = "" + + #debugger + if DEBUG then console.log "power base: " + base + " " + " exponent: " + exponent + + # quick check is this is actually a square root. + if isoneovertwo(exponent) + if equaln(base, 2) + if codeGen + accumulator += print_str("Math.SQRT2") + return accumulator + else + if printMode == PRINTMODE_LATEX + accumulator += print_str("\\sqrt{") + accumulator += print_expr(base) + accumulator += print_str("}") + return accumulator + else if codeGen + accumulator += print_str("Math.sqrt(") + accumulator += print_expr(base) + accumulator += print_str(')') + return accumulator + + + if ((equaln(get_binding(symbol(PRINT_LEAVE_E_ALONE)), 1)) and base == symbol(E)) + if codeGen + accumulator += print_str("Math.exp(") + accumulator += print_expo_of_denom exponent + accumulator += print_str(')') + return accumulator + + if printMode == PRINTMODE_LATEX + accumulator += print_str("e^{") + accumulator += print_expr(exponent) + accumulator += print_str("}") + else + accumulator += print_str("exp(") + accumulator += print_expr(exponent) + accumulator += print_str(')') + return accumulator + + if codeGen + accumulator += print_str("Math.pow(") + accumulator += print_base_of_denom base + accumulator += print_str(", ") + accumulator += print_expo_of_denom exponent + accumulator += print_str(')') + return accumulator + + + if ((equaln(get_binding(symbol(PRINT_LEAVE_X_ALONE)), 0)) or base.printname != "x") + # if the exponent is negative then + # we invert the base BUT we don't do + # that if the base is "e", because for + # example when trigonometric functions are + # expressed in terms of exponential functions + # that would be really confusing, one wants to + # keep "e" as the base and the negative exponent + if (base != symbol(E)) + if (isminusone(exponent)) + if printMode == PRINTMODE_LATEX + accumulator += print_str("\\frac{1}{") + else if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str("1 / ") + else + accumulator += print_str("1/") + + if (iscons(base) and printMode != PRINTMODE_LATEX) + accumulator += print_str('(') + accumulator += print_expr(base) + accumulator += print_str(')') + else + accumulator += print_expr(base) + + if printMode == PRINTMODE_LATEX + accumulator += print_str("}") + + return accumulator + + if (isnegativeterm(exponent)) + if printMode == PRINTMODE_LATEX + accumulator += print_str("\\frac{1}{") + else if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str("1 / ") + else + accumulator += print_str("1/") + + push(exponent) + push_integer(-1) + multiply() + newExponent = pop() + + if (iscons(base) and printMode != PRINTMODE_LATEX) + accumulator += print_str('(') + accumulator += print_power(base, newExponent) + accumulator += print_str(')') + else + accumulator += print_power(base, newExponent) + + + if printMode == PRINTMODE_LATEX + accumulator += print_str("}") + + return accumulator + + + if (isfraction(exponent) and printMode == PRINTMODE_LATEX) + accumulator += print_str("\\sqrt") + push(exponent) + denominator() + denomExponent = pop() + # we omit the "2" on the radical + if !isplustwo(denomExponent) + accumulator += print_str("[") + accumulator += print_expr(denomExponent) + accumulator += print_str("]") + accumulator += print_str("{") + push(exponent) + numerator() + numExponent = pop() + exponent = numExponent + accumulator += print_power(base, exponent) + accumulator += print_str("}") + return accumulator + + if printMode == PRINTMODE_LATEX and isplusone(exponent) + # if we are in latex mode we turn many + # radicals into a radix sign with a power + # underneath, and the power is often one + # (e.g. square root turns into a radical + # with a power one underneath) so handle + # this case simply here, just print the base + accumulator += print_expr(base) + else + # print the base, + # determining if it needs to be + # wrapped in parentheses or not + if (isadd(base) || isnegativenumber(base)) + accumulator += print_str('(') + accumulator += print_expr(base) + accumulator += print_str(')') + else if ( car(base) == symbol(MULTIPLY) || car(base) == symbol(POWER)) + if printMode != PRINTMODE_LATEX then accumulator += print_str('(') + accumulator += print_factor(base, true) + if printMode != PRINTMODE_LATEX then accumulator += print_str(')') + else if (isNumericAtom(base) && (lessp(base, zero) || isfraction(base))) + accumulator += print_str('(') + accumulator += print_factor(base) + accumulator += print_str(')') + else + accumulator += print_factor(base) + + # print the power symbol + #debugger + if printMode == PRINTMODE_HUMAN and !test_flag + #print_str(" ^ ") + accumulator += print_str(power_str) + else + accumulator += print_str("^") + + # print the exponent + if printMode == PRINTMODE_LATEX + # in latex mode, one can omit the curly braces + # wrapping the exponent if the exponent is only + # one character long + if print_expr(exponent).length > 1 + accumulator += print_str("{") + accumulator += print_expr(exponent) + accumulator += print_str("}") + else + accumulator += print_expr(exponent) + else if (iscons(exponent) || isfraction(exponent) || (isNumericAtom(exponent) && lessp(exponent, zero))) + accumulator += print_str('(') + accumulator += print_expr(exponent) + accumulator += print_str(')') + else + accumulator += print_factor(exponent) + return accumulator + +print_index_function = (p) -> + accumulator = "" + p = cdr(p); + if (caar(p) == symbol(ADD) || caar(p) == symbol(MULTIPLY) || caar(p) == symbol(POWER) || caar(p) == symbol(FACTORIAL)) + accumulator += print_subexpr(car(p)); + else + accumulator += print_expr(car(p)); + accumulator += print_str('['); + p = cdr(p); + if (iscons(p)) + accumulator += print_expr(car(p)); + p = cdr(p); + while(iscons(p)) + accumulator += print_str(','); + accumulator += print_expr(car(p)); + p = cdr(p); + accumulator += print_str(']'); + return accumulator + + +print_factor = (p, omitParens, pastFirstFactor) -> + # debugger + accumulator = "" + if (isNumericAtom(p)) + # in an evaluated term, all the numeric parts + # are at the beginning of the term. + # When printing the EXPRESSION, + # we peek into the first factor of the term and we + # look at whether it's a number less then zero. + # if it is, we print the "-" as the "leading" part of the + # print of the EXPRESSION, and then we proceed printint the factors + # of the term. This means that when we come here, we must + # skip printing the minus if the number is negative, + # because it's already been printed. + if pastFirstFactor and lessp(p, zero) + accumulator += '(' + accumulator += print_number(p, pastFirstFactor) + if pastFirstFactor and lessp(p, zero) + accumulator += ')' + return accumulator + + if (isstr(p)) + accumulator += print_str("\"") + accumulator += print_str(p.str) + accumulator += print_str("\"") + return accumulator + + if (istensor(p)) + if printMode == PRINTMODE_LATEX + accumulator += print_tensor_latex(p) + else + accumulator += print_tensor(p) + return accumulator + + if (car(p) == symbol(MULTIPLY)) + if !omitParens + if (sign_of_term(p) == '-' or printMode != PRINTMODE_LATEX) + if printMode == PRINTMODE_LATEX + accumulator += print_str(" \\left (") + else + accumulator += print_str('(') + accumulator += print_expr(p) + if !omitParens + if (sign_of_term(p) == '-' or printMode != PRINTMODE_LATEX) + if printMode == PRINTMODE_LATEX + accumulator += print_str(" \\right ) ") + else + accumulator += print_str(')') + return accumulator + else if (isadd(p)) + if !omitParens then accumulator += print_str('(') + accumulator += print_expr(p) + if !omitParens then accumulator += print_str(')') + return accumulator + + if (car(p) == symbol(POWER)) + base = cadr(p) + exponent = caddr(p) + accumulator += print_power(base, exponent) + return accumulator + + # if (car(p) == _list) { + # print_str("{") + # p = cdr(p) + # if (iscons(p)) { + # print_expr(car(p)) + # p = cdr(p) + # } + # while (iscons(p)) { + # print_str(",") + # print_expr(car(p)) + # p = cdr(p) + # } + # print_str("}") + # return + # } + + if (car(p) == symbol(FUNCTION)) + fbody = cadr(p) + + if !codeGen + parameters = caddr(p) + accumulator += print_str "function " + if DEBUG then console.log "emittedString from print_factor " + stringsEmittedByUserPrintouts + returned = print_list parameters + accumulator += returned + accumulator += print_str " -> " + accumulator += print_expr fbody + return accumulator + + if (car(p) == symbol(PATTERN)) + + accumulator += print_expr(caadr(p)) + if printMode == PRINTMODE_LATEX + accumulator += print_str(" \\rightarrow ") + else + if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str(" -> ") + else + accumulator += print_str("->") + + accumulator += print_expr car(cdr(cadr(p))) + return accumulator + + + if (car(p) == symbol(INDEX) && issymbol(cadr(p))) + accumulator += print_index_function(p) + return accumulator + + if (car(p) == symbol(FACTORIAL)) + accumulator += print_factorial_function(p) + return accumulator + else if (car(p) == symbol(ABS) && printMode == PRINTMODE_LATEX) + accumulator += print_ABS_latex(p) + return accumulator + else if (car(p) == symbol(SQRT) && printMode == PRINTMODE_LATEX) + #debugger + accumulator += print_SQRT_latex(p) + return accumulator + else if car(p) == symbol(TRANSPOSE) + if printMode == PRINTMODE_LATEX + accumulator += print_TRANSPOSE_latex(p) + return accumulator + else if codeGen + accumulator += print_TRANSPOSE_codegen(p) + return accumulator + else if car(p) == symbol(UNIT) + if codeGen + accumulator += print_UNIT_codegen(p) + return accumulator + else if car(p) == symbol(INV) + if printMode == PRINTMODE_LATEX + accumulator += print_INV_latex(p) + return accumulator + else if codeGen + accumulator += print_INV_codegen(p) + return accumulator + else if (car(p) == symbol(BINOMIAL) && printMode == PRINTMODE_LATEX) + accumulator += print_BINOMIAL_latex(p) + return accumulator + else if (car(p) == symbol(DEFINT) && printMode == PRINTMODE_LATEX) + accumulator += print_DEFINT_latex(p) + return accumulator + else if isinnerordot(p) + if printMode == PRINTMODE_LATEX + accumulator += print_DOT_latex(p) + return accumulator + else if codeGen + accumulator += print_DOT_codegen(p) + return accumulator + else if car(p) == symbol(SIN) + if codeGen + accumulator += print_SIN_codegen(p) + return accumulator + else if car(p) == symbol(COS) + if codeGen + accumulator += print_COS_codegen(p) + return accumulator + else if car(p) == symbol(TAN) + if codeGen + accumulator += print_TAN_codegen(p) + return accumulator + else if car(p) == symbol(ARCSIN) + if codeGen + accumulator += print_ARCSIN_codegen(p) + return accumulator + else if car(p) == symbol(ARCCOS) + if codeGen + accumulator += print_ARCCOS_codegen(p) + return accumulator + else if car(p) == symbol(ARCTAN) + if codeGen + accumulator += print_ARCTAN_codegen(p) + return accumulator + else if car(p) == symbol(SUM) + if printMode == PRINTMODE_LATEX + accumulator += print_SUM_latex(p) + return accumulator + else if codeGen + accumulator += print_SUM_codegen(p) + return accumulator + #else if car(p) == symbol(QUOTE) + # if printMode == PRINTMODE_LATEX + # print_expr(cadr(p)) + # return accumulator + else if car(p) == symbol(PRODUCT) + if printMode == PRINTMODE_LATEX + accumulator += print_PRODUCT_latex(p) + return accumulator + else if codeGen + accumulator += print_PRODUCT_codegen(p) + return accumulator + else if car(p) == symbol(FOR) + if codeGen + accumulator += print_FOR_codegen(p) + return accumulator + else if car(p) == symbol(DO) + if codeGen + accumulator += print_DO_codegen(p) + return accumulator + else if car(p) == symbol(TEST) + if codeGen + accumulator += print_TEST_codegen(p) + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += print_TEST_latex(p) + return accumulator + else if car(p) == symbol(TESTLT) + if codeGen + accumulator += "(("+print_expr(cadr(p))+") < ("+print_expr(caddr(p))+"))" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += print_TESTLT_latex(p) + return accumulator + else if car(p) == symbol(TESTLE) + if codeGen + accumulator += "(("+print_expr(cadr(p))+") <= ("+print_expr(caddr(p))+"))" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += print_TESTLE_latex(p) + return accumulator + else if car(p) == symbol(TESTGT) + if codeGen + accumulator += "(("+print_expr(cadr(p))+") > ("+print_expr(caddr(p))+"))" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += print_TESTGT_latex(p) + return accumulator + else if car(p) == symbol(TESTGE) + if codeGen + accumulator += "(("+print_expr(cadr(p))+") >= ("+print_expr(caddr(p))+"))" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += print_TESTGE_latex(p) + return accumulator + else if car(p) == symbol(TESTEQ) + if codeGen + accumulator += "(("+print_expr(cadr(p))+") === ("+print_expr(caddr(p))+"))" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += print_TESTEQ_latex(p) + return accumulator + else if car(p) == symbol(FLOOR) + if codeGen + accumulator += "Math.floor("+print_expr(cadr(p))+")" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += " \\lfloor {" + print_expr(cadr(p)) + "} \\rfloor " + return accumulator + else if car(p) == symbol(CEILING) + if codeGen + accumulator += "Math.ceiling("+print_expr(cadr(p))+")" + return accumulator + if printMode == PRINTMODE_LATEX + accumulator += " \\lceil {" + print_expr(cadr(p)) + "} \\rceil " + return accumulator + else if car(p) == symbol(ROUND) + if codeGen + accumulator += "Math.round("+print_expr(cadr(p))+")" + return accumulator + else if car(p) == symbol(SETQ) + if codeGen + accumulator += print_SETQ_codegen(p) + return accumulator + else + accumulator += print_expr cadr p + accumulator += print_str("=") + accumulator += print_expr caddr p + return accumulator + + + if (iscons(p)) + #if (car(p) == symbol(FORMAL) && cadr(p)->k == SYM) { + # print_str(((struct symbol *) cadr(p))->name) + # return + #} + accumulator += print_factor(car(p)) + p = cdr(p) + if !omitParens then accumulator += print_str('(') + if (iscons(p)) + accumulator += print_expr(car(p)) + p = cdr(p) + while (iscons(p)) + accumulator += print_str(",") + accumulator += print_expr(car(p)) + p = cdr(p) + if !omitParens then accumulator += print_str(')') + return accumulator + + if (p == symbol(DERIVATIVE)) + accumulator += print_char('d') + else if (p == symbol(E)) + if codeGen + accumulator += print_str("Math.E") + else + accumulator += print_str("e") + else if (p == symbol(PI)) + if printMode == PRINTMODE_LATEX + accumulator += print_str("\\pi") + else + accumulator += print_str("pi") + else + accumulator += print_str(get_printname(p)) + return accumulator + + +print_list = (p) -> + accumulator = "" + switch (p.k) + when CONS + accumulator += ('(') + accumulator += print_list(car(p)) + if p == cdr(p) and p != symbol(NIL) + console.log "oh no recursive!" + debugger + p = cdr(p) + while (iscons(p)) + accumulator += (" ") + accumulator += print_list(car(p)) + p = cdr(p) + if p == cdr(p) and p != symbol(NIL) + console.log "oh no recursive!" + debugger + if (p != symbol(NIL)) + accumulator += (" . ") + accumulator += print_list(p) + accumulator += (')') + when STR + #print_str("\"") + accumulator += (p.str) + #print_str("\"") + when NUM, DOUBLE + accumulator += print_number(p, true) + when SYM + accumulator += get_printname(p) + else + accumulator += ("") + return accumulator + +print_multiply_sign = -> + accumulator = "" + if printMode == PRINTMODE_LATEX + if printMode == PRINTMODE_HUMAN and !test_flag + accumulator += print_str(" ") + else + return accumulator + + if printMode == PRINTMODE_HUMAN and !test_flag and !codeGen + accumulator += print_str(" ") + else + accumulator += print_str("*") + return accumulator + +is_denominator = (p) -> + if (car(p) == symbol(POWER) && cadr(p) != symbol(E) && isnegativeterm(caddr(p))) + return 1 + else + return 0 + +# don't consider the leading fraction +# we want 2/3*a*b*c instead of 2*a*b*c/3 + +any_denominators = (p) -> + p = cdr(p) + # if (isfraction(car(p))) + # return 1 + while (iscons(p)) + q = car(p) + if (is_denominator(q)) + return 1 + p = cdr(p) + return 0 + diff --git a/node_modules/algebrite/sources/print2d.coffee b/node_modules/algebrite/sources/print2d.coffee new file mode 100644 index 0000000..f94a3ae --- /dev/null +++ b/node_modules/algebrite/sources/print2d.coffee @@ -0,0 +1,1111 @@ +### + +Prints in "2d", e.g. instead of 1/(x+1)^2 : + + 1 + ---------- + 2 + (1 + x) + + Note that although this looks more natural, a) it's not parsable and + b) it can be occasionally be ambiguous, such as: + + 1 + ---- + 2 + x + +is 1/x^2 but it also looks a little like x^(1/2) + +### + +#----------------------------------------------------------------------------- +# +# Examples: +# +# 012345678 +# -2 ......... +# -1 ......... +# 0 ..hello.. x=2, y=0, h=1, w=5 +# 1 ......... +# 2 ......... +# +# 012345678 +# -2 ......... +# -1 ..355.... +# 0 ..---.... x=2, y=-1, h=3, w=3 +# 1 ..113.... +# 2 ......... +# +#----------------------------------------------------------------------------- + + + +YMAX = 10000 +class glyph + c: 0 + x: 0 + y: 0 + +# will contain glyphs +chartab = [] +for charTabIndex in [0...YMAX] + chartab[charTabIndex] = new glyph() + + +yindex = 0 +level = 0 +emit_x = 0 +expr_level = 0 +display_flag = 0 + + +# this is not really the translated version, +# the original is in window.cpp and is +# rather more complex +printchar_nowrap = (character) -> + accumulator = "" + accumulator += character + return accumulator + +printchar = (character) -> + return printchar_nowrap character + +print2dascii = (p) -> + h = 0 + w = 0 + y = 0 + + save() + + yindex = 0 + level = 0 + emit_x = 0 + emit_top_expr(p) + + # if too wide then print flat + + [h,w,y] = get_size(0, yindex) + + if (w > 100) + printline(p) + restore() + return + + beenPrinted = print_glyphs() + + restore() + return beenPrinted + +emit_top_expr = (p) -> + if (car(p) == symbol(SETQ)) + emit_expr(cadr(p)) + __emit_str(" = ") + emit_expr(caddr(p)) + return + + if (istensor(p)) + emit_tensor(p) + else + emit_expr(p) + +will_be_displayed_as_fraction = (p) -> + if (level > 0) + return 0 + if (isfraction(p)) + return 1 + if (car(p) != symbol(MULTIPLY)) + return 0 + if (isfraction(cadr(p))) + return 1 + while (iscons(p)) + if (isdenominator(car(p))) + return 1 + p = cdr(p) + return 0 + +emit_expr = (p) -> + # if (level > 0) { + # printexpr(p) + # return + # } + expr_level++ + if (car(p) == symbol(ADD)) + p = cdr(p) + if (__is_negative(car(p))) + __emit_char('-') + if (will_be_displayed_as_fraction(car(p))) + __emit_char(' ') + emit_term(car(p)) + p = cdr(p) + while (iscons(p)) + if (__is_negative(car(p))) + __emit_char(' ') + __emit_char('-') + __emit_char(' ') + else + __emit_char(' ') + __emit_char('+') + __emit_char(' ') + + emit_term(car(p)) + p = cdr(p) + else + if (__is_negative(p)) + __emit_char('-') + if (will_be_displayed_as_fraction(p)) + __emit_char(' ') + emit_term(p) + expr_level-- + +emit_unsigned_expr = (p) -> + if (car(p) == symbol(ADD)) + p = cdr(p) + # if (__is_negative(car(p))) + # __emit_char('-') + emit_term(car(p)) + p = cdr(p) + while (iscons(p)) + if (__is_negative(car(p))) + __emit_char(' ') + __emit_char('-') + __emit_char(' ') + else + __emit_char(' ') + __emit_char('+') + __emit_char(' ') + emit_term(car(p)) + p = cdr(p) + else + # if (__is_negative(p)) + # __emit_char('-') + emit_term(p) + +__is_negative = (p) -> + if (isnegativenumber(p)) + return 1 + if (car(p) == symbol(MULTIPLY) && isnegativenumber(cadr(p))) + return 1 + return 0 + +emit_term = (p) -> + if (car(p) == symbol(MULTIPLY)) + n = count_denominators(p) + if (n && level == 0) + emit_fraction(p, n) + else + emit_multiply(p, n) + else + emit_factor(p) + +isdenominator = (p) -> + if (car(p) == symbol(POWER) && cadr(p) != symbol(E) && __is_negative(caddr(p))) + return 1 + else + return 0 + +count_denominators = (p) -> + count = 0 + p = cdr(p) + # if (isfraction(car(p))) { + # count++ + # p = cdr(p) + # } + while (iscons(p)) + q = car(p) + if (isdenominator(q)) + count++ + p = cdr(p) + return count + +# n is the number of denominators, not counting a fraction like 1/2 +emit_multiply = (p, n) -> + if (n == 0) + p = cdr(p) + if (isplusone(car(p)) || isminusone(car(p))) + p = cdr(p) + emit_factor(car(p)) + p = cdr(p) + while (iscons(p)) + __emit_char(' ') + emit_factor(car(p)) + p = cdr(p) + else + emit_numerators(p) + __emit_char('/') + # need grouping if more than one denominator + if (n > 1 || isfraction(cadr(p))) + __emit_char('(') + emit_denominators(p) + __emit_char(')') + else + emit_denominators(p) + +#define A p3 +#define B p4 + +# sign of term has already been emitted + +emit_fraction = (p, d) -> + count = 0 + k1 = 0 + k2 = 0 + n = 0 + x = 0 + + save() + + p3 = one; # p3 is A + p4 = one; # p4 is B + + # handle numerical coefficient + + if (isrational(cadr(p))) + push(cadr(p)) + mp_numerator() + absval() + p3 = pop(); # p3 is A + push(cadr(p)) + mp_denominator() + p4 = pop(); # p4 is B + + if (isdouble(cadr(p))) + push(cadr(p)) + absval() + p3 = pop(); # p3 is A + + # count numerators + + if (isplusone(p3)) # p3 is A + n = 0 + else + n = 1 + p1 = cdr(p) + if (isNumericAtom(car(p1))) + p1 = cdr(p1) + while (iscons(p1)) + p2 = car(p1) + if (isdenominator(p2)) + doNothing = 1 + else + n++ + p1 = cdr(p1) + + # emit numerators + + x = emit_x + + k1 = yindex + + count = 0 + + # emit numerical coefficient + + if (!isplusone(p3)) # p3 is A + emit_number(p3, 0); # p3 is A + count++ + + # skip over "multiply" + + p1 = cdr(p) + + # skip over numerical coefficient, already handled + + if (isNumericAtom(car(p1))) + p1 = cdr(p1) + + while (iscons(p1)) + p2 = car(p1) + if (isdenominator(p2)) + doNothing = 1 + else + if (count > 0) + __emit_char(' ') + if (n == 1) + emit_expr(p2) + else + emit_factor(p2) + count++ + p1 = cdr(p1) + + if (count == 0) + __emit_char('1') + + # emit denominators + + k2 = yindex + + count = 0 + + if (!isplusone(p4)) # p4 is B + emit_number(p4, 0); # p4 is B + count++ + d++ + + p1 = cdr(p) + + if (isrational(car(p1))) + p1 = cdr(p1) + + while (iscons(p1)) + p2 = car(p1) + if (isdenominator(p2)) + if (count > 0) + __emit_char(' ') + emit_denominator(p2, d) + count++ + p1 = cdr(p1) + + fixup_fraction(x, k1, k2) + + restore() + +# p points to a multiply + +emit_numerators = (p) -> + save() + + n = 0 + + p1 = one + + p = cdr(p) + + if (isrational(car(p))) + push(car(p)) + mp_numerator() + absval() + p1 = pop() + p = cdr(p) + else if (isdouble(car(p))) + push(car(p)) + absval() + p1 = pop() + p = cdr(p) + + n = 0 + + if (!isplusone(p1)) + emit_number(p1, 0) + n++ + + while (iscons(p)) + if (isdenominator(car(p))) + doNothing = 1 + else + if (n > 0) + __emit_char(' ') + emit_factor(car(p)) + n++ + p = cdr(p) + + if (n == 0) + __emit_char('1') + + restore() + +# p points to a multiply + +emit_denominators = (p) -> + + save() + + n = 0 + + p = cdr(p) + + if (isfraction(car(p))) + push(car(p)) + mp_denominator() + p1 = pop() + emit_number(p1, 0) + n++ + p = cdr(p) + + while (iscons(p)) + if (isdenominator(car(p))) + if (n > 0) + __emit_char(' ') + emit_denominator(car(p), 0) + n++ + p = cdr(p) + + restore() + +emit_factor = (p) -> + if (istensor(p)) + if (level == 0) + #emit_tensor(p) + emit_flat_tensor(p) + else + emit_flat_tensor(p) + return + + if (isdouble(p)) + emit_number(p, 0) + return + + if (car(p) == symbol(ADD) || car(p) == symbol(MULTIPLY)) + emit_subexpr(p) + return + + if (car(p) == symbol(POWER)) + emit_power(p) + return + + if (iscons(p)) + #if (car(p) == symbol(FORMAL) && cadr(p).k == SYM) + # emit_symbol(cadr(p)) + #else + emit_function(p) + return + + if (isNumericAtom(p)) + if (level == 0) + emit_numerical_fraction(p) + else + emit_number(p, 0) + return + + if (issymbol(p)) + emit_symbol(p) + return + + if (isstr(p)) + emit_string(p) + return + +emit_numerical_fraction = (p) -> + k1 = 0 + k2 = 0 + x = 0 + + save() + + push(p) + mp_numerator() + absval() + p3 = pop(); # p3 is A + + push(p) + mp_denominator() + p4 = pop(); # p4 is B + + if (isplusone(p4)) # p4 is B + emit_number(p3, 0); # p3 is A + restore() + return + + x = emit_x + + k1 = yindex + + emit_number(p3, 0); # p3 is A + + k2 = yindex + + emit_number(p4, 0) # p4 is B + + fixup_fraction(x, k1, k2) + + restore() + +# if it's a factor then it doesn't need parens around it, i.e. 1/sin(theta)^2 + +isfactor = (p) -> + if (iscons(p) && car(p) != symbol(ADD) && car(p) != symbol(MULTIPLY) && car(p) != symbol(POWER)) + return 1 + if (issymbol(p)) + return 1 + if (isfraction(p)) + return 0 + if (isnegativenumber(p)) + return 0 + if (isNumericAtom(p)) + return 1 + return 0 + +emit_power = (p) -> + k1 = 0 + k2 = 0 + x = 0 + + if (cadr(p) == symbol(E)) + __emit_str("exp(") + emit_expr(caddr(p)) + __emit_char(')') + return + + if (level > 0) + if (isminusone(caddr(p))) + __emit_char('1') + __emit_char('/') + if (isfactor(cadr(p))) + emit_factor(cadr(p)) + else + emit_subexpr(cadr(p)) + else + if (isfactor(cadr(p))) + emit_factor(cadr(p)) + else + emit_subexpr(cadr(p)) + __emit_char('^') + if (isfactor(caddr(p))) + emit_factor(caddr(p)) + else + emit_subexpr(caddr(p)) + return + + # special case: 1 over something + + if (__is_negative(caddr(p))) + x = emit_x + k1 = yindex + __emit_char('1') + k2 = yindex + #level++ + emit_denominator(p, 1) + #level-- + fixup_fraction(x, k1, k2) + return + + k1 = yindex + if (isfactor(cadr(p))) + emit_factor(cadr(p)) + else + emit_subexpr(cadr(p)) + k2 = yindex + level++ + emit_expr(caddr(p)) + level-- + fixup_power(k1, k2) + +# if n == 1 then emit as expr (no parens) + +# p is a power + +emit_denominator = (p, n) -> + k1 = 0 + k2 = 0 + + # special case: 1 over something + + if (isminusone(caddr(p))) + if (n == 1) + emit_expr(cadr(p)) + else + emit_factor(cadr(p)) + return + + k1 = yindex + + # emit base + + if (isfactor(cadr(p))) + emit_factor(cadr(p)) + else + emit_subexpr(cadr(p)) + + k2 = yindex + + # emit exponent, don't emit minus sign + + level++ + + emit_unsigned_expr(caddr(p)) + + level-- + + fixup_power(k1, k2) + +emit_function = (p) -> + if (car(p) == symbol(INDEX) && issymbol(cadr(p))) + emit_index_function(p) + return + + if (car(p) == symbol(FACTORIAL)) + emit_factorial_function(p) + return + + if (car(p) == symbol(DERIVATIVE)) + __emit_char('d') + else + emit_symbol(car(p)) + __emit_char('(') + p = cdr(p) + if (iscons(p)) + emit_expr(car(p)) + p = cdr(p) + while (iscons(p)) + __emit_char(',') + #__emit_char(' ') + emit_expr(car(p)) + p = cdr(p) + __emit_char(')') + +emit_index_function = (p) -> + p = cdr(p) + if (caar(p) == symbol(ADD) || caar(p) == symbol(MULTIPLY) || caar(p) == symbol(POWER) || caar(p) == symbol(FACTORIAL)) + emit_subexpr(car(p)) + else + emit_expr(car(p)) + __emit_char('[') + p = cdr(p) + if (iscons(p)) + emit_expr(car(p)) + p = cdr(p) + while(iscons(p)) + __emit_char(',') + emit_expr(car(p)) + p = cdr(p) + __emit_char(']') + +emit_factorial_function = (p) -> + p = cadr(p) + if (isfraction(p) || car(p) == symbol(ADD) || car(p) == symbol(MULTIPLY) || car(p) == symbol(POWER) || car(p) == symbol(FACTORIAL)) + emit_subexpr(p) + else + emit_expr(p) + __emit_char('!') + +emit_subexpr = (p) -> + __emit_char('(') + emit_expr(p) + __emit_char(')') + +emit_symbol = (p) -> + + i = 0 + if (p == symbol(E)) + __emit_str("exp(1)") + return + + pPrintName = get_printname(p) + for i in [0...pPrintName.length] + __emit_char(pPrintName[i]) + +emit_string = (p) -> + i = 0 + pString = p.str + __emit_char('"') + for i in [0...pString.length] + __emit_char(pString[i]) + __emit_char('"') + +fixup_fraction = (x, k1, k2) -> + dx = 0 + dy = 0 + i = 0 + w = 0 + y = 0 + h1 = 0 + w1 = 0 + y1 = 0 + h2 = 0 + w2 = 0 + y2 = 0 + + [h1,w1,y1] = get_size(k1, k2) + [h2,w2,y2] = get_size(k2, yindex) + + if (w2 > w1) + dx = (w2 - w1) / 2; # shift numerator right + else + dx = 0 + + dx++ + # this is how much is below the baseline + + y = y1 + h1 - 1 + + dy = -y - 1 + + move(k1, k2, dx, dy) + + if (w2 > w1) + dx = -w1 + else + dx = -w1 + (w1 - w2) / 2 + + dx++ + dy = -y2 + 1 + + move(k2, yindex, dx, dy) + + if (w2 > w1) + w = w2 + else + w = w1 + + w+=2 + emit_x = x + + for i in [0...w] + __emit_char('-') + +fixup_power = (k1, k2) -> + dy = 0 + h1 = 0 + w1 = 0 + y1 = 0 + h2 = 0 + w2 = 0 + y2 = 0 + + [h1,w1,y1] = get_size(k1, k2) + [h2,w2,y2] = get_size(k2, yindex) + + # move superscript to baseline + + dy = -y2 - h2 + 1 + + # now move above base + + dy += y1 - 1 + + move(k2, yindex, 0, dy) + +move = (j, k, dx, dy) -> + i = 0 + for i in [j...k] + chartab[i].x += dx + chartab[i].y += dy + +# finds the bounding rectangle and vertical position + +get_size = (j, k)-> + i = 0 + min_x = chartab[j].x + max_x = chartab[j].x + min_y = chartab[j].y + max_y = chartab[j].y + for i in [(j + 1)...k] + if (chartab[i].x < min_x) + min_x = chartab[i].x + if (chartab[i].x > max_x) + max_x = chartab[i].x + if (chartab[i].y < min_y) + min_y = chartab[i].y + if (chartab[i].y > max_y) + max_y = chartab[i].y + h = max_y - min_y + 1 + w = max_x - min_x + 1 + y = min_y + return [h,w,y] + +displaychar = (c) -> + __emit_char(c) + +__emit_char = (c) -> + if (yindex == YMAX) + return + if !chartab[yindex]? + debugger + chartab[yindex].c = c + chartab[yindex].x = emit_x + chartab[yindex].y = 0 + yindex++ + emit_x++ + +__emit_str = (s) -> + i = 0 + for i in [0...s.length] + __emit_char(s[i]) + +emit_number = (p, emit_sign) -> + tmpString = "" + i = 0 + switch (p.k) + when NUM + tmpString = p.q.a.toString() + if (tmpString[0] == '-' && emit_sign == 0) + tmpString = tmpString.substring(1) + for i in [0...tmpString.length] + __emit_char(tmpString[i]) + tmpString = p.q.b.toString() + if (tmpString == "1") + break + __emit_char('/') + for i in [0...tmpString.length] + __emit_char(tmpString[i]) + + when DOUBLE + tmpString = doubleToReasonableString(p.d) + if (tmpString[0] == '-' && emit_sign == 0) + tmpString = tmpString.substring(1) + for i in [0...tmpString.length] + __emit_char(tmpString[i]) + +# a and b are glyphs +cmpGlyphs = (a, b) -> + + if (a.y < b.y) + return -1 + + if (a.y > b.y) + return 1 + + if (a.x < b.x) + return -1 + + if (a.x > b.x) + return 1 + + return 0 + +print_glyphs = -> + + i = 0 + accumulator = "" + + # now sort the glyphs by their vertical positions, + # since we are going to build a string where obviously the + # "upper" line has to printed out first, followed by + # a new line, followed by the other lines. + #qsort(chartab, yindex, sizeof (struct glyph), __cmp) + subsetOfStack = chartab.slice(0,yindex) + subsetOfStack.sort(cmpGlyphs) + chartab = [].concat(subsetOfStack).concat(chartab.slice(yindex)) + + x = 0 + + y = chartab[0].y + + for i in [0...yindex] + + while (chartab[i].y > y) + accumulator += printchar('\n') + x = 0 + y++ + + while (chartab[i].x > x) + accumulator += printchar_nowrap(' ') + x++ + + accumulator += printchar_nowrap(chartab[i].c) + + x++ + + return accumulator + +buffer = "" + +getdisplaystr = -> + yindex = 0 + level = 0 + emit_x = 0 + emit_expr(pop()) + fill_buf() + return buffer + +fill_buf = -> + tmpBuffer = buffer + sIndex = 0 + i = 0 + + #qsort(chartab, yindex, sizeof (struct glyph), __cmp) + subsetOfStack = chartab.slice(0,yindex) + subsetOfStack.sort(cmpGlyphs) + chartab = [].concat(subsetOfStack).concat(chartab.slice(yindex)) + + x = 0 + + y = chartab[0].y + + for i in [0...yindex] + + while (chartab[i].y > y) + tmpBuffer[sIndex++] = '\n' + x = 0 + y++ + + while (chartab[i].x > x) + tmpBuffer[sIndex++] = ' ' + x++ + + tmpBuffer[sIndex++] = chartab[i].c + + x++ + + tmpBuffer[sIndex++] = '\n' + + +N = 100 + +class oneElement + x: 0 + y: 0 + h: 0 + w: 0 + index: 0 + count: 0 + +elem = [] +for elelmIndex in [0...10000] + elem[elelmIndex] = new oneElement + +SPACE_BETWEEN_COLUMNS = 3 +SPACE_BETWEEN_ROWS = 1 + +emit_tensor = (p) -> + i = 0 + n = 0 + nrow = 0 + ncol = 0 + x = 0 + y = 0 + h = 0 + w = 0 + dx = 0 + dy = 0 + eh = 0 + ew = 0 + row = 0 + col = 0 + + if (p.tensor.ndim > 2) + emit_flat_tensor(p) + return + + nrow = p.tensor.dim[0] + + if (p.tensor.ndim == 2) + ncol = p.tensor.dim[1] + else + ncol = 1 + + n = nrow * ncol + + if (n > N) + emit_flat_tensor(p) + return + + # horizontal coordinate of the matrix + + #if 0 + #emit_x += 2; # make space for left paren + #endif + + x = emit_x + + # emit each element + + for i in [0...n] + elem[i].index = yindex + elem[i].x = emit_x + emit_expr(p.tensor.elem[i]) + elem[i].count = yindex - elem[i].index + [elem[i].h, elem[i].w, elem[i].y] = get_size(elem[i].index, yindex) + + # find element height and width + + eh = 0 + ew = 0 + + for i in [0...n] + if (elem[i].h > eh) + eh = elem[i].h + if (elem[i].w > ew) + ew = elem[i].w + + # this is the overall height of the matrix + + h = nrow * eh + (nrow - 1) * SPACE_BETWEEN_ROWS + + # this is the overall width of the matrix + + w = ncol * ew + (ncol - 1) * SPACE_BETWEEN_COLUMNS + + # this is the vertical coordinate of the matrix + + y = -(h / 2) + + # move elements around + + for row in [0...nrow] + for col in [0...ncol] + + i = row * ncol + col + + # first move to upper left corner of matrix + + dx = x - elem[i].x + dy = y - elem[i].y + + move(elem[i].index, elem[i].index + elem[i].count, dx, dy) + + # now move to official position + + dx = 0 + + if (col > 0) + dx = col * (ew + SPACE_BETWEEN_COLUMNS) + + dy = 0 + + if (row > 0) + dy = row * (eh + SPACE_BETWEEN_ROWS) + + # small correction for horizontal centering + + dx += (ew - elem[i].w) / 2 + + # small correction for vertical centering + + dy += (eh - elem[i].h) / 2 + + move(elem[i].index, elem[i].index + elem[i].count, dx, dy) + + emit_x = x + w + + ### + if 0 + + # left brace + + for (i = 0; i < h; i++) { + if (yindex == YMAX) + break + chartab[yindex].c = '|' + chartab[yindex].x = x - 2 + chartab[yindex].y = y + i + yindex++ + } + + # right brace + + emit_x++ + + for (i = 0; i < h; i++) { + if (yindex == YMAX) + break + chartab[yindex].c = '|' + chartab[yindex].x = emit_x + chartab[yindex].y = y + i + yindex++ + } + + emit_x++ + + endif + ### + + +emit_flat_tensor = (p) -> + emit_tensor_inner(p, 0, 0) + +emit_tensor_inner = (p, j, k) -> + i = 0 + __emit_char('(') + for i in [0...p.tensor.dim[j]] + if (j + 1 == p.tensor.ndim) + emit_expr(p.tensor.elem[k]) + k = k + 1 + else + k = emit_tensor_inner(p, j + 1, k) + if (i + 1 < p.tensor.dim[j]) + __emit_char(',') + __emit_char(')') + return k + + diff --git a/node_modules/algebrite/sources/product.coffee b/node_modules/algebrite/sources/product.coffee new file mode 100644 index 0000000..58ec7ab --- /dev/null +++ b/node_modules/algebrite/sources/product.coffee @@ -0,0 +1,59 @@ +# 'product' function + +#define A p3 +#define B p4 +#define I p5 +#define X p6 + +# leaves the product at the top of the stack + +Eval_product = -> + i = 0 + j = 0 + k = 0 + + # 1st arg + body = cadr(p1) + + # 2nd arg (index) + indexVariable = caddr(p1) + if (!issymbol(indexVariable)) + stop("sum: 2nd arg?") + + # 3rd arg (lower limit) + push(cadddr(p1)) + Eval() + j = pop_integer() + if (isNaN(j)) + push p1 + return + + # 4th arg (upper limit) + push(caddddr(p1)) + Eval() + k = pop_integer() + if (isNaN(k)) + push p1 + return + + # remember contents of the index + # variable so we can put it back after the loop + oldIndexVariableValue = get_binding(indexVariable) + + push_integer(1) + + for i in [j..k] + push_integer(i) + p5 = pop() + set_binding(indexVariable, p5) + push(body) + Eval() + if DEBUG + console.log "product - factor 1: " + stack[tos-1].toString() + console.log "product - factor 2: " + stack[tos-2].toString() + multiply() + if DEBUG + console.log "product - result: " + stack[tos-1].toString() + + # put back the index variable to original content + set_binding(indexVariable, oldIndexVariableValue) diff --git a/node_modules/algebrite/sources/qadd.coffee b/node_modules/algebrite/sources/qadd.coffee new file mode 100644 index 0000000..cdc07b9 --- /dev/null +++ b/node_modules/algebrite/sources/qadd.coffee @@ -0,0 +1,61 @@ +# Add rational numbers +# +# Input: tos-2 addend +# +# tos-1 addend +# +# Output: sum on stack + + + +qadd = -> + # a, qadd_ab, b, qadd_ba, c are all bigNum + # we are adding the fractions qadd_frac1 + qadd_frac2 i.e. + # qadd_frac1.q.a/qadd_frac1.q.b + qadd_frac2.q.a/qadd_frac2.q.b + + qadd_frac2 = pop() + qadd_frac1 = pop() + + qadd_ab = mmul(qadd_frac1.q.a, qadd_frac2.q.b) + qadd_ba = mmul(qadd_frac1.q.b, qadd_frac2.q.a) + + qadd_numerator = madd(qadd_ab, qadd_ba) + + #mfree(qadd_ab) + #mfree(qadd_ba) + + # zero? + + if (MZERO(qadd_numerator)) + #console.log "qadd IS ZERO" + #mfree(qadd_numerator) + push(zero) + return + + qadd_denominator = mmul(qadd_frac1.q.b, qadd_frac2.q.b) + + gcdBetweenNumeratorAndDenominator = mgcd(qadd_numerator, qadd_denominator) + #console.log "gcd("+qadd_numerator+","+qadd_denominator+"): " + gcdBetweenNumeratorAndDenominator + + gcdBetweenNumeratorAndDenominator = makeSignSameAs(gcdBetweenNumeratorAndDenominator,qadd_denominator) + + #console.log "qadd qadd_denominator: " + qadd_denominator + #console.log "qadd gcdBetweenNumeratorAndDenominator: " + gcdBetweenNumeratorAndDenominator + + resultSum = new U() + + resultSum.k = NUM + + resultSum.q.a = mdiv(qadd_numerator, gcdBetweenNumeratorAndDenominator) + resultSum.q.b = mdiv(qadd_denominator, gcdBetweenNumeratorAndDenominator) + + #console.log "qadd resultSum.q.a: " + resultSum.q.a + #console.log "qadd resultSum.q.b: " + resultSum.q.b + + #mfree(qadd_numerator) + #mfree(qadd_denominator) + #mfree(gcdBetweenNumeratorAndDenominator) + + push(resultSum) + #console.log "qadd result: " + resultSum + diff --git a/node_modules/algebrite/sources/qdiv.coffee b/node_modules/algebrite/sources/qdiv.coffee new file mode 100644 index 0000000..0fe01b2 --- /dev/null +++ b/node_modules/algebrite/sources/qdiv.coffee @@ -0,0 +1,44 @@ +# Divide rational numbers +# +# Input: tos-2 dividend +# +# tos-1 divisor +# +# Output: quotient on stack + + + +qdiv = -> + save() + + p2 = pop() + p1 = pop() + + # zero? + + if (MZERO(p2.q.a)) + stop("divide by zero") + + if (MZERO(p1.q.a)) + push(zero) + restore() + return + + aa = mmul(p1.q.a, p2.q.b) + bb = mmul(p1.q.b, p2.q.a) + + c = mgcd(aa, bb) + + c = makeSignSameAs(c,bb) + + p1 = new U() + + p1.k = NUM + + p1.q.a = mdiv(aa, c) + p1.q.b = mdiv(bb, c) + + + push(p1) + + restore() diff --git a/node_modules/algebrite/sources/qmul.coffee b/node_modules/algebrite/sources/qmul.coffee new file mode 100644 index 0000000..2677b8a --- /dev/null +++ b/node_modules/algebrite/sources/qmul.coffee @@ -0,0 +1,43 @@ +# Multiply rational numbers +# +# Input: tos-2 multiplicand +# +# tos-1 multiplier +# +# Output: product on stack + + + +qmul = -> + save() + + p2 = pop() + p1 = pop() + + # zero? + + if (MZERO(p1.q.a) || MZERO(p2.q.a)) + push(zero) + restore() + return + + aa = mmul(p1.q.a, p2.q.a) + bb = mmul(p1.q.b, p2.q.b) + + c = mgcd(aa, bb) + + c = makeSignSameAs(c,bb) + + p1 = new U() + + p1.k = NUM + + p1.q.a = mdiv(aa, c) + p1.q.b = mdiv(bb, c) + + #mfree(aa) + #mfree(bb) + + push(p1) + + restore() diff --git a/node_modules/algebrite/sources/qpow.coffee b/node_modules/algebrite/sources/qpow.coffee new file mode 100644 index 0000000..7867cca --- /dev/null +++ b/node_modules/algebrite/sources/qpow.coffee @@ -0,0 +1,236 @@ +# Rational power function + + + +qpow = -> + save() + qpowf() + restore() + +#define BASE p1 +#define EXPO p2 + +qpowf = -> + expo = 0 + #unsigned int a, b, *t, *x, *y + + p2 = pop(); # p2 is EXPO + p1 = pop(); # p1 is BASE + + # if base is 1 or exponent is 0 then return 1 + if (isplusone(p1) || isZeroAtomOrTensor(p2)) # p1 is BASE # p2 is EXPO + push_integer(1) + return + + # if (-1)^(1/2) -> leave it as is + if (isminusone(p1) and isoneovertwo(p2)) # p1 is BASE # p2 is EXPO + push(imaginaryunit) + return + + # if base is zero then return 0 + if (isZeroAtomOrTensor(p1)) # p1 is BASE + if (isnegativenumber(p2)) # p2 is EXPO + stop("divide by zero") + push(zero) + return + + # if exponent is 1 then return base + if (isplusone(p2)) # p2 is EXPO + push(p1); # p1 is BASE + return + + # if exponent is integer then power + if (isinteger(p2)) # p2 is EXPO + push(p2); # p2 is EXPO + expo = pop_integer() + if isNaN(expo) + # expo greater than 32 bits + push_symbol(POWER) + push(p1); # p1 is BASE + push(p2); # p2 is EXPO + list(3) + return + + x = mpow(p1.q.a, Math.abs(expo)); # p1 is BASE + y = mpow(p1.q.b, Math.abs(expo)); # p1 is BASE + if (expo < 0) + t = x + x = y + y = t + x = makeSignSameAs(x,y) + y = makePositive(y) + + p3 = new U() + p3.k = NUM + p3.q.a = x + p3.q.b = y + push(p3) + return + + # from here on out the exponent is NOT an integer + + # if base is -1 then normalize polar angle + if (isminusone(p1)) # p1 is BASE + push(p2); # p2 is EXPO + normalize_angle() + return + + # if base is negative then (-N)^M -> N^M * (-1)^M + if (isnegativenumber(p1)) # p1 is BASE + push(p1); # p1 is BASE + negate() + push(p2); # p2 is EXPO + qpow() + + push_integer(-1) + push(p2); # p2 is EXPO + qpow() + + multiply() + return + + # if p1 (BASE) is not an integer then power numerator and denominator + if (!isinteger(p1)) # p1 is BASE + push(p1); # p1 is BASE + mp_numerator() + push(p2); # p2 is EXPO + qpow() + push(p1); # p1 is BASE + mp_denominator() + push(p2); # p2 is EXPO + negate() + qpow() + multiply() + return + + # At this point p1 (BASE) is a positive integer. + + # If p1 (BASE) is small then factor it. + if (is_small_integer(p1)) # p1 is BASE + push(p1); # p1 is BASE + push(p2); # p2 is EXPO + quickfactor() + return + + # At this point p1 (BASE) is a positive integer and p2 (EXPO) is not an integer. + + if ( !isSmall(p2.q.a) || !isSmall(p2.q.b) ) # p2 is EXPO + push_symbol(POWER) + push(p1) # p1 is BASE + push(p2); # p2 is EXPO + list(3) + return + + a = p2.q.a; # p2 is EXPO + b = p2.q.b; # p2 is EXPO + + x = mroot(p1.q.a, b); # p1 is BASE + + if (x == 0) + push_symbol(POWER) + push(p1); # p1 is BASE + push(p2); # p2 is EXPO + list(3) + return + + y = mpow(x, a) + + #mfree(x) + + p3 = new U() + + p3.k = NUM + + if (p2.q.a.isNegative()) # p2 is EXPO + p3.q.a = bigInt(1) + p3.q.b = y + else + p3.q.a = y + p3.q.b = bigInt(1) + + push(p3) + +#----------------------------------------------------------------------------- +# +# Normalize the angle of unit imaginary, i.e. (-1) ^ N +# +# Input: N on stack (must be rational, not float) +# +# Output: Result on stack +# +# Note: +# +# n = q * d + r +# +# Example: +# n d q r +# +# (-1)^(8/3) -> (-1)^(2/3) 8 3 2 2 +# (-1)^(7/3) -> (-1)^(1/3) 7 3 2 1 +# (-1)^(5/3) -> -(-1)^(2/3) 5 3 1 2 +# (-1)^(4/3) -> -(-1)^(1/3) 4 3 1 1 +# (-1)^(2/3) -> (-1)^(2/3) 2 3 0 2 +# (-1)^(1/3) -> (-1)^(1/3) 1 3 0 1 +# +# (-1)^(-1/3) -> -(-1)^(2/3) -1 3 -1 2 +# (-1)^(-2/3) -> -(-1)^(1/3) -2 3 -1 1 +# (-1)^(-4/3) -> (-1)^(2/3) -4 3 -2 2 +# (-1)^(-5/3) -> (-1)^(1/3) -5 3 -2 1 +# (-1)^(-7/3) -> -(-1)^(2/3) -7 3 -3 2 +# (-1)^(-8/3) -> -(-1)^(1/3) -8 3 -3 1 +# +#----------------------------------------------------------------------------- + +#define A p1 +#define Q p2 +#define R p3 + +normalize_angle = -> + save() + + p1 = pop(); # p1 is A + + # integer exponent? + + if (isinteger(p1)) # p1 is A + if (p1.q.a.isOdd()) # p1 is A + push_integer(-1); # odd exponent + else + push_integer(1); # even exponent + restore() + return + + # floor + + push(p1); # p1 is A + bignum_truncate() + p2 = pop(); # p2 is Q + + if (isnegativenumber(p1)) # p1 is A + push(p2) # p2 is Q + push_integer(-1) + add() + p2 = pop(); # p2 is Q + + # remainder (always positive) + + push(p1); # p1 is A + push(p2); # p2 is Q + subtract() + p3 = pop(); # p3 is R + + # remainder becomes new angle + push_symbol(POWER) + push_integer(-1) + push(p3) # p3 is R + list(3) + + # negate if quotient is odd + + if (p2.q.a.isOdd()) # p2 is Q + negate() + + restore() + +is_small_integer = (p) -> + return isSmall(p.q.a) diff --git a/node_modules/algebrite/sources/quickfactor.coffee b/node_modules/algebrite/sources/quickfactor.coffee new file mode 100644 index 0000000..08a3deb --- /dev/null +++ b/node_modules/algebrite/sources/quickfactor.coffee @@ -0,0 +1,107 @@ +#----------------------------------------------------------------------------- +# +# Factor small numerical powers +# +# Input: tos-2 Base (positive integer < 2^31 - 1) +# +# tos-1 Exponent +# +# Output: Expr on stack +# +#----------------------------------------------------------------------------- + + + +#define BASE p1 +#define EXPO p2 + + +quickfactor = -> + i = 0 + save() + + p2 = pop(); # p2 is EXPO + p1 = pop(); # p1 is BASE + + h = tos + + push(p1); # p1 is BASE + + factor_small_number() + + n = tos - h + + stackIndex = h + + for i in [0...n] by 2 + push(stack[stackIndex+i]); # factored base + push(stack[stackIndex + i + 1]); # factored exponent + push(p2); # p2 is EXPO + multiply() + quickpower() + + # stack has n results from factor_number_raw() + + # on top of that are all the expressions from quickpower() + + # multiply the quickpower() results + + multiply_all(tos - h - n) + + p1 = pop() + + moveTos h + + push(p1) + + restore() + +# p1 (BASE) is a prime number so power is simpler + +quickpower = -> + expo = 0 + + save() + + p2 = pop(); # p2 is EXPO + p1 = pop(); # p1 is BASE + + push(p2); # p2 is EXPO + bignum_truncate() + p3 = pop() + + push(p2); # p2 is EXPO + push(p3) + subtract() + p4 = pop() + + # fractional part of p2 (EXPO) + + if (!isZeroAtomOrTensor(p4)) + push_symbol(POWER) + push(p1); # p1 is BASE + push(p4) + list(3) + + push(p3) + expo = pop_integer() + + if (isNaN(expo)) + push_symbol(POWER) + push(p1); # p1 is BASE + push(p3) + list(3) + restore() + return + + if (expo == 0) + restore() + return + + push(p1); # p1 is BASE + bignum_power_number(expo) + + restore() + +#if SELFTEST + diff --git a/node_modules/algebrite/sources/quotient.coffee b/node_modules/algebrite/sources/quotient.coffee new file mode 100644 index 0000000..3922250 --- /dev/null +++ b/node_modules/algebrite/sources/quotient.coffee @@ -0,0 +1,105 @@ +# Divide polynomials + + + +Eval_quotient = -> + push(cadr(p1)); # 1st arg, p(x) + Eval() + + push(caddr(p1)); # 2nd arg, q(x) + Eval() + + push(cadddr(p1)); # 3rd arg, x + Eval() + + p1 = pop(); # default x + if (p1 == symbol(NIL)) + p1 = symbol(SYMBOL_X) + push(p1) + + divpoly() + +#----------------------------------------------------------------------------- +# +# Divide polynomials +# +# Input: tos-3 Dividend +# +# tos-2 Divisor +# +# tos-1 x +# +# Output: tos-1 Quotient +# +#----------------------------------------------------------------------------- + +#define DIVIDEND p1 +#define DIVISOR p2 +#define X p3 +#define Q p4 +#define QUOTIENT p5 + +divpoly = -> + h = 0 + i = 0 + m = 0 + n = 0 + x = 0 + #U **dividend, **divisor + + save() + + p3 = pop() + p2 = pop() + p1 = pop() + + h = tos + + dividend = tos + + m = coeff(p3, p1) - 1; # m is dividend's power + + divisor = tos + + n = coeff(p3, p2) - 1; # n is divisor's power + + x = m - n + + push_integer(0) + p5 = pop() + + while (x >= 0) + + push(stack[dividend+m]) + push(stack[divisor+n]) + divide() + p4 = pop() + + for i in [0..n] + push(stack[dividend+x + i]) + push(stack[divisor+i]) + push(p4) + multiply() + subtract() + stack[dividend+x + i] = pop() + + push(p5) + push(p4) + push(p3) + push_integer(x) + power() + multiply() + add() + p5 = pop() + + m-- + x-- + + moveTos h + + push(p5) + + restore() + + + diff --git a/node_modules/algebrite/sources/rationalize.coffee b/node_modules/algebrite/sources/rationalize.coffee new file mode 100644 index 0000000..8df6df8 --- /dev/null +++ b/node_modules/algebrite/sources/rationalize.coffee @@ -0,0 +1,148 @@ + +DEBUG_RATIONALIZE = false + +Eval_rationalize = -> + push(cadr(p1)) + Eval() + rationalize() + +rationalize = -> + x = expanding + yyrationalize() + expanding = x + +yyrationalize = -> + theArgument = pop() + + if (istensor(theArgument)) + __rationalize_tensor(theArgument) + return + + expanding = 0 + + if (car(theArgument) != symbol(ADD)) + push(theArgument) + return + + if DEBUG_RATIONALIZE then console.log("rationalize: this is the input expr: " + theArgument) + + # get new denominator + + push(one) + multiply_denominators(theArgument) + commonDenominator = pop() + + if DEBUG_RATIONALIZE then console.log("rationalize: this is the new denominator: " + commonDenominator) + + # multiply each term by new denominator + + push(zero) + eachTerm = cdr(theArgument) + while (iscons(eachTerm)) + if DEBUG_RATIONALIZE then console.log("term: " + car(eachTerm)) + push(commonDenominator) + push(car(eachTerm)) + multiply() + add() + eachTerm = cdr(eachTerm) + + if DEBUG_RATIONALIZE then console.log("rationalize: original terms times new denominator: " + stack[tos - 1]) + + # collect common factors + + Condense() + + if DEBUG_RATIONALIZE then console.log("rationalize: after factoring: " + stack[tos - 1]) + + # divide by common denominator + + push(commonDenominator) + divide() + + if DEBUG_RATIONALIZE then console.log("rationalize: after dividing by new denom. (and we're done): " + stack[tos - 1]) + +multiply_denominators = (p) -> + if (car(p) == symbol(ADD)) + p = cdr(p) + while (iscons(p)) + multiply_denominators_term(car(p)) + p = cdr(p) + else + multiply_denominators_term(p) + +multiply_denominators_term = (p) -> + if (car(p) == symbol(MULTIPLY)) + p = cdr(p) + while (iscons(p)) + multiply_denominators_factor(car(p)) + p = cdr(p) + else + multiply_denominators_factor(p) + +multiply_denominators_factor = (p) -> + if (car(p) != symbol(POWER)) + return + + push(p) + + p = caddr(p) + + # like x^(-2) ? + + if (isnegativenumber(p)) + inverse() + __lcm() + return + + # like x^(-a) ? + + if (car(p) == symbol(MULTIPLY) && isnegativenumber(cadr(p))) + inverse() + __lcm() + return + + # no match + + pop() + +__rationalize_tensor = (theTensor) -> + + i = 0 + push(theTensor) + + Eval(); # makes a copy + + theTensor = pop() + + if (!istensor(theTensor)) # might be zero + push(theTensor) + return + + n = theTensor.tensor.nelem + + for i in [0...n] + push(theTensor.tensor.elem[i]) + rationalize() + theTensor.tensor.elem[i] = pop() + + check_tensor_dimensions theTensor + + push(theTensor) + + + +__lcm = -> + save() + + p1 = pop() + p2 = pop() + + push(p1) + push(p2) + multiply() + push(p1) + push(p2) + gcd() + divide() + + restore() diff --git a/node_modules/algebrite/sources/real.coffee b/node_modules/algebrite/sources/real.coffee new file mode 100644 index 0000000..7c2cd26 --- /dev/null +++ b/node_modules/algebrite/sources/real.coffee @@ -0,0 +1,30 @@ +### + Returns the real part of complex z + + z real(z) + - ------- + + a + i b a + + exp(i a) cos(a) +### + + + +Eval_real = -> + push(cadr(p1)) + Eval() + real() + +real = -> + save() + rect() + p1 = pop() + push(p1) + push(p1) + conjugate() + add() + push_integer(2) + divide() + restore() + diff --git a/node_modules/algebrite/sources/rect.coffee b/node_modules/algebrite/sources/rect.coffee new file mode 100644 index 0000000..6672b6a --- /dev/null +++ b/node_modules/algebrite/sources/rect.coffee @@ -0,0 +1,100 @@ +### +Convert complex z to rectangular form + + Input: push z + + Output: Result on stack +### + + +DEBUG_RECT = false + +Eval_rect = -> + push(cadr(p1)) + Eval() + rect() + +rect = -> + save() + p1 = pop() + input = p1 + + if DEBUG_RECT then console.log "RECT of " + input + + if DEBUG_RECT then console.log "any clock forms in : " + input + " ? " + findPossibleClockForm(input) + + + # if we assume real variables, then the + # rect of any symbol is the symbol itself + # (note that 'i' is not a symbol, it's made of (-1)^(1/2)) + # otherwise we have to leave unevalled + if issymbol(p1) + if DEBUG_RECT then console.log " rect: simple symbol: " + input + if !isZeroAtomOrTensor(get_binding(symbol(ASSUME_REAL_VARIABLES))) + push(p1) + else + push_symbol(YYRECT) + push(p1) + list(2) + + # TODO this is quite dirty, ideally we don't need this + # but removing this creates a few failings in the tests + # that I can't investigate right now. + # -- + # if we assume all variables are real AND + # it's not an exponential nor a polar nor a clock form + # THEN rect(_) = _ + # note that these matches can be quite sloppy, one can find expressions + # which shouldn't match but do + # + else if !isZeroAtomOrTensor(get_binding(symbol(ASSUME_REAL_VARIABLES))) and + !findPossibleExponentialForm(p1) and # no exp form? + !findPossibleClockForm(p1) and # no clock form? + !(Find(p1, symbol(SIN)) and Find(p1, symbol(COS)) and Find(p1, imaginaryunit)) # no polar form? + if DEBUG_RECT then console.log " rect: simple symbol: " + input + push(p1) + + # ib + else if (car(p1) == symbol(MULTIPLY) and isimaginaryunit(cadr(p1)) and !isZeroAtomOrTensor(get_binding(symbol(ASSUME_REAL_VARIABLES)))) + push(p1) + + # sum + else if (car(p1) == symbol(ADD)) + if DEBUG_RECT then console.log " rect - " + input + " is a sum " + push_integer(0) + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + rect() + add() + p1 = cdr(p1) + + else + # try to get to the rectangular form by doing + # abs(p1) * (cos (theta) + i * sin(theta)) + # where theta is arg(p1) + if DEBUG_RECT then console.log " rect - " + input + " is NOT a sum " + + push(p1); # abs(z) * (cos(arg(z)) + i sin(arg(z))) + abs() + + if DEBUG_RECT then console.log " rect - " + input + " abs: " + stack[tos-1].toString() + push(p1) + arg() + if DEBUG_RECT then console.log " rect - " + input + " arg of " + p1 + " : " + stack[tos-1].toString() + p1 = pop() + push(p1) + cosine() + if DEBUG_RECT then console.log " rect - " + input + " cosine: " + stack[tos-1].toString() + push(imaginaryunit) + push(p1) + sine() + if DEBUG_RECT then console.log " rect - " + input + " sine: " + stack[tos-1].toString() + multiply() + if DEBUG_RECT then console.log " rect - " + input + " i * sine: " + stack[tos-1].toString() + add() + if DEBUG_RECT then console.log " rect - " + input + " cos + i * sine: " + stack[tos-1].toString() + multiply() + restore() + if DEBUG_RECT then console.log "rect of " + input + " : " + stack[tos-1] + diff --git a/node_modules/algebrite/sources/roots.coffee b/node_modules/algebrite/sources/roots.coffee new file mode 100644 index 0000000..0b19cf2 --- /dev/null +++ b/node_modules/algebrite/sources/roots.coffee @@ -0,0 +1,1830 @@ + + + +#define POLY p1 +#define X p2 +#define A p3 +#define B p4 +#define C p5 +#define Y p6 + +show_power_debug = false +performing_roots = false + +Eval_roots = -> + + # this transforms simple "equation" forms into + # something that can be processed. E.g., say, y = 3x - 2 + # A == B -> A - B + # A = B -> A - B + p2 = cadr(p1) + if (car(p2) == symbol(SETQ) || car(p2) == symbol(TESTEQ)) + push(cadr(p2)) + Eval() + push(caddr(p2)) + Eval() + subtract() + else + push(p2) + Eval() + p2 = pop() + if (car(p2) == symbol(SETQ) || car(p2) == symbol(TESTEQ)) + push(cadr(p2)) + Eval() + push(caddr(p2)) + Eval() + subtract() + else + push(p2) + + # 2nd arg, x + + push(caddr(p1)) + Eval() + p2 = pop() + if (p2 == symbol(NIL)) + guess() + else + push(p2) + + p2 = pop() + p1 = pop() + + if (!ispolyexpandedform(p1, p2)) + stop("roots: 1st argument is not a polynomial in the variable " + p2) + + push(p1) + push(p2) + + roots() + + +hasImaginaryCoeff = (k) -> + + #polycoeff = tos + + + imaginaryCoefficients = false + h = tos + for i in [k...0] by -1 + #console.log "hasImaginaryCoeff - coeff.:" + stack[tos-i].toString() + if iscomplexnumber(stack[tos-i]) + imaginaryCoefficients = true + break + return imaginaryCoefficients + +isSimpleRoot = (k) -> + + #polycoeff = tos + + + #tos-n Coefficient of x^0 + #tos-1 Coefficient of x^(n-1) + + if k > 2 + isSimpleRootPolynomial = true + h = tos + + if isZeroAtomOrTensor(stack[tos-k]) + isSimpleRootPolynomial = false + + for i in [(k-1)...1] by -1 + #console.log "hasImaginaryCoeff - coeff.:" + stack[tos-i].toString() + if !isZeroAtomOrTensor(stack[tos-i]) + isSimpleRootPolynomial = false + break + else + isSimpleRootPolynomial = false + + return isSimpleRootPolynomial + + +normalisedCoeff = (variable, polynomial) -> + k = coeff(variable, polynomial) + #console.log("->" + tos) + divideBy = stack[tos-1] + miniStack = [] + for i in [1..k] + miniStack.push(pop()) + #console.log(tos) + + for i in [(k-1)..0] + push(miniStack[i]) + push(divideBy) + divide() + #console.log(tos) + return k + + + +# takes the polynomial and the +# variable on the stack + +roots = -> + h = 0 + i = 0 + n = 0 + + if DEBUG then console.log "roots: " + stack[tos-1].toString() + " " + stack[tos-2].toString() + + save() + + # the simplification of nested radicals uses + # "roots", which in turn uses simplification + # of nested radicals. Usually there is no problem, + # one level of recursion does the job. Beyond that, + # we probably got stuck in a strange case of infinite + # recursion, so bail out and return NIL. + if recursionLevelNestedRadicalsRemoval > 1 + pop() + pop() + push(symbol(NIL)) + restore() + return + + performing_roots = true + h = tos - 2 + + if DEBUG then console.log("roots checking if " + stack[tos-1].toString() + " is a case of simple roots") + + p2 = pop() + p1 = pop() + + push(p1) + push(p2) + + k = normalisedCoeff(p2, p1) + + if isSimpleRoot(k) + if DEBUG then console.log("yes, " + stack[tos-1].toString() + " is a case of simple roots") + lastCoeff = stack[tos-k] + leadingCoeff = stack[tos-1] + moveTos tos - k + pop() + pop() + getSimpleRoots(k, leadingCoeff, lastCoeff) + else + moveTos tos - k + roots2() + + n = tos - h + if (n == 0) + stop("roots: the polynomial is not factorable, try nroots") + if (n == 1) + performing_roots = false + restore() + return + sort_stack(n) + p1 = alloc_tensor(n) + p1.tensor.ndim = 1 + p1.tensor.dim[0] = n + for i in [0...n] + p1.tensor.elem[i] = stack[h + i] + moveTos h + push(p1) + restore() + performing_roots = false + +# ok to generate these roots take a look at their form +# in the case of even and odd exponents here: +# http://www.wolframalpha.com/input/?i=roots+x%5E14+%2B+1 +# http://www.wolframalpha.com/input/?i=roots+ax%5E14+%2B+b +# http://www.wolframalpha.com/input/?i=roots+x%5E15+%2B+1 +# http://www.wolframalpha.com/input/?i=roots+a*x%5E15+%2B+b +getSimpleRoots = (n, leadingCoeff, lastCoeff) -> + if DEBUG then console.log("getSimpleRoots") + save() + + #tos-n Coefficient of x^0 + #tos-1 Coefficient of x^(n-1) + + n = n-1 + + push(lastCoeff) + push_rational(1,n) + power() + + push(leadingCoeff) + push_rational(1,n) + power() + divide() + + commonPart = pop() + + if n % 2 == 0 + for rootsOfOne in [1..n] by 2 + push(commonPart) + push_integer(-1) + push_rational(rootsOfOne,n) + power() + multiply() + aSol = pop() + push(aSol) + push(aSol) + negate() + else + for rootsOfOne in [1..n] + push(commonPart) + push_integer(-1) + push_rational(rootsOfOne,n) + power() + multiply() + if rootsOfOne % 2 == 0 + negate() + + + restore() + +roots2 = -> + save() + + if DEBUG then console.log "roots2: " + stack[tos-1].toString() + " " + stack[tos-2].toString() + + p2 = pop() # the polynomial variable + p1 = pop() # the polynomial + + push(p1) + push(p2) + + k = normalisedCoeff(p2, p1) + + if !hasImaginaryCoeff(k) + moveTos tos - k + factorpoly() + p1 = pop() + else + moveTos tos - k + pop() + pop() + + + if (car(p1) == symbol(MULTIPLY)) + p1 = cdr(p1) + # scan through all the factors + # and find the roots of each of them + while (iscons(p1)) + push(car(p1)) + push(p2) + roots3() + p1 = cdr(p1) + else + push(p1) + push(p2) + roots3() + + restore() + +roots3 = -> + save() + p2 = pop() + p1 = pop() + if (car(p1) == symbol(POWER) && ispolyexpandedform(cadr(p1), p2) && isposint(caddr(p1))) + n = normalisedCoeff(p2, cadr(p1)) + mini_solve(n) + else if (ispolyexpandedform(p1, p2)) + n = normalisedCoeff(p2, p1) + mini_solve(n) + restore() + +#----------------------------------------------------------------------------- +# +# Input: stack[tos - 2] polynomial +# +# stack[tos - 1] dependent symbol +# +# Output: stack roots on stack +# +# (input args are popped first) +# +#----------------------------------------------------------------------------- + +# note that for many quadratic, cubic and quartic polynomials we don't +# actually end up using the quadratic/cubic/quartic formulas in here, +# since there is a chance we factored the polynomial and in so +# doing we found some solutions and lowered the degree. +mini_solve = (n) -> + #console.log "mini_solve >>>>>>>>>>>>>>>>>>>>>>>> tos:" + tos + + save() + + # AX + B, X = -B/A + + if (n == 2) + #console.log "mini_solve >>>>>>>>> 1st degree" + p3 = pop() + p4 = pop() + push(p4) + push(p3) + divide() + negate() + restore() + return + + # AX^2 + BX + C, X = (-B +/- (B^2 - 4AC)^(1/2)) / (2A) + + if (n == 3) + #console.log "mini_solve >>>>>>>>> 2nd degree" + p3 = pop() # A + p4 = pop() # B + p5 = pop() # C + + # B^2 + push(p4) + push_integer(2) + power() + + # 4AC + push_integer(4) + push(p3) + multiply() + push(p5) + multiply() + + # B^2 - 4AC + subtract() + + #(B^2 - 4AC)^(1/2) + push_rational(1, 2) + power() + + #p6 is (B^2 - 4AC)^(1/2) + p6 = pop() + push(p6); + + # B + push(p4) + subtract() # -B + (B^2 - 4AC)^(1/2) + + # 1/2A + push(p3) + push_integer(2) + multiply() + divide() + #simplify() + #rationalize() + # tos - 1 now is 1st root: (-B + (B^2 - 4AC)^(1/2)) / (2A) + + push(p6); + # tos - 1 now is (B^2 - 4AC)^(1/2) + # tos - 2: 1st root: (-B + (B^2 - 4AC)^(1/2)) / (2A) + + # add B to tos + push(p4) + add() + # tos - 1 now is B + (B^2 - 4AC)^(1/2) + # tos - 2: 1st root: (-B + (B^2 - 4AC)^(1/2)) / (2A) + + negate() + # tos - 1 now is -B -(B^2 - 4AC)^(1/2) + # tos - 2: 1st root: (-B + (B^2 - 4AC)^(1/2)) / (2A) + + # 1/2A again + push(p3) + divide() + push_rational(1, 2) + multiply() + #simplify() + #rationalize() + # tos - 1: 2nd root: (-B - (B^2 - 4AC)^(1/2)) / (2A) + # tos - 2: 1st root: (-B + (B^2 - 4AC)^(1/2)) / (2A) + + restore() + return + + #if (n == 4) + if (n == 4 or n == 5) + + p3 = pop() # A + p4 = pop() # B + p5 = pop() # C + p6 = pop() # D + + # C - only related calculations + push(p5) + push(p5) + multiply() + R_c2 = pop() + + push(R_c2) + push(p5) + multiply() + R_c3 = pop() + + # B - only related calculations + push(p4) + push(p4) + multiply() + R_b2 = pop() + + push(R_b2) + push(p4) + multiply() + R_b3 = pop() + + push(R_b3) + push(p6) + multiply() + R_b3_d = pop() + + push(R_b3_d) + push_integer(-4) + multiply() + R_m4_b3_d = pop() + + + push(R_b3) + push_integer(2) + multiply() + R_2_b3 = pop() + + # A - only related calculations + push(p3) + push(p3) + multiply() + R_a2 = pop() + + push(R_a2) + push(p3) + multiply() + R_a3 = pop() + + push_integer(3) + push(p3) + multiply() + R_3_a = pop() + + push(R_a2) + push(p6) + multiply() + R_a2_d = pop() + + push(R_a2_d) + push(p6) + multiply() + R_a2_d2 = pop() + + push(R_a2_d) + push_integer(27) + multiply() + R_27_a2_d = pop() + + push(R_a2_d2) + push_integer(-27) + multiply() + R_m27_a2_d2 = pop() + + push(R_3_a) + push_integer(2) + multiply() + R_6_a = pop() + + # mixed calculations + push(p3) + push(p5) + multiply() + R_a_c = pop() + + push(R_a_c) + push(p4) + multiply() + R_a_b_c = pop() + + push(R_a_b_c) + push(p6) + multiply() + R_a_b_c_d = pop() + + push(R_a_c) + push_integer(3) + multiply() + R_3_a_c = pop() + + push_integer(-4) + push(p3) + push(R_c3) + multiply() + multiply() + R_m4_a_c3 = pop() + + push(R_a_b_c) + push_integer(9) + multiply() + negate() + R_m9_a_b_c = pop() + + push(R_a_b_c_d) + push_integer(18) + multiply() + R_18_a_b_c_d = pop() + + push(R_b2) + push(R_3_a_c) + subtract() + R_DELTA0 = pop() + + push(R_b2) + push(R_c2) + multiply() + R_b2_c2 = pop() + + push(p4) + negate() + push(R_3_a) + divide() + R_m_b_over_3a = pop() + + + if (n == 4) + if DEBUG then console.log ">>>>>>>>>>>>>>>> actually using cubic formula <<<<<<<<<<<<<<< " + + #console.log ">>>> A:" + p3.toString() + #console.log ">>>> B:" + p4.toString() + #console.log ">>>> C:" + p5.toString() + #console.log ">>>> D:" + p6.toString() + + + if DEBUG then console.log "cubic: D0: " + R_DELTA0.toString() + + push(R_DELTA0) + push_integer(3) + power() + push_integer(4) + multiply() + R_4_DELTA03 = pop() + + push(R_DELTA0) + simplify() + absValFloat() + R_DELTA0_toBeCheckedIfZero = pop() + if DEBUG then console.log "cubic: D0 as float: " + R_DELTA0_toBeCheckedIfZero.toString() + #if isZeroAtomOrTensor(R_DELTA0_toBeCheckedIfZero) + # console.log " *********************************** D0 IS ZERO" + + + # DETERMINANT + push(R_18_a_b_c_d) + push(R_m4_b3_d) + push(R_b2_c2) + push(R_m4_a_c3) + push(R_m27_a2_d2) + add() + add() + add() + add() + simplify() + absValFloat() + R_determinant = pop() + if DEBUG then console.log "cubic: DETERMINANT: " + R_determinant.toString() + + # R_DELTA1 + push(R_2_b3) + push(R_m9_a_b_c) + push(R_27_a2_d) + add() + add() + R_DELTA1 = pop() + if DEBUG then console.log "cubic: D1: " + R_DELTA1.toString() + + # R_Q + push(R_DELTA1) + push_integer(2) + power() + push(R_4_DELTA03) + subtract() + push_rational(1, 2) + power() + simplify() + R_Q = pop() + + + if isZeroAtomOrTensor(R_determinant) + if isZeroAtomOrTensor(R_DELTA0_toBeCheckedIfZero) + if DEBUG then console.log " cubic: DETERMINANT IS ZERO and delta0 is zero" + push(R_m_b_over_3a) # just same solution three times + restore() + return + else + if DEBUG then console.log " cubic: DETERMINANT IS ZERO and delta0 is not zero" + push(p3) + push(p6) + push_integer(9) + multiply() + multiply() + push(p4) + push(p5) + multiply() + subtract() + push(R_DELTA0) + push_integer(2) + multiply() + divide() # first solution + root_solution = pop() + push(root_solution) # pushing two of them on the stack + push(root_solution) + + # second solution here + # 4abc + push(R_a_b_c) + push_integer(4) + multiply() + + # -9a*a*d + push(p3) + push(p3) + push(p6) + push_integer(9) + multiply() + multiply() + multiply() + negate() + + # -9*b^3 + push(R_b3) + negate() + + # sum the three terms + add() + add() + + # denominator is a*delta0 + push(p3) + push(R_DELTA0) + multiply() + + # build the fraction + divide() + + restore() + return + + + + C_CHECKED_AS_NOT_ZERO = false + flipSignOFQSoCIsNotZero = false + + # C will go as denominator, we have to check + # that is not zero + while !C_CHECKED_AS_NOT_ZERO + + # R_C + push(R_Q) + if flipSignOFQSoCIsNotZero + negate() + push(R_DELTA1) + add() + push_rational(1, 2) + multiply() + push_rational(1, 3) + power() + simplify() + R_C = pop() + if DEBUG then console.log "cubic: C: " + R_C.toString() + + push(R_C) + simplify() + absValFloat() + R_C_simplified_toCheckIfZero = pop() + if DEBUG then console.log "cubic: C as absval and float: " + R_C_simplified_toCheckIfZero.toString() + + if isZeroAtomOrTensor(R_C_simplified_toCheckIfZero) + if DEBUG then console.log " cubic: C IS ZERO flipping the sign" + flipSignOFQSoCIsNotZero = true + else + C_CHECKED_AS_NOT_ZERO = true + + + push(R_C) + push(R_3_a) + multiply() + R_3_a_C = pop() + + push(R_3_a_C) + push_integer(2) + multiply() + R_6_a_C = pop() + + + # imaginary parts calculations + push(imaginaryunit) + push_integer(3) + push_rational(1, 2) + power() + multiply() + i_sqrt3 = pop() + push_integer(1) + push(i_sqrt3) + add() + one_plus_i_sqrt3 = pop() + push_integer(1) + push(i_sqrt3) + subtract() + one_minus_i_sqrt3 = pop() + + + push(R_C) + push(R_3_a) + divide() + R_C_over_3a = pop() + + # first solution + push(R_m_b_over_3a) # first term + push(R_C_over_3a) + negate() # second term + push(R_DELTA0) + push(R_3_a_C) + divide() + negate() # third term + # now add the three terms together + add() + add() + simplify() + + # second solution + push(R_m_b_over_3a) # first term + push(R_C_over_3a) + push(one_plus_i_sqrt3) + multiply() + push_integer(2) + divide() # second term + push(one_minus_i_sqrt3) + push(R_DELTA0) + multiply() + push(R_6_a_C) + divide() # third term + # now add the three terms together + add() + add() + simplify() + + # third solution + push(R_m_b_over_3a) # first term + push(R_C_over_3a) + push(one_minus_i_sqrt3) + multiply() + push_integer(2) + divide() # second term + push(one_plus_i_sqrt3) + push(R_DELTA0) + multiply() + push(R_6_a_C) + divide() # third term + # now add the three terms together + add() + add() + simplify() + + restore() + return + + # See http://www.sscc.edu/home/jdavidso/Math/Catalog/Polynomials/Fourth/Fourth.html + # for a description of general shapes and properties of fourth degree polynomials + if (n == 5) + if DEBUG then console.log ">>>>>>>>>>>>>>>> actually using quartic formula <<<<<<<<<<<<<<< " + p7 = pop() # E + + if isZeroAtomOrTensor(p4) and isZeroAtomOrTensor(p6) and !isZeroAtomOrTensor(p5) and !isZeroAtomOrTensor(p7) + if DEBUG then console.log("biquadratic case") + push(p3) + push(symbol(SECRETX)) + push_integer(2) + power() + multiply() + + push(p5) + push(symbol(SECRETX)) + multiply() + + push(p7) + + add() + add() + + push(symbol(SECRETX)) + roots() + + biquadraticSolutions = pop() + + for eachSolution in biquadraticSolutions.tensor.elem + push(eachSolution) + push_rational(1,2) + power() + simplify() + + push(eachSolution) + push_rational(1,2) + power() + negate() + simplify() + + restore() + return + + + + + + # D - only related calculations + push(p6) + push(p6) + multiply() + R_d2 = pop() + + # E - only related calculations + push(p7) + push(p7) + multiply() + R_e2 = pop() + + push(R_e2) + push(p7) + multiply() + R_e3 = pop() + + # DETERMINANT + + push_integer(256) + push(R_a3) + push(R_e3) + multiply() + multiply() # first term 256 a^3 e^3 + + push_integer(-192) + push(R_a2_d) + push(R_e2) + push(p4) + multiply() + multiply() + multiply() # second term -192 a^3 b d e^2 + + push_integer(-128) + push(R_a2) + push(R_c2) + push(R_e2) + multiply() + multiply() + multiply() # third term -128 a^2 c^2 e^2 + + push_integer(144) + push(R_a2_d2) + push(p5) + push(p7) + multiply() + multiply() + multiply() # fourth term 144 a^2 c d^2 e + + push(R_m27_a2_d2) + push(R_d2) + multiply() # fifth term -27 a^2 d^4 + + push_integer(144) + push(R_a_b_c) + push(p4) + push(R_e2) + multiply() + multiply() + multiply() # sixth term 144 a b^2 c e^2 + + push_integer(-6) + push(p3) + push(R_b2) + push(R_d2) + push(p7) + multiply() + multiply() + multiply() + multiply() # seventh term -6 a b^2 d^2 e + + push_integer(-80) + push(R_a_b_c_d) + push(p5) + push(p7) + multiply() + multiply() + multiply() # eigth term -80 a b c^2 d e + + push_integer(18) + push(R_a_b_c_d) + push(R_d2) + multiply() + multiply() # ninth term 18 a b c d^3 + + push_integer(16) + push(R_a_c) + push(R_c3) + push(p7) + multiply() + multiply() + multiply() # tenth term 16 a c^4 e + + push_integer(-4) + push(R_a_c) + push(R_c2) + push(R_d2) + multiply() + multiply() + multiply() # eleventh term -4 a c^3 d^2 + + push_integer(-27) + push(R_b3) + push(p4) + push(R_e2) + multiply() + multiply() + multiply() # twelveth term -27 b^4 e^2 + + push_integer(18) + push(R_b3_d) + push(p5) + push(p7) + multiply() + multiply() + multiply() # thirteenth term 18 b^3 c d e + + push(R_m4_b3_d) + push(R_d2) + multiply() # fourteenth term -4 b^3 d^3 + + push_integer(-4) + push(R_b2_c2) + push(p5) + push(p7) + multiply() + multiply() + multiply() # fifteenth term -4 b^2 c^3 e + + push(R_b2_c2) + push(R_d2) + multiply() # sixteenth term b^2 c^2 d^2 + + # add together the sixteen terms by doing + # fifteen adds + add() + add() + add() + add() + add() + add() + add() + add() + add() + add() + add() + add() + add() + add() + add() + + R_determinant = pop() + if DEBUG then console.log("R_determinant: " + R_determinant.toString()) + + # DELTA0 + push(R_c2) # term one of DELTA0 + + push_integer(-3) + push(p4) + push(p6) + multiply() + multiply() # term two of DELTA0 + + push_integer(12) + push(p3) + push(p7) + multiply() + multiply() # term three of DELTA0 + + # add the three terms together + add() + add() + + R_DELTA0 = pop() + if DEBUG then console.log("R_DELTA0: " + R_DELTA0.toString()) + + # DELTA1 + push_integer(2) + push(R_c3) + multiply() + + push_integer(-9) + push(p4) + push(p5) + push(p6) + multiply() + multiply() + multiply() + + push_integer(27) + push(R_b2) + push(p7) + multiply() + multiply() + + push_integer(27) + push(p3) + push(R_d2) + multiply() + multiply() + + push_integer(-72) + push(R_a_c) + push(p7) + multiply() + multiply() + + # add the five terms together + add() + add() + add() + add() + + R_DELTA1 = pop() + if DEBUG then console.log("R_DELTA1: " + R_DELTA1.toString()) + + # p + push_integer(8) + push(R_a_c) + multiply() + + push_integer(-3) + push(R_b2) + multiply() + + add() + + push_integer(8) + push(R_a2) + multiply() + + divide() + + R_p = pop() + if DEBUG then console.log("p: " + R_p.toString()) + + # q + push(R_b3) + + push_integer(-4) + push(R_a_b_c) + multiply() + + push_integer(8) + push(R_a2_d) + multiply() + + add() + add() + + push_integer(8) + push(R_a3) + multiply() + + divide() + + R_q = pop() + if DEBUG then console.log("q: " + R_q.toString()) + + if DEBUG then console.log("tos 1 " + tos) + if !isZeroAtomOrTensor(p4) + if DEBUG then console.log("tos 2 " + tos) + + push_integer(8) + push(p5) + push(p3) + multiply() + multiply() + + push_integer(-3) + push(p4) + push_integer(2) + power() + multiply() + + add() + + push_integer(8) + push(p3) + push_integer(2) + power() + multiply() + + divide() + + R_p = pop() + if DEBUG then console.log("p for depressed quartic: " + R_p.toString()) + + push(p4) + push_integer(3) + power() + + push_integer(-4) + push(p3) + push(p4) + push(p5) + multiply() + multiply() + multiply() + + push_integer(8) + push(p6) + push(p3) + push_integer(2) + power() + multiply() + multiply() + + add() + add() + + + push_integer(8) + push(p3) + push_integer(3) + power() + multiply() + + divide() + + R_q = pop() + if DEBUG then console.log("q for depressed quartic: " + R_q.toString()) + + + # convert to depressed quartic + push(p4) + push_integer(4) + power() + push_integer(-3) + multiply() + + push_integer(256) + push(R_a3) + push(p7) + multiply() + multiply() + + push_integer(-64) + push(R_a2_d) + push(p4) + multiply() + multiply() + + push_integer(16) + push(R_b2) + push(p3) + push(p5) + multiply() + multiply() + multiply() + + add() + add() + add() + + push_integer(256) + push(p3) + push_integer(4) + power() + multiply() + divide() + + R_r = pop() + if DEBUG then console.log("r for depressed quartic: " + R_r.toString()) + + if DEBUG then console.log("tos 4 " + tos) + + push(symbol(SECRETX)) + push_integer(4) + power() + if DEBUG then console.log("4 * x^4: " + stack[tos-1].toString()) + + push(R_p) + push(symbol(SECRETX)) + push_integer(2) + power() + multiply() + if DEBUG then console.log("R_p * x^2: " + stack[tos-1].toString()) + + push(R_q) + push(symbol(SECRETX)) + multiply() + if DEBUG then console.log("R_q * x: " + stack[tos-1].toString()) + + push(R_r) + if DEBUG then console.log("R_r: " + stack[tos-1].toString()) + + add() + add() + add() + + simplify() + if DEBUG then console.log("solving depressed quartic: " + stack[tos-1].toString()) + + push(symbol(SECRETX)) + + roots() + + depressedSolutions = pop() + if DEBUG then console.log("depressedSolutions: " + depressedSolutions) + + for eachSolution in depressedSolutions.tensor.elem + push(eachSolution) + push(p4) + push_integer(4) + push(p3) + multiply() + divide() + subtract() + simplify() + if DEBUG then console.log("solution from depressed: " + stack[tos-1].toString()) + + restore() + return + + else + R_p = p5 + R_q = p6 + R_r = p7 + + ### + # Descartes' solution + # https://en.wikipedia.org/wiki/Quartic_function#Descartes.27_solution + # finding the "u" in the depressed equation + + push_integer(2) + push(R_p) + multiply() + coeff2 = pop() + + push_integer(-4) + push(R_p) + push_integer(2) + power() + multiply() + push(R_r) + multiply() + coeff3 = pop() + + push(R_q) + push_integer(2) + power() + negate() + coeff4 = pop() + + # now build the polynomial + push(symbol(SECRETX)) + push_integer(3) + power() + + push(coeff2) + push(symbol(SECRETX)) + push_integer(2) + power() + multiply() + + push(coeff3) + push(symbol(SECRETX)) + multiply() + + push(coeff4) + + add() + add() + add() + + console.log("Descarte's resolventCubic: " + stack[tos-1].toString()) + push(symbol(SECRETX)) + + roots() + + resolventCubicSolutions = pop() + console.log("Descarte's resolventCubic solutions: " + resolventCubicSolutions) + console.log("tos: " + tos) + + R_u = null + #R_u = resolventCubicSolutions.tensor.elem[1] + for eachSolution in resolventCubicSolutions.tensor.elem + console.log("examining solution: " + eachSolution) + push(eachSolution) + push_integer(2) + multiply() + push(R_p) + add() + + absValFloat() + toBeCheckedIFZero = pop() + console.log("abs value is: " + eachSolution) + if !isZeroAtomOrTensor(toBeCheckedIFZero) + R_u = eachSolution + break + + console.log("chosen solution: " + R_u) + + push(R_u) + negate() + R_s = pop() + + push(R_p) + push(R_u) + push_integer(2) + power() + push(R_q) + push(R_u) + divide() + add() + add() + push_integer(2) + divide() + R_t = pop() + + push(R_p) + push(R_u) + push_integer(2) + power() + push(R_q) + push(R_u) + divide() + subtract() + add() + push_integer(2) + divide() + R_v = pop() + + # factoring the quartic into two quadratics: + + # now build the polynomial + push(symbol(SECRETX)) + push_integer(2) + power() + + push(R_s) + push(symbol(SECRETX)) + multiply() + + push(R_t) + + add() + add() + + console.log("factored quartic 1: " + stack[tos-1].toString()) + + push(symbol(SECRETX)) + push_integer(2) + power() + + push(R_u) + push(symbol(SECRETX)) + multiply() + + push(R_v) + + add() + add() + + console.log("factored quartic 2: " + stack[tos-1].toString()) + pop() + + restore() + return + ### + + # Ferrari's solution + # https://en.wikipedia.org/wiki/Quartic_function#Ferrari.27s_solution + # finding the "m" in the depressed equation + push_rational(5,2) + push(R_p) + multiply() + coeff2 = pop() + + push_integer(2) + push(R_p) + push_integer(2) + power() + multiply() + push(R_r) + subtract() + coeff3 = pop() + + push(R_p) + push_integer(3) + power() + push_integer(2) + divide() + + push_rational(-1,2) + push(R_p) + push(R_r) + multiply() + multiply() + + push_rational(-1,8) + push(R_q) + push_integer(2) + power() + multiply() + + add() + add() + + coeff4 = pop() + + push(symbol(SECRETX)) + push_integer(3) + power() + + push(coeff2) + push(symbol(SECRETX)) + push_integer(2) + power() + multiply() + + push(coeff3) + push(symbol(SECRETX)) + multiply() + + push(coeff4) + + add() + add() + add() + + if DEBUG then console.log("resolventCubic: " + stack[tos-1].toString()) + push(symbol(SECRETX)) + + roots() + + resolventCubicSolutions = pop() + if DEBUG then console.log("resolventCubicSolutions: " + resolventCubicSolutions) + + R_m = null + #R_m = resolventCubicSolutions.tensor.elem[1] + for eachSolution in resolventCubicSolutions.tensor.elem + if DEBUG then console.log("examining solution: " + eachSolution) + push(eachSolution) + push_integer(2) + multiply() + push(R_p) + add() + + absValFloat() + toBeCheckedIFZero = pop() + if DEBUG then console.log("abs value is: " + eachSolution) + if !isZeroAtomOrTensor(toBeCheckedIFZero) + R_m = eachSolution + break + + if DEBUG then console.log("chosen solution: " + R_m) + push(R_m) + push_integer(2) + multiply() + push(R_p) + add() + push_rational(1,2) + power() + simplify() + sqrtPPlus2M = pop() + + push(R_q) + push_integer(2) + multiply() + push(sqrtPPlus2M) + divide() + simplify() + TwoQOversqrtPPlus2M = pop() + + push(R_p) + push_integer(3) + multiply() + push(R_m) + push_integer(2) + multiply() + add() + ThreePPlus2M = pop() + + # solution1 + push(sqrtPPlus2M) + push(ThreePPlus2M) + push(TwoQOversqrtPPlus2M) + add() + negate() + push_rational(1,2) + power() + simplify() + add() + push_integer(2) + divide() + # solution2 + push(sqrtPPlus2M) + push(ThreePPlus2M) + push(TwoQOversqrtPPlus2M) + add() + negate() + push_rational(1,2) + power() + simplify() + subtract() + push_integer(2) + divide() + # solution3 + push(sqrtPPlus2M) + negate() + push(ThreePPlus2M) + push(TwoQOversqrtPPlus2M) + subtract() + negate() + push_rational(1,2) + power() + simplify() + add() + push_integer(2) + divide() + # solution4 + push(sqrtPPlus2M) + negate() + push(ThreePPlus2M) + push(TwoQOversqrtPPlus2M) + subtract() + negate() + push_rational(1,2) + power() + simplify() + subtract() + push_integer(2) + divide() + + restore() + return + + + + + + + # Q --------------------------- + + push(R_determinant) + simplify() + absValFloat() + R_determinant_simplified_toCheckIfZero = pop() + + push(R_DELTA0) + simplify() + absValFloat() + R_DELTA0_simplified_toCheckIfZero = pop() + + S_CHECKED_AS_NOT_ZERO = false + choiceOfRadicalInQSoSIsNotZero = 0 + + while !S_CHECKED_AS_NOT_ZERO + + Q_CHECKED_AS_NOT_ZERO = false + flipSignOFRadicalSoQIsNotZero = false + + # Q will go as denominator to calculate S + # so we have to check + # that is not zero + while !Q_CHECKED_AS_NOT_ZERO + + # D1 under the outer radical + push(R_DELTA1) + + # D1^2 under the inner radical + push(R_DELTA1) + push_integer(2) + power() + + # 4*D0^3 under the inner radical + push_integer(-4) + push(R_DELTA0) + push_integer(3) + power() + multiply() + + # addition under the inner radical + add() + + # the second radical + push_rational(1,2) + power() + + if flipSignOFRadicalSoQIsNotZero + negate() + + # the addition under the outer radical + add() + + # content of outer radical divided by two + push_integer(2) + divide() + + if DEBUG then console.log("content of cubic root: " + stack[tos-1].toString()) + + # outer radical calculation: cubic root + # now we actually have to find all the roots + # because we have to pick the one that makes S != 0 + push_rational(1,3) + power() + simplify() + R_principalCubicRoot = pop() + if DEBUG then console.log("principal cubic root: " + R_principalCubicRoot.toString()) + + if DEBUG then console.log("tos : " + tos) + + if choiceOfRadicalInQSoSIsNotZero == 0 + if DEBUG then console.log("chosing principal cubic root") + push(R_principalCubicRoot) + else if choiceOfRadicalInQSoSIsNotZero == 1 + if DEBUG then console.log("chosing cubic root beyond principal") + push(R_principalCubicRoot) + push_rational(-1,2) + multiply() + + push_integer(3) + push_rational(1,2) + power() + push(imaginaryunit) + multiply() + push_rational(-1,2) + multiply() + push(R_principalCubicRoot) + multiply() + add() + else if choiceOfRadicalInQSoSIsNotZero == 1 + if DEBUG then console.log("chosing cubic root beyond beyond principal") + push(R_principalCubicRoot) + push_rational(-1,2) + multiply() + + push_integer(3) + push_rational(1,2) + power() + push(imaginaryunit) + multiply() + push_rational(1,2) + multiply() + push(R_principalCubicRoot) + multiply() + add() + + + + + simplify() + R_Q = pop() + if DEBUG then console.log "Q " + R_Q.toString() + if DEBUG then console.log("tos: " + tos) + + + push(R_Q) + simplify() + absValFloat() + + R_Q_simplified_toCheckIfZero = pop() + if DEBUG then console.log "Q simplified and abs" + R_Q_simplified_toCheckIfZero.toString() + if isZeroAtomOrTensor(R_Q_simplified_toCheckIfZero) and (!isZeroAtomOrTensor(R_determinant_simplified_toCheckIfZero) and isZeroAtomOrTensor(R_DELTA0_simplified_toCheckIfZero)) + if DEBUG then console.log " *********************************** Q IS ZERO and it matters, flipping the sign" + flipSignOFRadicalSoQIsNotZero = true + else + Q_CHECKED_AS_NOT_ZERO = true + + + if DEBUG then console.log("tos: " + tos) + + # S + push_rational(-2,3) + push(R_p) + multiply() + + push(R_Q) + + push(R_DELTA0) + push(R_Q) + divide() + + add() + #rationalize() + #console.log("rationalised: " + stack[tos-1].toString()) + #simplify() + + push(R_3_a) + divide() + + add() + + push_rational(1,2) + power() + + push_integer(2) + divide() + + show_power_debug = true + simplify() + R_S = pop() + if DEBUG then console.log "S " + R_S.toString() + + # now check if S is zero + push(R_S) + simplify() + absValFloat() + + R_S_simplified_toCheckIfZero = pop() + if DEBUG then console.log "S " + R_S_simplified_toCheckIfZero.toString() + if isZeroAtomOrTensor(R_S_simplified_toCheckIfZero) + if DEBUG then console.log " *********************************** S IS ZERO chosing another cubic root" + choiceOfRadicalInQSoSIsNotZero++ + else + S_CHECKED_AS_NOT_ZERO = true + + if DEBUG then console.log("tos: " + tos) + + + # ---------------------------- + + if DEBUG then console.log("tos: " + tos) + + push(p4) + negate() + push(p3) + push_integer(4) + multiply() + divide() + R_minus_b_over_4a = pop() + + push_integer(-4) + push(R_S) + push_integer(2) + power() + multiply() + push_integer(2) + push(R_p) + multiply() + subtract() + R_minus_4S2_minus_2p = pop() + + push(R_q) + push(R_S) + divide() + R_q_over_S = pop() + + if DEBUG then console.log("tos before putting together the 4 solutions: " + tos) + + # first solution + push(R_minus_b_over_4a) # first term + push(R_S) + subtract() + push(R_minus_4S2_minus_2p) + push(R_q_over_S) + add() + push_rational(1,2) + power() + push_integer(2) + divide() + add() + simplify() + + # second solution + push(R_minus_b_over_4a) # first term + push(R_S) + subtract() + push(R_minus_4S2_minus_2p) + push(R_q_over_S) + add() + push_rational(1,2) + power() + push_integer(2) + divide() + subtract() + simplify() + + # third solution + push(R_minus_b_over_4a) # first term + push(R_S) + add() + push(R_minus_4S2_minus_2p) + push(R_q_over_S) + subtract() + push_rational(1,2) + power() + push_integer(2) + divide() + add() + simplify() + + # fourth solution + push(R_minus_b_over_4a) # first term + push(R_S) + add() + push(R_minus_4S2_minus_2p) + push(R_q_over_S) + subtract() + push_rational(1,2) + power() + push_integer(2) + divide() + subtract() + simplify() + + restore() + return + + moveTos tos - n + + restore() + diff --git a/node_modules/algebrite/sources/round.coffee b/node_modules/algebrite/sources/round.coffee new file mode 100644 index 0000000..a57757b --- /dev/null +++ b/node_modules/algebrite/sources/round.coffee @@ -0,0 +1,39 @@ + + +Eval_round = -> + push(cadr(p1)) + Eval() + yround() + +yround = -> + save() + yyround() + restore() + +yyround = -> + d = 0.0 + + p1 = pop() + + if (!isNumericAtom(p1)) + push_symbol(ROUND) + push(p1) + list(2) + return + + if (isdouble(p1)) + d = Math.round(p1.d) + push_double(d) + return + + if (isinteger(p1)) + push(p1) + return + + push p1 + yyfloat() + p1 = pop() + push_integer Math.round(p1.d) + + + diff --git a/node_modules/algebrite/sources/scan.coffee b/node_modules/algebrite/sources/scan.coffee new file mode 100644 index 0000000..1d07eb2 --- /dev/null +++ b/node_modules/algebrite/sources/scan.coffee @@ -0,0 +1,829 @@ +# This scanner uses the recursive descent method. +# +# The char pointers token_str and scan_str are pointers to the input string as +# in the following example. +# +# | g | a | m | m | a | | a | l | p | h | a | +# ^ ^ +# token_str scan_str +# +# The char pointer token_buf points to a malloc buffer. +# +# | g | a | m | m | a | \0 | +# ^ +# token_buf +# +# In the sequence of method invocations for scanning, +# first we do the calls for scanning the operands +# of the operators of least precedence. +# So, since precedence in maths goes something like +# (form high to low) exponents, mult/div, plus/minus +# so we scan first for terms, then factors, then powers. +# That's the general idea, but of course we also have to deal +# with things like parens, non-commutative +# dot (or inner) product, assignments and tests, +# function calls etc. +# Note that a^1/2 is, correctly, a/2, not, incorrectly, sqrt(a), +# see comment in related test in power.coffee for more about this. + +# Notes: +# +# Formerly add() and multiply() were used to construct expressions but +# this preevaluation caused problems. +# +# For example, suppose A has the floating point value inf. +# +# Before, the expression A/A resulted in 1 because the scanner would +# divide the symbols. +# +# After removing add() and multiply(), A/A results in nan which is the +# correct result. +# +# The functions negate() and inverse() are used but they do not cause +# problems with preevaluation of symbols. + + +T_INTEGER = 1001 +T_DOUBLE = 1002 +T_SYMBOL = 1003 +T_FUNCTION = 1004 +T_NEWLINE = 1006 +T_STRING = 1007 +T_GTEQ = 1008 +T_LTEQ = 1009 +T_EQ = 1010 +T_NEQ = 1011 +T_QUOTASSIGN = 1012 + +token = "" +newline_flag = 0 +meta_mode = 0 + +input_str = 0 +scan_str = 0 +token_str = 0 +token_buf = 0 + +lastFoundSymbol = null +symbolsRightOfAssignment = null +symbolsLeftOfAssignment = null +isSymbolLeftOfAssignment = null +scanningParameters = null +functionInvokationsScanningStack = null +skipRootVariableToBeSolved = false +assignmentFound = null + + +# Returns number of chars scanned and expr on stack. + +# Returns zero when nothing left to scan. + +# takes a string + +scanned = "" +scan = (s) -> + if DEBUG then console.log "#### scanning " + s + #if s=="y=x" + # debugger + #if s=="y" + # debugger + #if s=="i=sqrt(-1)" + # debugger + + lastFoundSymbol = null + symbolsRightOfAssignment = [] + symbolsLeftOfAssignment = [] + isSymbolLeftOfAssignment = true + scanningParameters = [] + functionInvokationsScanningStack = [""] + assignmentFound = false + + + scanned = s + meta_mode = 0 + expanding++ + input_str = 0 + scan_str = 0 + get_next_token() + if (token == "") + push(symbol(NIL)) + expanding-- + return 0 + scan_stmt() + expanding-- + + if !assignmentFound + symbolsInExpressionsWithoutAssignments = symbolsInExpressionsWithoutAssignments.concat symbolsLeftOfAssignment + + return token_str - input_str + +# takes a string +scan_meta = (s) -> + scanned = s + meta_mode = 1 + expanding++ + input_str = 0 + scan_str = 0 + get_next_token() + if (token == "") + push(symbol(NIL)) + expanding-- + return 0 + scan_stmt() + expanding-- + return token_str - input_str + +scan_stmt = -> + scan_relation() + + assignmentIsOfQuotedType = false + + if token == T_QUOTASSIGN + assignmentIsOfQuotedType = true + + if (token == T_QUOTASSIGN or token == '=') + symbolLeftOfAssignment = lastFoundSymbol + if DEBUG then console.log("assignment!") + assignmentFound = true + isSymbolLeftOfAssignment = false + + get_next_token() + push_symbol(SETQ) + swap() + + # if it's a := then add a quote + if (assignmentIsOfQuotedType) + push_symbol(QUOTE) + + scan_relation() + + # if it's a := then you have to list + # together the quote and its argument + if assignmentIsOfQuotedType + list(2) + + list(3) + + isSymbolLeftOfAssignment = true + + if codeGen + + # in case of re-assignment, the symbol on the + # left will also be in the set of the symbols + # on the right. In that case just remove it from + # the symbols on the right. + indexOfSymbolLeftOfAssignment = symbolsRightOfAssignment.indexOf(symbolLeftOfAssignment) + if indexOfSymbolLeftOfAssignment != -1 + symbolsRightOfAssignment.splice(indexOfSymbolLeftOfAssignment, 1) + symbolsHavingReassignments.push symbolLeftOfAssignment + + # print out the immediate dependencies + if DEBUG + console.log "locally, " + symbolLeftOfAssignment + " depends on: " + for i in symbolsRightOfAssignment + console.log " " + i + + # ok add the local dependencies to the existing + # dependencies of this left-value symbol + + # create the exiting dependencies list if it doesn't exist + symbolsDependencies[symbolLeftOfAssignment] ?= [] + existingDependencies = symbolsDependencies[symbolLeftOfAssignment] + + # copy over the new dependencies to the existing + # dependencies avoiding repetitions + for i in symbolsRightOfAssignment + if existingDependencies.indexOf(i) == -1 + existingDependencies.push i + + symbolsRightOfAssignment = [] + +scan_relation = -> + scan_expression() + switch (token) + when T_EQ + push_symbol(TESTEQ) + swap() + get_next_token() + scan_expression() + list(3) + when T_NEQ + push_symbol(NOT) + swap() + push_symbol(TESTEQ) + swap() + get_next_token() + scan_expression() + list(3) + list(2) + when T_LTEQ + push_symbol(TESTLE) + swap() + get_next_token() + scan_expression() + list(3) + when T_GTEQ + push_symbol(TESTGE) + swap() + get_next_token() + scan_expression() + list(3) + when '<' + push_symbol(TESTLT) + swap() + get_next_token() + scan_expression() + list(3) + when '>' + push_symbol(TESTGT) + swap() + get_next_token() + scan_expression() + list(3) + +scan_expression = -> + h = tos + switch token + when '+' + get_next_token() + scan_term() + when '-' + get_next_token() + scan_term() + negate() + else + scan_term() + + while (newline_flag == 0 && (token == '+' || token == '-')) + if (token == '+') + get_next_token() + scan_term() + else + get_next_token() + scan_term() + negate() + + if (tos - h > 1) + list(tos - h) + push_symbol(ADD) + swap() + cons() + +is_factor = -> + + if token.charCodeAt?(0) == dotprod_unicode + return 1 + + switch (token) + when '*', '/' + return 1 + when '(', T_SYMBOL, T_FUNCTION, T_INTEGER, T_DOUBLE, T_STRING + if (newline_flag) # implicit mul can't cross line + scan_str = token_str # better error display + return 0 + else + return 1 + return 0 + + +simplify_1_in_products = (tos,h) -> + if (tos > h && isrational(stack[tos - 1]) && equaln(stack[tos - 1], 1)) + pop() + +# calculate away consecutive constants +multiply_consecutive_constants = (tos,h)-> + if (tos > h + 1 && isNumericAtom(stack[tos - 2]) && isNumericAtom(stack[tos - 1])) + multiply() + + +scan_term = -> + h = tos + + scan_factor() + + if parse_time_simplifications + simplify_1_in_products(tos,h) + + while (is_factor()) + if (token == '*') + get_next_token() + scan_factor() + else if (token == '/') + # in case of 1/... then + # we scanned the 1, we get rid + # of it because otherwise it becomes + # an extra factor that wasn't there and + # things like + # 1/(2*a) become 1*(1/(2*a)) + simplify_1_in_products(tos,h) + get_next_token() + scan_factor() + inverse() + else if (token.charCodeAt?(0) == dotprod_unicode) + get_next_token() + push_symbol(INNER) + swap() + scan_factor() + list(3) + + else + scan_factor() + + if parse_time_simplifications + multiply_consecutive_constants(tos,h) + simplify_1_in_products(tos,h) + + if (h == tos) + push_integer(1) + else if (tos - h > 1) + list(tos - h) + push_symbol(MULTIPLY) + swap() + cons() + +scan_power = -> + if (token == '^') + get_next_token() + push_symbol(POWER) + swap() + scan_factor() + list(3) + +scan_index = (h) -> + #console.log "[ as index" + get_next_token() + push_symbol(INDEX) + swap() + scan_expression() + while (token == ',') + get_next_token() + scan_expression() + if (token != ']') + scan_error("] expected") + get_next_token() + list(tos - h) + + +scan_factor = -> + + h = tos + + #console.log "scan_factor token: " + token + + firstFactorIsNumber = false + + if (token == '(') + scan_subexpr() + else if (token == T_SYMBOL) + scan_symbol() + else if (token == T_FUNCTION) + scan_function_call_with_function_name() + else if token == '[' + #console.log "[ as tensor" + #debugger + scan_tensor() + else if (token == T_INTEGER) + firstFactorIsNumber = true + bignum_scan_integer(token_buf) + get_next_token() + else if (token == T_DOUBLE) + firstFactorIsNumber = true + bignum_scan_float(token_buf) + get_next_token() + else if (token == T_STRING) + scan_string() + else + scan_error("syntax error") + + + # after the main initial part of the factor that + # we just scanned above, + # we can get an arbitrary about of appendages + # of the form ...[...](...)... + # If the main part is not a number, then these are all, respectively, + # - index references (as opposed to tensor definition) and + # - function calls without an explicit function name + # (instead of subexpressions or parameters of function + # definitions or function calls with an explicit function + # name), respectively + while token == '[' or token == '(' and newline_flag == 0 and !firstFactorIsNumber + if token == '[' + scan_index(h) + else if token == '(' + #console.log "( as function call without function name " + scan_function_call_without_function_name() + + + + while (token == '!') + get_next_token() + push_symbol(FACTORIAL) + swap() + list(2) + + # in theory we could already count the + # number of transposes and simplify them + # away, but it's not that clean to have + # multiple places where that happens, and + # the parser is not the place. + while (token.charCodeAt?(0) == transpose_unicode) + get_next_token() + push_symbol(TRANSPOSE) + swap() + list(2) + + scan_power() + + +addSymbolRightOfAssignment = (theSymbol) -> + if predefinedSymbolsInGlobalScope_doNotTrackInDependencies.indexOf(theSymbol) == -1 and + symbolsRightOfAssignment.indexOf(theSymbol) == -1 and + symbolsRightOfAssignment.indexOf("'"+theSymbol) == -1 and + !skipRootVariableToBeSolved + if DEBUG then console.log("... adding symbol: " + theSymbol + " to the set of the symbols right of assignment") + prefixVar = "" + for i in [1...functionInvokationsScanningStack.length] + if functionInvokationsScanningStack[i] != "" + prefixVar += functionInvokationsScanningStack[i] + "_" + i + "_" + + theSymbol = prefixVar + theSymbol + symbolsRightOfAssignment.push theSymbol + +addSymbolLeftOfAssignment = (theSymbol) -> + if predefinedSymbolsInGlobalScope_doNotTrackInDependencies.indexOf(theSymbol) == -1 and + symbolsLeftOfAssignment.indexOf(theSymbol) == -1 and + symbolsLeftOfAssignment.indexOf("'"+theSymbol) == -1 and + !skipRootVariableToBeSolved + if DEBUG then console.log("... adding symbol: " + theSymbol + " to the set of the symbols left of assignment") + prefixVar = "" + for i in [1...functionInvokationsScanningStack.length] + if functionInvokationsScanningStack[i] != "" + prefixVar += functionInvokationsScanningStack[i] + "_" + i + "_" + + theSymbol = prefixVar + theSymbol + symbolsLeftOfAssignment.push theSymbol + +scan_symbol = -> + if (token != T_SYMBOL) + scan_error("symbol expected") + if (meta_mode && token_buf.length == 1) + switch (token_buf[0]) + when 'a' + push(symbol(METAA)) + when 'b' + push(symbol(METAB)) + when 'x' + push(symbol(METAX)) + else + push(usr_symbol(token_buf)) + else + push(usr_symbol(token_buf)) + #console.log "found symbol: " + token_buf + + if scanningParameters.length == 0 + if DEBUG then console.log "out of scanning parameters, processing " + token_buf + lastFoundSymbol = token_buf + if isSymbolLeftOfAssignment + addSymbolLeftOfAssignment token_buf + else + if DEBUG then console.log "still scanning parameters, skipping " + token_buf + if isSymbolLeftOfAssignment + addSymbolRightOfAssignment "'" + token_buf + + if DEBUG then console.log("found symbol: " + token_buf + " left of assignment: " + isSymbolLeftOfAssignment) + + # if we were looking at the right part of an assignment while we + # found the symbol, then add it to the "symbolsRightOfAssignment" + # set (we check for duplications) + if !isSymbolLeftOfAssignment + addSymbolRightOfAssignment token_buf + get_next_token() + +scan_string = -> + push new_string(token_buf) + get_next_token() + +scan_function_call_with_function_name = -> + if DEBUG then console.log "-- scan_function_call_with_function_name start" + n = 1 # the parameter number as we scan parameters + p = new U() + p = usr_symbol(token_buf) + + push(p) + functionName = token_buf + if functionName == "roots" or functionName == "defint" or functionName == "sum" or functionName == "product" or functionName == "for" + functionInvokationsScanningStack.push token_buf + lastFoundSymbol = token_buf + if !isSymbolLeftOfAssignment + addSymbolRightOfAssignment token_buf + + get_next_token() # open parens + get_next_token() # 1st parameter + scanningParameters.push true + if (token != ')') + scan_stmt() + n++ + while (token == ',') + get_next_token() + # roots' disappearing variable, if there, is the second one + if n == 2 and functionInvokationsScanningStack[functionInvokationsScanningStack.length - 1].indexOf("roots") != -1 + symbolsRightOfAssignment = symbolsRightOfAssignment.filter (x) -> !(new RegExp("roots_" + (functionInvokationsScanningStack.length - 1) + "_" + token_buf)).test(x) + skipRootVariableToBeSolved = true + # sums' disappearing variable, is alsways the second one + if n == 2 and functionInvokationsScanningStack[functionInvokationsScanningStack.length - 1].indexOf("sum") != -1 + symbolsRightOfAssignment = symbolsRightOfAssignment.filter (x) -> !(new RegExp("sum_" + (functionInvokationsScanningStack.length - 1) + "_" + token_buf)).test(x) + skipRootVariableToBeSolved = true + # product's disappearing variable, is alsways the second one + if n == 2 and functionInvokationsScanningStack[functionInvokationsScanningStack.length - 1].indexOf("product") != -1 + symbolsRightOfAssignment = symbolsRightOfAssignment.filter (x) -> !(new RegExp("product_" + (functionInvokationsScanningStack.length - 1) + "_" + token_buf)).test(x) + skipRootVariableToBeSolved = true + # for's disappearing variable, is alsways the second one + if n == 2 and functionInvokationsScanningStack[functionInvokationsScanningStack.length - 1].indexOf("for") != -1 + symbolsRightOfAssignment = symbolsRightOfAssignment.filter (x) -> !(new RegExp("for_" + (functionInvokationsScanningStack.length - 1) + "_" + token_buf)).test(x) + skipRootVariableToBeSolved = true + # defint's disappearing variables can be in positions 2,5,8... + if functionInvokationsScanningStack[functionInvokationsScanningStack.length - 1].indexOf("defint") != -1 and + (n == 2 or (n>2 and ((n-2) % 3 == 0))) + symbolsRightOfAssignment = symbolsRightOfAssignment.filter (x) -> !(new RegExp("defint_" + (functionInvokationsScanningStack.length - 1) + "_" + token_buf)).test(x) + skipRootVariableToBeSolved = true + + scan_stmt() + skipRootVariableToBeSolved = false + n++ + + # todo refactor this, there are two copies + # this catches the case where the "roots" variable is not specified + if n == 2 and functionInvokationsScanningStack[functionInvokationsScanningStack.length - 1].indexOf("roots") != -1 + symbolsRightOfAssignment = symbolsRightOfAssignment.filter (x) -> !(new RegExp("roots_" + (functionInvokationsScanningStack.length - 1) + "_" + "x")).test(x) + + scanningParameters.pop() + + for i in [0..symbolsRightOfAssignment.length] + if symbolsRightOfAssignment[i]? + if functionName == "roots" + symbolsRightOfAssignment[i] = symbolsRightOfAssignment[i].replace(new RegExp("roots_" + (functionInvokationsScanningStack.length - 1) + "_"),"") + if functionName == "defint" + symbolsRightOfAssignment[i] = symbolsRightOfAssignment[i].replace(new RegExp("defint_" + (functionInvokationsScanningStack.length - 1) + "_"),"") + if functionName == "sum" + symbolsRightOfAssignment[i] = symbolsRightOfAssignment[i].replace(new RegExp("sum_" + (functionInvokationsScanningStack.length - 1) + "_"),"") + if functionName == "product" + symbolsRightOfAssignment[i] = symbolsRightOfAssignment[i].replace(new RegExp("product_" + (functionInvokationsScanningStack.length - 1) + "_"),"") + if functionName == "for" + symbolsRightOfAssignment[i] = symbolsRightOfAssignment[i].replace(new RegExp("for_" + (functionInvokationsScanningStack.length - 1) + "_"),"") + + if (token != ')') + scan_error(") expected") + + get_next_token() + list(n) + if functionName == "roots" or functionName == "defint" or functionName == "sum" or functionName == "product" or functionName == "for" + functionInvokationsScanningStack.pop() + if functionName == symbol(PATTERN).printname + patternHasBeenFound = true + + if DEBUG then console.log "-- scan_function_call_with_function_name end" + +scan_function_call_without_function_name = -> + if DEBUG then console.log "-- scan_function_call_without_function_name start" + + # the function will have to be looked up + # at runtime (i.e. we need to evaulate something to find it + # e.g. it might be inside a tensor, so we'd need to evaluate + # a tensor element access in that case) + push_symbol(EVAL) + swap() + list(2) + + n = 1 # the parameter number as we scan parameters + get_next_token() # left paren + scanningParameters.push true + if (token != ')') + scan_stmt() + n++ + while (token == ',') + get_next_token() + scan_stmt() + n++ + + scanningParameters.pop() + + + if (token != ')') + scan_error(") expected") + + get_next_token() + list(n) + + if DEBUG then console.log "-- scan_function_call_without_function_name end: " + stack[tos-1] + +# scan subexpression + +scan_subexpr = -> + n = 0 + if (token != '(') + scan_error("( expected") + get_next_token() + scan_stmt() + if (token != ')') + scan_error(") expected") + get_next_token() + +scan_tensor = -> + n = 0 + if (token != '[') + scan_error("[ expected") + + get_next_token() + + #console.log "scanning the next statement" + scan_stmt() + + n = 1 + while (token == ',') + get_next_token() + scan_stmt() + n++ + + #console.log "building tensor with elements number: " + n + build_tensor(n) + + if (token != ']') + scan_error("] expected") + get_next_token() + +scan_error = (errmsg) -> + errorMessage = "" + + # try not to put question mark on orphan line + + while (input_str != scan_str) + if ((scanned[input_str] == '\n' || scanned[input_str] == '\r') && input_str + 1 == scan_str) + break + errorMessage += scanned[input_str++] + + errorMessage += " ? " + + while (scanned[input_str] && (scanned[input_str] != '\n' && scanned[input_str] != '\r')) + errorMessage += scanned[input_str++] + + errorMessage += '\n' + + stop(errmsg) + +# There are n expressions on the stack, possibly tensors. +# +# This function assembles the stack expressions into a single tensor. +# +# For example, at the top level of the expression ((a,b),(c,d)), the vectors +# (a,b) and (c,d) would be on the stack. + +# takes an integer +build_tensor = (n) -> + # int i, j, k, ndim, nelem + + i = 0 + + save() + + p2 = alloc_tensor(n) + p2.tensor.ndim = 1 + p2.tensor.dim[0] = n + for i in [0...n] + p2.tensor.elem[i] = stack[tos-n+i] + + check_tensor_dimensions p2 + + moveTos tos - n + + push(p2) + + restore() + +get_next_token = -> + newline_flag = 0 + while (1) + get_token() + if (token != T_NEWLINE) + break + newline_flag = 1 + if DEBUG then console.log "get_next_token token: " + token + #if token == ')' + # debugger + +get_token = -> + # skip spaces + while (isspace(scanned[scan_str])) + if (scanned[scan_str] == '\n' || scanned[scan_str] == '\r') + token = T_NEWLINE + scan_str++ + return + scan_str++ + + token_str = scan_str + + # end of string? + + if (scan_str == scanned.length) + token = "" + return + + # number? + + if (isdigit(scanned[scan_str]) || scanned[scan_str] == '.') + while (isdigit(scanned[scan_str])) + scan_str++ + if (scanned[scan_str] == '.') + scan_str++ + while (isdigit(scanned[scan_str])) + scan_str++ + if (scanned[scan_str] == 'e' && (scanned[scan_str+1] == '+' || scanned[scan_str+1] == '-' || isdigit(scanned[scan_str+1]))) + scan_str += 2 + while (isdigit(scanned[scan_str])) + scan_str++ + token = T_DOUBLE + else + token = T_INTEGER + update_token_buf(token_str, scan_str) + return + + # symbol? + + if (isalpha(scanned[scan_str])) + while (isalnumorunderscore(scanned[scan_str])) + scan_str++ + if (scanned[scan_str] == '(') + token = T_FUNCTION + else + token = T_SYMBOL + update_token_buf(token_str, scan_str) + return + + # string ? + + if (scanned[scan_str] == '"') + scan_str++ + while (scanned[scan_str] != '"') + #if (scan_str == scanned.length || scanned[scan_str] == '\n' || scanned[scan_str] == '\r') + if (scan_str == scanned.length - 1) + scan_str++ + scan_error("runaway string") + scan_str-- + scan_str++ + scan_str++ + token = T_STRING + update_token_buf(token_str + 1, scan_str - 1) + return + + # comment? + + if (scanned[scan_str] == '#' || scanned[scan_str] == '-' && scanned[scan_str+1] == '-') + while (scanned[scan_str] && scanned[scan_str] != '\n' && scanned[scan_str] != '\r') + scan_str++ + if (scanned[scan_str]) + scan_str++ + token = T_NEWLINE + return + + # quote-assignment + if (scanned[scan_str] == ':' && scanned[scan_str+1] == '=') + scan_str += 2 + token = T_QUOTASSIGN + return + + # relational operator? + if (scanned[scan_str] == '=' && scanned[scan_str+1] == '=') + scan_str += 2 + token = T_EQ + return + + # != operator. It's a little odd because + # "!" is not a "not", which would make things consistent. + # (it's used for factorial). + # An alternative would be to use "<>" but it's not used + # a lot in other languages... + if (scanned[scan_str] == '!' && scanned[scan_str+1] == '=') + scan_str += 2 + token = T_NEQ + return + + if (scanned[scan_str] == '<' && scanned[scan_str+1] == '=') + scan_str += 2 + token = T_LTEQ + return + + if (scanned[scan_str] == '>' && scanned[scan_str+1] == '=') + scan_str += 2 + token = T_GTEQ + return + + # single char token + + token = scanned[scan_str++] + +# both strings +update_token_buf = (a,b) -> + + token_buf = scanned.substring(a,b) + + +$.scan = scan diff --git a/node_modules/algebrite/sources/sgn.coffee b/node_modules/algebrite/sources/sgn.coffee new file mode 100644 index 0000000..07d7bcb --- /dev/null +++ b/node_modules/algebrite/sources/sgn.coffee @@ -0,0 +1,85 @@ +#----------------------------------------------------------------------------- +# +# Author : philippe.billet@noos.fr +# +# sgn sign function +# +# +#----------------------------------------------------------------------------- + + + +Eval_sgn = -> + push(cadr(p1)) + Eval() + sgn() + +sgn = -> + save() + yysgn() + restore() + +#define X p1 + +yysgn = -> + + p1 = pop() + + + if (isdouble(p1)) + if (p1.d > 0) + push_integer(1) + return + else + if (p1.d == 0) + push_integer(1) + return + else + push_integer(-1) + return + + if (isrational(p1)) + if (MSIGN(mmul(p1.q.a,p1.q.b)) == -1) + push_integer(-1) + return + else + if (MZERO(mmul(p1.q.a,p1.q.b))) + push_integer(0) + return + else + push_integer(1) + return + + if (iscomplexnumber(p1)) + push_integer(-1) + push(p1) + absval() + power() + push(p1) + multiply() + return + + + if (isnegativeterm(p1)) + push_symbol(SGN) + push(p1) + negate() + list(2) + push_integer(-1) + multiply() + return + + ### + push_integer(2) + push(p1) + heaviside() + multiply() + push_integer(-1) + add() + ### + + push_symbol(SGN) + push(p1) + list(2) + + diff --git a/node_modules/algebrite/sources/shape.coffee b/node_modules/algebrite/sources/shape.coffee new file mode 100644 index 0000000..5484daa --- /dev/null +++ b/node_modules/algebrite/sources/shape.coffee @@ -0,0 +1,50 @@ +# shape of tensor + + + +Eval_shape = -> + push(cadr(p1)) + Eval() + shape() + +shape = -> + i = 0 + ndim = 0 + t = 0 + ai = [] + an = [] + for i in [0...MAXDIM] + ai[i] = 0 + an[i] = 0 + + #U **a, **b + + save() + + p1 = pop() + + if (!istensor(p1)) + if (!isZeroAtomOrTensor(p1)) + stop("transpose: tensor expected, 1st arg is not a tensor") + push(zero) + restore() + return + + ndim = p1.tensor.ndim + + + p2 = alloc_tensor(ndim) + + p2.tensor.ndim = 1 + p2.tensor.dim[0] = ndim + + + + for i in [0...ndim] + push_integer(p1.tensor.dim[i]) + p2.tensor.elem[i] = pop() + + push(p2) + + restore() + diff --git a/node_modules/algebrite/sources/simfac.coffee b/node_modules/algebrite/sources/simfac.coffee new file mode 100644 index 0000000..91df3ec --- /dev/null +++ b/node_modules/algebrite/sources/simfac.coffee @@ -0,0 +1,238 @@ +### + Simplify factorials + +The following script + + F(n,k) = k binomial(n,k) + (F(n,k) + F(n,k-1)) / F(n+1,k) + +generates + + k! n! n! (1 - k + n)! k! n! + -------------------- + -------------------- - ---------------------- + (-1 + k)! (1 + n)! (1 + n)! (-k + n)! k (-1 + k)! (1 + n)! + +Simplify each term to get + + k 1 - k + n 1 + ------- + ----------- - ------- + 1 + n 1 + n 1 + n + +Then simplify the sum to get + + n + ------- + 1 + n + +### + + + +# simplify factorials term-by-term + +Eval_simfac = -> + push(cadr(p1)) + Eval() + simfac() + +#if 1 + +simfac = -> + h = 0 + save() + p1 = pop() + if (car(p1) == symbol(ADD)) + h = tos + p1 = cdr(p1) + while (p1 != symbol(NIL)) + push(car(p1)) + simfac_term() + p1 = cdr(p1) + add_all(tos - h) + else + push(p1) + simfac_term() + restore() + + +#else +### +void +simfac(void) +{ + int h + save() + p1 = pop() + if (car(p1) == symbol(ADD)) { + h = tos + p1 = cdr(p1) + while (p1 != symbol(NIL)) { + push(car(p1)) + simfac_term() + p1 = cdr(p1) + } + addk(tos - h) + p1 = pop() + if (find(p1, symbol(FACTORIAL))) { + push(p1) + if (car(p1) == symbol(ADD)) { + Condense() + simfac_term() + } + } + } else { + push(p1) + simfac_term() + } + restore() +} + +#endif +### + +simfac_term = -> + h = 0 + + save() + + p1 = pop() + + # if not a product of factors then done + + if (car(p1) != symbol(MULTIPLY)) + push(p1) + restore() + return + + # push all factors + + h = tos + p1 = cdr(p1) + while (p1 != symbol(NIL)) + push(car(p1)) + p1 = cdr(p1) + + # keep trying until no more to do + + while (yysimfac(h)) + doNothing = 1 + + multiply_all_noexpand(tos - h) + + restore() + +# try all pairs of factors + +yysimfac = (h) -> + i = 0 + j = 0 + + for i in [h...tos] + p1 = stack[i] + for j in [h...tos] + if (i == j) + continue + p2 = stack[j] + + # n! / n -> (n - 1)! + + if (car(p1) == symbol(FACTORIAL)\ + && car(p2) == symbol(POWER)\ + && isminusone(caddr(p2))\ + && equal(cadr(p1), cadr(p2))) + push(cadr(p1)) + push(one) + subtract() + factorial() + stack[i] = pop() + stack[j] = one + return 1 + + # n / n! -> 1 / (n - 1)! + + if (car(p2) == symbol(POWER)\ + && isminusone(caddr(p2))\ + && caadr(p2) == symbol(FACTORIAL)\ + && equal(p1, cadadr(p2))) + push(p1) + push_integer(-1) + add() + factorial() + reciprocate() + stack[i] = pop() + stack[j] = one + return 1 + + # (n + 1) n! -> (n + 1)! + + if (car(p2) == symbol(FACTORIAL)) + push(p1) + push(cadr(p2)) + subtract() + p3 = pop() + if (isplusone(p3)) + push(p1) + factorial() + stack[i] = pop() + stack[j] = one + return 1 + + # 1 / ((n + 1) n!) -> 1 / (n + 1)! + + if (car(p1) == symbol(POWER)\ + && isminusone(caddr(p1))\ + && car(p2) == symbol(POWER)\ + && isminusone(caddr(p2))\ + && caadr(p2) == symbol(FACTORIAL)) + push(cadr(p1)) + push(cadr(cadr(p2))) + subtract() + p3 = pop() + if (isplusone(p3)) + push(cadr(p1)) + factorial() + reciprocate() + stack[i] = pop() + stack[j] = one + return 1 + + # (n + 1)! / n! -> n + 1 + + # n! / (n + 1)! -> 1 / (n + 1) + + if (car(p1) == symbol(FACTORIAL)\ + && car(p2) == symbol(POWER)\ + && isminusone(caddr(p2))\ + && caadr(p2) == symbol(FACTORIAL)) + push(cadr(p1)) + push(cadr(cadr(p2))) + subtract() + p3 = pop() + if (isplusone(p3)) + stack[i] = cadr(p1) + stack[j] = one + return 1 + if (isminusone(p3)) + push(cadr(cadr(p2))) + reciprocate() + stack[i] = pop() + stack[j] = one + return 1 + if (equaln(p3, 2)) + stack[i] = cadr(p1) + push(cadr(p1)) + push_integer(-1) + add() + stack[j] = pop() + return 1 + if (equaln(p3, -2)) + push(cadr(cadr(p2))) + reciprocate() + stack[i] = pop() + push(cadr(cadr(p2))) + push_integer(-1) + add() + reciprocate() + stack[j] = pop() + return 1 + return 0 diff --git a/node_modules/algebrite/sources/simplify.coffee b/node_modules/algebrite/sources/simplify.coffee new file mode 100644 index 0000000..1997999 --- /dev/null +++ b/node_modules/algebrite/sources/simplify.coffee @@ -0,0 +1,952 @@ + +DEBUG_SIMPLIFY = false + +Eval_simplify = -> + push(cadr(p1)) + runUserDefinedSimplifications() + Eval() + simplify() + +runUserDefinedSimplifications = -> + # ----------------------- + # unfortunately for the time being user + # specified simplifications are only + # run in things which don't contain + # integrals. + # Doesn't work yet, could be because of + # some clobbering as "transform" is called + # recursively? + if userSimplificationsInListForm.length != 0 and !Find(cadr(p1), symbol(INTEGRAL)) + originalexpanding = expanding + expanding = false + if DEBUG_SIMPLIFY then console.log("runUserDefinedSimplifications passed: " + stack[tos-1].toString()) + Eval() + if DEBUG_SIMPLIFY then console.log("runUserDefinedSimplifications after eval no expanding: " + stack[tos-1].toString()) + expanding = originalexpanding + + + p1 = stack[tos-1] + + if DEBUG_SIMPLIFY then console.log "patterns to be checked: " + for eachSimplification in userSimplificationsInListForm + if DEBUG_SIMPLIFY then console.log "..." + eachSimplification + + atLeastOneSuccessInRouldOfRulesApplications = true + numberOfRulesApplications = 0 + + + while atLeastOneSuccessInRouldOfRulesApplications and numberOfRulesApplications < MAX_CONSECUTIVE_APPLICATIONS_OF_ALL_RULES + atLeastOneSuccessInRouldOfRulesApplications = false + numberOfRulesApplications++ + for eachSimplification in userSimplificationsInListForm + success = true + eachConsecutiveRuleApplication = 0 + while success and eachConsecutiveRuleApplication < MAX_CONSECUTIVE_APPLICATIONS_OF_SINGLE_RULE + eachConsecutiveRuleApplication++ + if DEBUG_SIMPLIFY then console.log "simplify - tos: " + tos + " checking pattern: " + eachSimplification + " on: " + p1 + push_symbol(NIL) + success = transform(eachSimplification, true) + if success + atLeastOneSuccessInRouldOfRulesApplications = true + p1 = stack[tos-1] + if DEBUG_SIMPLIFY then console.log "p1 at this stage of simplification: " + p1 + if eachConsecutiveRuleApplication == MAX_CONSECUTIVE_APPLICATIONS_OF_SINGLE_RULE + stop("maximum application of single transformation rule exceeded: " + eachSimplification) + + if numberOfRulesApplications == MAX_CONSECUTIVE_APPLICATIONS_OF_ALL_RULES + stop("maximum application of all transformation rules exceeded ") + + if DEBUG_SIMPLIFY then console.log "METAX = " + get_binding(symbol(METAX)) + if DEBUG_SIMPLIFY then console.log "METAA = " + get_binding(symbol(METAA)) + if DEBUG_SIMPLIFY then console.log "METAB = " + get_binding(symbol(METAB)) + + # ------------------------ + +simplifyForCodeGeneration = -> + save() + runUserDefinedSimplifications() + codeGen = true + # in "codeGen" mode we completely + # eval and simplify the function bodies + # because we really want to resolve all + # the variables indirections and apply + # all the simplifications we can. + simplify_main() + codeGen = false + restore() + +simplify = -> + save() + simplify_main() + restore() + +simplify_main = -> + p1 = pop() + + # when we do code generation, we proceed to + # fully evaluate and simplify the body of + # a function, so we resolve all variables + # indirections and we simplify everything + # we can given the current assignments. + if codeGen and car(p1) == symbol(FUNCTION) + fbody = cadr(p1) + push fbody + # let's simplify the body so we give it a + # compact form + eval() + simplify() + p3 = pop() + + # replace the evaled body + args = caddr(p1); # p5 is B + + push_symbol(FUNCTION) + push p3 + push args + list(3) + p1 = pop() + + if (istensor(p1)) + simplify_tensor() + return + + if (Find(p1, symbol(FACTORIAL))) + push(p1) + simfac() + p2 = pop() + push(p1) + rationalize() + simfac() + p3 = pop() + if (count(p2) < count(p3)) + p1 = p2 + else + p1 = p3 + + f10() + if DEBUG_SIMPLIFY then console.log "f10: " + p1.toString() + f1() + if DEBUG_SIMPLIFY then console.log "f1: " + p1.toString() + f2() + if DEBUG_SIMPLIFY then console.log "f2: " + p1.toString() + f3() + if DEBUG_SIMPLIFY then console.log "f3: " + p1.toString() + f4() + if DEBUG_SIMPLIFY then console.log "f4: " + p1.toString() + f5() + if DEBUG_SIMPLIFY then console.log "f5: " + p1.toString() + f9() + if DEBUG_SIMPLIFY then console.log "f9: " + p1.toString() + simplify_polarRect() + if do_simplify_nested_radicals + # if there is some de-nesting then + # re-run a simplification because + # the shape of the expression might + # have changed significantly. + # e.g. simplify(14^(1/2) - (16 - 4*7^(1/2))^(1/2)) + # needs some more semplification after the de-nesting. + if simplify_nested_radicals() + if DEBUG_SIMPLIFY then console.log("de-nesting successful into: " + p1.toString()) + push(p1) + simplify() + return + + simplify_rectToClock() + simplify_rational_expressions() + + push(p1) + +simplify_tensor = -> + i = 0 + p2 = alloc_tensor(p1.tensor.nelem) + p2.tensor.ndim = p1.tensor.ndim + for i in [0...p1.tensor.ndim] + p2.tensor.dim[i] = p1.tensor.dim[i] + for i in [0...p1.tensor.nelem] + push(p1.tensor.elem[i]) + simplify() + p2.tensor.elem[i] = pop() + + check_tensor_dimensions p2 + + if (isZeroAtomOrTensor(p2)) + p2 = zero; # null tensor becomes scalar zero + push(p2) + + +# try rationalizing + +f1 = -> + if (car(p1) != symbol(ADD)) + return + push(p1) + rationalize() + p2 = pop() + if (count(p2) < count(p1)) + p1 = p2 + +# try condensing + +f2 = -> + if (car(p1) != symbol(ADD)) + return + push(p1) + Condense() + p2 = pop() + if (count(p2) <= count(p1)) + p1 = p2 + +# this simplifies forms like (A-B) / (B-A) + +f3 = -> + push(p1) + rationalize() + negate() + rationalize() + negate() + rationalize() + p2 = pop() + if (count(p2) < count(p1)) + p1 = p2 + + +f10 = -> + + carp1 = car(p1) + miao = cdr(p1) + if ( carp1 == symbol(MULTIPLY) || isinnerordot(p1)) + # both operands a transpose? + + if (car(car(cdr(p1))) == symbol(TRANSPOSE)) and (car(car(cdr(cdr(p1)))) == symbol(TRANSPOSE)) + if DEBUG_SIMPLIFY then console.log "maybe collecting a transpose " + p1 + a = cadr(car(cdr(p1))) + b = cadr(car(cdr(cdr(p1)))) + if carp1 == symbol(MULTIPLY) + push(a) + push(b) + multiply() + else if isinnerordot(p1) + push(b) + push(a) + inner() + push_integer(1) + push_integer(2) + originalexpanding = expanding + expanding = false + transpose() + expanding = originalexpanding + + p2 = pop() + if (count(p2) < count(p1)) + p1 = p2 + if DEBUG_SIMPLIFY then console.log "collecting a transpose " + p2 + +# try expanding denominators + +f4 = -> + if (isZeroAtomOrTensor(p1)) + return + push(p1) + rationalize() + inverse() + rationalize() + inverse() + rationalize() + p2 = pop() + if (count(p2) < count(p1)) + p1 = p2 + +# simplifies trig forms + +simplify_trig = -> + save() + p1 = pop() + f5() + push(p1) + restore() + +f5 = -> + if (Find(p1, symbol(SIN)) == 0 && Find(p1, symbol(COS)) == 0) + return + + p2 = p1 + + trigmode = 1 + push(p2) + Eval() + p3 = pop() + + trigmode = 2 + push(p2) + Eval() + p4 = pop() + + trigmode = 0 + + if (count(p4) < count(p3) || nterms(p4) < nterms(p3)) + p3 = p4 + + if (count(p3) < count(p1) || nterms(p3) < nterms(p1)) + p1 = p3 + +# if it's a sum then try to simplify each term + +f9 = -> + if (car(p1) != symbol(ADD)) + return + push_integer(0) + p2 = cdr(p1) + while (iscons(p2)) + push(car(p2)) + simplify() + add() + + oldp1 = p1 + oldp2 = p2 + p1 = pop() + simplify_rational_expressions() + push(p1) + p1 = oldp1 + p2 = oldp2 + + p2 = cdr(p2) + p2 = pop() + if (count(p2) < count(p1)) + p1 = p2 + + +simplify_rational_expressions = -> + push p1 + denominator() + denom = pop() + + if isone(denom) + return + + push p1 + numerator() + num = pop() + + if isone(num) + return + + if !(polyVar = areunivarpolysfactoredorexpandedform(num, denom)) + return + + push num + push denom + gcd() + + push(polyVar) + factor() + + theGCD = pop() + + # if there are no common factors then + # bail + if isone(theGCD) + return + + push num + push(polyVar) + factor() + push theGCD + #divide() + inverse() + multiply_noexpand() + simplify() + sasa = stack[tos-1].toString() + + push denom + push(polyVar) + factor() + push theGCD + #divide() + inverse() + multiply_noexpand() + simplify() + sasa = stack[tos-1].toString() + + divide() + #simplify() + Condense() + sasa = stack[tos-1].toString() + + p2 = pop() + if (count(p2) < count(p1)) + p1 = p2 + + +# things like 6*(cos(2/9*pi)+i*sin(2/9*pi)) +# where we have sin and cos, those might start to +# look better in clock form i.e. 6*(-1)^(2/9) +simplify_rectToClock = -> + #debugger + + if (Find(p1, symbol(SIN)) == 0 && Find(p1, symbol(COS)) == 0) + return + + push(p1) + Eval() + clockform() + + p2 = pop(); # put new (hopefully simplified expr) in p2 + if DEBUG_SIMPLIFY then console.log "before simplification clockform: " + p1 + " after: " + p2 + + if (count(p2) < count(p1)) + p1 = p2 + +simplify_polarRect = -> + push(p1) + + polarRectAMinusOneBase() + Eval() + + p2 = pop(); # put new (hopefully simplified expr) in p2 + + if (count(p2) < count(p1)) + p1 = p2 + +polarRectAMinusOneBase = -> + save() + p1 = pop() + + if isimaginaryunit(p1) + push(p1) + restore() + return + + if (equal(car(p1), symbol(POWER)) and isminusone(cadr(p1)) ) + + # base we just said is minus 1 + push(one) + negate() + + # exponent + push(caddr(p1)) + polarRectAMinusOneBase() + + power() + # try to simplify it using polar and rect + polar() + rect() + + else if (iscons(p1)) + h = tos + while (iscons(p1)) + #console.log("recursing on: " + car(p1).toString()) + push(car(p1)) + polarRectAMinusOneBase() + #console.log("...transformed into: " + stack[tos-1].toString()) + p1 = cdr(p1) + list(tos - h) + else + push(p1) + + restore() + return + +nterms = (p) -> + if (car(p) != symbol(ADD)) + return 1 + else + return length(p) - 1 + +simplify_nested_radicals = -> + if recursionLevelNestedRadicalsRemoval > 0 + if DEBUG_SIMPLIFY then console.log("denesting bailing out because of too much recursion") + return false + + push(p1) + somethingSimplified = take_care_of_nested_radicals() + + + # in this paragraph we check whether we can collect + # common factors without complicating the expression + # in particular we want to avoid + # collecting radicals like in this case where + # we collect sqrt(2): + # 2-2^(1/2) into 2^(1/2)*(-1+2^(1/2)) + # but we do like to collect other non-radicals e.g. + # 17/2+3/2*5^(1/2) into 1/2*(17+3*5^(1/2)) + # so what we do is we count the powers and we check + # which version has the least number of them. + simplificationWithoutCondense = stack[tos-1] + + prev_expanding = expanding + expanding = 0 + yycondense() + expanding = prev_expanding + + simplificationWithCondense = pop() + #console.log("occurrences of powers in " + simplificationWithoutCondense + " :" + countOccurrencesOfSymbol(symbol(POWER),simplificationWithoutCondense)) + #console.log("occurrences of powers in " + simplificationWithCondense + " :" + countOccurrencesOfSymbol(symbol(POWER),simplificationWithCondense)) + + if (countOccurrencesOfSymbol(symbol(POWER),simplificationWithoutCondense) < countOccurrencesOfSymbol(symbol(POWER),simplificationWithCondense)) + push(simplificationWithoutCondense) + else + push(simplificationWithCondense) + + + # we got out result, wrap up + p1 = pop() + return somethingSimplified + +take_care_of_nested_radicals = -> + if recursionLevelNestedRadicalsRemoval > 0 + if DEBUG_SIMPLIFY then console.log("denesting bailing out because of too much recursion") + return false + + + save() + p1 = pop() + #console.log("take_care_of_nested_radicals p1: " + p1.toString()) + + if equal(car(p1), symbol(POWER)) + + #console.log("ok it's a power ") + base = cadr(p1) + exponent = caddr(p1) + #console.log("possible double radical base: " + base) + #console.log("possible double radical exponent: " + exponent) + + if !isminusone(exponent) and equal(car(base), symbol(ADD)) and isfraction(exponent) and (equalq(exponent,1,3) or equalq(exponent,1,2)) + + #console.log("ok there is a radix with a term inside") + firstTerm = cadr(base) + push(firstTerm) + take_care_of_nested_radicals() + pop() + secondTerm = caddr(base) + push(secondTerm) + take_care_of_nested_radicals() + pop() + + #console.log("possible double radical term1: " + firstTerm) + #console.log("possible double radical term2: " + secondTerm) + + numberOfTerms = 0 + countingTerms = base + while (cdr(countingTerms) != symbol(NIL)) + numberOfTerms++ + countingTerms = cdr(countingTerms) + #console.log("number of terms: " + numberOfTerms) + if numberOfTerms > 2 + #console.log("too many terms under outer radix ") + push(p1) + restore() + return false + + + # list here all the factors + commonInnerExponent = null + commonBases = [] + termsThatAreNotPowers = [] + if (car(secondTerm) == symbol(MULTIPLY)) + # product of factors + secondTermFactor = cdr(secondTerm) + if iscons(secondTermFactor) + while (iscons(secondTermFactor)) + #console.log("second term factor BIS: " + car(secondTermFactor).toString()) + potentialPower = car(secondTermFactor) + if (car(potentialPower) == symbol(POWER)) + innerbase = cadr(potentialPower) + innerexponent = caddr(potentialPower) + if equalq(innerexponent,1,2) + #console.log("tackling double radical 1: " + p1.toString()) + if !commonInnerExponent? + commonInnerExponent = innerexponent + commonBases.push(innerbase) + else + if equal(innerexponent, commonInnerExponent) + #console.log("common base: " + innerbase.toString()) + commonBases.push(innerbase) + else + #console.log("no common bases here ") + #console.log("this one is a power base: " + innerbase + " , exponent: " + innerexponent) + else + termsThatAreNotPowers.push(potentialPower) + secondTermFactor = cdr(secondTermFactor) + else if (car(secondTerm) == symbol(POWER)) + innerbase = cadr(secondTerm) + innerexponent = caddr(secondTerm) + if !commonInnerExponent? and equalq(innerexponent,1,2) + #console.log("tackling double radical 2: " + p1.toString()) + commonInnerExponent = innerexponent + commonBases.push(innerbase) + + + if commonBases.length == 0 + push(p1) + restore() + return false + + A = firstTerm + #console.log("A: " + A.toString()) + + push_integer(1) + for i in commonBases + push(i) + multiply() + #console.log("basis with common exponent: " + i.toString()) + C = pop() + #console.log("C: " + C.toString()) + + push_integer(1) + for i in termsThatAreNotPowers + push(i) + multiply() + #console.log("terms that are not powers: " + i.toString()) + B = pop() + #console.log("B: " + B.toString()) + + + if equalq(exponent,1,3) + push(A) + negate() + push(C) + multiply() + push(B) + divide() # 4th coeff + #console.log("constant coeff " + stack[tos-1].toString()) + checkSize = pop() + push(checkSize) + real() + yyfloat() + if Math.abs(pop().d) > Math.pow(2, 32) + push(p1) + restore() + return false + push(checkSize) + + push_integer(3) + push(C) + multiply() # 3rd coeff + #console.log("next coeff " + stack[tos-1].toString()) + checkSize = pop() + push(checkSize) + real() + yyfloat() + if Math.abs(pop().d) > Math.pow(2, 32) + pop() + push(p1) + restore() + return false + push(checkSize) + + push(symbol(SECRETX)) + multiply() + + + push_integer(-3) + push(A) + multiply() + push(B) + divide() # 2nd coeff + checkSize = pop() + push(checkSize) + real() + yyfloat() + if Math.abs(pop().d) > Math.pow(2, 32) + pop() + pop() + push(p1) + restore() + return false + push(checkSize) + + #console.log("next coeff " + stack[tos-1].toString()) + push(symbol(SECRETX)) + push_integer(2) + power() + multiply() + + push_integer(1) # 1st coeff + #console.log("next coeff " + stack[tos-1].toString()) + push(symbol(SECRETX)) + push_integer(3) + power() + multiply() + + add() + add() + add() + + else if equalq(exponent,1,2) + push(C) # 3th coeff + checkSize = pop() + push(checkSize) + real() + yyfloat() + if Math.abs(pop().d) > Math.pow(2, 32) + push(p1) + restore() + return false + push(checkSize) + #console.log("constant coeff " + stack[tos-1].toString()) + + push_integer(-2) + push(A) + multiply() + push(B) + divide() # 2nd coeff + checkSize = pop() + push(checkSize) + real() + yyfloat() + if Math.abs(pop().d) > Math.pow(2, 32) + pop() + push(p1) + restore() + return false + push(checkSize) + + #console.log("next coeff " + stack[tos-1].toString()) + push(symbol(SECRETX)) + multiply() + + + push_integer(1) # 1st coeff + #console.log("next coeff " + stack[tos-1].toString()) + push(symbol(SECRETX)) + push_integer(2) + power() + multiply() + + add() + add() + + #console.log("whole polynomial: " + stack[tos-1].toString()) + + push(symbol(SECRETX)) + + + recursionLevelNestedRadicalsRemoval++ + #console.log("invoking roots at recursion level: " + recursionLevelNestedRadicalsRemoval) + roots() + recursionLevelNestedRadicalsRemoval-- + if equal(stack[tos-1], symbol(NIL)) + if DEBUG_SIMPLIFY then console.log("roots bailed out because of too much recursion") + pop() + push(p1) + restore() + return false + + #console.log("all solutions: " + stack[tos-1].toString()) + + # exclude the solutions with radicals + possibleSolutions = [] + for eachSolution in stack[tos-1].tensor.elem + if !Find(eachSolution, symbol(POWER)) + possibleSolutions.push(eachSolution) + + pop() # popping the tensor with the solutions + + #console.log("possible solutions: " + possibleSolutions.toString()) + if possibleSolutions.length == 0 + push(p1) + restore() + return false + + possibleRationalSolutions = [] + realOfpossibleRationalSolutions = [] + #console.log("checking the one with maximum real part ") + for i in possibleSolutions + push(i) + real() + yyfloat() + possibleRationalSolutions.push(i) + realOfpossibleRationalSolutions.push(pop().d) + + whichRationalSolution = realOfpossibleRationalSolutions.indexOf(Math.max.apply(Math, realOfpossibleRationalSolutions)) + SOLUTION = possibleRationalSolutions[whichRationalSolution] + #console.log("picked solution: " + SOLUTION) + + + ### + #possibleNewExpressions = [] + #realOfPossibleNewExpressions = [] + # pick the solution which cubic root has no radicals + lowercase_b = null + for SOLUTION in possibleSolutions + console.log("testing solution: " + SOLUTION.toString()) + + debugger + if equalq(exponent,1,3) + push(A) + push(SOLUTION) + push_integer(3) + power() + push_integer(3) + push(C) + multiply() + push(SOLUTION) + multiply() + add() + divide() + console.log("argument of cubic root: " + stack[tos-1].toString()) + push_rational(1,3) + power() + else if equalq(exponent,1,2) + push(A) + push(SOLUTION) + push_integer(2) + power() + push(C) + add() + divide() + console.log("argument of cubic root: " + stack[tos-1].toString()) + push_rational(1,2) + power() + console.log("b is: " + stack[tos-1].toString()) + + lowercase_b = pop() + + if !Find(lowercase_b, symbol(POWER)) + break + ### + + if equalq(exponent,1,3) + push(A) + push(SOLUTION) + push_integer(3) + power() + push_integer(3) + push(C) + multiply() + push(SOLUTION) + multiply() + add() + divide() + #console.log("argument of cubic root: " + stack[tos-1].toString()) + push_rational(1,3) + power() + else if equalq(exponent,1,2) + push(A) + push(SOLUTION) + push_integer(2) + power() + push(C) + add() + divide() + #console.log("argument of cubic root: " + stack[tos-1].toString()) + push_rational(1,2) + power() + #console.log("b is: " + stack[tos-1].toString()) + + lowercase_b = pop() + + + if !lowercase_b? + push(p1) + restore() + return false + + push(lowercase_b) + push(SOLUTION) + multiply() + + + if equalq(exponent,1,3) + #console.log("a is: " + stack[tos-1].toString()) + + lowercase_a = pop() + + push(lowercase_b) + push(C) + push_rational(1,2) + power() + multiply() + + push(lowercase_a) + add() + simplify() + else if equalq(exponent,1,2) + #console.log("a could be: " + stack[tos-1].toString()) + + lowercase_a = pop() + + push(lowercase_b) + push(C) + push_rational(1,2) + power() + multiply() + + push(lowercase_a) + add() + simplify() + possibleNewExpression = pop() + #console.log("verifying if " + possibleNewExpression + " is positive") + push(possibleNewExpression) + real() + yyfloat() + possibleNewExpressionValue = pop() + if !isnegativenumber(possibleNewExpressionValue) + #console.log("... it is positive") + push(possibleNewExpression) + else + #console.log("... it is NOT positive") + push(lowercase_b) + negate() + lowercase_b = pop() + + push(lowercase_a) + negate() + lowercase_a = pop() + + + push(lowercase_b) + push(C) + push_rational(1,2) + power() + multiply() + + push(lowercase_a) + add() + simplify() + # possibleNewExpression is now at top of stack + + + #console.log("potential new expression: " + stack[tos-1].toString()) + p1 = pop() + #newExpression = pop() + #debugger + #push(newExpression) + #real() + #yyfloat() + #possibleNewExpressions.push(newExpression) + #realOfPossibleNewExpressions.push(pop().d) + + #whichExpression = realOfPossibleNewExpressions.indexOf(Math.max.apply(Math, realOfPossibleNewExpressions)) + #p1 = possibleNewExpressions[whichExpression] + #console.log("final new expression: " + p1.toString()) + + push(p1) + restore() + return true + + + + else + push(p1) + restore() + return false + + else if (iscons(p1)) + h = tos + anyRadicalSimplificationWorked = false + while (iscons(p1)) + #console.log("recursing on: " + car(p1).toString()) + push(car(p1)) + anyRadicalSimplificationWorked = anyRadicalSimplificationWorked or take_care_of_nested_radicals() + #console.log("...transformed into: " + stack[tos-1].toString()) + p1 = cdr(p1) + list(tos - h) + restore() + return anyRadicalSimplificationWorked + else + push(p1) + restore() + return false + + throw new Error("control flow should never reach here") diff --git a/node_modules/algebrite/sources/sin.coffee b/node_modules/algebrite/sources/sin.coffee new file mode 100644 index 0000000..50b2867 --- /dev/null +++ b/node_modules/algebrite/sources/sin.coffee @@ -0,0 +1,170 @@ +# Sine function of numerical and symbolic arguments + + + +Eval_sin = -> + #console.log "sin ---- " + push(cadr(p1)) + Eval() + sine() + #console.log "sin end ---- " + +sine = -> + #console.log "sine ---- " + save() + p1 = pop() + if (car(p1) == symbol(ADD)) + # sin of a sum can be further decomposed into + #sin(alpha+beta) = sin(alpha)*cos(beta)+sin(beta)*cos(alpha) + sine_of_angle_sum() + else + sine_of_angle() + restore() + #console.log "sine end ---- " + +# Use angle sum formula for special angles. + +#define A p3 +#define B p4 + +# decompose sum sin(alpha+beta) into +# sin(alpha)*cos(beta)+sin(beta)*cos(alpha) +sine_of_angle_sum = -> + #console.log "sin of angle sum ---- " + p2 = cdr(p1) + while (iscons(p2)) + p4 = car(p2); # p4 is B + if (isnpi(p4)) # p4 is B + push(p1) + push(p4); # p4 is B + subtract() + p3 = pop(); # p3 is A + push(p3); # p3 is A + sine() + push(p4); # p4 is B + cosine() + multiply() + push(p3); # p3 is A + cosine() + push(p4); # p4 is B + sine() + multiply() + add() + #console.log "sin of angle sum end ---- " + return + p2 = cdr(p2) + sine_of_angle() + #console.log "sin of angle sum end ---- " + +sine_of_angle = -> + + if (car(p1) == symbol(ARCSIN)) + push(cadr(p1)) + return + + if isdouble(p1) + d = Math.sin(p1.d) + if (Math.abs(d) < 1e-10) + d = 0.0 + push_double(d) + return + + # sine function is antisymmetric, sin(-x) = -sin(x) + + if (isnegative(p1)) + push(p1) + negate() + sine() + negate() + return + + # sin(arctan(x)) = x / sqrt(1 + x^2) + + # see p. 173 of the CRC Handbook of Mathematical Sciences + + if (car(p1) == symbol(ARCTAN)) + push(cadr(p1)) + push_integer(1) + push(cadr(p1)) + push_integer(2) + power() + add() + push_rational(-1, 2) + power() + multiply() + return + + # multiply by 180/pi to go from radians to degrees. + # we go from radians to degrees because it's much + # easier to calculate symbolic results of most (not all) "classic" + # angles (e.g. 30,45,60...) if we calculate the degrees + # and the we do a switch on that. + # Alternatively, we could look at the fraction of pi + # (e.g. 60 degrees is 1/3 pi) but that's more + # convoluted as we'd need to look at both numerator and + # denominator. + + push(p1) + push_integer(180) + multiply() + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + divide() + + n = pop_integer() + + # most "good" (i.e. compact) trigonometric results + # happen for a round number of degrees. There are some exceptions + # though, e.g. 22.5 degrees, which we don't capture here. + if (n < 0 || isNaN(n)) + push(symbol(SIN)) + push(p1) + list(2) + return + + # values of some famous angles. Many more here: + # https://en.wikipedia.org/wiki/Trigonometric_constants_expressed_in_real_radicals + + switch (n % 360) + when 0, 180 + push_integer(0) + when 30, 150 + push_rational(1, 2) + when 210, 330 + push_rational(-1, 2) + when 45, 135 + push_rational(1, 2) + push_integer(2) + push_rational(1, 2) + power() + multiply() + when 225, 315 + push_rational(-1, 2) + push_integer(2) + push_rational(1, 2) + power() + multiply() + when 60, 120 + push_rational(1, 2) + push_integer(3) + push_rational(1, 2) + power() + multiply() + when 240, 300 + push_rational(-1, 2) + push_integer(3) + push_rational(1, 2) + power() + multiply() + when 90 + push_integer(1) + when 270 + push_integer(-1) + else + push(symbol(SIN)) + push(p1) + list(2) + + diff --git a/node_modules/algebrite/sources/sinh.coffee b/node_modules/algebrite/sources/sinh.coffee new file mode 100644 index 0000000..c64d7a6 --- /dev/null +++ b/node_modules/algebrite/sources/sinh.coffee @@ -0,0 +1,36 @@ +# exp(x) - exp(-x) +# sinh(x) = ---------------- +# 2 + + + +Eval_sinh = -> + push(cadr(p1)) + Eval() + ysinh() + +ysinh = -> + save() + yysinh() + restore() + +yysinh = -> + d = 0.0 + p1 = pop() + if (car(p1) == symbol(ARCSINH)) + push(cadr(p1)) + return + if (isdouble(p1)) + d = Math.sinh(p1.d) + if (Math.abs(d) < 1e-10) + d = 0.0 + push_double(d) + return + if (isZeroAtomOrTensor(p1)) + push(zero) + return + push_symbol(SINH) + push(p1) + list(2) + + diff --git a/node_modules/algebrite/sources/subst.coffee b/node_modules/algebrite/sources/subst.coffee new file mode 100644 index 0000000..b95419c --- /dev/null +++ b/node_modules/algebrite/sources/subst.coffee @@ -0,0 +1,52 @@ +### + Substitute new expr for old expr in expr. + + Input: push expr + + push old expr + + push new expr + + Output: Result on stack +### + + + +subst = -> + save() + newExpr = pop(); # new expr + oldExpr = pop(); # old expr + if (oldExpr == symbol(NIL) || newExpr == symbol(NIL)) + restore() + return + expr = pop(); # expr + if (istensor(expr)) + newTensor = alloc_tensor(expr.tensor.nelem) + newTensor.tensor.ndim = expr.tensor.ndim + for i in [0...expr.tensor.ndim] + newTensor.tensor.dim[i] = expr.tensor.dim[i] + for i in [0...expr.tensor.nelem] + push(expr.tensor.elem[i]) + push(oldExpr) + push(newExpr) + subst() + newTensor.tensor.elem[i] = pop() + + check_tensor_dimensions newTensor + + push(newTensor) + else if (equal(expr, oldExpr)) + push(newExpr) + else if (iscons(expr)) + push(car(expr)) + push(oldExpr) + push(newExpr) + subst() + push(cdr(expr)) + push(oldExpr) + push(newExpr) + subst() + cons() + else + push(expr) + restore() diff --git a/node_modules/algebrite/sources/sum.coffee b/node_modules/algebrite/sources/sum.coffee new file mode 100644 index 0000000..259b759 --- /dev/null +++ b/node_modules/algebrite/sources/sum.coffee @@ -0,0 +1,56 @@ +# 'sum' function + +#define A p3 +#define B p4 +#define I p5 +#define X p6 + +# leaves the sum at the top of the stack + +Eval_sum = -> + i = 0 + j = 0 + k = 0 + + + # 1st arg + body = cadr(p1) + + # 2nd arg (index) + indexVariable = caddr(p1) + if (!issymbol(indexVariable)) + stop("sum: 2nd arg?") + + # 3rd arg (lower limit) + push(cadddr(p1)) + Eval() + j = pop_integer() + if (isNaN(j)) + push p1 + return + + # 4th arg (upper limit) + push(caddddr(p1)) + Eval() + k = pop_integer() + if (isNaN(k)) + push p1 + return + + + # remember contents of the index + # variable so we can put it back after the loop + p4 = get_binding(indexVariable) + + push_integer(0) + + for i in [j..k] + push_integer(i) + p5 = pop() + set_binding(indexVariable, p5) + push(body) + Eval() + add() + + # put back the index variable to original content + set_binding(indexVariable, p4) diff --git a/node_modules/algebrite/sources/tan.coffee b/node_modules/algebrite/sources/tan.coffee new file mode 100644 index 0000000..7544f87 --- /dev/null +++ b/node_modules/algebrite/sources/tan.coffee @@ -0,0 +1,104 @@ +# Tangent function of numerical and symbolic arguments + + + +Eval_tan = -> + push(cadr(p1)) + Eval() + tangent() + +tangent = -> + save() + yytangent() + restore() + +yytangent = -> + n = 0 + d = 0.0 + + p1 = pop() + + if (car(p1) == symbol(ARCTAN)) + push(cadr(p1)) + return + + if (isdouble(p1)) + d = Math.tan(p1.d) + if (Math.abs(d) < 1e-10) + d = 0.0 + push_double(d) + return + + # tan function is antisymmetric, tan(-x) = -tan(x) + + if (isnegative(p1)) + push(p1) + negate() + tangent() + negate() + return + + # multiply by 180/pi to go from radians to degrees. + # we go from radians to degrees because it's much + # easier to calculate symbolic results of most (not all) "classic" + # angles (e.g. 30,45,60...) if we calculate the degrees + # and the we do a switch on that. + # Alternatively, we could look at the fraction of pi + # (e.g. 60 degrees is 1/3 pi) but that's more + # convoluted as we'd need to look at both numerator and + # denominator. + + push(p1) + push_integer(180) + multiply() + if evaluatingAsFloats + push_double(Math.PI) + else + push_symbol(PI) + divide() + + n = pop_integer() + + # most "good" (i.e. compact) trigonometric results + # happen for a round number of degrees. There are some exceptions + # though, e.g. 22.5 degrees, which we don't capture here. + if (n < 0 || isNaN(n)) + push(symbol(TAN)) + push(p1) + list(2) + return + + switch (n % 360) + when 0, 180 + push_integer(0) + when 30, 210 + push_rational(1, 3) + push_integer(3) + push_rational(1, 2) + power() + multiply() + when 150, 330 + push_rational(-1, 3) + push_integer(3) + push_rational(1, 2) + power() + multiply() + when 45, 225 + push_integer(1) + when 135, 315 + push_integer(-1) + when 60, 240 + push_integer(3) + push_rational(1, 2) + power() + when 120, 300 + push_integer(3) + push_rational(1, 2) + power() + negate() + else + push(symbol(TAN)) + push(p1) + list(2) + + diff --git a/node_modules/algebrite/sources/tanh.coffee b/node_modules/algebrite/sources/tanh.coffee new file mode 100644 index 0000000..0758e24 --- /dev/null +++ b/node_modules/algebrite/sources/tanh.coffee @@ -0,0 +1,27 @@ +# exp(2 x) - 1 +# tanh(x) = -------------- +# exp(2 x) + 1 + + + +Eval_tanh = -> + d = 0.0 + push(cadr(p1)) + Eval() + p1 = pop() + if (car(p1) == symbol(ARCTANH)) + push(cadr(p1)) + return + if (isdouble(p1)) + d = Math.tanh(p1.d) + if (Math.abs(d) < 1e-10) + d = 0.0 + push_double(d) + return + if (isZeroAtomOrTensor(p1)) + push(zero) + return + push_symbol(TANH) + push(p1) + list(2) + diff --git a/node_modules/algebrite/sources/taylor.coffee b/node_modules/algebrite/sources/taylor.coffee new file mode 100644 index 0000000..cfbcc55 --- /dev/null +++ b/node_modules/algebrite/sources/taylor.coffee @@ -0,0 +1,126 @@ +### +Taylor expansion of a function + + push(F) + push(X) + push(N) + push(A) + taylor() +### + + + +Eval_taylor = -> + # 1st arg + + p1 = cdr(p1) + push(car(p1)) + Eval() + + # 2nd arg + + p1 = cdr(p1) + push(car(p1)) + Eval() + p2 = pop() + if (p2 == symbol(NIL)) + guess() + else + push(p2) + + # 3rd arg + + p1 = cdr(p1) + push(car(p1)) + Eval() + p2 = pop() + if (p2 == symbol(NIL)) + push_integer(24); # default number of terms + else + push(p2) + + # 4th arg + + p1 = cdr(p1) + push(car(p1)) + Eval() + p2 = pop() + if (p2 == symbol(NIL)) + push_integer(0); # default expansion point + else + push(p2) + + taylor() + +#define F p1 +#define X p2 +#define N p3 +#define A p4 +#define C p5 + +taylor = -> + i = 0 + k = 0 + + save() + + p4 = pop() + p3 = pop() + p2 = pop() + p1 = pop() + + push(p3) + k = pop_integer() + if (isNaN(k)) + push_symbol(TAYLOR) + push(p1) + push(p2) + push(p3) + push(p4) + list(5) + restore() + return + + push(p1); # f(a) + push(p2) + push(p4) + subst() + Eval() + + push_integer(1) + p5 = pop() + + for i in [1..k] + + push(p1); # f = f' + push(p2) + derivative() + p1 = pop() + + if (isZeroAtomOrTensor(p1)) + break + + push(p5); # c = c * (x - a) + push(p2) + push(p4) + subtract() + multiply() + p5 = pop() + + push(p1); # f(a) + push(p2) + push(p4) + subst() + Eval() + + push(p5) + multiply() + push_integer(i) + factorial() + divide() + + add() + + restore() + + diff --git a/node_modules/algebrite/sources/tensor.coffee b/node_modules/algebrite/sources/tensor.coffee new file mode 100644 index 0000000..58fb738 --- /dev/null +++ b/node_modules/algebrite/sources/tensor.coffee @@ -0,0 +1,556 @@ +#(docs are generated from top-level comments, keep an eye on the formatting!) + +### tensor ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +General description +------------------- +Tensors are a strange in-between of matrices and "computer" +rectangular data structures. + +Tensors, unlike matrices, and like rectangular data structures, +can have an arbitrary number of dimensions (rank), although a tensor with +rank zero is just a scalar. + +Tensors, like matrices and unlike many computer rectangular data structures, +must be "contiguous" i.e. have no empty spaces within its size, and "uniform", +i.e. each element must have the same shape and hence the same rank. + +Also tensors have necessarily to make a distinction between row vectors, +column vectors (which have a rank of 2) and uni-dimensional vectors (rank 1). +They look very similar but they are fundamentally different. + +Tensors are 1-indexed, as per general math notation, and like Fortran, +Lua, Mathematica, SASL, MATLAB, Julia, Erlang and APL. + +Tensors with elements that are also tensors get promoted to a higher rank +, this is so we can represent and get the rank of a matrix correctly. +Example: +Start with a tensor of rank 1 with 2 elements (i.e. shape: 2) +if you put in both its elements another 2 tensors +of rank 1 with 2 elements (i.e. shape: 2) +then the result is a tensor of rank 2 with shape 2,2 +i.e. the dimension of a tensor at all times must be +the number of nested tensors in it. +Also, all tensors must be "uniform" i.e. they must be accessed +uniformly, which means that all existing elements of a tensor +must be contiguous and have the same shape. +Implication of it all is that you can't put arbitrary +tensors inside tensors (like you would do to represent block matrices) +Rather, all tensors inside tensors must have same shape (and hence, rank) + +Limitations +----------- +n.a. + +Implementation info +------------------- +Tensors are implemented... + +### + +# Called from the "eval" module to evaluate tensor elements. +# p1 points to the tensor operand. +Eval_tensor = -> + i = 0 + ndim = 0 + nelem = 0 + #U **a, **b + + #--------------------------------------------------------------------- + # + # create a new tensor for the result + # + #--------------------------------------------------------------------- + + check_tensor_dimensions p1 + + nelem = p1.tensor.nelem + + ndim = p1.tensor.ndim + + p2 = alloc_tensor(nelem) + + p2.tensor.ndim = ndim + + for i in [0...ndim] + p2.tensor.dim[i] = p1.tensor.dim[i] + + #--------------------------------------------------------------------- + # + # b = Eval(a) + # + #--------------------------------------------------------------------- + + a = p1.tensor.elem + b = p2.tensor.elem + + check_tensor_dimensions p2 + + for i in [0...nelem] + #console.log "push/pop: pushing element a of " + i + push(a[i]) + Eval() + #console.log "push/pop: popping into element b of " + i + b[i] = pop() + + check_tensor_dimensions p1 + check_tensor_dimensions p2 + #--------------------------------------------------------------------- + # + # push the result + # + #--------------------------------------------------------------------- + + push(p2) + + promote_tensor() + +#----------------------------------------------------------------------------- +# +# Add tensors +# +# Input: Operands on stack +# +# Output: Result on stack +# +#----------------------------------------------------------------------------- + +tensor_plus_tensor = -> + i = 0 + ndim = 0 + nelem = 0 + #U **a, **b, **c + + save() + + p2 = pop() + p1 = pop() + + # are the dimension lists equal? + + ndim = p1.tensor.ndim + + if (ndim != p2.tensor.ndim) + push(symbol(NIL)) + restore() + return + + for i in [0...ndim] + if (p1.tensor.dim[i] != p2.tensor.dim[i]) + push(symbol(NIL)) + restore() + return + + # create a new tensor for the result + + nelem = p1.tensor.nelem + + p3 = alloc_tensor(nelem) + + p3.tensor.ndim = ndim + + for i in [0...ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + + # c = a + b + + a = p1.tensor.elem + b = p2.tensor.elem + c = p3.tensor.elem + + for i in [0...nelem] + push(a[i]) + push(b[i]) + add() + c[i] = pop() + + # push the result + + push(p3) + + restore() + +#----------------------------------------------------------------------------- +# +# careful not to reorder factors +# +#----------------------------------------------------------------------------- + +tensor_times_scalar = -> + i = 0 + ndim = 0 + nelem = 0 + #U **a, **b + + save() + + p2 = pop() + p1 = pop() + + ndim = p1.tensor.ndim + nelem = p1.tensor.nelem + + p3 = alloc_tensor(nelem) + + p3.tensor.ndim = ndim + + for i in [0...ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + + a = p1.tensor.elem + b = p3.tensor.elem + + for i in [0...nelem] + push(a[i]) + push(p2) + multiply() + b[i] = pop() + + push(p3) + restore() + +scalar_times_tensor = -> + i = 0 + ndim = 0 + nelem = 0 + #U **a, **b + + save() + + p2 = pop() + p1 = pop() + + ndim = p2.tensor.ndim + nelem = p2.tensor.nelem + + p3 = alloc_tensor(nelem) + + p3.tensor.ndim = ndim + + for i in [0...ndim] + p3.tensor.dim[i] = p2.tensor.dim[i] + + a = p2.tensor.elem + b = p3.tensor.elem + + for i in [0...nelem] + push(p1) + push(a[i]) + multiply() + b[i] = pop() + + push(p3) + + restore() + +check_tensor_dimensions = (p) -> + if p.tensor.nelem != p.tensor.elem.length + console.log "something wrong in tensor dimensions" + debugger + +is_square_matrix = (p) -> + if (istensor(p) && p.tensor.ndim == 2 && p.tensor.dim[0] == p.tensor.dim[1]) + return 1 + else + return 0 + +#----------------------------------------------------------------------------- +# +# gradient of tensor +# +#----------------------------------------------------------------------------- + +d_tensor_tensor = -> + i = 0 + j = 0 + ndim = 0 + nelem = 0 + #U **a, **b, **c + + ndim = p1.tensor.ndim + nelem = p1.tensor.nelem + + if (ndim + 1 >= MAXDIM) + push_symbol(DERIVATIVE) + push(p1) + push(p2) + list(3) + return + + p3 = alloc_tensor(nelem * p2.tensor.nelem) + + p3.tensor.ndim = ndim + 1 + + for i in [0...ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + + p3.tensor.dim[ndim] = p2.tensor.dim[0] + + a = p1.tensor.elem + b = p2.tensor.elem + c = p3.tensor.elem + + for i in [0...nelem] + for j in [0...p2.tensor.nelem] + push(a[i]) + push(b[j]) + derivative() + c[i * p2.tensor.nelem + j] = pop() + + push(p3) + + +#----------------------------------------------------------------------------- +# +# gradient of scalar +# +#----------------------------------------------------------------------------- + +d_scalar_tensor = -> + #U **a, **b + + p3 = alloc_tensor(p2.tensor.nelem) + + p3.tensor.ndim = 1 + + p3.tensor.dim[0] = p2.tensor.dim[0] + + a = p2.tensor.elem + b = p3.tensor.elem + + for i in [0...p2.tensor.nelem] + push(p1) + push(a[i]) + derivative() + b[i] = pop() + + push(p3) + +#----------------------------------------------------------------------------- +# +# Derivative of tensor +# +#----------------------------------------------------------------------------- + +d_tensor_scalar = -> + i = 0 + #U **a, **b + + p3 = alloc_tensor(p1.tensor.nelem) + + p3.tensor.ndim = p1.tensor.ndim + + for i in [0...p1.tensor.ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + + a = p1.tensor.elem + b = p3.tensor.elem + + for i in [0...p1.tensor.nelem] + push(a[i]) + push(p2) + derivative() + b[i] = pop() + + push(p3) + +compare_tensors = (p1, p2) -> + + i = 0 + if (p1.tensor.ndim < p2.tensor.ndim) + return -1 + + if (p1.tensor.ndim > p2.tensor.ndim) + return 1 + + for i in [0...p1.tensor.ndim] + if (p1.tensor.dim[i] < p2.tensor.dim[i]) + return -1 + if (p1.tensor.dim[i] > p2.tensor.dim[i]) + return 1 + + for i in [0...p1.tensor.nelem] + if (equal(p1.tensor.elem[i], p2.tensor.elem[i])) + continue + if (lessp(p1.tensor.elem[i], p2.tensor.elem[i])) + return -1 + else + return 1 + + return 0 + +#----------------------------------------------------------------------------- +# +# Raise a tensor to a power +# +# Input: p1 tensor +# +# p2 exponent +# +# Output: Result on stack +# +#----------------------------------------------------------------------------- + +power_tensor = -> + i = 0 + k = 0 + n = 0 + + # first and last dims must be equal + + k = p1.tensor.ndim - 1 + + if (p1.tensor.dim[0] != p1.tensor.dim[k]) + push_symbol(POWER) + push(p1) + push(p2) + list(3) + return + + push(p2) + + n = pop_integer() + + if (isNaN(n)) + push_symbol(POWER) + push(p1) + push(p2) + list(3) + return + + if (n == 0) + if (p1.tensor.ndim != 2) + stop("power(tensor,0) with tensor rank not equal to 2") + n = p1.tensor.dim[0] + p1 = alloc_tensor(n * n) + p1.tensor.ndim = 2 + p1.tensor.dim[0] = n + p1.tensor.dim[1] = n + for i in [0...n] + p1.tensor.elem[n * i + i] = one + + check_tensor_dimensions p1 + + push(p1) + return + + if (n < 0) + n = -n + push(p1) + inv() + p1 = pop() + + push(p1) + + for i in [1...n] + push(p1) + inner() + if (isZeroAtomOrTensor(stack[tos - 1])) + break + +copy_tensor = -> + i = 0 + + save() + + p1 = pop() + + p2 = alloc_tensor(p1.tensor.nelem) + + p2.tensor.ndim = p1.tensor.ndim + + for i in [0...p1.tensor.ndim] + p2.tensor.dim[i] = p1.tensor.dim[i] + + for i in [0...p1.tensor.nelem] + p2.tensor.elem[i] = p1.tensor.elem[i] + + check_tensor_dimensions p1 + check_tensor_dimensions p2 + + push(p2) + + restore() + +# Tensors with elements that are also tensors get promoted to a higher rank. + +promote_tensor = -> + i = 0 + j = 0 + k = 0 + nelem = 0 + ndim = 0 + + save() + + p1 = pop() + + if (!istensor(p1)) + push(p1) + restore() + return + + p2 = p1.tensor.elem[0] + + for i in [1...p1.tensor.nelem] + if (!compatible(p2, p1.tensor.elem[i])) + stop("Cannot promote tensor due to inconsistent tensor components.") + + if (!istensor(p2)) + push(p1) + restore() + return + + ndim = p1.tensor.ndim + p2.tensor.ndim + + if (ndim > MAXDIM) + stop("tensor rank > " + MAXDIM) + + nelem = p1.tensor.nelem * p2.tensor.nelem + + p3 = alloc_tensor(nelem) + + p3.tensor.ndim = ndim + + for i in [0...p1.tensor.ndim] + p3.tensor.dim[i] = p1.tensor.dim[i] + + for j in [0...p2.tensor.ndim] + p3.tensor.dim[i + j] = p2.tensor.dim[j] + + k = 0 + + for i in [0...p1.tensor.nelem] + p2 = p1.tensor.elem[i] + for j in [0...p2.tensor.nelem] + p3.tensor.elem[k++] = p2.tensor.elem[j] + + check_tensor_dimensions p2 + check_tensor_dimensions p3 + + push(p3) + + restore() + +compatible = (p,q) -> + + if (!istensor(p) && !istensor(q)) + return 1 + + if (!istensor(p) || !istensor(q)) + return 0 + + if (p.tensor.ndim != q.tensor.ndim) + return 0 + + for i in [0...p.tensor.ndim] + if (p.tensor.dim[i] != q.tensor.dim[i]) + return 0 + + return 1 + + diff --git a/node_modules/algebrite/sources/test.coffee b/node_modules/algebrite/sources/test.coffee new file mode 100644 index 0000000..ae35ceb --- /dev/null +++ b/node_modules/algebrite/sources/test.coffee @@ -0,0 +1,315 @@ +# If the number of args is odd then the last arg is the default result. +# Works like a switch statement. Could also be used for piecewise +# functions? TODO should probably be called "switch"? + +Eval_test = -> + orig = p1 + p1 = cdr(p1) + while (iscons(p1)) + + # odd number of parameters means that the + # last argument becomes the default case + # i.e. the one without a test. + if (cdr(p1) == symbol(NIL)) + push(car(p1)); # default case + Eval() + return + + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined car(p1) + if !checkResult? + # we couldn't determine the result + # of a test. This means we can't conclude + # anything about the result of the + # overall test, so we must bail + # with the unevalled test + push orig + return + else if checkResult + # test succesful, we found out output + push(cadr(p1)) + Eval() + return + else + # test unsuccessful, continue to the + # next pair of test,value + p1 = cddr(p1) + + + # no test matched and there was no + # catch-all case, so we return zero. + push_integer 0 + +# we test A==B by first subtracting and checking if we symbolically +# get zero. If not, we evaluate to float and check if we get a zero. +# If we get another NUMBER then we know they are different. +# If we get something else, then we don't know and we return the +# unaveluated test, which is the same as saying "maybe". +Eval_testeq = -> + # first try without simplifyng both sides + orig = p1 + push(cadr(p1)) + Eval() + push(caddr(p1)) + Eval() + subtract() + subtractionResult = pop() + + # OK so we are doing something tricky here + # we are using isZeroLikeOrNonZeroLikeOrUndetermined to check if the result + # is zero or not zero or unknown. + # isZeroLikeOrNonZeroLikeOrUndetermined has some routines + # to determine the zero-ness/non-zero-ness or + # undeterminate-ness of things so we use + # that here and down below. + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined subtractionResult + if checkResult + push_integer(0) + return + else if checkResult? and !checkResult + push_integer(1) + return + + # we didn't get a simple numeric result but + # let's try again after doing + # a simplification on both sides + push(cadr(p1)) + Eval() + simplify() + push(caddr(p1)) + Eval() + simplify() + subtract() + subtractionResult = pop() + + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined subtractionResult + if checkResult + push_integer(0) + return + else if checkResult? and !checkResult + push_integer(1) + return + + # if we didn't get to a number then we + # don't know whether the quantities are + # different so do nothing + push orig + +# Relational operators expect a numeric result for operand difference. + +Eval_testge = -> + orig = p1 + comparison = cmp_args() + + if !comparison? + push orig + return + + if ( comparison >= 0) + push_integer(1) + else + push_integer(0) + +Eval_testgt = -> + orig = p1 + comparison = cmp_args() + + if !comparison? + push orig + return + + if ( comparison > 0) + push_integer(1) + else + push_integer(0) + +Eval_testle = -> + orig = p1 + comparison = cmp_args() + + if !comparison? + push orig + return + + if ( comparison <= 0) + push_integer(1) + else + push_integer(0) + +Eval_testlt = -> + orig = p1 + comparison = cmp_args() + + if !comparison? + push orig + return + + if ( comparison < 0) + push_integer(1) + else + push_integer(0) + +# not definition +Eval_not = -> + wholeAndExpression = p1 + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined cadr(p1) + if !checkResult? + # inconclusive test on predicate + push wholeAndExpression + else if checkResult + # true -> false + push_integer(0) + else + # false -> true + push_integer(1) + +### and ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +a,b,... + +General description +------------------- +Logical-and of predicate expressions. + +### + +# and definition +Eval_and = -> + wholeAndExpression = p1 + andPredicates = cdr(wholeAndExpression) + somePredicateUnknown = false + while (iscons(andPredicates)) + # eval each predicate + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined car(andPredicates) + + if !checkResult? + # here we have stuff that is not reconducible to any + # numeric value (or tensor with numeric values) e.g. + # 'a+b', so it just means that we just don't know the + # truth value of this particular predicate. + # We'll track the fact that we found an unknown + # predicate and we continue with the other predicates. + # (note that in case some subsequent predicate will be false, + # it won't matter that we found some unknowns and + # the whole test will be immediately zero). + somePredicateUnknown = true + andPredicates = cdr(andPredicates) + + else if checkResult + # found a true, move on to the next predicate + andPredicates = cdr(andPredicates) + + else if !checkResult + # found a false, enough to falsify everything and return + push_integer(0) + return + + # We checked all the predicates and none of them + # was false. So they were all either true or unknown. + # Now, if even just one was unknown, we'll have to call this + # test as inconclusive and return the whole test expression. + # If all the predicates were known, then we can conclude + # that the test returns true. + if somePredicateUnknown + push wholeAndExpression + else + push_integer(1) + +# or definition +Eval_or = -> + wholeOrExpression = p1 + orPredicates = cdr(wholeOrExpression) + somePredicateUnknown = false + while (iscons(orPredicates)) + # eval each predicate + checkResult = isZeroLikeOrNonZeroLikeOrUndetermined car(orPredicates) + + if !checkResult? + # here we have stuff that is not reconducible to any + # numeric value (or tensor with numeric values) e.g. + # 'a+b', so it just means that we just don't know the + # truth value of this particular predicate. + # We'll track the fact that we found an unknown + # predicate and we continue with the other predicates. + # (note that in case some subsequent predicate will be false, + # it won't matter that we found some unknowns and + # the whole test will be immediately zero). + somePredicateUnknown = true + orPredicates = cdr(orPredicates) + + else if checkResult + # found a true, enough to return true + push_integer(1) + return + + else if !checkResult + # found a false, move on to the next predicate + orPredicates = cdr(orPredicates) + + # We checked all the predicates and none of them + # was true. So they were all either false or unknown. + # Now, if even just one was unknown, we'll have to call this + # test as inconclusive and return the whole test expression. + # If all the predicates were known, then we can conclude + # that the test returns false. + if somePredicateUnknown + push wholeOrExpression + else + push_integer(0) + +# use subtract for cases like A < A + 1 + +# TODO you could be smarter here and +# simplify both sides only in the case +# of "relational operator: cannot determine..." +# a bit like we do in Eval_testeq +cmp_args = -> + t = 0 + + push(cadr(p1)) + Eval() + simplify() + push(caddr(p1)) + Eval() + simplify() + subtract() + p1 = pop() + + # try floating point if necessary + + if (p1.k != NUM && p1.k != DOUBLE) + push(p1) + yyfloat() + Eval() + p1 = pop() + + #console.log "comparison: " + p1.toString() + + if (isZeroAtomOrTensor(p1)) + #console.log "comparison isZero " + return 0 + + switch (p1.k) + when NUM + if (MSIGN(p1.q.a) == -1) + t = -1 + else + t = 1 + when DOUBLE + #console.log "comparison p1.d: " + p1.d + if (p1.d < 0.0) + t = -1 + else + t = 1 + else + #console.log "comparison is null" + t = null + + return t + + diff --git a/node_modules/algebrite/sources/transform.coffee b/node_modules/algebrite/sources/transform.coffee new file mode 100644 index 0000000..2ecfe79 --- /dev/null +++ b/node_modules/algebrite/sources/transform.coffee @@ -0,0 +1,317 @@ +### +Transform an expression using a pattern. The +pattern can come from the integrals table or +the user-defined patterns. + +The expression and free variable are on the stack. + +The argument s is a null terminated list of transform rules. + +For example, see the itab (integrals table) + +Internally, the following symbols are used: + + F input expression + + X free variable, i.e. F of X + + A template expression + + B result expression + + C list of conditional expressions + +Puts the final expression on top of stack +(whether it's transformed or not) and returns +true is successful, false if not. + + +### + + + +# p1 and p2 are tmps + +#define F p3 +#define X p4 +#define A p5 +#define B p6 +#define C p7 + +transform = (s, generalTransform) -> + transform_h = 0 + + save() + + p1 = null + + p4 = pop() # X i.e. free variable + p3 = pop() # F i.e. input expression + + if DEBUG + console.log " !!!!!!!!! transform on: " + p3 + + + saveMetaBindings() + + set_binding(symbol(METAX), p4) + + # put constants in F(X) on the stack + + transform_h = tos + push_integer(1) + push(p3) + push(p4) + polyform(); # collect coefficients of x, x^2, etc. + push(p4) + + bookmarkTosToPrintDecomps = tos - 2 + decomp(generalTransform) + numberOfDecomps = tos - bookmarkTosToPrintDecomps + + if DEBUG + console.log " " + numberOfDecomps + " decomposed elements ====== " + for i in [0...numberOfDecomps] + console.log " decomposition element " + i + ": " + stack[tos-1-i] + + transformationSuccessful = false + + if generalTransform + # "general tranform" mode is supposed to be more generic than + # "integrals" mode. + # In general transform mode we get only one transformation + # in s + + # simple numbers can end up matching complicated templates, + # which we don't want. + # for example "1" ends up matching "inner(transpose(a_),a_)" + # since "1" is decomposed to "1" and replacing "a_" with "1" + # there is a match. + # Although this match is OK at some fundamental level, we want to + # avoid it because that's not what the spirit of this match + # is: "1" does not have any structural resemblance with + # "inner(transpose(a_),a_)". There are probably better ways + # to so this, for example we might notice that "inner" is an + # anchor since it "sits above" any meta variables, so we + # might want to mandate it to be matched at the top + # of the tree. For the time + # being let's just skip matching on simple numbers. + if !isNumericAtom(p3) + + theTransform = s + if DEBUG then console.log "applying transform: " + theTransform + if DEBUG then console.log "scanning table entry " + theTransform + + push theTransform + + # replacements of meta variables. Note that we don't + # use scan_meta because the pattern is not a string + # that we have to parse, it's a tree already. + # replace a_ with METAA in the passed transformation + push symbol(SYMBOL_A_UNDERSCORE) + push symbol(METAA) + subst() + + # replace b_ with METAB in the passed transformation + push symbol(SYMBOL_B_UNDERSCORE) + push symbol(METAB) + subst() + + # replace x_ with METAX in the passed transformation + push symbol(SYMBOL_X_UNDERSCORE) + push symbol(METAX) + subst() + + p1 = pop() + + p5 = car(p1) + if DEBUG then console.log "template expression: " + p5 + p6 = cadr(p1) + p7 = cddr(p1) + + ### + p5 = p1.tensor.elem[0] + p6 = p1.tensor.elem[1] + for i in [2..(p1.tensor.elem.length-1)] + push p1.tensor.elem[i] + list(p1.tensor.elem.length - 2) + p7 = pop() + ### + + + + if (f_equals_a(transform_h, generalTransform)) + # successful transformation, + # transformed result is in p6 + transformationSuccessful = true + else + # the match failed but perhaps we can match + # something lower down in the tree, so + # let's recurse the tree + + if DEBUG then console.log "p3 at this point: " + p3 + + transformedTerms = [] + + if DEBUG then console.log "car(p3): " + car(p3) + restTerm = p3 + + if iscons(restTerm) + transformedTerms.push car(p3) + restTerm = cdr(p3) + + while (iscons(restTerm)) + secondTerm = car(restTerm) + restTerm = cdr(restTerm) + + if DEBUG then console.log "tos before recursive transform: " + tos + + push(secondTerm) + push_symbol(NIL) + if DEBUG then console.log "testing: " + secondTerm + #if (secondTerm+"") == "eig(A x,transpose(A x))()" + # debugger + if DEBUG then console.log "about to try to simplify other term: " + secondTerm + success = transform(s, generalTransform) + transformationSuccessful = transformationSuccessful or success + + transformedTerms.push pop() + + if DEBUG then console.log "tried to simplify other term: " + secondTerm + " ...successful?: " + success + " ...transformed: " + transformedTerms[transformedTerms.length-1] + + + # recreate the tree we were passed, + # but with all the terms being transformed + if transformedTerms.length != 0 + for i in transformedTerms + push i + list(transformedTerms.length) + p6 = pop() + + + + else # "integrals" mode + for eachTransformEntry in s + if DEBUG + console.log "scanning table entry " + eachTransformEntry + if (eachTransformEntry + "").indexOf("f(sqrt(a+b*x),2/3*1/b*sqrt((a+b*x)^3))") != -1 + debugger + if eachTransformEntry + scan_meta(eachTransformEntry) + p1 = pop() + + p5 = cadr(p1) + p6 = caddr(p1) + p7 = cdddr(p1) + + ### + p5 = p1.tensor.elem[0] + p6 = p1.tensor.elem[1] + for i in [2..(p1.tensor.elem.length-1)] + push p1.tensor.elem[i] + list(p1.tensor.elem.length - 2) + p7 = pop() + ### + + + if (f_equals_a(transform_h, generalTransform)) + # there is a successful transformation, + # transformed result is in p6 + transformationSuccessful = true + break + + + + + moveTos transform_h + + + if transformationSuccessful + #console.log "transformation successful" + # a transformation was successful + push(p6) + Eval() + p1 = pop() + #console.log "...into: " + p1 + transformationSuccessful = true + else + # transformations failed + if generalTransform + # result = original expression + p1 = p3 + else + p1 = symbol(NIL) + + restoreMetaBindings() + + push(p1) + + restore() + return transformationSuccessful + +saveMetaBindings = -> + push(get_binding(symbol(METAA))) + push(get_binding(symbol(METAB))) + push(get_binding(symbol(METAX))) + + +restoreMetaBindings = -> + set_binding(symbol(METAX), pop()) + set_binding(symbol(METAB), pop()) + set_binding(symbol(METAA), pop()) + +# search for a METAA and METAB such that F = A + +f_equals_a = (h, generalTransform) -> + fea_i = 0 + fea_j = 0 + for fea_i in [h...tos] + + set_binding(symbol(METAA), stack[fea_i]) + if DEBUG + console.log " binding METAA to " + get_binding(symbol(METAA)) + for fea_j in [h...tos] + + set_binding(symbol(METAB), stack[fea_j]) + if DEBUG + console.log " binding METAB to " + get_binding(symbol(METAB)) + + # now test all the conditions (it's an and between them) + p1 = p7 + while (iscons(p1)) + push(car(p1)) + Eval() + p2 = pop() + if (isZeroAtomOrTensor(p2)) + break + p1 = cdr(p1) + + if (iscons(p1)) + # conditions are not met, + # skip to the next binding of metas + continue + push(p3); # F = A? + if DEBUG + console.log "about to evaluate template expression: " + p5 + + " binding METAA to " + get_binding(symbol(METAA)) + + " and binding METAB to " + get_binding(symbol(METAB)) + + " and binding METAX to " + get_binding(symbol(METAX)) + push(p5) + if generalTransform + originalexpanding = expanding + expanding = false + Eval() + if generalTransform + expanding = originalexpanding + if DEBUG + console.log " comparing " + stack[tos-1] + " to: " + stack[tos-2] + subtract() + p1 = pop() + if (isZeroAtomOrTensor(p1)) + if DEBUG + console.log "binding METAA to " + get_binding(symbol(METAA)) + console.log "binding METAB to " + get_binding(symbol(METAB)) + console.log "binding METAX to " + get_binding(symbol(METAX)) + console.log "comparing " + p3 + " to: " + p5 + return 1; # yes + return 0; # no diff --git a/node_modules/algebrite/sources/transpose.coffee b/node_modules/algebrite/sources/transpose.coffee new file mode 100644 index 0000000..180f9b8 --- /dev/null +++ b/node_modules/algebrite/sources/transpose.coffee @@ -0,0 +1,241 @@ +# Transpose tensor indices + + + +Eval_transpose = -> + push(cadr(p1)) + Eval() + + # add default params if they + # have not been passed + if (cddr(p1) == symbol(NIL)) + push_integer(1) + push_integer(2) + else + push(caddr(p1)) + Eval() + push(cadddr(p1)) + Eval() + transpose() + +transpose = -> + i = 0 + j = 0 + k = 0 + l = 0 + m = 0 + ndim = 0 + nelem = 0 + t = 0 + ai = [] + an = [] + for i in [0...MAXDIM] + ai[i] = 0 + an[i] = 0 + + #U **a, **b + + save() + + # by default p3 is 2 and p2 is 1 + p3 = pop() # index to be transposed + p2 = pop() # other index to be transposed + p1 = pop() # what needs to be transposed + + # a transposition just goes away when + # applied to a scalar + if (isNumericAtom(p1)) + push p1 + restore() + return + + # transposition goes away for identity matrix + if ((isplusone(p2) and isplustwo(p3)) or (isplusone(p3) and isplustwo(p2))) + if isidentitymatrix(p1) + push p1 + restore() + return + + # a transposition just goes away when + # applied to another transposition with + # the same columns to be switched + if (istranspose(p1)) + innerTranspSwitch1 = car(cdr(cdr(p1))) + innerTranspSwitch2 = car(cdr(cdr(cdr(p1)))) + + if ( equal(innerTranspSwitch1,p3) and equal(innerTranspSwitch2,p2) ) or + ( equal(innerTranspSwitch2,p3) and equal(innerTranspSwitch1,p2) ) or + (( equal(innerTranspSwitch1,symbol(NIL)) and equal(innerTranspSwitch2,symbol(NIL)) ) and ((isplusone(p3) and isplustwo(p2)) or ((isplusone(p2) and isplustwo(p3))))) + push car(cdr(p1)) + restore() + return + + # if operand is a sum then distribute + # (if we are in expanding mode) + if (expanding && isadd(p1)) + p1 = cdr(p1) + push(zero) + while (iscons(p1)) + push(car(p1)) + # add the dimensions to switch but only if + # they are not the default ones. + push(p2) + push(p3) + transpose() + add() + p1 = cdr(p1) + restore() + return + + # if operand is a multiplication then distribute + # (if we are in expanding mode) + if (expanding && ismultiply(p1)) + p1 = cdr(p1) + push(one) + while (iscons(p1)) + push(car(p1)) + # add the dimensions to switch but only if + # they are not the default ones. + push(p2) + push(p3) + transpose() + multiply() + p1 = cdr(p1) + restore() + return + + # distribute the transpose of a dot + # if in expanding mode + # note that the distribution happens + # in reverse as per tranpose rules. + # The dot operator is not + # commutative, so, it matters. + if (expanding && isinnerordot(p1)) + p1 = cdr(p1) + accumulator = [] + while (iscons(p1)) + accumulator.push [car(p1),p2,p3] + p1 = cdr(p1) + + for eachEntry in [accumulator.length-1..0] + push(accumulator[eachEntry][0]) + push(accumulator[eachEntry][1]) + push(accumulator[eachEntry][2]) + transpose() + if eachEntry != accumulator.length-1 + inner() + + restore() + return + + + if (!istensor(p1)) + if (!isZeroAtomOrTensor(p1)) + #stop("transpose: tensor expected, 1st arg is not a tensor") + push_symbol(TRANSPOSE) + push(p1) + # remove the default "dimensions to be switched" + # parameters + if (!isplusone(p2) or !isplustwo(p3)) and (!isplusone(p3) or !isplustwo(p2)) + push(p2) + push(p3) + list(4) + else + list(2) + restore() + return + push(zero) + restore() + return + + ndim = p1.tensor.ndim + nelem = p1.tensor.nelem + + # is it a vector? + # so here it's something curious - note how vectors are + # not really special two-dimensional matrices, but rather + # 1-dimension objects (like tensors can be). So since + # they have one dimension, transposition has no effect. + # (as opposed as if they were special two-dimensional + # matrices) + # see also Ran Pan, Tensor Transpose and Its Properties. CoRR abs/1411.1503 (2014) + + if (ndim == 1) + push(p1) + restore() + return + + push(p2) + l = pop_integer() + + push(p3) + m = pop_integer() + + if (l < 1 || l > ndim || m < 1 || m > ndim) + stop("transpose: index out of range") + + l-- + m-- + + p2 = alloc_tensor(nelem) + + p2.tensor.ndim = ndim + + for i in [0...ndim] + p2.tensor.dim[i] = p1.tensor.dim[i] + + p2.tensor.dim[l] = p1.tensor.dim[m] + p2.tensor.dim[m] = p1.tensor.dim[l] + + a = p1.tensor.elem + b = p2.tensor.elem + + # init tensor index + + for i in [0...ndim] + ai[i] = 0 + an[i] = p1.tensor.dim[i] + + # copy components from a to b + + for i in [0...nelem] + + # swap indices l and m + + t = ai[l]; ai[l] = ai[m]; ai[m] = t; + t = an[l]; an[l] = an[m]; an[m] = t; + + # convert tensor index to linear index k + + k = 0 + for j in [0...ndim] + k = (k * an[j]) + ai[j] + + # swap indices back + + t = ai[l]; ai[l] = ai[m]; ai[m] = t; + t = an[l]; an[l] = an[m]; an[m] = t; + + # copy one element + + b[k] = a[i] + + # increment tensor index + + # Suppose the tensor dimensions are 2 and 3. + # Then the tensor index ai increments as follows: + # 00 -> 01 + # 01 -> 02 + # 02 -> 10 + # 10 -> 11 + # 11 -> 12 + # 12 -> 00 + + for j in [(ndim - 1)..0] + if (++ai[j] < an[j]) + break + ai[j] = 0 + + push(p2) + restore() + diff --git a/node_modules/algebrite/sources/userfunc.coffee b/node_modules/algebrite/sources/userfunc.coffee new file mode 100644 index 0000000..7500832 --- /dev/null +++ b/node_modules/algebrite/sources/userfunc.coffee @@ -0,0 +1,222 @@ +# Evaluate a user defined function + + +#define F p3 # F is the function body +#define A p4 # A is the formal argument list +#define B p5 # B is the calling argument list +#define S p6 # S is the argument substitution list + +# we got here because there was a function invocation and +# it's not been parsed (and consequently tagged) as any +# system function. +# So we are dealing with another function. +# The function could be actually defined, or not yet, +# so we'll deal with both cases. + +### d ===================================================================== + +Tags +---- +scripting, JS, internal, treenode, general concept + +Parameters +---------- +f,x + +General description +------------------- +Returns the partial derivative of f with respect to x. x can be a vector e.g. [x,y]. + +### + +Eval_user_function = -> + + # Use "derivative" instead of "d" if there is no user function "d" + + if DEBUG then console.log "Eval_user_function evaluating: " + car(p1) + if (car(p1) == symbol(SYMBOL_D) && get_binding(symbol(SYMBOL_D)) == symbol(SYMBOL_D)) + Eval_derivative() + return + + # normally car(p1) is a symbol with the function name + # but it could be something that has to be + # evaluated to get to the function definition instead + # (e.g. the function is an element of an array) + # so we do an eval to sort it all out. + push(car(p1)) + Eval() + + # we expect to find either the body and + # formula arguments, OR, if the function + # has not been defined yet, then the + # function will just contain its own name, as + # all undefined variables do. + bodyAndFormalArguments = pop() + + if isNumericAtom(bodyAndFormalArguments) + stop("expected function invocation, found multiplication instead. Use '*' symbol explicitly for multiplication.") + else if istensor(bodyAndFormalArguments) + stop("expected function invocation, found tensor product instead. Use 'dot/inner' explicitly.") + else if isstr(bodyAndFormalArguments) + stop("expected function, found string instead.") + + p3 = car(cdr(bodyAndFormalArguments)) # p3 is function body F + # p4 is the formal argument list + # that is also contained here in the FUNCTION node + p4 = car(cdr(cdr(bodyAndFormalArguments))) + + p5 = cdr(p1); # p5 is the calling argument list + + # example: + # f(x) = x+2 + # then: + # p3.toString() = "x + 2" + # p4 = x + # p5 = 2 + + # first check is whether we don't obtain a function + if (car(bodyAndFormalArguments) != symbol(FUNCTION)) or + # next check is whether evaluation did nothing, so the function is undefined + (bodyAndFormalArguments == car(p1)) # p3 is F + # leave everything as it was and return + h = tos + push(bodyAndFormalArguments); # p3 is F + p1 = p5; # p5 is B + while (iscons(p1)) + push(car(p1)) + Eval() + p1 = cdr(p1) + list(tos - h) + return + + # Create the argument substitution list p6(S) + + p1 = p4; # p4 is A + p2 = p5; # p5 is B + h = tos + while (iscons(p1) && iscons(p2)) + push(car(p1)) + push(car(p2)) + # why explicitly Eval the parameters when + # the body of the function is + # evalled anyways? Commenting it out. All tests pass... + #Eval() + p1 = cdr(p1) + p2 = cdr(p2) + + list(tos - h) + p6 = pop(); # p6 is S + + # Evaluate the function body + + push(p3); # p3 is F + if (iscons(p6)) # p6 is S + push(p6); # p6 is S + rewrite_args() + #console.log "rewritten body: " + stack[tos-1] + Eval() + +# Rewrite by expanding symbols that contain args + +rewrite_args = -> + n = 0 + save() + + # subst. list which is a list + # where each consecutive pair + # is what needs to be substituted and with what + p2 = pop(); + #console.log "subst. list " + p2 + + # expr to substitute in i.e. the + # function body + p1 = pop(); + #console.log "expr: " + p1 + + if (istensor(p1)) + n = rewrite_args_tensor() + restore() + return n + + if (iscons(p1)) + h = tos + if (car(p1) == car(p2)) + # rewrite a function in + # the body with the one + # passed from the paramaters + push_symbol(EVAL) + push(car(cdr(p2))); + list(2) + else + # if there is no match + # then no substitution necessary + push(car(p1)); + + # continue recursively to + # rewrite the rest of the body + p1 = cdr(p1) + while (iscons(p1)) + push(car(p1)) + push(p2) + n += rewrite_args() + p1 = cdr(p1) + list(tos - h) + restore() + return n + + # ground cases here + # (apart from function name which has + # already been substituted as it's in the head + # of the cons) + # ----------------- + + # If not a symbol then no + # substitution to be done + if (!issymbol(p1)) + push(p1) + restore() + return 0 + + # Here we are in a symbol case + # so we need to substitute + + # Check if there is a direct match + # of symbols right away + p3 = p2 + while (iscons(p3)) + if (p1 == car(p3)) + push(cadr(p3)) + restore() + return 1 + p3 = cddr(p3) + + # Get the symbol's content, if _that_ + # matches then do the substitution + p3 = get_binding(p1) + push(p3) + if (p1 != p3) + push(p2); # subst. list + n = rewrite_args() + if (n == 0) + pop() + push(p1); # restore if not rewritten with arg + + restore() + return n + +rewrite_args_tensor = -> + n = 0 + i = 0 + push(p1) + copy_tensor() + p1 = pop() + for i in [0...p1.tensor.nelem] + push(p1.tensor.elem[i]) + push(p2) + n += rewrite_args() + p1.tensor.elem[i] = pop() + + check_tensor_dimensions p1 + + push(p1) + return n diff --git a/node_modules/algebrite/sources/zero.coffee b/node_modules/algebrite/sources/zero.coffee new file mode 100644 index 0000000..4123a9f --- /dev/null +++ b/node_modules/algebrite/sources/zero.coffee @@ -0,0 +1,36 @@ + + +Eval_zero = -> + i = 0 + k = [] + m = 0 + n = 0 + + for i in [0...MAXDIM] + k[i] = 0 + + m = 1 + n = 0 + p2 = cdr(p1) + + while (iscons(p2)) + push(car(p2)) + Eval() + i = pop_integer() + if (i < 1 || isNaN(i)) + # if the input is nonsensical + # just return 0 + push(zero) + return + m *= i + k[n++] = i + p2 = cdr(p2) + if (n == 0) + push(zero) + return + p1 = alloc_tensor(m) + p1.tensor.ndim = n + for i in [0...n] + p1.tensor.dim[i] = k[i] + push(p1) + diff --git a/node_modules/algebrite/test-harness.coffee b/node_modules/algebrite/test-harness.coffee new file mode 100644 index 0000000..120312b --- /dev/null +++ b/node_modules/algebrite/test-harness.coffee @@ -0,0 +1,56 @@ +ok_tests = 0 +ko_tests = 0 + +logout = (s) -> + console.log s + + +run_test = (s) -> + i = 0 + t = "" + + test_flag = 1 + + run("clearall") + + run("e=quote(e)") + + for i in [0...s.length] by 2 + + console.log("starting example: " + s[i]) + #alert("starting example: " + s[i]) + # document.write("starting example: " + s[i] ) + + + out_count = 0 + + try + resultFromRun = run(s[i]) + catch error + console.log error + init() + + + if (resultFromRun == s[i+1]) + # document.write(" ...ok
") + console.log("ok example: " + s[i]) + # alert("ok example: " + s[i]) + ok_tests++ + continue + + ko_tests++ + # document.write(" ...fail
") + console.log("\n") + console.log("test failed: " + s[i]) + + console.log("expected: " + s[i+1]) + + console.log("obtained: " + resultFromRun) + console.log("\n") + + # alert "test failed: " + s[i] + " expected: " + s[i+1] + " obtained: " + resultFromRun + + + test_flag = 0 + +# these tests do not use "run" but still need a "stop" context \ No newline at end of file diff --git a/node_modules/algebrite/tests/abs.coffee b/node_modules/algebrite/tests/abs.coffee new file mode 100644 index 0000000..0ba3214 --- /dev/null +++ b/node_modules/algebrite/tests/abs.coffee @@ -0,0 +1,175 @@ +test_abs = -> + run_test [ + + "abs(a+i*b)", + "(a^2+b^2)^(1/2)", + + "abs(a+b+i*c)", + "(2*a*b+a^2+b^2+c^2)^(1/2)", + + "abs(exp(a+i*b))", + "exp(a)", + + "abs(((-1)^(1/3)+1)^(1/2))", + "3^(1/4)", + + "abs((-2*(-1)^(1/6)/(3^(1/2)))^(1/4))", + "(2/(3^(1/2)))^(1/4)", + + "abs((-2*(-1)^(1/6)/(3^(1/2))+1)^(1/4))", + "1/3^(1/8)", + + "abs((2*(-1)^(5/6)/(3^(1/2)))^(1/4))", + "(2/(3^(1/2)))^(1/4)", + + "abs(1+1.0*(-1)^(1/2))", + "1.414214...", + + "abs(1-1.0*(-1)^(1/2))", + "1.414214...", + + "abs(1+2.0*(-1)^(1/2))", + "2.236068...", + + "abs(1-2.0*(-1)^(1/2))", + "2.236068...", + + "abs(1)", + "1", + + "abs(x)", + "abs(x)", + + # true only if x is real, + # counterexample: i, which makes 1 and -1 + "abs(x)^2", + "x^2", + + "abs(-x)", + "abs(x)", + + "abs(abs(-x))", + "abs(x)", + + "abs(abs(abs(-x)))", + "abs(x)", + + "abs(a+b)", + "abs(a+b)", + + "abs(a*b)", + "abs(a)*abs(b)", + + "abs(-1)", + "1", + + "abs(1+exp(i*pi/3))", + "3^(1/2)", + + "abs((a+i*b)/(c+i*d))", + "(a^2+b^2)^(1/2)/((c^2+d^2)^(1/2))", + + "abs(((-1)^(1/2) / (3^(1/2)))^(1/2))", + "1/3^(1/4)", + + "abs(exp(i theta))", + "1", + + "abs(exp(-i theta))", + "1", + + "abs((-1)^theta)", + "1", + + "abs((-1)^(-theta))", + "1", + + "abs(3*(-1)^theta)", + "3", + + "abs(3*(-1)^(-theta))", + "3", + + "abs(-3*(-1)^theta)", + "3", + + "abs(-3*(-1)^(-theta))", + "3", + + "abs(-5 i pi / a)", + "5*pi/abs(a)", + + "abs(1 / a)", + "1/(abs(a))", + + # ---------- old abs tests + + "abs(2)", + "2", + + "abs(2.0)", + "2.0", + + "abs(-2)", + "2", + + "abs(-2.0)", + "2.0", + + "abs(a)", + "abs(a)", + + "abs(-a)", + "abs(a)", + + "abs(2*a)", + "2*abs(a)", + + "abs(-2*a)", + "2*abs(a)", + + "abs(2.0*a)", + "2.0*abs(a)", + + "abs(-2.0*a)", + "2.0*abs(a)", + + "abs(a-b)+abs(b-a)", + "2*abs(a-b)", + + "abs(3 + 4 i)", + "5", + + "abs([2,3,4])", + "29^(1/2)", + + "abs(a*b)", + "abs(a)*abs(b)", + + "abs(a/b)", + "abs(a)/abs(b)", + + "abs(1/a^b)", + "1/(abs(a^b))", + + # Check that vector length is simplified + + "P=[u*cos(v),u*sin(v),v]", + "", + + "abs(cross(d(P,u),d(P,v)))", + "(1+u^2)^(1/2)", + + "abs((-1)^(-0.666667+0.0291367/pi))", + "1.0", + + "abs((-1)^(9/3))", + "1", + + "abs((1)^(9/3))", + "1", + + "abs((-1.0)^(9/3))", + "1.0", + + ] diff --git a/node_modules/algebrite/tests/adj.coffee b/node_modules/algebrite/tests/adj.coffee new file mode 100644 index 0000000..861d6c0 --- /dev/null +++ b/node_modules/algebrite/tests/adj.coffee @@ -0,0 +1,13 @@ +test_adj = -> + run_test [ + + "adj([[a,b],[c,d]])", + "[[d,-b],[-c,a]]", + + "adj([[1,2],[3,4]])", + "[[4,-2],[-3,1]]", + + "adj([[2,3,-2,5],[6,-2,1,4],[5,10,3,-2],[-1,2,2,3]])", + "[[-4,-177,-73,194],[-117,117,-99,-27],[310,-129,-44,-374],[-130,-51,71,-211]]", + ] + diff --git a/node_modules/algebrite/tests/approxratio.coffee b/node_modules/algebrite/tests/approxratio.coffee new file mode 100644 index 0000000..afab14c --- /dev/null +++ b/node_modules/algebrite/tests/approxratio.coffee @@ -0,0 +1,91 @@ +test_approxratio = -> + run_test [ + "approxratio(0.9054054)", + "67/74", + + "approxratio(0.0102)", + "1/98", + + "approxratio(0.518518)", + "14/27", + + "approxratio(0.3333)", + "1/3", + + "approxratio(0.5)", + "1/2", + + "approxratio(3.14159)", + "355/113", + + "approxratio(a*3.14)", + "a*22/7", + + "approxratio(a*b)", + "a*b", + + "approxratio((0.5*4)^(1/3))", + "2^(1/3)", + + "approxratio(3.14)", + "22/7", + + # see http://davidbau.com/archives/2010/03/14/the_mystery_of_355113.html + "approxratio(3.14159)", + "355/113", + + "approxratio(-3.14159)", + "-355/113", + + "approxratio(0)", + "0", + + "approxratio(0.0)", + "0", + + "approxratio(2)", + "2", + + "approxratio(2.0)", + "2", + + # ------------------------------- + # checking some "long primes" + # also called long period primes, or maximal period primes + # i.e. those numbers whose reciprocal give + # long repeating sequences + # (long prime p gives repetition of p-1 digits). + # big list here: https://oeis.org/A001913/b001913.txt + # also see: https://oeis.org/A001913 + # ------------------------------- + + # 1st long prime + "approxratio(0.14)", + "1/7", + + # 9th long prime, the biggest 2-digits long prime. + # Often asked to + # mental calculators to check their abilities. + "approxratio(0.0103)", + "1/97", + + # 60th long prime, the biggest 3-digits long prime. + # Often asked to + # mental calculators to check their abilities. + "approxratio(0.001017)", + "1/983", + + # 467th long prime, the biggest 4-digits long prime. + "approxratio(0.00010033)", + "1/9967", + + # 3617th long prime, the biggest 5-digits long prime. + "approxratio(0.0000100011)", + "1/99989", + + # 10000th long prime. + "approxratio(0.00000323701)", + "1/308927", + + ] + diff --git a/node_modules/algebrite/tests/arccos.coffee b/node_modules/algebrite/tests/arccos.coffee new file mode 100644 index 0000000..7d75438 --- /dev/null +++ b/node_modules/algebrite/tests/arccos.coffee @@ -0,0 +1,54 @@ +test_arccos = -> + run_test [ + + "arccos(1)", + "0", + + "arccos(1/2)", + "1/3*pi", + + "arccos(0)", + "1/2*pi", + + "arccos(-1/2)", + "2/3*pi", + + "arccos(-1)", + "pi", + + "arccos(cos(0))", + "0", + + "arccos(cos(1/3*pi))", + "1/3*pi", + + "arccos(cos(1/2*pi))", + "1/2*pi", + + "arccos(cos(2/3*pi))", + "2/3*pi", + + "arccos(cos(pi))", + "pi", + + "arccos(cos(x))", + "x", + + "arccos(1/sqrt(2))", + "1/4*pi", + + "arccos(-1/sqrt(2))", + "3/4*pi", + + "arccos(cos(1/4*pi))", + "1/4*pi", + + "arccos(cos(3/4*pi))", + "3/4*pi", + + "arccos(sqrt(3)/2)", + "1/6*pi", + + "arccos(-sqrt(3)/2)", + "5/6*pi", + ] diff --git a/node_modules/algebrite/tests/arccosh.coffee b/node_modules/algebrite/tests/arccosh.coffee new file mode 100644 index 0000000..cbaeadd --- /dev/null +++ b/node_modules/algebrite/tests/arccosh.coffee @@ -0,0 +1,14 @@ +test_arccosh = -> + run_test [ + + "arccosh(1.0)", + "0.0", + + "arccosh(1)", + "0", + + "arccosh(cosh(x))", + "x", + ] + + diff --git a/node_modules/algebrite/tests/arcsin.coffee b/node_modules/algebrite/tests/arcsin.coffee new file mode 100644 index 0000000..144e7c2 --- /dev/null +++ b/node_modules/algebrite/tests/arcsin.coffee @@ -0,0 +1,53 @@ +test_arcsin = -> + run_test [ + "arcsin(-1)", + "-1/2*pi", + + "arcsin(-1/2)", + "-1/6*pi", + + "arcsin(0)", + "0", + + "arcsin(1/2)", + "1/6*pi", + + "arcsin(1)", + "1/2*pi", + + "arcsin(sin(-1/2*pi))", + "-1/2*pi", + + "arcsin(sin(-1/6*pi))", + "-1/6*pi", + + "arcsin(sin(0))", + "0", + + "arcsin(sin(1/6*pi))", + "1/6*pi", + + "arcsin(sin(1/2*pi))", + "1/2*pi", + + "arcsin(sin(x))", + "x", + + "arcsin(1/sqrt(2))", + "1/4*pi", + + "arcsin(-1/sqrt(2))", + "-1/4*pi", + + "arcsin(sin(1/4*pi))", + "1/4*pi", + + "arcsin(sin(-1/4*pi))", + "-1/4*pi", + + "arcsin(sqrt(3)/2)", + "1/3*pi", + + "arcsin(-sqrt(3)/2)", + "-1/3*pi", + ] diff --git a/node_modules/algebrite/tests/arcsinh.coffee b/node_modules/algebrite/tests/arcsinh.coffee new file mode 100644 index 0000000..f9777a8 --- /dev/null +++ b/node_modules/algebrite/tests/arcsinh.coffee @@ -0,0 +1,12 @@ +test_arcsinh = -> + run_test [ + + "arcsinh(0.0)", + "0.0", + + "arcsinh(0)", + "0", + + "arcsinh(sinh(x))", + "x", + ] diff --git a/node_modules/algebrite/tests/arctan.coffee b/node_modules/algebrite/tests/arctan.coffee new file mode 100644 index 0000000..140732c --- /dev/null +++ b/node_modules/algebrite/tests/arctan.coffee @@ -0,0 +1,33 @@ +test_arctan = -> + run_test [ + + "arctan(x)", + "arctan(x)", + + "arctan(-x)", + "-arctan(x)", + + "arctan(0)", + "0", + + "arctan(tan(x))", + "x", + + "arctan(1/sqrt(3))-pi/6", # 30 degrees + "0", + + "arctan(1)-pi/4", # 45 degrees + "0", + + "arctan(sqrt(3))-pi/3", # 60 degrees + "0", + + "arctan(a-b)", + "arctan(a-b)", + + "arctan(b-a)", + "-arctan(a-b)", + + "arctan(tan(x))", + "x", + ] diff --git a/node_modules/algebrite/tests/arctanh.coffee b/node_modules/algebrite/tests/arctanh.coffee new file mode 100644 index 0000000..e917483 --- /dev/null +++ b/node_modules/algebrite/tests/arctanh.coffee @@ -0,0 +1,11 @@ +test_arctanh = -> + run_test [ + "arctanh(0.0)", + "0.0", + + "arctanh(0)", + "0", + + "arctanh(tanh(x))", + "x", + ] diff --git a/node_modules/algebrite/tests/arg.coffee b/node_modules/algebrite/tests/arg.coffee new file mode 100644 index 0000000..b96bf89 --- /dev/null +++ b/node_modules/algebrite/tests/arg.coffee @@ -0,0 +1,102 @@ +test_arg = -> + run_test [ + + # wrong + #"arg(-1)", + #"-pi", + + "arg(pi)", + "0", + + "arg(1+i)", + "1/4*pi", + + "arg(1-i)", + "-1/4*pi", + + "arg(-1+i)", + "3/4*pi", + + "arg(-1-i)", + "-3/4*pi", + + "arg((-1)^(1/3))", + "1/3*pi", + + "arg(1+exp(i*pi/3))", + "1/6*pi", + + "arg((-1)^(1/6)*exp(i*pi/6))", + "1/3*pi", + + # check when not assuming real variables ---------- + "assumeRealVariables = 0", + "", + + "arg(a)", + "arg(a)", + + # TODO this is wrong + #"arg(a*exp(b+i*pi/5))", + #"1/5*pi", + + # this is wrong + #"arg(-1)", + #"-pi", + + # this is also highly debatable + # take the example + # a = -1-i + # then arg(a) - arg(-a) should give pi + # but arg(1+i) - arg(-1-i) gives -pi instead + # "arg(-a)", + # "-pi+arg(a)", + + "assumeRealVariables = 1", + "", + # -------------------------------------------------- + + # TODO this is wrong. + #"arg(a*exp(b+i*pi/5))", + #"1/5*pi", + + # referencing the test above, if + # a is positive: + "arg(abs(a)*exp(b+i*pi/5))", + "1/5*pi", + + # otherwise, if negative, we get: + "arg((-8)*exp(b+i*pi/5))", + "-4/5*pi", + + # if a is positive, zero + # if a is negative, -pi, so + # we can't say much + "arg(a)", + "arg(a)", + + # this is also wrong, this should + # be either zero or pi + #"arg(-a)", + #"-pi+arg(a)", + + "arg(-(-1)^(1/3))", + "-2/3*pi", + + "arg(-exp(i*pi/3))", + "-2/3*pi", + + "arg(-i)", + "-1/2*pi", + + "arg((a+b*i)/(c+d*i))", + "arctan(b/a)-arctan(d/c)", + + "arg(((-1)^(1/2) / (3^(1/2)))^(1/2))", + "1/4*pi", + + "arg((-1)^(1/6))", + "1/6*pi", + + + ] diff --git a/node_modules/algebrite/tests/assignments.coffee b/node_modules/algebrite/tests/assignments.coffee new file mode 100644 index 0000000..a12a248 --- /dev/null +++ b/node_modules/algebrite/tests/assignments.coffee @@ -0,0 +1,293 @@ +test_assignments = -> + run_test [ + + # it used to return exp(1) + "e", + "e", + + # normally sqrt(-1) is shown as i or j + # but if user really wants to look inside + # i/j then we are going to show sqrt(-1) + "i", + "(-1)^(1/2)", + + "j", + "j", + + # degenerate assignments give an error ---- + + "0=0", + "Stop: symbol assignment: error in symbol", + + "1=2", + "Stop: symbol assignment: error in symbol", + + "3=a", + "Stop: symbol assignment: error in symbol", + + # ------------------------------------------ + + # f is not defined, so everything left as is + "f(a)", + "f(a)", + + # this is parsed as a function call, the (f-f) is evaluated and + # returns zero, which is not a valid function, so here + # we can say that the user probably meant to use + # the multiplication + "(f-f)(a)", + "Stop: expected function invocation, found multiplication instead. Use '*' symbol explicitly for multiplication.", + + # tensor instead of function + "([1,2])(a)", + "Stop: expected function invocation, found tensor product instead. Use 'dot/inner' explicitly.", + + "[1,2](a)", + "Stop: expected function invocation, found tensor product instead. Use 'dot/inner' explicitly.", + + # string instead of function + "(\"hey\")(a)", + "Stop: expected function, found string instead.", + + "\"hey\"(a)", + "Stop: expected function, found string instead.", + + # this is parsed as a function call, (f(a)) is evaluated and + # returns something that is not fully evaluated, so we have to + # leave it all as it was + "(f(a))(b)", + "f(a)(b)", + + # this is parsed as a function call, the (f-1) is evaluated and + # returns something that is not fully evaluated, so again + # little that we can do + "(f-1)(a)", + "(-1+f)(a)", + + # similar to the case above + "(x-2)(x-1)", + "(-2+x)(x-1)", + + # similar to the case above, just with a space + "(x-2) (x-1)", + "(-2+x)(x-1)", + + # ------------------------------------------ + + "1[2] = 3" + "Stop: indexed assignment: expected a symbol name" + + "undefinedVar[1] = 2" + "Stop: error in indexed assign: assigning to something that is not a tensor" + + "[[1,2],[3,4]][5] = 6" + "Stop: indexed assignment: expected a symbol name" + + # ------------------------------------------ + + "f(x) = x + 1", + "", + + "g = f", + "", + + "lookup(f)", + "function (x) -> x+1", + + "lookup(g)", + "function (x) -> x+1", + + "f(x,y) = x + 2", + "", + + "lookup(f)", + "function (x y) -> x+2", + + "g(3)", + "4", + + "f(3,0)", + "5", + + "f = quote(1+1)", + "", + + "g = f", + "", + + "g", + "2", + + "g = quote(f)", + "", + + "g", + "2", + + "lookup(g)", + "f", + + "g = lookup(f)", + "", + + "g", + "2", + + "lookup(g)", + "1+1", + + # test the abbreviated form := + # of assignment with quote + "f := 1+1", + "", + + "lookup(f)", + "1+1", + + # a function returning a function + + "f(x) = x + 1", + "", + + "g() = f", + "", + + "g()(2)", + "3", + + # a function returning a function + # variant in which g has an (unneeded) parameter + + "f(x) = x + 1", + "", + + "g(y) = f", + "", + + "g()(2)", + "3", + + + # a function returning a function + # variant in which g has an (unneeded) parameter + # with the same name of the parameter that f uses + + "f(x) = x + 1", + "", + + "g(x) = f", + "", + + "g()(2)", + "3", + + # passing functions as parameters + + "f(x) = x + 1", + "", + + "g(x) = x * x", + "", + + "h(l, x) = l(x)", + "", + + "h(f, 2)", + "3", + + "h(g, 3)", + "9", + + + # passing function as parameter + # but doing nothing with it because + # the function in the body is already + # defined + + "f(x) = x + 1", + "", + + "g(x) = x * x", + "", + + "h(l, x) = f(x)", + "", + + "h(f, 2)", + "3", + + "h(g, 3)", + "4", + + + # clean up ----------------- + + "f=quote(f)", + "", + + "g=quote(g)", + "", + + "h=quote(h)", + "", + + # ---------------------- + "a = a+1", + "", + + "a", + "Stop: recursive evaluation of symbols: a -> a", + + # ---------------------- + "a := b", + "", + + "b := c", + "", + + "c := a", + "", + + "b", + "Stop: recursive evaluation of symbols: b -> c -> a -> b", + + # ---------------------- + # note how this case actually doesn't generate a recursion + # as in Algebrite it's not a problem when a variable + # just contain itself, actually that's the default of + # unassigned variables. + + "a = b", + "", + + "b = a", + "", + + "a", + "b", + + "b", + "b", + + # ---------------------- + # note how these assignments actually don't generate + # a recursion as in Algebrite it's not a problem when + # a variable just contain itself, actually that's the + # default for unassigned variables. + + "a=a", + "", + + "a := a", + "", + + "a", + "a", + + # clean up ----------------- + + "clearall", + "", + + + ] diff --git a/node_modules/algebrite/tests/bake.coffee b/node_modules/algebrite/tests/bake.coffee new file mode 100644 index 0000000..9e89d9b --- /dev/null +++ b/node_modules/algebrite/tests/bake.coffee @@ -0,0 +1,22 @@ +test_bake = -> + run_test [ + + "bake = 0", + "", + + "(x+3)^3", + "27+27*x+9*x^2+x^3", + + "factor", + "(3+x)^3", + + "bake = 1", + "", + + "(x+3)^3", + "x^3+9*x^2+27*x+27", + + "factor", + "(x+3)^3", + + ] diff --git a/node_modules/algebrite/tests/besselj.coffee b/node_modules/algebrite/tests/besselj.coffee new file mode 100644 index 0000000..ef862e0 --- /dev/null +++ b/node_modules/algebrite/tests/besselj.coffee @@ -0,0 +1,54 @@ +test_besselj = -> + run_test [ + + "besselj(x,n)", + "besselj(x,n)", + + "besselj(0,0)", + "1", + + "besselj(0,1)", + "0", + + "besselj(0,-1)", + "0", + + "besselj(x,1/2)-sqrt(2/pi/x)*sin(x)", + "0", + + "besselj(x,-1/2)-sqrt(2/pi/x)*cos(x)", + "0", + + "besselj(x,3/2)-sqrt(2/pi/x)*(sin(x)/x-cos(x))", + "0", + + "besselj(x,-3/2)-sqrt(2/pi/x)*(-cos(x)/x-sin(x))", + "0", + + "besselj(x,5/2)-sqrt(2/pi/x)*((3/x^2-1)*sin(x)-3/x*cos(x))", + "0", + + "besselj(x,-5/2)-sqrt(2/pi/x)*((3/x^2-1)*cos(x)+3/x*sin(x))", + "0", + + # From the note above + + "besselj(x,3/2)-(1/x)*besselj(x,1/2)+besselj(x,-1/2)", + "0", + + "besselj(x,-3/2)+(1/x)*besselj(x,-1/2)+besselj(x,1/2)", + "0", + + # this should simplify + + "y=besselj(x,5/2)", + "", + + "x^2*d(y,x,x)+x*d(y,x)+(x^2-(5/2)^2)*y", + "0", + + "y=quote(y)", + "", + ] + + diff --git a/node_modules/algebrite/tests/bessely.coffee b/node_modules/algebrite/tests/bessely.coffee new file mode 100644 index 0000000..525942f --- /dev/null +++ b/node_modules/algebrite/tests/bessely.coffee @@ -0,0 +1,7 @@ +test_bessely = -> + run_test [ + + "bessely(x,n)", + "bessely(x,n)", + ] + diff --git a/node_modules/algebrite/tests/bignum.coffee b/node_modules/algebrite/tests/bignum.coffee new file mode 100644 index 0000000..8ca8e52 --- /dev/null +++ b/node_modules/algebrite/tests/bignum.coffee @@ -0,0 +1,20 @@ +test_signs_in_rationals = -> + run_test [ + + # I found out about basic mistakes in + # these very very late, better to + # have those tests early on. + + "1/1", + "1", + + "-1/1", + "-1", + + "1/(-1)", + "-1", + + "(-1)/(-1)", + "1", + + ] diff --git a/node_modules/algebrite/tests/binomial.coffee b/node_modules/algebrite/tests/binomial.coffee new file mode 100644 index 0000000..e1e0bc3 --- /dev/null +++ b/node_modules/algebrite/tests/binomial.coffee @@ -0,0 +1,24 @@ +test_binomial = -> + run_test [ + "binomial(12,6)", + "924", + + "binomial(n,k)", + # "1/(factorial(k))*factorial(n)*1/(factorial(-k+n))", + # "factorial(n)/(factorial(k)*factorial(-k+n))", + "n!/(k!*(-k+n)!)", + + "binomial(0,k)", + # "1/(factorial(k))*1/(factorial(-k))", + # "1/(factorial(k)*factorial(-k))", + "1/(k!*(-k)!)", + + "binomial(n,0)", + "1", + + "binomial(-1,k)", + "0", + + "binomial(n,-1)", + "0", + ] diff --git a/node_modules/algebrite/tests/ceiling.coffee b/node_modules/algebrite/tests/ceiling.coffee new file mode 100644 index 0000000..6f346f0 --- /dev/null +++ b/node_modules/algebrite/tests/ceiling.coffee @@ -0,0 +1,76 @@ +test_ceiling = -> + run_test [ + "ceiling(a)", + "ceiling(a)", + + "ceiling(a+b)", + "ceiling(a+b)", + + "ceiling(5/2)", + "3", + + "ceiling(4/2)", + "2", + + "ceiling(3/2)", + "2", + + "ceiling(2/2)", + "1", + + "ceiling(1/2)", + "1", + + "ceiling(0/2)", + "0", + + "ceiling(-1/2)", + "0", + + "ceiling(-2/2)", + "-1", + + "ceiling(-3/2)", + "-1", + + "ceiling(-4/2)", + "-2", + + "ceiling(-5/2)", + "-2", + + "ceiling(5/2.0)", + "3.0", + + "ceiling(4/2.0)", + "2.0", + + "ceiling(3/2.0)", + "2.0", + + "ceiling(2/2.0)", + "1.0", + + "ceiling(1/2.0)", + "1.0", + + "ceiling(0.0)", + "0.0", + + "ceiling(-1/2.0)", + "0.0", + + "ceiling(-2/2.0)", + "-1.0", + + "ceiling(-3/2.0)", + "-1.0", + + "ceiling(-4/2.0)", + "-2.0", + + "ceiling(-5/2.0)", + "-2.0", + ] + + diff --git a/node_modules/algebrite/tests/check.coffee b/node_modules/algebrite/tests/check.coffee new file mode 100644 index 0000000..66177c8 --- /dev/null +++ b/node_modules/algebrite/tests/check.coffee @@ -0,0 +1,87 @@ +test_check = -> + if DEBUG then console.log "test_check ----------------------------" + + run_test [ + + # note how check can turn an assignment + # into a test, so in this case a is not + # assigned anything + + "check(a=b)", + "check(a=b)", + + "a", + "a", + + "check(a)", + "check(a)", + + "check(a=a)", + "1", + + "check(a==a)", + "1", + + "check(a===a)", + "check(a=== ? a)\nStop: syntax error", + + "check(a+1=a)", + "0", + + "check(a+1==a)", + "0", + + "check(a+1===a)", + "check(a+1=== ? a)\nStop: syntax error", + + "check(1)", + "1", + + "check(0)", + "0", + + "check(and(1,0))", + "0", + + "check(and(1,1))", + "1", + + # if passed a value, check if non-zero + "check(pi)", + "1", + + "check(2)", + "1", + + "check(-2)", + "1", + + "check(sqrt(2))", + "1", + + "check(sqrt(-1))", + "1", + + "check(sqrt(pi/4)-sqrt(i))", + "1", + + "check(1+i)", + "1", + + + "check([0,0])", + "0", + + "check([1,2])", + "1", + + "check([1+i,2])", + "1", + + "check([a,2])", + "check([a,2])", + + "check(1-i)", + "1", + + ] diff --git a/node_modules/algebrite/tests/choose.coffee b/node_modules/algebrite/tests/choose.coffee new file mode 100644 index 0000000..d9d7c42 --- /dev/null +++ b/node_modules/algebrite/tests/choose.coffee @@ -0,0 +1,21 @@ +test_choose = -> + run_test [ + "choose(52,5)", + "2598960", + + "choose(n,k)", + "n!/(k!*(-k+n)!)", + + "choose(0,k)", + "1/(k!*(-k)!)", + + "choose(n,0)", + "1", + + "choose(-1,k)", + "0", + + "choose(n,-1)", + "0", + ] + diff --git a/node_modules/algebrite/tests/circexp.coffee b/node_modules/algebrite/tests/circexp.coffee new file mode 100644 index 0000000..73f771c --- /dev/null +++ b/node_modules/algebrite/tests/circexp.coffee @@ -0,0 +1,30 @@ +test_circexp = -> + run_test [ + + "circexp(cos(x))", + "1/2*exp(-i*x)+1/2*exp(i*x)", + + "circexp(sin(x))", + "1/2*i*exp(-i*x)-1/2*i*exp(i*x)", + + "circexp(tan(x))", + "i*exp(-i*x)/(exp(-i*x)+exp(i*x))-i*exp(i*x)/(exp(-i*x)+exp(i*x))", + + "circexp(cosh(x))", + "1/2*exp(x)+1/2*exp(-x)", + + "circexp(sinh(x))", + "1/2*exp(x)-1/2*exp(-x)", + + "circexp(tanh(x))", + "-1/(1+exp(2*x))+exp(2*x)/(1+exp(2*x))", + + "circexp([cos(x),sin(x)])", + "[1/2*exp(-i*x)+1/2*exp(i*x),1/2*i*exp(-i*x)-1/2*i*exp(i*x)]", + + "circexp(cos(x)*sin(x))-expcos(x)*expsin(x)", + "0", + + "circexp(i*2^(1/4)*sin(1/8*pi)+2^(1/4)*cos(1/8*pi))", + "2^(1/4)*exp(1/8*i*pi)", + ] diff --git a/node_modules/algebrite/tests/clearall.coffee b/node_modules/algebrite/tests/clearall.coffee new file mode 100644 index 0000000..ae47e62 --- /dev/null +++ b/node_modules/algebrite/tests/clearall.coffee @@ -0,0 +1,15 @@ +test_clearall = -> + run_test [ + + "a = 1", + "", + + "a", + "1", + + "clearall", + "", + + "a", + "a", + ] diff --git a/node_modules/algebrite/tests/clock.coffee b/node_modules/algebrite/tests/clock.coffee new file mode 100644 index 0000000..367f12c --- /dev/null +++ b/node_modules/algebrite/tests/clock.coffee @@ -0,0 +1,31 @@ +test_clock = -> + run_test [ + + "clock(exp(i pi/3))", + "(-1)^(1/3)", + + "clock(exp(-i pi/3))", + #"-(-1)^(2/3)", + "1/(-1)^(1/3)", + + "rect(clock(3+4*i))", # needs sin(arctan(x)) and cos(arctan(x)) + "3+4*i", + + "clock((-108+108*(-1)^(1/2)*3^(1/2))^(1/3))", + "6*(-1)^(2/9)", + + # TODO + # the changes to abs/mag of Jan 2017 + # make it so a ends up as absolute value + # (-1)^(1/5)*abs(a) + # Rather, clock should somehow recognize + # that this is already very close to clock + # form and just replace the exponential with + # the power of -1 + # Note that this was working before the Jan 2017 + # changes because abs/mag were blissfully + # transforming abs(any_variable) -> any_variable + #"clock(exp(1/5*i*pi)*a)", + #"(-1)^(1/5)*a", + + ] diff --git a/node_modules/algebrite/tests/coeff.coffee b/node_modules/algebrite/tests/coeff.coffee new file mode 100644 index 0000000..2767375 --- /dev/null +++ b/node_modules/algebrite/tests/coeff.coffee @@ -0,0 +1,27 @@ +test_coeff = -> + run_test [ + + "coeff(40*x^3+30*x^2+20*x+10,3)", + "40", + + "coeff(40*x^3+30*x^2+20*x+10,2)", + "30", + + "coeff(40*x^3+30*x^2+20*x+10,1)", + "20", + + "coeff(40*x^3+30*x^2+20*x+10,0)", + "10", + + "coeff(a*t^3+b*t^2+c*t+d,t,3)", + "a", + + "coeff(a*t^3+b*t^2+c*t+d,t,2)", + "b", + + "coeff(a*t^3+b*t^2+c*t+d,t,1)", + "c", + + "coeff(a*t^3+b*t^2+c*t+d,t,0)", + "d", + ] diff --git a/node_modules/algebrite/tests/cofactor.coffee b/node_modules/algebrite/tests/cofactor.coffee new file mode 100644 index 0000000..9286cbb --- /dev/null +++ b/node_modules/algebrite/tests/cofactor.coffee @@ -0,0 +1,18 @@ +test_cofactor = -> + run_test [ + + "cofactor([[1,2],[3,4]],1,1)", + "4", + + "cofactor([[1,2],[3,4]],1,2)", + "-3", + + "cofactor([[1,2],[3,4]],2,1)", + "-2", + + "cofactor([[1,2],[3,4]],2,2)", + "1", + + "cofactor([[1,2,3],[4,5,6],[7,8,9]],1,2)", + "6", + ] diff --git a/node_modules/algebrite/tests/condense.coffee b/node_modules/algebrite/tests/condense.coffee new file mode 100644 index 0000000..a1bf535 --- /dev/null +++ b/node_modules/algebrite/tests/condense.coffee @@ -0,0 +1,28 @@ +test_condense = -> + run_test [ + + "condense(a/(a+b)+b/(a+b))", + "1", + + "psi(n) = exp(-r/n) laguerre(2r/n,n-1,1)", + "", + + "psi(3)", + "3*exp(-1/3*r)-2*r*exp(-1/3*r)+2/9*r^2*exp(-1/3*r)", + + "condense(last)", + "exp(-1/3*r)*(3-2*r+2/9*r^2)", + + "psi()=psi", + "", + + # test case H + + "condense(-3 exp(-1/3 r + i phi) cos(theta) - 6 exp(-1/3 r + i phi) cos(theta) sin(theta)^2 + 12 exp(-1/3 r + i phi) cos(theta)^3)", + "3*exp(-1/3*r+i*phi)*(-1+4*cos(theta)^2-2*sin(theta)^2)*cos(theta)", + + "condense(7208+2736*5^(1/2))", + "8*(901+342*5^(1/2))", + + + ] diff --git a/node_modules/algebrite/tests/contract.coffee b/node_modules/algebrite/tests/contract.coffee new file mode 100644 index 0000000..357e314 --- /dev/null +++ b/node_modules/algebrite/tests/contract.coffee @@ -0,0 +1,46 @@ +test_contract = -> + run_test [ + "contract(0)", + "0", + + "contract(0.0)", + "0", + + # this is same as contract(hilbertmatrix(20)) + # we are testing this because some versions of bigInt library + # seemed to give problems with some gcds involved in these + # additions of fractions + "409741429887649/166966608033225 + 1/39", + "414022624965424/166966608033225", + + # this is same as contract(hilbertmatrix(21)) + # we are testing this because some versions of bigInt library + # seemed to give problems with some gcds involved in these + # additions of fractions + "414022624965424/166966608033225 + 1/41", + "17141894231615609/6845630929362225", + + "contract(hilbert(50))", + "3200355699626285671281379375916142064964/1089380862964257455695840764614254743075", + + "contract([[a,b],[c,d]])", + "a+d", + + "contract([[1,2],[3,4]],1,2)", + "5", + + "A=[[a11,a12],[a21,a22]]", + "", + + "B=[[b11,b12],[b21,b22]]", + "", + + "contract(outer(A,B),2,3)", + "[[a11*b11+a12*b21,a11*b12+a12*b22],[a21*b11+a22*b21,a21*b12+a22*b22]]", + + "A=quote(A)", + "", + + "B=quote(B)", + "", + ] diff --git a/node_modules/algebrite/tests/cos.coffee b/node_modules/algebrite/tests/cos.coffee new file mode 100644 index 0000000..dfb8684 --- /dev/null +++ b/node_modules/algebrite/tests/cos.coffee @@ -0,0 +1,228 @@ +test_cos = -> + run_test [ + + "cos(x)", + "cos(x)", + + "cos(-x)", + "cos(x)", + + "cos(b-a)", + "cos(a-b)", + + # check against the floating point math library + + "f(a,x)=1+cos(float(a/360*2*pi))-float(x)+cos(a/360*2*pi)-x", + "", + + "f(0,1)", # 0 + "1.0", + + "f(90,0)", # 90 + "1.0", + + "f(180,-1)", # 180 + "1.0", + + "f(270,0)", # 270 + "1.0", + + "f(360,1)", # 360 + "1.0", + + "f(-90,0)", # -90 + "1.0", + + "f(-180,-1)", # -180 + "1.0", + + "f(-270,0)", # -270 + "1.0", + + "f(-360,1)", # -360 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(45,sqrt(2)/2)", # 45 + "1.000000...", + + "f(135,-sqrt(2)/2)", # 135 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(225,-sqrt(2)/2)", # 225 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(315,sqrt(2)/2)", # 315 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-45,sqrt(2)/2)", # -45 + "1.000000...", + + "f(-135,-sqrt(2)/2)", # -135 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-225,-sqrt(2)/2)", # -225 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-315,sqrt(2)/2)", # -315 + "1.000000...", + + "f(30,sqrt(3)/2)", # 30 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(150,-sqrt(3)/2)", # 150 + "1.000000...", + + "f(210,-sqrt(3)/2)", # 210 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(330,sqrt(3)/2)", # 330 + "1.000000...", + + "f(-30,sqrt(3)/2)", # -30 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-150,-sqrt(3)/2)", # -150 + "1.000000...", + + "f(-210,-sqrt(3)/2)", # -210 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-330,sqrt(3)/2)", # -330 + "1.000000...", + + "f(60,1/2)", # 60 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(120,-1/2)", # 120 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(240,-1/2)", # 240 + "1.000000...", + + "f(300,1/2)", # 300 + "1.0", + + "f(-60,1/2)", # -60 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-120,-1/2)", # -120 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-240,-1/2)", # -240 + "1.000000...", + + "f(-300,1/2)", # -300 + "1.0", + + "f=quote(f)", + "", + + "cos(arccos(x))", + "x", + + # bug fix for version 119 + + "cos(1/12*pi)", + "cos(1/12*pi)", + + "cos(arctan(4/3))", + "3/5", + + "cos(-arctan(4/3))", + "3/5", + + # phase + + "cos(x-8/2*pi)", + "cos(x)", + + "cos(x-7/2*pi)", + "-sin(x)", + + "cos(x-6/2*pi)", + "-cos(x)", + + "cos(x-5/2*pi)", + "sin(x)", + + "cos(x-4/2*pi)", + "cos(x)", + + "cos(x-3/2*pi)", + "-sin(x)", + + "cos(x-2/2*pi)", + "-cos(x)", + + "cos(x-1/2*pi)", + "sin(x)", + + "cos(x+0/2*pi)", + "cos(x)", + + "cos(x+1/2*pi)", + "-sin(x)", + + "cos(x+2/2*pi)", + "-cos(x)", + + "cos(x+3/2*pi)", + "sin(x)", + + "cos(x+4/2*pi)", + "cos(x)", + + "cos(x+5/2*pi)", + "-sin(x)", + + "cos(x+6/2*pi)", + "-cos(x)", + + "cos(x+7/2*pi)", + "sin(x)", + + "cos(x+8/2*pi)", + "cos(x)", + ] diff --git a/node_modules/algebrite/tests/cosh.coffee b/node_modules/algebrite/tests/cosh.coffee new file mode 100644 index 0000000..9cbadc0 --- /dev/null +++ b/node_modules/algebrite/tests/cosh.coffee @@ -0,0 +1,11 @@ +test_cosh = -> + run_test [ + "cosh(x)", + "cosh(x)", + + "cosh(0)", + "1", + + "cosh(arccosh(x))", + "x", + ] diff --git a/node_modules/algebrite/tests/defint.coffee b/node_modules/algebrite/tests/defint.coffee new file mode 100644 index 0000000..3c11b2d --- /dev/null +++ b/node_modules/algebrite/tests/defint.coffee @@ -0,0 +1,55 @@ +test_defint = -> + run_test [ + "defint(x^2,y,0,sqrt(1-x^2),x,-1,1)", + "1/8*pi", + + # from the eigenmath manual + + "z=2", + "", + + "P=[x,y,z]", + "", + + "a=abs(cross(d(P,x),d(P,y)))", + "", + + "defint(a,y,-sqrt(1-x^2),sqrt(1-x^2),x,-1,1)", + "pi", + + # from the eigenmath manual + + "z=x^2+2y", + "", + + "P=[x,y,z]", + "", + + "a=abs(cross(d(P,x),d(P,y)))", + "", + + "defint(a,x,0,1,y,0,1)", + "3/2+5/8*log(5)", + + # from the eigenmath manual + + "x=u*cos(v)", + "", + + "y=u*sin(v)", + "", + + "z=v", + "", + + "S=[x,y,z]", + "", + + "a=abs(cross(d(S,u),d(S,v)))", + "", + + "defint(a,u,0,1,v,0,3pi)", + "3/2*pi*log(1+2^(1/2))+3*pi/(2^(1/2))", + ] + + diff --git a/node_modules/algebrite/tests/denominator.coffee b/node_modules/algebrite/tests/denominator.coffee new file mode 100644 index 0000000..51805c3 --- /dev/null +++ b/node_modules/algebrite/tests/denominator.coffee @@ -0,0 +1,23 @@ +test_denominator = -> + run_test [ + + "denominator(2/3)", + "3", + + "denominator(x)", + "1", + + "denominator(1/x)", + "x", + + "denominator(a+b)", + "1", + + "denominator(1/a+1/b)", + "a*b", + + # denominator function expands + + "denominator(1/(x-1)/(x-2))", + "x^2-3*x+2", + ] diff --git a/node_modules/algebrite/tests/dependencies.coffee b/node_modules/algebrite/tests/dependencies.coffee new file mode 100644 index 0000000..f4796b5 --- /dev/null +++ b/node_modules/algebrite/tests/dependencies.coffee @@ -0,0 +1,781 @@ +test_dependencies = -> + do_clearall() + + testResult = findDependenciesInScript('1') + if testResult[0] == "All local dependencies: . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: " and + testResult[1] == "1" and + testResult[2] == "" + console.log "ok dependency test" + else + console.log "fail dependency test 1 expected: " + testResult + + do_clearall() + + # check that floats in code are expressed with maximum precision ------------------- + testResult = findDependenciesInScript('a = float(1/3)') + if testResult[0] == "All local dependencies: variable a depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: ; " and + testResult[1] == "" and + testResult[2] == "a = 0.3333333333333333;" + console.log "ok dependency test" + else + console.log "fail dependency test 2 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('a = float(10^50)') + if testResult[0] == "All local dependencies: variable a depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: ; " and + testResult[1] == "" and + testResult[2] == "a = 1e+50;" + console.log "ok dependency test" + else + console.log "fail dependency test 3 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('f = x+1\n g = f\n h = g\n f = g') + if testResult[0] == "All local dependencies: variable f depends on: x, g, ; variable g depends on: f, ; variable h depends on: g, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: x, ; f --> g --> ... then f again, variable g depends on: x, ; g --> f --> ... then g again, variable h depends on: x, ; h --> g --> f --> ... then g again, " and + testResult[1] == "" and + testResult[2] == "// f is part of a cyclic dependency, no code generated.\n// g is part of a cyclic dependency, no code generated.\n// h is part of a cyclic dependency, no code generated." + else + console.log "fail dependency test 4 expected: " + testResult + + do_clearall() + + if findDependenciesInScript('f = x+1\n g = f + y\n h = g')[0] == "All local dependencies: variable f depends on: x, ; variable g depends on: f, y, ; variable h depends on: g, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: x, ; variable g depends on: x, y, ; variable h depends on: x, y, ; " + console.log "ok dependency test" + else + console.log "fail dependency test 5" + + do_clearall() + + if findDependenciesInScript('g = h(x,y)')[0] == "All local dependencies: variable g depends on: h, x, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable g depends on: h, x, y, ; " + console.log "ok dependency test" + else + console.log "fail dependency test 6" + + do_clearall() + + if findDependenciesInScript('f(x,y) = k')[0] == "All local dependencies: variable f depends on: 'x, 'y, k, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: 'x, 'y, k, ; " + console.log "ok dependency test" + else + console.log "fail dependency test 7" + + do_clearall() + + if findDependenciesInScript('x = z\n f(x,y) = k')[0] == "All local dependencies: variable x depends on: z, ; variable f depends on: 'x, 'y, k, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: z, ; variable f depends on: 'x, 'y, k, ; " + console.log "ok dependency test" + else + console.log "fail dependency test 8" + + do_clearall() + + if findDependenciesInScript('x = z\n g = f(x,y)')[0] == "All local dependencies: variable x depends on: z, ; variable g depends on: f, x, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: z, ; variable g depends on: f, z, y, ; " + console.log "ok dependency test" + else + console.log "fail dependency test 9" + + do_clearall() + + if findDependenciesInScript('x = 1\n x = y\n x = z')[0] == "All local dependencies: variable x depends on: y, z, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: y, z, ; " + console.log "ok dependency test" + else + console.log "fail dependency test 10" + + do_clearall() + + testResult = findDependenciesInScript('x = y*y') + if testResult[0] == "All local dependencies: variable x depends on: y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: y, ; " and + testResult[1] == "" and + testResult[2] == "x = function (y) { return ( Math.pow(y, 2) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 11 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('x = e*e') + if testResult[0] == "All local dependencies: variable x depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: ; " and + testResult[1] == "" and + testResult[2] == "x = Math.exp(2);" + console.log "ok dependency test" + else + console.log "fail dependency test 12 expected: " + testResult + + testResult = findDependenciesInScript('x = e') + if testResult[0] == "All local dependencies: variable x depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: ; " and + testResult[1] == "" and + testResult[2] == "x = Math.E;" + console.log "ok dependency test" + else + console.log "fail dependency test 13 expected: " + testResult + + testResult = findDependenciesInScript('x = -sqrt(2)/2') + if testResult[0] == "All local dependencies: variable x depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: ; " and + testResult[1] == "" and + testResult[2] == "x = -1/2*Math.SQRT2;" + console.log "ok dependency test" + else + console.log "fail dependency test 14 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('x = 2^(1/2-a)*2^a/10') + if testResult[0] == "All local dependencies: variable x depends on: a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: a, ; " and + testResult[1] == "" and + testResult[2] == "x = 1/10*Math.SQRT2;" + console.log "ok dependency test" + else + console.log "fail dependency test 15 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('x = rationalize(t*y/(t+y)+2*t^2*y*(2*t+y)^(-2))') + if testResult[0] == "All local dependencies: variable x depends on: t, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: t, y, ; " and + testResult[1] == "" and + testResult[2] == "x = function (t, y) { return ( t*y*(6*Math.pow(t, 2)+Math.pow(y, 2)+6*t*y)/((t+y)*Math.pow((2*t+y), 2)) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 16 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('x = abs((a+i*b)/(c+i*d))') + if testResult[0] == "All local dependencies: variable x depends on: a, b, c, d, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: a, b, c, d, ; " and + testResult[1] == "" and + testResult[2] == "x = function (a, b, c, d) { return ( Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2))/(Math.sqrt(Math.pow(c, 2)+Math.pow(d, 2))) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 17 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('x = sin(1/10)^2 + cos(1/10)^2 + y') + if testResult[0] == "All local dependencies: variable x depends on: y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: y, ; " and + testResult[1] == "" and + testResult[2] == "x = function (y) { return ( 1+y ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 18 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('x = y + cos(1) + sin(1)') + if testResult[0] == "All local dependencies: variable x depends on: y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: y, ; " and + testResult[1] == "" and + testResult[2] == "x = function (y) { return ( y+Math.cos(1)+Math.sin(1) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 19 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('x = a + arccos(b) + arcsin(c)') + if testResult[0] == "All local dependencies: variable x depends on: a, arccos, b, arcsin, c, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: a, arccos, b, arcsin, c, ; " and + testResult[1] == "" and + testResult[2] == "x = function (a, b, c) { return ( a+Math.acos(b)+Math.asin(c) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 20 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('x = sin(1/10)^2 + cos(1/10)^2') + if testResult[0] == "All local dependencies: variable x depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable x depends on: ; " and + testResult[1] == "" and + testResult[2] == "x = 1;" + console.log "ok dependency test" + else + console.log "fail dependency test 21 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('a = unit(b) + c') + if testResult[0] == "All local dependencies: variable a depends on: b, c, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: b, c, ; " and + testResult[1] == "" and + testResult[2] == "a = function (c, b) { return ( c+identity(b) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 22 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f(x) = x * x') + if testResult[0] == "All local dependencies: variable f depends on: 'x, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: 'x, ; " and + testResult[1] == "" and + testResult[2] == "f = function (x) { return ( x*x ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 23 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('f(x) = x * x + g(y)') + if testResult[0] == "All local dependencies: variable f depends on: 'x, g, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: 'x, g, y, ; " and + testResult[1] == "" and + testResult[2] == "f = function (g, y, x) { return ( g(y)+Math.pow(x, 2) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 24 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('y = 2\nf(x) = x * x + g(y)') + if testResult[0] == "All local dependencies: variable y depends on: ; variable f depends on: 'x, g, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable y depends on: ; variable f depends on: 'x, g, ; " and + testResult[1] == "" and + testResult[2] == "y = 2;\nf = function (g, x) { return ( g(2)+Math.pow(x, 2) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 25 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('g(x) = x + 2\ny = 2\nf(x) = x * x + g(y)') + if testResult[0] == "All local dependencies: variable g depends on: 'x, ; variable y depends on: ; variable f depends on: 'x, g, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable g depends on: 'x, ; variable y depends on: ; variable f depends on: 'x, ; " and + testResult[1] == "" and + testResult[2] == "g = function (x) { return ( 2+x ); }\ny = 2;\nf = function (x) { return ( 4+Math.pow(x, 2) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 26 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('g(x) = x + 2\nf(x) = x * x + g(y)') + if testResult[0] == "All local dependencies: variable g depends on: 'x, ; variable f depends on: 'x, g, y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable g depends on: 'x, ; variable f depends on: 'x, y, ; " and + testResult[1] == "" and + testResult[2] == "g = function (x) { return ( 2+x ); }\nf = function (y, x) { return ( 2+y+Math.pow(x, 2) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 27 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + ### + testResult = findDependenciesInScript('g(x) = f(x)\nf(x)=g(x)') + if testResult[0] == "All local dependencies: variable g depends on: 'x, f, x, ; variable f depends on: 'x, g, x, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable g depends on: 'x, ; g --> f --> ... then g again, variable f depends on: 'x, x, ; f --> g --> ... then f again, " and + testResult[1] == "" and + testResult[2] == "// g is part of a cyclic dependency, no code generated.\n// f is part of a cyclic dependency, no code generated." + console.log "ok dependency test" + else + console.log "fail dependency test 28 expected: " + testResult + + do_clearall() + ### + + testResult = findDependenciesInScript('piApprox = sum((-1)^k * (1/(2*k + 1)),k,0,iterations)*4') + if testResult[0] == "All local dependencies: variable piApprox depends on: iterations, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable piApprox depends on: iterations, ; " and + testResult[1] == "" and + testResult[2] == "piApprox = function (iterations) { return ( 4*(function(){ var k; var holderSum = 0; var lowerlimit = 0; var upperlimit = iterations; for (k = lowerlimit; k < upperlimit; k++) { holderSum += Math.pow((-1), k)/(2*k+1); } return holderSum;})() ); }" and + testResult[3] == "piApprox(iterations) = 4\\sum_{k=0}^{iterations}{\\frac{(-1)^k}{(2k+1)}}" + console.log "ok dependency test" + else + console.log "fail dependency test 29 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + console.log "testResult[3]: " + testResult[3] + + do_clearall() + + testResult = findDependenciesInScript('piApprox = 2*product(4*k^2/(4*k^2-1),k,1,iterations)') + if testResult[0] == "All local dependencies: variable piApprox depends on: iterations, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable piApprox depends on: iterations, ; " and + testResult[1] == "" and + testResult[2] == "piApprox = function (iterations) { return ( 2*(function(){ var k; var holderProduct = 1; var lowerlimit = 1; var upperlimit = iterations; for (k = lowerlimit; k < upperlimit; k++) { holderProduct *= 4*Math.pow(k, 2)/(4*Math.pow(k, 2)-1); } return holderProduct;})() ); }" and + testResult[3] == "piApprox(iterations) = 2\\prod_{k=1}^{iterations}{\\frac{4k^2}{(4k^2-1)}}" + console.log "ok dependency test" + else + console.log "fail dependency test 30 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + console.log "testResult[3]: " + testResult[3] + + do_clearall() + + testResult = findDependenciesInScript('f = roots(a*x^2 + b*x + c, x)') + if testResult[0] == "All local dependencies: variable f depends on: a, b, c, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: a, b, c, ; " and + testResult[1] == "" and + testResult[2] == "f = function (a, b, c) { return ( [-1/2*(Math.sqrt(Math.pow(b, 2)/(Math.pow(a, 2))-4*c/a)+b/a),1/2*(Math.sqrt(Math.pow(b, 2)/(Math.pow(a, 2))-4*c/a)-b/a)] ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 31 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f = roots(a*x^2 + b*x + c)') + if testResult[0] == "All local dependencies: variable f depends on: a, b, c, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: a, b, c, ; " and + testResult[1] == "" and + testResult[2] == "f = function (a, b, c) { return ( [-1/2*(Math.sqrt(Math.pow(b, 2)/(Math.pow(a, 2))-4*c/a)+b/a),1/2*(Math.sqrt(Math.pow(b, 2)/(Math.pow(a, 2))-4*c/a)-b/a)] ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 32 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f = roots(integral(a*x + b))') + if testResult[0] == "All local dependencies: variable f depends on: a, b, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: a, b, ; " and + testResult[1] == "" and + testResult[2] == "f = function (a, b) { return ( [0,-2*b/a] ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 33 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f = roots(defint(a*x + y,y,0,1))') + if testResult[0] == "All local dependencies: variable f depends on: a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: a, ; " and + testResult[1] == "" and + testResult[2] == "f = function (a) { return ( -1/(2*a) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 34 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f = roots(defint(a*x + y + z,y,0,1, z, 0, 1))') + if testResult[0] == "All local dependencies: variable f depends on: a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: a, ; " and + testResult[1] == "" and + testResult[2] == "f = function (a) { return ( -1/a ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 35 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f = defint(2*x - 3*y,x,0,2*y)') + if testResult[0] == "All local dependencies: variable f depends on: y, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: y, ; " and + testResult[1] == "" and + testResult[2] == "f = function (y) { return ( -2*Math.pow(y, 2) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 36 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('f = defint(12 - x^2 - (y^2)/2,x,0,2,y,0,3)') + if testResult[0] == "All local dependencies: variable f depends on: ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable f depends on: ; " and + testResult[1] == "" and + testResult[2] == "f = 55;" + console.log "ok dependency test" + else + console.log "fail dependency test 37 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + # this example checks that functions are not meddled with, + # in particular that in the function body, the variables + # bound by the parameters remain "separate" from previous + # variables with the same name. + testResult = findDependenciesInScript('a = 2\nf(a) = a+1+b') + if testResult[0] == "All local dependencies: variable a depends on: ; variable f depends on: 'a, b, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: ; variable f depends on: 'a, b, ; " and + testResult[1] == "" and + testResult[2] == "a = 2;\nf = function (a, b) { return ( 1+a+b ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 38 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + # similar as test above but this time we are not + # defining a function, so things are a bit different. + testResult = findDependenciesInScript('a = 2\nf = a+1') + if testResult[0] == "All local dependencies: variable a depends on: ; variable f depends on: a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: ; variable f depends on: ; " and + testResult[1] == "" and + testResult[2] == "a = 2;\nf = 3;" + console.log "ok dependency test" + else + console.log "fail dependency test 39 expected: " + testResult + + do_clearall() + + # similar as test above but this time we do a + # trick with the quote to see whether we + # get confused with the indirection + testResult = findDependenciesInScript('a := b\nf = a+1') + if testResult[0] == "All local dependencies: variable a depends on: b, ; variable f depends on: a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: b, ; variable f depends on: b, ; " and + testResult[1] == "" and + testResult[2] == "a = function (b) { return ( b ); }\nf = function (b) { return ( 1+b ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 40 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + # another tricky case of indirection through quote + testResult = findDependenciesInScript('a := b\nf(a) = a+1') + if testResult[0] == "All local dependencies: variable a depends on: b, ; variable f depends on: 'a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: b, ; variable f depends on: 'a, ; " and + testResult[1] == "" and + testResult[2] == "a = function (b) { return ( b ); }\nf = function (a) { return ( 1+a ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 41 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + # reassignment + testResult = findDependenciesInScript('b = 1\nb=a+b+c') + if testResult[0] == "All local dependencies: variable b depends on: a, c, ; . Symbols with reassignments: b, . Symbols in expressions without assignments: . All dependencies recursively: variable b depends on: a, c, ; " and + testResult[1] == "" and + testResult[2] == "b = function (a, c) { return ( 1+a+c ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 42 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + # reassignment + testResult = findDependenciesInScript('a = a+1') + if testResult[0] == "All local dependencies: variable a depends on: ; . Symbols with reassignments: a, . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: ; " and + testResult[1] == "" and + testResult[2] == "" and + testResult[5] == "Error: Stop: recursive evaluation of symbols: a -> a" + console.log "ok dependency test" + else + console.log "fail dependency test 43 expected: " + testResult + + do_clearall() + + # reassignment + testResult = computeDependenciesFromAlgebra('pattern(a,b)\nc= d\na=a+1') + if testResult.affectsVariables.length is 3 and + testResult.affectsVariables.indexOf("c") != -1 and + testResult.affectsVariables.indexOf("a") != -1 and + testResult.affectsVariables.indexOf("PATTERN_DEPENDENCY") != -1 and + testResult.affectedBy.length is 3 and + testResult.affectedBy.indexOf("d") != -1 and + testResult.affectedBy.indexOf("a") != -1 and + testResult.affectedBy.indexOf("PATTERN_DEPENDENCY") != -1 + console.log "ok dependency test" + else + console.log "fail dependency test 44 expected: " + testResult + + do_clearall() + + testResult = computeDependenciesFromAlgebra('PCA(M) = eig(Mᵀ⋅M)') + if testResult.affectsVariables.length is 1 and + testResult.affectsVariables.indexOf("PCA") != -1 and + testResult.affectsVariables.indexOf("PATTERN_DEPENDENCY") == -1 and + testResult.affectedBy.length is 1 and + testResult.affectedBy.indexOf("PATTERN_DEPENDENCY") != -1 + console.log "ok dependency test" + else + console.log "fail dependency test 45 expected: " + testResult + + do_clearall() + + testResult = computeDependenciesFromAlgebra('pattern(a_ᵀ⋅a_, cov(a_))') + if testResult.affectsVariables.length is 1 and + testResult.affectsVariables.indexOf("PATTERN_DEPENDENCY") != -1 and + testResult.affectedBy.length is 1 and + testResult.affectedBy.indexOf("PATTERN_DEPENDENCY") != -1 + console.log "ok dependency test" + else + console.log "fail dependency test 46 expected: " + testResult + + do_clearall() + + testResult = findDependenciesInScript('a = b\nf = a+1') + if testResult[0] == "All local dependencies: variable a depends on: b, ; variable f depends on: a, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable a depends on: b, ; variable f depends on: b, ; " and + testResult[1] == "" and + testResult[2] == "a = function (b) { return ( b ); }\nf = function (b) { return ( 1+b ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 47 obtained: " + console.log "testResult[0]: " + testResult[0] + console.log "testResult[1]: " + testResult[1] + console.log "testResult[2]: " + testResult[2] + + do_clearall() + + testResult = findDependenciesInScript('PCA(M) = eig(cov(M))') + if testResult[0] == "All local dependencies: variable PCA depends on: 'M, ; . Symbols with reassignments: . Symbols in expressions without assignments: . All dependencies recursively: variable PCA depends on: 'M, ; " and + testResult[1] == "" and + testResult[2] == "PCA = function (M) { return ( eig(cov(M)) ); }" + console.log "ok dependency test" + else + console.log "fail dependency test 48 expected: " + testResult + + do_clearall() + + computeResultsAndJavaScriptFromAlgebra('PCA(M) = eig(Mᵀ⋅M)') + testResult = run('symbolsinfo') + if testResult.indexOf('AVOID_BINDING_TO_EXTERNAL_SCOPE_VALUE') != -1 + console.log "fail dependency tests 49 found AVOID_BINDING_TO_EXTERNAL_SCOPE_VALUE" + else + console.log "ok dependency test" + + do_clearall() + + # this checks error handling in case of pattern and syntax error + # picked up during scanning. + computeResultsAndJavaScriptFromAlgebra('pattern(a_ᵀ⋅a_, cov(a_))') + computeResultsAndJavaScriptFromAlgebra('simplify(') + testResult = computeResultsAndJavaScriptFromAlgebra('PCA = Mᵀ·M') + + if testResult.code == "PCA = function (M) { return ( cov(M) ); }" and + testResult.latexResult == "$$PCA(M) = cov(M)$$" and + testResult.result == "$$PCA(M) = cov(M)$$" and + testResult.dependencyInfo.affectedBy[0] == "M" and + testResult.dependencyInfo.affectedBy[1] == "PATTERN_DEPENDENCY" and + testResult.dependencyInfo.affectsVariables.length == 1 and + testResult.dependencyInfo.affectsVariables[0] == "PCA" + console.log "ok dependency test" + else + console.log "fail dependency tests 50 Error handling 1" + console.log testResult + return + + do_clearall() + + testResult = computeResultsAndJavaScriptFromAlgebra('x + x + x') + + if testResult.code == "" and + testResult.latexResult == "$$3x$$" and + testResult.result == "$$3x$$" and + testResult.dependencyInfo.affectedBy.length == 2 and + testResult.dependencyInfo.affectedBy[0] == "x" and + testResult.dependencyInfo.affectedBy[1] == "PATTERN_DEPENDENCY" and + testResult.dependencyInfo.affectsVariables.length == 0 + console.log "ok dependency test" + else + console.log "fail dependency tests 51" + + do_clearall() + + computeResultsAndJavaScriptFromAlgebra('x = y + 2') + testResult = computeResultsAndJavaScriptFromAlgebra('x + x + x') + + if testResult.code == "" and + testResult.latexResult == "$$3y+6$$" and + testResult.result == "$$3y+6$$" and + testResult.dependencyInfo.affectedBy.length == 2 and + testResult.dependencyInfo.affectedBy[0] == "x" and + testResult.dependencyInfo.affectedBy[1] == "PATTERN_DEPENDENCY" and + testResult.dependencyInfo.affectsVariables.length == 0 + console.log "ok dependency test" + else + console.log "fail dependency tests 52" + + do_clearall() + + testResult = computeResultsAndJavaScriptFromAlgebra('[[0,1],[1,0]]') + + if testResult.latexResult == "$$\\begin{bmatrix} 0 & 1 \\\\ 1 & 0 \\end{bmatrix}$$" and + testResult.result == "$$\\begin{bmatrix} 0 & 1 \\\\ 1 & 0 \\end{bmatrix}$$" and + testResult.dependencyInfo.affectsVariables.length == 0 + console.log "ok dependency test" + else + console.log "fail dependency tests 53" + + do_clearall() + + testResult = computeResultsAndJavaScriptFromAlgebra('x = [[0,1],[1,0]]') + + if testResult.code == "x = [[0,1],[1,0]];" and + testResult.latexResult == "$$x = \\begin{bmatrix} 0 & 1 \\\\ 1 & 0 \\end{bmatrix}$$" and + testResult.result == "$$x = \\begin{bmatrix} 0 & 1 \\\\ 1 & 0 \\end{bmatrix}$$" and + testResult.dependencyInfo.affectedBy.length == 1 and + testResult.dependencyInfo.affectedBy[0] == "PATTERN_DEPENDENCY" and + testResult.dependencyInfo.affectsVariables.length == 1 and + testResult.dependencyInfo.affectsVariables[0] == "x" + console.log "ok dependency test" + else + console.log "fail dependency tests 54" + + do_clearall() + + # a simple array lookup like this is turned into + # a function, which is slighly silly but + # it's orthogonal, this works also if instead of + # b we have an arbitrary non-trivial function + # on b, maybe even symbolic e.g. the round + # of the root of by = 6, i.e. round(root(by-6,y)) + testResult = computeResultsAndJavaScriptFromAlgebra('x = a[b]') + + if testResult.code == "x = function (a, b) { return ( a[b] ); }" and + testResult.latexResult == "$$x(a, b) = a[b]$$" and + testResult.result == "$$x(a, b) = a[b]$$" and + testResult.dependencyInfo.affectedBy.length == 3 and + testResult.dependencyInfo.affectedBy[0] == "a" and + testResult.dependencyInfo.affectedBy[1] == "b" and + testResult.dependencyInfo.affectedBy[2] == "PATTERN_DEPENDENCY" and + testResult.dependencyInfo.affectsVariables.length == 1 and + testResult.dependencyInfo.affectsVariables[0] == "x" + console.log "ok dependency test" + else + console.log "fail dependency tests 55" + + do_clearall() + + testResult = computeResultsAndJavaScriptFromAlgebra('x = a ⋅ b') + + if testResult.code == "x = function (a, b) { return ( dot(a, b) ); }" and + testResult.latexResult == "$$x(a, b) = a \\cdot b$$" and + testResult.result == "$$x(a, b) = a \\cdot b$$" and + testResult.dependencyInfo.affectedBy.length == 3 and + testResult.dependencyInfo.affectedBy[0] == "a" and + testResult.dependencyInfo.affectedBy[1] == "b" and + testResult.dependencyInfo.affectedBy[2] == "PATTERN_DEPENDENCY" and + testResult.dependencyInfo.affectsVariables.length == 1 and + testResult.dependencyInfo.affectsVariables[0] == "x" + console.log "ok dependency test" + else + console.log "fail dependency tests 56" + + do_clearall() + + # Here we test an actual sequence of invokations form the + # notebook. + + code1 = 'pattern(a_ᵀ⋅a_, cov(a_))' + code2 = 'PCA = Mᵀ·M' + + # invokation sequence, we check that the + # full evaluation of the last piece of code + # gives the correct result. + computeDependenciesFromAlgebra code1 + computeDependenciesFromAlgebra code2 + computeResultsAndJavaScriptFromAlgebra code1 + computeDependenciesFromAlgebra code1 + computeDependenciesFromAlgebra code2 + res = computeResultsAndJavaScriptFromAlgebra code2 + + if res.code == 'PCA = function (M) { return ( cov(M) ); }' and + res.latexResult == '$$PCA(M) = cov(M)$$' and + res.dependencyInfo.affectsVariables.length == 1 and + res.dependencyInfo.affectsVariables[0] == 'PCA' and + res.dependencyInfo.affectedBy.length == 2 and + res.dependencyInfo.affectedBy[0] == 'M' and + res.dependencyInfo.affectedBy[1] == 'PATTERN_DEPENDENCY' + console.log "ok dependency test" + else + console.log "fail dependency tests 57" + + + + do_clearall() + + # overwriting a pattern, as seen from the notebook + + code1 = 'pattern(a_ + a_, 42 * a_)' + code2 = 'pattern(a_ + a_, 21 * a_)' + code3 = 'f = x + x' + + computeResultsAndJavaScriptFromAlgebra code1 + computeResultsAndJavaScriptFromAlgebra code2 + res = computeResultsAndJavaScriptFromAlgebra code3 + + if res.code == 'f = function (x) { return ( 21*x ); }' and + res.latexResult == '$$f(x) = 21x$$' and + res.dependencyInfo.affectsVariables.length == 1 and + res.dependencyInfo.affectsVariables[0] == 'f' and + res.dependencyInfo.affectedBy.length == 2 and + res.dependencyInfo.affectedBy[0] == 'x' and + res.dependencyInfo.affectedBy[1] == 'PATTERN_DEPENDENCY' + console.log "ok dependency test" + else + console.log "fail dependency tests 58" + + + + do_clearall() + + # tests + + res = computeResultsAndJavaScriptFromAlgebra "f=test(x<1,-x-4,3<=x,x*x+7,120/x+5)" + + if res.code == 'f = function (x) { return ( (function(){if (((x) < (1))){return (-x-4);} else if (((3) <= (x))){return (x*x+7);}else {return (120/x+5);}})() ); }' and + res.latexResult == '$$f(x) = \\left\\{ \\begin{array}{ll}{-x-4} & if & {x} < {1} \\\\\\\\{xx+7} & if & {3} \\leq {x} \\\\\\\\{\\frac{120}{x}+5} & otherwise \\end{array} \\right.$$' and + res.dependencyInfo.affectsVariables.length == 1 and + res.dependencyInfo.affectsVariables[0] == 'f' and + res.dependencyInfo.affectedBy.length == 2 and + res.dependencyInfo.affectedBy[0] == 'x' and + res.dependencyInfo.affectedBy[1] == 'PATTERN_DEPENDENCY' + console.log "ok dependency test" + else + console.log "fail dependency tests 59" + + + do_clearall() + + # tests + + res = computeResultsAndJavaScriptFromAlgebra "f=floor(x) + ceiling(x) + round(x)" + + if res.code == 'f = function (x) { return ( ceiling(x)+floor(x)+round(x) ); }' and + res.latexResult == '$$f(x) = \\lceil {x} \\rceil + \\lfloor {x} \\rfloor +round(x)$$' and + res.dependencyInfo.affectsVariables.length == 1 and + res.dependencyInfo.affectsVariables[0] == 'f' and + res.dependencyInfo.affectedBy.length == 2 and + res.dependencyInfo.affectedBy[0] == 'x' and + res.dependencyInfo.affectedBy[1] == 'PATTERN_DEPENDENCY' + console.log "ok dependency test" + else + console.log "fail dependency tests 60" + + + do_clearall() + + console.log "-- done dependency tests" diff --git a/node_modules/algebrite/tests/derivative.coffee b/node_modules/algebrite/tests/derivative.coffee new file mode 100644 index 0000000..271bd4d --- /dev/null +++ b/node_modules/algebrite/tests/derivative.coffee @@ -0,0 +1,184 @@ +test_derivative = -> + run_test [ + + "x=quote(x)", + "", + + "f=quote(f)", + "", + + "g=quote(g)", + "", + + "d(a,x)", + "0", + + "d(x,x)", + "1", + + "d(x^2,x)", + "2*x", + + "d(log(x),x)", + "1/x", + + "d(exp(x),x)", + "exp(x)", + + "d(a^x,x)", + "a^x*log(a)", + + "d(x^x,x)-(x^x+x^x*log(x))", + "0", + + "d(log(x^2+5),x)-(2*x/(5+x^2))", + "0", + + "d(d(f(x),x),y)", + "0", + + "d(d(f(x),y),x)", + "0", + + "d(d(f(y),x),y)", + "0", + + "d(d(f(y),y),x)", + "0", + + "d([x*y*z,y,x+z],[x,y,z])", + "[[y*z,x*z,x*y],[0,1,0],[1,0,1]]", + + "d(x+z,[x,y,z])", + "[1,0,1]", + + "d(cos(theta)^2,cos(theta))", + "2*cos(theta)", + + "d(f())", + "d(f(),x)", + + "d(x^2)", + "2*x", + + "d(t^2)", + "2*t", + + "d(t^2 x^2)", + "2*t^2*x", + + # trig functions + + "d(sin(x),x)-cos(x)", + "0", + + "d(cos(x),x)+sin(x)", + "0", + + "d(tan(x),x)-cos(x)^(-2)", + "0", + + "d(arcsin(x),x)-1/sqrt(1-x^2)", + "0", + + "d(arccos(x),x)+1/sqrt(1-x^2)", + "0", + + "d(arctan(x),x)-1/(1+x^2)", + "0", + + "d(arctan(y/x),x)", + "-y/(x^2+y^2)", + + "d(arctan(y/x),y)", + "x/(x^2+y^2)", + + # hyp functions + + "d(sinh(x),x)-cosh(x)", + "0", + + "d(cosh(x),x)-sinh(x)", + "0", + + "d(tanh(x),x)-cosh(x)^(-2)", + "0", + + "d(arcsinh(x),x)-1/sqrt(x^2+1)", + "0", + + "d(arccosh(x),x)-1/sqrt(x^2-1)", + "0", + + "d(arctanh(x),x)-1/(1-x^2)", + "0", + + "d(sin(cos(x)),x)+cos(cos(x))*sin(x)", + "0", + + "d(sin(x)^2,x)-2*sin(x)*cos(x)", + "0", + + "d(sin(cos(x)),cos(x))-cos(cos(x))", + "0", + + "d(abs(x),x)", + "sgn(x)", + + "d(sgn(x),x)", + "2*dirac(x)", + + # generic functions + + "d(f(),x)", + "d(f(),x)", + + "d(f(x),x)", + "d(f(x),x)", + + "d(f(y),x)", + "0", + + "d(g(f(x)),f(x))", + "d(g(f(x)),f(x))", + + "d(g(f(x)),x)", + "d(g(f(x)),x)", + + # other functions + + "d(erf(x))-2*exp(-x^2)/sqrt(pi)", + "0", + + # arg lists + + "f=x^5*y^7", + "", + + "d(f)", + "5*x^4*y^7", + + "d(f,x)", + "5*x^4*y^7", + + "d(f,x,0)", + "x^5*y^7", + + "d(f,x,1)", + "5*x^4*y^7", + + "d(f,x,2)", + "20*x^3*y^7", + + "d(f,2)", + "20*x^3*y^7", + + "d(f,2,y)", + "140*x^3*y^6", + + "d(f,x,x,y,y)", + "840*x^3*y^5", + + "f=quote(f)", + "", + ] diff --git a/node_modules/algebrite/tests/dirac.coffee b/node_modules/algebrite/tests/dirac.coffee new file mode 100644 index 0000000..c65386d --- /dev/null +++ b/node_modules/algebrite/tests/dirac.coffee @@ -0,0 +1,5 @@ +test_dirac = -> + run_test [ + "dirac(-x)", + "dirac(x)", + ] diff --git a/node_modules/algebrite/tests/divisors.coffee b/node_modules/algebrite/tests/divisors.coffee new file mode 100644 index 0000000..8159eae --- /dev/null +++ b/node_modules/algebrite/tests/divisors.coffee @@ -0,0 +1,27 @@ +test_divisors = -> + run_test [ + + "divisors(12)", + "[1,2,3,4,6,12]", + + "divisors(-12)", + "[1,2,3,4,6,12]", + + "divisors(a)", + "[1,a]", + + "divisors(-a)", + "[1,a]", + + "divisors(+3*x+3)", + "[1,3,1+x,3+3*x]", + + "divisors(+3*x-3)", + "[1,3,-3+3*x,-1+x]", + + "divisors(-3*x+3)", + "[1,3,1-x,3-3*x]", + + "divisors(-3*x-3)", + "[1,3,1+x,3+3*x]", + ] diff --git a/node_modules/algebrite/tests/eigen.coffee b/node_modules/algebrite/tests/eigen.coffee new file mode 100644 index 0000000..ef6e777 --- /dev/null +++ b/node_modules/algebrite/tests/eigen.coffee @@ -0,0 +1,63 @@ +test_eigen = -> + run_test [ + "eigen(A)", + "Stop: eigen: argument is not a square matrix", + + "eigenval(A)", + "eigenval(A)", + + "eigenvec(A)", + "eigenvec(A)", + + "eigen([1,2])", + "Stop: eigen: argument is not a square matrix", + + "eigen([[1,2],[1,2]])", + "Stop: eigen: matrix is not symmetrical", + + "eigenval([[1,1,1,1],[1,2,3,4],[1,3,6,10],[1,4,10,20]])", + "[[0.038016...,0.0,0.0,0.0],[0.0,0.453835...,0.0,0.0],[0.0,0.0,2.203446...,0.0],[0.0,0.0,0.0,26.304703...]]", + + "eigenvec([[1,1,1,1],[1,2,3,4],[1,3,6,10],[1,4,10,20]])", + "[[0.308686...,-0.723090...,0.594551...,-0.168412...],[0.787275...,-0.163234...,-0.532107...,0.265358...],[0.530366...,0.640332...,0.391832...,-0.393897...],[0.060187...,0.201173...,0.458082...,0.863752...]]", + "eigen(hilbert(20))", + "", + + # "contract" is the trace, but "trace" is a debugging flag in + # Algebrite/Eigenmath + # this one takes quite some time to finish because of the + # "dot(transpose(Q),D,Q))" calculation. Note that since + # D and Q are matrices of doubles, the whole result is a double. + # also note that the result gives "-0.000000...", that's why I put the abs there + # Note that this should be really "0" however, because of calculation errors, + # it doesn't test equal to "0", so we get to this result + "abs(contract(hilbert(20))-contract(dot(transpose(Q),D,Q)))", + "0.000000...", + + "D=quote(D)", + "", + + "Q=quote(Q)", + "", + + "A=hilbert(3)", + "", + + "eigen(A)", + "", + + "D-eigenval(A)", + "[[0,0,0],[0,0,0],[0,0,0]]", + + "Q-eigenvec(A)", + "[[0,0,0],[0,0,0],[0,0,0]]", + + "A=quote(A)", + "", + + "D=quote(D)", + "", + + "Q=quote(Q)", + "", + ] diff --git a/node_modules/algebrite/tests/erf.coffee b/node_modules/algebrite/tests/erf.coffee new file mode 100644 index 0000000..766db29 --- /dev/null +++ b/node_modules/algebrite/tests/erf.coffee @@ -0,0 +1,32 @@ +test_erf = -> + run_test [ + + "erf(a)", + "erf(a)", + + "erf(0.0) + 1", + "1.0", + + "float(erf(0))", + "0.0", + + "erf(0.0)", + "0.0", + + "erf(-0.0)", + "0.0", + + "erf(0)", + "0", + + "erf(-0)", + "0", + + "float(erf(0)) + 1", + "1.0", + + "float(erf(1))", + "0.842701...", + + ] + diff --git a/node_modules/algebrite/tests/erfc.coffee b/node_modules/algebrite/tests/erfc.coffee new file mode 100644 index 0000000..2a9c150 --- /dev/null +++ b/node_modules/algebrite/tests/erfc.coffee @@ -0,0 +1,28 @@ +test_erfc = -> + run_test [ + + "erfc(a)", + "erfc(a)", + + "erfc(0.0)", + "1.0", + + "float(erfc(0))", + "1.0", + + "erfc(0.0)", + "1.0", + + "erfc(-0.0)", + "1.0", + + "erfc(0)", + "1", + + "erfc(-0)", + "1", + + "float(erfc(1))", + "0.157299...", + + ] diff --git a/node_modules/algebrite/tests/exp.coffee b/node_modules/algebrite/tests/exp.coffee new file mode 100644 index 0000000..51ef50d --- /dev/null +++ b/node_modules/algebrite/tests/exp.coffee @@ -0,0 +1,13 @@ +test_exp = -> + run_test [ + + "exp(-3/4*i*pi)", + #"exp(-3/4*i*pi)", + "-1/2*2^(1/2)-1/2*i*2^(1/2)", + + "simplify(exp(-3/4*i*pi))", + #"exp(-3/4*i*pi)", + #"-1/2*2^(1/2)-1/2*i*2^(1/2)", + "-(1+i)/(2^(1/2))", + + ] diff --git a/node_modules/algebrite/tests/expand.coffee b/node_modules/algebrite/tests/expand.coffee new file mode 100644 index 0000000..7393f58 --- /dev/null +++ b/node_modules/algebrite/tests/expand.coffee @@ -0,0 +1,92 @@ +test_expand = -> + run_test [ + + # general cases + + "expand(1/(x+1)/(x+2))", + "1/(x+1)-1/(x+2)", + + "expand((2x^3-x+2)/(x^2-2x+1))", + "4+2*x+5/(x-1)+3/(x^2-2*x+1)", + + "expand(1/x^2/(x-1))", + "-1/(x^2)-1/x+1/(x-1)", + + "p=5s+2", + "", + + "q=(s+1)*(s+2)^2", + "", + + "expand(p/q)", + "-3/(s+1)+3/(s+2)+8/(s^2+4*s+4)", + + # ensure denominators are expanded (result seems preferable that way) + + "q=(x-1)*(x-2)^3", + "", + + "expand(1/q)", + "1/(x^3-6*x^2+12*x-8)+1/(x-2)-1/(x-1)-1/(x^2-4*x+4)", + + # fractional poles + + "expand(1/(x+1/2)/(x+1/3))", + "-12/(2*x+1)+18/(3*x+1)", + + # expand tensor + + "f=1/(x+1)/(x+2)", + "", + + "g=1/(x+1)-1/(x+2)", + "", + + "expand([[f,f],[f,f]])-[[g,g],[g,g]]", + "[[0,0],[0,0]]", + + # denominator normalized? + + "expand(1/(1+1/x))", + "1-1/(x+1)", + + # poles at zero + + "expand(1/x/(x+1))", + "1/x-1/(x+1)", + + "expand(1/x^2/(x+1))", + #"x^(-2)-1/x+1/(x+1)", + "1/x^2-1/x+1/(x+1)", + + # other corner cases + + "expand(1/x)", + "1/x", + + "expand(1/x^2)", + #"x^(-2)", + "1/x^2", + + "expand(1/(x^2-4x+4))", + "1/(x^2-4*x+4)", + + # cases where nothing can be done + + "expand(sin(x))", + "sin(x)", + + "expand(x)", + "x", + + "expand(1/sin(x))", + # unclear why the extra parens are added but no biggie + "1/(sin(x))", + + # note that expand isn't needed to execute the + # multiplications, expand does something + # different. + "expand(expand((sin(x)+1)^2))", + "1+sin(x)^2+2*sin(x)", + + ] diff --git a/node_modules/algebrite/tests/expcos.coffee b/node_modules/algebrite/tests/expcos.coffee new file mode 100644 index 0000000..794313a --- /dev/null +++ b/node_modules/algebrite/tests/expcos.coffee @@ -0,0 +1,6 @@ +test_expcos = -> + run_test [ + + "expcos(x)", + "1/2*exp(-i*x)+1/2*exp(i*x)", + ] diff --git a/node_modules/algebrite/tests/expsin.coffee b/node_modules/algebrite/tests/expsin.coffee new file mode 100644 index 0000000..ae43033 --- /dev/null +++ b/node_modules/algebrite/tests/expsin.coffee @@ -0,0 +1,6 @@ +test_expsin = -> + run_test [ + + "expsin(x)", + "1/2*i*exp(-i*x)-1/2*i*exp(i*x)", + ] diff --git a/node_modules/algebrite/tests/factor.coffee b/node_modules/algebrite/tests/factor.coffee new file mode 100644 index 0000000..5592e01 --- /dev/null +++ b/node_modules/algebrite/tests/factor.coffee @@ -0,0 +1,137 @@ +test_factor_number = -> + run_test [ + + "factor(0)", + "0", + + "factor(1)", + "1", + + "factor(2)", + "2", + + "factor(3)", + "3", + + "factor(4)", + "2^2", + + "factor(5)", + "5", + + "factor(6)", + "2*3", + + "factor(7)", + "7", + + "factor(8)", + "2^3", + + "factor(9)", + "3^2", + + "factor(10)", + "2*5", + + "factor(100!)", + "2^97*3^48*5^24*7^16*11^9*13^7*17^5*19^5*23^4*29^3*31^3*37^2*41^2*43^2*47^2*53*59*61*67*71*73*79*83*89*97", + + "factor(2*(2^30-35))", + "2*1073741789", + + # x is the 10,000th prime + + # Prime factors greater than x^2 are found using the Pollard rho method + + "a=104729", + "", + + "factor(2*(a^2+6))", + "2*10968163447", + + "factor((a^2+6)^2)", + "10968163447*10968163447", # FIXME should be 10968163447^2 + + "factor((a^2+6)*(a^2+60))", + "10968163501*10968163447", # FIXME sort order + + "f=(x+1)*(x+2)*(y+3)*(y+4)", + "", + + "factor(f,x,y)", + "(x+1)*(x+2)*(y+3)*(y+4)", + + "factor(f,y,x)", + "(x+1)*(x+2)*(y+3)*(y+4)", + + "f=(x+1)*(x+1)*(y+2)*(y+2)", + "", + + "factor(f,x,y)", + "(x+1)^2*(y+2)^2", + + "factor(f,y,x)", + "(x+1)^2*(y+2)^2", + + "factor((x+1)*(-x^2+x+1),x)", + "-(x^2-x-1)*(x+1)", + + "factor((x+1)*(x^2-x-1),x)", + "(x^2-x-1)*(x+1)", + + "factor(5*x^3-5)", + "5*(x-1)*(x^2+x+1)", + + "factor((x+1)*(2x+4))", + "2*(x+1)*(x+2)", + + "factor(x^8 - 1)", + "(x-1)*(x+1)*(x^2+1)*(x^4+1)", + + "factor((x-1)*(x+1)*(x^2+1)*(2*x^4+2))", + "2*(x-1)*(x+1)*(x^2+1)*(x^4+1)", + + "factor((x-1)*(x+1)*(2*x^2+2)*(x^4+1))", + "2*(x-1)*(x+1)*(x^2+1)*(x^4+1)", + + "factor(x^1 - 1)", + "x-1", + + "factor(x^2 - 1)", + "(x-1)*(x+1)", + + "factor(x^3 - 1)", + "(x-1)*(x^2+x+1)", + + "factor(x^4 - 1)", + "(x-1)*(x+1)*(x^2+1)", + + "factor(x^5 - 1)", + "(x-1)*(x^4+x^3+x^2+x+1)", + + "factor(x^6 - 1)", + "(x-1)*(x+1)*(x^2+x+1)*(x^2+1)", + + "factor(x^7 - 1)", + "(x-1)*(x^6+x^5+x^4+x^3+x^2+x+1)", + + # irreducible in Z + "factor(1+x+x^2+x^3+x^4)", + "x^4+x^3+x^2+x+1", + + "factor(x^4 - 1*x^3 + 4*x^2 + 3*x + 5)", + "(x^2+x+1)*(x^2-2*x+5)", + + # https://github.com/davidedc/Algebrite/issues/113 + "factor((x^3+x^2+x)*(y^3+y^2),x,y)", + "x*y^2*(x^2+x+1)*(y+1)", + + # clean up + "a = quote(a)", + "", + + "f = quote(f)", + "", + + ] diff --git a/node_modules/algebrite/tests/factorpoly.coffee b/node_modules/algebrite/tests/factorpoly.coffee new file mode 100644 index 0000000..c475c32 --- /dev/null +++ b/node_modules/algebrite/tests/factorpoly.coffee @@ -0,0 +1,366 @@ +test_factorpoly = -> + run_test [ + + "bake=0", + "", + + "factor((x+1)*(x+2)*(x+3),x)", + "(1+x)*(2+x)*(3+x)", + + "factor((x+a)*(x^2+x+1),x)", + "(1+x+x^2)*(a+x)", + + "factor(x*(x+1)*(x+2),x)", + "x*(1+x)*(2+x)", + + "factor((x+1)*(x+2)*(y+3)*(y+4))", + "(1+x)*(2+x)*(12+7*y+y^2)", + + "factor((x+1)*(x+2)*(y+3)*(y+4),x,y)", + "(1+x)*(2+x)*(3+y)*(4+y)", + + "factor((-2*x+3)*(x+4),x)", + "-(-3+2*x)*(4+x)", + + "(-2*x+3)*(x+4)+(-3+2*x)*(4+x)", + "0", + + # make sure sign of remaining poly is factored + + "factor((x+1)*(-x^2+x+1),x)", + "-(-1-x+x^2)*(1+x)", + + # sign handling + + #++++++ + + "factor((x+1/2)*(+x+1/3)*(+x+1/4),x)", + "1/24*(1+2*x)*(1+3*x)*(1+4*x)", + + "(x+1/2)*(+x+1/3)*(+x+1/4)-1/24*(1+2*x)*(1+3*x)*(1+4*x)", + "0", + + #+++++- + + "factor((x+1/2)*(+x+1/3)*(+x-1/4),x)", + "1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + + "(x+1/2)*(+x+1/3)*(+x-1/4)-1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + "0", + + #++++-+ + + "factor((x+1/2)*(+x+1/3)*(-x+1/4),x)", + "-1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + + "(x+1/2)*(+x+1/3)*(-x+1/4)+1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + "0", + + #++++-- + + "factor((x+1/2)*(+x+1/3)*(-x-1/4),x)", + "-1/24*(1+2*x)*(1+3*x)*(1+4*x)", + + "(x+1/2)*(+x+1/3)*(-x-1/4)+1/24*(1+2*x)*(1+3*x)*(1+4*x)", + "0", + + #+++-++ + + "factor((x+1/2)*(+x-1/3)*(+x+1/4),x)", + "1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + + "(x+1/2)*(+x-1/3)*(+x+1/4)-1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + "0", + + #+++-+- + + "factor((x+1/2)*(+x-1/3)*(+x-1/4),x)", + "1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + + "(x+1/2)*(+x-1/3)*(+x-1/4)-1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + "0", + + #+++--+ + + "factor((x+1/2)*(+x-1/3)*(-x+1/4),x)", + "-1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + + "(x+1/2)*(+x-1/3)*(-x+1/4)+1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + "0", + + #+++--- + + "factor((x+1/2)*(+x-1/3)*(-x-1/4),x)", + "-1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + + "(x+1/2)*(+x-1/3)*(-x-1/4)+1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + "0", + + #++-+++ + + "factor((x+1/2)*(-x+1/3)*(+x+1/4),x)", + "-1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + + "(x+1/2)*(-x+1/3)*(+x+1/4)+1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + "0", + + #++-++- + + "factor((x+1/2)*(-x+1/3)*(+x-1/4),x)", + "-1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + + "(x+1/2)*(-x+1/3)*(+x-1/4)+1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + "0", + + #++-+-+ + + "factor((x+1/2)*(-x+1/3)*(-x+1/4),x)", + "1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + + "(x+1/2)*(-x+1/3)*(-x+1/4)-1/24*(-1+3*x)*(-1+4*x)*(1+2*x)", + "0", + + #++-+-- + + "factor((x+1/2)*(-x+1/3)*(-x-1/4),x)", + "1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + + "(x+1/2)*(-x+1/3)*(-x-1/4)-1/24*(-1+3*x)*(1+2*x)*(1+4*x)", + "0", + + #++--++ + + "factor((x+1/2)*(-x-1/3)*(+x+1/4),x)", + "-1/24*(1+2*x)*(1+3*x)*(1+4*x)", + + "(x+1/2)*(-x-1/3)*(+x+1/4)+1/24*(1+2*x)*(1+3*x)*(1+4*x)", + "0", + + #++--+- + + "factor((x+1/2)*(-x-1/3)*(+x-1/4),x)", + "-1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + + "(x+1/2)*(-x-1/3)*(+x-1/4)+1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + "0", + + #++---+ + + "factor((x+1/2)*(-x-1/3)*(-x+1/4),x)", + "1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + + "(x+1/2)*(-x-1/3)*(-x+1/4)-1/24*(-1+4*x)*(1+2*x)*(1+3*x)", + "0", + + #++---- + + "factor((x+1/2)*(-x-1/3)*(-x-1/4),x)", + "1/24*(1+2*x)*(1+3*x)*(1+4*x)", + + "(x+1/2)*(-x-1/3)*(-x-1/4)-1/24*(1+2*x)*(1+3*x)*(1+4*x)", + "0", + + #++++++ + + "factor((+x+a)*(+x+b)*(+x+c),x)", + "(a+x)*(b+x)*(c+x)", + + "(a+x)*(b+x)*(c+x)-(a+x)*(b+x)*(c+x)", + "0", + + #+++++- + + "factor((+x+a)*(+x+b)*(+x-c),x)", + "(a+x)*(b+x)*(-c+x)", + + "(+x+a)*(+x+b)*(+x-c)-(a+x)*(b+x)*(-c+x)", + "0", + + #++++-+ + + "factor((+x+a)*(+x+b)*(-x+c),x)", + "-(a+x)*(b+x)*(-c+x)", + + "(+x+a)*(+x+b)*(-x+c)+(a+x)*(b+x)*(-c+x)", + "0", + + #++++-- + + "factor((+x+a)*(+x+b)*(-x-c),x)", + "-(a+x)*(b+x)*(c+x)", + + "(+x+a)*(+x+b)*(-x-c)+(a+x)*(b+x)*(c+x)", + "0", + + #++++ + + "factor((+a*x+b)*(+c*x+d),x)", + "(b+a*x)*(d+c*x)", + + "(+a*x+b)*(+c*x+d)-(b+a*x)*(d+c*x)", + "0", + + #+++- + + "factor((+a*x+b)*(+c*x-d),x)", + "(b+a*x)*(-d+c*x)", + + "(+a*x+b)*(+c*x-d)-(b+a*x)*(-d+c*x)", + "0", + + #++-+ + + "factor((+a*x+b)*(-c*x+d),x)", + "-(b+a*x)*(-d+c*x)", + + "(+a*x+b)*(-c*x+d)+(b+a*x)*(-d+c*x)", + "0", + + #++-- + + "factor((+a*x+b)*(-c*x-d),x)", + "-(b+a*x)*(d+c*x)", + + "(+a*x+b)*(-c*x-d)+(b+a*x)*(d+c*x)", + "0", + + #+-++ + + "factor((+a*x-b)*(+c*x+d),x)", + "(d+c*x)*(-b+a*x)", + + "(+a*x-b)*(+c*x+d)-(d+c*x)*(-b+a*x)", + "0", + + #+-+- + + "factor((+a*x-b)*(+c*x-d),x)", + "(-b+a*x)*(-d+c*x)", + + "(+a*x-b)*(+c*x-d)-(-b+a*x)*(-d+c*x)", + "0", + + #+--+ + + "factor((+a*x-b)*(-c*x+d),x)", + "-(-b+a*x)*(-d+c*x)", + + "(+a*x-b)*(-c*x+d)+(-b+a*x)*(-d+c*x)", + "0", + + #+--- + + "factor((+a*x-b)*(-c*x-d),x)", + "-(d+c*x)*(-b+a*x)", + + "(+a*x-b)*(-c*x-d)+(d+c*x)*(-b+a*x)", + "0", + + #-+++ + + "factor((-a*x+b)*(+c*x+d),x)", + "-(d+c*x)*(-b+a*x)", + + "(-a*x+b)*(+c*x+d)+(d+c*x)*(-b+a*x)", + "0", + + #-++- + + "factor((-a*x+b)*(+c*x-d),x)", + "-(-b+a*x)*(-d+c*x)", + + "(-a*x+b)*(+c*x-d)+(-b+a*x)*(-d+c*x)", + "0", + + #-+-+ + + "factor((-a*x+b)*(-c*x+d),x)", + "(-b+a*x)*(-d+c*x)", + + "(-a*x+b)*(-c*x+d)-(-b+a*x)*(-d+c*x)", + "0", + + #-+-- + + "factor((-a*x+b)*(-c*x-d),x)", + "(d+c*x)*(-b+a*x)", + + "(-a*x+b)*(-c*x-d)-(d+c*x)*(-b+a*x)", + "0", + + #--++ + + "factor((-a*x-b)*(+c*x+d),x)", + "-(b+a*x)*(d+c*x)", + + "(-a*x-b)*(+c*x+d)+(b+a*x)*(d+c*x)", + "0", + + #--+- + + "factor((-a*x-b)*(+c*x-d),x)", + "-(b+a*x)*(-d+c*x)", + + "(-a*x-b)*(+c*x-d)+(b+a*x)*(-d+c*x)", + "0", + + #---+ + + "factor((-a*x-b)*(-c*x+d),x)", + "(b+a*x)*(-d+c*x)", + + "(-a*x-b)*(-c*x+d)-(b+a*x)*(-d+c*x)", + "0", + + #---- + + "factor((-a*x-b)*(-c*x-d),x)", + "(b+a*x)*(d+c*x)", + + "(-a*x-b)*(-c*x-d)-(b+a*x)*(d+c*x)", + "0", + + # this used to cause divide by zero + + # fixed by calling ispolyexpandedform before calling coeff + + # "factor(1/x+1)", + # "(1+x)/x", + + # see if poly gets rationalized + + # "(x+1)(x+2)(x+3)/x^3", + # "1+6/(x^3)+11/(x^2)+6/x", + + # "factor(last)", + # "(1+x)*(2+x)*(3+x)/(x^3)", + + # this used to fail + + "factor(x,x)", + "x", + + "factor(x^2,x)", + "x^2", + + "factor(x^3,x)", + "x^3", + + "bake=1", + "", + + "y=(x+1)*(x+2)", + "", + + "factor(y,z)", + "x^2+3*x+2", + + "factor(y,y)", + "x^2+3*x+2", + + "y=x^2+exp(x)", + "", + + "factor(y)", + "x^2+exp(x)", + ] diff --git a/node_modules/algebrite/tests/float.coffee b/node_modules/algebrite/tests/float.coffee new file mode 100644 index 0000000..41a7a11 --- /dev/null +++ b/node_modules/algebrite/tests/float.coffee @@ -0,0 +1,73 @@ +test_float = -> + run_test [ + + "1.0+0", + "1.0", + + "1+0.0", + "1.0", + + "1+0.0-0.0", + "1.0", + + "float(0)", + "0.0", + + "1-float(0)", + "1.0", + + "float(x)", + "x", + + "float(1/2)", + "0.5", + + "float(pi)", + "3.141593...", + + "float(exp(1))", + "2.718282...", + + "float(sin(2))", + "0.909297...", + + "float(cos(2))", + "-0.416147...", + + "x=[1/2,1/4]", + "", + + "float(x)", + "[0.5,0.25]", + + "x", + "[1/2,1/4]", + + "x=quote(x)", + "", + + "float((1+2*i)^(1/2))", + "1.272020...+0.786151...*i", + + "float((1+2*(-1)^(1/2))^(1/2))", + "1.272020...+0.786151...*i", + + "float((-1)^(-0.666667+0.0291367/pi))", + "-0.474559...-0.880224...*i", + + "abs(float((-1)^(-0.666667+0.0291367/pi)))", + "1.0", + + # using float with an array + "a = [2,3,4]", + "", + + "float(a[1])", + "2.0", + + "a=quote(a)", + "", + + + ] + diff --git a/node_modules/algebrite/tests/floor.coffee b/node_modules/algebrite/tests/floor.coffee new file mode 100644 index 0000000..bcfe769 --- /dev/null +++ b/node_modules/algebrite/tests/floor.coffee @@ -0,0 +1,74 @@ +test_floor = -> + run_test [ + "floor(a)", + "floor(a)", + + "floor(a+b)", + "floor(a+b)", + + "floor(5/2)", + "2", + + "floor(4/2)", + "2", + + "floor(3/2)", + "1", + + "floor(2/2)", + "1", + + "floor(1/2)", + "0", + + "floor(0/2)", + "0", + + "floor(-1/2)", + "-1", + + "floor(-2/2)", + "-1", + + "floor(-3/2)", + "-2", + + "floor(-4/2)", + "-2", + + "floor(-5/2)", + "-3", + + "floor(5/2.0)", + "2.0", + + "floor(4/2.0)", + "2.0", + + "floor(3/2.0)", + "1.0", + + "floor(2/2.0)", + "1.0", + + "floor(1/2.0)", + "0.0", + + "floor(0.0)", + "0.0", + + "floor(-1/2.0)", + "-1.0", + + "floor(-2/2.0)", + "-1.0", + + "floor(-3/2.0)", + "-2.0", + + "floor(-4/2.0)", + "-2.0", + + "floor(-5/2.0)", + "-3.0", + ] diff --git a/node_modules/algebrite/tests/for.coffee b/node_modules/algebrite/tests/for.coffee new file mode 100644 index 0000000..c8edb2a --- /dev/null +++ b/node_modules/algebrite/tests/for.coffee @@ -0,0 +1,10 @@ +test_for = -> + run_test [ + + "x=0\ny=2\nfor(do(x=sqrt(2+x),y=2*y/x), k,1,9)\nfloat(y)", + "3.141588...", + + "for(do(x=sqrt(2+x),y=2*y/x),k,1,iterations)", + "for(do(x=sqrt(2+x),y=2*y/x),k,1,iterations)", + + ] diff --git a/node_modules/algebrite/tests/gamma.coffee b/node_modules/algebrite/tests/gamma.coffee new file mode 100644 index 0000000..2236705 --- /dev/null +++ b/node_modules/algebrite/tests/gamma.coffee @@ -0,0 +1,21 @@ +test_gamma = -> + run_test [ + "Gamma(a)", + "Gamma(a)", + + # "float(gamma(10))", + # "362880", + + "Gamma(x+1)", + "x*Gamma(x)", + + "Gamma(1/2)", + "pi^(1/2)", + + "Gamma(x-1)-Gamma(x)/(-1+x)", + "0", + + "Gamma(-x)", + "-pi/(x*Gamma(x)*sin(pi*x))", + + ] diff --git a/node_modules/algebrite/tests/gcd.coffee b/node_modules/algebrite/tests/gcd.coffee new file mode 100644 index 0000000..9b6ab8b --- /dev/null +++ b/node_modules/algebrite/tests/gcd.coffee @@ -0,0 +1,115 @@ +test_gcd = -> + + gcdTests = [] + + GCD_TESTS_DONT_TEST_FACTOR = 1 + + addGcdTest = (arg1, arg2, result, dontTestFactor) -> + gcdTests.push "gcd(" + arg1 + "," + arg2 + ")" + gcdTests.push result + + gcdTests.push "gcd(" + arg2 + "," + arg1 + ")" + gcdTests.push result + + if !dontTestFactor? + gcdTests.push "gcd(factor(" + arg1 + ")," + arg2 + ")" + gcdTests.push result + + if !dontTestFactor? + gcdTests.push "gcd(factor(" + arg2 + ")," + arg1 + ")" + gcdTests.push result + + if !dontTestFactor? + gcdTests.push "gcd(" + arg1 + ",factor(" + arg2 + "))" + gcdTests.push result + + if !dontTestFactor? + gcdTests.push "gcd(" + arg2 + ",factor(" + arg1 + "))" + gcdTests.push result + + if !dontTestFactor? + gcdTests.push "gcd(factor(" + arg1 + "),factor(" + arg2 + "))" + gcdTests.push result + + if !dontTestFactor? + gcdTests.push "gcd(factor(" + arg2 + "),factor(" + arg1 + "))" + gcdTests.push result + + + addGcdTest "30","42","6" + addGcdTest "-30","42","6" + addGcdTest "30","-42","6" + addGcdTest "-30","-42","6", GCD_TESTS_DONT_TEST_FACTOR + + addGcdTest "x","x","x" + addGcdTest "-x","x","x" + addGcdTest "-x","-x","-x" + + addGcdTest "x^2","x^3","x^2" + addGcdTest "x","y","1" + addGcdTest "x*y","y","y" + addGcdTest "x*y","y^2","y" + addGcdTest "x^2*y^2","x^3*y^3","x^2*y^2" + addGcdTest "x^2","x^3","x^2" + + # gcd of expr + addGcdTest "x+y","x+z","1" + addGcdTest "x+y","x+y","x+y" + addGcdTest "x+y","2*x+2*y","x+y", GCD_TESTS_DONT_TEST_FACTOR + addGcdTest "-x-y","x+y","x+y", GCD_TESTS_DONT_TEST_FACTOR + addGcdTest "4*x+4*y","6*x+6*y","2*x+2*y", GCD_TESTS_DONT_TEST_FACTOR + addGcdTest "4*x+4*y+4","6*x+6*y+6","2+2*x+2*y", GCD_TESTS_DONT_TEST_FACTOR + # TODO this is not really correct, it should give 2 + # however this was failing before all the gcd changes + # of May 2019, so just leaving it in with a note + addGcdTest "4*x+4*y+4","6*x+6*y+12","1", GCD_TESTS_DONT_TEST_FACTOR + addGcdTest "27*t^3+y^3+9*t*y^2+27*t^2*y","t+y","1" + + # gcd expr factor + addGcdTest "2*a^2*x^2+a*x+a*b","a","a" + addGcdTest "2*a^2*x^2+a*x+a*b","a^2","a" + addGcdTest "2*a^2*x^2+2*a*x+2*a*b","a","a" + + # gcd expr term + addGcdTest "2*a^2*x^2+2*a*x+2*a*b","2*a","2*a" + addGcdTest "2*a^2*x^2+2*a*x+2*a*b","3*a","a" + addGcdTest "2*a^2*x^2+2*a*x+2*a*b","4*a","2*a" + + # gcd factor factor + addGcdTest "x","x^2","x" + addGcdTest "x","x^a","1" + + + # polynomials + addGcdTest "(x+1)*(x+1)","x+1","x+1" + addGcdTest "x*(x+1)","x","x" + addGcdTest "x^2+7x+6","x^2-5x-6","x+1", + addGcdTest "x*(x+1)^2","x+1","x+1" + addGcdTest "x*(x+1)","x+1","x+1" + addGcdTest "x^2+3x","x^2+5x","x" + addGcdTest "6x+20","2x+10","2" + addGcdTest "x^3-3x^2","4x^2-5x","x" + addGcdTest "x^2-9","x^2+5x+6","x+3" + addGcdTest "x^2-3x+2","x^2-1","x-1" + addGcdTest "x^2-2x-15","x^2+x-6","x+3" + addGcdTest "10x^3","2x^2-18x","2*x" + addGcdTest "6x^2","12x^4-9x^3","3*x^2" + addGcdTest "(3-x)*(x-1)","(x-3)*(x+1)","x-3" + addGcdTest "(x-2)*(x-5)","(2-x)*(x+5)","x-2" + addGcdTest "15-10x","8x^3-12x^2","2*x-3" + addGcdTest "3x","15x^2-6x","3*x" + addGcdTest "3x^3-15x^2+12x","3x-3","3*x-3" + addGcdTest "6x^2-12x","6x-3x^2","3*x^2-6*x" + addGcdTest "2x^2+13x+20","2x^2+17x+30","2*x+5" + addGcdTest "x^4+8x^2+7","3x^5-3x","x^2+1" + addGcdTest "x^2+8x*k+16*k^2","x^2-16k^2","x+4*k" + + + run_test gcdTests + + # multiple arguments + run_test [ + "gcd(12,18,9)", + "3", + ] + diff --git a/node_modules/algebrite/tests/hermite.coffee b/node_modules/algebrite/tests/hermite.coffee new file mode 100644 index 0000000..77021ae --- /dev/null +++ b/node_modules/algebrite/tests/hermite.coffee @@ -0,0 +1,41 @@ +test_hermite = -> + run_test [ + "hermite(x,n)", + "hermite(x,n)", + + "hermite(x,0)-1", + "0", + + "hermite(x,1)-2*x", + "0", + + "hermite(x,2)-(4*x^2-2)", + "0", + + "hermite(x,3)-(8*x^3-12*x)", + "0", + + "hermite(x,4)-(16*x^4-48*x^2+12)", + "0", + + "hermite(x,5)-(32*x^5-160*x^3+120*x)", + "0", + + "hermite(x,6)-(64*x^6-480*x^4+720*x^2-120)", + "0", + + "hermite(x,7)-(128*x^7-1344*x^5+3360*x^3-1680*x)", + "0", + + "hermite(x,8)-(256*x^8-3584*x^6+13440*x^4-13440*x^2+1680)", + "0", + + "hermite(x,9)-(512*x^9-9216*x^7+48384*x^5-80640*x^3+30240*x)", + "0", + + "hermite(x,10)-(1024*x^10-23040*x^8+161280*x^6-403200*x^4+302400*x^2-30240)", + "0", + + "hermite(a-b,10)-eval(subst(a-b,x,hermite(x,10)))", + "0", + ] diff --git a/node_modules/algebrite/tests/imag.coffee b/node_modules/algebrite/tests/imag.coffee new file mode 100644 index 0000000..4b0b487 --- /dev/null +++ b/node_modules/algebrite/tests/imag.coffee @@ -0,0 +1,18 @@ +test_imag = -> + run_test [ + + "imag(a+i*b)", + "b", + + "imag(1+exp(i*pi/3))", + "1/2*3^(1/2)", + + "imag(i)", + "1", + + "imag((-1)^(1/3))", + "1/2*3^(1/2)", + + "imag(-i)", + "-1", + ] diff --git a/node_modules/algebrite/tests/index.coffee b/node_modules/algebrite/tests/index.coffee new file mode 100644 index 0000000..89aee1d --- /dev/null +++ b/node_modules/algebrite/tests/index.coffee @@ -0,0 +1,79 @@ +test_index = -> + run_test [ + + "A=[[A11,A12],[A21,A22]]", + "", + + "A[1,1]", + "A11", + + "A[1,2]", + "A12", + + "A[2,1]", + "A21", + + "A[2,2]", + "A22", + + "A[1]", + "[A11,A12]", + + "A[1][2]", + "A12", + + "A[2]", + "[A21,A22]", + + "A[1]=[B11,B12]", + "", + + "A", + "[[B11,B12],[A21,A22]]", + + "A[2]=[B21,B22]", + "", + + "A", + "[[B11,B12],[B21,B22]]", + + "A=[[0,0],[0,0]]", + "", + + "A[1,1]", + "0", + + # index of scalar should throw an error + + "1[2]", + "Stop: trying to access a scalar as a tensor", + + # clean up ----------------- + + "clearall", + "", + + # index of a non-allocated tensor + # or index with a symbol instead of + # a number + + "a[0]", + "a[0]", + + "a[0,2]", + "a[0,2]", + + + "a[b]", + "a[b]", + + "a[b,c]", + "a[b,c]", + + "a = [1,2,3]", + "", + + "a[b]", + "a[b]", + + ] diff --git a/node_modules/algebrite/tests/inner.coffee b/node_modules/algebrite/tests/inner.coffee new file mode 100644 index 0000000..969f6e6 --- /dev/null +++ b/node_modules/algebrite/tests/inner.coffee @@ -0,0 +1,217 @@ +test_inner = -> + run_test [ + + # since we don't know anything about + # a and b, we have to leave this unevaluated + # turning this into a normal multiplication (which is + # commutative) would not be OK + "inner(a,b)", + "inner(a,b)", + + # this shouldn't ever go wrong + # but one never knows + "inner(b,a)", + "inner(b,a)", + + "inner(2,a)", + "2*a", + + "inner(a,2)", + "2*a", + + "inner(a,[b1,b2])", + "inner(a,[b1,b2])", + + "inner([a1,a2],b)", + "inner([a1,a2],b)", + + "inner(2,[b1,b2])", + "[2*b1,2*b2]", + + "inner([b1,b2],2)", + "[2*b1,2*b2]", + + "inner([[a11,a12],[a21,a22]],[x1,x2])", + "[a11*x1+a12*x2,a21*x1+a22*x2]", + + "inner([1,2],[3,4])", + "11", + + # non-invertible matrix + "inner([[2,2],[2,2]],[[0],[1]])", + "[[2],[2]]", + + "inner(inner([1,2],[[3,4],[5,6]]),[7,8])", + "219", + + "inner([1,2],inner([[3,4],[5,6]],[7,8]))", + "219", + + "inner([1,2],[[3,4],[5,6]],[7,8])", + "219", + + "inner(c,a1+b1)", + "inner(c,a1)+inner(c,b1)", + + "inner(b1+c1,a)", + "inner(b1,a)+inner(c1,a)", + + "inner(inner(a,b),c)", + "inner(a,inner(b,c))", + + "inner(inner(a,b),c) - inner(a,inner(b,c))", + "0", + + "inner(inner(a,b),c,d) - inner(a,b,inner(c,d))", + "0", + + # trying some associativity and distributivity together + "inner(inner(a,b),c,d+f) - ( (inner(a,inner(b,c),d)) + inner(inner(a,b),c,f) )", + "0", + + # bring it to a canonical form + # using associativity + "inner(a,b,c)", + "inner(a,inner(b,c))", + + "inner(a,b+c,d)", + "inner(a,inner(b,d))+inner(a,inner(c,d))", + + "inner(inner(a,b),inner(c,d))", + "inner(a,inner(b,inner(c,d)))", + + # scalar product of vectors: + "inner([a, b, c], [x, y, z])", + "a*x+b*y+c*z", + + # products of matrices and vectors: + "inner([[a, b], [c,d]], [x, y])", + "[a*x+b*y,c*x+d*y]", + + "inner([x, y], [[a, b], [c,d]])", + "[a*x+c*y,b*x+d*y]", + + "inner([x, y], [[a, b], [c,d]], [r, s])", + "a*r*x+b*s*x+c*r*y+d*s*y", + + # matrix product: + + "inner([[a,b],[c,d]],[[r,s],[t,u]])", + "[[a*r+b*t,a*s+b*u],[c*r+d*t,c*s+d*u]]", + + # --------------------------------------- + # using the dot + # --------------------------------------- + + "a·b", + "inner(a,b)", + + "a·b·c", + "inner(a,inner(b,c))", + + "a·b*c", + "c*inner(a,b)", + + # note how we use associativity to bring it all + # to a canonical form + "((a·b)·c)·d", + "inner(a,inner(b,inner(c,d)))", + + "a*b·c", + "a*inner(b,c)", + + "2*a·b", + "2*inner(a,b)", + + "inv(a)·a", + "I", + + "a·inv(a)", + "I", + + "b·a·inv(a)·c", + "inner(b,c)", + + "b·aᵀ·inv(aᵀ)·c", + "inner(b,c)", + + "b·inv(aᵀ)·aᵀ·c", + "inner(b,c)", + + "b·inv((a+b)ᵀ)·(b+a)ᵀ·c", + "inner(b,c)", + + "(-a)·(-b)", + "inner(a,b)", + + "I·I", + "I", + + "I·Iᵀ", + "I", + + "(-I)·(-I)", + "I", + + "(-Iᵀ)·(-I)", + "I", + + "c·(b+a)ᵀ·inv((a+b)ᵀ)·d", + "inner(c,d)", + + "c·inv((b+a)ᵀ)·(a+b)ᵀ·d", + "inner(c,d)", + + "c·(b+a)ᵀ·inv((a+b)ᵀ)·inv(c)", + "I", + + "c·inv((b+a)ᵀ)·(a+b)ᵀ·inv(c)", + "I", + + "inv(c)·(b+a)ᵀ·inv((a+b)ᵀ)·c", + "I", + + "inv(c)·inv((b+a)ᵀ)·(a+b)ᵀ·c", + "I", + + + "c·d·(b+a)ᵀ·inv((a+b)ᵀ)", + "inner(c,d)", + + "d·(b+a)ᵀ·inv((a+b)ᵀ)", + "d", + + "(b+a)ᵀ·inv((a+b)ᵀ)", + "I", + + "c·d·(b+a)ᵀ·inv((a+b)ᵀ)·inv(d)", + "c", + + "c·d·(b+a)ᵀ·inv((a+b)ᵀ)·inv(d)·inv(c)", + "I", + + "c·d·(b+a)ᵀ·inv((a+b)ᵀ)·inv(c·d)", + "I", + + "c·d·(a+b)ᵀ·inv(c·d·(b+a)ᵀ)", + "I", + + "inv(c)·c", + "I", + + "inv(c·a)·c·a", + "I", + + "inv(c·b·a)·c·b·a", + "I", + + "inv(c)·d·(a+b)ᵀ·inv(inv(c)·d·(b+a)ᵀ)", + "I", + + "inv(c+f)·d·(a+b)ᵀ·inv(inv(f+c)·d·(b+a)ᵀ)", + "I", + + "c·d·inv(a)·inv(c·d·inv(a))", + "I", + + ] diff --git a/node_modules/algebrite/tests/integral.coffee b/node_modules/algebrite/tests/integral.coffee new file mode 100644 index 0000000..d4b77de --- /dev/null +++ b/node_modules/algebrite/tests/integral.coffee @@ -0,0 +1,738 @@ +test_integral = -> + run_test [ + + "clearall", + "", + + "tty=1", + "", + + "integral(x^2+x)-(1/2*x^2+1/3*x^3)", + "0", + + #1 + "integral(A,X)", + "A*X", + + #4 + "integral(A+B,X)-(A*X+B*X)", + "0", + + #9 + "integral(1/X,X)", + "log(X)", + + #11 + "integral(exp(X),X)", + "exp(X)", + + #12 + "integral(exp(A*X),X)-exp(A*X)/A", + "0", + + #14 + "integral(log(X),X)-X*log(X)+X", + "0", + + #15 + "integral(3^X*log(3),X)", + "3^X", + + #16 + "integral(1/(3+x^2),x)-3^(-1/2)*arctan(3^(-1/2)*x)", + "0", + + #17 + "integral(1/(a-x^2),x)-a^(-1/2)*arctanh(a^(-1/2)*x)", + "0", + + #19 + "integral(1/sqrt(a-x^2),x)-arcsin(a^(-1/2)*x)", + "0", + + #20 + "integral(1/sqrt(a+x^2),x)-(log(x+(a+x^2)^(1/2)))", + "0", + + #27 + "integral(1/(a+b*x),x)-(log(a+b*x)/b)", + "0", + + #28 + "integral(1/(A+B*X)^2,X)+1/B*1/(A+B*X)", + "0", + + #29 + "integral(1/(a+b*x)^3,x)+1/2*1/b*(a+b*x)^(-2)", + "0", + + #30 + "integral(X/(A+B*X),X)+A*B^(-2)*log(A+B*X)-X/B", + "0", + + #31 + "integral(X/(A+B*X)^2,X)-1/B^2*(log(A+B*X)+A/(A+B*X))", + "0", + + #33 + "integral(X^2/(A+B*X),X)-1/B^2*(1/2*(A+B*X)^2-2*A*(A+B*X)+A^2*log(A+B*X))", + "0", + + #34 + "integral(X^2/(A+B*X)^2,X)-1/B^3*(A+B*X-2*A*log(A+B*X)-A^2/(A+B*X))", + "0", + + #35 + "integral(X^2/(A+B*X)^3,X)-1/B^3*(log(A+B*X)+2*A/(A+B*X)-1/2*A^2/(A+B*X)^2)", + "0", + + #37 + "integral(1/X*1/(A+B*X),X)+1/A*log((A+B*X)/X)", + "0", + + #38 + "integral(1/X*1/(A+B*X)^2,X)-1/A*1/(A+B*X)+1/A^2*log((A+B*X)/X)", + "0", + + #39 + "integral(1/X*1/(A+B*X)^3,X)-1/A^3*(1/2*((2*A+B*X)/(A+B*X))^2+log(X/(A+B*X)))", + "0", + + #40 + "integral(1/X^2*1/(A+B*X),X)+1/(A*X)-B/A^2*log((A+B*X)/X)", + "0", + + #41 + "integral(1/X^3*1/(A+B*X),X)-(2*B*X-A)/(2*A^2*X^2)-B^2/A^3*log(X/(A+B*X))", + "0", + + #42 + "integral(1/X^2*1/(A+B*X)^2,X)+(A+2*B*X)/(A^2*X*(A+B*X))-2*B/A^3*log((A+B*X)/X)", + "0", + + #60 + "integral(1/(2+3*X^2),X)-1/sqrt(6)*arctan(1/2*X*sqrt(6))", + "0", + "integral(1/(-2-3*X^2),X)-1/sqrt(6)*arctan(-1/2*X*sqrt(6))", + "0", + + #61 + "integral(1/(2-3*X^2),X)-1/2*1/sqrt(6)*log((2+X*sqrt(6))/(2-X*sqrt(6)))", + "0", + "integral(1/(-2+3*X^2),X)-1/2*1/sqrt(6)*log((-2+X*sqrt(6))/(-2-X*sqrt(6)))", + "0", + + #63 + "integral(X/(A+B*X^2),X)-1/2*1/B*log(A+B*X^2)", + "0", + + #64 + "integral(X^2/(A+B*X^2),X)-X/B+A/B*integral(1/(A+B*X^2),X)", + "0", + + #65 + "integral(1/(A+B*X^2)^2,X)-X/(2*A*(A+B*X^2))-1/2*1/A*integral(1/(A+B*X^2),X)", + "0", + + #70 + "integral(1/X*1/(A+B*X^2),X)-1/2*1/A*log(X^2/(A+B*X^2))", + "0", + + #71 + "integral(1/X^2*1/(A+B*X^2),X)+1/(A*X)+B/A*integral(1/(A+B*X^2),X)", + "0", + + #74 + "integral(1/(A+B*X^3),X)-1/3*1/A*(A/B)^(1/3)*(1/2*log(((A/B)^(1/3)+X)^3/(A+B*X^3))+sqrt(3)*arctan((2*X-(A/B)^(1/3))*(A/B)^(-1/3)/sqrt(3)))", + "0", + + #76 + "integral(X^2/(A+B*X^3),X)-1/3*1/B*log(A+B*X^3)", + "0", + + # commenting this out because the definite integral of this one + # between 0 and pi was incorrect AND the indefinite integral + # became incorrect after I avoided having roots in the denominator + # when doing multiplications. The two things combined made me + # think to eliminate this test. + #77 + #"integral(1/(2+3*X^4),X)-1/2*1/2*(2/3/4)^(1/4)*(1/2*log((X^2+2*(2/3/4)^(1/4)*X+2*(2/3/4)^(1/2))/(X^2-2*(2/3/4)^(1/4)*X+2*(2/3/4)^(1/2)))+arctan(2*(2/3/4)^(1/4)*X/(2*(2/3/4)^(1/2)-X^2)))", + #"0", + + # commenting this out because the definite integral of this one + # between 0 and pi was incorrect AND the indefinite integral + # became incorrect after I avoided having roots in the denominator + # when doing multiplications. The two things combined made me + # think to eliminate this test. + #78 + #"integral(1/(2-3*X^4),X)-1/2*(2/3)^(1/4)/2*(1/2*log((X+(2/3)^(1/4))/(X-(2/3)^(1/4)))+arctan(X*(2/3)^(-1/4)))", + #"0", + + #79 + "integral(X/(2+3*X^4),X)-1/2*1/3*1/sqrt(2/3)*arctan(X^2/sqrt(2/3))", + "0", + + #80 + "integral(X/(2-3*X^4),X)+1/4*1/3*sqrt(3/2)*log((X^2-sqrt(2/3))/(X^2+sqrt(2/3)))", + "0", + + # commenting this out because the definite integral of this one + # between 0 and pi was incorrect AND the indefinite integral + # became incorrect after I avoided having roots in the denominator + # when doing multiplications. The two things combined made me + # think to eliminate this test. + #81 + #"integral(X^2/(2+3*X^4),X)-1/4*1/3*(2/3/4)^(-1/4)*(1/2*log((X^2-2*(2/3/4)^(1/4)*X+2*sqrt(2/3/4))/(X^2+2*(2/3/4)^(1/4)*X+2*sqrt(2/3/4)))+arctan(2*(2/3/4)^(1/4)*X/(2*sqrt(2/3/4)-X^2)))", + #"0", + + # commenting this out because the definite integral of this one + # between 0 and pi was incorrect AND the indefinite integral + # became incorrect after I avoided having roots in the denominator + # when doing multiplications. The two things combined made me + # think to eliminate this test. + #82 + #"integral(X^2/(2-3*X^4),X)+1/4*1/3*(2/3)^(-1/4)*(log((X-(2/3)^(1/4))/(X+(2/3)^(1/4)))+2*arctan(X*(2/3)^(-1/4)))", + #"0", + + #83 + "integral(X^3/(A+B*X^4),X)-1/4*1/B*log(A+B*X^4)", + "0", + + #124 + "integral(sqrt(A+B*X),X)-2/3/B*sqrt((A+B*X)^3)", + "0", + + #125 + "integral(X*sqrt(A+B*X),X)+2*(2*A-3*B*X)*sqrt((A+B*X)^3)/15*B^(-2)", + "0", + + #126 + "integral(X^2*sqrt(A+B*X),X)-2*(8*A^2-12*A*B*X+15*B^2*X^2)*sqrt((A+B*X)^3)/105*B^(-3)", + "0", + + #128 + "integral(sqrt(A+B*X)/X,X)-2*sqrt(A+B*X)-A*integral(1/X*1/sqrt(A+B*X),X)", + "0", + + #129 + "integral(sqrt(A+B*X)/X^2,X)+sqrt(A+B*X)/X-B/2*integral(1/X*1/sqrt(A+B*X),X)", + "0", + + #131 + "integral(1/sqrt(A+B*X),X)-2*sqrt(A+B*X)/B", + "0", + + #132 + "integral(X/sqrt(A+B*X),X)+2/3*(2*A-B*X)*sqrt(A+B*X)/B^2", + "0", + + #133 + "integral(X^2/sqrt(A+B*X),X)-2/15*(8*A^2-4*A*B*X+3*B^2*X^2)*sqrt(A+B*X)/B^3", + "0", + + #134 + "integral(1/X*1/sqrt(2+B*X),X)-1/sqrt(2)*log((sqrt(2+B*X)-sqrt(2))/(sqrt(2+B*X)+sqrt(2)))", + "0", + + #136 + "integral(1/X*1/sqrt(-2+B*X),X)-2/sqrt(2)*arctan(sqrt((-2+B*X)/2))", + "0", + + #137 + "integral(1/X^2*1/sqrt(A+B*X),X)+sqrt(A+B*X)/A/X+1/2*B/A*integral(1/X*1/sqrt(A+B*X),X)", + "0", + + #156 + "integral(sqrt(X^2+A),X)-1/2*(X*sqrt(X^2+A)+A*log(X+sqrt(X^2+A)))", + "0", + + #157 + "integral(1/sqrt(X^2+A),X)-log(X+sqrt(X^2+A))", + "0", + + #158 + "integral(1/X*1/sqrt(X^2-2),X)-arcsec(X/sqrt(2))/sqrt(2)", + "0", + + #159 + "integral(1/X*1/sqrt(X^2+2),X)+1/sqrt(2)*log((sqrt(2)+sqrt(X^2+2))/X)", + "0", + + #160 + "integral(sqrt(X^2+2)/X,X)-sqrt(X^2+2)+sqrt(2)*log((sqrt(2)+sqrt(X^2+2))/X)", + "0", + + #161 + "integral(sqrt(X^2-2)/X,X)-sqrt(X^2-2)+sqrt(2)*arcsec(X/sqrt(2))", + "0", + + #162 + "integral(X/sqrt(X^2+A),X)-sqrt(X^2+A)", + "0", + + #163 + "integral(X*sqrt(X^2+A),X)-1/3*sqrt((X^2+A)^3)", + "0", + + #164 fails after Jan 2017 changes to abs/mag + #"integral(sqrt((X^2+A)^3),X)-1/4*(X*sqrt((X^2+A)^3)+3/2*A*X*sqrt(X^2+A)+3/2*A^2*log(X+sqrt(X^2+A)))", + #"0", + + #"integral(sqrt((X^2-A)^3),X)-1/4*(X*sqrt((X^2-A)^3)-3/2*A*X*sqrt(X^2-A)+3/2*A^2*log(X+sqrt(X^2-A)))", + #"0", + + #165 fails after Jan 2017 changes to abs/mag + #"integral(1/sqrt((X^2+A)^3),X)-X/A/sqrt(X^2+A)", + #"0", + + #166 fails after Jan 2017 changes to abs/mag + #"integral(X/sqrt((X^2+A)^3),X)+1/sqrt(X^2+A)", + #"0", + + #167 fails after Jan 2017 changes to abs/mag + #"integral(X*sqrt((X^2+A)^3),X)-1/5*sqrt((X^2+A)^5)", + #"0", + + #168 + "integral(X^2*sqrt(X^2+A),X)-1/4*X*sqrt((X^2+A)^3)+1/8*A*X*sqrt(X^2+A)+1/8*A^2*log(X+sqrt(X^2+A))", + "0", + + #169 + "integral(X^3*sqrt(X^2+7),X)-(1/5*X^2-2/15*7)*sqrt((X^2+7)^3)", + "0", + + #170 + "integral(X^3*sqrt(X^2-7),X)-(sqrt((X^2-7)^5)/5+7*sqrt((X^2-7)^3)/3)", + "0", + + #171 + "integral(X^2/sqrt(X^2+A),X)-1/2*X*sqrt(X^2+A)+1/2*A*log(X+sqrt(X^2+A))", + "0", + + #172 + "integral(X^3/sqrt(X^2+A),X)-1/3*sqrt((X^2+A)^3)+A*sqrt(X^2+A)", + "0", + + #173 + "integral(1/X^2*1/sqrt(X^2+A),X)+sqrt(X^2+A)/A/X", + "0", + + #174 + "integral(1/X^3*1/sqrt(X^2+2),X)+1/2*sqrt(X^2+2)/2/X^2-1/2*log((sqrt(2)+sqrt(X^2+2))/X)/(sqrt(2)^3)", + "0", + + #175 + "integral(1/X^3*1/sqrt(X^2-2),X)-1/2*sqrt(X^2-2)/2/X^2-1/2*1/(2^(3/2))*arcsec(X/(2^(1/2)))", + "0", + + #176+ + "integral(X^2*sqrt((X^2+2^2)^3),X)\ + -1/6*X*sqrt((X^2+2^2)^5)\ + +1/24*(2^2)*X*sqrt((X^2+2^2)^3)\ + +1/16*(2^4)X*sqrt(X^2+2^2)\ + +1/16*(2^6)*log(X+sqrt(X^2+2^2))", + "0", + + #176- + "integral(X^2*sqrt((X^2-2^2)^3),X)\ + -1/6*X*sqrt((X^2-2^2)^5)\ + -1/24*(2^2)*X*sqrt((X^2-2^2)^3)\ + +1/16*(2^4)X*sqrt(X^2-2^2)\ + -1/16*(2^6)*log(X+sqrt(X^2-2^2))", + "0", + + #177+ + "integral(X^3*sqrt((X^2+7^2)^3),X)\ + -1/7*sqrt((X^2+7^2)^7)\ + +1/5*(7^2)*sqrt((X^2+7^2)^5)", + "0", + + #177- + "integral(X^3*sqrt((X^2-7^2)^3),X)\ + -1/7*sqrt((X^2-7^2)^7)\ + -1/5*(7^2)*sqrt((X^2-7^2)^5)", + "0", + + #196 + "simplify(integral(1/(X-A)/sqrt(X^2-A^2),X)+sqrt(X^2-A^2)/A/(X-A))", + "0", + "simplify(1/(X-A)/sqrt(X^2-A^2)-d(integral(1/(X-A)/sqrt(X^2-A^2),X),X))", + "0", + + #197 + "integral(1/(X+A)/sqrt(X^2-A^2),X)-sqrt(X^2-A^2)/A/(X+A)", + "0", + "simplify(1/(X+A)/sqrt(X^2-A^2)-d(integral(1/(X+A)/sqrt(X^2-A^2),X),X))", + "0", + + #200 + "integral(sqrt(7-X^2),X)-1/2*(X*sqrt(7-X^2)+7*arcsin(X/sqrt(7)))", + "0", + + #201 + "integral(1/sqrt(7-X^2),X)-arcsin(X/sqrt(7))", + "0", + + #202 + "integral(1/X*1/sqrt(7-X^2),X)+1/sqrt(7)*log((sqrt(7)+sqrt(7-X^2))/X)", + "0", + + #203 + "integral(sqrt(7-X^2)/X,X)\ + -sqrt(7-X^2)+sqrt(7)*log((sqrt(7)+sqrt(7-X^2))/X)", + "0", + + #204 + "integral(X/sqrt(A-X^2),X)\ + +sqrt(A-X^2)", + "0", + + #205 + "integral(X*sqrt(A-X^2),X)\ + +1/3*sqrt((A-X^2)^3)", + "0", + + #210 + "integral(X^2*sqrt(7-X^2),X)\ + +1/4*X*sqrt((7-X^2)^3)\ + -7/8*(X*sqrt(7-X^2)+7*arcsin(X/sqrt(7)))", + "0", + + #211 + "integral(X^3*sqrt(7-X^2),X)\ + -(-1/5*X^2-2/15*7)*sqrt((7-X^2)^3)", + "0", + + #214 + "integral(X^2/sqrt(7-X^2),X)\ + +X/2*sqrt(7-X^2)\ + -7/2*arcsin(X/sqrt(7))", + "0", + + #215 + "integral(1/X^2*1/sqrt(7-X^2),X)\ + +sqrt(7-X^2)/7/X", + "0", + + #216 + "integral(sqrt(7-X^2)/X^2,X)\ + +sqrt(7-X^2)/X\ + +arcsin(X/sqrt(7))", + "0", + + #217 + "integral(sqrt(7-X^2)/X^3,X)\ + +1/2*sqrt(7-X^2)/X^2\ + -1/2*log((sqrt(7)+sqrt(7-X^2))/X)/sqrt(7)", + "0", + + #218 + "integral(sqrt(7-X^2)/X^4,X)\ + +1/3*sqrt((7-X^2)^3)/7/X^3", + "0", + + #273 + "integral(sqrt(7*X^2+C),X)-X*sqrt(7*X^2+C)/2-C*log(X*sqrt(7)+sqrt(7*X^2+C))/2/sqrt(7)", + "0", + + #274 + "integral(sqrt(-7*X^2+C),X)-X*sqrt(-7*X^2+C)/2-C*arcsin(X*sqrt(7/C))/2/sqrt(7)", + "0", + + #290 + "integral(sin(A*X),X)+cos(A*X)/A", + "0", + + #291 + "integral(cos(A*X),X)-sin(A*X)/A", + "0", + + #292 + "integral(tan(A*X),X)+log(cos(A*X))/A", + "0", + + #293 + "integral(1/tan(A*X),X)-log(sin(A*X))/A", + "0", + + #294 + "integral(1/cos(A*X),X)-log(tan(pi/4+A*X/2))/A", + "0", + + #295 + "integral(1/sin(A*X),X)-log(tan(A*X/2))/A", + "0", + + #296 + "integral(sin(A*X)^2,X)-X/2+sin(2*A*X)/(4*A)", + "0", + + #297 + "integral(sin(A*X)^3,X)+cos(A*X)*(sin(A*X)^2+2)/(3*A)", + "0", + + #298 + "integral(sin(A*X)^4,X)-3/8*X+sin(2*A*X)/(4*A)-sin(4*A*X)/(32*A)", + "0", + + #302 + "integral(cos(A*X)^2,X)-X/2-sin(2*A*X)/(4*A)", + "0", + + #303 + "integral(cos(A*X)^3,X)-sin(A*X)*(cos(A*X)^2+2)/(3*A)", + "0", + + #304 + "integral(cos(A*X)^4,X)-3/8*X-sin(2*A*X)/(4*A)-sin(4*A*X)/(32*A)", + "0", + + #308 + "integral((1/sin(A*X))^2,X)+1/A*1/tan(A*X)", + "0", + + #312 + "integral((1/cos(A*X))^2,X)-tan(A*X)/A", + "0", + + #318 + "integral(sin(A*X)*cos(A*X),X)-sin(A*X)^2/(2*A)", + "0", + + #320 + "integral(sin(A*X)^2*cos(A*X)^2,X)+sin(4*A*X)/(32*A)-X/8", + "0", + + #326 + "integral(sin(A*X)/cos(A*X)/cos(A*X),X)-1/(A*cos(A*X))", + "0", + + #327 + "integral(sin(A*X)^2/cos(A*X),X)+sin(A*X)/A-log(tan(pi/4+A*X/2))/A", + "0", + + #328 + "integral(cos(A*X)/sin(A*X)^2,X)+1/(A*sin(A*X))", + "0", + + #329 + "integral(1/sin(A*X)/cos(A*X),X)-log(tan(A*X))/A", + "0", + + #330 + "integral(1/sin(A*X)/cos(A*X)^2,X)-(1/cos(A*X)+log(tan(A*X/2)))/A", + "0", + + #332 + "integral(1/sin(A*X)^2/cos(A*X),X)-(log(tan(pi/4+A*X/2))-1/sin(A*X))/A", + "0", + + #333 + "integral(1/sin(A*X)^2/cos(A*X)^2,X)+2/(A*tan(2*A*X))", + "0", + + #335 + "integral(sin(A+B*X),X)+cos(A+B*X)/B", + "0", + + #336 + "integral(cos(A+B*X),X)-sin(A+B*X)/B", + "0", + + #337+ + "integral(1/(1+sin(A*X)),X)+tan(pi/4-A*X/2)/A", + "0", + + #337b+ + "integral(1/(B+B*sin(A*X)),X)+tan(pi/4-A*X/2)/A/B", + "0", + + #337- + "integral(1/(1-sin(A*X)),X)-tan(pi/4+A*X/2)/A", + "0", + + #337b- + "integral(1/(B-B*sin(A*X)),X)-tan(pi/4+A*X/2)/A/B", + "0", + + #338 + "integral(1/(1+cos(A*X)),X)-tan(A*X/2)/A", + "0", + + #339 + "integral(1/(1-cos(A*X)),X)+1/(A*tan(A*X/2))", + "0", + + #340 + "integral(1/(A+B*sin(X)),X)-1/sqrt(B^2-A^2)*log((A*tan(X/2)+B-sqrt(B^2-A^2))/(A*tan(X/2)+B+sqrt(B^2-A^2)))", + "0", + + #341 + "integral(1/(A+B*cos(X)),X)-1/sqrt(B^2-A^2)*log((sqrt(B^2-A^2)*tan(X/2)+A+B)/(sqrt(B^2-A^2)*tan(X/2)-A-B))", + "0", + + #389 + "x*sin(A*x)-d(integral(x*sin(A*x)))", + "0", + + #390 + "x^2*sin(A*x)-d(integral(x^2*sin(A*x)))", + "0", + + #393 + "x*cos(A*x)-d(integral(x*cos(A*x)))", + "0", + + #394 + "x^2*cos(A*x)-d(integral(x^2*cos(A*x)))", + "0", + + #441 + "integral(arcsin(A*X),X)-X*arcsin(A*X)-sqrt(1-A^2*X^2)/A", + "0", + + #442 + "integral(arccos(A*X),X)-X*arccos(A*X)+sqrt(1-A^2*X^2)/A", + "0", + + #443 + "integral(arctan(A*X),X)-X*arctan(A*X)+log(1+A^2*X^2)/(2*A)", + "0", + + #485 + "integral(log(X),X)-X*log(X)+X", + "0", + + #485a + "integral(log(A*X),X)-X*log(A*X)+X", + "0", + + #486 + "integral(X*log(X),X)-1/2*X^2*log(X)+1/4*X^2", + "0", + + #486a + "integral(X*log(A*X),X)-1/2*X^2*log(A*X)+1/4*X^2", + "0", + + #487 + "integral(X^2*log(A*X),X)-1/3*X^3*log(A*X)+X^3/9", + "0", + + #489 + "integral(log(X)^2,X)-X*log(X)^2+2*X*log(X)-2*X", + "0", + + #493 + "integral(1/X*1/log(A*X),X)-log(log(A*X))", + "0", + + #499 + "integral(log(A*X+B),X)-(A*X+B)*log(A*X+B)/A+X", + "0", + + #500 + "integral(log(A*X+B)/X^2,X)-A*log(X)/B+(A*X+B)*log(A*X+B)/B/X", + "0", + + #554 + "integral(sinh(X),X)-cosh(X)", + "0", + + #555 + "integral(cosh(X),X)-sinh(X)", + "0", + + #556 + "integral(tanh(X),X)-log(cosh(X))", + "0", + + #560 + "integral(X*sinh(X),X)-X*cosh(X)+sinh(X)", + "0", + + #562 + "integral(X*cosh(X),X)-X*sinh(X)+cosh(X)", + "0", + + #566 + "integral(sinh(X)^2,X)-sinh(2*X)/4+X/2", + "0", + + #569 + "integral(tanh(X)^2,X)-X+tanh(X)", + "0", + + #572 + "integral(cosh(X)^2,X)-sinh(2*X)/4-X/2", + "0", + + # test integral(exp(a*x^2)) + + "integral(exp(a*x^2))+i*sqrt(pi)*erf(i*sqrt(a)*x)/sqrt(a)/2", + "0", + + "integral(exp(-x^2))-sqrt(pi)*erf(x)/2", + "0", + + # before abs/mag changes of Jan 2017 + # this integral gave the more compact result of: + # sqrt(pi/3)*erf(sqrt(3)*x)/2 + # but the new given one is still correct + "integral(exp(-3*x^2))-pi^(1/2)*erf(3^(1/2)*x)/(2*3^(1/2))", + "0", + + "integral(1/x*1/(a+log(x)),x)-log(a+log(x))", + "0", + + "integral(exp(a*x+b*x))", + "exp((a+b)*x)/(a+b)", + + "integral(x*exp(a*x))", + "-exp(a*x)/(a^2)+x*exp(a*x)/a", + "derivative", + "x*exp(a*x)", + + "integral(x*exp(a*x+b))", + "-exp(a*x+b)/(a^2)+x*exp(a*x+b)/a", + "derivative", + "x*exp(a*x+b)", + + "integral(x*exp(-a*x+b))", + "-exp(-a*x+b)/(a^2)-x*exp(-a*x+b)/a", + "derivative", + "x*exp(-a*x+b)", + + "integral(x^2*exp(a*x))", + "2*exp(a*x)/(a^3)-2*x*exp(a*x)/(a^2)+x^2*exp(a*x)/a", + "derivative", + "x^2*exp(a*x)", + + "integral(x^2*exp(a*x+b))", + "2*exp(a*x+b)/(a^3)-2*x*exp(a*x+b)/(a^2)+x^2*exp(a*x+b)/a", + "derivative", + "x^2*exp(a*x+b)", + + "integral(x^3*exp(a*x))", + "-6*exp(a*x)/(a^4)+6*x*exp(a*x)/(a^3)-3*x^2*exp(a*x)/(a^2)+x^3*exp(a*x)/a", + "derivative", + "x^3*exp(a*x)", + + "integral(x^3*exp(a*x+b))", + "-6*exp(a*x+b)/(a^4)+6*x*exp(a*x+b)/(a^3)-3*x^2*exp(a*x+b)/(a^2)+x^3*exp(a*x+b)/a", + "derivative", + "x^3*exp(a*x+b)", + + # here + "integral(sqrt(a*x^2+b))", + "Stop: integral: sorry, could not find a solution", + + "integral(x^2*(1-x^2)^(3/2))-(x*sqrt(1-x^2)*(-8*x^4+14*x^2-3)+3*arcsin(x))/48", + "0", + + "integral(x^4*(1-x^2)^(3/2))-(-x*sqrt(1-x^2)*(16*x^6-24*x^4+2*x^2+3)+3*arcsin(x))/128", + "0", + + "integral(x^2*(1-x^2)^(5/2))-(x*sqrt(1-x^2)*(48*x^6-136*x^4+118*x^2-15)+15*arcsin(x))/384", + "0", + ] diff --git a/node_modules/algebrite/tests/inv.coffee b/node_modules/algebrite/tests/inv.coffee new file mode 100644 index 0000000..7189fbd --- /dev/null +++ b/node_modules/algebrite/tests/inv.coffee @@ -0,0 +1,24 @@ +test_inv = -> + run_test [ + + "inv(a)", + "inv(a)", + + "inv(inv(a))", + "a", + + "inv(inv(inv(a)))", + "inv(a)", + + "inv(inv(inv(inv(a))))", + "a", + + "inv(a·b·c)", + "inner(inv(c),inner(inv(b),inv(a)))", + + "inv(I)", + "I", + + ] + + diff --git a/node_modules/algebrite/tests/isprime.coffee b/node_modules/algebrite/tests/isprime.coffee new file mode 100644 index 0000000..fcfaacb --- /dev/null +++ b/node_modules/algebrite/tests/isprime.coffee @@ -0,0 +1,35 @@ +test_isprime = -> + run_test [ + # 0 and 1 are not prime numbers + + "isprime(0)", + "0", + + "isprime(1)", + "0", + + "isprime(13)", + "1", + + "isprime(14)", + "0", + + # from the Prime Curios web page + + "isprime(9007199254740991)", + "0", + + # The largest prime that JavaScript supports + + "isprime(2^53 - 111)", + "1", + + # misc. primes + + "isprime(2^50-71)", + "1", + + "isprime(2^40-87)", + "1", + + ] diff --git a/node_modules/algebrite/tests/laguerre.coffee b/node_modules/algebrite/tests/laguerre.coffee new file mode 100644 index 0000000..2c49b9d --- /dev/null +++ b/node_modules/algebrite/tests/laguerre.coffee @@ -0,0 +1,35 @@ +test_laguerre = -> + run_test [ + "laguerre(x,n)", + "laguerre(x,n,0)", + + "laguerre(x,n,k)", + "laguerre(x,n,k)", + + "laguerre(x,0)-1", + "0", + + "laguerre(x,1)-(-x+1)", + "0", + + "laguerre(x,2)-1/2*(x^2-4*x+2)", + "0", + + "laguerre(x,3)-1/6*(-x^3+9*x^2-18*x+6)", + "0", + + "laguerre(x,0,k)-1", + "0", + + "laguerre(x,1,k)-(-x+k+1)", + "0", + + "laguerre(x,2,k)-1/2*(x^2-2*(k+2)*x+(k+1)*(k+2))", + "0", + + "laguerre(x,3,k)-1/6*(-x^3+3*(k+3)*x^2-3*(k+2)*(k+3)*x+(k+1)*(k+2)*(k+3))", + "0", + + "laguerre(a-b,10)-eval(subst(a-b,x,laguerre(x,10)))", + "0", + ] diff --git a/node_modules/algebrite/tests/lcm.coffee b/node_modules/algebrite/tests/lcm.coffee new file mode 100644 index 0000000..e664562 --- /dev/null +++ b/node_modules/algebrite/tests/lcm.coffee @@ -0,0 +1,14 @@ +test_lcm = -> + run_test [ + + "lcm(4,6)", + "12", + + "lcm(4*x,6*x*y)", + "12*x*y", + + # multiple arguments + + "lcm(2,3,4)", + "12", + ] diff --git a/node_modules/algebrite/tests/legendre.coffee b/node_modules/algebrite/tests/legendre.coffee new file mode 100644 index 0000000..9c041b3 --- /dev/null +++ b/node_modules/algebrite/tests/legendre.coffee @@ -0,0 +1,110 @@ +test_legendre = -> + run_test [ + "legendre(x,n)", + "legendre(x,n,0)", + + "legendre(x,n,m)", + "legendre(x,n,m)", + + "legendre(x,0)-1", + "0", + + "legendre(x,1)-x", + "0", + + "legendre(x,2)-1/2*(3*x^2-1)", + "0", + + "legendre(x,3)-1/2*(5*x^3-3*x)", + "0", + + "legendre(x,4)-1/8*(35*x^4-30*x^2+3)", + "0", + + "legendre(x,5)-1/8*(63*x^5-70*x^3+15*x)", + "0", + + "legendre(x,6)-1/16*(231*x^6-315*x^4+105*x^2-5)", + "0", + + "legendre(x,0,0)-1", + "0", + + "legendre(x,1,0)-x", + "0", + + "legendre(x,1,1)+(1-x^2)^(1/2)", + "0", + + "legendre(x,2,0)-1/2*(3*x^2-1)", + "0", + + "legendre(x,2,1)+3*x*(1-x^2)^(1/2)", + "0", + + "legendre(x,2,2)-3*(1-x^2)", + "0", + + "legendre(x,3,0)-1/2*x*(5*x^2-3)", + "0", + + "legendre(x,3,1)-3/2*(1-5*x^2)*(1-x^2)^(1/2)", + "0", + + "legendre(x,3,2)-15*x*(1-x^2)", + "0", + + "legendre(x,3,3)+15*(1-x^2)^(3/2)", + "0", + + "legendre(x,4,0)-1/8*(35*x^4-30*x^2+3)", + "0", + + "legendre(x,4,1)-5/2*x*(3-7*x^2)*(1-x^2)^(1/2)", + "0", + + "legendre(x,4,2)-15/2*(7*x^2-1)*(1-x^2)", + "0", + + "legendre(x,4,3)+105*x*(1-x^2)^(3/2)", + "0", + + "legendre(x,4,4)-105*(1-x^2)^2", + "0", + + "legendre(x,5,0)-1/8*x*(63*x^4-70*x^2+15)", + "0", + + "legendre(cos(theta),0,0)-1", + "0", + + "legendre(cos(theta),1,0)-cos(theta)", + "0", + + "legendre(cos(theta),1,1)+abs(sin(theta))", + "0", + + "legendre(cos(theta),2,0)-1/2*(3*cos(theta)^2-1)", + "0", + + "legendre(cos(theta),2,1)+3*cos(theta)*abs(sin(theta))", + "0", + + "legendre(cos(theta),2,2)-3*sin(theta)^2", + "0", + + "legendre(cos(theta),3,0)-1/2*cos(theta)*(5*cos(theta)^2-3)", + "0", + + "legendre(cos(theta),3,1)- (3/2*abs(sin(theta))-15/2*cos(theta)^2*abs(sin(theta)))", + "0", + + "legendre(cos(theta),3,2)-15*cos(theta)*sin(theta)^2", + "0", + + "legendre(cos(theta),3,3)+15*(sin(theta)^2)^(3/2)", + "0", + + "legendre(a-b,10)-eval(subst(a-b,x,legendre(x,10)))", + "0", + ] diff --git a/node_modules/algebrite/tests/log.coffee b/node_modules/algebrite/tests/log.coffee new file mode 100644 index 0000000..60c9a1c --- /dev/null +++ b/node_modules/algebrite/tests/log.coffee @@ -0,0 +1,45 @@ +test_log = -> + run_test [ + + "log(1)", + "0", + + "log(exp(1))", + "1", + + "log(exp(x))", + "x", + + "exp(log(x))", + "x", + + "log(x^2)", + "2*log(x)", + + "log(1/x)", + "-log(x)", + + "log(a^b)", + "b*log(a)", + + "log(2)", + "log(2)", + + "log(2.0)", + "0.693147...", + + "float(log(2))", + "0.693147...", + + "log(a*b)", + "log(a)+log(b)", + + "log(1/3)+log(3)", + "0", + + "log(-1)", + "i*pi", + + "log(-1.0)", + "3.141593...*i", + ] diff --git a/node_modules/algebrite/tests/madd.coffee b/node_modules/algebrite/tests/madd.coffee new file mode 100644 index 0000000..baff043 --- /dev/null +++ b/node_modules/algebrite/tests/madd.coffee @@ -0,0 +1,62 @@ +test_madd = -> + i = 0 + if DEBUG then console.log("test madd") + m = mtotal + for i in [-100...100] + for j in [-100...100] + test_maddf(i, j, i + j) + #if (m != mtotal) + # logout("memory leak\n") + # errout() + logout("ok\n") + +test_maddf = (na, nb, nc) -> + + a = mint(na) + b = mint(nb) + c = mint(nc) + + d = madd(a, b) + + if (mcmp(c, d) == 0) + return + else + throw new Error("test_maddf") + + #sprintf(logbuf, "%d %d %d %d\n", na, nb, nc, *d * MSIGN(d)) + logout(logbuf) + errout() + +test_msub = -> + i = 0 + logout("test msub\n") + m = mtotal + for i in [-100..100] + for j in [-100..100] + test_msubf(i, j, i - j) + if (m != mtotal) + logout("memory leak\n") + errout() + logout("ok\n") + +test_msubf = (na, nb, nc) -> + #unsigned int *a, *b, *c, *d + + a = mint(na) + b = mint(nb) + c = mint(nc) + + d = msub(a, b) + + if (mcmp(c, d) == 0) + #mfree(a) + #mfree(b) + #mfree(c) + #mfree(d) + return + + #sprintf(logbuf, "%d %d %d %d\n", na, nb, nc, *d * MSIGN(d)) + logout(logbuf) + errout() + +#endif diff --git a/node_modules/algebrite/tests/mgcd.coffee b/node_modules/algebrite/tests/mgcd.coffee new file mode 100644 index 0000000..321f2b3 --- /dev/null +++ b/node_modules/algebrite/tests/mgcd.coffee @@ -0,0 +1,31 @@ +test_mgcd = -> + logout("testing mgcd\n") + for i in [1...100] + a = mint(i) + for j in [1...100] + b = mint(j) + c = mgcd(a, b) + d = egcd(a, b) + if (mcmp(c, d) != 0) + throw new Error("test_mgcd failed") + logout("ok\n") + +# Euclid's algorithm + +egcd = (a, b) -> + sign_ = 0 + if (MZERO(b)) + stop("divide by zero") + #b = mcopy(b) + if (MZERO(a)) + return b + sign_ = MSIGN(b) + #a = mcopy(a) + while (!MZERO(b)) + c = mmod(a, b) + #mfree(a) + a = b + b = c + a = setSignTo(a,sign_) + return a + diff --git a/node_modules/algebrite/tests/mini-test.coffee b/node_modules/algebrite/tests/mini-test.coffee new file mode 100644 index 0000000..6ba8353 --- /dev/null +++ b/node_modules/algebrite/tests/mini-test.coffee @@ -0,0 +1,236 @@ +# mini test for distribution builds + +mini_test = -> + + run_test [ + # static spherical metric + + "clearall", + "", + + "gdd=[[-exp(2*Phi(r)),0,0,0],[0,exp(2*Lambda(r)),0,0],[0,0,r^2,0],[0,0,0,r^2*sin(theta)^2]]", + "", + + "X=[t,r,theta,phi]", + "", + + "guu=inv(gdd)", + "", + + "gddd=d(gdd,X)", + "", + + "GAMDDD=1/2*(gddd+transpose(gddd,2,3)-transpose(transpose(gddd,2,3),1,2))", + "", + + "GAMUDD=contract(outer(guu,GAMDDD),2,3)", + "", + + "T1=d(GAMUDD,X)", + "", + + "T2=contract(outer(GAMUDD,GAMUDD),2,4)", + "", + + "RUDDD=transpose(T1,3,4)-T1+transpose(T2,2,3)-transpose(transpose(T2,2,3),3,4)", + "", + + "RDD=contract(RUDDD,1,3)", + "", + + "R=contract(contract(outer(guu,RDD),2,3),1,2)", + "", + + "GDD=RDD-1/2*gdd*R", + "", + + "Gtt=1/r^2*exp(2 Phi(r)) d(r*(1 - exp(-2 Lambda(r))),r)", + "", + + "Grr=-1/r^2*exp(2*Lambda(r))*(1-exp(-2*Lambda(r)))+2/r*d(Phi(r),r)", + "", + + "Gthetatheta=r^2*exp(-2*Lambda(r))*(d(d(Phi(r),r),r)+d(Phi(r),r)^2+d(Phi(r),r)/r-d(Phi(r),r)*d(Lambda(r),r)-d(Lambda(r),r)/r)", + "", + + "Gphiphi=sin(theta)^2*Gthetatheta", + "", + + "T=[[Gtt,0,0,0],[0,Grr,0,0],[0,0,Gthetatheta,0],[0,0,0,Gphiphi]]", + "", + + "GDD-T", + "[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]", + + # surface integral example from the manual + + "clearall", + "", + + "z=1-x^2-y^2", + "", + + "F=[x*y^2*z,-2*x^3,y*z^2]", + "", + + "S=[x,y,z]", + "", + + "s=dot(F,cross(d(S,x),d(S,y)))", + "", + + "defint(s,y,-sqrt(1-x^2),sqrt(1-x^2),x,-1,1)", + "1/48*pi", + + # hydrogen wavefunction example + + "clearall", + "", + + "laplacian(f)=1/r^2*d(r^2*d(f,r),r)+1/(r^2*sin(theta))*d(sin(theta)*d(f,theta),theta)+1/(r*sin(theta))^2*d(f,phi,phi)", + "", + + "n=7", + "", + + "l=3", + "", + + "m=1", + "", + + "R=r^l*exp(-r/n)*laguerre(2*r/n,n-l-1,2*l+1)", + "", + + "Y=legendre(cos(theta),l,abs(m))*exp(i*m*phi)", + "", + + "psi=R*Y", + "", + + "E=psi/n^2", + "", + + "K=laplacian(psi)", + "", + + "V=2*psi/r", + "", + + # after the changes to abs and mag of Jan 2017 + # , some abs/mag are introduced in the results of legendre + # (correctly, I believe), + # which makes this expression != 0. + # TODO this can work only after all the absolute values + # have been removed + #"circexp(sin(theta)*(E-K-V))", + #"0", + + # Green's theorem (surface integral) + + "clearall", + "", + + "P=2x^3-y^3", + "", + + "Q=x^3+y^3", + "", + + "f=d(Q,x)-d(P,y)", + "", + + "x=r*cos(theta)", + "", + + "y=r*sin(theta)", + "", + + "defint(f*r,r,0,1,theta,0,2pi)", + "3/2*pi", + + # Green's theorem (line integral) + + "clearall", + "", + + "x=cos(t)", + "", + + "y=sin(t)", + "", + + "P=2x^3-y^3", + "", + + "Q=x^3+y^3", + "", + + "f=P*d(x,t)+Q*d(y,t)", + "", + + "f=circexp(f)", + "", + + "defint(f,t,0,2pi)", + "3/2*pi", + + # Stokes' theorem (surface integral) + + "clearall", + "", + + "z=9-x^2-y^2", + "", + + "F=[3y,4z,-6x]", + "", + + "S=[x,y,z]", + "", + + "f=dot(curl(F),cross(d(S,x),d(S,y)))", + "", + + "x=r*cos(theta)", + "", + + "y=r*sin(theta)", + "", + + "defint(f*r,r,0,3,theta,0,2pi)", + "-27*pi", + + # Stokes' theorem (line integral) + + "clearall", + "", + + "x=3*cos(t)", + "", + + "y=3*sin(t)", + "", + + "z=9-x^2-y^2", + "", + + "P=3y", + "", + + "Q=4z", + "", + + "R=-6x", + "", + + "f=P*d(x,t)+Q*d(y,t)+R*d(z,t)", + "", + + "f=circexp(f)", + "", + + "defint(f,t,0,2pi)", + "-27*pi", + ] + diff --git a/node_modules/algebrite/tests/mixedprint.coffee b/node_modules/algebrite/tests/mixedprint.coffee new file mode 100644 index 0000000..83da531 --- /dev/null +++ b/node_modules/algebrite/tests/mixedprint.coffee @@ -0,0 +1,220 @@ +test_mixedprint = -> + run_test [ + + "1.0", + "1.0", + + "1111 * 1111.0", + "1234321.0", + + "1111.0 * 1111", + "1234321.0", + + "1111.0 * 1111.0", + "1234321.0", + + "11111111 * 11111111.0", + "123456787654321.0", + + "11111111.0 * 11111111", + "123456787654321.0", + + "11111111.0 * 11111111.0", + "123456787654321.0", + + # unfortunately using Numbers + # at some point we hit the precision + "111111111 * 111111111.0", + "12345678987654320.0", + + # unfortunately using Numbers + # at some point we hit the precision + "111111111.0 * 111111111", + "12345678987654320.0", + + # unfortunately using Numbers + # at some point we hit the precision + "111111111.0 * 111111111.0", + "12345678987654320.0", + + "1.0*10^(-6)", + "0.000001", + + # check that this doesn't return 0.0 + "1.0*10^(-7)", + "0.000000...", + + # ------------------------------------------ + "maxFixedPrintoutDigits", + "6", + + "maxFixedPrintoutDigits=20", + "", + + "maxFixedPrintoutDigits", + "20", + + "1.0*10^(-15)", + "0.000000000000001", + + "printhuman", + "0.000000000000001", + + "printcomputer", + "0.000000000000001", + + "printlatex", + "0.000000000000001", + + "printlist", + "0.000000000000001", + + "print2dascii", + "0.000000000000001", + + "forceFixedPrintout=0", + "", + + "1.0*10^(-15)", + "1.0*10^(-15)", + + "printhuman", + "1.0*10^(-15)", + + "printcomputer", + "1.0*10^(-15)", + + "printlatex", + "1.0\\mathrm{e}{-15}", + + "printlist", + "1.0*10^(-15)", + + "print2dascii", + "1.0*10^(-15)", + + "forceFixedPrintout=1", + "", + + "maxFixedPrintoutDigits=6", + "", + + # ------------------------------------------ + + "float(pi)", + "3.141593...", + + "print(\"hello\")", + "\"hello\"", + + "-sqrt(2)/2", + "-1/2*2^(1/2)", + + # we can't get rid of the multiplication sign + # in general, because expressions like + # (x+1)(x-1) actually represent a function call + # We could get rid of the multiplication sign + # in these special cases where there are numeric + # constants but we don't do that yet. + "printhuman", + "-1/2 2^(1/2)", + + "printcomputer", + "-1/2*2^(1/2)", + + "printlatex", + "-\\frac{\\sqrt{2}}{2}", + + "printlist", + "(multiply -1/2 (power 2 1/2))", + + "printlist(a+b)\nprintlist(c+d)", + "(add a b)(add c d)", + + "print2dascii", + " 1 1/2\n- --- 2\n 2", + + "last2dasciiprint", + "\" 1 1/2\n- --- 2\n 2\"", + + # checks that no extra newlines are + # inserted + "x=0\ny=2\nfor(do(x=sqrt(2+x),y=2*y/x,printcomputer(y)),k,1,2)", + "2*2^(1/2)4*2^(1/2)/((2+2^(1/2))^(1/2))", + + "clearall", + "", + + "print2dascii([[a,b],[c,d]])", + "a b\n\nc d", + + "print2dascii(1/sqrt(-15))", + " 1/2\n (-1)\n- -----------\n 1/2 1/2\n 3 5", + + "print2dascii(x^(1/a))", + " 1/a\nx", + + "print2dascii(x^(a/b))", + " a/b\nx", + + "print2dascii(x^(a/2))", + " 1/2 a\nx", + + "print2dascii(x^(1/(a+b)))", + " 1/(a + b)\nx", + + # ------------------------------------------ + + "(5/3)!", + "(5/3)!", + + "printhuman", + "(5/3)!", + + "printcomputer", + "(5/3)!", + + "printlatex", + "(\\frac{5}{3})!", + + "printlist", + "(factorial 5/3)", + + "print2dascii", + " 5\n(---)!\n 3", + + # bug #106 --------------------------------- + # printing terms that are not "normalised" + # following an eval, one can't assume that + # the numbers are all leading, hence some + # checks had to be refined when printing + # the signs + + "clearall", + "", + + "print(quote(k*(-2)))", + "k*(-2)", + + "print(quote(k*(-1/2)))", + "k*(-1/2)", + + "print(quote(k*2))", + "k*2", + + "print(quote(k*1/2))", + "k*1/2", + + "print(k*(-2))", + "-2*k", + + "print(k*(-1/2))", + "-1/2*k", + + "print(k*2)", + "2*k", + + "print(k*1/2)", + "1/2*k", + + ] diff --git a/node_modules/algebrite/tests/mmul.coffee b/node_modules/algebrite/tests/mmul.coffee new file mode 100644 index 0000000..e2b4bd1 --- /dev/null +++ b/node_modules/algebrite/tests/mmul.coffee @@ -0,0 +1,79 @@ +test_mmul = -> + i = 0 + j = 0 + m = 0 + logout("test mmul\n") + for i in [-100..100] + for j in [-100..100] + test_mmulf(i, j, i * j) + logout("ok\n") + +test_mmulf = (na, nb, nc) -> + + a = mint(na) + b = mint(nb) + c = mint(nc) + + d = mmul(a, b) + + if (mcmp(c, d) == 0) + return + else + throw new Error("test_mmulf error") + +test_mdiv = -> + i = 0 + j = 0 + m = 0 + logout("test mdiv\n") + for i in [-100..100] + for j in [-100..100] + if (j) + if i/j > 0 + expectedResult = Math.floor(i / j) + else + expectedResult = Math.ceil(i / j) + test_mdivf(i, j, expectedResult) + logout("ok\n") + +test_mdivf = (na, nb, nc) -> + + a = mint(na) + b = mint(nb) + c = mint(nc) + + d = mdiv(a, b) + + if (mcmp(c, d) == 0) + return + else + debugger + throw new Error("test_mdivf error") + + +test_mmod = -> + i = 0 + j = 0 + m = 0 + logout("test mmod\n") + for i in [-100..100] + for j in [-100..100] + if (j) + test_mmodf(i, j, i % j) + logout("ok\n") + +test_mmodf = (na,nb,nc) -> + + a = mint(na) + b = mint(nb) + c = mint(nc) + + d = mmod(a, b) + + if (mcmp(c, d) == 0) + return + else + throw new Error("test_mmodf error") + + + diff --git a/node_modules/algebrite/tests/mod.coffee b/node_modules/algebrite/tests/mod.coffee new file mode 100644 index 0000000..b2112ad --- /dev/null +++ b/node_modules/algebrite/tests/mod.coffee @@ -0,0 +1,44 @@ +test_mod = -> + run_test [ + "mod(2.0,3.0)", + "2", + + "mod(-2.0,3.0)", + "-2", + + "mod(2.0,-3.0)", + "2", + + "mod(-2.0,-3.0)", + "-2", + + "mod(2,3)", + "2", + + "mod(-2,3)", + "-2", + + "mod(2,-3)", + "2", + + "mod(-2,-3)", + "-2", + + "mod(a,b)", + "mod(a,b)", + + "mod(2.0,0.0)", + "Stop: mod function: divide by zero", + + "mod(2,0)", + "Stop: mod function: divide by zero", + + "mod(1.2,2)", + "Stop: mod function: cannot convert float value to integer", + + "mod(1/2,3)", + "Stop: mod function: integer arguments expected", + + "mod(15,8.0)", + "7", + ] diff --git a/node_modules/algebrite/tests/mpow.coffee b/node_modules/algebrite/tests/mpow.coffee new file mode 100644 index 0000000..a7a4c16 --- /dev/null +++ b/node_modules/algebrite/tests/mpow.coffee @@ -0,0 +1,20 @@ +test_mpow = -> + logout("testing mpow\n") + + + # small numbers + + for i in [-10...10] + a = mint(i) + x = 1 + for j in [0...10] + b = mpow(a, j) + c = mint(x) + if (mcmp(b, c) != 0) + throw new Error("failed test_mpow") + x *= i + + + logout("ok\n") + +#endif diff --git a/node_modules/algebrite/tests/mprime.coffee b/node_modules/algebrite/tests/mprime.coffee new file mode 100644 index 0000000..1e01a74 --- /dev/null +++ b/node_modules/algebrite/tests/mprime.coffee @@ -0,0 +1,19 @@ +test_mprime = -> + i = 0 + k = 0 + m = 0 + t = 0 + logout("test mprime\n") + k = 0 + for i in [0...10000] + n = mint(i) + t = mprime(n) + if (i == primetab[k]) + if (t == 0) + throw new Error("failed for prime number " + i) + k++ + else if (t == 1) + throw new Error("failed for composite number " + i) + logout("ok\n") + +#endif diff --git a/node_modules/algebrite/tests/mroot.coffee b/node_modules/algebrite/tests/mroot.coffee new file mode 100644 index 0000000..997559d --- /dev/null +++ b/node_modules/algebrite/tests/mroot.coffee @@ -0,0 +1,34 @@ +test_mroot = -> + i = 0 + j = 0 + mem = 0 + + logout("testing mroot\n") + + + # small numbers + + for i in [0...10] + a = mint(i) + for j in [1...10] + #logout(i + " " + j) + b = mpow(a, j) + c = mroot(b, j) + if (c == 0 || mcmp(a, c) != 0) + debugger + throw new Error("failed test_mroot") + + logout(" ...mroot small numbers ok\n") + + a = mint(12345) + + for i in [1...10] + #logout(i) + b = mpow(a, i) + c = mroot(b, i) + if (c == 0 || mcmp(a, c) != 0) + throw new Error("failed") + + + logout(" ...mroot big numbers ok\n") + logout("ok") diff --git a/node_modules/algebrite/tests/multiply.coffee b/node_modules/algebrite/tests/multiply.coffee new file mode 100644 index 0000000..57320b4 --- /dev/null +++ b/node_modules/algebrite/tests/multiply.coffee @@ -0,0 +1,124 @@ +test_multiply = -> + if DEBUG then console.log "test_multiply ----------------------------" + run_test [ + + "0*a", + "0", + + "a*0", + "0", + + "1*a", + "a", + + "a*1", + "a", + + "0.0*a", + "0.0", + + "a*0.0", + "0.0", + + "1.0*a", + "1.0*a", + + "a*1.0", + "1.0*a", + + "a*a", + "a^2", + + "a^2*a", + "a^3", + + "a*a^2", + "a^3", + + "a^2*a^2", + "a^4", + + "2^a*2^(3-a)", # symbolic exponents cancel + "8", + + "sqrt(2)/2", + # leave the roots nice and + # clean in numerator, avoid these + # forms + #"2^(-1/2)", + "1/2*2^(1/2)", + + "2/sqrt(2)", + "2^(1/2)", + + "-sqrt(2)/2", + # avoid having roots in denominator + #"-1/(2^(1/2))", + "-1/2*2^(1/2)", + + "2^(1/2-a)*2^a/10", + # avoid roots in denominator + #"1/(5*2^(1/2))", + "1/10*2^(1/2)", + + "i/4", + "1/4*i", + + "1/(4 i)", + "-1/4*i", + + # ensure 1.0 is not discarded + + "1.0 pi 1/2", + "1.570796...", + + "1.0 1/2 pi", + "1.570796...", + + # https://github.com/davidedc/Algebrite/issues/121 + + "1 - 1/2*0^2", + "1", + + "1 - 3/2*0^2", + "1", + + "1 - 1/2*0^1", + "1", + + + "1 - 1/2*(-0^2)", + "1", + + "1 - 1/2*5^2", + "-23/2", + + "1 + 1/2*0^2", + "1", + + "1 + (-1/2*0^2)", + "1", + + "-1/2*0^2", + "0", + + "1 - 1/2*0*0", + "1", + + "1 - 1/x*0^2", + "1", + + "1 - 10/2*0^2", + "1", + + "1 - 2*0^2", + "1", + + "1 - 0^2", + "1", + + "1 - 0^2*(1/2)", + "1", + + + ] diff --git a/node_modules/algebrite/tests/nroots.coffee b/node_modules/algebrite/tests/nroots.coffee new file mode 100644 index 0000000..52f0f77 --- /dev/null +++ b/node_modules/algebrite/tests/nroots.coffee @@ -0,0 +1,14 @@ +test_nroots = -> + run_test [ + "nroots(x)", + "0", + + "nroots((1+i)*x^2+1)", + "[-0.171780...-0.727673...*i,0.171780...+0.727673...*i]", + + "nroots(sqrt(2)*exp(i*pi/4)*x^2+1)", + "[-0.171780...-0.727673...*i,0.171780...+0.727673...*i]", + + # "nroots(x^4+1)", + # "(-0.707107+0.707107*i,-0.707107-0.707107*i,0.707107+0.707107*i,0.707107-0.707107*i)", + ] diff --git a/node_modules/algebrite/tests/numerator.coffee b/node_modules/algebrite/tests/numerator.coffee new file mode 100644 index 0000000..6eb0e99 --- /dev/null +++ b/node_modules/algebrite/tests/numerator.coffee @@ -0,0 +1,18 @@ +test_numerator = -> + run_test [ + + "numerator(2/3)", + "2", + + "numerator(x)", + "x", + + "numerator(1/x)", + "1", + + "numerator(a+b)", + "a+b", + + "numerator(1/a+1/b)", + "a+b", + ] diff --git a/node_modules/algebrite/tests/outer.coffee b/node_modules/algebrite/tests/outer.coffee new file mode 100644 index 0000000..428e121 --- /dev/null +++ b/node_modules/algebrite/tests/outer.coffee @@ -0,0 +1,32 @@ +test_outer = -> + run_test [ + "outer(a,b)", + "a*b", + + "outer(a,[b1,b2])", + "[a*b1,a*b2]", + + "outer([a1,a2],b)", + "[a1*b,a2*b]", + + "H33=hilbert(3)", + "", + + "H44=hilbert(4)", + "", + + "H55=hilbert(5)", + "", + + "H3344=outer(H33,H44)", + "", + + "H4455=outer(H44,H55)", + "", + + "H33444455=outer(H33,H44,H44,H55)", + "", + + "simplify(inner(H3344,H4455)-contract(H33444455,4,5))", + "0", + ] diff --git a/node_modules/algebrite/tests/pattern.coffee b/node_modules/algebrite/tests/pattern.coffee new file mode 100644 index 0000000..c52563b --- /dev/null +++ b/node_modules/algebrite/tests/pattern.coffee @@ -0,0 +1,367 @@ +test_pattern = -> + run_test [ + + "pattern(dot(transpose(a_),a_), cov(a_))", + "dot(transpose(a_),a_)->cov(a_)", + + "pattern(dot(a_,transpose(a_)), cov(a_))", + "dot(a_,transpose(a_))->cov(a_)", + + #"pattern(cov(transpose(a_)), cov(a_))", + #"", + + "simplify(1 + eig(dot(transpose(A+B),B+transpose(transpose(A)))))", + "1+eig(cov(A+B))", + + "simplify(1 + eig(dot(x*transpose(transpose(A)), transpose(x*A))))", + "1+eig(cov(transpose(A)*transpose(x)))", + + # ideally this but we need to make simplifications work better + # "1+eig(cov(A*x))", + + "simplify(1 + eig(dot(x*transpose(transpose(A)), transpose(A*x))))", + "1+eig(cov(transpose(A)*transpose(x)))", + + "simplify(1 + eig(dot(x*Aᵀᵀ, (A*x)ᵀ)))", + "1+eig(cov(transpose(A)*transpose(x)))", + + # ideally this but we need to make simplifications work better + # "1+eig(cov(A*x))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + + + "simplify(integral(1/(X-A)/sqrt(X^2-A^2),X)+sqrt(X^2-A^2)/A/(X-A))", + "0", + + + # ------------------------------------------------------------------ + + + "pattern(dot(transpose(a_),a_), cov(a_))", + "dot(transpose(a_),a_)->cov(a_)", + + "simplify(integral(1/(X-A)/sqrt(X^2-A^2),X)+sqrt(X^2-A^2)/A/(X-A))", + "0", + + + # ------------------------------------------------------------------ + + + "simplify(eig(dot(transpose(A+B),B+transpose(transpose(A)))))", + "eig(cov(A+B))", + + "simplify(eig(dot(x*transpose(transpose(A)), transpose(A*x))))", + "eig(cov(transpose(A)*transpose(x)))", + + "simplify(eig(dot(x*transpose(transpose(A)), transpose(x*A))))", + "eig(cov(transpose(A)*transpose(x)))", + + + # ------------------------------------------------------------------ + + + "pattern(dot(a_,transpose(a_)), cov(a_))", + "dot(a_,transpose(a_))->cov(a_)", + + "simplify(eig(dot(transpose(A+B),B+transpose(transpose(A)))))", + "eig(cov(A+B))", + + "simplify(eig(dot(x*transpose(transpose(A)), transpose(x*A))))", + "eig(cov(transpose(A)*transpose(x)))", + + "simplify(eig(dot(x*transpose(transpose(A)), transpose(A*x))))", + "eig(cov(transpose(A)*transpose(x)))", + + "clearpatterns()", + "", + + + # ------------------------------------------------------------------ + + + + "simplify(eig(dot(transpose(A+B),B+transpose(transpose(A)))))", + "eig(inner(transpose(A),A)+inner(transpose(A),B)+inner(transpose(B),A)+inner(transpose(B),B))", + + + # ------------------------------------------------------------------ + + + "pattern(dot(transpose(a_),a_), cov(a_), not(number(a_)))", + "dot(transpose(a_),a_)->cov(a_)", + + "pattern(dot(transpose(a_),a_), cov(a_), number(a_),a_>0 )", + "dot(transpose(a_),a_)->cov(a_)", + + "simplify(eig(dot(transpose(3),transpose(transpose(3)))))", + "eig(9)", + + "simplify(eig(dot(transpose(-3),transpose(transpose(-3)))))", + "eig(9)", + + "simplify(eig(dot(transpose(-x),transpose(transpose(-x)))))", + "eig(cov(-x))", + + "clearpatterns()", + "", + + + # ------------------------------------------------------------------ + + + + "pattern(something(a_,b_),b_*somethingElse(a_))", + "something(a_,b_)->b_*somethingElse(a_)", + + "simplify(something(x,y))", + "somethingElse(x)*y", + + "clearpatterns()", + "", + + + # ------------------------------------------------------------------ + + + + "pattern(something(a_,b_),b_*somethingElse(a_))", + "something(a_,b_)->b_*somethingElse(a_)", + + "indirection(h,k) = something(h,k)", + "", + + "simplify(indirection(x,y))", + "somethingElse(x)*y", + + "clearpatterns()", + "", + + + # ------------------------------------------------------------------ + + + "pattern(dot(a_,transpose(a_)), cov(a_))", + "dot(a_,transpose(a_))->cov(a_)", + + "simplify(1 + eig(dot(transpose(A)+transpose(B),B+transpose(transpose(A)))))", + "1+eig(inner(transpose(A),A)+inner(transpose(A),B)+inner(transpose(B),A)+inner(transpose(B),B))", + + # catches if a guard works against substituting bare native functions + "simplify(1 + eig(dot(transpose(A)+transpose(B),B+transpose(transpose(A)))))", + "1+eig(inner(transpose(A),A)+inner(transpose(A),B)+inner(transpose(B),A)+inner(transpose(B),B))", + + "clearpatterns()", + "", + + + # ------------------------------------------------------------------ + + + "pattern(dot(transpose(a_),a_), cov(a_))", + "dot(transpose(a_),a_)->cov(a_)", + + # picks up that transpose(abs(k)) + # is a substitution that works + "simplify(1 + eig(dot(abs(k),transpose(abs(k)))))", + "1+eig(cov(transpose(abs(k))))", + + # picks up that transpose(b(2)) + # is a substitution that works + "simplify(1 + eig(dot(b(2),transpose(b(2)))))", + "1+eig(cov(transpose(b(2))))", + + "clearpatterns()", + "", + + + # ------------------------------------------------------------------ + + "pattern(a_ + b_, dot(cov(b_),cov(a_)))", + "a_+b_->dot(cov(b_),cov(a_))", + + "simplify(something + somethingelse)", + "inner(cov(somethingelse),cov(something))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify(aFunction(someArg))", + "anotherFunction(someArg)", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify(1 + aFunction(someArg))", + "1+anotherFunction(someArg)", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify(aFunction(someArg)+aFunction(someOtherArg))", + "anotherFunction(someArg)+anotherFunction(someOtherArg)", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify( a + aFunction(someArg) + b + aFunction(someOtherArg))", + "a+b+anotherFunction(someArg)+anotherFunction(someOtherArg)", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify(aFunction(aFunction(someOtherArg)))", + "anotherFunction(anotherFunction(someOtherArg))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "pattern(aFunction(a_), anotherFunctionBBBB(a_))", + "aFunction(a_)->anotherFunctionBBBB(a_)", + + "simplify(aFunction(aFunction(someOtherArg)))", + "anotherFunctionBBBB(anotherFunctionBBBB(someOtherArg))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunctionBBBB(a_))", + "aFunction(a_)->anotherFunctionBBBB(a_)", + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify(aFunction(aFunction(someOtherArg)))", + "anotherFunction(anotherFunction(someOtherArg))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "pattern(anotherFunction(a_), YETanotherFunction(a_))", + "anotherFunction(a_)->YETanotherFunction(a_)", + + "simplify(aFunction(aFunction(someOtherArg)))", + "YETanotherFunction(YETanotherFunction(someOtherArg))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + # this one tests if multiple rounds of ruleS applications are + # done while there are still trasformations succeeding. + + "pattern(anotherFunction(a_), YETanotherFunction(a_))", + "anotherFunction(a_)->YETanotherFunction(a_)", + + "pattern(aFunction(a_), anotherFunction(a_))", + "aFunction(a_)->anotherFunction(a_)", + + "simplify(aFunction(aFunction(someOtherArg)))", + "YETanotherFunction(YETanotherFunction(someOtherArg))", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + # you can use transformation rules to calculate factorials + # you shouldn't, but you can + + "pattern(fact(0), 1)", + "fact(0)->1", + + # TODO would be nice to print out the constraints + # as well. + "pattern(fact(a_), a_*fact(a_-1), not(a_ == 0))", + "fact(a_)->a_*fact(a_-1)", + + "simplify(fact(3))", + "6", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(f(a_,b_),f(b_,a_))", + "f(a_,b_)->f(b_,a_)", + + # TODO would be nice to print out the constraints + # as well. + "simplify(f(1,2))", + "Stop: maximum application of single transformation rule exceeded: f(a_,b_)(f(b_,a_))", + + "clearpatterns()", + "", + + # overwriting a pattern --------------------------------------------- + + "pattern(a_ + a_ ,42 * a_)", + "a_+a_->42*a_", + + "pattern(a_ + a_ ,21 * a_)", + "a_+a_->21*a_", + + "simplify(x+x)", + "21*x", + + "clearpatterns()", + "", + + # ------------------------------------------------------------------ + + "pattern(f(a_,b_))", + "Stop: pattern needs at least a template and a transformed version", + + # ------------------------------------------------------------------ + + "pattern()", + "Stop: pattern needs at least a template and a transformed version", + + # ------------------------------------------------------------------ + + "pattern(f(a_,b_), f(a_,b_))", + "Stop: recursive pattern", + + + ] diff --git a/node_modules/algebrite/tests/polar.coffee b/node_modules/algebrite/tests/polar.coffee new file mode 100644 index 0000000..8986f87 --- /dev/null +++ b/node_modules/algebrite/tests/polar.coffee @@ -0,0 +1,66 @@ +test_polar = -> + run_test [ + "polar(1+i)", + "2^(1/2)*exp(1/4*i*pi)", + + "polar(-1+i)", + "2^(1/2)*exp(3/4*i*pi)", + + "polar(-1-i)", + "2^(1/2)*exp(-3/4*i*pi)", + + "polar(1-i)", + "2^(1/2)*exp(-1/4*i*pi)", + + "rect(polar(3+4*i))", + "3+4*i", + + "rect(polar(-3+4*i))", + "-3+4*i", + + "rect(polar(3-4*i))", + "3-4*i", + + "rect(polar(-3-4*i))", + "-3-4*i", + + "rect(polar((-1)^(1/2)))", + "i", + + "rect(polar((-1)^(-5/6)))", + "-1/2*i-1/2*3^(1/2)", + + "rect(polar((-1)^(-5/a)))", + "cos(5*pi/a)-i*sin(5*pi/a)", + + "rect(polar((-1)^(a)))", + "cos(a*pi)+i*sin(a*pi)", + + "-i*(-2*rect(polar((-1)^(1/6)))/rect(polar((3^(1/2))))+2*rect(polar((-1)^(5/6)))/rect(polar((3^(1/2)))))^(1/4)*(2*rect(polar((-1)^(1/6)))/rect(polar((3^(1/2))))-2*rect(polar((-1)^(5/6)))/rect(polar((3^(1/2)))))^(1/4)/(2^(1/2))", + #"-(-1)^(3/4)", + "1/2^(1/2)-i/(2^(1/2))", + + # this is also "-(-1)^(3/4)" but we get to that after the simplification after + # this test + "-i*(-2*polar((-1)^(1/6))/polar((3^(1/2)))+2*polar((-1)^(5/6))/polar((3^(1/2))))^(1/4)*(2*polar((-1)^(1/6))/polar((3^(1/2)))-2*polar((-1)^(5/6))/polar((3^(1/2))))^(1/4)/(2^(1/2))", + "-i*(-2*exp(1/6*i*pi)/(3^(1/2))+2*exp(5/6*i*pi)/(3^(1/2)))^(1/4)*(2*exp(1/6*i*pi)/(3^(1/2))-2*exp(5/6*i*pi)/(3^(1/2)))^(1/4)/(2^(1/2))", + + "simplify", + "(1-i)/(2^(1/2))", + + "-i*(-2*rect(exp(1/6*i*pi))/(3^(1/2))+2*rect(exp(5/6*i*pi))/(3^(1/2)))^(1/4)*(2*rect(exp(1/6*i*pi))/(3^(1/2))-2*rect(exp(5/6*i*pi))/(3^(1/2)))^(1/4)/(2^(1/2))", + #"-(-1)^(3/4)", + "1/2^(1/2)-i/(2^(1/2))", + + "polar(-(-1)^(3/4))", + "exp(-1/4*i*pi)", + + "polar(-i*(-2*(-1)^(1/6)/(3^(1/2))+2*(-1)^(5/6)/(3^(1/2)))^(1/4)*(2*(-1)^(1/6)/(3^(1/2))-2*(-1)^(5/6)/(3^(1/2)))^(1/4)/(2^(1/2)))", + "exp(-1/4*i*pi)", + + # nothing to do for polar since we end + # up with a real + "polar((-1)^(1/6) - (-1)^(5/6))", + "3^(1/2)", + + ] diff --git a/node_modules/algebrite/tests/power.coffee b/node_modules/algebrite/tests/power.coffee new file mode 100644 index 0000000..bbd6925 --- /dev/null +++ b/node_modules/algebrite/tests/power.coffee @@ -0,0 +1,296 @@ +test_power = -> + run_test [ + + # according to the notorious + # "PEMDAS" mnemonic, the power + # operator has the most precedence. + # Strangely, Mathematica parses + # a^1/2 as sqrt(a), not following PEMDAS, + # probably because of some fancy + # euristics, since, contrarily to the + # case above, it also parses + # a^b/2 as (a^b)/2. + # I think this more standard/uniform handling + # a-la-sympy is ok. + "a^1/2 + a^1/2", + "a", + + "2^(1/2)", + "2^(1/2)", + + "2^(3/2)", + "2*2^(1/2)", + + "(-2)^(1/2)", + "i*2^(1/2)", + + "3^(4/3)", + "3*3^(1/3)", + + "3^(-4/3)", + "1/(3*3^(1/3))", + + "3^(5/3)", + "3*3^(2/3)", + + "3^(2/3)-9^(1/3)", + "0", + + "3^(10/3)", + "27*3^(1/3)", + + "3^(-10/3)", + "1/(27*3^(1/3))", + + "(1/3)^(10/3)", + "1/(27*3^(1/3))", + + "(1/3)^(-10/3)", + "27*3^(1/3)", + + "27^(2/3)", + "9", + + "27^(-2/3)", + "1/9", + + "102^(1/2)", + "2^(1/2)*3^(1/2)*17^(1/2)", + + "32^(1/3)", + "2*2^(2/3)", + + "9999^(1/2)", + "3*11^(1/2)*101^(1/2)", + + "8^(1/2)", + "2*2^(1/2)", + + "10000^(1/3)", + "10*2^(1/3)*5^(1/3)", + + # we could take out a "18" from the radix but + # we only handle this for small numbers in + # "quickfactor" routine. TODO + "8204861575751304355842204^(1/2)", + "8204861575751304355842204^(1/2)", + + # see above + "simplify(8204861575751304355842204^(1/2))", + "8204861575751304355842204^(1/2)", + + "sqrt(-1/2 -1/2 * x)", + "(-1/2*x-1/2)^(1/2)", + + "sqrt(x*y)", + "(x*y)^(1/2)", + + "sqrt(1/x)", + "(1/x)^(1/2)", + + "sqrt(x^y)", + "(x^y)^(1/2)", + + "sqrt(x)^2", + "x", + + "sqrt(x^2)", + "abs(x)", + + # always true, whether x is real or not + "sqrt(x^2)^2", + "x^2", + + "3^(1/2)*i/9", + "1/9*i*3^(1/2)", + + "(-4.0)^(1.5)", + "-8.0*i", + + "(-4.0)^(3/2)", + "-8.0*i", + + # usually the rectangular form is returned. + "(-1)^(1/3)", + #"(-1)^(1/3)", + "1/2+1/2*i*3^(1/2)", + + # note how the "double" type + # is toxic i.e. it propagates through + # everything it touches. + # also, that -0.500000... _really_ is 0.5 + # however we get some error in the calculations + # so it doesn't end up being exactly equal to -0.5 + "(-1.0)^(2/3)", + "-0.500000...+0.866025...*i", + + # this also has a nested radical + # form but we are not calculating + # that. + "(-1)^(1/3)*2^(1/4)", + #"(-1)^(1/3)*2^(1/4)", + "1/2*2^(1/4)+1/2*i*2^(1/4)*3^(1/2)", + + "(-1)^(1/2)", + "i", + + "sqrt(1000000)", + "1000", + + "sqrt(-1000000)", + "1000*i", + + "sqrt(2^60)", + "1073741824", + + # this is why we factor irrationals + + "6^(1/3) 3^(2/3)", + "3*2^(1/3)", + + # inverse of complex numbers + + "1/(2+3*i)", + "2/13-3/13*i", + + "1/(2+3*i)^2", + "-5/169-12/169*i", + + "(-1+3i)/(2-i)", + "-1+i", + + # other + + "(0.0)^(0.0)", + "1.0", + + "(-4.0)^(0.5)", + "2.0*i", + + "(-4.0)^(-0.5)", + "-0.5*i", + + "(-4.0)^(-1.5)", + "0.125*i", + + # more complex number cases + + "(1+i)^2", + "2*i", + + "(1+i)^(-2)", + "-1/2*i", + + "(1+i)^(1/2)", + #"(-1)^(1/8)*2^(1/4)", + "i*2^(1/4)*sin(1/8*pi)+2^(1/4)*cos(1/8*pi)", + + "(1+i)^(-1/2)", + "-(-1)^(7/8)/(2^(1/4))", + + "(1+i)^(0.5)", + "1.098684...+0.455090...*i", + + "(1+i)^(-0.5)", + "0.776887...-0.321797...*i", + + # test cases for simplification of polar forms, counterclockwise + + "exp(i*pi/2)", + "i", + + "exp(i*pi)", + "-1", + + "exp(i*3*pi/2)", + "-i", + + "exp(i*2*pi)", + "1", + + "exp(i*5*pi/2)", + "i", + + "exp(i*3*pi)", + "-1", + + "exp(i*7*pi/2)", + "-i", + + "exp(i*4*pi)", + "1", + + "exp(A+i*pi/2)", + "i*exp(A)", + + "exp(A+i*pi)", + "-exp(A)", + + "exp(A+i*3*pi/2)", + "-i*exp(A)", + + "exp(A+i*2*pi)", + "exp(A)", + + "exp(A+i*5*pi/2)", + "i*exp(A)", + + "exp(A+i*3*pi)", + "-exp(A)", + + "exp(A+i*7*pi/2)", + "-i*exp(A)", + + "exp(A+i*4*pi)", + "exp(A)", + + # test cases for simplification of polar forms, clockwise + + "exp(-i*pi/2)", + "-i", + + "exp(-i*pi)", + "-1", + + "exp(-i*3*pi/2)", + "i", + + "exp(-i*2*pi)", + "1", + + "exp(-i*5*pi/2)", + "-i", + + "exp(-i*3*pi)", + "-1", + + "exp(-i*7*pi/2)", + "i", + + "exp(-i*4*pi)", + "1", + + "exp(A-i*pi/2)", + "-i*exp(A)", + + "exp(A-i*pi)", + "-exp(A)", + + "exp(A-i*3*pi/2)", + "i*exp(A)", + + "exp(A-i*2*pi)", + "exp(A)", + + "exp(A-i*5*pi/2)", + "-i*exp(A)", + + "exp(A-i*3*pi)", + "-exp(A)", + + "exp(A-i*7*pi/2)", + "i*exp(A)", + + "exp(A-i*4*pi)", + "exp(A)", + ] diff --git a/node_modules/algebrite/tests/printlatex.coffee b/node_modules/algebrite/tests/printlatex.coffee new file mode 100644 index 0000000..ad87835 --- /dev/null +++ b/node_modules/algebrite/tests/printlatex.coffee @@ -0,0 +1,116 @@ +test_printlatex = -> + run_test [ + + "printlatex(pi/2)", + "\\frac{\\pi}{2}", + + "printlatex(-pi/2)", + "-\\frac{\\pi}{2}", + + "printlatex(pi/(-2))", + "-\\frac{\\pi}{2}", + + "printlatex(-pi/(-2))", + "\\frac{\\pi}{2}", + + "printlatex((1/2)*pi)", + "\\frac{\\pi}{2}", + + "printlatex((1/(-2))*pi)", + "-\\frac{\\pi}{2}", + + # note that these two are different: + # pi^(1/2) != pi^1/2 + "printlatex(pi^(1/2))", + "\\sqrt{\\pi}", + + "printlatex(1/x+x^3+1+1)", + "2+\\frac{1}{x}+x^3", + + "lastlatexprint == \"2+\\frac{1}{x}+x^3\"", + "1", + + "printlatex(quote(1/x+1+1))", + "\\frac{1}{x}+1+1", + + "printlatex(quote(defint(a,y,-sqrt(1-x^2),sqrt(1-x^2))))", + "\\int^{\\sqrt{1-x^2} }_{-\\sqrt{1-x^2} } \\! a \\, \\mathrm{d} y", + + "printlatex(1/(x+1))", + "\\frac{1}{1+x}", + + "printlatex(1/(x+1)^2)", + "\\frac{1}{(1+x)^2}", + + "printlatex(quote(1/(2*a*(x+1))))", + "\\frac{1}{2a(x+1)}", + + "printlatex(j^k^l^m)", + "j^{k^{l^m}}", + + "printlatex(dot(a,b))", + "a \\cdot b", + + "printlatex(inner(a,b))", + "a \\cdot b", + + "printlatex(inv(a))", + "{a}^{-1}", + + "printlatex(inv(a+1))", + "{(1+a)}^{-1}", + + "printlatex(12x^11)", + "12x^{11}", + + # tricky when there are two consecutive + # numbers, can't just leave a space there. + "printlatex(5^2 * 3^y)", + "25 \\cdot 3^y", + + "printlatex(5^2 * 3^(1/2))", + "25\\sqrt{3}", + + "printlatex(5^2 * 3^(2/3))", + "25\\sqrt[3]{3^2}", + + "printlatex([[0,1],[1,0]])", + "\\begin{bmatrix} 0 & 1 \\\\ 1 & 0 \\end{bmatrix}", + + "printlatex([0,1])", + "\\begin{bmatrix} 0 & 1 \\end{bmatrix}", + + "printlatex([[0,1,2],[3,4,5]])", + "\\begin{bmatrix} 0 & 1 & 2 \\\\ 3 & 4 & 5 \\end{bmatrix}", + + "printlatex([[a]])", + "\\begin{bmatrix} a \\end{bmatrix}", + + "printlatex([[0],[1]])", + "\\begin{bmatrix} 0 \\\\ 1 \\end{bmatrix}", + + "printlatex(quote(sum((-1)^k * (1/(2*k + 1)),k,0,100)*4))", + "\\sum_{k=0}^{100}{\\frac{(-1)^k}{(2k+1)}}4", + + "printlatex(quote(2*product(4*k^2/(4*k^2-1),k,1,100)))", + "2\\prod_{k=1}^{100}{\\frac{4k^2}{(4k^2-1)}}", + + "printlatex(quote(a==b))", + "{a} = {b}", + + "printlatex(quote(ab))", + "{a} > {b}", + + "printlatex(quote(a>=b))", + "{a} \\geq {b}", + + "printlatex(quote(f(x)=test(x<3,-x-4,3<=x,x*x+7,120/x+5)))", + "f(x)=\\left\\{ \\begin{array}{ll}{-x-4} & if & {x} < {3} \\\\\\\\{xx+7} & if & {3} \\leq {x} \\\\\\\\{\\frac{120}{x}+5} & otherwise \\end{array} \\right.", + + ] diff --git a/node_modules/algebrite/tests/product.coffee b/node_modules/algebrite/tests/product.coffee new file mode 100644 index 0000000..91a99c4 --- /dev/null +++ b/node_modules/algebrite/tests/product.coffee @@ -0,0 +1,38 @@ +test_product = -> + run_test [ + + # compute pi using Viete's formula ------------ + + # note that this is not an array, this + # defines a recursive function + "a(n)=test(n=0,0,sqrt(2+a(n-1)))", + "", + + # not very efficient because evaluation of + # a(n) is not memoized, so there + # is quadratic cost as n increases. + "float(2*product(2/a(k),k,1,9))", + "3.141588...", + + + # Wallis' product + "2*product(float(4*k^2/(4*k^2-1)),k,1,100)", + "3.133787...", + + # --------------------------- + "f(a,b)=product(k,k,a,b)", + "", + + "f(1,2)", + "2", + + # --- cleanup + + "a = quote(a)", + "", + + "f = quote(f)", + "", + + + ] diff --git a/node_modules/algebrite/tests/quickfactor.coffee b/node_modules/algebrite/tests/quickfactor.coffee new file mode 100644 index 0000000..2751af7 --- /dev/null +++ b/node_modules/algebrite/tests/quickfactor.coffee @@ -0,0 +1,34 @@ +test_quickfactor = -> + i = 0 + logout("testing quickfactor\n") + for i in [2...10001] + if i % 1000 == 0 + console.log i + base = i + push_integer(base) + push_integer(1) + quickfactor() + h = tos + j = 0 + while (base > 1) + expo = 0 + while (base % primetab[j] == 0) + base /= primetab[j] + expo++ + if (expo) + push_integer(primetab[j]) + push_integer(expo) + quickpower() + j++ + multiply_all(tos - h) + p2 = pop() + p1 = pop() + if (!equal(p1, p2)) + logout("failed\n") + print_lisp(p1) + print_lisp(p2) + errout() + console.log "quickfactor is ok" + logout("ok\n") + +#endif diff --git a/node_modules/algebrite/tests/quotient.coffee b/node_modules/algebrite/tests/quotient.coffee new file mode 100644 index 0000000..5a11aae --- /dev/null +++ b/node_modules/algebrite/tests/quotient.coffee @@ -0,0 +1,8 @@ +test_quotient = -> + run_test [ + "quotient(x^2+1,x+1)-x+1", + "0", + + "quotient(a*x^2+b*x+c,d*x+e)-(-a*e/(d^2)+a*x/d+b/d)", + "0", + ] diff --git a/node_modules/algebrite/tests/rationalize.coffee b/node_modules/algebrite/tests/rationalize.coffee new file mode 100644 index 0000000..8ae7f5a --- /dev/null +++ b/node_modules/algebrite/tests/rationalize.coffee @@ -0,0 +1,19 @@ +test_rationalize = -> + run_test [ + + "rationalize(a/b+c/d)", + "(a*d+b*c)/(b*d)", + + "rationalize(t*y/(t+y)+2*t^2*y*(2*t+y)^(-2))", + "t*y*(6*t^2+y^2+6*t*y)/((t+y)*(2*t+y)^2)", + + "rationalize(x^(-2*a)+x^(-4*a))", + "(1+x^(2*a))/(x^(4*a))", + + "rationalize(x^(1/3)+x^(2/3))", + "x^(1/3)*(1+x^(1/3))", + + "rationalize(rect(-(-1)^(3/4)))", + "(1-i)/(2^(1/2))", + + ] diff --git a/node_modules/algebrite/tests/real.coffee b/node_modules/algebrite/tests/real.coffee new file mode 100644 index 0000000..ef477df --- /dev/null +++ b/node_modules/algebrite/tests/real.coffee @@ -0,0 +1,15 @@ +test_real = -> + run_test [ + + "real(a+i*b)", + "a", + + "real(1+exp(i*pi/3))", + "3/2", + + "real(i)", + "0", + + "real((-1)^(1/3))", + "1/2", + ] diff --git a/node_modules/algebrite/tests/rect.coffee b/node_modules/algebrite/tests/rect.coffee new file mode 100644 index 0000000..8f77a26 --- /dev/null +++ b/node_modules/algebrite/tests/rect.coffee @@ -0,0 +1,65 @@ +test_rect = -> + run_test [ + + # check when not assuming real variables ---------- + "assumeRealVariables = 0", + "", + + "rect(a)", + "rect(a)", + + # same as rect(a) + i*rect(b) + # where rect(b) is abs(b)*(cos(arg(b)) + i*sin(arg(b))) + "rect(a+i*b)", + "rect(a)-abs(b)*sin(arg(b))+i*abs(b)*cos(arg(b))", + + "assumeRealVariables = 1", + "", + # -------------------------------------------------- + + "rect(a)", + "a", + + "rect(a+i*b)", + "a+i*b", + + "rect(exp(a+i*b))", + "i*exp(a)*sin(b)+exp(a)*cos(b)", + + "rect(1+exp(i*pi/3))", + "3/2+1/2*i*3^(1/2)", + + "z=(a+b*i)/(c+d*i)", + "", + + "rect(z)-real(z)-i*imag(z)", + "0", + + "z=quote(z)", + "", + + "rect((-1)^(2/3))", + "-1/2+1/2*i*3^(1/2)", + + "rect(exp(-3/4*i*pi))", + "-1/2*2^(1/2)-1/2*i*2^(1/2)", + + "rect(exp(-1/4*i*pi))", + "1/2*2^(1/2)-1/2*i*2^(1/2)", + + "rect(exp(-2/4*i*pi))", + "-i", + + "rect(exp(-3/4*i*pi))", + "-1/2*2^(1/2)-1/2*i*2^(1/2)", + + "rect(exp(-4/4*i*pi))", + "-1", + + "rect(((-1)^(1/2)/(3^(1/2)))^(1/2))", + "i*2^(1/2)/(2*3^(1/4))+2^(1/2)/(2*3^(1/4))", + + "rect((-1)^(1/6) - (-1)^(5/6))", + "3^(1/2)", + + ] diff --git a/node_modules/algebrite/tests/roots.coffee b/node_modules/algebrite/tests/roots.coffee new file mode 100644 index 0000000..50ba912 --- /dev/null +++ b/node_modules/algebrite/tests/roots.coffee @@ -0,0 +1,759 @@ +test_roots = -> + run_test [ + + "roots(x)", + "0", + + "roots(2^x-y,y)", + "2^x", + + "roots(x^2)", + "0", + + "roots(x^3)", + "0", + + "roots(2 x)", + "0", + + "roots(2 x^2)", + "0", + + "roots(i*x^2-13*i*x+36*i)", + "[4,9]", + + "roots(2 x^3)", + "0", + + "roots(6+11*x+6*x^2+x^3)", + "[-3,-2,-1]", + + "roots(a*x^2+b*x+c)", + #"[-b/(2*a)-(-4*a*c+b^2)^(1/2)/(2*a),-b/(2*a)+(-4*a*c+b^2)^(1/2)/(2*a)]", + "[-1/2*(b^2/(a^2)-4*c/a)^(1/2)-b/(2*a),1/2*(b^2/(a^2)-4*c/a)^(1/2)-b/(2*a)]", + + "roots(3+7*x+5*x^2+x^3)", + "[-3,-1]", + + "roots(x^3+x^2+x+1)", + "[-1,-i,i]", + + "roots(x^2==1)", + "[-1,1]", + + "roots(3 x + 12 == 24)", + "4", + + "y=roots(x^2+b*x+c/k)[1]", + "", + + "y^2+b*y+c/k", + "0", + + "y=roots(x^2+b*x+c/k)[2]", + "", + + "y^2+b*y+c/k", + "0", + + "y=roots(a*x^2+b*x+c/4)[1]", + "", + + "a*y^2+b*y+c/4", + "0", + + "y=roots(a*x^2+b*x+c/4)[2]", + "", + + "a*y^2+b*y+c/4", + "0", + + "y=quote(y)", + "", + + # -------------------------------------------- + # examples covering https://github.com/davidedc/Algebrite/issues/130 + + "roots(-2*z+x^2+y^2,z)", + "1/2*x^2+1/2*y^2", + + "roots(-2*z+x^2+y^2,z)", + "1/2*x^2+1/2*y^2", + + "roots(x+y+z)", + "-y-z", + + "roots(x+y+z,z)", + "-x-y", + + "roots(x+y+a,z)", + "Stop: roots: 1st argument is not a polynomial in the variable z", + + "clearall", + "", + + # -------------------------------------------- + # some more tests with 3rd degree polynomials + # including use of cubic formula. + # Only the ones marked "DOES use cubic formula" + # actually do so, all other examples manage to + # be reduced via factoring. + # -------------------------------------------- + + "roots(x^3 + x^2 + x + 1)", + "[-1,-i,i]", + + "roots(2*x^3 + 3*x^2 - 11*x - 6)", + "[-3,-1/2,2]", + + "roots(x^3 - 7*x^2 + 4*x + 12)", + "[-1,2,6]", + + "roots(x^3 + 1)", + "[-1,1/2-1/2*i*3^(1/2),1/2+1/2*i*3^(1/2)]", + # also: "[-1,-(-1)^(2/3),(-1)^(1/3))", + + "roots(x^3 - 1)", + "[1,-1/2-1/2*i*3^(1/2),-1/2+1/2*i*3^(1/2)]", + # also: "[1,-(-1)^(1/3),(-1)^(2/3))", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = x^3 + d", + "", + + "roots(thePoly)", + # also OK: + # "[-d^(1/3),1/2*d^(1/3)*(1-i*3^(1/2)),1/2*d^(1/3)*(1+i*3^(1/2)))", + # or "[-(-1)^(2/3)*d^(1/3),-d^(1/3),(-1)^(1/3)*d^(1/3))", + "[1/2*d^(1/3)-1/2*i*3^(1/2)*d^(1/3),1/2*d^(1/3)+1/2*i*3^(1/2)*d^(1/3),-d^(1/3)]", + + "and((simplify(subst(last[1],x,thePoly)) == 0),(simplify(subst(last[2],x,thePoly)) == 0),(simplify(subst(last[3],x,thePoly)) == 0))", + "1", + + # DOES use cubic formula + # the actual format of this solution might change, the important thing + # is that the next few tests work, where we plug in the + # symbolic solutions in the polynomial again and we check that we + # get the zeroes. + + "clearall", + "", + + "thePoly = a*x^3 + b*x^2 + c*x + d", + "", + + "roots(thePoly)", + "[-1/3*(1/2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^3/(a^3)+729*d^2/(a^2))^(1/2)+b^3/(a^3)-9*b*c/(2*a^2)+27*d/(2*a))^(1/3)-1/2*a*c+1/6*b^2+1/2*i*3^(1/2)*a*c+1/6*i*3^(1/2)*a^2*(1/2*(-27*b^2*c^2/(a^4)+108*b^3*d/(a^4)-486*b*c*d/(a^3)+108*c^3/(a^3)+729*d^2/(a^2))^(1/2)+b^3/(a^3)-9*b*c/(2*a^2)+27*d/(2*a))^(2/3)-1/6*i*3^(1/2)*b^2+1/6*a^2*(1/2*(-27*b^2*c^2/(a^4)+108*b^3*d/(a^4)-486*b*c*d/(a^3)+108*c^3/(a^3)+729*d^2/(a^2))^(1/2)+b^3/(a^3)-9*b*c/(2*a^2)+27*d/(2*a))^(2/3))/(a^2*(1/2*(-27*b^2*c^2/(a^4)+108*b^3*d/(a^4)-486*b*c*d/(a^3)+108*c^3/(a^3)+729*d^2/(a^2))^(1/2)+b^3/(a^3)-9*b*c/(2*a^2)+27*d/(2*a))^(1/3))]", + + "and((simplify(subst(last[1],x,thePoly)) == 0),(simplify(subst(last[2],x,thePoly)) == 0),(simplify(subst(last[3],x,thePoly)) == 0))", + "1", + + "roots(x^3 + 6x - 20)", + "[2,-1-3*i,-1+3*i]", + + "roots(x^3 - 6x - 40)", + "[4,-2-i*2^(1/2)*3^(1/2),-2+i*2^(1/2)*3^(1/2)]", + + "roots(x^3 + x^2 - 5x - 5)", + "[-1,-5^(1/2),5^(1/2)]", + + "roots(x^3 - 8x + 3)", + "[-3,3/2-1/2*5^(1/2),3/2+1/2*5^(1/2)]", + + "roots(x^3 - 8x - 3)", + "[3,-3/2-1/2*5^(1/2),-3/2+1/2*5^(1/2)]", + + "roots(x^3 - 18x + 35)", + "[-5,5/2-1/2*i*3^(1/2),5/2+1/2*i*3^(1/2)]", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = x^3 - 3x + 1", + "", + + "roots(thePoly)", + "[-(-1)^(1/9)+(-1)^(8/9),1/2*cos(1/9*pi)-1/2*cos(8/9*pi)+1/2*i*sin(1/9*pi)-1/2*i*sin(8/9*pi)-3^(1/2)*cos(11/18*pi),1/2*cos(1/9*pi)-1/2*cos(8/9*pi)+1/2*i*sin(1/9*pi)-1/2*i*sin(8/9*pi)+3^(1/2)*cos(11/18*pi)]", + # also: "[(3+1/3*(27/2+27/2*i*3^(1/2))^(2/3)-3*i*3^(1/2)+1/3*i*3^(1/2)*(27/2+27/2*i*3^(1/2))^(2/3))/(2*(27/2+27/2*i*3^(1/2))^(1/3)),(3+1/3*(27/2+27/2*i*3^(1/2))^(2/3)+3*i*3^(1/2)-1/3*i*3^(1/2)*(27/2+27/2*i*3^(1/2))^(2/3))/(2*(27/2+27/2*i*3^(1/2))^(1/3)),(-3-1/3*(27/2+27/2*i*3^(1/2))^(2/3))/((27/2+27/2*i*3^(1/2))^(1/3)))", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))))", + "1", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = x^3 - 3x - 1", + "", + + "roots(thePoly)", + "[-(-1)^(2/9)+(-1)^(7/9),1/2*cos(2/9*pi)-1/2*cos(7/9*pi)+1/2*i*sin(2/9*pi)-1/2*i*sin(7/9*pi)-3^(1/2)*cos(13/18*pi),1/2*cos(2/9*pi)-1/2*cos(7/9*pi)+1/2*i*sin(2/9*pi)-1/2*i*sin(7/9*pi)+3^(1/2)*cos(13/18*pi)]", + # also: "[(3+1/3*(-27/2+27/2*i*3^(1/2))^(2/3)-3*i*3^(1/2)+1/3*i*3^(1/2)*(-27/2+27/2*i*3^(1/2))^(2/3))/(2*(-27/2+27/2*i*3^(1/2))^(1/3)),(3+1/3*(-27/2+27/2*i*3^(1/2))^(2/3)+3*i*3^(1/2)-1/3*i*3^(1/2)*(-27/2+27/2*i*3^(1/2))^(2/3))/(2*(-27/2+27/2*i*3^(1/2))^(1/3)),(-3-1/3*(-27/2+27/2*i*3^(1/2))^(2/3))/((-27/2+27/2*i*3^(1/2))^(1/3)))", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))))", + "1", + + "roots(x^3 - 15x - 4)", + "[4,-2-3^(1/2),-2+3^(1/2)]", + + "roots(2*x^3 - 4x^2 - 22*x + 24)", + "[-3,1,4]", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 3*x^3 - 10*x^2 - 14*x + 27", + "", + + "roots(thePoly)", + "[1/3*(10/3-226/(9*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3))-(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3)),1/3*(10/3+113/(9*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3))+1/2*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3)-113*i*3^(1/2)/(9*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3))+1/2*i*3^(1/2)*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3)),1/3*(10/3+113/(9*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3))+1/2*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3)+113*i*3^(1/2)/(9*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3))-1/2*i*3^(1/2)*(781/54+i*97^(1/2)*1933^(1/2)/(2*3^(1/2)))^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(10^(-13))),(abs(float(subst(float(last[2]),x,thePoly))) < float(10^(-13))), (abs(float(subst(float(last[3]),x,thePoly))) < float(10^(-13))))", + "1", + + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 1*x^3 + 6*x^2 - 12*x + 8", + "", + + "roots(thePoly)", + "[-2+2^(1/3)+2^(2/3)-i*2^(1/3)*3^(1/2)+i*2^(2/3)*3^(1/2),-2+2^(1/3)+2^(2/3)+i*2^(1/3)*3^(1/2)-i*2^(2/3)*3^(1/2),-2*(1+2^(1/3)+2^(2/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-14))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-14))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-14))))", + "1", + + + "roots(1*x^3 + 6*x^2 + 12*x + 8)", + "-2", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 1*x^3 + 0*x^2 + 12*x - 10", + "", + + "roots(thePoly)", + "[(-6+1/6*(-135+27*89^(1/2))^(2/3)-6*i*3^(1/2)-1/6*i*3^(1/2)*(-135+27*89^(1/2))^(2/3))/((-135+27*89^(1/2))^(1/3)),(-6+1/6*(-135+27*89^(1/2))^(2/3)+6*i*3^(1/2)+1/6*i*3^(1/2)*(-135+27*89^(1/2))^(2/3))/((-135+27*89^(1/2))^(1/3)),(12-1/3*(-135+27*89^(1/2))^(2/3))/((-135+27*89^(1/2))^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-14))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-14))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-14))))", + "1", + + "roots(1*x^3 + 0*x^2 - 18*x + 35)", + "[-5,5/2-1/2*i*3^(1/2),5/2+1/2*i*3^(1/2)]", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 1*x^3 + 0*x^2 - 3*x - 6", + "", + + "roots(thePoly)", + "[(3+1/3*(-81+54*2^(1/2))^(2/3)-3*i*3^(1/2)+1/3*i*3^(1/2)*(-81+54*2^(1/2))^(2/3))/(2*(-81+54*2^(1/2))^(1/3)),(3+1/3*(-81+54*2^(1/2))^(2/3)+3*i*3^(1/2)-1/3*i*3^(1/2)*(-81+54*2^(1/2))^(2/3))/(2*(-81+54*2^(1/2))^(1/3)),(-3-1/3*(-81+54*2^(1/2))^(2/3))/((-81+54*2^(1/2))^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-14))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-14))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-14))))", + "1", + + "roots(2*x^3 - 30*x^2 + 162*x - 350)", + "[7,4-3*i,4+3*i]", + + "roots(1*x^3 - 4*x^2 - 6*x + 5)", + "[5,-1/2-1/2*5^(1/2),-1/2+1/2*5^(1/2)]", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 3*x^3 + 6*x^2 + 4*x + 9", + "", + + "roots(thePoly)", + "[1/3*(-2-73^(1/3)),1/3*(-2+1/2*73^(1/3)-1/2*i*3^(1/2)*73^(1/3)),1/3*(-2+1/2*73^(1/3)+1/2*i*3^(1/2)*73^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-14))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-14))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-14))))", + "1", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 3*x^3 + 21*x^2 + 2*x + 3", + "", + + "roots(thePoly)", + "[1/3*(-7-47/((671/2+1/2*34949^(1/2))^(1/3))-(671/2+1/2*34949^(1/2))^(1/3)),1/3*(-7+47/(2*(671/2+1/2*34949^(1/2))^(1/3))+1/2*(671/2+1/2*34949^(1/2))^(1/3)-47*i*3^(1/2)/(2*(671/2+1/2*34949^(1/2))^(1/3))+1/2*i*3^(1/2)*(671/2+1/2*34949^(1/2))^(1/3)),1/3*(-7+47/(2*(671/2+1/2*34949^(1/2))^(1/3))+1/2*(671/2+1/2*34949^(1/2))^(1/3)+47*i*3^(1/2)/(2*(671/2+1/2*34949^(1/2))^(1/3))-1/2*i*3^(1/2)*(671/2+1/2*34949^(1/2))^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(10^(-12))))", + "1", + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 3*x^3 - 6*x^2 + 4*x - 5", + "", + + "roots(thePoly)", + # also these ones could be sort of OK: + # "[2/3-1/3*(-1)^(1/3)*37^(1/3),2/3+1/6*(-1)^(1/3)*37^(1/3)-(-1)^(5/6)*37^(1/3)/(2*3^(1/2)),2/3+1/6*(-1)^(1/3)*37^(1/3)+(-1)^(5/6)*37^(1/3)/(2*3^(1/2)))", + # "[2/3-1/3*(-1)^(1/3)*37^(1/3),2/3-1/6*37^(1/3)+i*37^(1/3)/(2*3^(1/2)),2/3+1/3*37^(1/3))", + # "[1/3*(2-(-1)^(1/3)*37^(1/3)),1/3*(2-1/2*37^(1/3)+1/2*i*3^(1/2)*37^(1/3)),1/3*(2+37^(1/3)))", + "[2/3-1/3*(-1)^(1/3)*37^(1/3),1/3*(2-1/2*37^(1/3)+1/2*i*3^(1/2)*37^(1/3)),1/3*(2+37^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-14))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-14))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-14))))", + "1", + + "roots(8*x^3 - 36*x^2 + 54*x - 27)", + "3/2", + + "roots(3*x^3 - 5*x^2 - 1*x - 2)", + "[2,-1/6-1/6*i*11^(1/2),-1/6+1/6*i*11^(1/2)]", + + + "clearall", + "", + + # DOES use cubic formula + "thePoly = 3*x^3 - 6*x^2 + 4*x - i", + "", + + "roots(thePoly)", + "[1/3*(2-(8-9*i)^(1/3)),1/3*(2+1/2*(8-9*i)^(1/3)-1/2*i*3^(1/2)*(8-9*i)^(1/3)),1/3*(2+1/2*(8-9*i)^(1/3)+1/2*i*3^(1/2)*(8-9*i)^(1/3))]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))))", + "1", + + + "clearall", + "", + + # DOES use cubic formula + "thePoly = x^3+i", + "", + + "roots(thePoly)", + # also these could be OK: + # "[1/2*(-1)^(1/6)-1/2*(-1)^(2/3)*3^(1/2),-(-1)^(1/6),1/2*(-1)^(1/6)*(1+i*3^(1/2)))", + # "[-1/2*i+1/2*3^(1/2),-(-1)^(1/6),i)", + # "[-(-1)^(1/6),-(-1)^(5/6),i)", + "[-1/2*i-1/2*3^(1/2),-1/2*i+1/2*3^(1/2),i]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))))", + "1", + + + "clearall", + "", + + # DOES use cubic formula + "thePoly = x^3-i", + "", + + "roots(thePoly)", + # "[-i,1/2*(i-3^(1/2)),1/2*(i+3^(1/2)))", + # "[-i,(-1)^(1/6),(-1)^(5/6))", + "[-3/4*i-1/2*(-1)^(5/6)-1/4*3^(1/2),3/4*i-1/2*(-1)^(5/6)+1/4*3^(1/2),(-1)^(5/6)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))))", + "1", + + # some quartics + + "clearall", + "", + + "thePoly = x^4 + 1", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + # "[-(-1)^(1/4),-(-1)^(3/4),(-1)^(1/4),(-1)^(3/4))", + "[-1/2*2^(1/2)-1/2*i*2^(1/2),-1/2*2^(1/2)+1/2*i*2^(1/2),1/2*2^(1/2)-1/2*i*2^(1/2),1/2*2^(1/2)+1/2*i*2^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-15))))", + "1", + + "clearall", + "", + + "thePoly = 4*x^4 - 1*x^3 + 4*x^2 + 3*x + 5", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[1/16-1/2*(-125/96-447/(256*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2))-265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)-265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2)+1/2*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2),1/16-1/2*(-125/96+447/(256*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2))-265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)-265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2)-1/2*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2),1/16+1/2*(-125/96-447/(256*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2))-265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)-265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2)+1/2*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2),1/16+1/2*(-125/96+447/(256*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2))-265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)-265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2)-1/2*(-125/192+265/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))+1/3*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3)+265*i*3^(1/2)/(192*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))-1/3*i*3^(1/2)*(4417/1024+9/1024*i*461^(1/2)*1471^(1/2))^(1/3))^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = x^5 + 1", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + # "[-1,-(-1)^(2/5),-(-1)^(4/5),(-1)^(1/5),(-1)^(3/5))", + "[-1,cos(1/5*pi)+i*sin(1/5*pi),cos(3/5*pi)+i*sin(3/5*pi),-cos(2/5*pi)-i*sin(2/5*pi),-cos(4/5*pi)-i*sin(4/5*pi)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[5]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = a*x^5 + k", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots[1] = simplify(theRoots[1])", + "", + + "theRoots[1]", + "-(-1)^(2/5)*((k/a)^(2/5))^(1/2)", + + "theRoots[2] = simplify(theRoots[2])", + "", + + "theRoots[2]", + "-(-1)^(4/5)*((k/a)^(2/5))^(1/2)", + + "theRoots[3] = circexp(theRoots[3])", + "", + + "theRoots[3]", + "exp(1/5*i*pi)*(k/a)^(1/5)", + + "theRoots[4] = circexp(theRoots[4])", + "", + + "theRoots[4]", + "exp(3/5*i*pi)*(k/a)^(1/5)", + + "theRoots[5] = simplify(theRoots[5])", + "", + + "theRoots[5]", + "-(k/a)^(1/5)", + + # unfortunately the comparison here doesn't work, + # due to rounding errors float() produces expressions that still hve + # a and k, albeit with really small + # coefficients, and hence the "<" comparison finds variables with + # undefined values and + # fails. + + #"and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[5]),x,thePoly))) < float(2*10^(-12))))", + #"1", + + "clearall", + "", + + "thePoly = x^3 - 7*x^2 + 41*x - 87", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[3,2-5*i,2+5*i]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = 398683376+1720835*x+2320*x^2+x^3", + "", + + "theRoots = roots(thePoly)", + "", + + # root 1 ~= -961.79, root 2 ~= -895.12, root 3 ~= -463.09 + # all three of them have a very small "error" imaginary part ~= 10^-13 + "theRoots", + "[-2320/3-219895/(3*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3))-1/3*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3),-2320/3+219895/(6*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3))+1/6*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3)-219895*i*3^(1/2)/(6*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3))+1/6*i*3^(1/2)*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3),-2320/3+219895/(6*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3))+1/6*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3)+219895*i*3^(1/2)/(6*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3))-1/6*i*3^(1/2)*(-96123824+9*i*7^(1/2)*79^(1/2)*2297^(1/2)*13538519^(1/2))^(1/3)]", + + # the error here is particularly high because of the big coefficients + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-7))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-7))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-7))))", + "1", + + "clearall", + "", + + "thePoly = x^4 - 1*x^3 + 4*x^2 + 3*x + 5", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-1/2-1/2*i*3^(1/2),-1/2+1/2*i*3^(1/2),1-2*i,1+2*i]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = x^4 - 2*x^3 - 7*x^2 + 8*x + 12", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-2,-1,2,3]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = x^4+8*x^2+3", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-(-4-13^(1/2))^(1/2),-(-4+13^(1/2))^(1/2),(-4-13^(1/2))^(1/2),(-4+13^(1/2))^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = -1*x^3-1*x^2+10*x - 8", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-4,1,2]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = -3-9*x+3*x^2+x^3", + "", + + "theRoots = roots(thePoly)", + "", + + # these solutions are slightly verbose but they are essentially good, + # take into account that ((108+108*i*3^(1/2))^(1/3)) is + # really just a compact version (in terms of number of nodes) + # for 3*2^(2/3)*(1+i*sqrt(3))^(1/3) + # (just take out 108 from the radical, and 108 is 2x2x3x3x3) + # so essentially these are written a little redundantly but + # they actually are in pretty good form. + "theRoots", + # "[-1-12/((108+108*i*3^(1/2))^(1/3))-1/3*(108+108*i*3^(1/2))^(1/3),-1+6/((108+108*i*3^(1/2))^(1/3))+1/6*(108+108*i*3^(1/2))^(1/3)-6*i*3^(1/2)/((108+108*i*3^(1/2))^(1/3))+1/6*i*3^(1/2)*(108+108*i*3^(1/2))^(1/3),-1+6/((108+108*i*3^(1/2))^(1/3))+1/6*(108+108*i*3^(1/2))^(1/3)+6*i*3^(1/2)/((108+108*i*3^(1/2))^(1/3))-1/6*i*3^(1/2)*(108+108*i*3^(1/2))^(1/3))", + "[-1+cos(1/9*pi)-cos(8/9*pi)+i*sin(1/9*pi)-i*sin(8/9*pi)-2*3^(1/2)*cos(11/18*pi),-1+cos(1/9*pi)-cos(8/9*pi)+i*sin(1/9*pi)-i*sin(8/9*pi)+2*3^(1/2)*cos(11/18*pi),-1-2*cos(1/9*pi)+2*cos(8/9*pi)-2*i*sin(1/9*pi)+2*i*sin(8/9*pi)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = x^4 + 8*x^3 + 12*x^2 + (2*30^(1/2) -16)*x + 4*30^(1/2)-28", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-2-1/2*(18-4*5^(1/2))^(1/2)+3^(1/2)/(2^(1/2)),-2-1/2*(18+4*5^(1/2))^(1/2)-1/2*2^(1/2)*3^(1/2),-2+1/2*(18-4*5^(1/2))^(1/2)+3^(1/2)/(2^(1/2)),-2+1/2*(18+4*5^(1/2))^(1/2)-1/2*2^(1/2)*3^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = x^3 + x - 2", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[1,-1/2-1/2*i*7^(1/2),-1/2+1/2*i*7^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))))", + "1", + + + "clearall", + "", + + "thePoly = x^3 + x^2 - 7", + "", + + "theRoots = roots(thePoly)", + "", + + # note how we can't use "last" here because the assignment returns nothing + "and(abs(float(subst(theRoots[1],x,thePoly))) < float(2*10^(-12)),abs(float(subst(theRoots[2],x,thePoly))) < float(2*10^(-12)),abs(float(subst(theRoots[3],x,thePoly))) < float(2*10^(-12)))", + "1", + + # some quartics + + "clearall", + "", + + "thePoly = x^4 + 8*x^2 + 3", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-(-4-13^(1/2))^(1/2),-(-4+13^(1/2))^(1/2),(-4-13^(1/2))^(1/2),(-4+13^(1/2))^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(8*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(8*10^(-15))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-15))))", + "1", + + "clearall", + "", + + "thePoly = x^4 - 10*x^3 + 21*x^2 + 40*x - 100", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-2,2,5]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = 2*x^4 - 8*x^3 + 2*x^2 + 24*x - 14", + "", + + "theRoots = roots(thePoly)", + "", + + "clearall", + "", + + "thePoly = x^4 - 4*x^3 + x^2 + 12*x - 7", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-1/2-1/2*5^(1/2),-1/2+1/2*5^(1/2),5/2-1/2*i*3^(1/2),5/2+1/2*i*3^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = 2*x^4 - 8*x^3 + 2*x^2 + 24*x - 14", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-1/2-1/2*5^(1/2),-1/2+1/2*5^(1/2),5/2-1/2*i*3^(1/2),5/2+1/2*i*3^(1/2)]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + "clearall", + "", + + "thePoly = x^4 - 9*x^3 + 22*x^2 + 28*x - 120", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-2,3,4-2*i,4+2*i]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + "1", + + + #"thePoly = 4* x^4 - 9*x^3 + 22*x^2 + 28*x - 120", + #"", + # + # these are really ugly - sympy or wolfram alpha don't give clean symbolic solutions either + #"theRoots = roots(thePoly)", + #"", + # + #"and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + #"1", + # + #"thePoly = -20*x^4 + 5*x^3 + 17*x^2 - 29*x + 87", + #"", + # + # these are really ugly - sympy or wolfram alpha don't give clean symbolic solutions either + #"theRoots = roots(thePoly)", + #"", + # + #"and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-12))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-12))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-12))))", + #"1", + # + + "clearall", + "", + + "thePoly = x^4 + 2*x^3 - 41*x^2 - 42*x + 360", + "", + + "theRoots = roots(thePoly)", + "", + + "theRoots", + "[-6,-4,3,5]", + + "and((abs(float(subst(float(last[1]),x,thePoly))) < float(2*10^(-15))),(abs(float(subst(float(last[2]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[3]),x,thePoly))) < float(2*10^(-15))), (abs(float(subst(float(last[4]),x,thePoly))) < float(2*10^(-15))))", + "1", + + + + # clean up + "thePoly = quote(thePoly)", + "", + + "theRoots = quote(theRoots)", + "", + + ] diff --git a/node_modules/algebrite/tests/round.coffee b/node_modules/algebrite/tests/round.coffee new file mode 100644 index 0000000..fbae2e4 --- /dev/null +++ b/node_modules/algebrite/tests/round.coffee @@ -0,0 +1,80 @@ +test_round = -> + run_test [ + "round(a)", + "round(a)", + + "round(a+b)", + "round(a+b)", + + "round(5/2)", + "3", + + "round(5/2 - 1/10)", + "2", + + "round(4/2)", + "2", + + "round(3/2)", + "2", + + "round(2/2)", + "1", + + "round(1/2)", + "1", + + "round(0/2)", + "0", + + "round(-1/2)", + "0", + + "round(-2/2)", + "-1", + + "round(-3/2)", + "-1", + + "round(-4/2)", + "-2", + + "round(-5/2)", + "-2", + + "round(-5/2 + 1/10)", + "-2", + + "round(5/2) - round(5/2.0)", + "0.0", + + "round(4/2) - round(4/2.0)", + "0.0", + + "round(3/2) - round(3/2.0)", + "0.0", + + "round(2/2) - round(2/2.0)", + "0.0", + + "round(1/2) - round(1/2.0)", + "0.0", + + "round(0.0)", + "0.0", + + "round(-1/2) - round(-1/2.0)", + "0.0", + + "round(-2/2) - round(-2/2.0)", + "0.0", + + "round(-3/2) - round(-3/2.0)", + "0.0", + + "round(-4/2) - round(-4/2.0)", + "0.0", + + "round(-5/2) - round(-5/2.0)", + "0.0", + ] diff --git a/node_modules/algebrite/tests/scan.coffee b/node_modules/algebrite/tests/scan.coffee new file mode 100644 index 0000000..5b51896 --- /dev/null +++ b/node_modules/algebrite/tests/scan.coffee @@ -0,0 +1,77 @@ +test_scan = -> + if DEBUG then console.log "test_scan ----------------------------" + + run_test [ + + "a^^b", + "a^^ ? b\nStop: syntax error", + + "(a+b", + "(a+b ? \nStop: ) expected", + + "quote(1/(x*log(a*x)))", # test case A + "1/(x*log(a*x))", + + "\"hello", + "\"hello ? \nStop: runaway string", + + # make sure question mark can appear after newlines + + "a+\nb+\nc+", + "a+\nb+\nc+ ? \nStop: syntax error", + + # this bug fixed in version 30 (used to give one result, 14) + + "(1+1)", + "2", + + "2+2\n(3+3)", + "4\n6", + + # plus and minus cannot cross newline + + "1\n-1", + "1\n-1", + + "1\n+1", + "1\n1", + + # implicit multiplication is parsed fine in + # in the obvious cases where the first factor + # is a "naked" number. Note that + # (2)(a) doesn't work (yet) instead. + # In many other cases such as a(b) it's in + # principle impossible at parse time to turn that + # into a multiplication because the first factor + # could be a function, so that'd be a function + # call. + + "2(a) * 2a", + "4*a^2", + + "2a3b", + "2*a3b", + + "2a 3b", + "6*a*b", + + "2 a 3b", + "6*a*b", + + "2 a 3 b", + "6*a*b", + + "2(a)3(b)", + "6*a*b", + + "2(a)b*3", + "6*a*b", + + "(a)2 * 2a", + "4*a^2", + + "3 (2 x^3 + x^2 - 23 x + 20)", + "6*x^3+3*x^2-69*x+60", + + ] + diff --git a/node_modules/algebrite/tests/sgn.coffee b/node_modules/algebrite/tests/sgn.coffee new file mode 100644 index 0000000..5497e43 --- /dev/null +++ b/node_modules/algebrite/tests/sgn.coffee @@ -0,0 +1,14 @@ +test_sgn = -> + run_test [ + + "sgn(-3)", + "-1", + + + "sgn(0)", + "0", + + "sgn(3)", + "1", + + ] diff --git a/node_modules/algebrite/tests/shape.coffee b/node_modules/algebrite/tests/shape.coffee new file mode 100644 index 0000000..b3f794c --- /dev/null +++ b/node_modules/algebrite/tests/shape.coffee @@ -0,0 +1,27 @@ +test_shape = -> + run_test [ + + # see transpose function source to see why + # transposition has no effect on vectors + # of dimension (rank) 1 + + "shape([A,B,C])", + "[3]", + + "shape(transpose([A,B,C]))", + "[3]", + + "shape([[A],[B],[C]])", + "[3,1]", + + "shape(transpose([[A],[B],[C]]))", + "[1,3]", + + "shape([[A,B],[C,D],[E,F]])", + "[3,2]", + + "shape(transpose([[A,B],[C,D],[E,F]]))", + "[2,3]", + + ] + diff --git a/node_modules/algebrite/tests/simplify.coffee b/node_modules/algebrite/tests/simplify.coffee new file mode 100644 index 0000000..ba04d69 --- /dev/null +++ b/node_modules/algebrite/tests/simplify.coffee @@ -0,0 +1,623 @@ +test_simplify = -> + run_test [ + + # the system normally tries to + # arrange polynomials in a normal + # form, without the need for simplify + "x+a*x", + "(1+a)*x", + + "simplify(A)", + "A", + + "simplify(A+B)", + "A+B", + + "simplify(A B)", + "A*B", + + "simplify(A^B)", + "A^B", + + "simplify(A/(A+B)+B/(A+B))", + "1", + + "simplify((A-B)/(B-A))", + "-1", + + "A=[[A11,A12],[A21,A22]]", + "", + + "simplify(det(A) inv(A) - adj(A))", + "0", + + "A=quote(A)", + "", + + "simplify(-3 exp(-1/3 r + i phi) cos(theta) / sin(theta)\ + + 3 exp(-1/3 r + i phi) cos(theta) sin(theta)\ + + 3 exp(-1/3 r + i phi) cos(theta)^3 / sin(theta))", + "0", + + "simplify((A^2 C^2 + A^2 D^2 + B^2 C^2 + B^2 D^2)/(A^2+B^2)/(C^2+D^2))", + "1", + + "simplify(d(arctan(y/x),y))", + "x/(x^2+y^2)", + + "simplify(d(arctan(y/x),x))", + "-y/(x^2+y^2)", + + "simplify(1-sin(x)^2)", + "cos(x)^2", + + "simplify(1-cos(x)^2)", + "sin(x)^2", + + "simplify(sin(x)^2-1)", + "-cos(x)^2", + + "simplify(cos(x)^2-1)", + "-sin(x)^2", + + # tries to get rid of sin and cos if there are more + # compact clockforms or exponential forms + "simplify(-cos(2/5*pi)*(k/a)^(1/5)-i*(k/a)^(1/5)*sin(2/5*pi))", + "((k/a)^(2/5))^(1/2)/((-1)^(3/5))", + + #"simfac(n!/n)-(n-1)!", + #"0", + + #"simfac(n/n!)-1/(n-1)!", + #"0", + + #"simfac(rationalize((n+k+1)/(n+k+1)!))-1/(n+k)!", + #"0", + + #"simfac(condense((n+1)*n!))-(n+1)!", + #"0", + + #"simfac(1/((n+1)*n!))-1/(n+1)!", + #"0", + + #"simfac((n+1)!/n!)-n-1", + #"0", + + #"simfac(n!/(n+1)!)-1/(n+1)", + #"0", + + #"simfac(binomial(n+1,k)/binomial(n,k))", + #"(1+n)/(1-k+n)", + + #"simfac(binomial(n,k)/binomial(n+1,k))", + #"(1-k+n)/(1+n)", + + #"F(nn,kk)=kk*binomial(nn,kk)", + #"", + + #"simplify(simfac((F(n,k)+F(n,k-1))/F(n+1,k))-n/(n+1))", + #"0", + + #"F=quote(F)", + #"", + + "simplify(n!/n)-(n-1)!", + "0", + + "simplify(n/n!)-1/(n-1)!", + "0", + + "simplify(rationalize((n+k+1)/(n+k+1)!))-1/(n+k)!", + "0", + + "simplify(condense((n+1)*n!))-(n+1)!", + "0", + + "simplify(1/((n+1)*n!))-1/(n+1)!", + "0", + + "simplify((n+1)!/n!)-n-1", + "0", + + "simplify(n!/(n+1)!)-1/(n+1)", + "0", + + "simplify(binomial(n+1,k)/binomial(n,k))", + "(1+n)/(1-k+n)", + + "simplify(binomial(n,k)/binomial(n+1,k))", + "(1-k+n)/(1+n)", + + "F(nn,kk)=kk*binomial(nn,kk)", + "", + + "simplify((F(n,k)+F(n,k-1))/F(n+1,k))-n/(n+1)", + "0", + + "F=quote(F)", + "", + + "simplify((n+1)/(n+1)!)-1/n!", + "0", + + "simplify(a*b+a*c)", + "a*(b+c)", + + # Symbol's binding is evaluated, undoing simplify + + "x=simplify(a*b+a*c)", + "", + + "x", + "a*b+a*c", + + "x=quote(x)", + "", + + "simplify((6 - 4*2^(1/2))^(1/2))", + "2-2^(1/2)", + + "4-4*(-1)^(1/3)+4*(-1)^(2/3)", + "0", + + "simplify(4-4*(-1)^(1/3)+4*(-1)^(2/3))", + "0", + + # this requires some simplification to be + # further done after the de-nesting + "simplify(14^(1/2) - (16 - 4*7^(1/2))^(1/2))", + "2^(1/2)", + + + "simplify(-(2^(1/2)*(-1+7^(1/2)))+2^(1/2)*7^(1/2))", + "2^(1/2)", + + + "simplify((9 + 6*2^(1/2))^(1/2))", + "3^(1/2)*(1+2^(1/2))", + + + "simplify((7 + 13^(1/2))^(1/2))", + "(1+13^(1/2))/(2^(1/2))", + + # two nested radicals at the same time + "simplify((17 + 12*2^(1/2))^(1/2) + (17 - 12*2^(1/2))^(1/2))", + "6", + + "simplify((2 + 3^(1/2))^(1/2))", + "(1+3^(1/2))/(2^(1/2))", + + "simplify((1/2 + (39^(1/2)/16))^(1/2))", + "(3^(1/2)+13^(1/2))/(4*2^(1/2))", + + # there would be a slightly better presentation for this, + # where 108 is factored and some parts get out of the + # radical but there is no way to de-nest this. + "simplify((-108+108*(-1)^(1/2)*3^(1/2))^(1/3))", + "6*(-1)^(2/9)", + # also: "(-108+108*i*3^(1/2))^(1/3)" is a possible result + + # you can take that 4 out of the radical + # but other than that there is no + # "sum or radicals" form of this + "simplify((-4+4*(-1)^(1/2)*3^(1/2))^(1/3))", + "2*(-1)^(2/9)", + # also: "(-4+4*i*3^(1/2))^(1/3)" is a possible result + + + # scrambling the order of things a little + # and checking whether the nested radical + # still gets simplified. + "simplify((((-3)^(1/2) + 1)/2)^(1/2))", + #"(-1)^(1/6)", + "1/2*(i+3^(1/2))", + + "simplify((1/2 + (-3)^(1/2)/2)^(1/2))", + #"(-1)^(1/6)", + "1/2*(i+3^(1/2))", + + # no possible de-nesting, should + # leave unchanged. + "simplify((2 +2^(1/2))^(1/2))", + "(2+2^(1/2))^(1/2)", + + "simplify((1 +3^(1/2)/2)^(1/2) + (1 -3^(1/2)/2)^(1/2))", + "3^(1/2)", + + "simplify((1 +3^(1/2)/2)^(1/2))", + "1/2*(1+3^(1/2))", + + # not quite perfect as there is a radical at the + # denominator, but the de-nesting happens. + "simplify(((1 +39^(1/2)/8)/2)^(1/2))", + "(3^(1/2)+13^(1/2))/(4*2^(1/2))", + + "simplify((5 +24^(1/2))^(1/2))", + "2^(1/2)+3^(1/2)", + + "simplify((3 +4*i)^(1/2))", + "2+i", + + "simplify((3 -4*i)^(1/2))", + "2-i", + + "simplify((-2 +2*3^(1/2)*i)^(1/2))", + #"2*(-1)^(1/3)", + "1+i*3^(1/2)", + + "simplify((9 - 4*5^(1/2))^(1/2))", + "-2+5^(1/2)", + + "simplify((61 - 24*5^(1/2))^(1/2))", + "-4+3*5^(1/2)", + + "simplify((-352+936*(-1)^(1/2))^(1/3))", + "2*(4+3*i)", + + + "simplify((3 - 2*2^(1/2))^(1/2))", + "-1+2^(1/2)", + + "simplify((27/2+27/2*(-1)^(1/2)*3^(1/2))^(1/3))", + "3*(-1)^(1/9)", + # also good: (27/2+27/2*i*3^(1/2))^(1/3) + + # this nested radical is also equal to + # (-1)^(1/9) + # but there is no "sum of radicals" form + # for this. + "simplify((1/2+1/2*(-1)^(1/2)*3^(1/2))^(1/3))", + "(-1)^(1/9)", + # also good: (1/2+1/2*i*3^(1/2))^(1/3) + + "simplify((2 + 5^(1/2))^(1/3))", + "1/2*(1+5^(1/2))", + + "simplify((-3 + 10*3^(1/2)*i/9)^(1/3))", + "1+2/3*i*3^(1/2)", + + "simplify((1-3*x^2+3*x^4-x^6)^(1/2))", + "(-x^6+3*x^4-3*x^2+1)^(1/2)", + + "simplify(subst((-1)^(1/2),i,(-3 + 10*3^(1/2)*i/9)^(1/3)))", + "1+2/3*i*3^(1/2)", + + "simplify(rationalize(-3 + 10*3^(1/2)*i/9)^(1/3))", + "1+2/3*i*3^(1/2)", + + # note that sympy doesn't give a straight symbolic answer to + # this one, the result to this is numeric instead, and with + # a near-zero imaginary part. + # In Sympy one can get to the answer obliquely with minpoly instead, + # as minpoly((-1)^(1/6) - (-1)^(5/6)) -> x^2−3 + "simplify((-1)^(1/6) - (-1)^(5/6))", + "3^(1/2)", + + "simplify((7208+2736*5^(1/2))^(1/3))", + "17+3*5^(1/2)", + + "simplify((901+342*5^(1/2))^(1/3))", + "1/2*(17+3*5^(1/2))", + + "-i*(-2*(-1)^(1/6)/(3^(1/2))+2*(-1)^(5/6)/(3^(1/2)))^(1/4)*(2*(-1)^(1/6)/(3^(1/2))-2*(-1)^(5/6)/(3^(1/2)))^(1/4)/(2^(1/2))", + "1/2^(1/2)-i/(2^(1/2))", + + "simplify(-i*(-2*(-1)^(1/6)/(3^(1/2))+2*(-1)^(5/6)/(3^(1/2)))^(1/4)*(2*(-1)^(1/6)/(3^(1/2))-2*(-1)^(5/6)/(3^(1/2)))^(1/4)/(2^(1/2)))", + # this one simplifies to any of these two, these are all the same: + "(1-i)/(2^(1/2))", + # -(-1)^(3/4) + #"-(-1)^(3/4)", + + "(-1)^(-5/a)", + #"(-1)^(-5/a)", + "1/(-1)^(5/a)", + + + # ----------------------- + "simplify((-1)^(-5))", + "-1", + + "simplify((-1)^(5))", + "-1", + + "simplify((1)^(-5))", + "1", + + "simplify((1)^(5))", + "1", + + # seems here that the simplification + # has more nodes than the result but + # it's not the case: the 1/... inversion + # is just done at the print level for + # legibility + "simplify((-1)^(-5/a))", + #"(-1)^(-5/a)", + "1/(-1)^(5/a)", + + "simplify((-1)^(5/a))", + "(-1)^(5/a)", + + "simplify((1)^(-5/a))", + "1", + + "simplify((1)^(5/a))", + "1", + + # ----------------------- + "simplify((-1)^(-6))", + "1", + + "simplify((-1)^(6))", + "1", + + "simplify((1)^(-6))", + "1", + + "simplify((1)^(6))", + "1", + + # clockform can be much more compact than the + # rectangular format so we return that one, + # the user can always do a rect or a circexp on + # the result if she desires other forms + "simplify(i*2^(1/4)*sin(1/8*pi)+2^(1/4)*cos(1/8*pi))", + "(-1)^(1/8)*2^(1/4)", + # the circexp of the above is + # 2^(1/4) exp(1/8 i pi), which is less compact + + + # seems here that the simplification + # has more nodes than the result but + # it's not the case: the 1/... inversion + # is just done at the print level for + "simplify((-1)^(-6/a))", + #"(-1)^(-6/a)", + "1/(-1)^(6/a)", + + "simplify((-1)^(6/a))", + "(-1)^(6/a)", + + "simplify((1)^(-6/a))", + "1", + + "simplify((1)^(6/a))", + "1", + + "simplify(transpose(A)*transpose(x))", + "transpose(A*x)", + + "simplify(inner(transpose(A),transpose(x)))", + "transpose(inner(x,A))", + + # --------------------------------------------- + # checking that simplify doesn't make incorrect + # simplifications + + "simplify(sqrt(-1/2 -1/2 * x))", + "(-1/2*x-1/2)^(1/2)", + + "simplify(sqrt(x*y))", + "(x*y)^(1/2)", + + "simplify(sqrt(1/x))", + "(1/x)^(1/2)", + + "simplify(sqrt(x^y))", + "(x^y)^(1/2)", + + "simplify(sqrt(x)^2)", + "x", + + "simplify(sqrt(x^2))", + "abs(x)", + + # simplifying rational expressions + + "simplify((x+1)*(x+1)/(x+1))", + "x+1", + + "simplify(x*(x+1)/x)", + "x+1", + + "simplify((x^2+7x+6)/(x^2-5x-6))", + "(x+6)/(x-6)", + + "simplify(x*(x+1)/(x+1)+1)", + "x+1", + + "simplify(x*(x+1)/(x+1))", + "x", + + "simplify((x^2+3x)/(x^2+5x))", + "(x+3)/(x+5)", + + "simplify((6x+20)/(2x+10))", + "(3*x+10)/(x+5)", + + "simplify((x^3-3x^2)/(4x^2-5x))", + "x*(x-3)/(4*x-5)", + + "simplify((x^2-9)/(x^2+5x+6))", + "(x-3)/(x+2)", + + "simplify((x^2-3x+2)/(x^2-1))", + "(x-2)/(x+1)", + + "simplify((x^2-2x-15)/(x^2+x-6))", + "(x-5)/(x-2)", + + "simplify(10x^3/(2x^2-18x))", + "5*x^2/(x-9)", + + "simplify(6x^2/(12x^4-9x^3))", + "1/(x*(2*x-3/2))", + + "simplify(((3-x)*(x-1))/((x-3)*(x+1)))", + "(-x+1)/(x+1)", + + "simplify(((x-2)*(x-5))/((2-x)*(x+5)))", + "(-x+5)/(x+5)", + + "simplify((15-10x)/(8x^3-12x^2))", + "-5/(4*x^2)", + + "simplify(3x/(15x^2-6x))", + "1/(5*x-2)", + + "simplify((3x^3-15x^2+12x)/(3x-3))", + "x*(x-4)", + + "simplify((6x^2-12x)/(6x-3x^2))", + "-2", + + "simplify((2x^2+13x+20)/(2x^2+17x+30))", + "(x+4)/(x+6)", + + "simplify((x^4+8x^2+7)/(3x^5-3x))", + "(x^2+7)/(3*x*(x^2-1))", + + "simplify((x^2+8x*k+16*k^2)/(x^2-16k^2))", + "(x+4*k)/(x-4*k)", + + "simplify((x^2-2x-8)/(x^2-9x+20))", + "(x+2)/(x-5)", + + "simplify((x^2-25)/(5x-x^2))", + "-1-5/x", + + "simplify((x^7+2x^6+x^5)/(x^3*(x+1)^8))", + "x^2/((x+1)^6)", + + "simplify((x^2+2*x+1)/((x+1)^8))", + "1/((x+1)^6)", + + "simplify(((x^2-5x-14)/(x^2-3x+2))*((x^2-4)/(x^2-14x+49)))", + "(x+2)^2/((x-7)*(x-1))", + + "simplify(((x^2-9)/(x^2+5x+6))/((3-x)/(x+2)))", + "-1", + + "simplify((x^2+5x+4)/((x^2-1)/(x+5)))", + "(x^2+9*x+20)/(x-1)", + + "simplify((x^2-6x-7)/(x^2-10x+21))", + "(x+1)/(x-3)", + + "simplify((x^2+6x+9)/(x^2-9))", + "(x+3)/(x-3)", + + "simplify((2x^2-x-28)/(20-x-x^2))", + "(-2*x-7)/(x+5)", + + "simplify(((x^2+5x-24)/(x^2+6x+8))*((x^2+4x+4)/(x^2-3x)))", + "(10+x+16/x)/(x+4)", + + "simplify(((x^2-49)/(2x^2-3x-5))/((x^2-x-42)/(x^2+7x+6)))", + "(x+7)/(2*x-5)", + + "simplify(((x^2-2x-8)/(2x^2-8x-24))/((x^2-9x+20)/(x^2-11x+30)))", + "1/2", + + "simplify((3/(x+1))/((x+4)/(x^2+11x+10)))", + "3*(x+10)/(x+4)", + + "simplify((x^3+10x^2)/(x^2+6x-40))", + "x^2/(x-4)", + + "simplify((x^2+18x+72)/(2x^2+11x-6))", + "(x+12)/(2*x-1)", + + "simplify((x^2-3x-28)/(49-x^2))", + "(-x-4)/(x+7)", + + "simplify((6x^2+13x+5)/(3x^2+26x+35))", + "(2*x+1)/(x+7)", + + "simplify((-x^2+10x-9)/(-x^2+6x+27))", + "(x-1)/(x+3)", + + "simplify((x-6)*(x^3+x^2-20x)/(x^4-12x^3+36x^2))", + "(1+x-20/x)/(x-6)", + + # somewhat strange simplification but it's correct + "simplify(((4x^3-x^2-3x)/(x^2-10x+25))*((10+3x-x^2)/(x^4-x^3)))", + "(-4-6/(x^2)-11/x)/(x-5)", + + "simplify(((x^2+5x-24)/(x^2-5x+4))/((x^2+x-12)/(x-1)))", + "(x+8)/(x^2-16)", + + "simplify(((6x^2+x^3-x^4)/(x^2-4))/((3x^3-9x^2)/(x^2+6x-16)))", + "1/3*(-x-8)", + + "simplify(((3x^2+23x+14)/(x^2+4x+3))/((6x^2+13x+6)/(x^2+2x+1)))", + "(x^2+8*x+7)/((x+3)*(2*x+3))", + + "simplify((5x^2-18x-8)/((x-4)/(x+6)))", + "5*x^2+32*x+12", + + "simplify((2/(x+4))/((6x^3+17x^2)/(x^2+3x-4)))", + "(x-1)/(x^2*(3*x+17/2))", + + # sum of rational expressions + "simplify(((x^2+1)/(2x^2-4x+2))+((x)/((x-1)^2))+((-x-1)/(x^2-2x+1)))", + "(x+1)/(2*(x-1))", + + "simplify((4/(6x^2))-(1/(3x^5))+(5/(2x^3)))", + "(2/3*x^3+5/2*x^2-1/3)/(x^5)", + + "simplify((x/(x^2-2x+1))-(2/(x-1))+(3/(x+2)))", + "(2*x^2-6*x+7)/(x^3-3*x+2)", + + "simplify((2x/(x^2-9))-(1/(x+3))-(2/(x-3)))", + "-1/(x-3)", + + "simplify((4/(x+2)-(1/x)+1)*(x+2)*x)", + "x^2+5*x-2", + + "simplify(((3/(x-4))+x/(2x+7))*(x-4)*(2x+7))", + "x^2+2*x+21", + + "simplify((x/(x^2+12x+36))-((x-8)/(x+6)))", + "(-x^2+3*x+48)/((x+6)^2)", + + "simplify(((x^2+14x+40)/(x^2+2x-8))*((x^2+5x-14)/(x^2+7x-30)))", + "(x+7)/(x-3)", + + # could be cleaner but it's correct + "simplify(1/(x^2-13x+42)+(x+1)/(x-6)-x^2/(x-7))", + "1/(x-7)+x/(x-6)-x^2/(x-7)", + + "simplify((x+10)/((3x+8)^3)+x/((3x+8)^2))", + "(3*x^2+9*x+10)/((3*x+8)^3)", + + "simplify(2/(3x^2)-1/(4x^7)+7/(6x^3))", + "(2/3*x^5+7/6*x^4-1/4)/(x^7)", + + "simplify(2x/(x+9)-(x-1)/(x))", + "-1+1/x+2*x/(x+9)", + + "simplify((x+1)/(x-1)+6/(x-7))", + "(x^2-13)/((x-7)*(x-1))", + + "simplify(9/(x^2-4)-7x/(x^2-4x+4))", + "(-7*x^2-5*x-18)/((x-2)^2*(x+2))", + + "simplify((2x+1)/(4x^2-3x-7)-(x+3)/(x+1)+x/(4x-7))", + "x/(4*x-7)-x/(x+1)+2*(-5*x+11)/((4*x-7)*(x+1))", + + "simplify(simplify((2x+1)/(4x^2-3x-7)-(x+3)/(x+1)+x/(4x-7))*(x+1)*(4x-7))", + "-3*x^2-2*x+22", + + # could be cleaner but it's correct + "simplify(3/(6x-x^2)-x/(x^2-5x-6))", + "(-3-x-3/x)/((x-6)*(x+1))", + + # could be cleaner but it's correct + "simplify(3/(x^2)+(x+9)/(x^2+5x)-2/(x^2+10x+25))", + "(15+x+75/(x^2)+75/x)/((x+5)^2)", + + "simplify(1/(x+1)-2/((x+1)^2)-3/((x+1)^3))", + "(x^2-4)/((x+1)^3)", + + ] diff --git a/node_modules/algebrite/tests/sin.coffee b/node_modules/algebrite/tests/sin.coffee new file mode 100644 index 0000000..cbcc049 --- /dev/null +++ b/node_modules/algebrite/tests/sin.coffee @@ -0,0 +1,219 @@ +test_sin = -> + run_test [ + + "sin(x)", + "sin(x)", + + "sin(-x)", + "-sin(x)", + + "sin(b-a)", + "-sin(a-b)", + + # check against the floating point math library + + "f(a,x)=1+sin(float(a/360*2*pi))-float(x)+sin(a/360*2*pi)-x", + "", + + "f(0,0)", # 0 + "1.0", + + "f(90,1)", # 90 + "1.0", + + "f(180,0)", # 180 + "1.0", + + "f(270,-1)", # 270 + "1.0", + + "f(360,0)", # 360 + "1.0", + + "f(-90,-1)", # -90 + "1.0", + + "f(-180,0)", # -180 + "1.0", + + "f(-270,1)", # -270 + "1.0", + + "f(-360,0)", # -360 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(45,sqrt(2)/2)", # 45 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(135,sqrt(2)/2)", # 135 + "1.000000...", + + "f(225,-sqrt(2)/2)", # 225 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(315,-sqrt(2)/2)", # 315 + "1.000000...", + + "f(-45,-sqrt(2)/2)", # -45 + "1.0", + + "f(-135,-sqrt(2)/2)", # -135 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-225,sqrt(2)/2)", # -225 + "1.000000...", + + "f(-315,sqrt(2)/2)", # -315 + "1.0", + + "f(30,1/2)", # 30 + "1.0", + + "f(150,1/2)", # 150 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(210,-1/2)", # 210 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(330,-1/2)", # 330 + "1.000000...", + + "f(-30,-1/2)", # -30 + "1.0", + + "f(-150,-1/2)", # -150 + "1.0", + + "f(-210,1/2)", # -210 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-330,1/2)", # -330 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(60,sqrt(3)/2)", # 60 + "1.000000...", + + "f(120,sqrt(3)/2)", # 120 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(240,-sqrt(3)/2)", # 240 + "1.000000...", + + "f(300,-sqrt(3)/2)", # 300 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-60,-sqrt(3)/2)", # -60 + "1.000000...", + + "f(-120,-sqrt(3)/2)", # -120 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-240,sqrt(3)/2)", # -240 + "1.000000...", + + "f(-300,sqrt(3)/2)", # -300 + "1.0", + + "f=quote(f)", + "", + + "sin(arcsin(x))", + "x", + + # check the default case + + "sin(1/12*pi)", + "sin(1/12*pi)", + + "sin(arctan(4/3))", + "4/5", + + "sin(-arctan(4/3))", + "-4/5", + + # phase + + "sin(x-8/2*pi)", + "sin(x)", + + "sin(x-7/2*pi)", + "cos(x)", + + "sin(x-6/2*pi)", + "-sin(x)", + + "sin(x-5/2*pi)", + "-cos(x)", + + "sin(x-4/2*pi)", + "sin(x)", + + "sin(x-3/2*pi)", + "cos(x)", + + "sin(x-2/2*pi)", + "-sin(x)", + + "sin(x-1/2*pi)", + "-cos(x)", + + "sin(x+0/2*pi)", + "sin(x)", + + "sin(x+1/2*pi)", + "cos(x)", + + "sin(x+2/2*pi)", + "-sin(x)", + + "sin(x+3/2*pi)", + "-cos(x)", + + "sin(x+4/2*pi)", + "sin(x)", + + "sin(x+5/2*pi)", + "cos(x)", + + "sin(x+6/2*pi)", + "-sin(x)", + + "sin(x+7/2*pi)", + "-cos(x)", + + "sin(x+8/2*pi)", + "sin(x)", + ] diff --git a/node_modules/algebrite/tests/sinh.coffee b/node_modules/algebrite/tests/sinh.coffee new file mode 100644 index 0000000..4eae177 --- /dev/null +++ b/node_modules/algebrite/tests/sinh.coffee @@ -0,0 +1,11 @@ +test_sinh = -> + run_test [ + "sinh(x)", + "sinh(x)", + + "sinh(0)", + "0", + + "sinh(arcsinh(x))", + "x", + ] diff --git a/node_modules/algebrite/tests/strings.coffee b/node_modules/algebrite/tests/strings.coffee new file mode 100644 index 0000000..1d97fb9 --- /dev/null +++ b/node_modules/algebrite/tests/strings.coffee @@ -0,0 +1,22 @@ +test_strings = -> + run_test [ + + "\"hey\" + \"you\"", + "\"hey\"+\"you\"", + + "\"hey\" + \"hey\"", + "2*\"hey\"", + + "\"hey\" / \"hey\"", + "1", + + "\"hey\" - \"hey\"", + "0", + + "\"hey\" * \"hey\"", + "\"hey\"^2", + + "\"aaaaaaaaaa\nbbbbbbbbbb\"", + "\"aaaaaaaaaa\nbbbbbbbbbb\"", + + ] diff --git a/node_modules/algebrite/tests/subst.coffee b/node_modules/algebrite/tests/subst.coffee new file mode 100644 index 0000000..b5f99ad --- /dev/null +++ b/node_modules/algebrite/tests/subst.coffee @@ -0,0 +1,7 @@ +test_subst = -> + run_test [ + + "subst((-1)^(1/2),i,-3 + 10*3^(1/2)*i/9)", + "-3+10/9*i*3^(1/2)", + + ] diff --git a/node_modules/algebrite/tests/sum.coffee b/node_modules/algebrite/tests/sum.coffee new file mode 100644 index 0000000..9c3ff05 --- /dev/null +++ b/node_modules/algebrite/tests/sum.coffee @@ -0,0 +1,32 @@ +test_sum = -> + run_test [ + + # no evaluation in case there are + # symbolic variables + "sum(body + k,k,b,c)", + "sum(body+k,k,b,c)", + + "f=sum(a^k,k,0,9)", + "", + + "eval(f,a,-1/2)", + "341/512", + + # Leibniz formula for π as a series + "sum(float((-1)^k * (1/(2*k + 1))),k,0,100)*4", + "3.151493...", + + # ------------------- + + "f(a,b)=sum(k,k,a,b)", + "", + + "f(0,1)", + "1", + + # --- cleanup + + "f = quote(f)", + "", + + ] diff --git a/node_modules/algebrite/tests/tan.coffee b/node_modules/algebrite/tests/tan.coffee new file mode 100644 index 0000000..ba07c9e --- /dev/null +++ b/node_modules/algebrite/tests/tan.coffee @@ -0,0 +1,168 @@ +test_tan = -> + run_test [ + "tan(x)", + "tan(x)", + + "tan(-x)", + "-tan(x)", + + "tan(b-a)", + "-tan(a-b)", + + # check against the floating point math library + + "f(a,x)=1+tan(float(a/360*2*pi))-float(x)+tan(a/360*2*pi)-x", + "", + + "f(0,0)", # 0 + "1.0", + + "f(180,0)", # 180 + "1.0", + + "f(360,0)", # 360 + "1.0", + + "f(-180,0)", # -180 + "1.0", + + "f(-360,0)", # -360 + "1.0", + + "f(45,1)", # 45 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(135,-1)", # 135 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(225,1)", # 225 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(315,-1)", # 315 + "1.000000...", + + "f(-45,-1)", # -45 + "1.0", + + "f(-135,1)", # -135 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-225,-1)", # -225 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-315,1)", # -315 + "1.000000...", + + "f(30,sqrt(3)/3)", # 30 + "1.0", + + "f(150,-sqrt(3)/3)", # 150 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(210,sqrt(3)/3)", # 210 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(330,-sqrt(3)/3)", # 330 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-30,-sqrt(3)/3)", # -30 + "1.000000...", + + "f(-150,sqrt(3)/3)", # -150 + "1.0", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-210,-sqrt(3)/3)", # -210 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-330,sqrt(3)/3)", # -330 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(60,sqrt(3))", # 60 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(120,-sqrt(3))", # 120 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(240,sqrt(3))", # 240 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(300,-sqrt(3))", # 300 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-60,-sqrt(3))", # -60 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-120,sqrt(3))", # -120 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-240,-sqrt(3))", # -240 + "1.000000...", + + # this should really be 1.0 , however + # we have errors doing the calculations so + # we don't get to that exact 1.0 float + "f(-300,sqrt(3))", # -300 + "1.000000...", + + "f=quote(f)", + "", + + "tan(arctan(x))", + "x", + + # check the default case + + "tan(1/12*pi)", + "tan(1/12*pi)", + ] diff --git a/node_modules/algebrite/tests/tanh.coffee b/node_modules/algebrite/tests/tanh.coffee new file mode 100644 index 0000000..9b06eea --- /dev/null +++ b/node_modules/algebrite/tests/tanh.coffee @@ -0,0 +1,11 @@ +test_tanh = -> + run_test [ + "tanh(x)", + "tanh(x)", + + "tanh(0)", + "0", + + "tanh(arctanh(x))", + "x", + ] diff --git a/node_modules/algebrite/tests/taylor.coffee b/node_modules/algebrite/tests/taylor.coffee new file mode 100644 index 0000000..7830bd8 --- /dev/null +++ b/node_modules/algebrite/tests/taylor.coffee @@ -0,0 +1,8 @@ +test_taylor = -> + run_test [ + "taylor(1/(5+4*cos(x)),x,6,0)-(1/9+2/81*x^2+5/1458*x^4+49/131220*x^6)", + "0", + + "taylor(1/(5+4*cos(x)),x,6)-(1/9+2/81*x^2+5/1458*x^4+49/131220*x^6)", + "0", + ] diff --git a/node_modules/algebrite/tests/tensor.coffee b/node_modules/algebrite/tests/tensor.coffee new file mode 100644 index 0000000..17b8868 --- /dev/null +++ b/node_modules/algebrite/tests/tensor.coffee @@ -0,0 +1,233 @@ +test_tensor = -> + run_test [ + + "[[a]]", + "[[a]]", + + # --------------------------------- + # basic parsing, promotion and printout + # --------------------------------- + + "[[1,0],[0,0]]", + "[[1,0],[0,0]]", + + # --------------------------------- + # basic rank and shape checks + # --------------------------------- + + # in general, the trick to count + # rank (i.e. dimensions) is to count the + # number of nested brackets + # and the trick to determine the shape + # is to count the commas proceeding + # from the outermost to the + # inner-most brackets. + + "rank(a)", + "0", + + "rank([a,b,c])", + "1", + + "shape([a,b,c])", + "[3]", + + "rank([[a,b,c]])", + "2", + + # traditional matrix 1x3 + # i.e. one row three columns + # i.e. row vector + "shape([[a,b,c]])", + "[1,3]", + + "rank([[a],[b],[c]])", + "2", + + # traditional matrix 3x1 + # i.e. one columns three rows + # i.e. column vector + "shape([[a],[b],[c]])", + "[3,1]", + + "rank([[[a,b,c]]])", + "3", + + "shape([[[a,b,c]]])", + "[1,1,3]", + + "rank([[[a],[b],[c]]])", + "3", + + "shape([[[a],[b],[c]]])", + "[1,3,1]", + + "rank([[[a]],[[b]],[[c]]])", + "3", + + "shape([[[a]],[[b]],[[c]]])", + "[3,1,1]", + + + # --------------------------------- + # check tensor promotion + # --------------------------------- + + "a=[1,2,3]", + "", + + "rank(a)", + "1", + + "b=[4,5,6]", + "", + + "c=[7,8,9]", + "", + + "rank([a,b,c])", + "2", + + "[a,b,c]", + "[[1,2,3],[4,5,6],[7,8,9]]", + + + # ------------------------------------------------------- + # parsing, assigments and invokations calisthenics + # mixes [] used for a) tensor building and b) tensor indexing + # and mixes () used for a) function declarations + # b) function invokation and c) precedence + # Nests functions and matrices inside one another. + # ------------------------------------------------------- + + # -------------------- + + "f(x) = x + 1", + "", + + "a=[1,f,3]", + "", + + "a[2]", + "function (x) -> x+1", + + "a[f(1)]", + "function (x) -> x+1", + + "a[a[f(1)](1)]", + "function (x) -> x+1", + + "a[2](9)", + "10", + + "a[f(1)](f(8))", + "10", + + "a[a[f(1)](1)](a[f(1)](8))", + "10", + + # -------------------- + + "g(x) = x + 1", + "", + + "f() = [1,g,3]", + "", + + "a=[1,f,3]", + "", + + "a[2]()[2](7)", + "8", + + # -------------------- + + "g(x) = x + 1", + "", + + "f() = [[1,g,3],[0,0,0],[0,0,0]]", + "", + + "a=[1,f,3]", + "", + + "a[2]()[1][2](8)", + "9", + + "(a[2]())[1][2](8)", + "9", + + "((a[2]())[1])[2](8)", + "9", + + "(((a[2]())[1])[2])(8)", + "9", + + "(((a[a[1]+a[1]]())[a[1]])[a[1]+a[1]])(8)", + "9", + + "f()[1][2](8)", + "9", + + "f()[a[1]][a[1]+a[1]](8)", + "9", + + # -------------------- + + "g(x) = transpose(x)", + "", + + "f() = [[1,g,3],[0,0,0],[0,0,0]]", + "", + + "a=[1,f,3]", + "", + + "a[2]()[1][2]([[1,2,3,4]])", + "[[1],[2],[3],[4]]", + + # -------------------- + + "unit(x)", + "unit(x)", + + "unit(3)", + "[[1,0,0],[0,1,0],[0,0,1]]", + + "unit(1)", + "[[1]]", + + # cleanup + + "a=quote(a)", + "", + + "b=quote(b)", + "", + + "c=quote(c)", + "", + + "f=quote(f)", + "", + + "g=quote(g)", + "", + + # ------------------------------------------------------- + # handling of zero matrices + # ------------------------------------------------------- + + "-[0,0]", + "[0,0]", + + "zero(2,2)-zero(2,2)", + "[[0,0],[0,0]]", + + "-[0]", + "[0]", + + "[[0,0],[1,1]]-[[0,0],[1,1]]", + "[[0,0],[0,0]]", + + ] diff --git a/node_modules/algebrite/tests/test.coffee b/node_modules/algebrite/tests/test.coffee new file mode 100644 index 0000000..6afd4ea --- /dev/null +++ b/node_modules/algebrite/tests/test.coffee @@ -0,0 +1,655 @@ +test_test = -> + run_test [ + "a=1", + "1", + + "1>=2", + "0", + + "2>=1", + "1", + + "1>1", + "0", + + "1>2", + "0", + + "2>1", + "1", + + "1<=1", + "1", + + "1<=2", + "1", + + "2<=1", + "0", + + "1<1", + "0", + + "1<2", + "1", + + "2<1", + "0", + + "-1<-2", + "0", + + "-2<-1", + "1", + + "test(0,A,B)", + "B", + + "test(1,A,B)", + "A", + + "test(0,A,0,B)", + "0", + + "test(0,A,0,B,C)", + "C", + + "test(x<3,-x-4,3<=x,x*x+7,120/x+5)", + "test(testlt(x,3),-x-4,testle(3,x),x^2+7,120/x+5)", + + "x = -1", + "", + + "test(x<1,-x-4,3<=x,x*x+7,120/x+5)", + "-3", + + "x = 3", + "", + + "test(x<1,-x-4,3<=x,x*x+7,120/x+5)", + "16", + + "x = 2", + "", + + "test(x<1,-x-4,3<=x,x*x+7,120/x+5)", + "65", + + "x=quote(x)", + "", + + # not --------------------------------- + + "not(a=b)", + "not(a=b)", + + "a", + "a", + + "not(a)", + "not(a)", + + "not(not(a))", + "not(not(a))", + + "not(a=a)", + "0", + + "not(not(a=a))", + "1", + + "not(a==a)", + "0", + + "not(a===a)", + "not(a=== ? a)\nStop: syntax error", + + "not(a+1=a)", + "1", + + "not(a+1==a)", + "1", + + "not(a+1===a)", + "not(a+1=== ? a)\nStop: syntax error", + + "not(1)", + "0", + + "not(0)", + "1", + + "not(and(1,0))", + "1", + + "not(and(1,1))", + "0", + + # if passed a value, check if non-zero + "not(pi)", + "0", + + "not(2)", + "0", + + "not(-2)", + "0", + + "not(sqrt(2))", + "0", + + "not(sqrt(-1))", + "0", + + "not(sqrt(pi/4)-sqrt(i))", + "0", + + "not(1+i)", + "0", + + "not([0,0])", + "1", + + "not([1,2])", + "0", + + "not([1+i,2])", + "0", + + "not([a,2])", + "not([a,2])", + + "not(1-i)", + "0", + + + # and --------------------------------- + + # and with the first predicate being true + + "and(1,1)", + "1", + + "and(1,a=a,b=b)", + "1", + + "and(1,0)", + "0", + + "and(1,2)", + "1", + + "and(1,-2)", + "1", + + "and(1,sqrt(2))", + "1", + + "and(1,sqrt(-1))", + "1", + + "and(1,sqrt(pi/4)-sqrt(i))", + "1", + + "and(1,1+i)", + "1", + + + "and(1,a)", + "and(1,a)", + + + "and(1,[0,0])", + "0", + + "and(1,[1,2])", + "1", + + "and(1,[1+i,2])", + "1", + + "and(1,[a,2])", + "and(1,[a,2])", + + "and(1,1-i)", + "1", + + # and with the first predicate being false + + "and(0,1)", + "0", + + "and(0,a=a,b=b)", + "0", + + "and(0,0)", + "0", + + "and(0,2)", + "0", + + "and(0,-2)", + "0", + + "and(0,sqrt(2))", + "0", + + "and(0,sqrt(-1))", + "0", + + "and(0,sqrt(pi/4)-sqrt(i))", + "0", + + "and(0,1+i)", + "0", + + "and(0,a)", + "0", + + "and(0,[0,0])", + "0", + + "and(0,[1,2])", + "0", + + "and(0,[1+i,2])", + "0", + + "and(0,[a,2])", + "0", + + "and(0,1-i)", + "0", + + # and with last predicate being true + + "and(1,1)", + "1", + + "and(a=a,b=b,1)", + "1", + + "and(0,1)", + "0", + + "and(2,1)", + "1", + + "and(-2,1)", + "1", + + "and(sqrt(2),1)", + "1", + + "and(sqrt(-1),1)", + "1", + + "and(sqrt(pi/4)-sqrt(i),1)", + "1", + + "and(1+i,1)", + "1", + + + "and(a,1)", + "and(a,1)", + + + "and([0,0],1)", + "0", + + "and([1,2],1)", + "1", + + "and([1+i,2],1)", + "1", + + "and([a,2],1)", + "and([a,2],1)", + + "and(1-i,1)", + "1", + + # and with last predicate being false + + "and(1,0)", + "0", + + "and(a=a,b=b,0)", + "0", + + "and(0,0)", + "0", + + "and(2,0)", + "0", + + "and(-2,0)", + "0", + + "and(sqrt(2),0)", + "0", + + "and(sqrt(-1),0)", + "0", + + "and(sqrt(pi/4)-sqrt(i),0)", + "0", + + "and(1+i,0)", + "0", + + "and(a,0)", + "0", + + + "and([0,0],0)", + "0", + + "and([1,2],0)", + "0", + + "and([1+i,2],0)", + "0", + + "and([a,2],0)", + "0", + + "and(1-i,0)", + "0", + + # or ---------------------------------------------- + + # or with the first predicate being true + + "or(1,1)", + "1", + + "or(1,a=a,b=b)", + "1", + + "or(1,0)", + "1", + + "or(1,2)", + "1", + + "or(1,-2)", + "1", + + "or(1,sqrt(2))", + "1", + + "or(1,sqrt(-1))", + "1", + + "or(1,sqrt(pi/4)-sqrt(i))", + "1", + + "or(1,1+i)", + "1", + + "or(1,a)", + "1", + + "or(1,[0,0])", + "1", + + "or(1,[1,2])", + "1", + + "or(1,[1+i,2])", + "1", + + "or(1,[a,2])", + "1", + + "or(1,1-i)", + "1", + + # or with the first predicate being false + + "or(0,1)", + "1", + + "or(0,a=a,b=b)", + "1", + + "or(0,0)", + "0", + + "or(0,2)", + "1", + + "or(0,-2)", + "1", + + "or(0,sqrt(2))", + "1", + + "or(0,sqrt(-1))", + "1", + + "or(0,sqrt(pi/4)-sqrt(i))", + "1", + + "or(0,1+i)", + "1", + + "or(0,a)", + "or(0,a)", + + "or(0,[0,0])", + "0", + + "or(0,[1,2])", + "1", + + "or(0,[1+i,2])", + "1", + + "or(0,[a,2])", + "or(0,[a,2])", + + "or(0,1-i)", + "1", + + # or with last predicate being true + + "or(1,1)", + "1", + + "or(a=a,b=b,1)", + "1", + + "or(0,1)", + "1", + + "or(2,1)", + "1", + + "or(-2,1)", + "1", + + "or(sqrt(2),1)", + "1", + + "or(sqrt(-1),1)", + "1", + + "or(sqrt(pi/4)-sqrt(i),1)", + "1", + + "or(1+i,1)", + "1", + + "or(a,1)", + "1", + + "or([0,0],1)", + "1", + + "or([1,2],1)", + "1", + + "or([1+i,2],1)", + "1", + + "or([a,2],1)", + "1", + + "or(1-i,1)", + "1", + + # or with last predicate being false + + "or(1,0)", + "1", + + "or(a=a,b=b,0)", + "1", + + "or(0,0)", + "0", + + "or(2,0)", + "1", + + "or(-2,0)", + "1", + + "or(sqrt(2),0)", + "1", + + "or(sqrt(-1),0)", + "1", + + "or(sqrt(pi/4)-sqrt(i),0)", + "1", + + "or(1+i,0)", + "1", + + "or(a,0)", + "or(a,0)", + + + "or([0,0],0)", + "0", + + "or([1,2],0)", + "1", + + "or([1+i,2],0)", + "1", + + "or([a,2],0)", + "or([a,2],0)", + + "or(1-i,0)", + "1", + + # ------------------------------------------------ + + # zero and all zero vectors are considered equal. + # The reason being that the test checks whether + # [0,0]-0 is zero. Since anything minus zero is + # equal to itself, we effectively check if [0,0] + # is zero, which it is. + "[0,0]==0", + "1", + + "[1,2]==[1,2]", + "1", + + "[1,2]==[a,2]", + "testeq([1,2],[a,2])", + + "[1,2]==[3,4]", + "0", + + "[1,2]==[cos(x)^2 + sin(x)^2,2]", + "1", + + "1= 1", + "1", + + "cos(x)^2 + sin(x)^2 <= 1", + "1", + + "cos(x)^2 + sin(x)^2 < 1", + "0", + + "cos(x)^2 + sin(x)^2 + 1 > 1", + "1", + + "x + x > x", + "testgt(2*x,x)", + + "a > x", + "testgt(a,x)", + + "a >= x", + "testge(a,x)", + + "a == x", + "testeq(a,x)", + + "a < x", + "testlt(a,x)", + + "a <= x", + "testle(a,x)", + + # clean up ----------------- + + "a=quote(a)", + "", + + "x=quote(x)", + "", + + "b=quote(b)", + "", + + "A=quote(A)", + "", + + "B=quote(B)", + "", + + "C=quote(C)", + "", + + ] + diff --git a/node_modules/algebrite/tests/transpose.coffee b/node_modules/algebrite/tests/transpose.coffee new file mode 100644 index 0000000..b92a140 --- /dev/null +++ b/node_modules/algebrite/tests/transpose.coffee @@ -0,0 +1,181 @@ +test_transpose = -> + run_test [ + + "transpose(0)", + "0", + + "transpose([[1,2,3,4]])", + "[[1],[2],[3],[4]]", + + "transpose([[1],[2],[3],[4]])", + "[[1,2,3,4]]", + + "transpose(0.0)", + "0.0", + + "transpose([[a,b],[c,d]])", + "[[a,c],[b,d]]", + + "transpose([[a,b],[c,d]],1,2)", + "[[a,c],[b,d]]", + + "transpose([[a,b,c],[d,e,f]],1,2)", + "[[a,d],[b,e],[c,f]]", + + "transpose([[a,d],[b,e],[c,f]],1,2)", + "[[a,b,c],[d,e,f]]", + + # not how one-dimensional vectors + # don't have a transposition. + "transpose([a,b,c])", + "[a,b,c]", + + + "transpose(a)", + "transpose(a)", + + "transpose(a,1,2)", + "transpose(a)", + + "transpose(a,2,1)", + "transpose(a)", + + "transpose(1+10)", + "11", + + "transpose(1+10,2,3)", + "11", + + "transpose(a*b)", + "transpose(a)*transpose(b)", + + "transpose(a*b,3,4)", + "transpose(a,3,4)*transpose(b,3,4)", + + "transpose(b*2*a)", + "2*transpose(a)*transpose(b)", + + "transpose(b*2*a,3,4)", + "2*transpose(a,3,4)*transpose(b,3,4)", + + "transpose(b+a)", + "transpose(a)+transpose(b)", + + "transpose(b+a,3,4)", + "transpose(a,3,4)+transpose(b,3,4)", + + "transpose(inner(a,b))", + "inner(transpose(b),transpose(a))", + + "transpose(inner(a,b),3,4)", + "inner(transpose(b,3,4),transpose(a,3,4))", + + "transpose(transpose(a))", + "a", + + "transpose(transpose(transpose(a)))", + "transpose(a)", + + "transpose(transpose(transpose(transpose(a))))", + "a", + + "transpose(transpose(a),3,4)", + "transpose(transpose(a),3,4)", + + "transpose(transpose(transpose(a),3,4))", + "transpose(transpose(transpose(a),3,4))", + + "transpose(transpose(transpose(a),3,4))", + "transpose(transpose(transpose(a),3,4))", + + "transpose(transpose(transpose(a),1,2))", + "transpose(a)", + + "transpose(transpose(transpose(a),2,1))", + "transpose(a)", + + "transpose(transpose(a,3,4),4,3)", + "a", + + "transpose(transpose(a,3,4),5,6)", + "transpose(transpose(a,3,4),5,6)", + + "transpose(a) - transpose(a)", + "0", + + "transpose(a,1,2) - transpose(a,1,2)", + "0", + + "transpose(a,3,4) - transpose(a,3,4)", + "0", + + "aᵀ^b", + "transpose(a)^b", + + "a^ᵀb", + "a^ᵀ ? b\nStop: syntax error", + + "aᵀ^2^3", + "transpose(a)^8", + + "aᵀ", + "transpose(a)", + + "aᵀᵀ", + "a", + + "aᵀᵀᵀ", + "transpose(a)", + + "aᵀᵀᵀᵀ", + "a", + + "aᵀ+b", + "b+transpose(a)", + + "aᵀ*b", + "b*transpose(a)", + + # this output could be written out more + # cleanly without extra parens + "aᵀ^bᵀ", + "transpose(a)^(transpose(b))", + + "aᵀ*bᵀ", + "transpose(a)*transpose(b)", + + "a^bᵀ", + "a^(transpose(b))", + + "(a^b)ᵀ", + "transpose(a^b)", + + "(a*b)ᵀ", + "transpose(a)*transpose(b)", + + "inner(a,b)ᵀ", + "inner(transpose(b),transpose(a))", + + "dot(a,b)ᵀ", + "inner(transpose(b),transpose(a))", + + "(a·b·c)ᵀ", + "inner(transpose(c),inner(transpose(b),transpose(a)))", + + "Iᵀᵀᵀ", + "I", + + # Note that we are using the + # standard commutative multiplication here, + # not the dot product. + # So, one of the two arguments should + # be a scalar, but we don't know + # which one, so we have to transpose + # both. Note that we + # don't invert the order because + # we know it's a normal + # multiplication. + "transpose(A)*transpose(x)", + "transpose(A)*transpose(x)", + + ] diff --git a/node_modules/algebrite/tests/zero.coffee b/node_modules/algebrite/tests/zero.coffee new file mode 100644 index 0000000..353240b --- /dev/null +++ b/node_modules/algebrite/tests/zero.coffee @@ -0,0 +1,39 @@ +test_zero = -> + run_test [ + "zero(2,2)", + "[[0,0],[0,0]]", + + "zero(1,1)", + "[[0]]", + + "zero(1)", + "[0]", + + "zero(2)", + "[0,0]", + + "zero(1,2)", + "[[0,0]]", + + "zero(2,1)", + "[[0],[0]]", + + "zero(0)", + "0", + + "zero(0,0)", + "0", + + # it's relevant to handle the case of tensor + # being passed because if you type + # 2 + # zero + # > (0,0) + # zero # now the last result is passed to zero + # > 0 # (0,0) being passed, but it's handled! + # before some adjustments this used to crash. + # And it happened to me, so it can happen. + "zero([2,3])", + "0", + + ] diff --git a/node_modules/array-flatten/LICENSE b/node_modules/array-flatten/LICENSE new file mode 100644 index 0000000..983fbe8 --- /dev/null +++ b/node_modules/array-flatten/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +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/node_modules/array-flatten/README.md b/node_modules/array-flatten/README.md new file mode 100644 index 0000000..91fa5b6 --- /dev/null +++ b/node_modules/array-flatten/README.md @@ -0,0 +1,43 @@ +# Array Flatten + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] + +> Flatten an array of nested arrays into a single flat array. Accepts an optional depth. + +## Installation + +``` +npm install array-flatten --save +``` + +## Usage + +```javascript +var flatten = require('array-flatten') + +flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]) +//=> [1, 2, 3, 4, 5, 6, 7, 8, 9] + +flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2) +//=> [1, 2, 3, [4, [5], 6], 7, 8, 9] + +(function () { + flatten(arguments) //=> [1, 2, 3] +})(1, [2, 3]) +``` + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat +[npm-url]: https://npmjs.org/package/array-flatten +[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat +[downloads-url]: https://npmjs.org/package/array-flatten +[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat +[travis-url]: https://travis-ci.org/blakeembrey/array-flatten +[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat +[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master diff --git a/node_modules/array-flatten/array-flatten.js b/node_modules/array-flatten/array-flatten.js new file mode 100644 index 0000000..089117b --- /dev/null +++ b/node_modules/array-flatten/array-flatten.js @@ -0,0 +1,64 @@ +'use strict' + +/** + * Expose `arrayFlatten`. + */ +module.exports = arrayFlatten + +/** + * Recursive flatten function with depth. + * + * @param {Array} array + * @param {Array} result + * @param {Number} depth + * @return {Array} + */ +function flattenWithDepth (array, result, depth) { + for (var i = 0; i < array.length; i++) { + var value = array[i] + + if (depth > 0 && Array.isArray(value)) { + flattenWithDepth(value, result, depth - 1) + } else { + result.push(value) + } + } + + return result +} + +/** + * Recursive flatten function. Omitting depth is slightly faster. + * + * @param {Array} array + * @param {Array} result + * @return {Array} + */ +function flattenForever (array, result) { + for (var i = 0; i < array.length; i++) { + var value = array[i] + + if (Array.isArray(value)) { + flattenForever(value, result) + } else { + result.push(value) + } + } + + return result +} + +/** + * Flatten an array, with the ability to define a depth. + * + * @param {Array} array + * @param {Number} depth + * @return {Array} + */ +function arrayFlatten (array, depth) { + if (depth == null) { + return flattenForever(array, []) + } + + return flattenWithDepth(array, [], depth) +} diff --git a/node_modules/array-flatten/package.json b/node_modules/array-flatten/package.json new file mode 100644 index 0000000..1a24e2a --- /dev/null +++ b/node_modules/array-flatten/package.json @@ -0,0 +1,39 @@ +{ + "name": "array-flatten", + "version": "1.1.1", + "description": "Flatten an array of nested arrays into a single flat array", + "main": "array-flatten.js", + "files": [ + "array-flatten.js", + "LICENSE" + ], + "scripts": { + "test": "istanbul cover _mocha -- -R spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/blakeembrey/array-flatten.git" + }, + "keywords": [ + "array", + "flatten", + "arguments", + "depth" + ], + "author": { + "name": "Blake Embrey", + "email": "hello@blakeembrey.com", + "url": "http://blakeembrey.me" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/blakeembrey/array-flatten/issues" + }, + "homepage": "https://github.com/blakeembrey/array-flatten", + "devDependencies": { + "istanbul": "^0.3.13", + "mocha": "^2.2.4", + "pre-commit": "^1.0.7", + "standard": "^3.7.3" + } +} diff --git a/node_modules/big-integer/BigInteger.d.ts b/node_modules/big-integer/BigInteger.d.ts new file mode 100644 index 0000000..168ba5f --- /dev/null +++ b/node_modules/big-integer/BigInteger.d.ts @@ -0,0 +1,2393 @@ +/** + * Type definitions for BigInteger.js + * Definitions by: Tommy Frazier + */ +export = bigInt; +export as namespace bigInt; + +declare var bigInt: bigInt.BigIntegerStatic; + +declare namespace bigInt { + type BigNumber = number | bigint | string | BigInteger; + + interface BigIntegerStatic { + /** + * Equivalent to bigInt(0). + */ + (): BigInteger; + + /** + * Parse a Javascript number into a bigInt. + */ + (number: number): BigInteger; + + /** + * Parse a Javascript native bigint into a bigInt. + */ + (number: bigint): BigInteger; + + /** + * Parse a string into a bigInt. + * Default base is 10. + * Default alphabet is "0123456789abcdefghijklmnopqrstuvwxyz". + * caseSensitive defaults to false. + */ + (string: string, base?: BigNumber, alphabet?: string, caseSensitive?: boolean): BigInteger; + + /** + * no-op. + */ + (bigInt: BigInteger): BigInteger; + + /** + * Constructs a bigInt from an array of digits in specified base. + * The optional isNegative flag will make the number negative. + */ + fromArray: (digits: BigNumber[], base?: BigNumber, isNegative?: boolean) => BigInteger; + + /** + * Finds the greatest common denominator of a and b. + */ + gcd: (a: BigNumber, b: BigNumber) => BigInteger; + + + /** + * Returns true if x is a BigInteger, false otherwise. + */ + isInstance: (x: any) => x is BigInteger; + + /** + * Finds the least common multiple of a and b. + */ + lcm: (a: BigNumber, b: BigNumber) => BigInteger; + + /** + * Returns the largest of a and b. + */ + max: (a: BigNumber, b: BigNumber) => BigInteger; + + /** + * Returns the smallest of a and b. + */ + min: (a: BigNumber, b: BigNumber) => BigInteger; + + /** + * Equivalent to bigInt(-1). + */ + minusOne: BigInteger; + + /** + * Equivalent to bigInt(1). + */ + one: BigInteger; + + /** + * Returns a random number between min and max. + */ + randBetween: (min: BigNumber, max: BigNumber, rng?: () => number) => BigInteger; + + /** + * Equivalent to bigInt(0). + */ + zero: BigInteger; + } + + interface BigInteger { + /** + * Returns the absolute value of a bigInt. + */ + abs(): BigInteger; + + /** + * Performs addition. + */ + add(number: BigNumber): BigInteger; + + /** + * Performs the bitwise AND operation. + */ + and(number: BigNumber): BigInteger; + + /** + * Returns the number of digits required to represent a bigInt in binary. + */ + bitLength(): BigInteger; + + /** + * Performs a comparison between two numbers. If the numbers are equal, it returns 0. + * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. + */ + compare(number: BigNumber): number; + + /** + * Performs a comparison between the absolute value of two numbers. + */ + compareAbs(number: BigNumber): number; + + /** + * Alias for the compare method. + */ + compareTo(number: BigNumber): number; + + /** + * Performs integer division, disregarding the remainder. + */ + divide(number: BigNumber): BigInteger; + + /** + * Performs division and returns an object with two properties: quotient and remainder. + * The sign of the remainder will match the sign of the dividend. + */ + divmod(number: BigNumber): { quotient: BigInteger, remainder: BigInteger }; + + /** + * Alias for the equals method. + */ + eq(number: BigNumber): boolean; + + /** + * Checks if two numbers are equal. + */ + equals(number: BigNumber): boolean; + + /** + * Alias for the greaterOrEquals method. + */ + geq(number: BigNumber): boolean; + + /** + * Checks if the first number is greater than the second. + */ + greater(number: BigNumber): boolean; + + /** + * Checks if the first number is greater than or equal to the second. + */ + greaterOrEquals(number: BigNumber): boolean; + + /** + * Alias for the greater method. + */ + gt(number: BigNumber): boolean; + + /** + * Returns true if the first number is divisible by the second number, false otherwise. + */ + isDivisibleBy(number: BigNumber): boolean; + + /** + * Returns true if the number is even, false otherwise. + */ + isEven(): boolean; + + /** + * Returns true if the number is negative, false otherwise. + * Returns false for 0 and true for -0. + */ + isNegative(): boolean; + + /** + * Returns true if the number is odd, false otherwise. + */ + isOdd(): boolean; + + /** + * Return true if the number is positive, false otherwise. + * Returns true for 0 and false for -0. + */ + isPositive(): boolean; + + /** + * Returns true if the number is prime, false otherwise. + */ + isPrime(strict?: boolean): boolean; + + /** + * Returns true if the number is very likely to be prime, false otherwise. + */ + isProbablePrime(iterations?: number, rng?: () => number): boolean; + + /** + * Returns true if the number is 1 or -1, false otherwise. + */ + isUnit(): boolean; + + /** + * Return true if the number is 0 or -0, false otherwise. + */ + isZero(): boolean; + + /** + * Alias for the lesserOrEquals method. + */ + leq(number: BigNumber): boolean; + + /** + * Checks if the first number is lesser than the second. + */ + lesser(number: BigNumber): boolean; + + /** + * Checks if the first number is less than or equal to the second. + */ + lesserOrEquals(number: BigNumber): boolean; + + /** + * Alias for the lesser method. + */ + lt(number: BigNumber): boolean; + + /** + * Alias for the subtract method. + */ + minus(number: BigNumber): BigInteger; + + /** + * Performs division and returns the remainder, disregarding the quotient. + * The sign of the remainder will match the sign of the dividend. + */ + mod(number: BigNumber): BigInteger; + + /** + * Finds the multiplicative inverse of the number modulo mod. + */ + modInv(number: BigNumber): BigInteger; + + /** + * Takes the number to the power exp modulo mod. + */ + modPow(exp: BigNumber, mod: BigNumber): BigInteger; + + /** + * Performs multiplication. + */ + multiply(number: BigNumber): BigInteger; + + /** + * Reverses the sign of the number. + */ + negate(): BigInteger; + + /** + * Alias for the notEquals method. + */ + neq(number: BigNumber): boolean; + + /** + * Adds one to the number. + */ + next(): BigInteger; + + /** + * Performs the bitwise NOT operation. + */ + not(): BigInteger; + + /** + * Checks if two numbers are not equal. + */ + notEquals(number: BigNumber): boolean; + + /** + * Performs the bitwise OR operation. + */ + or(number: BigNumber): BigInteger; + + /** + * Alias for the divide method. + */ + over(number: BigNumber): BigInteger; + + /** + * Alias for the add method. + */ + plus(number: BigNumber): BigInteger; + + /** + * Performs exponentiation. If the exponent is less than 0, pow returns 0. + * bigInt.zero.pow(0) returns 1. + */ + pow(number: BigNumber): BigInteger; + + /** + * Subtracts one from the number. + */ + prev(): BigInteger; + + /** + * Alias for the mod method. + */ + remainder(number: BigNumber): BigInteger; + + /** + * Shifts the number left by n places in its binary representation. + * If a negative number is provided, it will shift right. + * + * Throws an error if number is outside of the range [-9007199254740992, 9007199254740992]. + */ + shiftLeft(number: BigNumber): BigInteger; + + /** + * Shifts the number right by n places in its binary representation. + * If a negative number is provided, it will shift left. + * + * Throws an error if number is outside of the range [-9007199254740992, 9007199254740992]. + */ + shiftRight(number: BigNumber): BigInteger; + + /** + * Squares the number. + */ + square(): BigInteger; + + /** + * Performs subtraction. + */ + subtract(number: BigNumber): BigInteger; + + /** + * Alias for the multiply method. + */ + times(number: BigNumber): BigInteger; + + /** + * + * Converts a bigInt to an object representing it as an array of integers module the given radix. + */ + toArray(radix: number): BaseArray; + + /** + * Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. + */ + toJSNumber(): number; + + /** + * Converts a bigInt to a string. + */ + toString(radix?: number, alphabet?: string): string; + + /** + * Converts a bigInt to a string. This method is called behind the scenes in JSON.stringify. + */ + toJSON(): string; + + /** + * Converts a bigInt to a native Javascript number. This override allows you to use native + * arithmetic operators without explicit conversion. + */ + valueOf(): number; + + /** + * Performs the bitwise XOR operation. + */ + xor(number: BigNumber): BigInteger; + } + + // Array constant accessors + interface BigIntegerStatic { + '-999': BigInteger; + '-998': BigInteger; + '-997': BigInteger; + '-996': BigInteger; + '-995': BigInteger; + '-994': BigInteger; + '-993': BigInteger; + '-992': BigInteger; + '-991': BigInteger; + '-990': BigInteger; + '-989': BigInteger; + '-988': BigInteger; + '-987': BigInteger; + '-986': BigInteger; + '-985': BigInteger; + '-984': BigInteger; + '-983': BigInteger; + '-982': BigInteger; + '-981': BigInteger; + '-980': BigInteger; + '-979': BigInteger; + '-978': BigInteger; + '-977': BigInteger; + '-976': BigInteger; + '-975': BigInteger; + '-974': BigInteger; + '-973': BigInteger; + '-972': BigInteger; + '-971': BigInteger; + '-970': BigInteger; + '-969': BigInteger; + '-968': BigInteger; + '-967': BigInteger; + '-966': BigInteger; + '-965': BigInteger; + '-964': BigInteger; + '-963': BigInteger; + '-962': BigInteger; + '-961': BigInteger; + '-960': BigInteger; + '-959': BigInteger; + '-958': BigInteger; + '-957': BigInteger; + '-956': BigInteger; + '-955': BigInteger; + '-954': BigInteger; + '-953': BigInteger; + '-952': BigInteger; + '-951': BigInteger; + '-950': BigInteger; + '-949': BigInteger; + '-948': BigInteger; + '-947': BigInteger; + '-946': BigInteger; + '-945': BigInteger; + '-944': BigInteger; + '-943': BigInteger; + '-942': BigInteger; + '-941': BigInteger; + '-940': BigInteger; + '-939': BigInteger; + '-938': BigInteger; + '-937': BigInteger; + '-936': BigInteger; + '-935': BigInteger; + '-934': BigInteger; + '-933': BigInteger; + '-932': BigInteger; + '-931': BigInteger; + '-930': BigInteger; + '-929': BigInteger; + '-928': BigInteger; + '-927': BigInteger; + '-926': BigInteger; + '-925': BigInteger; + '-924': BigInteger; + '-923': BigInteger; + '-922': BigInteger; + '-921': BigInteger; + '-920': BigInteger; + '-919': BigInteger; + '-918': BigInteger; + '-917': BigInteger; + '-916': BigInteger; + '-915': BigInteger; + '-914': BigInteger; + '-913': BigInteger; + '-912': BigInteger; + '-911': BigInteger; + '-910': BigInteger; + '-909': BigInteger; + '-908': BigInteger; + '-907': BigInteger; + '-906': BigInteger; + '-905': BigInteger; + '-904': BigInteger; + '-903': BigInteger; + '-902': BigInteger; + '-901': BigInteger; + '-900': BigInteger; + '-899': BigInteger; + '-898': BigInteger; + '-897': BigInteger; + '-896': BigInteger; + '-895': BigInteger; + '-894': BigInteger; + '-893': BigInteger; + '-892': BigInteger; + '-891': BigInteger; + '-890': BigInteger; + '-889': BigInteger; + '-888': BigInteger; + '-887': BigInteger; + '-886': BigInteger; + '-885': BigInteger; + '-884': BigInteger; + '-883': BigInteger; + '-882': BigInteger; + '-881': BigInteger; + '-880': BigInteger; + '-879': BigInteger; + '-878': BigInteger; + '-877': BigInteger; + '-876': BigInteger; + '-875': BigInteger; + '-874': BigInteger; + '-873': BigInteger; + '-872': BigInteger; + '-871': BigInteger; + '-870': BigInteger; + '-869': BigInteger; + '-868': BigInteger; + '-867': BigInteger; + '-866': BigInteger; + '-865': BigInteger; + '-864': BigInteger; + '-863': BigInteger; + '-862': BigInteger; + '-861': BigInteger; + '-860': BigInteger; + '-859': BigInteger; + '-858': BigInteger; + '-857': BigInteger; + '-856': BigInteger; + '-855': BigInteger; + '-854': BigInteger; + '-853': BigInteger; + '-852': BigInteger; + '-851': BigInteger; + '-850': BigInteger; + '-849': BigInteger; + '-848': BigInteger; + '-847': BigInteger; + '-846': BigInteger; + '-845': BigInteger; + '-844': BigInteger; + '-843': BigInteger; + '-842': BigInteger; + '-841': BigInteger; + '-840': BigInteger; + '-839': BigInteger; + '-838': BigInteger; + '-837': BigInteger; + '-836': BigInteger; + '-835': BigInteger; + '-834': BigInteger; + '-833': BigInteger; + '-832': BigInteger; + '-831': BigInteger; + '-830': BigInteger; + '-829': BigInteger; + '-828': BigInteger; + '-827': BigInteger; + '-826': BigInteger; + '-825': BigInteger; + '-824': BigInteger; + '-823': BigInteger; + '-822': BigInteger; + '-821': BigInteger; + '-820': BigInteger; + '-819': BigInteger; + '-818': BigInteger; + '-817': BigInteger; + '-816': BigInteger; + '-815': BigInteger; + '-814': BigInteger; + '-813': BigInteger; + '-812': BigInteger; + '-811': BigInteger; + '-810': BigInteger; + '-809': BigInteger; + '-808': BigInteger; + '-807': BigInteger; + '-806': BigInteger; + '-805': BigInteger; + '-804': BigInteger; + '-803': BigInteger; + '-802': BigInteger; + '-801': BigInteger; + '-800': BigInteger; + '-799': BigInteger; + '-798': BigInteger; + '-797': BigInteger; + '-796': BigInteger; + '-795': BigInteger; + '-794': BigInteger; + '-793': BigInteger; + '-792': BigInteger; + '-791': BigInteger; + '-790': BigInteger; + '-789': BigInteger; + '-788': BigInteger; + '-787': BigInteger; + '-786': BigInteger; + '-785': BigInteger; + '-784': BigInteger; + '-783': BigInteger; + '-782': BigInteger; + '-781': BigInteger; + '-780': BigInteger; + '-779': BigInteger; + '-778': BigInteger; + '-777': BigInteger; + '-776': BigInteger; + '-775': BigInteger; + '-774': BigInteger; + '-773': BigInteger; + '-772': BigInteger; + '-771': BigInteger; + '-770': BigInteger; + '-769': BigInteger; + '-768': BigInteger; + '-767': BigInteger; + '-766': BigInteger; + '-765': BigInteger; + '-764': BigInteger; + '-763': BigInteger; + '-762': BigInteger; + '-761': BigInteger; + '-760': BigInteger; + '-759': BigInteger; + '-758': BigInteger; + '-757': BigInteger; + '-756': BigInteger; + '-755': BigInteger; + '-754': BigInteger; + '-753': BigInteger; + '-752': BigInteger; + '-751': BigInteger; + '-750': BigInteger; + '-749': BigInteger; + '-748': BigInteger; + '-747': BigInteger; + '-746': BigInteger; + '-745': BigInteger; + '-744': BigInteger; + '-743': BigInteger; + '-742': BigInteger; + '-741': BigInteger; + '-740': BigInteger; + '-739': BigInteger; + '-738': BigInteger; + '-737': BigInteger; + '-736': BigInteger; + '-735': BigInteger; + '-734': BigInteger; + '-733': BigInteger; + '-732': BigInteger; + '-731': BigInteger; + '-730': BigInteger; + '-729': BigInteger; + '-728': BigInteger; + '-727': BigInteger; + '-726': BigInteger; + '-725': BigInteger; + '-724': BigInteger; + '-723': BigInteger; + '-722': BigInteger; + '-721': BigInteger; + '-720': BigInteger; + '-719': BigInteger; + '-718': BigInteger; + '-717': BigInteger; + '-716': BigInteger; + '-715': BigInteger; + '-714': BigInteger; + '-713': BigInteger; + '-712': BigInteger; + '-711': BigInteger; + '-710': BigInteger; + '-709': BigInteger; + '-708': BigInteger; + '-707': BigInteger; + '-706': BigInteger; + '-705': BigInteger; + '-704': BigInteger; + '-703': BigInteger; + '-702': BigInteger; + '-701': BigInteger; + '-700': BigInteger; + '-699': BigInteger; + '-698': BigInteger; + '-697': BigInteger; + '-696': BigInteger; + '-695': BigInteger; + '-694': BigInteger; + '-693': BigInteger; + '-692': BigInteger; + '-691': BigInteger; + '-690': BigInteger; + '-689': BigInteger; + '-688': BigInteger; + '-687': BigInteger; + '-686': BigInteger; + '-685': BigInteger; + '-684': BigInteger; + '-683': BigInteger; + '-682': BigInteger; + '-681': BigInteger; + '-680': BigInteger; + '-679': BigInteger; + '-678': BigInteger; + '-677': BigInteger; + '-676': BigInteger; + '-675': BigInteger; + '-674': BigInteger; + '-673': BigInteger; + '-672': BigInteger; + '-671': BigInteger; + '-670': BigInteger; + '-669': BigInteger; + '-668': BigInteger; + '-667': BigInteger; + '-666': BigInteger; + '-665': BigInteger; + '-664': BigInteger; + '-663': BigInteger; + '-662': BigInteger; + '-661': BigInteger; + '-660': BigInteger; + '-659': BigInteger; + '-658': BigInteger; + '-657': BigInteger; + '-656': BigInteger; + '-655': BigInteger; + '-654': BigInteger; + '-653': BigInteger; + '-652': BigInteger; + '-651': BigInteger; + '-650': BigInteger; + '-649': BigInteger; + '-648': BigInteger; + '-647': BigInteger; + '-646': BigInteger; + '-645': BigInteger; + '-644': BigInteger; + '-643': BigInteger; + '-642': BigInteger; + '-641': BigInteger; + '-640': BigInteger; + '-639': BigInteger; + '-638': BigInteger; + '-637': BigInteger; + '-636': BigInteger; + '-635': BigInteger; + '-634': BigInteger; + '-633': BigInteger; + '-632': BigInteger; + '-631': BigInteger; + '-630': BigInteger; + '-629': BigInteger; + '-628': BigInteger; + '-627': BigInteger; + '-626': BigInteger; + '-625': BigInteger; + '-624': BigInteger; + '-623': BigInteger; + '-622': BigInteger; + '-621': BigInteger; + '-620': BigInteger; + '-619': BigInteger; + '-618': BigInteger; + '-617': BigInteger; + '-616': BigInteger; + '-615': BigInteger; + '-614': BigInteger; + '-613': BigInteger; + '-612': BigInteger; + '-611': BigInteger; + '-610': BigInteger; + '-609': BigInteger; + '-608': BigInteger; + '-607': BigInteger; + '-606': BigInteger; + '-605': BigInteger; + '-604': BigInteger; + '-603': BigInteger; + '-602': BigInteger; + '-601': BigInteger; + '-600': BigInteger; + '-599': BigInteger; + '-598': BigInteger; + '-597': BigInteger; + '-596': BigInteger; + '-595': BigInteger; + '-594': BigInteger; + '-593': BigInteger; + '-592': BigInteger; + '-591': BigInteger; + '-590': BigInteger; + '-589': BigInteger; + '-588': BigInteger; + '-587': BigInteger; + '-586': BigInteger; + '-585': BigInteger; + '-584': BigInteger; + '-583': BigInteger; + '-582': BigInteger; + '-581': BigInteger; + '-580': BigInteger; + '-579': BigInteger; + '-578': BigInteger; + '-577': BigInteger; + '-576': BigInteger; + '-575': BigInteger; + '-574': BigInteger; + '-573': BigInteger; + '-572': BigInteger; + '-571': BigInteger; + '-570': BigInteger; + '-569': BigInteger; + '-568': BigInteger; + '-567': BigInteger; + '-566': BigInteger; + '-565': BigInteger; + '-564': BigInteger; + '-563': BigInteger; + '-562': BigInteger; + '-561': BigInteger; + '-560': BigInteger; + '-559': BigInteger; + '-558': BigInteger; + '-557': BigInteger; + '-556': BigInteger; + '-555': BigInteger; + '-554': BigInteger; + '-553': BigInteger; + '-552': BigInteger; + '-551': BigInteger; + '-550': BigInteger; + '-549': BigInteger; + '-548': BigInteger; + '-547': BigInteger; + '-546': BigInteger; + '-545': BigInteger; + '-544': BigInteger; + '-543': BigInteger; + '-542': BigInteger; + '-541': BigInteger; + '-540': BigInteger; + '-539': BigInteger; + '-538': BigInteger; + '-537': BigInteger; + '-536': BigInteger; + '-535': BigInteger; + '-534': BigInteger; + '-533': BigInteger; + '-532': BigInteger; + '-531': BigInteger; + '-530': BigInteger; + '-529': BigInteger; + '-528': BigInteger; + '-527': BigInteger; + '-526': BigInteger; + '-525': BigInteger; + '-524': BigInteger; + '-523': BigInteger; + '-522': BigInteger; + '-521': BigInteger; + '-520': BigInteger; + '-519': BigInteger; + '-518': BigInteger; + '-517': BigInteger; + '-516': BigInteger; + '-515': BigInteger; + '-514': BigInteger; + '-513': BigInteger; + '-512': BigInteger; + '-511': BigInteger; + '-510': BigInteger; + '-509': BigInteger; + '-508': BigInteger; + '-507': BigInteger; + '-506': BigInteger; + '-505': BigInteger; + '-504': BigInteger; + '-503': BigInteger; + '-502': BigInteger; + '-501': BigInteger; + '-500': BigInteger; + '-499': BigInteger; + '-498': BigInteger; + '-497': BigInteger; + '-496': BigInteger; + '-495': BigInteger; + '-494': BigInteger; + '-493': BigInteger; + '-492': BigInteger; + '-491': BigInteger; + '-490': BigInteger; + '-489': BigInteger; + '-488': BigInteger; + '-487': BigInteger; + '-486': BigInteger; + '-485': BigInteger; + '-484': BigInteger; + '-483': BigInteger; + '-482': BigInteger; + '-481': BigInteger; + '-480': BigInteger; + '-479': BigInteger; + '-478': BigInteger; + '-477': BigInteger; + '-476': BigInteger; + '-475': BigInteger; + '-474': BigInteger; + '-473': BigInteger; + '-472': BigInteger; + '-471': BigInteger; + '-470': BigInteger; + '-469': BigInteger; + '-468': BigInteger; + '-467': BigInteger; + '-466': BigInteger; + '-465': BigInteger; + '-464': BigInteger; + '-463': BigInteger; + '-462': BigInteger; + '-461': BigInteger; + '-460': BigInteger; + '-459': BigInteger; + '-458': BigInteger; + '-457': BigInteger; + '-456': BigInteger; + '-455': BigInteger; + '-454': BigInteger; + '-453': BigInteger; + '-452': BigInteger; + '-451': BigInteger; + '-450': BigInteger; + '-449': BigInteger; + '-448': BigInteger; + '-447': BigInteger; + '-446': BigInteger; + '-445': BigInteger; + '-444': BigInteger; + '-443': BigInteger; + '-442': BigInteger; + '-441': BigInteger; + '-440': BigInteger; + '-439': BigInteger; + '-438': BigInteger; + '-437': BigInteger; + '-436': BigInteger; + '-435': BigInteger; + '-434': BigInteger; + '-433': BigInteger; + '-432': BigInteger; + '-431': BigInteger; + '-430': BigInteger; + '-429': BigInteger; + '-428': BigInteger; + '-427': BigInteger; + '-426': BigInteger; + '-425': BigInteger; + '-424': BigInteger; + '-423': BigInteger; + '-422': BigInteger; + '-421': BigInteger; + '-420': BigInteger; + '-419': BigInteger; + '-418': BigInteger; + '-417': BigInteger; + '-416': BigInteger; + '-415': BigInteger; + '-414': BigInteger; + '-413': BigInteger; + '-412': BigInteger; + '-411': BigInteger; + '-410': BigInteger; + '-409': BigInteger; + '-408': BigInteger; + '-407': BigInteger; + '-406': BigInteger; + '-405': BigInteger; + '-404': BigInteger; + '-403': BigInteger; + '-402': BigInteger; + '-401': BigInteger; + '-400': BigInteger; + '-399': BigInteger; + '-398': BigInteger; + '-397': BigInteger; + '-396': BigInteger; + '-395': BigInteger; + '-394': BigInteger; + '-393': BigInteger; + '-392': BigInteger; + '-391': BigInteger; + '-390': BigInteger; + '-389': BigInteger; + '-388': BigInteger; + '-387': BigInteger; + '-386': BigInteger; + '-385': BigInteger; + '-384': BigInteger; + '-383': BigInteger; + '-382': BigInteger; + '-381': BigInteger; + '-380': BigInteger; + '-379': BigInteger; + '-378': BigInteger; + '-377': BigInteger; + '-376': BigInteger; + '-375': BigInteger; + '-374': BigInteger; + '-373': BigInteger; + '-372': BigInteger; + '-371': BigInteger; + '-370': BigInteger; + '-369': BigInteger; + '-368': BigInteger; + '-367': BigInteger; + '-366': BigInteger; + '-365': BigInteger; + '-364': BigInteger; + '-363': BigInteger; + '-362': BigInteger; + '-361': BigInteger; + '-360': BigInteger; + '-359': BigInteger; + '-358': BigInteger; + '-357': BigInteger; + '-356': BigInteger; + '-355': BigInteger; + '-354': BigInteger; + '-353': BigInteger; + '-352': BigInteger; + '-351': BigInteger; + '-350': BigInteger; + '-349': BigInteger; + '-348': BigInteger; + '-347': BigInteger; + '-346': BigInteger; + '-345': BigInteger; + '-344': BigInteger; + '-343': BigInteger; + '-342': BigInteger; + '-341': BigInteger; + '-340': BigInteger; + '-339': BigInteger; + '-338': BigInteger; + '-337': BigInteger; + '-336': BigInteger; + '-335': BigInteger; + '-334': BigInteger; + '-333': BigInteger; + '-332': BigInteger; + '-331': BigInteger; + '-330': BigInteger; + '-329': BigInteger; + '-328': BigInteger; + '-327': BigInteger; + '-326': BigInteger; + '-325': BigInteger; + '-324': BigInteger; + '-323': BigInteger; + '-322': BigInteger; + '-321': BigInteger; + '-320': BigInteger; + '-319': BigInteger; + '-318': BigInteger; + '-317': BigInteger; + '-316': BigInteger; + '-315': BigInteger; + '-314': BigInteger; + '-313': BigInteger; + '-312': BigInteger; + '-311': BigInteger; + '-310': BigInteger; + '-309': BigInteger; + '-308': BigInteger; + '-307': BigInteger; + '-306': BigInteger; + '-305': BigInteger; + '-304': BigInteger; + '-303': BigInteger; + '-302': BigInteger; + '-301': BigInteger; + '-300': BigInteger; + '-299': BigInteger; + '-298': BigInteger; + '-297': BigInteger; + '-296': BigInteger; + '-295': BigInteger; + '-294': BigInteger; + '-293': BigInteger; + '-292': BigInteger; + '-291': BigInteger; + '-290': BigInteger; + '-289': BigInteger; + '-288': BigInteger; + '-287': BigInteger; + '-286': BigInteger; + '-285': BigInteger; + '-284': BigInteger; + '-283': BigInteger; + '-282': BigInteger; + '-281': BigInteger; + '-280': BigInteger; + '-279': BigInteger; + '-278': BigInteger; + '-277': BigInteger; + '-276': BigInteger; + '-275': BigInteger; + '-274': BigInteger; + '-273': BigInteger; + '-272': BigInteger; + '-271': BigInteger; + '-270': BigInteger; + '-269': BigInteger; + '-268': BigInteger; + '-267': BigInteger; + '-266': BigInteger; + '-265': BigInteger; + '-264': BigInteger; + '-263': BigInteger; + '-262': BigInteger; + '-261': BigInteger; + '-260': BigInteger; + '-259': BigInteger; + '-258': BigInteger; + '-257': BigInteger; + '-256': BigInteger; + '-255': BigInteger; + '-254': BigInteger; + '-253': BigInteger; + '-252': BigInteger; + '-251': BigInteger; + '-250': BigInteger; + '-249': BigInteger; + '-248': BigInteger; + '-247': BigInteger; + '-246': BigInteger; + '-245': BigInteger; + '-244': BigInteger; + '-243': BigInteger; + '-242': BigInteger; + '-241': BigInteger; + '-240': BigInteger; + '-239': BigInteger; + '-238': BigInteger; + '-237': BigInteger; + '-236': BigInteger; + '-235': BigInteger; + '-234': BigInteger; + '-233': BigInteger; + '-232': BigInteger; + '-231': BigInteger; + '-230': BigInteger; + '-229': BigInteger; + '-228': BigInteger; + '-227': BigInteger; + '-226': BigInteger; + '-225': BigInteger; + '-224': BigInteger; + '-223': BigInteger; + '-222': BigInteger; + '-221': BigInteger; + '-220': BigInteger; + '-219': BigInteger; + '-218': BigInteger; + '-217': BigInteger; + '-216': BigInteger; + '-215': BigInteger; + '-214': BigInteger; + '-213': BigInteger; + '-212': BigInteger; + '-211': BigInteger; + '-210': BigInteger; + '-209': BigInteger; + '-208': BigInteger; + '-207': BigInteger; + '-206': BigInteger; + '-205': BigInteger; + '-204': BigInteger; + '-203': BigInteger; + '-202': BigInteger; + '-201': BigInteger; + '-200': BigInteger; + '-199': BigInteger; + '-198': BigInteger; + '-197': BigInteger; + '-196': BigInteger; + '-195': BigInteger; + '-194': BigInteger; + '-193': BigInteger; + '-192': BigInteger; + '-191': BigInteger; + '-190': BigInteger; + '-189': BigInteger; + '-188': BigInteger; + '-187': BigInteger; + '-186': BigInteger; + '-185': BigInteger; + '-184': BigInteger; + '-183': BigInteger; + '-182': BigInteger; + '-181': BigInteger; + '-180': BigInteger; + '-179': BigInteger; + '-178': BigInteger; + '-177': BigInteger; + '-176': BigInteger; + '-175': BigInteger; + '-174': BigInteger; + '-173': BigInteger; + '-172': BigInteger; + '-171': BigInteger; + '-170': BigInteger; + '-169': BigInteger; + '-168': BigInteger; + '-167': BigInteger; + '-166': BigInteger; + '-165': BigInteger; + '-164': BigInteger; + '-163': BigInteger; + '-162': BigInteger; + '-161': BigInteger; + '-160': BigInteger; + '-159': BigInteger; + '-158': BigInteger; + '-157': BigInteger; + '-156': BigInteger; + '-155': BigInteger; + '-154': BigInteger; + '-153': BigInteger; + '-152': BigInteger; + '-151': BigInteger; + '-150': BigInteger; + '-149': BigInteger; + '-148': BigInteger; + '-147': BigInteger; + '-146': BigInteger; + '-145': BigInteger; + '-144': BigInteger; + '-143': BigInteger; + '-142': BigInteger; + '-141': BigInteger; + '-140': BigInteger; + '-139': BigInteger; + '-138': BigInteger; + '-137': BigInteger; + '-136': BigInteger; + '-135': BigInteger; + '-134': BigInteger; + '-133': BigInteger; + '-132': BigInteger; + '-131': BigInteger; + '-130': BigInteger; + '-129': BigInteger; + '-128': BigInteger; + '-127': BigInteger; + '-126': BigInteger; + '-125': BigInteger; + '-124': BigInteger; + '-123': BigInteger; + '-122': BigInteger; + '-121': BigInteger; + '-120': BigInteger; + '-119': BigInteger; + '-118': BigInteger; + '-117': BigInteger; + '-116': BigInteger; + '-115': BigInteger; + '-114': BigInteger; + '-113': BigInteger; + '-112': BigInteger; + '-111': BigInteger; + '-110': BigInteger; + '-109': BigInteger; + '-108': BigInteger; + '-107': BigInteger; + '-106': BigInteger; + '-105': BigInteger; + '-104': BigInteger; + '-103': BigInteger; + '-102': BigInteger; + '-101': BigInteger; + '-100': BigInteger; + '-99': BigInteger; + '-98': BigInteger; + '-97': BigInteger; + '-96': BigInteger; + '-95': BigInteger; + '-94': BigInteger; + '-93': BigInteger; + '-92': BigInteger; + '-91': BigInteger; + '-90': BigInteger; + '-89': BigInteger; + '-88': BigInteger; + '-87': BigInteger; + '-86': BigInteger; + '-85': BigInteger; + '-84': BigInteger; + '-83': BigInteger; + '-82': BigInteger; + '-81': BigInteger; + '-80': BigInteger; + '-79': BigInteger; + '-78': BigInteger; + '-77': BigInteger; + '-76': BigInteger; + '-75': BigInteger; + '-74': BigInteger; + '-73': BigInteger; + '-72': BigInteger; + '-71': BigInteger; + '-70': BigInteger; + '-69': BigInteger; + '-68': BigInteger; + '-67': BigInteger; + '-66': BigInteger; + '-65': BigInteger; + '-64': BigInteger; + '-63': BigInteger; + '-62': BigInteger; + '-61': BigInteger; + '-60': BigInteger; + '-59': BigInteger; + '-58': BigInteger; + '-57': BigInteger; + '-56': BigInteger; + '-55': BigInteger; + '-54': BigInteger; + '-53': BigInteger; + '-52': BigInteger; + '-51': BigInteger; + '-50': BigInteger; + '-49': BigInteger; + '-48': BigInteger; + '-47': BigInteger; + '-46': BigInteger; + '-45': BigInteger; + '-44': BigInteger; + '-43': BigInteger; + '-42': BigInteger; + '-41': BigInteger; + '-40': BigInteger; + '-39': BigInteger; + '-38': BigInteger; + '-37': BigInteger; + '-36': BigInteger; + '-35': BigInteger; + '-34': BigInteger; + '-33': BigInteger; + '-32': BigInteger; + '-31': BigInteger; + '-30': BigInteger; + '-29': BigInteger; + '-28': BigInteger; + '-27': BigInteger; + '-26': BigInteger; + '-25': BigInteger; + '-24': BigInteger; + '-23': BigInteger; + '-22': BigInteger; + '-21': BigInteger; + '-20': BigInteger; + '-19': BigInteger; + '-18': BigInteger; + '-17': BigInteger; + '-16': BigInteger; + '-15': BigInteger; + '-14': BigInteger; + '-13': BigInteger; + '-12': BigInteger; + '-11': BigInteger; + '-10': BigInteger; + '-9': BigInteger; + '-8': BigInteger; + '-7': BigInteger; + '-6': BigInteger; + '-5': BigInteger; + '-4': BigInteger; + '-3': BigInteger; + '-2': BigInteger; + '-1': BigInteger; + '0': BigInteger; + '1': BigInteger; + '2': BigInteger; + '3': BigInteger; + '4': BigInteger; + '5': BigInteger; + '6': BigInteger; + '7': BigInteger; + '8': BigInteger; + '9': BigInteger; + '10': BigInteger; + '11': BigInteger; + '12': BigInteger; + '13': BigInteger; + '14': BigInteger; + '15': BigInteger; + '16': BigInteger; + '17': BigInteger; + '18': BigInteger; + '19': BigInteger; + '20': BigInteger; + '21': BigInteger; + '22': BigInteger; + '23': BigInteger; + '24': BigInteger; + '25': BigInteger; + '26': BigInteger; + '27': BigInteger; + '28': BigInteger; + '29': BigInteger; + '30': BigInteger; + '31': BigInteger; + '32': BigInteger; + '33': BigInteger; + '34': BigInteger; + '35': BigInteger; + '36': BigInteger; + '37': BigInteger; + '38': BigInteger; + '39': BigInteger; + '40': BigInteger; + '41': BigInteger; + '42': BigInteger; + '43': BigInteger; + '44': BigInteger; + '45': BigInteger; + '46': BigInteger; + '47': BigInteger; + '48': BigInteger; + '49': BigInteger; + '50': BigInteger; + '51': BigInteger; + '52': BigInteger; + '53': BigInteger; + '54': BigInteger; + '55': BigInteger; + '56': BigInteger; + '57': BigInteger; + '58': BigInteger; + '59': BigInteger; + '60': BigInteger; + '61': BigInteger; + '62': BigInteger; + '63': BigInteger; + '64': BigInteger; + '65': BigInteger; + '66': BigInteger; + '67': BigInteger; + '68': BigInteger; + '69': BigInteger; + '70': BigInteger; + '71': BigInteger; + '72': BigInteger; + '73': BigInteger; + '74': BigInteger; + '75': BigInteger; + '76': BigInteger; + '77': BigInteger; + '78': BigInteger; + '79': BigInteger; + '80': BigInteger; + '81': BigInteger; + '82': BigInteger; + '83': BigInteger; + '84': BigInteger; + '85': BigInteger; + '86': BigInteger; + '87': BigInteger; + '88': BigInteger; + '89': BigInteger; + '90': BigInteger; + '91': BigInteger; + '92': BigInteger; + '93': BigInteger; + '94': BigInteger; + '95': BigInteger; + '96': BigInteger; + '97': BigInteger; + '98': BigInteger; + '99': BigInteger; + '100': BigInteger; + '101': BigInteger; + '102': BigInteger; + '103': BigInteger; + '104': BigInteger; + '105': BigInteger; + '106': BigInteger; + '107': BigInteger; + '108': BigInteger; + '109': BigInteger; + '110': BigInteger; + '111': BigInteger; + '112': BigInteger; + '113': BigInteger; + '114': BigInteger; + '115': BigInteger; + '116': BigInteger; + '117': BigInteger; + '118': BigInteger; + '119': BigInteger; + '120': BigInteger; + '121': BigInteger; + '122': BigInteger; + '123': BigInteger; + '124': BigInteger; + '125': BigInteger; + '126': BigInteger; + '127': BigInteger; + '128': BigInteger; + '129': BigInteger; + '130': BigInteger; + '131': BigInteger; + '132': BigInteger; + '133': BigInteger; + '134': BigInteger; + '135': BigInteger; + '136': BigInteger; + '137': BigInteger; + '138': BigInteger; + '139': BigInteger; + '140': BigInteger; + '141': BigInteger; + '142': BigInteger; + '143': BigInteger; + '144': BigInteger; + '145': BigInteger; + '146': BigInteger; + '147': BigInteger; + '148': BigInteger; + '149': BigInteger; + '150': BigInteger; + '151': BigInteger; + '152': BigInteger; + '153': BigInteger; + '154': BigInteger; + '155': BigInteger; + '156': BigInteger; + '157': BigInteger; + '158': BigInteger; + '159': BigInteger; + '160': BigInteger; + '161': BigInteger; + '162': BigInteger; + '163': BigInteger; + '164': BigInteger; + '165': BigInteger; + '166': BigInteger; + '167': BigInteger; + '168': BigInteger; + '169': BigInteger; + '170': BigInteger; + '171': BigInteger; + '172': BigInteger; + '173': BigInteger; + '174': BigInteger; + '175': BigInteger; + '176': BigInteger; + '177': BigInteger; + '178': BigInteger; + '179': BigInteger; + '180': BigInteger; + '181': BigInteger; + '182': BigInteger; + '183': BigInteger; + '184': BigInteger; + '185': BigInteger; + '186': BigInteger; + '187': BigInteger; + '188': BigInteger; + '189': BigInteger; + '190': BigInteger; + '191': BigInteger; + '192': BigInteger; + '193': BigInteger; + '194': BigInteger; + '195': BigInteger; + '196': BigInteger; + '197': BigInteger; + '198': BigInteger; + '199': BigInteger; + '200': BigInteger; + '201': BigInteger; + '202': BigInteger; + '203': BigInteger; + '204': BigInteger; + '205': BigInteger; + '206': BigInteger; + '207': BigInteger; + '208': BigInteger; + '209': BigInteger; + '210': BigInteger; + '211': BigInteger; + '212': BigInteger; + '213': BigInteger; + '214': BigInteger; + '215': BigInteger; + '216': BigInteger; + '217': BigInteger; + '218': BigInteger; + '219': BigInteger; + '220': BigInteger; + '221': BigInteger; + '222': BigInteger; + '223': BigInteger; + '224': BigInteger; + '225': BigInteger; + '226': BigInteger; + '227': BigInteger; + '228': BigInteger; + '229': BigInteger; + '230': BigInteger; + '231': BigInteger; + '232': BigInteger; + '233': BigInteger; + '234': BigInteger; + '235': BigInteger; + '236': BigInteger; + '237': BigInteger; + '238': BigInteger; + '239': BigInteger; + '240': BigInteger; + '241': BigInteger; + '242': BigInteger; + '243': BigInteger; + '244': BigInteger; + '245': BigInteger; + '246': BigInteger; + '247': BigInteger; + '248': BigInteger; + '249': BigInteger; + '250': BigInteger; + '251': BigInteger; + '252': BigInteger; + '253': BigInteger; + '254': BigInteger; + '255': BigInteger; + '256': BigInteger; + '257': BigInteger; + '258': BigInteger; + '259': BigInteger; + '260': BigInteger; + '261': BigInteger; + '262': BigInteger; + '263': BigInteger; + '264': BigInteger; + '265': BigInteger; + '266': BigInteger; + '267': BigInteger; + '268': BigInteger; + '269': BigInteger; + '270': BigInteger; + '271': BigInteger; + '272': BigInteger; + '273': BigInteger; + '274': BigInteger; + '275': BigInteger; + '276': BigInteger; + '277': BigInteger; + '278': BigInteger; + '279': BigInteger; + '280': BigInteger; + '281': BigInteger; + '282': BigInteger; + '283': BigInteger; + '284': BigInteger; + '285': BigInteger; + '286': BigInteger; + '287': BigInteger; + '288': BigInteger; + '289': BigInteger; + '290': BigInteger; + '291': BigInteger; + '292': BigInteger; + '293': BigInteger; + '294': BigInteger; + '295': BigInteger; + '296': BigInteger; + '297': BigInteger; + '298': BigInteger; + '299': BigInteger; + '300': BigInteger; + '301': BigInteger; + '302': BigInteger; + '303': BigInteger; + '304': BigInteger; + '305': BigInteger; + '306': BigInteger; + '307': BigInteger; + '308': BigInteger; + '309': BigInteger; + '310': BigInteger; + '311': BigInteger; + '312': BigInteger; + '313': BigInteger; + '314': BigInteger; + '315': BigInteger; + '316': BigInteger; + '317': BigInteger; + '318': BigInteger; + '319': BigInteger; + '320': BigInteger; + '321': BigInteger; + '322': BigInteger; + '323': BigInteger; + '324': BigInteger; + '325': BigInteger; + '326': BigInteger; + '327': BigInteger; + '328': BigInteger; + '329': BigInteger; + '330': BigInteger; + '331': BigInteger; + '332': BigInteger; + '333': BigInteger; + '334': BigInteger; + '335': BigInteger; + '336': BigInteger; + '337': BigInteger; + '338': BigInteger; + '339': BigInteger; + '340': BigInteger; + '341': BigInteger; + '342': BigInteger; + '343': BigInteger; + '344': BigInteger; + '345': BigInteger; + '346': BigInteger; + '347': BigInteger; + '348': BigInteger; + '349': BigInteger; + '350': BigInteger; + '351': BigInteger; + '352': BigInteger; + '353': BigInteger; + '354': BigInteger; + '355': BigInteger; + '356': BigInteger; + '357': BigInteger; + '358': BigInteger; + '359': BigInteger; + '360': BigInteger; + '361': BigInteger; + '362': BigInteger; + '363': BigInteger; + '364': BigInteger; + '365': BigInteger; + '366': BigInteger; + '367': BigInteger; + '368': BigInteger; + '369': BigInteger; + '370': BigInteger; + '371': BigInteger; + '372': BigInteger; + '373': BigInteger; + '374': BigInteger; + '375': BigInteger; + '376': BigInteger; + '377': BigInteger; + '378': BigInteger; + '379': BigInteger; + '380': BigInteger; + '381': BigInteger; + '382': BigInteger; + '383': BigInteger; + '384': BigInteger; + '385': BigInteger; + '386': BigInteger; + '387': BigInteger; + '388': BigInteger; + '389': BigInteger; + '390': BigInteger; + '391': BigInteger; + '392': BigInteger; + '393': BigInteger; + '394': BigInteger; + '395': BigInteger; + '396': BigInteger; + '397': BigInteger; + '398': BigInteger; + '399': BigInteger; + '400': BigInteger; + '401': BigInteger; + '402': BigInteger; + '403': BigInteger; + '404': BigInteger; + '405': BigInteger; + '406': BigInteger; + '407': BigInteger; + '408': BigInteger; + '409': BigInteger; + '410': BigInteger; + '411': BigInteger; + '412': BigInteger; + '413': BigInteger; + '414': BigInteger; + '415': BigInteger; + '416': BigInteger; + '417': BigInteger; + '418': BigInteger; + '419': BigInteger; + '420': BigInteger; + '421': BigInteger; + '422': BigInteger; + '423': BigInteger; + '424': BigInteger; + '425': BigInteger; + '426': BigInteger; + '427': BigInteger; + '428': BigInteger; + '429': BigInteger; + '430': BigInteger; + '431': BigInteger; + '432': BigInteger; + '433': BigInteger; + '434': BigInteger; + '435': BigInteger; + '436': BigInteger; + '437': BigInteger; + '438': BigInteger; + '439': BigInteger; + '440': BigInteger; + '441': BigInteger; + '442': BigInteger; + '443': BigInteger; + '444': BigInteger; + '445': BigInteger; + '446': BigInteger; + '447': BigInteger; + '448': BigInteger; + '449': BigInteger; + '450': BigInteger; + '451': BigInteger; + '452': BigInteger; + '453': BigInteger; + '454': BigInteger; + '455': BigInteger; + '456': BigInteger; + '457': BigInteger; + '458': BigInteger; + '459': BigInteger; + '460': BigInteger; + '461': BigInteger; + '462': BigInteger; + '463': BigInteger; + '464': BigInteger; + '465': BigInteger; + '466': BigInteger; + '467': BigInteger; + '468': BigInteger; + '469': BigInteger; + '470': BigInteger; + '471': BigInteger; + '472': BigInteger; + '473': BigInteger; + '474': BigInteger; + '475': BigInteger; + '476': BigInteger; + '477': BigInteger; + '478': BigInteger; + '479': BigInteger; + '480': BigInteger; + '481': BigInteger; + '482': BigInteger; + '483': BigInteger; + '484': BigInteger; + '485': BigInteger; + '486': BigInteger; + '487': BigInteger; + '488': BigInteger; + '489': BigInteger; + '490': BigInteger; + '491': BigInteger; + '492': BigInteger; + '493': BigInteger; + '494': BigInteger; + '495': BigInteger; + '496': BigInteger; + '497': BigInteger; + '498': BigInteger; + '499': BigInteger; + '500': BigInteger; + '501': BigInteger; + '502': BigInteger; + '503': BigInteger; + '504': BigInteger; + '505': BigInteger; + '506': BigInteger; + '507': BigInteger; + '508': BigInteger; + '509': BigInteger; + '510': BigInteger; + '511': BigInteger; + '512': BigInteger; + '513': BigInteger; + '514': BigInteger; + '515': BigInteger; + '516': BigInteger; + '517': BigInteger; + '518': BigInteger; + '519': BigInteger; + '520': BigInteger; + '521': BigInteger; + '522': BigInteger; + '523': BigInteger; + '524': BigInteger; + '525': BigInteger; + '526': BigInteger; + '527': BigInteger; + '528': BigInteger; + '529': BigInteger; + '530': BigInteger; + '531': BigInteger; + '532': BigInteger; + '533': BigInteger; + '534': BigInteger; + '535': BigInteger; + '536': BigInteger; + '537': BigInteger; + '538': BigInteger; + '539': BigInteger; + '540': BigInteger; + '541': BigInteger; + '542': BigInteger; + '543': BigInteger; + '544': BigInteger; + '545': BigInteger; + '546': BigInteger; + '547': BigInteger; + '548': BigInteger; + '549': BigInteger; + '550': BigInteger; + '551': BigInteger; + '552': BigInteger; + '553': BigInteger; + '554': BigInteger; + '555': BigInteger; + '556': BigInteger; + '557': BigInteger; + '558': BigInteger; + '559': BigInteger; + '560': BigInteger; + '561': BigInteger; + '562': BigInteger; + '563': BigInteger; + '564': BigInteger; + '565': BigInteger; + '566': BigInteger; + '567': BigInteger; + '568': BigInteger; + '569': BigInteger; + '570': BigInteger; + '571': BigInteger; + '572': BigInteger; + '573': BigInteger; + '574': BigInteger; + '575': BigInteger; + '576': BigInteger; + '577': BigInteger; + '578': BigInteger; + '579': BigInteger; + '580': BigInteger; + '581': BigInteger; + '582': BigInteger; + '583': BigInteger; + '584': BigInteger; + '585': BigInteger; + '586': BigInteger; + '587': BigInteger; + '588': BigInteger; + '589': BigInteger; + '590': BigInteger; + '591': BigInteger; + '592': BigInteger; + '593': BigInteger; + '594': BigInteger; + '595': BigInteger; + '596': BigInteger; + '597': BigInteger; + '598': BigInteger; + '599': BigInteger; + '600': BigInteger; + '601': BigInteger; + '602': BigInteger; + '603': BigInteger; + '604': BigInteger; + '605': BigInteger; + '606': BigInteger; + '607': BigInteger; + '608': BigInteger; + '609': BigInteger; + '610': BigInteger; + '611': BigInteger; + '612': BigInteger; + '613': BigInteger; + '614': BigInteger; + '615': BigInteger; + '616': BigInteger; + '617': BigInteger; + '618': BigInteger; + '619': BigInteger; + '620': BigInteger; + '621': BigInteger; + '622': BigInteger; + '623': BigInteger; + '624': BigInteger; + '625': BigInteger; + '626': BigInteger; + '627': BigInteger; + '628': BigInteger; + '629': BigInteger; + '630': BigInteger; + '631': BigInteger; + '632': BigInteger; + '633': BigInteger; + '634': BigInteger; + '635': BigInteger; + '636': BigInteger; + '637': BigInteger; + '638': BigInteger; + '639': BigInteger; + '640': BigInteger; + '641': BigInteger; + '642': BigInteger; + '643': BigInteger; + '644': BigInteger; + '645': BigInteger; + '646': BigInteger; + '647': BigInteger; + '648': BigInteger; + '649': BigInteger; + '650': BigInteger; + '651': BigInteger; + '652': BigInteger; + '653': BigInteger; + '654': BigInteger; + '655': BigInteger; + '656': BigInteger; + '657': BigInteger; + '658': BigInteger; + '659': BigInteger; + '660': BigInteger; + '661': BigInteger; + '662': BigInteger; + '663': BigInteger; + '664': BigInteger; + '665': BigInteger; + '666': BigInteger; + '667': BigInteger; + '668': BigInteger; + '669': BigInteger; + '670': BigInteger; + '671': BigInteger; + '672': BigInteger; + '673': BigInteger; + '674': BigInteger; + '675': BigInteger; + '676': BigInteger; + '677': BigInteger; + '678': BigInteger; + '679': BigInteger; + '680': BigInteger; + '681': BigInteger; + '682': BigInteger; + '683': BigInteger; + '684': BigInteger; + '685': BigInteger; + '686': BigInteger; + '687': BigInteger; + '688': BigInteger; + '689': BigInteger; + '690': BigInteger; + '691': BigInteger; + '692': BigInteger; + '693': BigInteger; + '694': BigInteger; + '695': BigInteger; + '696': BigInteger; + '697': BigInteger; + '698': BigInteger; + '699': BigInteger; + '700': BigInteger; + '701': BigInteger; + '702': BigInteger; + '703': BigInteger; + '704': BigInteger; + '705': BigInteger; + '706': BigInteger; + '707': BigInteger; + '708': BigInteger; + '709': BigInteger; + '710': BigInteger; + '711': BigInteger; + '712': BigInteger; + '713': BigInteger; + '714': BigInteger; + '715': BigInteger; + '716': BigInteger; + '717': BigInteger; + '718': BigInteger; + '719': BigInteger; + '720': BigInteger; + '721': BigInteger; + '722': BigInteger; + '723': BigInteger; + '724': BigInteger; + '725': BigInteger; + '726': BigInteger; + '727': BigInteger; + '728': BigInteger; + '729': BigInteger; + '730': BigInteger; + '731': BigInteger; + '732': BigInteger; + '733': BigInteger; + '734': BigInteger; + '735': BigInteger; + '736': BigInteger; + '737': BigInteger; + '738': BigInteger; + '739': BigInteger; + '740': BigInteger; + '741': BigInteger; + '742': BigInteger; + '743': BigInteger; + '744': BigInteger; + '745': BigInteger; + '746': BigInteger; + '747': BigInteger; + '748': BigInteger; + '749': BigInteger; + '750': BigInteger; + '751': BigInteger; + '752': BigInteger; + '753': BigInteger; + '754': BigInteger; + '755': BigInteger; + '756': BigInteger; + '757': BigInteger; + '758': BigInteger; + '759': BigInteger; + '760': BigInteger; + '761': BigInteger; + '762': BigInteger; + '763': BigInteger; + '764': BigInteger; + '765': BigInteger; + '766': BigInteger; + '767': BigInteger; + '768': BigInteger; + '769': BigInteger; + '770': BigInteger; + '771': BigInteger; + '772': BigInteger; + '773': BigInteger; + '774': BigInteger; + '775': BigInteger; + '776': BigInteger; + '777': BigInteger; + '778': BigInteger; + '779': BigInteger; + '780': BigInteger; + '781': BigInteger; + '782': BigInteger; + '783': BigInteger; + '784': BigInteger; + '785': BigInteger; + '786': BigInteger; + '787': BigInteger; + '788': BigInteger; + '789': BigInteger; + '790': BigInteger; + '791': BigInteger; + '792': BigInteger; + '793': BigInteger; + '794': BigInteger; + '795': BigInteger; + '796': BigInteger; + '797': BigInteger; + '798': BigInteger; + '799': BigInteger; + '800': BigInteger; + '801': BigInteger; + '802': BigInteger; + '803': BigInteger; + '804': BigInteger; + '805': BigInteger; + '806': BigInteger; + '807': BigInteger; + '808': BigInteger; + '809': BigInteger; + '810': BigInteger; + '811': BigInteger; + '812': BigInteger; + '813': BigInteger; + '814': BigInteger; + '815': BigInteger; + '816': BigInteger; + '817': BigInteger; + '818': BigInteger; + '819': BigInteger; + '820': BigInteger; + '821': BigInteger; + '822': BigInteger; + '823': BigInteger; + '824': BigInteger; + '825': BigInteger; + '826': BigInteger; + '827': BigInteger; + '828': BigInteger; + '829': BigInteger; + '830': BigInteger; + '831': BigInteger; + '832': BigInteger; + '833': BigInteger; + '834': BigInteger; + '835': BigInteger; + '836': BigInteger; + '837': BigInteger; + '838': BigInteger; + '839': BigInteger; + '840': BigInteger; + '841': BigInteger; + '842': BigInteger; + '843': BigInteger; + '844': BigInteger; + '845': BigInteger; + '846': BigInteger; + '847': BigInteger; + '848': BigInteger; + '849': BigInteger; + '850': BigInteger; + '851': BigInteger; + '852': BigInteger; + '853': BigInteger; + '854': BigInteger; + '855': BigInteger; + '856': BigInteger; + '857': BigInteger; + '858': BigInteger; + '859': BigInteger; + '860': BigInteger; + '861': BigInteger; + '862': BigInteger; + '863': BigInteger; + '864': BigInteger; + '865': BigInteger; + '866': BigInteger; + '867': BigInteger; + '868': BigInteger; + '869': BigInteger; + '870': BigInteger; + '871': BigInteger; + '872': BigInteger; + '873': BigInteger; + '874': BigInteger; + '875': BigInteger; + '876': BigInteger; + '877': BigInteger; + '878': BigInteger; + '879': BigInteger; + '880': BigInteger; + '881': BigInteger; + '882': BigInteger; + '883': BigInteger; + '884': BigInteger; + '885': BigInteger; + '886': BigInteger; + '887': BigInteger; + '888': BigInteger; + '889': BigInteger; + '890': BigInteger; + '891': BigInteger; + '892': BigInteger; + '893': BigInteger; + '894': BigInteger; + '895': BigInteger; + '896': BigInteger; + '897': BigInteger; + '898': BigInteger; + '899': BigInteger; + '900': BigInteger; + '901': BigInteger; + '902': BigInteger; + '903': BigInteger; + '904': BigInteger; + '905': BigInteger; + '906': BigInteger; + '907': BigInteger; + '908': BigInteger; + '909': BigInteger; + '910': BigInteger; + '911': BigInteger; + '912': BigInteger; + '913': BigInteger; + '914': BigInteger; + '915': BigInteger; + '916': BigInteger; + '917': BigInteger; + '918': BigInteger; + '919': BigInteger; + '920': BigInteger; + '921': BigInteger; + '922': BigInteger; + '923': BigInteger; + '924': BigInteger; + '925': BigInteger; + '926': BigInteger; + '927': BigInteger; + '928': BigInteger; + '929': BigInteger; + '930': BigInteger; + '931': BigInteger; + '932': BigInteger; + '933': BigInteger; + '934': BigInteger; + '935': BigInteger; + '936': BigInteger; + '937': BigInteger; + '938': BigInteger; + '939': BigInteger; + '940': BigInteger; + '941': BigInteger; + '942': BigInteger; + '943': BigInteger; + '944': BigInteger; + '945': BigInteger; + '946': BigInteger; + '947': BigInteger; + '948': BigInteger; + '949': BigInteger; + '950': BigInteger; + '951': BigInteger; + '952': BigInteger; + '953': BigInteger; + '954': BigInteger; + '955': BigInteger; + '956': BigInteger; + '957': BigInteger; + '958': BigInteger; + '959': BigInteger; + '960': BigInteger; + '961': BigInteger; + '962': BigInteger; + '963': BigInteger; + '964': BigInteger; + '965': BigInteger; + '966': BigInteger; + '967': BigInteger; + '968': BigInteger; + '969': BigInteger; + '970': BigInteger; + '971': BigInteger; + '972': BigInteger; + '973': BigInteger; + '974': BigInteger; + '975': BigInteger; + '976': BigInteger; + '977': BigInteger; + '978': BigInteger; + '979': BigInteger; + '980': BigInteger; + '981': BigInteger; + '982': BigInteger; + '983': BigInteger; + '984': BigInteger; + '985': BigInteger; + '986': BigInteger; + '987': BigInteger; + '988': BigInteger; + '989': BigInteger; + '990': BigInteger; + '991': BigInteger; + '992': BigInteger; + '993': BigInteger; + '994': BigInteger; + '995': BigInteger; + '996': BigInteger; + '997': BigInteger; + '998': BigInteger; + '999': BigInteger; + } + + interface BaseArray { + value: number[], + isNegative: boolean + } +} diff --git a/node_modules/big-integer/BigInteger.js b/node_modules/big-integer/BigInteger.js new file mode 100644 index 0000000..e8658dc --- /dev/null +++ b/node_modules/big-integer/BigInteger.js @@ -0,0 +1,1453 @@ +var bigInt = (function (undefined) { + "use strict"; + + var BASE = 1e7, + LOG_BASE = 7, + MAX_INT = 9007199254740992, + MAX_INT_ARR = smallToArray(MAX_INT), + DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz"; + + var supportsNativeBigInt = typeof BigInt === "function"; + + function Integer(v, radix, alphabet, caseSensitive) { + if (typeof v === "undefined") return Integer[0]; + if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive); + return parseValue(v); + } + + function BigInteger(value, sign) { + this.value = value; + this.sign = sign; + this.isSmall = false; + } + BigInteger.prototype = Object.create(Integer.prototype); + + function SmallInteger(value) { + this.value = value; + this.sign = value < 0; + this.isSmall = true; + } + SmallInteger.prototype = Object.create(Integer.prototype); + + function NativeBigInt(value) { + this.value = value; + } + NativeBigInt.prototype = Object.create(Integer.prototype); + + function isPrecise(n) { + return -MAX_INT < n && n < MAX_INT; + } + + function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes + if (n < 1e7) + return [n]; + if (n < 1e14) + return [n % 1e7, Math.floor(n / 1e7)]; + return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)]; + } + + function arrayToSmall(arr) { // If BASE changes this function may need to change + trim(arr); + var length = arr.length; + if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) { + switch (length) { + case 0: return 0; + case 1: return arr[0]; + case 2: return arr[0] + arr[1] * BASE; + default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE; + } + } + return arr; + } + + function trim(v) { + var i = v.length; + while (v[--i] === 0); + v.length = i + 1; + } + + function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger + var x = new Array(length); + var i = -1; + while (++i < length) { + x[i] = 0; + } + return x; + } + + function truncate(n) { + if (n > 0) return Math.floor(n); + return Math.ceil(n); + } + + function add(a, b) { // assumes a and b are arrays with a.length >= b.length + var l_a = a.length, + l_b = b.length, + r = new Array(l_a), + carry = 0, + base = BASE, + sum, i; + for (i = 0; i < l_b; i++) { + sum = a[i] + b[i] + carry; + carry = sum >= base ? 1 : 0; + r[i] = sum - carry * base; + } + while (i < l_a) { + sum = a[i] + carry; + carry = sum === base ? 1 : 0; + r[i++] = sum - carry * base; + } + if (carry > 0) r.push(carry); + return r; + } + + function addAny(a, b) { + if (a.length >= b.length) return add(a, b); + return add(b, a); + } + + function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT + var l = a.length, + r = new Array(l), + base = BASE, + sum, i; + for (i = 0; i < l; i++) { + sum = a[i] - base + carry; + carry = Math.floor(sum / base); + r[i] = sum - carry * base; + carry += 1; + } + while (carry > 0) { + r[i++] = carry % base; + carry = Math.floor(carry / base); + } + return r; + } + + BigInteger.prototype.add = function (v) { + var n = parseValue(v); + if (this.sign !== n.sign) { + return this.subtract(n.negate()); + } + var a = this.value, b = n.value; + if (n.isSmall) { + return new BigInteger(addSmall(a, Math.abs(b)), this.sign); + } + return new BigInteger(addAny(a, b), this.sign); + }; + BigInteger.prototype.plus = BigInteger.prototype.add; + + SmallInteger.prototype.add = function (v) { + var n = parseValue(v); + var a = this.value; + if (a < 0 !== n.sign) { + return this.subtract(n.negate()); + } + var b = n.value; + if (n.isSmall) { + if (isPrecise(a + b)) return new SmallInteger(a + b); + b = smallToArray(Math.abs(b)); + } + return new BigInteger(addSmall(b, Math.abs(a)), a < 0); + }; + SmallInteger.prototype.plus = SmallInteger.prototype.add; + + NativeBigInt.prototype.add = function (v) { + return new NativeBigInt(this.value + parseValue(v).value); + } + NativeBigInt.prototype.plus = NativeBigInt.prototype.add; + + function subtract(a, b) { // assumes a and b are arrays with a >= b + var a_l = a.length, + b_l = b.length, + r = new Array(a_l), + borrow = 0, + base = BASE, + i, difference; + for (i = 0; i < b_l; i++) { + difference = a[i] - borrow - b[i]; + if (difference < 0) { + difference += base; + borrow = 1; + } else borrow = 0; + r[i] = difference; + } + for (i = b_l; i < a_l; i++) { + difference = a[i] - borrow; + if (difference < 0) difference += base; + else { + r[i++] = difference; + break; + } + r[i] = difference; + } + for (; i < a_l; i++) { + r[i] = a[i]; + } + trim(r); + return r; + } + + function subtractAny(a, b, sign) { + var value; + if (compareAbs(a, b) >= 0) { + value = subtract(a, b); + } else { + value = subtract(b, a); + sign = !sign; + } + value = arrayToSmall(value); + if (typeof value === "number") { + if (sign) value = -value; + return new SmallInteger(value); + } + return new BigInteger(value, sign); + } + + function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT + var l = a.length, + r = new Array(l), + carry = -b, + base = BASE, + i, difference; + for (i = 0; i < l; i++) { + difference = a[i] + carry; + carry = Math.floor(difference / base); + difference %= base; + r[i] = difference < 0 ? difference + base : difference; + } + r = arrayToSmall(r); + if (typeof r === "number") { + if (sign) r = -r; + return new SmallInteger(r); + } return new BigInteger(r, sign); + } + + BigInteger.prototype.subtract = function (v) { + var n = parseValue(v); + if (this.sign !== n.sign) { + return this.add(n.negate()); + } + var a = this.value, b = n.value; + if (n.isSmall) + return subtractSmall(a, Math.abs(b), this.sign); + return subtractAny(a, b, this.sign); + }; + BigInteger.prototype.minus = BigInteger.prototype.subtract; + + SmallInteger.prototype.subtract = function (v) { + var n = parseValue(v); + var a = this.value; + if (a < 0 !== n.sign) { + return this.add(n.negate()); + } + var b = n.value; + if (n.isSmall) { + return new SmallInteger(a - b); + } + return subtractSmall(b, Math.abs(a), a >= 0); + }; + SmallInteger.prototype.minus = SmallInteger.prototype.subtract; + + NativeBigInt.prototype.subtract = function (v) { + return new NativeBigInt(this.value - parseValue(v).value); + } + NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract; + + BigInteger.prototype.negate = function () { + return new BigInteger(this.value, !this.sign); + }; + SmallInteger.prototype.negate = function () { + var sign = this.sign; + var small = new SmallInteger(-this.value); + small.sign = !sign; + return small; + }; + NativeBigInt.prototype.negate = function () { + return new NativeBigInt(-this.value); + } + + BigInteger.prototype.abs = function () { + return new BigInteger(this.value, false); + }; + SmallInteger.prototype.abs = function () { + return new SmallInteger(Math.abs(this.value)); + }; + NativeBigInt.prototype.abs = function () { + return new NativeBigInt(this.value >= 0 ? this.value : -this.value); + } + + + function multiplyLong(a, b) { + var a_l = a.length, + b_l = b.length, + l = a_l + b_l, + r = createArray(l), + base = BASE, + product, carry, i, a_i, b_j; + for (i = 0; i < a_l; ++i) { + a_i = a[i]; + for (var j = 0; j < b_l; ++j) { + b_j = b[j]; + product = a_i * b_j + r[i + j]; + carry = Math.floor(product / base); + r[i + j] = product - carry * base; + r[i + j + 1] += carry; + } + } + trim(r); + return r; + } + + function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE + var l = a.length, + r = new Array(l), + base = BASE, + carry = 0, + product, i; + for (i = 0; i < l; i++) { + product = a[i] * b + carry; + carry = Math.floor(product / base); + r[i] = product - carry * base; + } + while (carry > 0) { + r[i++] = carry % base; + carry = Math.floor(carry / base); + } + return r; + } + + function shiftLeft(x, n) { + var r = []; + while (n-- > 0) r.push(0); + return r.concat(x); + } + + function multiplyKaratsuba(x, y) { + var n = Math.max(x.length, y.length); + + if (n <= 30) return multiplyLong(x, y); + n = Math.ceil(n / 2); + + var b = x.slice(n), + a = x.slice(0, n), + d = y.slice(n), + c = y.slice(0, n); + + var ac = multiplyKaratsuba(a, c), + bd = multiplyKaratsuba(b, d), + abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)); + + var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); + trim(product); + return product; + } + + // The following function is derived from a surface fit of a graph plotting the performance difference + // between long multiplication and karatsuba multiplication versus the lengths of the two arrays. + function useKaratsuba(l1, l2) { + return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0; + } + + BigInteger.prototype.multiply = function (v) { + var n = parseValue(v), + a = this.value, b = n.value, + sign = this.sign !== n.sign, + abs; + if (n.isSmall) { + if (b === 0) return Integer[0]; + if (b === 1) return this; + if (b === -1) return this.negate(); + abs = Math.abs(b); + if (abs < BASE) { + return new BigInteger(multiplySmall(a, abs), sign); + } + b = smallToArray(abs); + } + if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes + return new BigInteger(multiplyKaratsuba(a, b), sign); + return new BigInteger(multiplyLong(a, b), sign); + }; + + BigInteger.prototype.times = BigInteger.prototype.multiply; + + function multiplySmallAndArray(a, b, sign) { // a >= 0 + if (a < BASE) { + return new BigInteger(multiplySmall(b, a), sign); + } + return new BigInteger(multiplyLong(b, smallToArray(a)), sign); + } + SmallInteger.prototype._multiplyBySmall = function (a) { + if (isPrecise(a.value * this.value)) { + return new SmallInteger(a.value * this.value); + } + return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign); + }; + BigInteger.prototype._multiplyBySmall = function (a) { + if (a.value === 0) return Integer[0]; + if (a.value === 1) return this; + if (a.value === -1) return this.negate(); + return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign); + }; + SmallInteger.prototype.multiply = function (v) { + return parseValue(v)._multiplyBySmall(this); + }; + SmallInteger.prototype.times = SmallInteger.prototype.multiply; + + NativeBigInt.prototype.multiply = function (v) { + return new NativeBigInt(this.value * parseValue(v).value); + } + NativeBigInt.prototype.times = NativeBigInt.prototype.multiply; + + function square(a) { + //console.assert(2 * BASE * BASE < MAX_INT); + var l = a.length, + r = createArray(l + l), + base = BASE, + product, carry, i, a_i, a_j; + for (i = 0; i < l; i++) { + a_i = a[i]; + carry = 0 - a_i * a_i; + for (var j = i; j < l; j++) { + a_j = a[j]; + product = 2 * (a_i * a_j) + r[i + j] + carry; + carry = Math.floor(product / base); + r[i + j] = product - carry * base; + } + r[i + l] = carry; + } + trim(r); + return r; + } + + BigInteger.prototype.square = function () { + return new BigInteger(square(this.value), false); + }; + + SmallInteger.prototype.square = function () { + var value = this.value * this.value; + if (isPrecise(value)) return new SmallInteger(value); + return new BigInteger(square(smallToArray(Math.abs(this.value))), false); + }; + + NativeBigInt.prototype.square = function (v) { + return new NativeBigInt(this.value * this.value); + } + + function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes. + var a_l = a.length, + b_l = b.length, + base = BASE, + result = createArray(b.length), + divisorMostSignificantDigit = b[b_l - 1], + // normalization + lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), + remainder = multiplySmall(a, lambda), + divisor = multiplySmall(b, lambda), + quotientDigit, shift, carry, borrow, i, l, q; + if (remainder.length <= a_l) remainder.push(0); + divisor.push(0); + divisorMostSignificantDigit = divisor[b_l - 1]; + for (shift = a_l - b_l; shift >= 0; shift--) { + quotientDigit = base - 1; + if (remainder[shift + b_l] !== divisorMostSignificantDigit) { + quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit); + } + // quotientDigit <= base - 1 + carry = 0; + borrow = 0; + l = divisor.length; + for (i = 0; i < l; i++) { + carry += quotientDigit * divisor[i]; + q = Math.floor(carry / base); + borrow += remainder[shift + i] - (carry - q * base); + carry = q; + if (borrow < 0) { + remainder[shift + i] = borrow + base; + borrow = -1; + } else { + remainder[shift + i] = borrow; + borrow = 0; + } + } + while (borrow !== 0) { + quotientDigit -= 1; + carry = 0; + for (i = 0; i < l; i++) { + carry += remainder[shift + i] - base + divisor[i]; + if (carry < 0) { + remainder[shift + i] = carry + base; + carry = 0; + } else { + remainder[shift + i] = carry; + carry = 1; + } + } + borrow += carry; + } + result[shift] = quotientDigit; + } + // denormalization + remainder = divModSmall(remainder, lambda)[0]; + return [arrayToSmall(result), arrayToSmall(remainder)]; + } + + function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/ + // Performs faster than divMod1 on larger input sizes. + var a_l = a.length, + b_l = b.length, + result = [], + part = [], + base = BASE, + guess, xlen, highx, highy, check; + while (a_l) { + part.unshift(a[--a_l]); + trim(part); + if (compareAbs(part, b) < 0) { + result.push(0); + continue; + } + xlen = part.length; + highx = part[xlen - 1] * base + part[xlen - 2]; + highy = b[b_l - 1] * base + b[b_l - 2]; + if (xlen > b_l) { + highx = (highx + 1) * base; + } + guess = Math.ceil(highx / highy); + do { + check = multiplySmall(b, guess); + if (compareAbs(check, part) <= 0) break; + guess--; + } while (guess); + result.push(guess); + part = subtract(part, check); + } + result.reverse(); + return [arrayToSmall(result), arrayToSmall(part)]; + } + + function divModSmall(value, lambda) { + var length = value.length, + quotient = createArray(length), + base = BASE, + i, q, remainder, divisor; + remainder = 0; + for (i = length - 1; i >= 0; --i) { + divisor = remainder * base + value[i]; + q = truncate(divisor / lambda); + remainder = divisor - q * lambda; + quotient[i] = q | 0; + } + return [quotient, remainder | 0]; + } + + function divModAny(self, v) { + var value, n = parseValue(v); + if (supportsNativeBigInt) { + return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)]; + } + var a = self.value, b = n.value; + var quotient; + if (b === 0) throw new Error("Cannot divide by zero"); + if (self.isSmall) { + if (n.isSmall) { + return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)]; + } + return [Integer[0], self]; + } + if (n.isSmall) { + if (b === 1) return [self, Integer[0]]; + if (b == -1) return [self.negate(), Integer[0]]; + var abs = Math.abs(b); + if (abs < BASE) { + value = divModSmall(a, abs); + quotient = arrayToSmall(value[0]); + var remainder = value[1]; + if (self.sign) remainder = -remainder; + if (typeof quotient === "number") { + if (self.sign !== n.sign) quotient = -quotient; + return [new SmallInteger(quotient), new SmallInteger(remainder)]; + } + return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)]; + } + b = smallToArray(abs); + } + var comparison = compareAbs(a, b); + if (comparison === -1) return [Integer[0], self]; + if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]]; + + // divMod1 is faster on smaller input sizes + if (a.length + b.length <= 200) + value = divMod1(a, b); + else value = divMod2(a, b); + + quotient = value[0]; + var qSign = self.sign !== n.sign, + mod = value[1], + mSign = self.sign; + if (typeof quotient === "number") { + if (qSign) quotient = -quotient; + quotient = new SmallInteger(quotient); + } else quotient = new BigInteger(quotient, qSign); + if (typeof mod === "number") { + if (mSign) mod = -mod; + mod = new SmallInteger(mod); + } else mod = new BigInteger(mod, mSign); + return [quotient, mod]; + } + + BigInteger.prototype.divmod = function (v) { + var result = divModAny(this, v); + return { + quotient: result[0], + remainder: result[1] + }; + }; + NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod; + + + BigInteger.prototype.divide = function (v) { + return divModAny(this, v)[0]; + }; + NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) { + return new NativeBigInt(this.value / parseValue(v).value); + }; + SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide; + + BigInteger.prototype.mod = function (v) { + return divModAny(this, v)[1]; + }; + NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) { + return new NativeBigInt(this.value % parseValue(v).value); + }; + SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod; + + BigInteger.prototype.pow = function (v) { + var n = parseValue(v), + a = this.value, + b = n.value, + value, x, y; + if (b === 0) return Integer[1]; + if (a === 0) return Integer[0]; + if (a === 1) return Integer[1]; + if (a === -1) return n.isEven() ? Integer[1] : Integer[-1]; + if (n.sign) { + return Integer[0]; + } + if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large."); + if (this.isSmall) { + if (isPrecise(value = Math.pow(a, b))) + return new SmallInteger(truncate(value)); + } + x = this; + y = Integer[1]; + while (true) { + if (b & 1 === 1) { + y = y.times(x); + --b; + } + if (b === 0) break; + b /= 2; + x = x.square(); + } + return y; + }; + SmallInteger.prototype.pow = BigInteger.prototype.pow; + + NativeBigInt.prototype.pow = function (v) { + var n = parseValue(v); + var a = this.value, b = n.value; + var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2); + if (b === _0) return Integer[1]; + if (a === _0) return Integer[0]; + if (a === _1) return Integer[1]; + if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1]; + if (n.isNegative()) return new NativeBigInt(_0); + var x = this; + var y = Integer[1]; + while (true) { + if ((b & _1) === _1) { + y = y.times(x); + --b; + } + if (b === _0) break; + b /= _2; + x = x.square(); + } + return y; + } + + BigInteger.prototype.modPow = function (exp, mod) { + exp = parseValue(exp); + mod = parseValue(mod); + if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0"); + var r = Integer[1], + base = this.mod(mod); + if (exp.isNegative()) { + exp = exp.multiply(Integer[-1]); + base = base.modInv(mod); + } + while (exp.isPositive()) { + if (base.isZero()) return Integer[0]; + if (exp.isOdd()) r = r.multiply(base).mod(mod); + exp = exp.divide(2); + base = base.square().mod(mod); + } + return r; + }; + NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow; + + function compareAbs(a, b) { + if (a.length !== b.length) { + return a.length > b.length ? 1 : -1; + } + for (var i = a.length - 1; i >= 0; i--) { + if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1; + } + return 0; + } + + BigInteger.prototype.compareAbs = function (v) { + var n = parseValue(v), + a = this.value, + b = n.value; + if (n.isSmall) return 1; + return compareAbs(a, b); + }; + SmallInteger.prototype.compareAbs = function (v) { + var n = parseValue(v), + a = Math.abs(this.value), + b = n.value; + if (n.isSmall) { + b = Math.abs(b); + return a === b ? 0 : a > b ? 1 : -1; + } + return -1; + }; + NativeBigInt.prototype.compareAbs = function (v) { + var a = this.value; + var b = parseValue(v).value; + a = a >= 0 ? a : -a; + b = b >= 0 ? b : -b; + return a === b ? 0 : a > b ? 1 : -1; + } + + BigInteger.prototype.compare = function (v) { + // See discussion about comparison with Infinity: + // https://github.com/peterolson/BigInteger.js/issues/61 + if (v === Infinity) { + return -1; + } + if (v === -Infinity) { + return 1; + } + + var n = parseValue(v), + a = this.value, + b = n.value; + if (this.sign !== n.sign) { + return n.sign ? 1 : -1; + } + if (n.isSmall) { + return this.sign ? -1 : 1; + } + return compareAbs(a, b) * (this.sign ? -1 : 1); + }; + BigInteger.prototype.compareTo = BigInteger.prototype.compare; + + SmallInteger.prototype.compare = function (v) { + if (v === Infinity) { + return -1; + } + if (v === -Infinity) { + return 1; + } + + var n = parseValue(v), + a = this.value, + b = n.value; + if (n.isSmall) { + return a == b ? 0 : a > b ? 1 : -1; + } + if (a < 0 !== n.sign) { + return a < 0 ? -1 : 1; + } + return a < 0 ? 1 : -1; + }; + SmallInteger.prototype.compareTo = SmallInteger.prototype.compare; + + NativeBigInt.prototype.compare = function (v) { + if (v === Infinity) { + return -1; + } + if (v === -Infinity) { + return 1; + } + var a = this.value; + var b = parseValue(v).value; + return a === b ? 0 : a > b ? 1 : -1; + } + NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare; + + BigInteger.prototype.equals = function (v) { + return this.compare(v) === 0; + }; + NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals; + + BigInteger.prototype.notEquals = function (v) { + return this.compare(v) !== 0; + }; + NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals; + + BigInteger.prototype.greater = function (v) { + return this.compare(v) > 0; + }; + NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater; + + BigInteger.prototype.lesser = function (v) { + return this.compare(v) < 0; + }; + NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser; + + BigInteger.prototype.greaterOrEquals = function (v) { + return this.compare(v) >= 0; + }; + NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals; + + BigInteger.prototype.lesserOrEquals = function (v) { + return this.compare(v) <= 0; + }; + NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals; + + BigInteger.prototype.isEven = function () { + return (this.value[0] & 1) === 0; + }; + SmallInteger.prototype.isEven = function () { + return (this.value & 1) === 0; + }; + NativeBigInt.prototype.isEven = function () { + return (this.value & BigInt(1)) === BigInt(0); + } + + BigInteger.prototype.isOdd = function () { + return (this.value[0] & 1) === 1; + }; + SmallInteger.prototype.isOdd = function () { + return (this.value & 1) === 1; + }; + NativeBigInt.prototype.isOdd = function () { + return (this.value & BigInt(1)) === BigInt(1); + } + + BigInteger.prototype.isPositive = function () { + return !this.sign; + }; + SmallInteger.prototype.isPositive = function () { + return this.value > 0; + }; + NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive; + + BigInteger.prototype.isNegative = function () { + return this.sign; + }; + SmallInteger.prototype.isNegative = function () { + return this.value < 0; + }; + NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative; + + BigInteger.prototype.isUnit = function () { + return false; + }; + SmallInteger.prototype.isUnit = function () { + return Math.abs(this.value) === 1; + }; + NativeBigInt.prototype.isUnit = function () { + return this.abs().value === BigInt(1); + } + + BigInteger.prototype.isZero = function () { + return false; + }; + SmallInteger.prototype.isZero = function () { + return this.value === 0; + }; + NativeBigInt.prototype.isZero = function () { + return this.value === BigInt(0); + } + + BigInteger.prototype.isDivisibleBy = function (v) { + var n = parseValue(v); + if (n.isZero()) return false; + if (n.isUnit()) return true; + if (n.compareAbs(2) === 0) return this.isEven(); + return this.mod(n).isZero(); + }; + NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy; + + function isBasicPrime(v) { + var n = v.abs(); + if (n.isUnit()) return false; + if (n.equals(2) || n.equals(3) || n.equals(5)) return true; + if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false; + if (n.lesser(49)) return true; + // we don't know if it's prime: let the other functions figure it out + } + + function millerRabinTest(n, a) { + var nPrev = n.prev(), + b = nPrev, + r = 0, + d, t, i, x; + while (b.isEven()) b = b.divide(2), r++; + next: for (i = 0; i < a.length; i++) { + if (n.lesser(a[i])) continue; + x = bigInt(a[i]).modPow(b, n); + if (x.isUnit() || x.equals(nPrev)) continue; + for (d = r - 1; d != 0; d--) { + x = x.square().mod(n); + if (x.isUnit()) return false; + if (x.equals(nPrev)) continue next; + } + return false; + } + return true; + } + + // Set "strict" to true to force GRH-supported lower bound of 2*log(N)^2 + BigInteger.prototype.isPrime = function (strict) { + var isPrime = isBasicPrime(this); + if (isPrime !== undefined) return isPrime; + var n = this.abs(); + var bits = n.bitLength(); + if (bits <= 64) + return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]); + var logN = Math.log(2) * bits.toJSNumber(); + var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN); + for (var a = [], i = 0; i < t; i++) { + a.push(bigInt(i + 2)); + } + return millerRabinTest(n, a); + }; + NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime; + + BigInteger.prototype.isProbablePrime = function (iterations, rng) { + var isPrime = isBasicPrime(this); + if (isPrime !== undefined) return isPrime; + var n = this.abs(); + var t = iterations === undefined ? 5 : iterations; + for (var a = [], i = 0; i < t; i++) { + a.push(bigInt.randBetween(2, n.minus(2), rng)); + } + return millerRabinTest(n, a); + }; + NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; + + BigInteger.prototype.modInv = function (n) { + var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; + while (!newR.isZero()) { + q = r.divide(newR); + lastT = t; + lastR = r; + t = newT; + r = newR; + newT = lastT.subtract(q.multiply(newT)); + newR = lastR.subtract(q.multiply(newR)); + } + if (!r.isUnit()) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime"); + if (t.compare(0) === -1) { + t = t.add(n); + } + if (this.isNegative()) { + return t.negate(); + } + return t; + }; + + NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv; + + BigInteger.prototype.next = function () { + var value = this.value; + if (this.sign) { + return subtractSmall(value, 1, this.sign); + } + return new BigInteger(addSmall(value, 1), this.sign); + }; + SmallInteger.prototype.next = function () { + var value = this.value; + if (value + 1 < MAX_INT) return new SmallInteger(value + 1); + return new BigInteger(MAX_INT_ARR, false); + }; + NativeBigInt.prototype.next = function () { + return new NativeBigInt(this.value + BigInt(1)); + } + + BigInteger.prototype.prev = function () { + var value = this.value; + if (this.sign) { + return new BigInteger(addSmall(value, 1), true); + } + return subtractSmall(value, 1, this.sign); + }; + SmallInteger.prototype.prev = function () { + var value = this.value; + if (value - 1 > -MAX_INT) return new SmallInteger(value - 1); + return new BigInteger(MAX_INT_ARR, true); + }; + NativeBigInt.prototype.prev = function () { + return new NativeBigInt(this.value - BigInt(1)); + } + + var powersOfTwo = [1]; + while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); + var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; + + function shift_isSmall(n) { + return Math.abs(n) <= BASE; + } + + BigInteger.prototype.shiftLeft = function (v) { + var n = parseValue(v).toJSNumber(); + if (!shift_isSmall(n)) { + throw new Error(String(n) + " is too large for shifting."); + } + if (n < 0) return this.shiftRight(-n); + var result = this; + if (result.isZero()) return result; + while (n >= powers2Length) { + result = result.multiply(highestPower2); + n -= powers2Length - 1; + } + return result.multiply(powersOfTwo[n]); + }; + NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft; + + BigInteger.prototype.shiftRight = function (v) { + var remQuo; + var n = parseValue(v).toJSNumber(); + if (!shift_isSmall(n)) { + throw new Error(String(n) + " is too large for shifting."); + } + if (n < 0) return this.shiftLeft(-n); + var result = this; + while (n >= powers2Length) { + if (result.isZero() || (result.isNegative() && result.isUnit())) return result; + remQuo = divModAny(result, highestPower2); + result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; + n -= powers2Length - 1; + } + remQuo = divModAny(result, powersOfTwo[n]); + return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; + }; + NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight; + + function bitwise(x, y, fn) { + y = parseValue(y); + var xSign = x.isNegative(), ySign = y.isNegative(); + var xRem = xSign ? x.not() : x, + yRem = ySign ? y.not() : y; + var xDigit = 0, yDigit = 0; + var xDivMod = null, yDivMod = null; + var result = []; + while (!xRem.isZero() || !yRem.isZero()) { + xDivMod = divModAny(xRem, highestPower2); + xDigit = xDivMod[1].toJSNumber(); + if (xSign) { + xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers + } + + yDivMod = divModAny(yRem, highestPower2); + yDigit = yDivMod[1].toJSNumber(); + if (ySign) { + yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers + } + + xRem = xDivMod[0]; + yRem = yDivMod[0]; + result.push(fn(xDigit, yDigit)); + } + var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); + for (var i = result.length - 1; i >= 0; i -= 1) { + sum = sum.multiply(highestPower2).add(bigInt(result[i])); + } + return sum; + } + + BigInteger.prototype.not = function () { + return this.negate().prev(); + }; + NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not; + + BigInteger.prototype.and = function (n) { + return bitwise(this, n, function (a, b) { return a & b; }); + }; + NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and; + + BigInteger.prototype.or = function (n) { + return bitwise(this, n, function (a, b) { return a | b; }); + }; + NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or; + + BigInteger.prototype.xor = function (n) { + return bitwise(this, n, function (a, b) { return a ^ b; }); + }; + NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor; + + var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I; + function roughLOB(n) { // get lowestOneBit (rough) + // SmallInteger: return Min(lowestOneBit(n), 1 << 30) + // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7] + var v = n.value, + x = typeof v === "number" ? v | LOBMASK_I : + typeof v === "bigint" ? v | BigInt(LOBMASK_I) : + v[0] + v[1] * BASE | LOBMASK_BI; + return x & -x; + } + + function integerLogarithm(value, base) { + if (base.compareTo(value) <= 0) { + var tmp = integerLogarithm(value, base.square(base)); + var p = tmp.p; + var e = tmp.e; + var t = p.multiply(base); + return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 }; + } + return { p: bigInt(1), e: 0 }; + } + + BigInteger.prototype.bitLength = function () { + var n = this; + if (n.compareTo(bigInt(0)) < 0) { + n = n.negate().subtract(bigInt(1)); + } + if (n.compareTo(bigInt(0)) === 0) { + return bigInt(0); + } + return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)); + } + NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; + + function max(a, b) { + a = parseValue(a); + b = parseValue(b); + return a.greater(b) ? a : b; + } + function min(a, b) { + a = parseValue(a); + b = parseValue(b); + return a.lesser(b) ? a : b; + } + function gcd(a, b) { + a = parseValue(a).abs(); + b = parseValue(b).abs(); + if (a.equals(b)) return a; + if (a.isZero()) return b; + if (b.isZero()) return a; + var c = Integer[1], d, t; + while (a.isEven() && b.isEven()) { + d = min(roughLOB(a), roughLOB(b)); + a = a.divide(d); + b = b.divide(d); + c = c.multiply(d); + } + while (a.isEven()) { + a = a.divide(roughLOB(a)); + } + do { + while (b.isEven()) { + b = b.divide(roughLOB(b)); + } + if (a.greater(b)) { + t = b; b = a; a = t; + } + b = b.subtract(a); + } while (!b.isZero()); + return c.isUnit() ? a : a.multiply(c); + } + function lcm(a, b) { + a = parseValue(a).abs(); + b = parseValue(b).abs(); + return a.divide(gcd(a, b)).multiply(b); + } + function randBetween(a, b, rng) { + a = parseValue(a); + b = parseValue(b); + var usedRNG = rng || Math.random; + var low = min(a, b), high = max(a, b); + var range = high.subtract(low).add(1); + if (range.isSmall) return low.add(Math.floor(usedRNG() * range)); + var digits = toBase(range, BASE).value; + var result = [], restricted = true; + for (var i = 0; i < digits.length; i++) { + var top = restricted ? digits[i] + (i + 1 < digits.length ? digits[i + 1] / BASE : 0) : BASE; + var digit = truncate(usedRNG() * top); + result.push(digit); + if (digit < digits[i]) restricted = false; + } + return low.add(Integer.fromArray(result, BASE, false)); + } + + var parseBase = function (text, base, alphabet, caseSensitive) { + alphabet = alphabet || DEFAULT_ALPHABET; + text = String(text); + if (!caseSensitive) { + text = text.toLowerCase(); + alphabet = alphabet.toLowerCase(); + } + var length = text.length; + var i; + var absBase = Math.abs(base); + var alphabetValues = {}; + for (i = 0; i < alphabet.length; i++) { + alphabetValues[alphabet[i]] = i; + } + for (i = 0; i < length; i++) { + var c = text[i]; + if (c === "-") continue; + if (c in alphabetValues) { + if (alphabetValues[c] >= absBase) { + if (c === "1" && absBase === 1) continue; + throw new Error(c + " is not a valid digit in base " + base + "."); + } + } + } + base = parseValue(base); + var digits = []; + var isNegative = text[0] === "-"; + for (i = isNegative ? 1 : 0; i < text.length; i++) { + var c = text[i]; + if (c in alphabetValues) digits.push(parseValue(alphabetValues[c])); + else if (c === "<") { + var start = i; + do { i++; } while (text[i] !== ">" && i < text.length); + digits.push(parseValue(text.slice(start + 1, i))); + } + else throw new Error(c + " is not a valid character"); + } + return parseBaseFromArray(digits, base, isNegative); + }; + + function parseBaseFromArray(digits, base, isNegative) { + var val = Integer[0], pow = Integer[1], i; + for (i = digits.length - 1; i >= 0; i--) { + val = val.add(digits[i].times(pow)); + pow = pow.times(base); + } + return isNegative ? val.negate() : val; + } + + function stringify(digit, alphabet) { + alphabet = alphabet || DEFAULT_ALPHABET; + if (digit < alphabet.length) { + return alphabet[digit]; + } + return "<" + digit + ">"; + } + + function toBase(n, base) { + base = bigInt(base); + if (base.isZero()) { + if (n.isZero()) return { value: [0], isNegative: false }; + throw new Error("Cannot convert nonzero numbers to base 0."); + } + if (base.equals(-1)) { + if (n.isZero()) return { value: [0], isNegative: false }; + if (n.isNegative()) + return { + value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())) + .map(Array.prototype.valueOf, [1, 0]) + ), + isNegative: false + }; + + var arr = Array.apply(null, Array(n.toJSNumber() - 1)) + .map(Array.prototype.valueOf, [0, 1]); + arr.unshift([1]); + return { + value: [].concat.apply([], arr), + isNegative: false + }; + } + + var neg = false; + if (n.isNegative() && base.isPositive()) { + neg = true; + n = n.abs(); + } + if (base.isUnit()) { + if (n.isZero()) return { value: [0], isNegative: false }; + + return { + value: Array.apply(null, Array(n.toJSNumber())) + .map(Number.prototype.valueOf, 1), + isNegative: neg + }; + } + var out = []; + var left = n, divmod; + while (left.isNegative() || left.compareAbs(base) >= 0) { + divmod = left.divmod(base); + left = divmod.quotient; + var digit = divmod.remainder; + if (digit.isNegative()) { + digit = base.minus(digit).abs(); + left = left.next(); + } + out.push(digit.toJSNumber()); + } + out.push(left.toJSNumber()); + return { value: out.reverse(), isNegative: neg }; + } + + function toBaseString(n, base, alphabet) { + var arr = toBase(n, base); + return (arr.isNegative ? "-" : "") + arr.value.map(function (x) { + return stringify(x, alphabet); + }).join(''); + } + + BigInteger.prototype.toArray = function (radix) { + return toBase(this, radix); + }; + + SmallInteger.prototype.toArray = function (radix) { + return toBase(this, radix); + }; + + NativeBigInt.prototype.toArray = function (radix) { + return toBase(this, radix); + }; + + BigInteger.prototype.toString = function (radix, alphabet) { + if (radix === undefined) radix = 10; + if (radix !== 10 || alphabet) return toBaseString(this, radix, alphabet); + var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit; + while (--l >= 0) { + digit = String(v[l]); + str += zeros.slice(digit.length) + digit; + } + var sign = this.sign ? "-" : ""; + return sign + str; + }; + + SmallInteger.prototype.toString = function (radix, alphabet) { + if (radix === undefined) radix = 10; + if (radix != 10 || alphabet) return toBaseString(this, radix, alphabet); + return String(this.value); + }; + + NativeBigInt.prototype.toString = SmallInteger.prototype.toString; + + NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); } + + BigInteger.prototype.valueOf = function () { + return parseInt(this.toString(), 10); + }; + BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf; + + SmallInteger.prototype.valueOf = function () { + return this.value; + }; + SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; + NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () { + return parseInt(this.toString(), 10); + } + + function parseStringValue(v) { + if (isPrecise(+v)) { + var x = +v; + if (x === truncate(x)) + return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x); + throw new Error("Invalid integer: " + v); + } + var sign = v[0] === "-"; + if (sign) v = v.slice(1); + var split = v.split(/e/i); + if (split.length > 2) throw new Error("Invalid integer: " + split.join("e")); + if (split.length === 2) { + var exp = split[1]; + if (exp[0] === "+") exp = exp.slice(1); + exp = +exp; + if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent."); + var text = split[0]; + var decimalPlace = text.indexOf("."); + if (decimalPlace >= 0) { + exp -= text.length - decimalPlace - 1; + text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1); + } + if (exp < 0) throw new Error("Cannot include negative exponent part for integers"); + text += (new Array(exp + 1)).join("0"); + v = text; + } + var isValid = /^([0-9][0-9]*)$/.test(v); + if (!isValid) throw new Error("Invalid integer: " + v); + if (supportsNativeBigInt) { + return new NativeBigInt(BigInt(sign ? "-" + v : v)); + } + var r = [], max = v.length, l = LOG_BASE, min = max - l; + while (max > 0) { + r.push(+v.slice(min, max)); + min -= l; + if (min < 0) min = 0; + max -= l; + } + trim(r); + return new BigInteger(r, sign); + } + + function parseNumberValue(v) { + if (supportsNativeBigInt) { + return new NativeBigInt(BigInt(v)); + } + if (isPrecise(v)) { + if (v !== truncate(v)) throw new Error(v + " is not an integer."); + return new SmallInteger(v); + } + return parseStringValue(v.toString()); + } + + function parseValue(v) { + if (typeof v === "number") { + return parseNumberValue(v); + } + if (typeof v === "string") { + return parseStringValue(v); + } + if (typeof v === "bigint") { + return new NativeBigInt(v); + } + return v; + } + // Pre-define numbers in range [-999,999] + for (var i = 0; i < 1000; i++) { + Integer[i] = parseValue(i); + if (i > 0) Integer[-i] = parseValue(-i); + } + // Backwards compatibility + Integer.one = Integer[1]; + Integer.zero = Integer[0]; + Integer.minusOne = Integer[-1]; + Integer.max = max; + Integer.min = min; + Integer.gcd = gcd; + Integer.lcm = lcm; + Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; }; + Integer.randBetween = randBetween; + + Integer.fromArray = function (digits, base, isNegative) { + return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative); + }; + + return Integer; +})(); + +// Node.js check +if (typeof module !== "undefined" && module.hasOwnProperty("exports")) { + module.exports = bigInt; +} + +//amd check +if (typeof define === "function" && define.amd) { + define( function () { + return bigInt; + }); +} diff --git a/node_modules/big-integer/BigInteger.min.js b/node_modules/big-integer/BigInteger.min.js new file mode 100644 index 0000000..a960fa6 --- /dev/null +++ b/node_modules/big-integer/BigInteger.min.js @@ -0,0 +1 @@ +var bigInt=function(undefined){"use strict";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),DEFAULT_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyz";var supportsNativeBigInt=typeof BigInt==="function";function Integer(v,radix,alphabet,caseSensitive){if(typeof v==="undefined")return Integer[0];if(typeof radix!=="undefined")return+radix===10&&!alphabet?parseValue(v):parseBase(v,radix,alphabet,caseSensitive);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function NativeBigInt(value){this.value=value}NativeBigInt.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;NativeBigInt.prototype.add=function(v){return new NativeBigInt(this.value+parseValue(v).value)};NativeBigInt.prototype.plus=NativeBigInt.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value==="number"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;NativeBigInt.prototype.subtract=function(v){return new NativeBigInt(this.value-parseValue(v).value)};NativeBigInt.prototype.minus=NativeBigInt.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};NativeBigInt.prototype.negate=function(){return new NativeBigInt(-this.value)};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};NativeBigInt.prototype.abs=function(){return new NativeBigInt(this.value>=0?this.value:-this.value)};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);if(supportsNativeBigInt){return[new NativeBigInt(self.value/n.value),new NativeBigInt(self.value%n.value)]}var a=self.value,b=n.value;var quotient;if(b===0)throw new Error("Cannot divide by zero");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};NativeBigInt.prototype.compareAbs=function(v){var a=this.value;var b=parseValue(v).value;a=a>=0?a:-a;b=b>=0?b:-b;return a===b?0:a>b?1:-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;NativeBigInt.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var a=this.value;var b=parseValue(v).value;return a===b?0:a>b?1:-1};NativeBigInt.prototype.compareTo=NativeBigInt.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};NativeBigInt.prototype.eq=NativeBigInt.prototype.equals=SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};NativeBigInt.prototype.neq=NativeBigInt.prototype.notEquals=SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};NativeBigInt.prototype.gt=NativeBigInt.prototype.greater=SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};NativeBigInt.prototype.lt=NativeBigInt.prototype.lesser=SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};NativeBigInt.prototype.geq=NativeBigInt.prototype.greaterOrEquals=SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};NativeBigInt.prototype.leq=NativeBigInt.prototype.lesserOrEquals=SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};NativeBigInt.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};NativeBigInt.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};NativeBigInt.prototype.isPositive=SmallInteger.prototype.isPositive;BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};NativeBigInt.prototype.isNegative=SmallInteger.prototype.isNegative;BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};NativeBigInt.prototype.isUnit=function(){return this.abs().value===BigInt(1)};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};NativeBigInt.prototype.isZero=function(){return this.value===BigInt(0)};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);if(n.isZero())return false;if(n.isUnit())return true;if(n.compareAbs(2)===0)return this.isEven();return this.mod(n).isZero()};NativeBigInt.prototype.isDivisibleBy=SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(49))return true}function millerRabinTest(n,a){var nPrev=n.prev(),b=nPrev,r=0,d,t,i,x;while(b.isEven())b=b.divide(2),r++;next:for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};NativeBigInt.prototype.prev=function(){return new NativeBigInt(this.value-BigInt(1))};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return Math.abs(n)<=BASE}BigInteger.prototype.shiftLeft=function(v){var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};NativeBigInt.prototype.shiftLeft=SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(v){var remQuo;var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};NativeBigInt.prototype.shiftRight=SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};NativeBigInt.prototype.not=SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};NativeBigInt.prototype.and=SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};NativeBigInt.prototype.or=SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};NativeBigInt.prototype.xor=SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v==="number"?v|LOBMASK_I:typeof v==="bigint"?v|BigInt(LOBMASK_I):v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};NativeBigInt.prototype.bitLength=SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b,rng){a=parseValue(a);b=parseValue(b);var usedRNG=rng||Math.random;var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(usedRNG()*range));var digits=toBase(range,BASE).value;var result=[],restricted=true;for(var i=0;i=absBase){if(c==="1"&&absBase===1)continue;throw new Error(c+" is not a valid digit in base "+base+".")}}}base=parseValue(base);var digits=[];var isNegative=text[0]==="-";for(i=isNegative?1:0;i"&&i=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit,alphabet){alphabet=alphabet||DEFAULT_ALPHABET;if(digit"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error("Cannot convert nonzero numbers to base 0.")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(n.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.isUnit()){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(n.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base,alphabet){var arr=toBase(n,base);return(arr.isNegative?"-":"")+arr.value.map(function(x){return stringify(x,alphabet)}).join("")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};NativeBigInt.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!==10||alphabet)return toBaseString(this,radix,alphabet);var v=this.value,l=v.length,str=String(v[--l]),zeros="0000000",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?"-":"";return sign+str};SmallInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!=10||alphabet)return toBaseString(this,radix,alphabet);return String(this.value)};NativeBigInt.prototype.toString=SmallInteger.prototype.toString;NativeBigInt.prototype.toJSON=BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;NativeBigInt.prototype.valueOf=NativeBigInt.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return supportsNativeBigInt?new NativeBigInt(BigInt(x)):new SmallInteger(x);throw new Error("Invalid integer: "+v)}var sign=v[0]==="-";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error("Invalid integer: "+split.join("e"));if(split.length===2){var exp=split[1];if(exp[0]==="+")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error("Invalid integer: "+exp+" is not a valid exponent.");var text=split[0];var decimalPlace=text.indexOf(".");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error("Cannot include negative exponent part for integers");text+=new Array(exp+1).join("0");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error("Invalid integer: "+v);if(supportsNativeBigInt){return new NativeBigInt(BigInt(sign?"-"+v:v))}var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(supportsNativeBigInt){return new NativeBigInt(BigInt(v))}if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+" is not an integer.");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v==="number"){return parseNumberValue(v)}if(typeof v==="string"){return parseStringValue(v)}if(typeof v==="bigint"){return new NativeBigInt(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=parseValue(i);if(i>0)Integer[-i]=parseValue(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger||x instanceof NativeBigInt};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!=="undefined"&&module.hasOwnProperty("exports")){module.exports=bigInt}if(typeof define==="function"&&define.amd){define(function(){return bigInt})} \ No newline at end of file diff --git a/node_modules/big-integer/LICENSE b/node_modules/big-integer/LICENSE new file mode 100644 index 0000000..cf1ab25 --- /dev/null +++ b/node_modules/big-integer/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +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 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. + +For more information, please refer to diff --git a/node_modules/big-integer/README.md b/node_modules/big-integer/README.md new file mode 100644 index 0000000..d72420f --- /dev/null +++ b/node_modules/big-integer/README.md @@ -0,0 +1,589 @@ +# BigInteger.js [![Build Status][travis-img]][travis-url] [![Coverage Status][coveralls-img]][coveralls-url] [![Monthly Downloads][downloads-img]][downloads-url] + +[travis-url]: https://travis-ci.org/peterolson/BigInteger.js +[travis-img]: https://travis-ci.org/peterolson/BigInteger.js.svg?branch=master +[coveralls-url]: https://coveralls.io/github/peterolson/BigInteger.js?branch=master +[coveralls-img]: https://coveralls.io/repos/peterolson/BigInteger.js/badge.svg?branch=master&service=github +[downloads-url]: https://www.npmjs.com/package/big-integer +[downloads-img]: https://img.shields.io/npm/dm/big-integer.svg + +**BigInteger.js** is an arbitrary-length integer library for Javascript, allowing arithmetic operations on integers of unlimited size, notwithstanding memory and time limitations. + +**Update (December 2, 2018):** [`BigInt` is being added as a native feature of JavaScript](https://tc39.github.io/proposal-bigint/). This library now works as a polyfill: if the environment supports the native `BigInt`, this library acts as a thin wrapper over the native implementation. + +## Installation + +If you are using a browser, you can download [BigInteger.js from GitHub](http://peterolson.github.com/BigInteger.js/BigInteger.min.js) or just hotlink to it: + + + +If you are using node, you can install BigInteger with [npm](https://npmjs.org/). + + npm install big-integer + +Then you can include it in your code: + + var bigInt = require("big-integer"); + + +## Usage +### `bigInt(number, [base], [alphabet], [caseSensitive])` + +You can create a bigInt by calling the `bigInt` function. You can pass in + + - a string, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails. + - a Javascript number, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails. + - another bigInt. + - nothing, and it will return `bigInt.zero`. + + If you provide a second parameter, then it will parse `number` as a number in base `base`. Note that `base` can be any bigInt (even negative or zero). The letters "a-z" and "A-Z" will be interpreted as the numbers 10 to 35. Higher digits can be specified in angle brackets (`<` and `>`). The default `base` is `10`. + + You can specify a custom alphabet for base conversion with the third parameter. The default `alphabet` is `"0123456789abcdefghijklmnopqrstuvwxyz"`. + + The fourth parameter specifies whether or not the number string should be case-sensitive, i.e. whether `a` and `A` should be treated as different digits. By default `caseSensitive` is `false`. + +Examples: + + var zero = bigInt(); + var ninetyThree = bigInt(93); + var largeNumber = bigInt("75643564363473453456342378564387956906736546456235345"); + var googol = bigInt("1e100"); + var bigNumber = bigInt(largeNumber); + + var maximumByte = bigInt("FF", 16); + var fiftyFiveGoogol = bigInt("<55>0", googol); + +Note that Javascript numbers larger than `9007199254740992` and smaller than `-9007199254740992` are not precisely represented numbers and will not produce exact results. If you are dealing with numbers outside that range, it is better to pass in strings. + +### Method Chaining + +Note that bigInt operations return bigInts, which allows you to chain methods, for example: + + var salary = bigInt(dollarsPerHour).times(hoursWorked).plus(randomBonuses) + +### Constants + +There are three named constants already stored that you do not have to construct with the `bigInt` function yourself: + + - `bigInt.one`, equivalent to `bigInt(1)` + - `bigInt.zero`, equivalent to `bigInt(0)` + - `bigInt.minusOne`, equivalent to `bigInt(-1)` + +The numbers from -999 to 999 are also already prestored and can be accessed using `bigInt[index]`, for example: + + - `bigInt[-999]`, equivalent to `bigInt(-999)` + - `bigInt[256]`, equivalent to `bigInt(256)` + +### Methods + +#### `abs()` + +Returns the absolute value of a bigInt. + + - `bigInt(-45).abs()` => `45` + - `bigInt(45).abs()` => `45` + +#### `add(number)` + +Performs addition. + + - `bigInt(5).add(7)` => `12` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition) + +#### `and(number)` + +Performs the bitwise AND operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(6).and(3)` => `2` + - `bigInt(6).and(-3)` => `4` + +#### `bitLength()` + +Returns the number of digits required to represent a bigInt in binary. + + - `bigInt(5)` => `3` (since 5 is `101` in binary, which is three digits long) + +#### `compare(number)` + +Performs a comparison between two numbers. If the numbers are equal, it returns `0`. If the first number is greater, it returns `1`. If the first number is lesser, it returns `-1`. + + - `bigInt(5).compare(5)` => `0` + - `bigInt(5).compare(4)` => `1` + - `bigInt(4).compare(5)` => `-1` + +#### `compareAbs(number)` + +Performs a comparison between the absolute value of two numbers. + + - `bigInt(5).compareAbs(-5)` => `0` + - `bigInt(5).compareAbs(4)` => `1` + - `bigInt(4).compareAbs(-5)` => `-1` + +#### `compareTo(number)` + +Alias for the `compare` method. + +#### `divide(number)` + +Performs integer division, disregarding the remainder. + + - `bigInt(59).divide(5)` => `11` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `divmod(number)` + +Performs division and returns an object with two properties: `quotient` and `remainder`. The sign of the remainder will match the sign of the dividend. + + - `bigInt(59).divmod(5)` => `{quotient: bigInt(11), remainder: bigInt(4) }` + - `bigInt(-5).divmod(2)` => `{quotient: bigInt(-2), remainder: bigInt(-1) }` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `eq(number)` + +Alias for the `equals` method. + +#### `equals(number)` + +Checks if two numbers are equal. + + - `bigInt(5).equals(5)` => `true` + - `bigInt(4).equals(7)` => `false` + +#### `geq(number)` + +Alias for the `greaterOrEquals` method. + + +#### `greater(number)` + +Checks if the first number is greater than the second. + + - `bigInt(5).greater(6)` => `false` + - `bigInt(5).greater(5)` => `false` + - `bigInt(5).greater(4)` => `true` + +#### `greaterOrEquals(number)` + +Checks if the first number is greater than or equal to the second. + + - `bigInt(5).greaterOrEquals(6)` => `false` + - `bigInt(5).greaterOrEquals(5)` => `true` + - `bigInt(5).greaterOrEquals(4)` => `true` + +#### `gt(number)` + +Alias for the `greater` method. + +#### `isDivisibleBy(number)` + +Returns `true` if the first number is divisible by the second number, `false` otherwise. + + - `bigInt(999).isDivisibleBy(333)` => `true` + - `bigInt(99).isDivisibleBy(5)` => `false` + +#### `isEven()` + +Returns `true` if the number is even, `false` otherwise. + + - `bigInt(6).isEven()` => `true` + - `bigInt(3).isEven()` => `false` + +#### `isNegative()` + +Returns `true` if the number is negative, `false` otherwise. +Returns `false` for `0` and `-0`. + + - `bigInt(-23).isNegative()` => `true` + - `bigInt(50).isNegative()` => `false` + +#### `isOdd()` + +Returns `true` if the number is odd, `false` otherwise. + + - `bigInt(13).isOdd()` => `true` + - `bigInt(40).isOdd()` => `false` + +#### `isPositive()` + +Return `true` if the number is positive, `false` otherwise. +Returns `false` for `0` and `-0`. + + - `bigInt(54).isPositive()` => `true` + - `bigInt(-1).isPositive()` => `false` + +#### `isPrime(strict?)` + +Returns `true` if the number is prime, `false` otherwise. +Set "strict" boolean to true to force GRH-supported lower bound of 2*log(N)^2. + + - `bigInt(5).isPrime()` => `true` + - `bigInt(6).isPrime()` => `false` + +#### `isProbablePrime([iterations], [rng])` + +Returns `true` if the number is very likely to be prime, `false` otherwise. +Supplying `iterations` is optional - it determines the number of iterations of the test (default: `5`). The more iterations, the lower chance of getting a false positive. +This uses the [Miller Rabin test](https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test). + + - `bigInt(5).isProbablePrime()` => `true` + - `bigInt(49).isProbablePrime()` => `false` + - `bigInt(1729).isProbablePrime()` => `false` + +Note that this function is not deterministic, since it relies on random sampling of factors, so the result for some numbers is not always the same - unless you pass a predictable random number generator as `rng`. The behavior and requirements are the same as with `randBetween`. + + - `bigInt(1729).isProbablePrime(1, () => 0.1)` => `false` + - `bigInt(1729).isProbablePrime(1, () => 0.2)` => `true` + +If the number is composite then the Miller–Rabin primality test declares the number probably prime with a probability at most `4` to the power `−iterations`. +If the number is prime, this function always returns `true`. + +#### `isUnit()` + +Returns `true` if the number is `1` or `-1`, `false` otherwise. + + - `bigInt.one.isUnit()` => `true` + - `bigInt.minusOne.isUnit()` => `true` + - `bigInt(5).isUnit()` => `false` + +#### `isZero()` + +Return `true` if the number is `0` or `-0`, `false` otherwise. + + - `bigInt.zero.isZero()` => `true` + - `bigInt("-0").isZero()` => `true` + - `bigInt(50).isZero()` => `false` + +#### `leq(number)` + +Alias for the `lesserOrEquals` method. + +#### `lesser(number)` + +Checks if the first number is lesser than the second. + + - `bigInt(5).lesser(6)` => `true` + - `bigInt(5).lesser(5)` => `false` + - `bigInt(5).lesser(4)` => `false` + +#### `lesserOrEquals(number)` + +Checks if the first number is less than or equal to the second. + + - `bigInt(5).lesserOrEquals(6)` => `true` + - `bigInt(5).lesserOrEquals(5)` => `true` + - `bigInt(5).lesserOrEquals(4)` => `false` + +#### `lt(number)` + +Alias for the `lesser` method. + +#### `minus(number)` + +Alias for the `subtract` method. + + - `bigInt(3).minus(5)` => `-2` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction) + +#### `mod(number)` + +Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. + + - `bigInt(59).mod(5)` => `4` + - `bigInt(-5).mod(2)` => `-1` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `modInv(mod)` + +Finds the [multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) of the number modulo `mod`. + + - `bigInt(3).modInv(11)` => `4` + - `bigInt(42).modInv(2017)` => `1969` + +#### `modPow(exp, mod)` + +Takes the number to the power `exp` modulo `mod`. + + - `bigInt(10).modPow(3, 30)` => `10` + +#### `multiply(number)` + +Performs multiplication. + + - `bigInt(111).multiply(111)` => `12321` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication) + +#### `neq(number)` + +Alias for the `notEquals` method. + +#### `next()` + +Adds one to the number. + + - `bigInt(6).next()` => `7` + +#### `not()` + +Performs the bitwise NOT operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(10).not()` => `-11` + - `bigInt(0).not()` => `-1` + +#### `notEquals(number)` + +Checks if two numbers are not equal. + + - `bigInt(5).notEquals(5)` => `false` + - `bigInt(4).notEquals(7)` => `true` + +#### `or(number)` + +Performs the bitwise OR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(13).or(10)` => `15` + - `bigInt(13).or(-8)` => `-3` + +#### `over(number)` + +Alias for the `divide` method. + + - `bigInt(59).over(5)` => `11` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `plus(number)` + +Alias for the `add` method. + + - `bigInt(5).plus(7)` => `12` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition) + +#### `pow(number)` + +Performs exponentiation. If the exponent is less than `0`, `pow` returns `0`. `bigInt.zero.pow(0)` returns `1`. + + - `bigInt(16).pow(16)` => `18446744073709551616` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Exponentiation) + +#### `prev(number)` + +Subtracts one from the number. + + - `bigInt(6).prev()` => `5` + +#### `remainder(number)` + +Alias for the `mod` method. + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `shiftLeft(n)` + +Shifts the number left by `n` places in its binary representation. If a negative number is provided, it will shift right. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`. + + - `bigInt(8).shiftLeft(2)` => `32` + - `bigInt(8).shiftLeft(-2)` => `2` + +#### `shiftRight(n)` + +Shifts the number right by `n` places in its binary representation. If a negative number is provided, it will shift left. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`. + + - `bigInt(8).shiftRight(2)` => `2` + - `bigInt(8).shiftRight(-2)` => `32` + +#### `square()` + +Squares the number + + - `bigInt(3).square()` => `9` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Squaring) + +#### `subtract(number)` + +Performs subtraction. + + - `bigInt(3).subtract(5)` => `-2` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction) + +#### `times(number)` + +Alias for the `multiply` method. + + - `bigInt(111).times(111)` => `12321` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication) + +#### `toArray(radix)` + +Converts a bigInt into an object with the properties "value" and "isNegative." "Value" is an array of integers modulo the given radix. "isNegative" is a boolean that represents the sign of the result. + + - `bigInt("1e9").toArray(10)` => { + value: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], + isNegative: false + } + - `bigInt("1e9").toArray(16)` => { + value: [3, 11, 9, 10, 12, 10, 0, 0], + isNegative: false + } + - `bigInt(567890).toArray(100)` => { + value: [56, 78, 90], + isNegative: false + } + +Negative bases are supported. + + - `bigInt(12345).toArray(-10)` => { + value: [2, 8, 4, 6, 5], + isNegative: false + } + +Base 1 and base -1 are also supported. + + - `bigInt(-15).toArray(1)` => { + value: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + isNegative: true + } + - `bigInt(-15).toArray(-1)` => { + value: [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], + isNegative: false + } + +Base 0 is only allowed for the number zero. + + - `bigInt(0).toArray(0)` => { + value: [0], + isNegative: false + } + - `bigInt(1).toArray(0)` => `Error: Cannot convert nonzero numbers to base 0.` + +#### `toJSNumber()` + +Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range `[-9007199254740992, 9007199254740992]`. + + - `bigInt("18446744073709551616").toJSNumber()` => `18446744073709552000` + +#### `xor(number)` + +Performs the bitwise XOR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(12).xor(5)` => `9` + - `bigInt(12).xor(-5)` => `-9` + +### Static Methods + +#### `fromArray(digits, base = 10, isNegative?)` + +Constructs a bigInt from an array of digits in base `base`. The optional `isNegative` flag will make the number negative. + + - `bigInt.fromArray([1, 2, 3, 4, 5], 10)` => `12345` + - `bigInt.fromArray([1, 0, 0], 2, true)` => `-4` + +#### `gcd(a, b)` + +Finds the greatest common denominator of `a` and `b`. + + - `bigInt.gcd(42,56)` => `14` + +#### `isInstance(x)` + +Returns `true` if `x` is a BigInteger, `false` otherwise. + + - `bigInt.isInstance(bigInt(14))` => `true` + - `bigInt.isInstance(14)` => `false` + +#### `lcm(a,b)` + +Finds the least common multiple of `a` and `b`. + + - `bigInt.lcm(21, 6)` => `42` + +#### `max(a,b)` + +Returns the largest of `a` and `b`. + + - `bigInt.max(77, 432)` => `432` + +#### `min(a,b)` + +Returns the smallest of `a` and `b`. + + - `bigInt.min(77, 432)` => `77` + +#### `randBetween(min, max, [rng])` + +Returns a random number between `min` and `max`, optionally using `rng` to generate randomness. + + - `bigInt.randBetween("-1e100", "1e100")` => (for example) `8494907165436643479673097939554427056789510374838494147955756275846226209006506706784609314471378745` + +`rng` should take no arguments and return a `number` between 0 and 1. It defaults to `Math.random`. + + - `bigInt.randBetween("-1e100", "1e100", () => 0.5)` => (always) `50000005000000500000050000005000000500000050000005000000500000050000005000000500000050000005000000` + + +### Override Methods + +#### `toString(radix = 10, [alphabet])` + +Converts a bigInt to a string. There is an optional radix parameter (which defaults to 10) that converts the number to the given radix. Digits in the range `10-35` will use the letters `a-z`. + + - `bigInt("1e9").toString()` => `"1000000000"` + - `bigInt("1e9").toString(16)` => `"3b9aca00"` + + You can use a custom base alphabet with the second parameter. The default `alphabet` is `"0123456789abcdefghijklmnopqrstuvwxyz"`. + + - `bigInt("5").toString(2, "aA")` => `"AaA"` + +**Note that arithmetical operators will trigger the `valueOf` function rather than the `toString` function.** When converting a bigInteger to a string, you should use the `toString` method or the `String` function instead of adding the empty string. + + - `bigInt("999999999999999999").toString()` => `"999999999999999999"` + - `String(bigInt("999999999999999999"))` => `"999999999999999999"` + - `bigInt("999999999999999999") + ""` => `1000000000000000000` + +Bases larger than 36 are supported. If a digit is greater than or equal to 36, it will be enclosed in angle brackets. + + - `bigInt(567890).toString(100)` => `"<56><78><90>"` + +Negative bases are also supported. + + - `bigInt(12345).toString(-10)` => `"28465"` + +Base 1 and base -1 are also supported. + + - `bigInt(-15).toString(1)` => `"-111111111111111"` + - `bigInt(-15).toString(-1)` => `"101010101010101010101010101010"` + +Base 0 is only allowed for the number zero. + + - `bigInt(0).toString(0)` => `0` + - `bigInt(1).toString(0)` => `Error: Cannot convert nonzero numbers to base 0.` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#toString) + +#### `valueOf()` + +Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion: + + - `bigInt("100") + bigInt("200") === 300; //true` + +## Contributors + +To contribute, just fork the project, make some changes, and submit a pull request. Please verify that the unit tests pass before submitting. + +The unit tests are contained in the `spec/spec.js` file. You can run them locally by opening the `spec/SpecRunner.html` or file or running `npm test`. You can also [run the tests online from GitHub](http://peterolson.github.io/BigInteger.js/spec/SpecRunner.html). + +There are performance benchmarks that can be viewed from the `benchmarks/index.html` page. You can [run them online from GitHub](http://peterolson.github.io/BigInteger.js/benchmark/). + +## License + +This project is public domain. For more details, read about the [Unlicense](http://unlicense.org/). diff --git a/node_modules/big-integer/bower.json b/node_modules/big-integer/bower.json new file mode 100644 index 0000000..22dc58f --- /dev/null +++ b/node_modules/big-integer/bower.json @@ -0,0 +1,29 @@ +{ + "name": "big-integer", + "description": "An arbitrary length integer library for Javascript", + "main": "./BigInteger.js", + "authors": [ + "Peter Olson" + ], + "license": "Unlicense", + "keywords": [ + "math", + "big", + "bignum", + "bigint", + "biginteger", + "integer", + "arbitrary", + "precision", + "arithmetic" + ], + "homepage": "https://github.com/peterolson/BigInteger.js", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "coverage", + "tests" + ] +} diff --git a/node_modules/big-integer/package.json b/node_modules/big-integer/package.json new file mode 100644 index 0000000..742570a --- /dev/null +++ b/node_modules/big-integer/package.json @@ -0,0 +1,48 @@ +{ + "name": "big-integer", + "version": "1.6.52", + "author": "Peter Olson ", + "description": "An arbitrary length integer library for Javascript", + "contributors": [], + "bin": {}, + "scripts": { + "test": "tsc && karma start my.conf.js && node spec/tsDefinitions.js", + "minify": "uglifyjs BigInteger.js -o BigInteger.min.js" + }, + "main": "./BigInteger", + "repository": { + "type": "git", + "url": "git@github.com:peterolson/BigInteger.js.git" + }, + "keywords": [ + "math", + "big", + "bignum", + "bigint", + "biginteger", + "integer", + "arbitrary", + "precision", + "arithmetic" + ], + "devDependencies": { + "@types/lodash": "^4.14.175", + "@types/node": "^7.10.2", + "coveralls": "^3.0.6", + "jasmine": "3.5.0", + "jasmine-core": "^3.5.0", + "karma": "^6.3.4", + "karma-cli": "^2.0.0", + "karma-coverage": "^2.0.3", + "karma-jasmine": "^4.0.1", + "karma-phantomjs-launcher": "^1.0.4", + "lodash": "^4.17.21", + "typescript": "^5.3.2", + "uglify-js": "^3.17.4" + }, + "license": "Unlicense", + "engines": { + "node": ">=0.6" + }, + "typings": "./BigInteger.d.ts" +} diff --git a/node_modules/big-integer/tsconfig.json b/node_modules/big-integer/tsconfig.json new file mode 100644 index 0000000..bb8e6cf --- /dev/null +++ b/node_modules/big-integer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "./", + "moduleResolution": "node", + "allowJs": true, + "typeRoots": [ + "./" + ], + "types": [], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "BigInteger.d.ts", + "spec/tsDefinitions.ts" + ] +} diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md new file mode 100644 index 0000000..c9b0b5b --- /dev/null +++ b/node_modules/body-parser/HISTORY.md @@ -0,0 +1,680 @@ +1.20.4 / 2025-12-01 +=================== + + * deps: qs@~6.14.0 + * deps: use tilde notation for dependencies + * deps: http-errors@~2.0.1 + * deps: raw-body@~2.5.3 + +1.20.3 / 2024-09-10 +=================== + + * deps: qs@6.13.0 + * add `depth` option to customize the depth level in the parser + * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`) + +1.20.2 / 2023-02-21 +=================== + + * Fix strict json error message on Node.js 19+ + * deps: content-type@~1.0.5 + - perf: skip value escaping when unnecessary + * deps: raw-body@2.5.2 + +1.20.1 / 2022-10-06 +=================== + + * deps: qs@6.11.0 + * perf: remove unnecessary object clone + +1.20.0 / 2022-04-02 +=================== + + * Fix error message for json parse whitespace in `strict` + * Fix internal error when inflated body exceeds limit + * Prevent loss of async hooks context + * Prevent hanging when request already read + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: http-errors@2.0.0 + - deps: depd@2.0.0 + - deps: statuses@2.0.1 + * deps: on-finished@2.4.1 + * deps: qs@6.10.3 + * deps: raw-body@2.5.1 + - deps: http-errors@2.0.0 + +1.19.2 / 2022-02-15 +=================== + + * deps: bytes@3.1.2 + * deps: qs@6.9.7 + * Fix handling of `__proto__` keys + * deps: raw-body@2.4.3 + - deps: bytes@3.1.2 + +1.19.1 / 2021-12-10 +=================== + + * deps: bytes@3.1.1 + * deps: http-errors@1.8.1 + - deps: inherits@2.0.4 + - deps: toidentifier@1.0.1 + - deps: setprototypeof@1.2.0 + * deps: qs@6.9.6 + * deps: raw-body@2.4.2 + - deps: bytes@3.1.1 + - deps: http-errors@1.8.1 + * deps: safe-buffer@5.2.1 + * deps: type-is@~1.6.18 + +1.19.0 / 2019-04-25 +=================== + + * deps: bytes@3.1.0 + - Add petabyte (`pb`) support + * deps: http-errors@1.7.2 + - Set constructor name when possible + - deps: setprototypeof@1.1.1 + - deps: statuses@'>= 1.5.0 < 2' + * deps: iconv-lite@0.4.24 + - Added encoding MIK + * deps: qs@6.7.0 + - Fix parsing array brackets after index + * deps: raw-body@2.4.0 + - deps: bytes@3.1.0 + - deps: http-errors@1.7.2 + - deps: iconv-lite@0.4.24 + * deps: type-is@~1.6.17 + - deps: mime-types@~2.1.24 + - perf: prevent internal `throw` on invalid type + +1.18.3 / 2018-05-14 +=================== + + * Fix stack trace for strict json parse error + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: http-errors@~1.6.3 + - deps: depd@~1.1.2 + - deps: setprototypeof@1.1.0 + - deps: statuses@'>= 1.3.1 < 2' + * deps: iconv-lite@0.4.23 + - Fix loading encoding with year appended + - Fix deprecation warnings on Node.js 10+ + * deps: qs@6.5.2 + * deps: raw-body@2.3.3 + - deps: http-errors@1.6.3 + - deps: iconv-lite@0.4.23 + * deps: type-is@~1.6.16 + - deps: mime-types@~2.1.18 + +1.18.2 / 2017-09-22 +=================== + + * deps: debug@2.6.9 + * perf: remove argument reassignment + +1.18.1 / 2017-09-12 +=================== + + * deps: content-type@~1.0.4 + - perf: remove argument reassignment + - perf: skip parameter parsing when no parameters + * deps: iconv-lite@0.4.19 + - Fix ISO-8859-1 regression + - Update Windows-1255 + * deps: qs@6.5.1 + - Fix parsing & compacting very deep objects + * deps: raw-body@2.3.2 + - deps: iconv-lite@0.4.19 + +1.18.0 / 2017-09-08 +=================== + + * Fix JSON strict violation error to match native parse error + * Include the `body` property on verify errors + * Include the `type` property on all generated errors + * Use `http-errors` to set status code on errors + * deps: bytes@3.0.0 + * deps: debug@2.6.8 + * deps: depd@~1.1.1 + - Remove unnecessary `Buffer` loading + * deps: http-errors@~1.6.2 + - deps: depd@1.1.1 + * deps: iconv-lite@0.4.18 + - Add support for React Native + - Add a warning if not loaded as utf-8 + - Fix CESU-8 decoding in Node.js 8 + - Improve speed of ISO-8859-1 encoding + * deps: qs@6.5.0 + * deps: raw-body@2.3.1 + - Use `http-errors` for standard emitted errors + - deps: bytes@3.0.0 + - deps: iconv-lite@0.4.18 + - perf: skip buffer decoding on overage chunk + * perf: prevent internal `throw` when missing charset + +1.17.2 / 2017-05-17 +=================== + + * deps: debug@2.6.7 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@2.0.0 + * deps: type-is@~1.6.15 + - deps: mime-types@~2.1.15 + +1.17.1 / 2017-03-06 +=================== + + * deps: qs@6.4.0 + - Fix regression parsing keys starting with `[` + +1.17.0 / 2017-03-01 +=================== + + * deps: http-errors@~1.6.1 + - Make `message` property enumerable for `HttpError`s + - deps: setprototypeof@1.0.3 + * deps: qs@6.3.1 + - Fix compacting nested arrays + +1.16.1 / 2017-02-10 +=================== + + * deps: debug@2.6.1 + - Fix deprecation messages in WebStorm and other editors + - Undeprecate `DEBUG_FD` set to `1` or `2` + +1.16.0 / 2017-01-17 +=================== + + * deps: debug@2.6.0 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: http-errors@~1.5.1 + - deps: inherits@2.0.3 + - deps: setprototypeof@1.0.2 + - deps: statuses@'>= 1.3.1 < 2' + * deps: iconv-lite@0.4.15 + - Added encoding MS-31J + - Added encoding MS-932 + - Added encoding MS-936 + - Added encoding MS-949 + - Added encoding MS-950 + - Fix GBK/GB18030 handling of Euro character + * deps: qs@6.2.1 + - Fix array parsing from skipping empty values + * deps: raw-body@~2.2.0 + - deps: iconv-lite@0.4.15 + * deps: type-is@~1.6.14 + - deps: mime-types@~2.1.13 + +1.15.2 / 2016-06-19 +=================== + + * deps: bytes@2.4.0 + * deps: content-type@~1.0.2 + - perf: enable strict mode + * deps: http-errors@~1.5.0 + - Use `setprototypeof` module to replace `__proto__` setting + - deps: statuses@'>= 1.3.0 < 2' + - perf: enable strict mode + * deps: qs@6.2.0 + * deps: raw-body@~2.1.7 + - deps: bytes@2.4.0 + - perf: remove double-cleanup on happy path + * deps: type-is@~1.6.13 + - deps: mime-types@~2.1.11 + +1.15.1 / 2016-05-05 +=================== + + * deps: bytes@2.3.0 + - Drop partial bytes on all parsed units + - Fix parsing byte string that looks like hex + * deps: raw-body@~2.1.6 + - deps: bytes@2.3.0 + * deps: type-is@~1.6.12 + - deps: mime-types@~2.1.10 + +1.15.0 / 2016-02-10 +=================== + + * deps: http-errors@~1.4.0 + - Add `HttpError` export, for `err instanceof createError.HttpError` + - deps: inherits@2.0.1 + - deps: statuses@'>= 1.2.1 < 2' + * deps: qs@6.1.0 + * deps: type-is@~1.6.11 + - deps: mime-types@~2.1.9 + +1.14.2 / 2015-12-16 +=================== + + * deps: bytes@2.2.0 + * deps: iconv-lite@0.4.13 + * deps: qs@5.2.0 + * deps: raw-body@~2.1.5 + - deps: bytes@2.2.0 + - deps: iconv-lite@0.4.13 + * deps: type-is@~1.6.10 + - deps: mime-types@~2.1.8 + +1.14.1 / 2015-09-27 +=================== + + * Fix issue where invalid charset results in 400 when `verify` used + * deps: iconv-lite@0.4.12 + - Fix CESU-8 decoding in Node.js 4.x + * deps: raw-body@~2.1.4 + - Fix masking critical errors from `iconv-lite` + - deps: iconv-lite@0.4.12 + * deps: type-is@~1.6.9 + - deps: mime-types@~2.1.7 + +1.14.0 / 2015-09-16 +=================== + + * Fix JSON strict parse error to match syntax errors + * Provide static `require` analysis in `urlencoded` parser + * deps: depd@~1.1.0 + - Support web browser loading + * deps: qs@5.1.0 + * deps: raw-body@~2.1.3 + - Fix sync callback when attaching data listener causes sync read + * deps: type-is@~1.6.8 + - Fix type error when given invalid type to match against + - deps: mime-types@~2.1.6 + +1.13.3 / 2015-07-31 +=================== + + * deps: type-is@~1.6.6 + - deps: mime-types@~2.1.4 + +1.13.2 / 2015-07-05 +=================== + + * deps: iconv-lite@0.4.11 + * deps: qs@4.0.0 + - Fix dropping parameters like `hasOwnProperty` + - Fix user-visible incompatibilities from 3.1.0 + - Fix various parsing edge cases + * deps: raw-body@~2.1.2 + - Fix error stack traces to skip `makeError` + - deps: iconv-lite@0.4.11 + * deps: type-is@~1.6.4 + - deps: mime-types@~2.1.2 + - perf: enable strict mode + - perf: remove argument reassignment + +1.13.1 / 2015-06-16 +=================== + + * deps: qs@2.4.2 + - Downgraded from 3.1.0 because of user-visible incompatibilities + +1.13.0 / 2015-06-14 +=================== + + * Add `statusCode` property on `Error`s, in addition to `status` + * Change `type` default to `application/json` for JSON parser + * Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser + * Provide static `require` analysis + * Use the `http-errors` module to generate errors + * deps: bytes@2.1.0 + - Slight optimizations + * deps: iconv-lite@0.4.10 + - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails + - Leading BOM is now removed when decoding + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * deps: qs@3.1.0 + - Fix dropping parameters like `hasOwnProperty` + - Fix various parsing edge cases + - Parsed object now has `null` prototype + * deps: raw-body@~2.1.1 + - Use `unpipe` module for unpiping requests + - deps: iconv-lite@0.4.10 + * deps: type-is@~1.6.3 + - deps: mime-types@~2.1.1 + - perf: reduce try block size + - perf: remove bitwise operations + * perf: enable strict mode + * perf: remove argument reassignment + * perf: remove delete call + +1.12.4 / 2015-05-10 +=================== + + * deps: debug@~2.2.0 + * deps: qs@2.4.2 + - Fix allowing parameters like `constructor` + * deps: on-finished@~2.2.1 + * deps: raw-body@~2.0.1 + - Fix a false-positive when unpiping in Node.js 0.8 + - deps: bytes@2.0.1 + * deps: type-is@~1.6.2 + - deps: mime-types@~2.0.11 + +1.12.3 / 2015-04-15 +=================== + + * Slight efficiency improvement when not debugging + * deps: depd@~1.0.1 + * deps: iconv-lite@0.4.8 + - Add encoding alias UNICODE-1-1-UTF-7 + * deps: raw-body@1.3.4 + - Fix hanging callback if request aborts during read + - deps: iconv-lite@0.4.8 + +1.12.2 / 2015-03-16 +=================== + + * deps: qs@2.4.1 + - Fix error when parameter `hasOwnProperty` is present + +1.12.1 / 2015-03-15 +=================== + + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: type-is@~1.6.1 + - deps: mime-types@~2.0.10 + +1.12.0 / 2015-02-13 +=================== + + * add `debug` messages + * accept a function for the `type` option + * use `content-type` to parse `Content-Type` headers + * deps: iconv-lite@0.4.7 + - Gracefully support enumerables on `Object.prototype` + * deps: raw-body@1.3.3 + - deps: iconv-lite@0.4.7 + * deps: type-is@~1.6.0 + - fix argument reassignment + - fix false-positives in `hasBody` `Transfer-Encoding` check + - support wildcard for both type and subtype (`*/*`) + - deps: mime-types@~2.0.9 + +1.11.0 / 2015-01-30 +=================== + + * make internal `extended: true` depth limit infinity + * deps: type-is@~1.5.6 + - deps: mime-types@~2.0.8 + +1.10.2 / 2015-01-20 +=================== + + * deps: iconv-lite@0.4.6 + - Fix rare aliases of single-byte encodings + * deps: raw-body@1.3.2 + - deps: iconv-lite@0.4.6 + +1.10.1 / 2015-01-01 +=================== + + * deps: on-finished@~2.2.0 + * deps: type-is@~1.5.5 + - deps: mime-types@~2.0.7 + +1.10.0 / 2014-12-02 +=================== + + * make internal `extended: true` array limit dynamic + +1.9.3 / 2014-11-21 +================== + + * deps: iconv-lite@0.4.5 + - Fix Windows-31J and X-SJIS encoding support + * deps: qs@2.3.3 + - Fix `arrayLimit` behavior + * deps: raw-body@1.3.1 + - deps: iconv-lite@0.4.5 + * deps: type-is@~1.5.3 + - deps: mime-types@~2.0.3 + +1.9.2 / 2014-10-27 +================== + + * deps: qs@2.3.2 + - Fix parsing of mixed objects and values + +1.9.1 / 2014-10-22 +================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + * deps: qs@2.3.0 + - Fix parsing of mixed implicit and explicit arrays + * deps: type-is@~1.5.2 + - deps: mime-types@~2.0.2 + +1.9.0 / 2014-09-24 +================== + + * include the charset in "unsupported charset" error message + * include the encoding in "unsupported content encoding" error message + * deps: depd@~1.0.0 + +1.8.4 / 2014-09-23 +================== + + * fix content encoding to be case-insensitive + +1.8.3 / 2014-09-19 +================== + + * deps: qs@2.2.4 + - Fix issue with object keys starting with numbers truncated + +1.8.2 / 2014-09-15 +================== + + * deps: depd@0.4.5 + +1.8.1 / 2014-09-07 +================== + + * deps: media-typer@0.3.0 + * deps: type-is@~1.5.1 + +1.8.0 / 2014-09-05 +================== + + * make empty-body-handling consistent between chunked requests + - empty `json` produces `{}` + - empty `raw` produces `new Buffer(0)` + - empty `text` produces `''` + - empty `urlencoded` produces `{}` + * deps: qs@2.2.3 + - Fix issue where first empty value in array is discarded + * deps: type-is@~1.5.0 + - fix `hasbody` to be true for `content-length: 0` + +1.7.0 / 2014-09-01 +================== + + * add `parameterLimit` option to `urlencoded` parser + * change `urlencoded` extended array limit to 100 + * respond with 413 when over `parameterLimit` in `urlencoded` + +1.6.7 / 2014-08-29 +================== + + * deps: qs@2.2.2 + - Remove unnecessary cloning + +1.6.6 / 2014-08-27 +================== + + * deps: qs@2.2.0 + - Array parsing fix + - Performance improvements + +1.6.5 / 2014-08-16 +================== + + * deps: on-finished@2.1.0 + +1.6.4 / 2014-08-14 +================== + + * deps: qs@1.2.2 + +1.6.3 / 2014-08-10 +================== + + * deps: qs@1.2.1 + +1.6.2 / 2014-08-07 +================== + + * deps: qs@1.2.0 + - Fix parsing array of objects + +1.6.1 / 2014-08-06 +================== + + * deps: qs@1.1.0 + - Accept urlencoded square brackets + - Accept empty values in implicit array notation + +1.6.0 / 2014-08-05 +================== + + * deps: qs@1.0.2 + - Complete rewrite + - Limits array length to 20 + - Limits object depth to 5 + - Limits parameters to 1,000 + +1.5.2 / 2014-07-27 +================== + + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + +1.5.1 / 2014-07-26 +================== + + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + +1.5.0 / 2014-07-20 +================== + + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: iconv-lite@0.4.4 + - Added encoding UTF-7 + * deps: raw-body@1.3.0 + - deps: iconv-lite@0.4.4 + - Added encoding UTF-7 + - Fix `Cannot switch to old mode now` error on Node.js 0.10+ + * deps: type-is@~1.3.2 + +1.4.3 / 2014-06-19 +================== + + * deps: type-is@1.3.1 + - fix global variable leak + +1.4.2 / 2014-06-19 +================== + + * deps: type-is@1.3.0 + - improve type parsing + +1.4.1 / 2014-06-19 +================== + + * fix urlencoded extended deprecation message + +1.4.0 / 2014-06-19 +================== + + * add `text` parser + * add `raw` parser + * check accepted charset in content-type (accepts utf-8) + * check accepted encoding in content-encoding (accepts identity) + * deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed + * deprecate `urlencoded()` without provided `extended` option + * lazy-load urlencoded parsers + * parsers split into files for reduced mem usage + * support gzip and deflate bodies + - set `inflate: false` to turn off + * deps: raw-body@1.2.2 + - Support all encodings from `iconv-lite` + +1.3.1 / 2014-06-11 +================== + + * deps: type-is@1.2.1 + - Switch dependency from mime to mime-types@1.0.0 + +1.3.0 / 2014-05-31 +================== + + * add `extended` option to urlencoded parser + +1.2.2 / 2014-05-27 +================== + + * deps: raw-body@1.1.6 + - assert stream encoding on node.js 0.8 + - assert stream encoding on node.js < 0.10.6 + - deps: bytes@1 + +1.2.1 / 2014-05-26 +================== + + * invoke `next(err)` after request fully read + - prevents hung responses and socket hang ups + +1.2.0 / 2014-05-11 +================== + + * add `verify` option + * deps: type-is@1.2.0 + - support suffix matching + +1.1.2 / 2014-05-11 +================== + + * improve json parser speed + +1.1.1 / 2014-05-11 +================== + + * fix repeated limit parsing with every request + +1.1.0 / 2014-05-10 +================== + + * add `type` option + * deps: pin for safety and consistency + +1.0.2 / 2014-04-14 +================== + + * use `type-is` module + +1.0.1 / 2014-03-20 +================== + + * lower default limits to 100kb diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md index 39d320f..f6661b7 100644 --- a/node_modules/body-parser/README.md +++ b/node_modules/body-parser/README.md @@ -17,18 +17,18 @@ before trusting. For example, `req.body.foo.toString()` may fail in multiple ways, for example the `foo` property may not be there or may not be a string, and `toString` may not be a function and instead a string or other user input. -[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/learn/http/anatomy-of-an-http-transaction). +[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). _This does not handle multipart bodies_, due to their complex and typically large nature. For multipart bodies, you may be interested in the following modules: - * [busboy](https://www.npmjs.com/package/busboy#readme) and - [connect-busboy](https://www.npmjs.com/package/connect-busboy#readme) - * [multiparty](https://www.npmjs.com/package/multiparty#readme) and - [connect-multiparty](https://www.npmjs.com/package/connect-multiparty#readme) - * [formidable](https://www.npmjs.com/package/formidable#readme) - * [multer](https://www.npmjs.com/package/multer#readme) + * [busboy](https://www.npmjs.org/package/busboy#readme) and + [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) + * [multiparty](https://www.npmjs.org/package/multiparty#readme) and + [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) + * [formidable](https://www.npmjs.org/package/formidable#readme) + * [multer](https://www.npmjs.org/package/multer#readme) This module provides the following parsers: @@ -39,8 +39,8 @@ This module provides the following parsers: Other body parsers you might be interested in: -- [body](https://www.npmjs.com/package/body#readme) -- [co-body](https://www.npmjs.com/package/co-body#readme) +- [body](https://www.npmjs.org/package/body#readme) +- [co-body](https://www.npmjs.org/package/co-body#readme) ## Installation @@ -51,12 +51,14 @@ $ npm install body-parser ## API ```js -const bodyParser = require('body-parser') +var bodyParser = require('body-parser') ``` The `bodyParser` object exposes various factories to create middlewares. All middlewares will populate the `req.body` property with the parsed body when -the `Content-Type` request header matches the `type` option. +the `Content-Type` request header matches the `type` option, or an empty +object (`{}`) if there was no body to parse, the `Content-Type` was not matched, +or an error occurred. The various errors returned by this module are described in the [errors section](#errors). @@ -65,8 +67,8 @@ The various errors returned by this module are described in the Returns middleware that only parses `json` and only looks at requests where the `Content-Type` header matches the `type` option. This parser accepts any -Unicode encoding of the body and supports automatic inflation of `gzip`, -`br` (brotli) and `deflate` encodings. +Unicode encoding of the body and supports automatic inflation of `gzip` and +`deflate` encodings. A new `body` object containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). @@ -76,11 +78,6 @@ object after the middleware (i.e. `req.body`). The `json` function takes an optional `options` object that may contain any of the following keys: -##### defaultCharset - -Specify the default character set for the json content if the charset is not -specified in the `Content-Type` header of the request. Defaults to `utf-8`. - ##### inflate When set to `true`, then deflated (compressed) bodies will be inflated; when @@ -109,7 +106,7 @@ accept anything `JSON.parse` accepts. Defaults to `true`. The `type` option is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `json`), a mime type (like `application/json`), or a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a truthy @@ -125,8 +122,7 @@ encoding of the request. The parsing can be aborted by throwing an error. Returns middleware that parses all bodies as a `Buffer` and only looks at requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` -encodings. +parser supports automatic inflation of `gzip` and `deflate` encodings. A new `body` object containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). This will be a `Buffer` object @@ -154,7 +150,7 @@ to `'100kb'`. The `type` option is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.com/package/type-is#readme) library and this +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `bin`), a mime type (like `application/octet-stream`), or a mime type with a wildcard (like `*/*` or `application/*`). If a function, the `type` option is called as `fn(req)` @@ -171,8 +167,7 @@ encoding of the request. The parsing can be aborted by throwing an error. Returns middleware that parses all bodies as a string and only looks at requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` -encodings. +parser supports automatic inflation of `gzip` and `deflate` encodings. A new `body` string containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). This will be a string of the @@ -205,7 +200,7 @@ to `'100kb'`. The `type` option is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `txt`), a mime type (like `text/plain`), or a mime type with a wildcard (like `*/*` or `text/*`). If a function, the `type` option is called as `fn(req)` and the request is parsed if it returns a @@ -221,8 +216,8 @@ encoding of the request. The parsing can be aborted by throwing an error. Returns middleware that only parses `urlencoded` bodies and only looks at requests where the `Content-Type` header matches the `type` option. This -parser accepts only UTF-8 and ISO-8859-1 encodings of the body and supports -automatic inflation of `gzip`, `br` (brotli) and `deflate` encodings. +parser accepts only UTF-8 encoding of the body and supports automatic +inflation of `gzip` and `deflate` encodings. A new `body` object containing the parsed data is populated on the `request` object after the middleware (i.e. `req.body`). This object will contain @@ -236,12 +231,16 @@ any of the following keys: ##### extended -The "extended" syntax allows for rich objects and arrays to be encoded into the -URL-encoded format, allowing for a JSON-like experience with URL-encoded. For -more information, please [see the qs -library](https://www.npmjs.com/package/qs#readme). +The `extended` option allows to choose between parsing the URL-encoded data +with the `querystring` library (when `false`) or the `qs` library (when +`true`). The "extended" syntax allows for rich objects and arrays to be +encoded into the URL-encoded format, allowing for a JSON-like experience +with URL-encoded. For more information, please +[see the qs library](https://www.npmjs.org/package/qs#readme). -Defaults to `false`. +Defaults to `true`, but using the default has been deprecated. Please +research into the difference between `qs` and `querystring` and choose the +appropriate setting. ##### inflate @@ -266,7 +265,7 @@ than this value, a 413 will be returned to the client. Defaults to `1000`. The `type` option is used to determine what media type the middleware will parse. This option can be a string, array of strings, or a function. If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.com/package/type-is#readme) library and this can +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can be an extension name (like `urlencoded`), a mime type (like `application/x-www-form-urlencoded`), or a mime type with a wildcard (like `*/x-www-form-urlencoded`). If a function, the `type` option is called as @@ -279,24 +278,7 @@ The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)` where `buf` is a `Buffer` of the raw request body and `encoding` is the encoding of the request. The parsing can be aborted by throwing an error. -##### defaultCharset - -The default charset to parse as, if not specified in content-type. Must be -either `utf-8` or `iso-8859-1`. Defaults to `utf-8`. - -##### charsetSentinel - -Whether to let the value of the `utf8` parameter take precedence as the charset -selector. It requires the form to contain a parameter named `utf8` with a value -of `✓`. Defaults to `false`. - -##### interpretNumericEntities - -Whether to decode numeric entities such as `☺` when parsing an iso-8859-1 -form. Defaults to `false`. - - -##### depth +#### depth The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. @@ -409,13 +391,13 @@ top-level middleware, which will parse the bodies of all incoming requests. This is the simplest setup. ```js -const express = require('express') -const bodyParser = require('body-parser') +var express = require('express') +var bodyParser = require('body-parser') -const app = express() +var app = express() // parse application/x-www-form-urlencoded -app.use(bodyParser.urlencoded()) +app.use(bodyParser.urlencoded({ extended: false })) // parse application/json app.use(bodyParser.json()) @@ -423,7 +405,7 @@ app.use(bodyParser.json()) app.use(function (req, res) { res.setHeader('Content-Type', 'text/plain') res.write('you posted:\n') - res.end(String(JSON.stringify(req.body, null, 2))) + res.end(JSON.stringify(req.body, null, 2)) }) ``` @@ -434,26 +416,24 @@ need them. In general, this is the most recommended way to use body-parser with Express. ```js -const express = require('express') -const bodyParser = require('body-parser') +var express = require('express') +var bodyParser = require('body-parser') -const app = express() +var app = express() // create application/json parser -const jsonParser = bodyParser.json() +var jsonParser = bodyParser.json() // create application/x-www-form-urlencoded parser -const urlencodedParser = bodyParser.urlencoded() +var urlencodedParser = bodyParser.urlencoded({ extended: false }) // POST /login gets urlencoded bodies app.post('/login', urlencodedParser, function (req, res) { - if (!req.body || !req.body.username) res.sendStatus(400) res.send('welcome, ' + req.body.username) }) // POST /api/users gets JSON bodies app.post('/api/users', jsonParser, function (req, res) { - if (!req.body) res.sendStatus(400) // create user in req.body }) ``` @@ -464,10 +444,10 @@ All the parsers accept a `type` option which allows you to change the `Content-Type` that the middleware will parse. ```js -const express = require('express') -const bodyParser = require('body-parser') +var express = require('express') +var bodyParser = require('body-parser') -const app = express() +var app = express() // parse various different custom JSON types as JSON app.use(bodyParser.json({ type: 'application/*+json' })) @@ -483,12 +463,14 @@ app.use(bodyParser.text({ type: 'text/html' })) [MIT](LICENSE) -[ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/body-parser/ci.yml?branch=master&label=ci +[ci-image]: https://badgen.net/github/checks/expressjs/body-parser/master?label=ci [ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml -[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/body-parser?branch=master +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/body-parser/master [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[npm-downloads-image]: https://img.shields.io/npm/dm/body-parser -[npm-url]: https://npmjs.com/package/body-parser -[npm-version-image]: https://img.shields.io/npm/v/body-parser +[node-version-image]: https://badgen.net/npm/node/body-parser +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/body-parser +[npm-url]: https://npmjs.org/package/body-parser +[npm-version-image]: https://badgen.net/npm/v/body-parser [ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge -[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser \ No newline at end of file diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js index 013ce5c..bb24d73 100644 --- a/node_modules/body-parser/index.js +++ b/node_modules/body-parser/index.js @@ -7,65 +7,150 @@ 'use strict' /** - * @typedef {Object} Parsers - * @property {Function} json JSON parser - * @property {Function} raw Raw parser - * @property {Function} text Text parser - * @property {Function} urlencoded URL-encoded parser + * Module dependencies. + * @private + */ + +var deprecate = require('depd')('body-parser') + +/** + * Cache of loaded parsers. + * @private + */ + +var parsers = Object.create(null) + +/** + * @typedef Parsers + * @type {function} + * @property {function} json + * @property {function} raw + * @property {function} text + * @property {function} urlencoded */ /** * Module exports. - * @type {Function & Parsers} + * @type {Parsers} */ -exports = module.exports = bodyParser + +exports = module.exports = deprecate.function(bodyParser, + 'bodyParser: use individual json/urlencoded middlewares') /** * JSON parser. * @public */ + Object.defineProperty(exports, 'json', { configurable: true, enumerable: true, - get: () => require('./lib/types/json') + get: createParserGetter('json') }) /** * Raw parser. * @public */ + Object.defineProperty(exports, 'raw', { configurable: true, enumerable: true, - get: () => require('./lib/types/raw') + get: createParserGetter('raw') }) /** * Text parser. * @public */ + Object.defineProperty(exports, 'text', { configurable: true, enumerable: true, - get: () => require('./lib/types/text') + get: createParserGetter('text') }) /** * URL-encoded parser. * @public */ + Object.defineProperty(exports, 'urlencoded', { configurable: true, enumerable: true, - get: () => require('./lib/types/urlencoded') + get: createParserGetter('urlencoded') }) /** * Create a middleware to parse json and urlencoded bodies. * + * @param {object} [options] + * @return {function} * @deprecated * @public */ -function bodyParser () { - throw new Error('The bodyParser() generic has been split into individual middleware to use instead.') + +function bodyParser (options) { + // use default type for parsers + var opts = Object.create(options || null, { + type: { + configurable: true, + enumerable: true, + value: undefined, + writable: true + } + }) + + var _urlencoded = exports.urlencoded(opts) + var _json = exports.json(opts) + + return function bodyParser (req, res, next) { + _json(req, res, function (err) { + if (err) return next(err) + _urlencoded(req, res, next) + }) + } +} + +/** + * Create a getter for loading a parser. + * @private + */ + +function createParserGetter (name) { + return function get () { + return loadParser(name) + } +} + +/** + * Load a parser module. + * @private + */ + +function loadParser (parserName) { + var parser = parsers[parserName] + + if (parser !== undefined) { + return parser + } + + // this uses a switch for static require analysis + switch (parserName) { + case 'json': + parser = require('./lib/types/json') + break + case 'raw': + parser = require('./lib/types/raw') + break + case 'text': + parser = require('./lib/types/text') + break + case 'urlencoded': + parser = require('./lib/types/urlencoded') + break + } + + // store to prevent invoking require() + return (parsers[parserName] = parser) } diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js index d1f3f48..fce6283 100644 --- a/node_modules/body-parser/lib/read.js +++ b/node_modules/body-parser/lib/read.js @@ -12,12 +12,12 @@ */ var createError = require('http-errors') +var destroy = require('destroy') var getBody = require('raw-body') var iconv = require('iconv-lite') var onFinished = require('on-finished') -var zlib = require('node:zlib') -var hasBody = require('type-is').hasBody -var { getCharset } = require('./utils') +var unpipe = require('unpipe') +var zlib = require('zlib') /** * Module exports. @@ -28,61 +28,27 @@ module.exports = read /** * Read a request into a buffer and parse. * - * @param {Object} req - * @param {Object} res - * @param {Function} next - * @param {Function} parse - * @param {Function} debug - * @param {Object} options + * @param {object} req + * @param {object} res + * @param {function} next + * @param {function} parse + * @param {function} debug + * @param {object} options * @private */ + function read (req, res, next, parse, debug, options) { - if (onFinished.isFinished(req)) { - debug('body already parsed') - next() - return - } - - if (!('body' in req)) { - req.body = undefined - } - - // skip requests without bodies - if (!hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!options.shouldParse(req)) { - debug('skip parsing') - next() - return - } - - var encoding = null - if (options?.skipCharset !== true) { - encoding = getCharset(req) || options.defaultCharset - - // validate charset - if (!!options?.isValidCharset && !options.isValidCharset(encoding)) { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding, - type: 'charset.unsupported' - })) - return - } - } - var length var opts = options var stream + // flag as parsed + req._body = true + // read options + var encoding = opts.encoding !== null + ? opts.encoding + : null var verify = opts.verify try { @@ -127,8 +93,8 @@ function read (req, res, next, parse, debug, options) { // unpipe from stream and destroy if (stream !== req) { - req.unpipe() - stream.destroy() + unpipe(req) + destroy(stream, true) } // read off entire request @@ -159,7 +125,7 @@ function read (req, res, next, parse, debug, options) { str = typeof body !== 'string' && encoding !== null ? iconv.decode(body, encoding) : body - req.body = parse(str, encoding) + req.body = parse(str) } catch (err) { next(createError(400, err, { body: str, @@ -175,15 +141,17 @@ function read (req, res, next, parse, debug, options) { /** * Get the content stream of the request. * - * @param {Object} req - * @param {Function} debug - * @param {boolean} inflate - * @returns {Object} - * @private + * @param {object} req + * @param {function} debug + * @param {boolean} [inflate=true] + * @return {object} + * @api private */ + function contentstream (req, debug, inflate) { var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() var length = req.headers['content-length'] + var stream debug('content-encoding "%s"', encoding) @@ -194,49 +162,39 @@ function contentstream (req, debug, inflate) { }) } - if (encoding === 'identity') { - req.length = length - return req - } - - var stream = createDecompressionStream(encoding, debug) - req.pipe(stream) - return stream -} - -/** - * Create a decompression stream for the given encoding. - * @param {string} encoding - * @param {Function} debug - * @returns {Object} - * @private - */ -function createDecompressionStream (encoding, debug) { switch (encoding) { case 'deflate': + stream = zlib.createInflate() debug('inflate body') - return zlib.createInflate() + req.pipe(stream) + break case 'gzip': + stream = zlib.createGunzip() debug('gunzip body') - return zlib.createGunzip() - case 'br': - debug('brotli decompress body') - return zlib.createBrotliDecompress() + req.pipe(stream) + break + case 'identity': + stream = req + stream.length = length + break default: throw createError(415, 'unsupported content encoding "' + encoding + '"', { encoding: encoding, type: 'encoding.unsupported' }) } + + return stream } /** * Dump the contents of a request. * - * @param {Object} req - * @param {Function} callback - * @private + * @param {object} req + * @param {function} callback + * @api private */ + function dump (req, callback) { if (onFinished.isFinished(req)) { callback(null) diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js index 23c7357..59f3f7e 100644 --- a/node_modules/body-parser/lib/types/json.js +++ b/node_modules/body-parser/lib/types/json.js @@ -12,9 +12,12 @@ * @private */ +var bytes = require('bytes') +var contentType = require('content-type') +var createError = require('http-errors') var debug = require('debug')('body-parser:json') var read = require('../read') -var { normalizeOptions } = require('../utils') +var typeis = require('type-is') /** * Module exports. @@ -33,6 +36,7 @@ module.exports = json * %x0A / ; Line feed or New line * %x0D ) ; Carriage return */ + var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex var JSON_SYNTAX_CHAR = '#' @@ -41,15 +45,31 @@ var JSON_SYNTAX_REGEXP = /#+/g /** * Create a middleware to parse JSON bodies. * - * @param {Object} [options] - * @returns {Function} + * @param {object} [options] + * @return {function} * @public */ -function json (options) { - const normalizedOptions = normalizeOptions(options, 'application/json') - var reviver = options?.reviver - var strict = options?.strict !== false +function json (options) { + var opts = options || {} + + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var inflate = opts.inflate !== false + var reviver = opts.reviver + var strict = opts.strict !== false + var type = opts.type || 'application/json' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type function parse (body) { if (body.length === 0) { @@ -78,14 +98,49 @@ function json (options) { } } - const readOptions = { - ...normalizedOptions, - // assert charset per RFC 7159 sec 8.1 - isValidCharset: (charset) => charset.slice(0, 4) === 'utf-' - } - return function jsonParser (req, res, next) { - read(req, res, next, parse, debug, readOptions) + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // assert charset per RFC 7159 sec 8.1 + var charset = getCharset(req) || 'utf-8' + if (charset.slice(0, 4) !== 'utf-') { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset: charset, + type: 'charset.unsupported' + })) + return + } + + // read + read(req, res, next, parse, debug, { + encoding: charset, + inflate: inflate, + limit: limit, + verify: verify + }) } } @@ -94,15 +149,20 @@ function json (options) { * * @param {string} str * @param {string} char - * @returns {Error} + * @return {Error} * @private */ + function createStrictSyntaxError (str, char) { var index = str.indexOf(char) var partial = '' if (index !== -1) { - partial = str.substring(0, index) + JSON_SYNTAX_CHAR.repeat(str.length - index) + partial = str.substring(0, index) + JSON_SYNTAX_CHAR + + for (var i = index + 1; i < str.length; i++) { + partial += JSON_SYNTAX_CHAR + } } try { @@ -121,9 +181,10 @@ function createStrictSyntaxError (str, char) { * Get the first non-whitespace character in a string. * * @param {string} str - * @returns {string|undefined} + * @return {function} * @private */ + function firstchar (str) { var match = FIRST_CHAR_REGEXP.exec(str) @@ -132,14 +193,29 @@ function firstchar (str) { : undefined } +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch (e) { + return undefined + } +} + /** * Normalize a SyntaxError for JSON.parse. * * @param {SyntaxError} error - * @param {Object} obj - * @returns {SyntaxError} - * @private + * @param {object} obj + * @return {SyntaxError} */ + function normalizeJsonSyntaxError (error, obj) { var keys = Object.getOwnPropertyNames(error) @@ -156,3 +232,16 @@ function normalizeJsonSyntaxError (error, obj) { return error } + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js index ad4854d..f5d1b67 100644 --- a/node_modules/body-parser/lib/types/raw.js +++ b/node_modules/body-parser/lib/types/raw.js @@ -10,9 +10,10 @@ * Module dependencies. */ +var bytes = require('bytes') var debug = require('debug')('body-parser:raw') var read = require('../read') -var { normalizeOptions, passthrough } = require('../utils') +var typeis = require('type-is') /** * Module exports. @@ -23,20 +24,78 @@ module.exports = raw /** * Create a middleware to parse raw bodies. * - * @param {Object} [options] - * @returns {Function} - * @public + * @param {object} [options] + * @return {function} + * @api public */ -function raw (options) { - const normalizedOptions = normalizeOptions(options, 'application/octet-stream') - const readOptions = { - ...normalizedOptions, - // Skip charset validation and parse the body as is - skipCharset: true +function raw (options) { + var opts = options || {} + + var inflate = opts.inflate !== false + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var type = opts.type || 'application/octet-stream' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (buf) { + return buf } return function rawParser (req, res, next) { - read(req, res, next, passthrough, debug, readOptions) + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // read + read(req, res, next, parse, debug, { + encoding: null, + inflate: inflate, + limit: limit, + verify: verify + }) + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) } } diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js index 9df73be..083a009 100644 --- a/node_modules/body-parser/lib/types/text.js +++ b/node_modules/body-parser/lib/types/text.js @@ -10,9 +10,11 @@ * Module dependencies. */ +var bytes = require('bytes') +var contentType = require('content-type') var debug = require('debug')('body-parser:text') var read = require('../read') -var { normalizeOptions, passthrough } = require('../utils') +var typeis = require('type-is') /** * Module exports. @@ -23,14 +25,97 @@ module.exports = text /** * Create a middleware to parse text bodies. * - * @param {Object} [options] - * @returns {Function} - * @public + * @param {object} [options] + * @return {function} + * @api public */ + function text (options) { - const normalizedOptions = normalizeOptions(options, 'text/plain') + var opts = options || {} + + var defaultCharset = opts.defaultCharset || 'utf-8' + var inflate = opts.inflate !== false + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var type = opts.type || 'text/plain' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (buf) { + return buf + } return function textParser (req, res, next) { - read(req, res, next, passthrough, debug, normalizedOptions) + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // get charset + var charset = getCharset(req) || defaultCharset + + // read + read(req, res, next, parse, debug, { + encoding: charset, + inflate: inflate, + limit: limit, + verify: verify + }) + } +} + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch (e) { + return undefined + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) } } diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js index 4a3227c..832992c 100644 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ b/node_modules/body-parser/lib/types/urlencoded.js @@ -12,11 +12,13 @@ * @private */ +var bytes = require('bytes') +var contentType = require('content-type') var createError = require('http-errors') var debug = require('debug')('body-parser:urlencoded') +var deprecate = require('depd')('body-parser') var read = require('../read') -var qs = require('qs') -var { normalizeOptions } = require('../utils') +var typeis = require('type-is') /** * Module exports. @@ -24,55 +26,115 @@ var { normalizeOptions } = require('../utils') module.exports = urlencoded +/** + * Cache of parser modules. + */ + +var parsers = Object.create(null) + /** * Create a middleware to parse urlencoded bodies. * - * @param {Object} [options] - * @returns {Function} + * @param {object} [options] + * @return {function} * @public */ -function urlencoded (options) { - const normalizedOptions = normalizeOptions(options, 'application/x-www-form-urlencoded') - if (normalizedOptions.defaultCharset !== 'utf-8' && normalizedOptions.defaultCharset !== 'iso-8859-1') { - throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1') +function urlencoded (options) { + var opts = options || {} + + // notice because option default will flip in next major + if (opts.extended === undefined) { + deprecate('undefined extended: provide extended option') + } + + var extended = opts.extended !== false + var inflate = opts.inflate !== false + var limit = typeof opts.limit !== 'number' + ? bytes.parse(opts.limit || '100kb') + : opts.limit + var type = opts.type || 'application/x-www-form-urlencoded' + var verify = opts.verify || false + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') } // create the appropriate query parser - var queryparse = createQueryParser(options) + var queryparse = extended + ? extendedparser(opts) + : simpleparser(opts) - function parse (body, encoding) { + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + function parse (body) { return body.length - ? queryparse(body, encoding) + ? queryparse(body) : {} } - const readOptions = { - ...normalizedOptions, - // assert charset - isValidCharset: (charset) => charset === 'utf-8' || charset === 'iso-8859-1' - } - return function urlencodedParser (req, res, next) { - read(req, res, next, parse, debug, readOptions) + if (req._body) { + debug('body already parsed') + next() + return + } + + req.body = req.body || {} + + // skip requests without bodies + if (!typeis.hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!shouldParse(req)) { + debug('skip parsing') + next() + return + } + + // assert charset + var charset = getCharset(req) || 'utf-8' + if (charset !== 'utf-8') { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { + charset: charset, + type: 'charset.unsupported' + })) + return + } + + // read + read(req, res, next, parse, debug, { + debug: debug, + encoding: charset, + inflate: inflate, + limit: limit, + verify: verify + }) } } /** * Get the extended query parser. * - * @param {Object} options - * @returns {Function} - * @private + * @param {object} options */ -function createQueryParser (options) { - var extended = Boolean(options?.extended) - var parameterLimit = options?.parameterLimit !== undefined - ? options?.parameterLimit + +function extendedparser (options) { + var parameterLimit = options.parameterLimit !== undefined + ? options.parameterLimit : 1000 - var charsetSentinel = options?.charsetSentinel - var interpretNumericEntities = options?.interpretNumericEntities - var depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0 + var depth = options.depth !== undefined ? options.depth : 32 + var parse = parser('qs') if (isNaN(parameterLimit) || parameterLimit < 1) { throw new TypeError('option parameterLimit must be a positive number') @@ -86,7 +148,7 @@ function createQueryParser (options) { parameterLimit = parameterLimit | 0 } - return function queryparse (body, encoding) { + return function queryparse (body) { var paramCount = parameterCount(body, parameterLimit) if (paramCount === undefined) { @@ -96,19 +158,16 @@ function createQueryParser (options) { }) } - var arrayLimit = extended ? Math.max(100, paramCount) : paramCount + var arrayLimit = Math.max(100, paramCount) - debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding') + debug('parse extended urlencoding') try { - return qs.parse(body, { + return parse(body, { allowPrototypes: true, arrayLimit: arrayLimit, depth: depth, - charsetSentinel: charsetSentinel, - interpretNumericEntities: interpretNumericEntities, - charset: encoding, - parameterLimit: parameterLimit, - strictDepth: true + strictDepth: true, + parameterLimit: parameterLimit }) } catch (err) { if (err instanceof RangeError) { @@ -122,21 +181,120 @@ function createQueryParser (options) { } } +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch (e) { + return undefined + } +} + /** * Count the number of parameters, stopping once limit reached * * @param {string} body * @param {number} limit - * @returns {number|undefined} Returns undefined if limit exceeded - * @private + * @api private */ + function parameterCount (body, limit) { - let count = 0 - let index = -1 - do { + var count = 0 + var index = 0 + + while ((index = body.indexOf('&', index)) !== -1) { count++ - if (count > limit) return undefined // Early exit if limit exceeded - index = body.indexOf('&', index + 1) - } while (index !== -1) + index++ + + if (count === limit) { + return undefined + } + } + return count } + +/** + * Get parser for module name dynamically. + * + * @param {string} name + * @return {function} + * @api private + */ + +function parser (name) { + var mod = parsers[name] + + if (mod !== undefined) { + return mod.parse + } + + // this uses a switch for static require analysis + switch (name) { + case 'qs': + mod = require('qs') + break + case 'querystring': + mod = require('querystring') + break + } + + // store to prevent invoking require() + parsers[name] = mod + + return mod.parse +} + +/** + * Get the simple query parser. + * + * @param {object} options + */ + +function simpleparser (options) { + var parameterLimit = options.parameterLimit !== undefined + ? options.parameterLimit + : 1000 + var parse = parser('querystring') + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function queryparse (body) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + debug('parse urlencoding') + return parse(body, undefined, undefined, { maxKeys: parameterLimit }) + } +} + +/** + * Get the simple type checker. + * + * @param {string} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} diff --git a/node_modules/body-parser/lib/utils.js b/node_modules/body-parser/lib/utils.js deleted file mode 100644 index e0bf974..0000000 --- a/node_modules/body-parser/lib/utils.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var typeis = require('type-is') - -/** - * Module exports. - */ -module.exports = { - getCharset, - normalizeOptions, - passthrough -} - -/** - * Get the charset of a request. - * - * @param {Object} req - * @returns {string | undefined} - * @private - */ -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch { - return undefined - } -} - -/** - * Get the simple type checker. - * - * @param {string | string[]} type - * @returns {Function} - * @private - */ -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} - -/** - * Normalizes the common options for all parsers. - * - * @param {Object} options options to normalize - * @param {string | string[] | Function} defaultType default content type(s) or a function to determine it - * @returns {Object} - * @private - */ -function normalizeOptions (options, defaultType) { - if (!defaultType) { - // Parsers must define a default content type - throw new TypeError('defaultType must be provided') - } - - var inflate = options?.inflate !== false - var limit = typeof options?.limit !== 'number' - ? bytes.parse(options?.limit || '100kb') - : options?.limit - var type = options?.type || defaultType - var verify = options?.verify || false - var defaultCharset = options?.defaultCharset || 'utf-8' - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - return { - inflate, - limit, - verify, - defaultCharset, - shouldParse - } -} - -/** - * Passthrough function that returns input unchanged. - * Used by parsers that don't need to transform the data. - * - * @param {*} value - * @returns {*} - * @private - */ -function passthrough (value) { - return value -} diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json index 486878a..c8e61c1 100644 --- a/node_modules/body-parser/package.json +++ b/node_modules/body-parser/package.json @@ -1,52 +1,55 @@ { "name": "body-parser", "description": "Node.js body parsing middleware", - "version": "2.2.2", + "version": "1.20.4", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)" ], "license": "MIT", "repository": "expressjs/body-parser", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, "dependencies": { - "bytes": "^3.1.2", - "content-type": "^1.0.5", - "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", - "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" }, "devDependencies": { - "eslint": "^8.57.1", - "eslint-config-standard": "^14.1.1", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-markdown": "^3.0.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.6.0", - "eslint-plugin-standard": "^4.1.0", - "mocha": "^11.1.0", - "nyc": "^17.1.0", - "supertest": "^7.0.0" + "eslint": "8.34.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "methods": "1.1.2", + "mocha": "10.2.0", + "nyc": "15.1.0", + "safe-buffer": "5.2.1", + "supertest": "6.3.3" }, "files": [ "lib/", "LICENSE", + "HISTORY.md", "index.js" ], "engines": { - "node": ">=18" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" }, "scripts": { "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks test/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/complex.js/LICENSE b/node_modules/complex.js/LICENSE deleted file mode 100644 index 8741015..0000000 --- a/node_modules/complex.js/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 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/node_modules/complex.js/README.md b/node_modules/complex.js/README.md deleted file mode 100644 index 8e3e2ec..0000000 --- a/node_modules/complex.js/README.md +++ /dev/null @@ -1,373 +0,0 @@ -# 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/rawify/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. - -**Note:** Object attributes have to be of type Number to avoid undefined behavior. - -### 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() | - -**Notes on branches & ranges.** Inverse trig on ℂ needs a branch choice. For `acot` there are two real-axis conventions: - -* **(Chosen) Textbook range (0, π) on ℝ.** - Gives familiar real values (`acot(1)=π/4`, `acot(0)=π/2`, `acot(-1)=3π/4`). With the principal complex branch this **necessarily causes a π jump across the negative real axis** (e.g., near `-1±i0` → `-π/4`, but on `-1` → `3π/4`). - **We implement this with `atan2(1, x)`** to select the correct quadrant and handle `x=0`. - -* **Alternative range (−π/2, π/2] on ℝ.** - Makes `acot(-1) = -π/4` and can avoid that specific jump **only if the entire complex branch is changed to match**. Using plain `atan(1/x)` silently adopts this convention, changes real outputs, is undefined at `x=0`, and still wouldn’t resolve the complex behavior without a broader policy change. - -We therefore prefer predictable, textbook real values and robust quadrant handling—hence `atan2(1, x)`-accepting the implied branch cut on ℝ⁻ by design. - - -## 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 - -You can install `Complex.js` via npm: - -```bash -npm install complex.js -``` - -Or with yarn: - -```bash -yarn add complex.js -``` - -Alternatively, download or clone the repository: - -```bash -git clone https://github.com/rawify/Complex.js -``` - -## Usage - -Include the `complex.min.js` file in your project: - -```html - - -``` - -Or in a Node.js project: - -```javascript -const Complex = require('complex.js'); -``` - -or - -```javascript -import Complex from 'complex.js'; -``` - - -## 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) 2025, [Robert Eisele](https://raw.org/) -Licensed under the MIT license. diff --git a/node_modules/complex.js/complex.d.ts b/node_modules/complex.js/complex.d.ts deleted file mode 100644 index 37003f1..0000000 --- a/node_modules/complex.js/complex.d.ts +++ /dev/null @@ -1,323 +0,0 @@ -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/node_modules/complex.js/dist/complex.js b/node_modules/complex.js/dist/complex.js deleted file mode 100644 index 11ff7ec..0000000 --- a/node_modules/complex.js/dist/complex.js +++ /dev/null @@ -1,1476 +0,0 @@ -'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: - * - * const c = new Complex('99.3+8i'); - * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); - * - */ - - -const cosh = Math.cosh || function (x) { - return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5; -}; - -const 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 - */ -const cosm1 = x => { - // cos(x) - 1 = − 2sin^2(x / 2) - const s = Math.sin(0.5 * x); - return -2 * s * s; -}; - -const hypot = function (x, y) { - - x = Math.abs(x); - y = Math.abs(y); - - // Ensure `x` is the larger value - if (x < y) [x, y] = [y, x]; - - // If both are below the threshold, use straightforward Pythagoras - if (x < 1e8) return Math.sqrt(x * x + y * y); - - // For larger values, scale to avoid overflow - y /= x; - return x * Math.sqrt(1 + y * y); -}; - -const 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) { - - const _a = Math.abs(a); - const _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) - - const fn = function(a, b) { - a = Math.abs(a); - b = Math.abs(b); - let 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 * 0.5; - b = b * 0.5; - - return 0.5 * Math.log(a * a + b * b) + Math.LN2; -} - -const P = { 're': 0, 'im': 0 }; -const parse = function (a, b) { - - const z = P; - - 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 (!isFinite(a['abs']) && 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 (!isFinite(a['r']) && 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; - - const tokens = a.replace(/_/g, '') - .match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g); - let plus = 1; - let minus = 0; - - if (tokens === null) { - parser_exit(); - } - - for (let i = 0; i < tokens.length; i++) { - - const 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); - } - - const 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 () { - - const abs = hypot(this['re'], this['im']); - - return new Complex( - this['re'] / abs, - this['im'] / abs); - }, - - /** - * Adds two complex numbers - * - * @returns {Complex} - */ - 'add': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - - if (tInfin || zInfin) { - - if (tInfin && zInfin) { - // Infinity + Infinity = NaN - return Complex['NAN']; - } - // Infinity + z = Infinity { where z != Infinity } - return Complex['INFINITY']; - } - - return new Complex( - this['re'] + z['re'], - this['im'] + z['im']); - }, - - /** - * Subtracts two complex numbers - * - * @returns {Complex} - */ - 'sub': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - - if (tInfin || zInfin) { - - if (tInfin && zInfin) { - // Infinity - Infinity = NaN - return Complex['NAN']; - } - // Infinity - z = Infinity { where z != Infinity } - return Complex['INFINITY']; - } - - return new Complex( - this['re'] - z['re'], - this['im'] - z['im']); - }, - - /** - * Multiplies two complex numbers - * - * @returns {Complex} - */ - 'mul': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - // Infinity * 0 = NaN - if (tInfin && zIsZero || zInfin && tIsZero) { - return Complex['NAN']; - } - - // Infinity * z = Infinity { where z != 0 } - if (tInfin || zInfin) { - return Complex['INFINITY']; - } - - // Shortcut 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) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - // 0 / 0 = NaN and Infinity / Infinity = NaN - if (tIsZero && zIsZero || tInfin && zInfin) { - return Complex['NAN']; - } - - // Infinity / 0 = Infinity - if (zIsZero || tInfin) { - return Complex['INFINITY']; - } - - // 0 / Infinity = 0 - if (tIsZero || zInfin) { - return Complex['ZERO']; - } - - if (0 === z['im']) { - // Divisor is real - return new Complex(this['re'] / z['re'], this['im'] / z['re']); - } - - if (Math.abs(z['re']) < Math.abs(z['im'])) { - - const x = z['re'] / z['im']; - const t = z['re'] * x + z['im']; - - return new Complex( - (this['re'] * x + this['im']) / t, - (this['im'] * x - this['re']) / t); - - } else { - - const x = z['im'] / z['re']; - const t = z['im'] * x + z['re']; - - return new Complex( - (this['re'] + this['im'] * x) / t, - (this['im'] - this['re'] * x) / t); - } - }, - - /** - * Calculate the power of two complex numbers - * - * @returns {Complex} - */ - 'pow': function (a, b) { - - const z = parse(a, b); - - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - if (zIsZero) { - return Complex['ONE']; - } - - // If the exponent is real - if (z['im'] === 0) { - - if (this['im'] === 0 && this['re'] > 0) { - - return new Complex(Math.pow(this['re'], z['re']), 0); - - } else if (this['re'] === 0) { // If base is fully imaginary - - switch ((z['re'] % 4 + 4) % 4) { - case 0: - return new Complex(Math.pow(this['im'], z['re']), 0); - case 1: - return new Complex(0, Math.pow(this['im'], z['re'])); - case 2: - return new Complex(-Math.pow(this['im'], z['re']), 0); - case 3: - return new Complex(0, -Math.pow(this['im'], 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 (tIsZero && z['re'] > 0) { // Same behavior as Wolframalpha, Zero if real part is zero - return Complex['ZERO']; - } - - const arg = Math.atan2(this['im'], this['re']); - const loh = logHypot(this['re'], this['im']); - - let re = Math.exp(z['re'] * loh - z['im'] * arg); - let im = z['im'] * loh + z['re'] * arg; - return new Complex( - re * Math.cos(im), - re * Math.sin(im)); - }, - - /** - * Calculate the complex square root - * - * @returns {Complex} - */ - 'sqrt': function () { - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - // Real number case - if (a >= 0) { - return new Complex(Math.sqrt(a), 0); - } else { - return new Complex(0, Math.sqrt(-a)); - } - } - - const r = hypot(a, b); - - let re = Math.sqrt(0.5 * (r + Math.abs(a))); // sqrt(2x) / 2 = sqrt(x / 2) - let im = Math.abs(b) / (2 * re); - - if (a >= 0) { - return new Complex(re, b < 0 ? -im : im); - } else { - return new Complex(im, b < 0 ? -re : re); - } - }, - - /** - * Calculate the complex exponent - * - * @returns {Complex} - */ - 'exp': function () { - - const er = Math.exp(this['re']); - - if (this['im'] === 0) { - return new Complex(er, 0); - } - return new Complex( - er * Math.cos(this['im']), - er * 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) - */ - - const a = this['re']; - const 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 () { - - const a = this['re']; - const 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) - - const a = this['re']; - const 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) - - const a = this['re']; - const 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) ) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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)) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - - const t1 = new Complex( - b * b - a * a + 1, - -2 * a * b)['sqrt'](); - - const 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)) - - const a = this['re']; - const b = this['im']; - - const t1 = new Complex( - b * b - a * a + 1, - -2 * a * b)['sqrt'](); - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0) { - - if (b === 1) { - return new Complex(0, Infinity); - } - - if (b === -1) { - return new Complex(0, -Infinity); - } - } - - const d = a * a + (1.0 - b) * (1.0 - b); - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - return new Complex(Math.atan2(1, a), 0); - } - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0 && b === 0) { - return new Complex(0, Infinity); - } - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0 && b === 0) { - return new Complex(Math.PI / 2, Infinity); - } - - const 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 - - const a = this['re']; - const 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 - - const a = this['re']; - const 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) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const d = cosh(a) - Math.cos(b); - - return new Complex( - sinh(a) / d, - -Math.sin(b) / d); - }, - - /** - * Calculate the complex csch - * - * @returns {Complex} - */ - 'csch': function () { - - // csch(c) = 2 / (e^c - e^-c) - - const a = this['re']; - const b = this['im']; - const 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) - - const a = this['re']; - const b = this['im']; - const 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(z) = log(z + sqrt(z^2 + 1)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - if (a === 0) { - return new Complex(0, 0); - } - - // Use |a| to keep asinh(-a) = -asinh(a) and avoid cancellation for large -a - const x = Math.abs(a); - const r = Math.log(x + Math.sqrt(x * x + 1)); - - return new Complex(a < 0 ? -r : r, 0); - } - - // z^2 + 1 = (a^2 - b^2 + 1) + i (2ab) - const re2 = a * a - b * b + 1; - const im2 = 2 * a * b; - - const t = new Complex(re2, im2)['sqrt'](); // sqrt(z^2 + 1) - - return new Complex(a + t['re'], b + t['im'])['log'](); - }, - - /** - * Calculate the complex acosh - * - * @returns {Complex} - */ - 'acosh': function () { - - // acosh(z)= log(z + sqrt(z^2 - 1)) = log(z + sqrt(z - 1) * sqrt(z + 1)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - // z = a is real - if (a > 1) { - // acosh(a) = log(a + sqrt(a - 1) * sqrt(a + 1)), a > 1 - return new Complex( - Math.log(a + Math.sqrt(a - 1) * Math.sqrt(a + 1)), 0); - } - - if (a < -1) { - // acosh(a) = log(-a + sqrt(a^2 - 1)) + i*pi, a < -1 - const t = Math.sqrt(a * a - 1); - return new Complex(Math.log(-a + t), Math.PI); - } - - // -1 <= a <= 1 : purely imaginary - // acosh(a) = i * acos(a) - return new Complex(0, Math.acos(a)); - } - - const t1 = new Complex(a - 1, b)['sqrt'](); // sqrt(z - 1) - const t2 = new Complex(a + 1, b)['sqrt'](); // sqrt(z + 1) - - return new Complex( - a + t1['re'] * t2['re'] - t1['im'] * t2['im'], - b + t1['re'] * t2['im'] + t1['im'] * t2['re'] - )['log'](); - }, - - /** - * Calculate the complex atanh - * - * @returns {Complex} - */ - 'atanh': function () { - - // atanh(z) = log((1 + z) / (1 - z)) / 2 - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - if (a === 0) { - return new Complex(0, 0); - } - - if (a === 1) { - // limit x -> 1^- atanh(x) = +Infinity - return new Complex(Infinity, 0); - } - - if (a === -1) { - // limit x -> -1^+ atanh(x) = -Infinity - return new Complex(-Infinity, 0); - } - - if (-1 < a && a < 1) { - // Purely real - return new Complex( - 0.5 * Math.log((1 + a) / (1 - a)), - 0 - ); - } - - if (a > 1) { - // Our branch: Im(atanh(a)) = -π/2 for a > 1 - const t = (a + 1) / (a - 1); // > 0 - return new Complex( - 0.5 * Math.log(t), - -Math.PI / 2 - ); - } - - // a < -1: Im(atanh(a)) = +π/2 - const t = (1 + a) / (1 - a); // < 0 - return new Complex( - 0.5 * Math.log(-t), // log((1 - a)/(1 + a)) - Math.PI / 2 - ); - } - - // Use atanh(z) = 0.5 * Log((1+z)/(1-z)) with principal Log. - const oneMinus = 1 - a; - const onePlus = 1 + a; - const d = oneMinus * oneMinus + b * b; // |1 - z|^2 - - if (d === 0) { - // (1 - z) == 0 for finite z only at z = 1+0i, already handled above. - // If we ever get here, just propagate infinities consistently: - return new Complex( - (a !== -1) ? (a / 0) : 0, - (b !== 0) ? (b / 0) : 0 - ); - } - - // (1 + z) / (1 - z) with a single complex division - const xr = (onePlus * oneMinus - b * b) / d; - const xi = (b * oneMinus + onePlus * b) / d; - - // 0.5 * log(xr + i xi) - return new Complex( - logHypot(xr, xi) / 2, - Math.atan2(xi, xr) / 2 - ); - }, - - /** - * Calculate the complex acoth - * - * @returns {Complex} - */ - 'acoth': function () { - - // acoth(z) = log((z + 1) / (z - 1)) / 2 = atanh(1 / z) - - const a = this['re']; - const b = this['im']; - - // z = 0 -> acoth(0) = i * π / 2 (log((1+0)/(1-0))/2 = log(-1)/2) - if (a === 0 && b === 0) { - return new Complex(0, Math.PI / 2); - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1 / z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['atanh'](); - } - - // Fallback for weird infinities/NaNs: mirror other functions' style - return 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) = = asinh(1 / z) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - // z = a real - if (a === 0) { - // acsch(0) -> +/- Infinity, we keep your previous behavior - return new Complex(Infinity, 0); - } - - // acsch(a) = asinh(1/a) = log(1/a + sqrt(1/a^2 + 1)) - const inv = 1 / a; - return new Complex( - Math.log(inv + Math.sqrt(inv * inv + 1)), - 0 - ); - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1/z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['asinh'](); - } - - // Handle 0 + 0i or infinities in the same spirit as your existing code - return new Complex( - (a !== 0) ? a / 0 : 0, - (b !== 0) ? -b / 0 : 0)['asinh'](); - }, - - /** - * Calculate the complex asech - * - * @returns {Complex} - */ - 'asech': function () { - - // asech(z) = acosh(1 / z) - - const a = this['re']; - const b = this['im']; - - if (this['isZero']()) { - // asech(0) = acosh(∞) -> ∞ - return Complex['INFINITY']; - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1 / z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['acosh'](); - } - - // Fallback for weird infinities/NaNs - return 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']; - } - - const a = this['re']; - const b = this['im']; - - const 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) { - - const z = parse(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 () { - - let a = this['re']; - let b = this['im']; - let 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['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/node_modules/complex.js/dist/complex.min.js b/node_modules/complex.js/dist/complex.min.js deleted file mode 100644 index 37c9da1..0000000 --- a/node_modules/complex.js/dist/complex.min.js +++ /dev/null @@ -1,27 +0,0 @@ -/* -Complex.js v2.4.3 11/13/2025 -https://raw.org/article/complex-numbers-in-javascript/ - -Copyright (c) 2025, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -'use strict';(function(q){function l(a,b){if(a===void 0||a===null)f.re=f.im=0;else if(b!==void 0)f.re=a,f.im=b;else switch(typeof a){case "object":if("im"in a&&"re"in a)f.re=a.re,f.im=a.im;else if("abs"in a&&"arg"in a){if(!isFinite(a.abs)&&isFinite(a.arg))return c.INFINITY;f.re=a.abs*Math.cos(a.arg);f.im=a.abs*Math.sin(a.arg)}else if("r"in a&&"phi"in a){if(!isFinite(a.r)&&isFinite(a.phi))return c.INFINITY;f.re=a.r*Math.cos(a.phi);f.im=a.r*Math.sin(a.phi)}else a.length===2?(f.re=a[0],f.im=a[1]):m(); -break;case "string":f.im=f.re=0;a=a.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);b=1;let d=0;a===null&&m();for(let e=0;e0&& -m();break;case "number":f.im=0;f.re=a;break;default:m()}return f}function m(){throw SyntaxError("Invalid Param");}function n(a,b){a=Math.abs(a);b=Math.abs(b);a -0)return new c(Math.pow(this.re,a.re),0);if(this.re===0)switch((a.re%4+4)%4){case 0:return new c(Math.pow(this.im,a.re),0);case 1:return new c(0,Math.pow(this.im,a.re));case 2:return new c(-Math.pow(this.im,a.re),0);case 3:return new c(0,-Math.pow(this.im,a.re))}}if(b&&a.re>0)return c.ZERO;const d=Math.atan2(this.im,this.re),e=p(this.re,this.im);b=Math.exp(a.re*e-a.im*d);a=a.im*e+a.re*d;return new c(b*Math.cos(a),b*Math.sin(a))},sqrt:function(){const a=this.re,b=this.im;if(b===0)return a>=0?new c(Math.sqrt(a), -0):new c(0,Math.sqrt(-a));var d=n(a,b);d=Math.sqrt(.5*(d+Math.abs(a)));let e=Math.abs(b)/(2*d);return a>=0?new c(d,b<0?-e:e):new c(e,b<0?-d:d)},exp:function(){const a=Math.exp(this.re);return this.im===0?new c(a,0):new c(a*Math.cos(this.im),a*Math.sin(this.im))},expm1:function(){const a=this.re,b=this.im,d=Math.sin(.5*b);return new c(Math.expm1(a)*Math.cos(b)+-2*d*d,Math.exp(a)*Math.sin(b))},log:function(){const a=this.re,b=this.im;return b===0&&a>0?new c(Math.log(a),0):new c(p(a,b),Math.atan2(b, -a))},abs:function(){return n(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const a=this.re,b=this.im;return new c(Math.sin(a)*h(b),Math.cos(a)*k(b))},cos:function(){const a=this.re,b=this.im;return new c(Math.cos(a)*h(b),-Math.sin(a)*k(b))},tan:function(){const a=2*this.re,b=2*this.im,d=Math.cos(a)+h(b);return new c(Math.sin(a)/d,k(b)/d)},cot:function(){const a=2*this.re,b=2*this.im,d=Math.cos(a)-h(b);return new c(-Math.sin(a)/d,k(b)/d)},sec:function(){const a= -this.re,b=this.im,d=.5*h(2*b)+.5*Math.cos(2*a);return new c(Math.cos(a)*h(b)/d,Math.sin(a)*k(b)/d)},csc:function(){const a=this.re,b=this.im,d=.5*h(2*b)-.5*Math.cos(2*a);return new c(Math.sin(a)*h(b)/d,-Math.cos(a)*k(b)/d)},asin:function(){var a=this.re;const b=this.im,d=(new c(b*b-a*a+1,-2*a*b)).sqrt();a=(new c(d.re-b,d.im+a)).log();return new c(a.im,-a.re)},acos:function(){var a=this.re;const b=this.im,d=(new c(b*b-a*a+1,-2*a*b)).sqrt();a=(new c(d.re-b,d.im+a)).log();return new c(Math.PI/2-a.im, -a.re)},atan:function(){var a=this.re;const b=this.im;if(a===0){if(b===1)return new c(0,Infinity);if(b===-1)return new c(0,-Infinity)}const d=a*a+(1-b)*(1-b);a=(new c((1-b*b-a*a)/d,-2*a/d)).log();return new c(-.5*a.im,.5*a.re)},acot:function(){const a=this.re,b=this.im;if(b===0)return new c(Math.atan2(1,a),0);const d=a*a+b*b;return d!==0?(new c(a/d,-b/d)).atan():(new c(a!==0?a/0:0,b!==0?-b/0:0)).atan()},asec:function(){const a=this.re,b=this.im;if(a===0&&b===0)return new c(0,Infinity);const d=a*a+ -b*b;return d!==0?(new c(a/d,-b/d)).acos():(new c(a!==0?a/0:0,b!==0?-b/0:0)).acos()},acsc:function(){const a=this.re,b=this.im;if(a===0&&b===0)return new c(Math.PI/2,Infinity);const d=a*a+b*b;return d!==0?(new c(a/d,-b/d)).asin():(new c(a!==0?a/0:0,b!==0?-b/0:0)).asin()},sinh:function(){const a=this.re,b=this.im;return new c(k(a)*Math.cos(b),h(a)*Math.sin(b))},cosh:function(){const a=this.re,b=this.im;return new c(h(a)*Math.cos(b),k(a)*Math.sin(b))},tanh:function(){const a=2*this.re,b=2*this.im,d= -h(a)+Math.cos(b);return new c(k(a)/d,Math.sin(b)/d)},coth:function(){const a=2*this.re,b=2*this.im,d=h(a)-Math.cos(b);return new c(k(a)/d,-Math.sin(b)/d)},csch:function(){const a=this.re,b=this.im,d=Math.cos(2*b)-h(2*a);return new c(-2*k(a)*Math.cos(b)/d,2*h(a)*Math.sin(b)/d)},sech:function(){const a=this.re,b=this.im,d=Math.cos(2*b)+h(2*a);return new c(2*h(a)*Math.cos(b)/d,-2*k(a)*Math.sin(b)/d)},asinh:function(){const a=this.re;var b=this.im;if(b===0){if(a===0)return new c(0,0);b=Math.abs(a);b= -Math.log(b+Math.sqrt(b*b+1));return new c(a<0?-b:b,0)}const d=(new c(a*a-b*b+1,2*a*b)).sqrt();return(new c(a+d.re,b+d.im)).log()},acosh:function(){const a=this.re,b=this.im;if(b===0)return a>1?new c(Math.log(a+Math.sqrt(a-1)*Math.sqrt(a+1)),0):a<-1?new c(Math.log(-a+Math.sqrt(a*a-1)),Math.PI):new c(0,Math.acos(a));const d=(new c(a-1,b)).sqrt(),e=(new c(a+1,b)).sqrt();return(new c(a+d.re*e.re-d.im*e.im,b+d.re*e.im+d.im*e.re)).log()},atanh:function(){var a=this.re,b=this.im;if(b===0)return a===0?new c(0, -0):a===1?new c(Infinity,0):a===-1?new c(-Infinity,0):-11?new c(.5*Math.log((a+1)/(a-1)),-Math.PI/2):new c(.5*Math.log(-((1+a)/(1-a))),Math.PI/2);const d=1-a,e=1+a,g=d*d+b*b;if(g===0)return new c(a!==-1?a/0:0,b!==0?b/0:0);a=(e*d-b*b)/g;b=(b*d+e*b)/g;return new c(p(a,b)/2,Math.atan2(b,a)/2)},acoth:function(){const a=this.re,b=this.im;if(a===0&&b===0)return new c(0,Math.PI/2);const d=a*a+b*b;return d!==0?(new c(a/d,-b/d)).atanh():(new c(a!==0?a/0:0,b!==0?-b/ -0:0)).atanh()},acsch:function(){var a=this.re;const b=this.im;if(b===0){if(a===0)return new c(Infinity,0);a=1/a;return new c(Math.log(a+Math.sqrt(a*a+1)),0)}const d=a*a+b*b;return d!==0?(new c(a/d,-b/d)).asinh():(new c(a!==0?a/0:0,b!==0?-b/0:0)).asinh()},asech:function(){const a=this.re,b=this.im;if(this.isZero())return c.INFINITY;const d=a*a+b*b;return d!==0?(new c(a/d,-b/d)).acosh():(new c(a!==0?a/0:0,b!==0?-b/0:0)).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO; -const a=this.re,b=this.im,d=a*a+b*b;return new c(a/d,-b/d)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(a){a=Math.pow(10,a||0);return new c(Math.ceil(this.re*a)/a,Math.ceil(this.im*a)/a)},floor:function(a){a=Math.pow(10,a||0);return new c(Math.floor(this.re*a)/a,Math.floor(this.im*a)/a)},round:function(a){a=Math.pow(10,a||0);return new c(Math.round(this.re*a)/a,Math.round(this.im*a)/a)},equals:function(a,b){a=l(a,b);return Math.abs(a.re- -this.re)<=c.EPSILON&&Math.abs(a.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){let a=this.re,b=this.im,d="";if(this.isNaN())return"NaN";if(this.isInfinite())return"Infinity";Math.abs(a), 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: - * - * const c = new Complex('99.3+8i'); - * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); - * - */ - - -const cosh = Math.cosh || function (x) { - return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5; -}; - -const 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 - */ -const cosm1 = x => { - // cos(x) - 1 = − 2sin^2(x / 2) - const s = Math.sin(0.5 * x); - return -2 * s * s; -}; - -const hypot = function (x, y) { - - x = Math.abs(x); - y = Math.abs(y); - - // Ensure `x` is the larger value - if (x < y) [x, y] = [y, x]; - - // If both are below the threshold, use straightforward Pythagoras - if (x < 1e8) return Math.sqrt(x * x + y * y); - - // For larger values, scale to avoid overflow - y /= x; - return x * Math.sqrt(1 + y * y); -}; - -const 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) { - - const _a = Math.abs(a); - const _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) - - const fn = function(a, b) { - a = Math.abs(a); - b = Math.abs(b); - let 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 * 0.5; - b = b * 0.5; - - return 0.5 * Math.log(a * a + b * b) + Math.LN2; -} - -const P = { 're': 0, 'im': 0 }; -const parse = function (a, b) { - - const z = P; - - 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 (!isFinite(a['abs']) && 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 (!isFinite(a['r']) && 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; - - const tokens = a.replace(/_/g, '') - .match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g); - let plus = 1; - let minus = 0; - - if (tokens === null) { - parser_exit(); - } - - for (let i = 0; i < tokens.length; i++) { - - const 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); - } - - const 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 () { - - const abs = hypot(this['re'], this['im']); - - return new Complex( - this['re'] / abs, - this['im'] / abs); - }, - - /** - * Adds two complex numbers - * - * @returns {Complex} - */ - 'add': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - - if (tInfin || zInfin) { - - if (tInfin && zInfin) { - // Infinity + Infinity = NaN - return Complex['NAN']; - } - // Infinity + z = Infinity { where z != Infinity } - return Complex['INFINITY']; - } - - return new Complex( - this['re'] + z['re'], - this['im'] + z['im']); - }, - - /** - * Subtracts two complex numbers - * - * @returns {Complex} - */ - 'sub': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - - if (tInfin || zInfin) { - - if (tInfin && zInfin) { - // Infinity - Infinity = NaN - return Complex['NAN']; - } - // Infinity - z = Infinity { where z != Infinity } - return Complex['INFINITY']; - } - - return new Complex( - this['re'] - z['re'], - this['im'] - z['im']); - }, - - /** - * Multiplies two complex numbers - * - * @returns {Complex} - */ - 'mul': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - // Infinity * 0 = NaN - if (tInfin && zIsZero || zInfin && tIsZero) { - return Complex['NAN']; - } - - // Infinity * z = Infinity { where z != 0 } - if (tInfin || zInfin) { - return Complex['INFINITY']; - } - - // Shortcut 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) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - // 0 / 0 = NaN and Infinity / Infinity = NaN - if (tIsZero && zIsZero || tInfin && zInfin) { - return Complex['NAN']; - } - - // Infinity / 0 = Infinity - if (zIsZero || tInfin) { - return Complex['INFINITY']; - } - - // 0 / Infinity = 0 - if (tIsZero || zInfin) { - return Complex['ZERO']; - } - - if (0 === z['im']) { - // Divisor is real - return new Complex(this['re'] / z['re'], this['im'] / z['re']); - } - - if (Math.abs(z['re']) < Math.abs(z['im'])) { - - const x = z['re'] / z['im']; - const t = z['re'] * x + z['im']; - - return new Complex( - (this['re'] * x + this['im']) / t, - (this['im'] * x - this['re']) / t); - - } else { - - const x = z['im'] / z['re']; - const t = z['im'] * x + z['re']; - - return new Complex( - (this['re'] + this['im'] * x) / t, - (this['im'] - this['re'] * x) / t); - } - }, - - /** - * Calculate the power of two complex numbers - * - * @returns {Complex} - */ - 'pow': function (a, b) { - - const z = parse(a, b); - - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - if (zIsZero) { - return Complex['ONE']; - } - - // If the exponent is real - if (z['im'] === 0) { - - if (this['im'] === 0 && this['re'] > 0) { - - return new Complex(Math.pow(this['re'], z['re']), 0); - - } else if (this['re'] === 0) { // If base is fully imaginary - - switch ((z['re'] % 4 + 4) % 4) { - case 0: - return new Complex(Math.pow(this['im'], z['re']), 0); - case 1: - return new Complex(0, Math.pow(this['im'], z['re'])); - case 2: - return new Complex(-Math.pow(this['im'], z['re']), 0); - case 3: - return new Complex(0, -Math.pow(this['im'], 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 (tIsZero && z['re'] > 0) { // Same behavior as Wolframalpha, Zero if real part is zero - return Complex['ZERO']; - } - - const arg = Math.atan2(this['im'], this['re']); - const loh = logHypot(this['re'], this['im']); - - let re = Math.exp(z['re'] * loh - z['im'] * arg); - let im = z['im'] * loh + z['re'] * arg; - return new Complex( - re * Math.cos(im), - re * Math.sin(im)); - }, - - /** - * Calculate the complex square root - * - * @returns {Complex} - */ - 'sqrt': function () { - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - // Real number case - if (a >= 0) { - return new Complex(Math.sqrt(a), 0); - } else { - return new Complex(0, Math.sqrt(-a)); - } - } - - const r = hypot(a, b); - - let re = Math.sqrt(0.5 * (r + Math.abs(a))); // sqrt(2x) / 2 = sqrt(x / 2) - let im = Math.abs(b) / (2 * re); - - if (a >= 0) { - return new Complex(re, b < 0 ? -im : im); - } else { - return new Complex(im, b < 0 ? -re : re); - } - }, - - /** - * Calculate the complex exponent - * - * @returns {Complex} - */ - 'exp': function () { - - const er = Math.exp(this['re']); - - if (this['im'] === 0) { - return new Complex(er, 0); - } - return new Complex( - er * Math.cos(this['im']), - er * 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) - */ - - const a = this['re']; - const 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 () { - - const a = this['re']; - const 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) - - const a = this['re']; - const 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) - - const a = this['re']; - const 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) ) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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)) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - - const t1 = new Complex( - b * b - a * a + 1, - -2 * a * b)['sqrt'](); - - const 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)) - - const a = this['re']; - const b = this['im']; - - const t1 = new Complex( - b * b - a * a + 1, - -2 * a * b)['sqrt'](); - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0) { - - if (b === 1) { - return new Complex(0, Infinity); - } - - if (b === -1) { - return new Complex(0, -Infinity); - } - } - - const d = a * a + (1.0 - b) * (1.0 - b); - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - return new Complex(Math.atan2(1, a), 0); - } - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0 && b === 0) { - return new Complex(0, Infinity); - } - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0 && b === 0) { - return new Complex(Math.PI / 2, Infinity); - } - - const 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 - - const a = this['re']; - const 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 - - const a = this['re']; - const 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) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const d = cosh(a) - Math.cos(b); - - return new Complex( - sinh(a) / d, - -Math.sin(b) / d); - }, - - /** - * Calculate the complex csch - * - * @returns {Complex} - */ - 'csch': function () { - - // csch(c) = 2 / (e^c - e^-c) - - const a = this['re']; - const b = this['im']; - const 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) - - const a = this['re']; - const b = this['im']; - const 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(z) = log(z + sqrt(z^2 + 1)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - if (a === 0) { - return new Complex(0, 0); - } - - // Use |a| to keep asinh(-a) = -asinh(a) and avoid cancellation for large -a - const x = Math.abs(a); - const r = Math.log(x + Math.sqrt(x * x + 1)); - - return new Complex(a < 0 ? -r : r, 0); - } - - // z^2 + 1 = (a^2 - b^2 + 1) + i (2ab) - const re2 = a * a - b * b + 1; - const im2 = 2 * a * b; - - const t = new Complex(re2, im2)['sqrt'](); // sqrt(z^2 + 1) - - return new Complex(a + t['re'], b + t['im'])['log'](); - }, - - /** - * Calculate the complex acosh - * - * @returns {Complex} - */ - 'acosh': function () { - - // acosh(z)= log(z + sqrt(z^2 - 1)) = log(z + sqrt(z - 1) * sqrt(z + 1)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - // z = a is real - if (a > 1) { - // acosh(a) = log(a + sqrt(a - 1) * sqrt(a + 1)), a > 1 - return new Complex( - Math.log(a + Math.sqrt(a - 1) * Math.sqrt(a + 1)), 0); - } - - if (a < -1) { - // acosh(a) = log(-a + sqrt(a^2 - 1)) + i*pi, a < -1 - const t = Math.sqrt(a * a - 1); - return new Complex(Math.log(-a + t), Math.PI); - } - - // -1 <= a <= 1 : purely imaginary - // acosh(a) = i * acos(a) - return new Complex(0, Math.acos(a)); - } - - const t1 = new Complex(a - 1, b)['sqrt'](); // sqrt(z - 1) - const t2 = new Complex(a + 1, b)['sqrt'](); // sqrt(z + 1) - - return new Complex( - a + t1['re'] * t2['re'] - t1['im'] * t2['im'], - b + t1['re'] * t2['im'] + t1['im'] * t2['re'] - )['log'](); - }, - - /** - * Calculate the complex atanh - * - * @returns {Complex} - */ - 'atanh': function () { - - // atanh(z) = log((1 + z) / (1 - z)) / 2 - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - if (a === 0) { - return new Complex(0, 0); - } - - if (a === 1) { - // limit x -> 1^- atanh(x) = +Infinity - return new Complex(Infinity, 0); - } - - if (a === -1) { - // limit x -> -1^+ atanh(x) = -Infinity - return new Complex(-Infinity, 0); - } - - if (-1 < a && a < 1) { - // Purely real - return new Complex( - 0.5 * Math.log((1 + a) / (1 - a)), - 0 - ); - } - - if (a > 1) { - // Our branch: Im(atanh(a)) = -π/2 for a > 1 - const t = (a + 1) / (a - 1); // > 0 - return new Complex( - 0.5 * Math.log(t), - -Math.PI / 2 - ); - } - - // a < -1: Im(atanh(a)) = +π/2 - const t = (1 + a) / (1 - a); // < 0 - return new Complex( - 0.5 * Math.log(-t), // log((1 - a)/(1 + a)) - Math.PI / 2 - ); - } - - // Use atanh(z) = 0.5 * Log((1+z)/(1-z)) with principal Log. - const oneMinus = 1 - a; - const onePlus = 1 + a; - const d = oneMinus * oneMinus + b * b; // |1 - z|^2 - - if (d === 0) { - // (1 - z) == 0 for finite z only at z = 1+0i, already handled above. - // If we ever get here, just propagate infinities consistently: - return new Complex( - (a !== -1) ? (a / 0) : 0, - (b !== 0) ? (b / 0) : 0 - ); - } - - // (1 + z) / (1 - z) with a single complex division - const xr = (onePlus * oneMinus - b * b) / d; - const xi = (b * oneMinus + onePlus * b) / d; - - // 0.5 * log(xr + i xi) - return new Complex( - logHypot(xr, xi) / 2, - Math.atan2(xi, xr) / 2 - ); - }, - - /** - * Calculate the complex acoth - * - * @returns {Complex} - */ - 'acoth': function () { - - // acoth(z) = log((z + 1) / (z - 1)) / 2 = atanh(1 / z) - - const a = this['re']; - const b = this['im']; - - // z = 0 -> acoth(0) = i * π / 2 (log((1+0)/(1-0))/2 = log(-1)/2) - if (a === 0 && b === 0) { - return new Complex(0, Math.PI / 2); - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1 / z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['atanh'](); - } - - // Fallback for weird infinities/NaNs: mirror other functions' style - return 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) = = asinh(1 / z) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - // z = a real - if (a === 0) { - // acsch(0) -> +/- Infinity, we keep your previous behavior - return new Complex(Infinity, 0); - } - - // acsch(a) = asinh(1/a) = log(1/a + sqrt(1/a^2 + 1)) - const inv = 1 / a; - return new Complex( - Math.log(inv + Math.sqrt(inv * inv + 1)), - 0 - ); - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1/z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['asinh'](); - } - - // Handle 0 + 0i or infinities in the same spirit as your existing code - return new Complex( - (a !== 0) ? a / 0 : 0, - (b !== 0) ? -b / 0 : 0)['asinh'](); - }, - - /** - * Calculate the complex asech - * - * @returns {Complex} - */ - 'asech': function () { - - // asech(z) = acosh(1 / z) - - const a = this['re']; - const b = this['im']; - - if (this['isZero']()) { - // asech(0) = acosh(∞) -> ∞ - return Complex['INFINITY']; - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1 / z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['acosh'](); - } - - // Fallback for weird infinities/NaNs - return 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']; - } - - const a = this['re']; - const b = this['im']; - - const 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) { - - const z = parse(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 () { - - let a = this['re']; - let b = this['im']; - let 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['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/node_modules/complex.js/examples/gamma.js b/node_modules/complex.js/examples/gamma.js deleted file mode 100644 index 1cc739d..0000000 --- a/node_modules/complex.js/examples/gamma.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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/node_modules/complex.js/package.json b/node_modules/complex.js/package.json deleted file mode 100644 index 0f19826..0000000 --- a/node_modules/complex.js/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "complex.js", - "title": "Complex.js", - "version": "2.4.3", - "homepage": "https://raw.org/article/complex-numbers-in-javascript/", - "bugs": "https://github.com/rawify/Complex.js/issues", - "description": "The RAW 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.2", - "mocha": "*" - } -} diff --git a/node_modules/complex.js/src/complex.js b/node_modules/complex.js/src/complex.js deleted file mode 100644 index fbc1913..0000000 --- a/node_modules/complex.js/src/complex.js +++ /dev/null @@ -1,1477 +0,0 @@ -/** - * @license Complex.js v2.4.3 11/13/2025 - * https://raw.org/article/complex-numbers-in-javascript/ - * - * Copyright (c) 2025, 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: - * - * const c = new Complex('99.3+8i'); - * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2); - * - */ - - -const cosh = Math.cosh || function (x) { - return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5; -}; - -const 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 - */ -const cosm1 = x => { - // cos(x) - 1 = − 2sin^2(x / 2) - const s = Math.sin(0.5 * x); - return -2 * s * s; -}; - -const hypot = function (x, y) { - - x = Math.abs(x); - y = Math.abs(y); - - // Ensure `x` is the larger value - if (x < y) [x, y] = [y, x]; - - // If both are below the threshold, use straightforward Pythagoras - if (x < 1e8) return Math.sqrt(x * x + y * y); - - // For larger values, scale to avoid overflow - y /= x; - return x * Math.sqrt(1 + y * y); -}; - -const 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) { - - const _a = Math.abs(a); - const _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) - - const fn = function(a, b) { - a = Math.abs(a); - b = Math.abs(b); - let 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 * 0.5; - b = b * 0.5; - - return 0.5 * Math.log(a * a + b * b) + Math.LN2; -} - -const P = { 're': 0, 'im': 0 }; -const parse = function (a, b) { - - const z = P; - - 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 (!isFinite(a['abs']) && 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 (!isFinite(a['r']) && 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; - - const tokens = a.replace(/_/g, '') - .match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g); - let plus = 1; - let minus = 0; - - if (tokens === null) { - parser_exit(); - } - - for (let i = 0; i < tokens.length; i++) { - - const 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); - } - - const 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 () { - - const abs = hypot(this['re'], this['im']); - - return new Complex( - this['re'] / abs, - this['im'] / abs); - }, - - /** - * Adds two complex numbers - * - * @returns {Complex} - */ - 'add': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - - if (tInfin || zInfin) { - - if (tInfin && zInfin) { - // Infinity + Infinity = NaN - return Complex['NAN']; - } - // Infinity + z = Infinity { where z != Infinity } - return Complex['INFINITY']; - } - - return new Complex( - this['re'] + z['re'], - this['im'] + z['im']); - }, - - /** - * Subtracts two complex numbers - * - * @returns {Complex} - */ - 'sub': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - - if (tInfin || zInfin) { - - if (tInfin && zInfin) { - // Infinity - Infinity = NaN - return Complex['NAN']; - } - // Infinity - z = Infinity { where z != Infinity } - return Complex['INFINITY']; - } - - return new Complex( - this['re'] - z['re'], - this['im'] - z['im']); - }, - - /** - * Multiplies two complex numbers - * - * @returns {Complex} - */ - 'mul': function (a, b) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - // Infinity * 0 = NaN - if (tInfin && zIsZero || zInfin && tIsZero) { - return Complex['NAN']; - } - - // Infinity * z = Infinity { where z != 0 } - if (tInfin || zInfin) { - return Complex['INFINITY']; - } - - // Shortcut 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) { - - const z = parse(a, b); - - const tInfin = this['isInfinite'](); - const zInfin = !(isFinite(z['re']) && isFinite(z['im'])); - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - // 0 / 0 = NaN and Infinity / Infinity = NaN - if (tIsZero && zIsZero || tInfin && zInfin) { - return Complex['NAN']; - } - - // Infinity / 0 = Infinity - if (zIsZero || tInfin) { - return Complex['INFINITY']; - } - - // 0 / Infinity = 0 - if (tIsZero || zInfin) { - return Complex['ZERO']; - } - - if (0 === z['im']) { - // Divisor is real - return new Complex(this['re'] / z['re'], this['im'] / z['re']); - } - - if (Math.abs(z['re']) < Math.abs(z['im'])) { - - const x = z['re'] / z['im']; - const t = z['re'] * x + z['im']; - - return new Complex( - (this['re'] * x + this['im']) / t, - (this['im'] * x - this['re']) / t); - - } else { - - const x = z['im'] / z['re']; - const t = z['im'] * x + z['re']; - - return new Complex( - (this['re'] + this['im'] * x) / t, - (this['im'] - this['re'] * x) / t); - } - }, - - /** - * Calculate the power of two complex numbers - * - * @returns {Complex} - */ - 'pow': function (a, b) { - - const z = parse(a, b); - - const tIsZero = this['re'] === 0 && this['im'] === 0; - const zIsZero = z['re'] === 0 && z['im'] === 0; - - if (zIsZero) { - return Complex['ONE']; - } - - // If the exponent is real - if (z['im'] === 0) { - - if (this['im'] === 0 && this['re'] > 0) { - - return new Complex(Math.pow(this['re'], z['re']), 0); - - } else if (this['re'] === 0) { // If base is fully imaginary - - switch ((z['re'] % 4 + 4) % 4) { - case 0: - return new Complex(Math.pow(this['im'], z['re']), 0); - case 1: - return new Complex(0, Math.pow(this['im'], z['re'])); - case 2: - return new Complex(-Math.pow(this['im'], z['re']), 0); - case 3: - return new Complex(0, -Math.pow(this['im'], 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 (tIsZero && z['re'] > 0) { // Same behavior as Wolframalpha, Zero if real part is zero - return Complex['ZERO']; - } - - const arg = Math.atan2(this['im'], this['re']); - const loh = logHypot(this['re'], this['im']); - - let re = Math.exp(z['re'] * loh - z['im'] * arg); - let im = z['im'] * loh + z['re'] * arg; - return new Complex( - re * Math.cos(im), - re * Math.sin(im)); - }, - - /** - * Calculate the complex square root - * - * @returns {Complex} - */ - 'sqrt': function () { - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - // Real number case - if (a >= 0) { - return new Complex(Math.sqrt(a), 0); - } else { - return new Complex(0, Math.sqrt(-a)); - } - } - - const r = hypot(a, b); - - let re = Math.sqrt(0.5 * (r + Math.abs(a))); // sqrt(2x) / 2 = sqrt(x / 2) - let im = Math.abs(b) / (2 * re); - - if (a >= 0) { - return new Complex(re, b < 0 ? -im : im); - } else { - return new Complex(im, b < 0 ? -re : re); - } - }, - - /** - * Calculate the complex exponent - * - * @returns {Complex} - */ - 'exp': function () { - - const er = Math.exp(this['re']); - - if (this['im'] === 0) { - return new Complex(er, 0); - } - return new Complex( - er * Math.cos(this['im']), - er * 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) - */ - - const a = this['re']; - const 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 () { - - const a = this['re']; - const 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) - - const a = this['re']; - const 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) - - const a = this['re']; - const 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) ) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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)) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - const 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)) - - const a = this['re']; - const b = this['im']; - - const t1 = new Complex( - b * b - a * a + 1, - -2 * a * b)['sqrt'](); - - const 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)) - - const a = this['re']; - const b = this['im']; - - const t1 = new Complex( - b * b - a * a + 1, - -2 * a * b)['sqrt'](); - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0) { - - if (b === 1) { - return new Complex(0, Infinity); - } - - if (b === -1) { - return new Complex(0, -Infinity); - } - } - - const d = a * a + (1.0 - b) * (1.0 - b); - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - return new Complex(Math.atan2(1, a), 0); - } - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0 && b === 0) { - return new Complex(0, Infinity); - } - - const 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)) - - const a = this['re']; - const b = this['im']; - - if (a === 0 && b === 0) { - return new Complex(Math.PI / 2, Infinity); - } - - const 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 - - const a = this['re']; - const 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 - - const a = this['re']; - const 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) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const 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) - - const a = 2 * this['re']; - const b = 2 * this['im']; - const d = cosh(a) - Math.cos(b); - - return new Complex( - sinh(a) / d, - -Math.sin(b) / d); - }, - - /** - * Calculate the complex csch - * - * @returns {Complex} - */ - 'csch': function () { - - // csch(c) = 2 / (e^c - e^-c) - - const a = this['re']; - const b = this['im']; - const 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) - - const a = this['re']; - const b = this['im']; - const 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(z) = log(z + sqrt(z^2 + 1)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - if (a === 0) { - return new Complex(0, 0); - } - - // Use |a| to keep asinh(-a) = -asinh(a) and avoid cancellation for large -a - const x = Math.abs(a); - const r = Math.log(x + Math.sqrt(x * x + 1)); - - return new Complex(a < 0 ? -r : r, 0); - } - - // z^2 + 1 = (a^2 - b^2 + 1) + i (2ab) - const re2 = a * a - b * b + 1; - const im2 = 2 * a * b; - - const t = new Complex(re2, im2)['sqrt'](); // sqrt(z^2 + 1) - - return new Complex(a + t['re'], b + t['im'])['log'](); - }, - - /** - * Calculate the complex acosh - * - * @returns {Complex} - */ - 'acosh': function () { - - // acosh(z)= log(z + sqrt(z^2 - 1)) = log(z + sqrt(z - 1) * sqrt(z + 1)) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - // z = a is real - if (a > 1) { - // acosh(a) = log(a + sqrt(a - 1) * sqrt(a + 1)), a > 1 - return new Complex( - Math.log(a + Math.sqrt(a - 1) * Math.sqrt(a + 1)), 0); - } - - if (a < -1) { - // acosh(a) = log(-a + sqrt(a^2 - 1)) + i*pi, a < -1 - const t = Math.sqrt(a * a - 1); - return new Complex(Math.log(-a + t), Math.PI); - } - - // -1 <= a <= 1 : purely imaginary - // acosh(a) = i * acos(a) - return new Complex(0, Math.acos(a)); - } - - const t1 = new Complex(a - 1, b)['sqrt'](); // sqrt(z - 1) - const t2 = new Complex(a + 1, b)['sqrt'](); // sqrt(z + 1) - - return new Complex( - a + t1['re'] * t2['re'] - t1['im'] * t2['im'], - b + t1['re'] * t2['im'] + t1['im'] * t2['re'] - )['log'](); - }, - - /** - * Calculate the complex atanh - * - * @returns {Complex} - */ - 'atanh': function () { - - // atanh(z) = log((1 + z) / (1 - z)) / 2 - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - if (a === 0) { - return new Complex(0, 0); - } - - if (a === 1) { - // limit x -> 1^- atanh(x) = +Infinity - return new Complex(Infinity, 0); - } - - if (a === -1) { - // limit x -> -1^+ atanh(x) = -Infinity - return new Complex(-Infinity, 0); - } - - if (-1 < a && a < 1) { - // Purely real - return new Complex( - 0.5 * Math.log((1 + a) / (1 - a)), - 0 - ); - } - - if (a > 1) { - // Our branch: Im(atanh(a)) = -π/2 for a > 1 - const t = (a + 1) / (a - 1); // > 0 - return new Complex( - 0.5 * Math.log(t), - -Math.PI / 2 - ); - } - - // a < -1: Im(atanh(a)) = +π/2 - const t = (1 + a) / (1 - a); // < 0 - return new Complex( - 0.5 * Math.log(-t), // log((1 - a)/(1 + a)) - Math.PI / 2 - ); - } - - // Use atanh(z) = 0.5 * Log((1+z)/(1-z)) with principal Log. - const oneMinus = 1 - a; - const onePlus = 1 + a; - const d = oneMinus * oneMinus + b * b; // |1 - z|^2 - - if (d === 0) { - // (1 - z) == 0 for finite z only at z = 1+0i, already handled above. - // If we ever get here, just propagate infinities consistently: - return new Complex( - (a !== -1) ? (a / 0) : 0, - (b !== 0) ? (b / 0) : 0 - ); - } - - // (1 + z) / (1 - z) with a single complex division - const xr = (onePlus * oneMinus - b * b) / d; - const xi = (b * oneMinus + onePlus * b) / d; - - // 0.5 * log(xr + i xi) - return new Complex( - logHypot(xr, xi) / 2, - Math.atan2(xi, xr) / 2 - ); - }, - - /** - * Calculate the complex acoth - * - * @returns {Complex} - */ - 'acoth': function () { - - // acoth(z) = log((z + 1) / (z - 1)) / 2 = atanh(1 / z) - - const a = this['re']; - const b = this['im']; - - // z = 0 -> acoth(0) = i * π / 2 (log((1+0)/(1-0))/2 = log(-1)/2) - if (a === 0 && b === 0) { - return new Complex(0, Math.PI / 2); - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1 / z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['atanh'](); - } - - // Fallback for weird infinities/NaNs: mirror other functions' style - return 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) = = asinh(1 / z) - - const a = this['re']; - const b = this['im']; - - if (b === 0) { - - // z = a real - if (a === 0) { - // acsch(0) -> +/- Infinity, we keep your previous behavior - return new Complex(Infinity, 0); - } - - // acsch(a) = asinh(1/a) = log(1/a + sqrt(1/a^2 + 1)) - const inv = 1 / a; - return new Complex( - Math.log(inv + Math.sqrt(inv * inv + 1)), - 0 - ); - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1/z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['asinh'](); - } - - // Handle 0 + 0i or infinities in the same spirit as your existing code - return new Complex( - (a !== 0) ? a / 0 : 0, - (b !== 0) ? -b / 0 : 0)['asinh'](); - }, - - /** - * Calculate the complex asech - * - * @returns {Complex} - */ - 'asech': function () { - - // asech(z) = acosh(1 / z) - - const a = this['re']; - const b = this['im']; - - if (this['isZero']()) { - // asech(0) = acosh(∞) -> ∞ - return Complex['INFINITY']; - } - - const d = a * a + b * b; - - if (d !== 0) { - // 1 / z = (a - i b) / (a^2 + b^2) - return new Complex(a / d, -b / d)['acosh'](); - } - - // Fallback for weird infinities/NaNs - return 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']; - } - - const a = this['re']; - const b = this['im']; - - const 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) { - - const z = parse(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 () { - - let a = this['re']; - let b = this['im']; - let 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['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/node_modules/complex.js/tests/complex.test.js b/node_modules/complex.js/tests/complex.test.js deleted file mode 100644 index f7ffbea..0000000 --- a/node_modules/complex.js/tests/complex.test.js +++ /dev/null @@ -1,1089 +0,0 @@ - -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.242640687119286i" -}, { - set: Infinity, - fn: "mul", - param: "i", - expect: "Infinity" -}, { - set: "-36i", - fn: "sqrt", - expect: "4.242640687119285 - 4.242640687119286i" -}, { - 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.7163349779007357 - 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"); - - var t = Complex(3, 4); - assert.strictEqual(t.asinh().toString(), "2.29991404087927 + 0.9176168533514786i"); - - assert.strictEqual(t.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 calculate the acosh correctly', function () { - assert.strictEqual(Complex({ re: 0.451, im: 0 }).acosh().im, 1.1029108863861707); - }); - - 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/node_modules/content-disposition/HISTORY.md b/node_modules/content-disposition/HISTORY.md index 1a3b308..488effa 100644 --- a/node_modules/content-disposition/HISTORY.md +++ b/node_modules/content-disposition/HISTORY.md @@ -1,15 +1,3 @@ -1.0.1 / 2025-11-18 -================= - - * Updated `engines` field to Node@18 or higher (fixed reference, see 1.0.0) - * Remove dependency `safe-buffer` - -1.0.0 / 2024-08-31 -================== - - * drop node <18 - * allow utf8 as alias for utf-8 - 0.5.4 / 2021-12-10 ================== diff --git a/node_modules/content-disposition/README.md b/node_modules/content-disposition/README.md index fbedc2f..3a0bb05 100644 --- a/node_modules/content-disposition/README.md +++ b/node_modules/content-disposition/README.md @@ -17,7 +17,7 @@ $ npm install content-disposition ## API ```js -const contentDisposition = require('content-disposition') +var contentDisposition = require('content-disposition') ``` ### contentDisposition(filename, options) @@ -67,7 +67,7 @@ it). The type is normalized to lower-case. ### contentDisposition.parse(string) ```js -const disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt') +var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt') ``` Parse a `Content-Disposition` header string. This automatically handles extended @@ -86,13 +86,13 @@ are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF- ### Send a file for download ```js -const contentDisposition = require('content-disposition') -const destroy = require('destroy') -const fs = require('fs') -const http = require('http') -const onFinished = require('on-finished') +var contentDisposition = require('content-disposition') +var destroy = require('destroy') +var fs = require('fs') +var http = require('http') +var onFinished = require('on-finished') -const filePath = '/path/to/public/plans.pdf' +var filePath = '/path/to/public/plans.pdf' http.createServer(function onRequest (req, res) { // set headers @@ -100,7 +100,7 @@ http.createServer(function onRequest (req, res) { res.setHeader('Content-Disposition', contentDisposition(filePath)) // send file - const stream = fs.createReadStream(filePath) + var stream = fs.createReadStream(filePath) stream.pipe(res) onFinished(res, function () { destroy(stream) @@ -130,13 +130,13 @@ $ npm test [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/content-disposition +[npm-image]: https://img.shields.io/npm/v/content-disposition.svg [npm-url]: https://npmjs.org/package/content-disposition -[node-version-image]: https://img.shields.io/node/v/content-disposition +[node-version-image]: https://img.shields.io/node/v/content-disposition.svg [node-version-url]: https://nodejs.org/en/download -[coveralls-image]: https://img.shields.io/coverallsCoverage/github/jshttp/content-disposition +[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg [coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master -[downloads-image]: https://img.shields.io/npm/dm/content-disposition +[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg [downloads-url]: https://npmjs.org/package/content-disposition -[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/jshttp/content-disposition/ci.yml -[github-actions-ci-url]: https://github.com/jshttp/content-disposition/actions/workflows/ci.yml +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/content-disposition/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/content-disposition?query=workflow%3Aci diff --git a/node_modules/content-disposition/index.js b/node_modules/content-disposition/index.js index efcd9ca..ecec899 100644 --- a/node_modules/content-disposition/index.js +++ b/node_modules/content-disposition/index.js @@ -20,6 +20,7 @@ module.exports.parse = parse */ var basename = require('path').basename +var Buffer = require('safe-buffer').Buffer /** * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%") @@ -242,7 +243,7 @@ function format (obj) { for (var i = 0; i < params.length; i++) { param = params[i] - var val = param.slice(-1) === '*' + var val = param.substr(-1) === '*' ? ustring(parameters[param]) : qstring(parameters[param]) @@ -280,7 +281,6 @@ function decodefield (str) { value = getlatin1(binary) break case 'utf-8': - case 'utf8': value = Buffer.from(binary, 'binary').toString('utf8') break default: @@ -332,7 +332,7 @@ function parse (string) { var value // calculate index to start at - index = PARAM_REGEXP.lastIndex = match[0].slice(-1) === ';' + index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';' ? index - 1 : index @@ -369,7 +369,7 @@ function parse (string) { if (value[0] === '"') { // remove quotes and escapes value = value - .slice(1, -1) + .substr(1, value.length - 2) .replace(QESC_REGEXP, '$1') } diff --git a/node_modules/content-disposition/package.json b/node_modules/content-disposition/package.json index a44034c..43c70ce 100644 --- a/node_modules/content-disposition/package.json +++ b/node_modules/content-disposition/package.json @@ -1,7 +1,7 @@ { "name": "content-disposition", "description": "Create and parse Content-Disposition header", - "version": "1.0.1", + "version": "0.5.4", "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ @@ -11,19 +11,20 @@ "res" ], "repository": "jshttp/content-disposition", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "dependencies": { + "safe-buffer": "5.2.1" }, "devDependencies": { - "c8": "^10.1.2", + "deep-equal": "1.0.1", "eslint": "7.32.0", "eslint-config-standard": "13.0.1", "eslint-plugin-import": "2.25.3", "eslint-plugin-markdown": "2.2.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0" + "eslint-plugin-standard": "4.1.0", + "istanbul": "0.4.5", + "mocha": "9.1.3" }, "files": [ "LICENSE", @@ -32,12 +33,12 @@ "index.js" ], "engines": { - "node": ">=18" + "node": ">= 0.6" }, "scripts": { "lint": "eslint .", - "test": "node --test --test-reporter spec", - "test-ci": "c8 --reporter=lcovonly --reporter=text npm test", - "test-cov": "c8 --reporter=html --reporter=text npm test" + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" } } diff --git a/node_modules/cookie-signature/History.md b/node_modules/cookie-signature/History.md index 479211a..bcf8cc9 100644 --- a/node_modules/cookie-signature/History.md +++ b/node_modules/cookie-signature/History.md @@ -1,34 +1,7 @@ -1.2.2 / 2024-10-29 -================== - -* various metadata/documentation tweaks (incl. #51) - - -1.2.1 / 2023-02-27 -================== - -* update annotations for allowed secret key types (#44, thanks @jyasskin!) - - -1.2.0 / 2022-02-17 -================== - -* allow buffer and other node-supported types as key (#33) -* be pickier about extra content after signed portion (#40) -* some internal code clarity/cleanup improvements (#26) - - -1.1.0 / 2018-01-18 -================== - -* switch to built-in `crypto.timingSafeEqual` for validation instead of previous double-hash method (thank you @jodevsa!) - - 1.0.7 / 2023-04-12 ================== -Later release for older node.js versions. See the [v1.0.x branch notes](https://github.com/tj/node-cookie-signature/blob/v1.0.x/History.md#107--2023-04-12). - +* backport the buffer support from the 1.2.x release branch (thanks @FadhiliNjagi!) 1.0.6 / 2015-02-03 ================== @@ -36,7 +9,6 @@ Later release for older node.js versions. See the [v1.0.x branch notes](https:// * use `npm test` instead of `make test` to run tests * clearer assertion messages when checking input - 1.0.5 / 2014-09-05 ================== diff --git a/node_modules/cookie-signature/LICENSE b/node_modules/cookie-signature/LICENSE deleted file mode 100644 index a2671bf..0000000 --- a/node_modules/cookie-signature/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2012–2024 LearnBoost 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/node_modules/cookie-signature/Readme.md b/node_modules/cookie-signature/Readme.md index 369af15..2559e84 100644 --- a/node_modules/cookie-signature/Readme.md +++ b/node_modules/cookie-signature/Readme.md @@ -16,8 +16,27 @@ cookie.unsign(val, 'tobiiscool').should.equal('hello'); cookie.unsign(val, 'luna').should.be.false; ``` -## License +## License -MIT. +(The MIT License) -See LICENSE file for details. +Copyright (c) 2012 LearnBoost <tj@learnboost.com> + +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. \ No newline at end of file diff --git a/node_modules/cookie-signature/index.js b/node_modules/cookie-signature/index.js index 3fbbddb..336d487 100644 --- a/node_modules/cookie-signature/index.js +++ b/node_modules/cookie-signature/index.js @@ -14,7 +14,7 @@ var crypto = require('crypto'); */ exports.sign = function(val, secret){ - if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string."); + if ('string' !== typeof val) throw new TypeError("Cookie value must be provided as a string."); if (null == secret) throw new TypeError("Secret key must be provided."); return val + '.' + crypto .createHmac('sha256', secret) @@ -24,24 +24,28 @@ exports.sign = function(val, secret){ }; /** - * Unsign and decode the given `input` with `secret`, + * Unsign and decode the given `val` with `secret`, * returning `false` if the signature is invalid. * - * @param {String} input + * @param {String} val * @param {String|NodeJS.ArrayBufferView|crypto.KeyObject} secret * @return {String|Boolean} * @api private */ -exports.unsign = function(input, secret){ - if ('string' != typeof input) throw new TypeError("Signed cookie string must be provided."); +exports.unsign = function(val, secret){ + if ('string' !== typeof val) throw new TypeError("Signed cookie string must be provided."); if (null == secret) throw new TypeError("Secret key must be provided."); - var tentativeValue = input.slice(0, input.lastIndexOf('.')), - expectedInput = exports.sign(tentativeValue, secret), - expectedBuffer = Buffer.from(expectedInput), - inputBuffer = Buffer.from(input); - return ( - expectedBuffer.length === inputBuffer.length && - crypto.timingSafeEqual(expectedBuffer, inputBuffer) - ) ? tentativeValue : false; + var str = val.slice(0, val.lastIndexOf('.')) + , mac = exports.sign(str, secret); + + return sha1(mac) == sha1(val) ? str : false; }; + +/** + * Private + */ + +function sha1(str){ + return crypto.createHash('sha1').update(str).digest('hex'); +} diff --git a/node_modules/cookie-signature/package.json b/node_modules/cookie-signature/package.json index a160040..738487b 100644 --- a/node_modules/cookie-signature/package.json +++ b/node_modules/cookie-signature/package.json @@ -1,24 +1,18 @@ { "name": "cookie-signature", - "version": "1.2.2", - "main": "index.js", + "version": "1.0.7", "description": "Sign and unsign cookies", "keywords": ["cookie", "sign", "unsign"], "author": "TJ Holowaychuk ", "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/node-cookie-signature.git" - }, + "repository": { "type": "git", "url": "https://github.com/visionmedia/node-cookie-signature.git"}, "dependencies": {}, - "engines": { - "node": ">=6.6.0" - }, "devDependencies": { "mocha": "*", "should": "*" }, "scripts": { "test": "mocha --require should --reporter spec" - } -} + }, + "main": "index" +} \ No newline at end of file diff --git a/node_modules/cors/LICENSE b/node_modules/cors/LICENSE deleted file mode 100644 index fd10c84..0000000 --- a/node_modules/cors/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Troy Goode - -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/node_modules/cors/README.md b/node_modules/cors/README.md deleted file mode 100644 index 3d206e5..0000000 --- a/node_modules/cors/README.md +++ /dev/null @@ -1,277 +0,0 @@ -# cors - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -CORS is a [Node.js](https://nodejs.org/en/) middleware for [Express](https://expressjs.com/)/[Connect](https://github.com/senchalabs/connect) that sets [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) response headers. These headers tell browsers which origins can read responses from your server. - -> [!IMPORTANT] -> **How CORS Works:** This package sets response headers—it doesn't block requests. CORS is enforced by browsers: they check the headers and decide if JavaScript can read the response. Non-browser clients (curl, Postman, other servers) ignore CORS entirely. See the [MDN CORS guide](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS) for details. - -* [Installation](#installation) -* [Usage](#usage) - * [Simple Usage](#simple-usage-enable-all-cors-requests) - * [Enable CORS for a Single Route](#enable-cors-for-a-single-route) - * [Configuring CORS](#configuring-cors) - * [Configuring CORS w/ Dynamic Origin](#configuring-cors-w-dynamic-origin) - * [Enabling CORS Pre-Flight](#enabling-cors-pre-flight) - * [Customizing CORS Settings Dynamically per Request](#customizing-cors-settings-dynamically-per-request) -* [Configuration Options](#configuration-options) -* [Common Misconceptions](#common-misconceptions) -* [License](#license) -* [Original Author](#original-author) - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/downloading-and-installing-packages-locally): - -```sh -$ npm install cors -``` - -## Usage - -### Simple Usage (Enable *All* CORS Requests) - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -// Adds headers: Access-Control-Allow-Origin: * -app.use(cors()) - -app.get('/products/:id', function (req, res, next) { - res.json({msg: 'Hello'}) -}) - -app.listen(80, function () { - console.log('web server listening on port 80') -}) -``` - -### Enable CORS for a Single Route - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -// Adds headers: Access-Control-Allow-Origin: * -app.get('/products/:id', cors(), function (req, res, next) { - res.json({msg: 'Hello'}) -}) - -app.listen(80, function () { - console.log('web server listening on port 80') -}) -``` - -### Configuring CORS - -See the [configuration options](#configuration-options) for details. - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -var corsOptions = { - origin: 'http://example.com', - optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204 -} - -// Adds headers: Access-Control-Allow-Origin: http://example.com, Vary: Origin -app.get('/products/:id', cors(corsOptions), function (req, res, next) { - res.json({msg: 'Hello'}) -}) - -app.listen(80, function () { - console.log('web server listening on port 80') -}) -``` - -### Configuring CORS w/ Dynamic Origin - -This module supports validating the origin dynamically using a function provided -to the `origin` option. This function will be passed a string that is the origin -(or `undefined` if the request has no origin), and a `callback` with the signature -`callback(error, origin)`. - -The `origin` argument to the callback can be any value allowed for the `origin` -option of the middleware, except a function. See the -[configuration options](#configuration-options) section for more information on all -the possible value types. - -This function is designed to allow the dynamic loading of allowed origin(s) from -a backing datasource, like a database. - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -var corsOptions = { - origin: function (origin, callback) { - // db.loadOrigins is an example call to load - // a list of origins from a backing database - db.loadOrigins(function (error, origins) { - callback(error, origins) - }) - } -} - -// Adds headers: Access-Control-Allow-Origin: , Vary: Origin -app.get('/products/:id', cors(corsOptions), function (req, res, next) { - res.json({msg: 'Hello'}) -}) - -app.listen(80, function () { - console.log('web server listening on port 80') -}) -``` - -### Enabling CORS Pre-Flight - -Certain CORS requests are considered 'complex' and require an initial -`OPTIONS` request (called the "pre-flight request"). An example of a -'complex' CORS request is one that uses an HTTP verb other than -GET/HEAD/POST (such as DELETE) or that uses custom headers. To enable -pre-flighting, you must add a new OPTIONS handler for the route you want -to support: - -```javascript -var express = require('express') -var cors = require('cors') -var app = express() - -app.options('/products/:id', cors()) // preflight for DELETE -app.del('/products/:id', cors(), function (req, res, next) { - res.json({msg: 'Hello'}) -}) - -app.listen(80, function () { - console.log('web server listening on port 80') -}) -``` - -You can also enable pre-flight across-the-board like so: - -```javascript -app.options('*', cors()) // include before other routes -``` - -NOTE: When using this middleware as an application level middleware (for -example, `app.use(cors())`), pre-flight requests are already handled for all -routes. - -### Customizing CORS Settings Dynamically per Request - -For APIs that require different CORS configurations for specific routes or requests, you can dynamically generate CORS options based on the incoming request. The `cors` middleware allows you to achieve this by passing a function instead of static options. This function is called for each incoming request and must use the callback pattern to return the appropriate CORS options. - -The function accepts: -1. **`req`**: - - The incoming request object. - -2. **`callback(error, corsOptions)`**: - - A function used to return the computed CORS options. - - **Arguments**: - - **`error`**: Pass `null` if there’s no error, or an error object to indicate a failure. - - **`corsOptions`**: An object specifying the CORS policy for the current request. - -Here’s an example that handles both public routes and restricted, credential-sensitive routes: - -```javascript -var dynamicCorsOptions = function(req, callback) { - var corsOptions; - if (req.path.startsWith('/auth/connect/')) { - // Access-Control-Allow-Origin: http://mydomain.com, Access-Control-Allow-Credentials: true, Vary: Origin - corsOptions = { - origin: 'http://mydomain.com', - credentials: true - }; - } else { - // Access-Control-Allow-Origin: * - corsOptions = { origin: '*' }; - } - callback(null, corsOptions); -}; - -app.use(cors(dynamicCorsOptions)); - -app.get('/auth/connect/twitter', function (req, res) { - res.send('Hello'); -}); - -app.get('/public', function (req, res) { - res.send('Hello'); -}); - -app.listen(80, function () { - console.log('web server listening on port 80') -}) -``` - -## Configuration Options - -* `origin`: Configures the **Access-Control-Allow-Origin** CORS header. Possible values: - - `Boolean` - set `origin` to `true` to reflect the [request origin](https://datatracker.ietf.org/doc/html/draft-abarth-origin-09), as defined by `req.header('Origin')`, or set it to `false` to disable CORS. - - `String` - set `origin` to a specific origin. For example, if you set it to - - `"http://example.com"` only requests from "http://example.com" will be allowed. - - `"*"` for all domains to be allowed. - - `RegExp` - set `origin` to a regular expression pattern which will be used to test the request origin. If it's a match, the request origin will be reflected. For example the pattern `/example\.com$/` will reflect any request that is coming from an origin ending with "example.com". - - `Array` - set `origin` to an array of valid origins. Each origin can be a `String` or a `RegExp`. For example `["http://example1.com", /\.example2\.com$/]` will accept any request from "http://example1.com" or from a subdomain of "example2.com". - - `Function` - set `origin` to a function implementing some custom logic. The function takes the request origin as the first parameter and a callback (called as `callback(err, origin)`, where `origin` is a non-function value of the `origin` option) as the second. -* `methods`: Configures the **Access-Control-Allow-Methods** CORS header. Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: `['GET', 'PUT', 'POST']`). -* `allowedHeaders`: Configures the **Access-Control-Allow-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Type,Authorization') or an array (ex: `['Content-Type', 'Authorization']`). If not specified, defaults to reflecting the headers specified in the request's **Access-Control-Request-Headers** header. -* `exposedHeaders`: Configures the **Access-Control-Expose-Headers** CORS header. Expects a comma-delimited string (ex: 'Content-Range,X-Content-Range') or an array (ex: `['Content-Range', 'X-Content-Range']`). If not specified, no custom headers are exposed. -* `credentials`: Configures the **Access-Control-Allow-Credentials** CORS header. Set to `true` to pass the header, otherwise it is omitted. -* `maxAge`: Configures the **Access-Control-Max-Age** CORS header. Set to an integer to pass the header, otherwise it is omitted. -* `preflightContinue`: Pass the CORS preflight response to the next handler. -* `optionsSuccessStatus`: Provides a status code to use for successful `OPTIONS` requests, since some legacy browsers (IE11, various SmartTVs) choke on `204`. - -The default configuration is the equivalent of: - -```json -{ - "origin": "*", - "methods": "GET,HEAD,PUT,PATCH,POST,DELETE", - "preflightContinue": false, - "optionsSuccessStatus": 204 -} -``` - -## Common Misconceptions - -### "CORS blocks requests from disallowed origins" - -**No.** Your server receives and processes every request. CORS headers tell the browser whether JavaScript can read the response—not whether the request is allowed. - -### "CORS protects my API from unauthorized access" - -**No.** CORS is not access control. Any HTTP client (curl, Postman, another server) can call your API regardless of CORS settings. Use authentication and authorization to protect your API. - -### "Setting `origin: 'http://example.com'` means only that domain can access my server" - -**No.** It means browsers will only let JavaScript from that origin read responses. The server still responds to all requests. - -## License - -[MIT License](http://www.opensource.org/licenses/mit-license.php) - -## Original Author - -[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) - -[coveralls-image]: https://img.shields.io/coveralls/expressjs/cors/master.svg -[coveralls-url]: https://coveralls.io/r/expressjs/cors?branch=master -[downloads-image]: https://img.shields.io/npm/dm/cors.svg -[downloads-url]: https://npmjs.com/package/cors -[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/cors/ci.yml?branch=master&label=ci -[github-actions-ci-url]: https://github.com/expressjs/cors?query=workflow%3Aci -[npm-image]: https://img.shields.io/npm/v/cors.svg -[npm-url]: https://npmjs.com/package/cors diff --git a/node_modules/cors/lib/index.js b/node_modules/cors/lib/index.js deleted file mode 100644 index ad899ca..0000000 --- a/node_modules/cors/lib/index.js +++ /dev/null @@ -1,238 +0,0 @@ -(function () { - - 'use strict'; - - var assign = require('object-assign'); - var vary = require('vary'); - - var defaults = { - origin: '*', - methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', - preflightContinue: false, - optionsSuccessStatus: 204 - }; - - function isString(s) { - return typeof s === 'string' || s instanceof String; - } - - function isOriginAllowed(origin, allowedOrigin) { - if (Array.isArray(allowedOrigin)) { - for (var i = 0; i < allowedOrigin.length; ++i) { - if (isOriginAllowed(origin, allowedOrigin[i])) { - return true; - } - } - return false; - } else if (isString(allowedOrigin)) { - return origin === allowedOrigin; - } else if (allowedOrigin instanceof RegExp) { - return allowedOrigin.test(origin); - } else { - return !!allowedOrigin; - } - } - - function configureOrigin(options, req) { - var requestOrigin = req.headers.origin, - headers = [], - isAllowed; - - if (!options.origin || options.origin === '*') { - // allow any origin - headers.push([{ - key: 'Access-Control-Allow-Origin', - value: '*' - }]); - } else if (isString(options.origin)) { - // fixed origin - headers.push([{ - key: 'Access-Control-Allow-Origin', - value: options.origin - }]); - headers.push([{ - key: 'Vary', - value: 'Origin' - }]); - } else { - isAllowed = isOriginAllowed(requestOrigin, options.origin); - // reflect origin - headers.push([{ - key: 'Access-Control-Allow-Origin', - value: isAllowed ? requestOrigin : false - }]); - headers.push([{ - key: 'Vary', - value: 'Origin' - }]); - } - - return headers; - } - - function configureMethods(options) { - var methods = options.methods; - if (methods.join) { - methods = options.methods.join(','); // .methods is an array, so turn it into a string - } - return { - key: 'Access-Control-Allow-Methods', - value: methods - }; - } - - function configureCredentials(options) { - if (options.credentials === true) { - return { - key: 'Access-Control-Allow-Credentials', - value: 'true' - }; - } - return null; - } - - function configureAllowedHeaders(options, req) { - var allowedHeaders = options.allowedHeaders || options.headers; - var headers = []; - - if (!allowedHeaders) { - allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers - headers.push([{ - key: 'Vary', - value: 'Access-Control-Request-Headers' - }]); - } else if (allowedHeaders.join) { - allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string - } - if (allowedHeaders && allowedHeaders.length) { - headers.push([{ - key: 'Access-Control-Allow-Headers', - value: allowedHeaders - }]); - } - - return headers; - } - - function configureExposedHeaders(options) { - var headers = options.exposedHeaders; - if (!headers) { - return null; - } else if (headers.join) { - headers = headers.join(','); // .headers is an array, so turn it into a string - } - if (headers && headers.length) { - return { - key: 'Access-Control-Expose-Headers', - value: headers - }; - } - return null; - } - - function configureMaxAge(options) { - var maxAge = (typeof options.maxAge === 'number' || options.maxAge) && options.maxAge.toString() - if (maxAge && maxAge.length) { - return { - key: 'Access-Control-Max-Age', - value: maxAge - }; - } - return null; - } - - function applyHeaders(headers, res) { - for (var i = 0, n = headers.length; i < n; i++) { - var header = headers[i]; - if (header) { - if (Array.isArray(header)) { - applyHeaders(header, res); - } else if (header.key === 'Vary' && header.value) { - vary(res, header.value); - } else if (header.value) { - res.setHeader(header.key, header.value); - } - } - } - } - - function cors(options, req, res, next) { - var headers = [], - method = req.method && req.method.toUpperCase && req.method.toUpperCase(); - - if (method === 'OPTIONS') { - // preflight - headers.push(configureOrigin(options, req)); - headers.push(configureCredentials(options)) - headers.push(configureMethods(options)) - headers.push(configureAllowedHeaders(options, req)); - headers.push(configureMaxAge(options)) - headers.push(configureExposedHeaders(options)) - applyHeaders(headers, res); - - if (options.preflightContinue) { - next(); - } else { - // Safari (and potentially other browsers) need content-length 0, - // for 204 or they just hang waiting for a body - res.statusCode = options.optionsSuccessStatus; - res.setHeader('Content-Length', '0'); - res.end(); - } - } else { - // actual response - headers.push(configureOrigin(options, req)); - headers.push(configureCredentials(options)) - headers.push(configureExposedHeaders(options)) - applyHeaders(headers, res); - next(); - } - } - - function middlewareWrapper(o) { - // if options are static (either via defaults or custom options passed in), wrap in a function - var optionsCallback = null; - if (typeof o === 'function') { - optionsCallback = o; - } else { - optionsCallback = function (req, cb) { - cb(null, o); - }; - } - - return function corsMiddleware(req, res, next) { - optionsCallback(req, function (err, options) { - if (err) { - next(err); - } else { - var corsOptions = assign({}, defaults, options); - var originCallback = null; - if (corsOptions.origin && typeof corsOptions.origin === 'function') { - originCallback = corsOptions.origin; - } else if (corsOptions.origin) { - originCallback = function (origin, cb) { - cb(null, corsOptions.origin); - }; - } - - if (originCallback) { - originCallback(req.headers.origin, function (err2, origin) { - if (err2 || !origin) { - next(err2); - } else { - corsOptions.origin = origin; - cors(corsOptions, req, res, next); - } - }); - } else { - next(); - } - } - }); - }; - } - - // can pass either an options hash, an options delegate, or nothing - module.exports = middlewareWrapper; - -}()); diff --git a/node_modules/cors/package.json b/node_modules/cors/package.json deleted file mode 100644 index e90bac8..0000000 --- a/node_modules/cors/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "cors", - "description": "Node.js CORS middleware", - "version": "2.8.6", - "author": "Troy Goode (https://github.com/troygoode/)", - "license": "MIT", - "keywords": [ - "cors", - "express", - "connect", - "middleware" - ], - "repository": "expressjs/cors", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "main": "./lib/index.js", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "devDependencies": { - "after": "0.8.2", - "eslint": "7.30.0", - "express": "4.21.2", - "mocha": "9.2.2", - "nyc": "15.1.0", - "supertest": "6.1.3" - }, - "files": [ - "lib/index.js" - ], - "engines": { - "node": ">= 0.10" - }, - "scripts": { - "test": "npm run lint && npm run test-ci", - "test-ci": "nyc --reporter=lcov --reporter=text mocha --require test/support/env", - "lint": "eslint lib test" - } -} diff --git a/node_modules/debug/.coveralls.yml b/node_modules/debug/.coveralls.yml new file mode 100644 index 0000000..20a7068 --- /dev/null +++ b/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/debug/.eslintrc b/node_modules/debug/.eslintrc new file mode 100644 index 0000000..8a37ae2 --- /dev/null +++ b/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/debug/.npmignore b/node_modules/debug/.npmignore new file mode 100644 index 0000000..5f60eec --- /dev/null +++ b/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/node_modules/debug/.travis.yml b/node_modules/debug/.travis.yml new file mode 100644 index 0000000..6c6090c --- /dev/null +++ b/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/debug/CHANGELOG.md b/node_modules/debug/CHANGELOG.md new file mode 100644 index 0000000..eadaa18 --- /dev/null +++ b/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE index 1a9820e..658c933 100644 --- a/node_modules/debug/LICENSE +++ b/node_modules/debug/LICENSE @@ -1,20 +1,19 @@ (The MIT License) -Copyright (c) 2014-2017 TJ Holowaychuk -Copyright (c) 2018-2021 Josh Junon +Copyright (c) 2014 TJ Holowaychuk -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, +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 +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 +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/node_modules/debug/Makefile b/node_modules/debug/Makefile new file mode 100644 index 0000000..584da8b --- /dev/null +++ b/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md index 9ebdfbf..f67be6b 100644 --- a/node_modules/debug/README.md +++ b/node_modules/debug/README.md @@ -1,11 +1,12 @@ # debug -[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - -A tiny JavaScript debugging utility modelled after Node.js core's debugging -technique. Works in Node.js and web browsers. + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** ## Installation @@ -17,7 +18,7 @@ $ npm install debug `debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. -Example [_app.js_](./examples/node/app.js): +Example _app.js_: ```js var debug = require('debug')('http') @@ -26,7 +27,7 @@ var debug = require('debug')('http') // fake app -debug('booting %o', name); +debug('booting %s', name); http.createServer(function(req, res){ debug(req.method + ' ' + req.url); @@ -40,148 +41,81 @@ http.createServer(function(req, res){ require('./worker'); ``` -Example [_worker.js_](./examples/node/worker.js): +Example _worker.js_: ```js -var a = require('debug')('worker:a') - , b = require('debug')('worker:b'); +var debug = require('debug')('worker'); -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); +setInterval(function(){ + debug('doing some work'); +}, 1000); ``` -The `DEBUG` environment variable is then used to enable these based on space or -comma-delimited names. + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: -Here are some examples: + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) -screen shot 2017-08-08 at 12 53 04 pm -screen shot 2017-08-08 at 12 53 38 pm -screen shot 2017-08-08 at 12 53 25 pm + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) -#### Windows command prompt notes +#### Windows note -##### CMD + On Windows the environment variable is set using the `set` command. -On Windows the environment variable is set using the `set` command. + ```cmd + set DEBUG=*,-not_this + ``` -```cmd -set DEBUG=*,-not_this -``` + Note that PowerShell uses different syntax to set environment variables. -Example: - -```cmd -set DEBUG=* & node app.js -``` - -##### PowerShell (VS Code default) - -PowerShell uses different syntax to set environment variables. - -```cmd -$env:DEBUG = "*,-not_this" -``` - -Example: - -```cmd -$env:DEBUG='app';node app.js -``` + ```cmd + $env:DEBUG = "*,-not_this" + ``` Then, run the program to be debugged as usual. -npm script example: -```js - "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", -``` - -## Namespace Colors - -Every debug instance has a color generated for it based on its namespace name. -This helps when visually parsing the debug output to identify which debug instance -a debug line belongs to. - -#### Node.js - -In Node.js, colors are enabled when stderr is a TTY. You also _should_ install -the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, -otherwise debug will only use a small handful of basic colors. - - - -#### Web Browser - -Colors are also enabled on "Web Inspectors" that understand the `%c` formatting -option. These are WebKit web inspectors, Firefox ([since version -31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) -and the Firebug plugin for Firefox (any version). - - - - ## Millisecond diff -When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) -When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: - - + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) ## Conventions -If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". ## Wildcards -The `*` character may be used as a wildcard. Suppose for example your library has -debuggers named "connect:bodyParser", "connect:compress", "connect:session", -instead of listing all three with -`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do -`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. -You can also exclude specific debuggers by prefixing them with a "-" character. -For example, `DEBUG=*,-connect:*` would include all debuggers except those -starting with "connect:". + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". ## Environment Variables -When running through Node.js, you can set a few environment variables that will -change the behavior of the debug logging: + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: | Name | Purpose | |-----------|-------------------------------------------------| | `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | | `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_DEPTH` | Object inspection depth. | | `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | -__Note:__ The environment variables beginning with `DEBUG_` end up being -converted into an Options object that gets used with `%o`/`%O` formatters. -See the Node.js documentation for -[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) -for the complete list. + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. ## Formatters -Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. -Below are the officially supported formatters: + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: | Formatter | Representation | |-----------|----------------| @@ -192,12 +126,9 @@ Below are the officially supported formatters: | `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | | `%%` | Single percent sign ('%'). This does not consume an argument. | - ### Custom formatters -You can add custom formatters by extending the `debug.formatters` object. -For example, if you wanted to add support for rendering a Buffer as hex with -`%h`, you could do something like: + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: ```js const createDebug = require('debug') @@ -211,16 +142,14 @@ debug('this is hex: %h', new Buffer('hello world')) // foo this is hex: 68656c6c6f20776f726c6421 +0ms ``` +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. -## Browser Support - -You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), -or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), -if you don't want to build it yourself. - -Debug's enable state is currently persisted by `localStorage`. -Consider the situation shown below where you have `worker:a` and `worker:b`, -and wish to debug both. You can enable this using `localStorage.debug`: + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: ```js localStorage.debug = 'worker:*' @@ -241,15 +170,23 @@ setInterval(function(){ }, 1200); ``` -In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - ## Output streams By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: -Example [_stdout.js_](./examples/node/stdout.js): +Example _stdout.js_: ```js var debug = require('debug'); @@ -271,118 +208,13 @@ error('now goes to stdout via console.info'); log('still goes to stdout, but via console.info now'); ``` -## Extend -You can simply extend debugger -```js -const log = require('debug')('auth'); - -//creates new debug instance with extended namespace -const logSign = log.extend('sign'); -const logLogin = log.extend('login'); - -log('hello'); // auth hello -logSign('hello'); //auth:sign hello -logLogin('hello'); //auth:login hello -``` - -## Set dynamically - -You can also enable debug dynamically by calling the `enable()` method : - -```js -let debug = require('debug'); - -console.log(1, debug.enabled('test')); - -debug.enable('test'); -console.log(2, debug.enabled('test')); - -debug.disable(); -console.log(3, debug.enabled('test')); - -``` - -print : -``` -1 false -2 true -3 false -``` - -Usage : -`enable(namespaces)` -`namespaces` can include modes separated by a colon and wildcards. - -Note that calling `enable()` completely overrides previously set DEBUG variable : - -``` -$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' -=> false -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## Checking whether a debug target is enabled - -After you've created a debug instance, you can determine whether or not it is -enabled by checking the `enabled` property: - -```javascript -const debug = require('debug')('http'); - -if (debug.enabled) { - // do stuff... -} -``` - -You can also manually toggle this property to force the debug instance to be -enabled or disabled. - -## Usage in child processes - -Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. -For example: - -```javascript -worker = fork(WORKER_WRAP_PATH, [workerPath], { - stdio: [ - /* stdin: */ 0, - /* stdout: */ 'pipe', - /* stderr: */ 'pipe', - 'ipc', - ], - env: Object.assign({}, process.env, { - DEBUG_COLORS: 1 // without this settings, colors won't be shown - }), -}); - -worker.stderr.pipe(process.stderr, { end: false }); -``` - ## Authors - TJ Holowaychuk - Nathan Rajlich - Andrew Rhyne - - Josh Junon - + ## Backers Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] @@ -458,8 +290,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s (The MIT License) -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> -Copyright (c) 2018-2021 Josh Junon +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/debug/component.json b/node_modules/debug/component.json new file mode 100644 index 0000000..9de2641 --- /dev/null +++ b/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/debug/karma.conf.js b/node_modules/debug/karma.conf.js new file mode 100644 index 0000000..103a82d --- /dev/null +++ b/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/debug/node.js b/node_modules/debug/node.js new file mode 100644 index 0000000..7fc36fe --- /dev/null +++ b/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json index ee8abb5..dc787ba 100644 --- a/node_modules/debug/package.json +++ b/node_modules/debug/package.json @@ -1,64 +1,49 @@ { "name": "debug", - "version": "4.4.3", + "version": "2.6.9", "repository": { "type": "git", - "url": "git://github.com/debug-js/debug.git" + "url": "git://github.com/visionmedia/debug.git" }, - "description": "Lightweight debugging utility for Node.js and the browser", + "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], - "files": [ - "src", - "LICENSE", - "README.md" - ], - "author": "Josh Junon (https://github.com/qix-)", + "author": "TJ Holowaychuk ", "contributors": [ - "TJ Holowaychuk ", "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", - "scripts": { - "lint": "xo", - "test": "npm run test:node && npm run test:browser && npm run lint", - "test:node": "mocha test.js test.node.js", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls" - }, "dependencies": { - "ms": "^2.1.3" + "ms": "2.0.0" }, "devDependencies": { - "brfs": "^2.0.1", - "browserify": "^16.2.3", - "coveralls": "^3.0.2", - "karma": "^3.1.4", - "karma-browserify": "^6.0.0", - "karma-chrome-launcher": "^2.2.0", + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", - "mocha": "^5.2.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", "mocha-lcov-reporter": "^1.2.0", - "sinon": "^14.0.0", - "xo": "^0.23.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" }, "main": "./src/index.js", "browser": "./src/browser.js", - "engines": { - "node": ">=6.0" - }, - "xo": { - "rules": { - "import/extensions": "off" + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" } } } diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js index 5993451..7106924 100644 --- a/node_modules/debug/src/browser.js +++ b/node_modules/debug/src/browser.js @@ -1,106 +1,31 @@ -/* eslint-env browser */ - /** * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. */ +exports = module.exports = require('./debug'); +exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); /** * Colors. */ exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' ]; /** @@ -111,35 +36,39 @@ exports.colors = [ * TODO: add a `localStorage` variable to explicitly enable/disable colors */ -// eslint-disable-next-line complexity function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { + return true; + } - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - let m; - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - // eslint-disable-next-line no-return-assign - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); + // is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (err) { + return '[UnexpectedJSONParseError]: ' + err.message; + } +}; + + /** * Colorize log arguments if enabled. * @@ -147,49 +76,52 @@ function useColors() { */ function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); + var useColors = this.useColors; - if (!this.useColors) { - return; - } + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); + if (!useColors) return; - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); + var c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit') - args.splice(lastC, 0, c); + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); } /** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". * * @api public */ -exports.log = console.debug || console.log || (() => {}); + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} /** * Save `namespaces`. @@ -197,17 +129,15 @@ exports.log = console.debug || console.log || (() => {}); * @param {String} namespaces * @api private */ + function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} } /** @@ -216,23 +146,27 @@ function save(namespaces) { * @return {String} returns the previously persisted debug modes * @api private */ + function load() { - let r; - try { - r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } + var r; + try { + r = exports.storage.debug; + } catch(e) {} - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } - return r; + return r; } +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + /** * Localstorage attempts to return the localstorage. * @@ -245,28 +179,7 @@ function load() { */ function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } + try { + return window.localStorage; + } catch (e) {} } - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; diff --git a/node_modules/debug/src/common.js b/node_modules/debug/src/common.js deleted file mode 100644 index 141cb57..0000000 --- a/node_modules/debug/src/common.js +++ /dev/null @@ -1,292 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - const split = (typeof namespaces === 'string' ? namespaces : '') - .trim() - .replace(/\s+/g, ',') - .split(',') - .filter(Boolean); - - for (const ns of split) { - if (ns[0] === '-') { - createDebug.skips.push(ns.slice(1)); - } else { - createDebug.names.push(ns); - } - } - } - - /** - * Checks if the given string matches a namespace template, honoring - * asterisks as wildcards. - * - * @param {String} search - * @param {String} template - * @return {Boolean} - */ - function matchesTemplate(search, template) { - let searchIndex = 0; - let templateIndex = 0; - let starIndex = -1; - let matchIndex = 0; - - while (searchIndex < search.length) { - if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { - // Match character or proceed with wildcard - if (template[templateIndex] === '*') { - starIndex = templateIndex; - matchIndex = searchIndex; - templateIndex++; // Skip the '*' - } else { - searchIndex++; - templateIndex++; - } - } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition - // Backtrack to the last '*' and try to match more characters - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; // No match - } - } - - // Handle trailing '*' in template - while (templateIndex < template.length && template[templateIndex] === '*') { - templateIndex++; - } - - return templateIndex === template.length; - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names, - ...createDebug.skips.map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - for (const skip of createDebug.skips) { - if (matchesTemplate(name, skip)) { - return false; - } - } - - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } - } - - return false; - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; diff --git a/node_modules/debug/src/debug.js b/node_modules/debug/src/debug.js new file mode 100644 index 0000000..6a5e3fc --- /dev/null +++ b/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + +exports.formatters = {}; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * @param {String} namespace + * @return {Number} + * @api private + */ + +function selectColor(namespace) { + var hash = 0, i; + + for (i in namespace) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return exports.colors[Math.abs(hash) % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function createDebug(namespace) { + + function debug() { + // disabled? + if (!debug.enabled) return; + + var self = debug; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // turn the `arguments` into a proper Array + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %O + args.unshift('%O'); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // apply env-specific formatting (colors, etc.) + exports.formatArgs.call(self, args); + + var logFn = debug.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = exports.enabled(namespace); + debug.useColors = exports.useColors(); + debug.color = selectColor(namespace); + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + return debug; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + exports.names = []; + exports.skips = []; + + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js index bf4c57f..e12cf4d 100644 --- a/node_modules/debug/src/index.js +++ b/node_modules/debug/src/index.js @@ -1,10 +1,10 @@ /** - * Detect Electron renderer / nwjs process, which is node, but we should + * Detect Electron renderer process, which is node, but we should * treat as a browser. */ -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = require('./browser.js'); +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); } else { - module.exports = require('./node.js'); + module.exports = require('./node.js'); } diff --git a/node_modules/debug/src/inspector-log.js b/node_modules/debug/src/inspector-log.js new file mode 100644 index 0000000..60ea6c0 --- /dev/null +++ b/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js index 715560a..b15109c 100644 --- a/node_modules/debug/src/node.js +++ b/node_modules/debug/src/node.js @@ -2,23 +2,22 @@ * Module dependencies. */ -const tty = require('tty'); -const util = require('util'); +var tty = require('tty'); +var util = require('util'); /** * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. */ +exports = module.exports = require('./debug'); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); /** * Colors. @@ -26,138 +25,80 @@ exports.destroy = util.deprecate( exports.colors = [6, 2, 3, 4, 5, 1]; -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = require('supports-color'); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); +exports.inspectOpts = Object.keys(process.env).filter(function (key) { + return /^debug_/i.test(key); +}).reduce(function (obj, key) { + // camel-case + var prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } + // coerce string value into JS value + var val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) val = true; + else if (/^(no|off|false|disabled)$/i.test(val)) val = false; + else if (val === 'null') val = null; + else val = Number(val); - obj[prop] = val; - return obj; + obj[prop] = val; + return obj; }, {}); +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; + +if (1 !== fd && 2 !== fd) { + util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() +} + +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); + return 'colors' in exports.inspectOpts + ? Boolean(exports.inspectOpts.colors) + : tty.isatty(fd); } +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +exports.formatters.o = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n').map(function(str) { + return str.trim() + }).join(' '); +}; + +/** + * Map %o to `util.inspect()`, allowing multiple lines if needed. + */ + +exports.formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + /** * Adds ANSI color escape codes if enabled. * @@ -165,33 +106,27 @@ function useColors() { */ function formatArgs(args) { - const {namespace: name, useColors} = this; + var name = this.namespace; + var useColors = this.useColors; - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; + if (useColors) { + var c = this.color; + var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } } /** - * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + * Invokes `util.format()` with the specified arguments and writes to `stream`. */ -function log(...args) { - return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); +function log() { + return stream.write(util.format.apply(util, arguments) + '\n'); } /** @@ -200,14 +135,15 @@ function log(...args) { * @param {String} namespaces * @api private */ + function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } } /** @@ -218,7 +154,75 @@ function save(namespaces) { */ function load() { - return process.env.DEBUG; + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; } /** @@ -228,36 +232,17 @@ function load() { * differently for a particular `debug` instance. */ -function init(debug) { - debug.inspectOpts = {}; +function init (debug) { + debug.inspectOpts = {}; - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } + var keys = Object.keys(exports.inspectOpts); + for (var i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } } -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - /** - * Map %o to `util.inspect()`, all on a single line. + * Enable namespaces listed in `process.env.DEBUG` initially. */ -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; +exports.enable(load()); diff --git a/node_modules/decimal.js/LICENCE.md b/node_modules/decimal.js/LICENCE.md deleted file mode 100644 index e62dbae..0000000 --- a/node_modules/decimal.js/LICENCE.md +++ /dev/null @@ -1,23 +0,0 @@ -The MIT Licence. - -Copyright (c) 2025 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/node_modules/decimal.js/README.md b/node_modules/decimal.js/README.md deleted file mode 100644 index f59a9cf..0000000 --- a/node_modules/decimal.js/README.md +++ /dev/null @@ -1,246 +0,0 @@ -![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) -[![CDNJS](https://img.shields.io/cdnjs/v/decimal.js.svg)](https://cdnjs.com/libraries/decimal.js) -[![](https://data.jsdelivr.com/v1/package/npm/decimal.js/badge)](https://www.jsdelivr.com/package/npm/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](LICENCE.md) diff --git a/node_modules/decimal.js/decimal.d.ts b/node_modules/decimal.js/decimal.d.ts deleted file mode 100644 index 526a896..0000000 --- a/node_modules/decimal.js/decimal.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -// 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 | bigint | 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; -} - -export declare function Decimal(n: Decimal.Value): Decimal; diff --git a/node_modules/decimal.js/decimal.js b/node_modules/decimal.js/decimal.js deleted file mode 100644 index f7ecafb..0000000 --- a/node_modules/decimal.js/decimal.js +++ /dev/null @@ -1,4951 +0,0 @@ -;(function (globalScope) { - 'use strict'; - - - /*! - * decimal.js v10.6.0 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2025 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|bigint|Decimal} - * max {number|string|bigint|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 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; - - // See https://github.com/MikeMcl/decimal.js/pull/217 - x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan(); - - Ctor.precision = pr; - Ctor.rounding = rm; - - return x.times(2); - }; - - - /* - * 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|bigint|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|bigint|Decimal} - * - P.max = function () { - Array.prototype.push.call(arguments, this); - return maxOrMin(this.constructor, arguments, -1); - }; - */ - - - /* - * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal. - * - * arguments {number|string|bigint|Decimal} - * - P.min = function () { - Array.prototype.push.call(arguments, this); - return maxOrMin(this.constructor, arguments, 1); - }; - */ - - - /* - * 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|bigint|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|bigint|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|bigint|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` (`n` is -1) and `min` (`n` is 1). - */ - function maxOrMin(Ctor, args, n) { - var k, y, - x = new Ctor(args[0]), - i = 0; - - for (; ++i < args.length;) { - y = new Ctor(args[i]); - - // NaN? - if (!y.s) { - x = y; - break; - } - - k = x.cmp(y); - - if (k === n || k === 0 && x.s === n) { - 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; - - // TODO BigInt str: no need to check for decimal point, exponential form or leading zeros. - - // 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|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} The y-coordinate. - * x {number|string|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * min {number|string|bigint|Decimal} - * max {number|string|bigint|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|bigint|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|bigint|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|bigint|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; - - 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 or NaN? - if (v * 0 !== 0) { - if (!v) x.s = NaN; - x.e = NaN; - x.d = null; - return; - } - - return parseDecimal(x, v.toString()); - } - - if (t === 'string') { - if ((i = v.charCodeAt(0)) === 45) { // minus sign - v = v.slice(1); - x.s = -1; - } else { - if (i === 43) v = v.slice(1); // plus sign - x.s = 1; - } - - return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); - } - - if (t === 'bigint') { - if (v < 0) { - v = -v; - x.s = -1; - } else { - x.s = 1; - } - - return parseDecimal(x, v.toString()); - } - - throw Error(invalidArgument + 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|bigint|Decimal} - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} The argument of the logarithm. - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * - */ - function max() { - return maxOrMin(this, arguments, -1); - } - - - /* - * Return a new Decimal whose value is the minimum of the arguments. - * - * arguments {number|string|bigint|Decimal} - * - */ - function min() { - return maxOrMin(this, arguments, 1); - } - - - /* - * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits - * using rounding mode `rounding`. - * - * x {number|string|bigint|Decimal} - * y {number|string|bigint|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|bigint|Decimal} - * y {number|string|bigint|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|bigint|Decimal} The base. - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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/node_modules/decimal.js/decimal.mjs b/node_modules/decimal.js/decimal.mjs deleted file mode 100644 index 18dc640..0000000 --- a/node_modules/decimal.js/decimal.mjs +++ /dev/null @@ -1,4914 +0,0 @@ -/*! - * decimal.js v10.6.0 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2025 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|bigint|Decimal} - * max {number|string|bigint|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 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; - - // See https://github.com/MikeMcl/decimal.js/pull/217 - x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().atan(); - - Ctor.precision = pr; - Ctor.rounding = rm; - - return x.times(2); -}; - - -/* - * 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|bigint|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|bigint|Decimal} - * -P.max = function () { - Array.prototype.push.call(arguments, this); - return maxOrMin(this.constructor, arguments, -1); -}; - */ - - -/* - * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal. - * - * arguments {number|string|bigint|Decimal} - * -P.min = function () { - Array.prototype.push.call(arguments, this); - return maxOrMin(this.constructor, arguments, 1); -}; - */ - - -/* - * 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|bigint|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|bigint|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|bigint|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` (`n` is -1) and `min` (`n` is 1). - */ -function maxOrMin(Ctor, args, n) { - var k, y, - x = new Ctor(args[0]), - i = 0; - - for (; ++i < args.length;) { - y = new Ctor(args[i]); - - // NaN? - if (!y.s) { - x = y; - break; - } - - k = x.cmp(y); - - if (k === n || k === 0 && x.s === n) { - 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; - - // TODO BigInt str: no need to check for decimal point, exponential form or leading zeros. - // 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|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} The y-coordinate. - * x {number|string|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * min {number|string|bigint|Decimal} - * max {number|string|bigint|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|bigint|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|bigint|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|bigint|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; - - 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 or NaN? - if (v * 0 !== 0) { - if (!v) x.s = NaN; - x.e = NaN; - x.d = null; - return; - } - - return parseDecimal(x, v.toString()); - } - - if (t === 'string') { - if ((i = v.charCodeAt(0)) === 45) { // minus sign - v = v.slice(1); - x.s = -1; - } else { - if (i === 43) v = v.slice(1); // plus sign - x.s = 1; - } - - return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v); - } - - if (t === 'bigint') { - if (v < 0) { - v = -v; - x.s = -1; - } else { - x.s = 1; - } - - return parseDecimal(x, v.toString()); - } - - throw Error(invalidArgument + 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|bigint|Decimal} - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} The argument of the logarithm. - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * - */ -function max() { - return maxOrMin(this, arguments, -1); -} - - -/* - * Return a new Decimal whose value is the minimum of the arguments. - * - * arguments {number|string|bigint|Decimal} - * - */ -function min() { - return maxOrMin(this, arguments, 1); -} - - -/* - * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits - * using rounding mode `rounding`. - * - * x {number|string|bigint|Decimal} - * y {number|string|bigint|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|bigint|Decimal} - * y {number|string|bigint|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|bigint|Decimal} The base. - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} - * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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/node_modules/decimal.js/package.json b/node_modules/decimal.js/package.json deleted file mode 100644 index 4f84301..0000000 --- a/node_modules/decimal.js/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "decimal.js", - "description": "An arbitrary-precision Decimal type for JavaScript.", - "version": "10.6.0", - "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/node_modules/destroy/LICENSE b/node_modules/destroy/LICENSE new file mode 100644 index 0000000..0e2c35f --- /dev/null +++ b/node_modules/destroy/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2015-2022 Douglas Christopher Wilson doug@somethingdoug.com + +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/node_modules/destroy/README.md b/node_modules/destroy/README.md new file mode 100644 index 0000000..e7701ae --- /dev/null +++ b/node_modules/destroy/README.md @@ -0,0 +1,63 @@ +# destroy + +[![NPM version][npm-image]][npm-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +Destroy a stream. + +This module is meant to ensure a stream gets destroyed, handling different APIs +and Node.js bugs. + +## API + +```js +var destroy = require('destroy') +``` + +### destroy(stream [, suppress]) + +Destroy the given stream, and optionally suppress any future `error` events. + +In most cases, this is identical to a simple `stream.destroy()` call. The rules +are as follows for a given stream: + + 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` + and add a listener to the `open` event to call `stream.close()` if it is + fired. This is for a Node.js bug that will leak a file descriptor if + `.destroy()` is called before `open`. + 2. If the `stream` is an instance of a zlib stream, then call `stream.destroy()` + and close the underlying zlib handle if open, otherwise call `stream.close()`. + This is for consistency across Node.js versions and a Node.js bug that will + leak a native zlib handle. + 3. If the `stream` is not an instance of `Stream`, then nothing happens. + 4. If the `stream` has a `.destroy()` method, then call it. + +The function returns the `stream` passed in as the argument. + +## Example + +```js +var destroy = require('destroy') + +var fs = require('fs') +var stream = fs.createReadStream('package.json') + +// ... and later +destroy(stream) +``` + +[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square +[npm-url]: https://npmjs.org/package/destroy +[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square +[github-url]: https://github.com/stream-utils/destroy/tags +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master +[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/destroy +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/stream-utils/destroy/ci/master?label=ci&style=flat-square +[github-actions-ci-url]: https://github.com/stream-utils/destroy/actions/workflows/ci.yml diff --git a/node_modules/destroy/index.js b/node_modules/destroy/index.js new file mode 100644 index 0000000..7fd5c09 --- /dev/null +++ b/node_modules/destroy/index.js @@ -0,0 +1,209 @@ +/*! + * destroy + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var EventEmitter = require('events').EventEmitter +var ReadStream = require('fs').ReadStream +var Stream = require('stream') +var Zlib = require('zlib') + +/** + * Module exports. + * @public + */ + +module.exports = destroy + +/** + * Destroy the given stream, and optionally suppress any future `error` events. + * + * @param {object} stream + * @param {boolean} suppress + * @public + */ + +function destroy (stream, suppress) { + if (isFsReadStream(stream)) { + destroyReadStream(stream) + } else if (isZlibStream(stream)) { + destroyZlibStream(stream) + } else if (hasDestroy(stream)) { + stream.destroy() + } + + if (isEventEmitter(stream) && suppress) { + stream.removeAllListeners('error') + stream.addListener('error', noop) + } + + return stream +} + +/** + * Destroy a ReadStream. + * + * @param {object} stream + * @private + */ + +function destroyReadStream (stream) { + stream.destroy() + + if (typeof stream.close === 'function') { + // node.js core bug work-around + stream.on('open', onOpenClose) + } +} + +/** + * Close a Zlib stream. + * + * Zlib streams below Node.js 4.5.5 have a buggy implementation + * of .close() when zlib encountered an error. + * + * @param {object} stream + * @private + */ + +function closeZlibStream (stream) { + if (stream._hadError === true) { + var prop = stream._binding === null + ? '_binding' + : '_handle' + + stream[prop] = { + close: function () { this[prop] = null } + } + } + + stream.close() +} + +/** + * Destroy a Zlib stream. + * + * Zlib streams don't have a destroy function in Node.js 6. On top of that + * simply calling destroy on a zlib stream in Node.js 8+ will result in a + * memory leak. So until that is fixed, we need to call both close AND destroy. + * + * PR to fix memory leak: https://github.com/nodejs/node/pull/23734 + * + * In Node.js 6+8, it's important that destroy is called before close as the + * stream would otherwise emit the error 'zlib binding closed'. + * + * @param {object} stream + * @private + */ + +function destroyZlibStream (stream) { + if (typeof stream.destroy === 'function') { + // node.js core bug work-around + // istanbul ignore if: node.js 0.8 + if (stream._binding) { + // node.js < 0.10.0 + stream.destroy() + if (stream._processing) { + stream._needDrain = true + stream.once('drain', onDrainClearBinding) + } else { + stream._binding.clear() + } + } else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) { + // node.js >= 12, ^11.1.0, ^10.15.1 + stream.destroy() + } else if (stream._destroy && typeof stream.close === 'function') { + // node.js 7, 8 + stream.destroyed = true + stream.close() + } else { + // fallback + // istanbul ignore next + stream.destroy() + } + } else if (typeof stream.close === 'function') { + // node.js < 8 fallback + closeZlibStream(stream) + } +} + +/** + * Determine if stream has destroy. + * @private + */ + +function hasDestroy (stream) { + return stream instanceof Stream && + typeof stream.destroy === 'function' +} + +/** + * Determine if val is EventEmitter. + * @private + */ + +function isEventEmitter (val) { + return val instanceof EventEmitter +} + +/** + * Determine if stream is fs.ReadStream stream. + * @private + */ + +function isFsReadStream (stream) { + return stream instanceof ReadStream +} + +/** + * Determine if stream is Zlib stream. + * @private + */ + +function isZlibStream (stream) { + return stream instanceof Zlib.Gzip || + stream instanceof Zlib.Gunzip || + stream instanceof Zlib.Deflate || + stream instanceof Zlib.DeflateRaw || + stream instanceof Zlib.Inflate || + stream instanceof Zlib.InflateRaw || + stream instanceof Zlib.Unzip +} + +/** + * No-op function. + * @private + */ + +function noop () {} + +/** + * On drain handler to clear binding. + * @private + */ + +// istanbul ignore next: node.js 0.8 +function onDrainClearBinding () { + this._binding.clear() +} + +/** + * On open handler to close stream. + * @private + */ + +function onOpenClose () { + if (typeof this.fd === 'number') { + // actually close down the fd + this.close() + } +} diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json new file mode 100644 index 0000000..c85e438 --- /dev/null +++ b/node_modules/destroy/package.json @@ -0,0 +1,48 @@ +{ + "name": "destroy", + "description": "destroy a stream if possible", + "version": "1.2.0", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "repository": "stream-utils/destroy", + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "files": [ + "index.js", + "LICENSE" + ], + "keywords": [ + "stream", + "streams", + "destroy", + "cleanup", + "leak", + "fd" + ] +} diff --git a/node_modules/escape-latex/LICENSE.md b/node_modules/escape-latex/LICENSE.md deleted file mode 100644 index 6e54eff..0000000 --- a/node_modules/escape-latex/LICENSE.md +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/escape-latex/README.md b/node_modules/escape-latex/README.md deleted file mode 100644 index 78ff9da..0000000 --- a/node_modules/escape-latex/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# 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/node_modules/escape-latex/dist/index.js b/node_modules/escape-latex/dist/index.js deleted file mode 100644 index 0da9c0d..0000000 --- a/node_modules/escape-latex/dist/index.js +++ /dev/null @@ -1,80 +0,0 @@ -"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/node_modules/escape-latex/package.json b/node_modules/escape-latex/package.json deleted file mode 100644 index a57945d..0000000 --- a/node_modules/escape-latex/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "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/node_modules/express/History.md b/node_modules/express/History.md new file mode 100644 index 0000000..150c2ab --- /dev/null +++ b/node_modules/express/History.md @@ -0,0 +1,3667 @@ +4.22.1 / 2025-12-01 +========== + + * Revert security fix for [CVE-2024-51999](https://www.cve.org/CVERecord?id=CVE-2024-51999) ([GHSA-pj86-cfqh-vqx6](https://github.com/expressjs/express/security/advisories/GHSA-pj86-cfqh-vqx6)) + +4.22.0 / 2025-12-01 +========== + * Security fix for [CVE-2024-51999](https://www.cve.org/CVERecord?id=CVE-2024-51999) ([GHSA-pj86-cfqh-vqx6](https://github.com/expressjs/express/security/advisories/GHSA-pj86-cfqh-vqx6)) + * deps: use tilde notation for dependencies + * deps: qs@6.14.0 + +4.21.2 / 2024-11-06 +========== + + * deps: path-to-regexp@0.1.12 + - Fix backtracking protection + * deps: path-to-regexp@0.1.11 + - Throws an error on invalid path values + +4.21.1 / 2024-10-08 +========== + + * Backported a fix for [CVE-2024-47764](https://nvd.nist.gov/vuln/detail/CVE-2024-47764) + + +4.21.0 / 2024-09-11 +========== + + * Deprecate `res.location("back")` and `res.redirect("back")` magic string + * deps: serve-static@1.16.2 + * includes send@0.19.0 + * deps: finalhandler@1.3.1 + * deps: qs@6.13.0 + +4.20.0 / 2024-09-10 +========== + * deps: serve-static@0.16.0 + * Remove link renderization in html while redirecting + * deps: send@0.19.0 + * Remove link renderization in html while redirecting + * deps: body-parser@0.6.0 + * add `depth` option to customize the depth level in the parser + * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`) + * Remove link renderization in html while using `res.redirect` + * deps: path-to-regexp@0.1.10 + - Adds support for named matching groups in the routes using a regex + - Adds backtracking protection to parameters without regexes defined + * deps: encodeurl@~2.0.0 + - Removes encoding of `\`, `|`, and `^` to align better with URL spec + * Deprecate passing `options.maxAge` and `options.expires` to `res.clearCookie` + - Will be ignored in v5, clearCookie will set a cookie with an expires in the past to instruct clients to delete the cookie + +4.19.2 / 2024-03-25 +========== + + * Improved fix for open redirect allow list bypass + +4.19.1 / 2024-03-20 +========== + + * Allow passing non-strings to res.location with new encoding handling checks + +4.19.0 / 2024-03-20 +========== + + * Prevent open redirect allow list bypass due to encodeurl + * deps: cookie@0.6.0 + +4.18.3 / 2024-02-29 +========== + + * Fix routing requests without method + * deps: body-parser@1.20.2 + - Fix strict json error message on Node.js 19+ + - deps: content-type@~1.0.5 + - deps: raw-body@2.5.2 + * deps: cookie@0.6.0 + - Add `partitioned` option + +4.18.2 / 2022-10-08 +=================== + + * Fix regression routing a large stack in a single route + * deps: body-parser@1.20.1 + - deps: qs@6.11.0 + - perf: remove unnecessary object clone + * deps: qs@6.11.0 + +4.18.1 / 2022-04-29 +=================== + + * Fix hanging on large stack of sync routes + +4.18.0 / 2022-04-25 +=================== + + * Add "root" option to `res.download` + * Allow `options` without `filename` in `res.download` + * Deprecate string and non-integer arguments to `res.status` + * Fix behavior of `null`/`undefined` as `maxAge` in `res.cookie` + * Fix handling very large stacks of sync middleware + * Ignore `Object.prototype` values in settings through `app.set`/`app.get` + * Invoke `default` with same arguments as types in `res.format` + * Support proper 205 responses using `res.send` + * Use `http-errors` for `res.format` error + * deps: body-parser@1.20.0 + - Fix error message for json parse whitespace in `strict` + - Fix internal error when inflated body exceeds limit + - Prevent loss of async hooks context + - Prevent hanging when request already read + - deps: depd@2.0.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: qs@6.10.3 + - deps: raw-body@2.5.1 + * deps: cookie@0.5.0 + - Add `priority` option + - Fix `expires` option to reject invalid dates + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: finalhandler@1.2.0 + - Remove set content headers that break response + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + * deps: on-finished@2.4.1 + - Prevent loss of async hooks context + * deps: qs@6.10.3 + * deps: send@0.18.0 + - Fix emitted 416 error missing headers property + - Limit the headers removed for 304 response + - deps: depd@2.0.0 + - deps: destroy@1.2.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + * deps: serve-static@1.15.0 + - deps: send@0.18.0 + * deps: statuses@2.0.1 + - Remove code 306 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +4.17.3 / 2022-02-16 +=================== + + * deps: accepts@~1.3.8 + - deps: mime-types@~2.1.34 + - deps: negotiator@0.6.3 + * deps: body-parser@1.19.2 + - deps: bytes@3.1.2 + - deps: qs@6.9.7 + - deps: raw-body@2.4.3 + * deps: cookie@0.4.2 + * deps: qs@6.9.7 + * Fix handling of `__proto__` keys + * pref: remove unnecessary regexp for trust proxy + +4.17.2 / 2021-12-16 +=================== + + * Fix handling of `undefined` in `res.jsonp` + * Fix handling of `undefined` when `"json escape"` is enabled + * Fix incorrect middleware execution with unanchored `RegExp`s + * Fix `res.jsonp(obj, status)` deprecation message + * Fix typo in `res.is` JSDoc + * deps: body-parser@1.19.1 + - deps: bytes@3.1.1 + - deps: http-errors@1.8.1 + - deps: qs@6.9.6 + - deps: raw-body@2.4.2 + - deps: safe-buffer@5.2.1 + - deps: type-is@~1.6.18 + * deps: content-disposition@0.5.4 + - deps: safe-buffer@5.2.1 + * deps: cookie@0.4.1 + - Fix `maxAge` option to reject invalid values + * deps: proxy-addr@~2.0.7 + - Use `req.socket` over deprecated `req.connection` + - deps: forwarded@0.2.0 + - deps: ipaddr.js@1.9.1 + * deps: qs@6.9.6 + * deps: safe-buffer@5.2.1 + * deps: send@0.17.2 + - deps: http-errors@1.8.1 + - deps: ms@2.1.3 + - pref: ignore empty http tokens + * deps: serve-static@1.14.2 + - deps: send@0.17.2 + * deps: setprototypeof@1.2.0 + +4.17.1 / 2019-05-25 +=================== + + * Revert "Improve error message for `null`/`undefined` to `res.status`" + +4.17.0 / 2019-05-16 +=================== + + * Add `express.raw` to parse bodies into `Buffer` + * Add `express.text` to parse bodies into string + * Improve error message for non-strings to `res.sendFile` + * Improve error message for `null`/`undefined` to `res.status` + * Support multiple hosts in `X-Forwarded-Host` + * deps: accepts@~1.3.7 + * deps: body-parser@1.19.0 + - Add encoding MIK + - Add petabyte (`pb`) support + - Fix parsing array brackets after index + - deps: bytes@3.1.0 + - deps: http-errors@1.7.2 + - deps: iconv-lite@0.4.24 + - deps: qs@6.7.0 + - deps: raw-body@2.4.0 + - deps: type-is@~1.6.17 + * deps: content-disposition@0.5.3 + * deps: cookie@0.4.0 + - Add `SameSite=None` support + * deps: finalhandler@~1.1.2 + - Set stricter `Content-Security-Policy` header + - deps: parseurl@~1.3.3 + - deps: statuses@~1.5.0 + * deps: parseurl@~1.3.3 + * deps: proxy-addr@~2.0.5 + - deps: ipaddr.js@1.9.0 + * deps: qs@6.7.0 + - Fix parsing array brackets after index + * deps: range-parser@~1.2.1 + * deps: send@0.17.1 + - Set stricter CSP header in redirect & error responses + - deps: http-errors@~1.7.2 + - deps: mime@1.6.0 + - deps: ms@2.1.1 + - deps: range-parser@~1.2.1 + - deps: statuses@~1.5.0 + - perf: remove redundant `path.normalize` call + * deps: serve-static@1.14.1 + - Set stricter CSP header in redirect response + - deps: parseurl@~1.3.3 + - deps: send@0.17.1 + * deps: setprototypeof@1.1.1 + * deps: statuses@~1.5.0 + - Add `103 Early Hints` + * deps: type-is@~1.6.18 + - deps: mime-types@~2.1.24 + - perf: prevent internal `throw` on invalid type + +4.16.4 / 2018-10-10 +=================== + + * Fix issue where `"Request aborted"` may be logged in `res.sendfile` + * Fix JSDoc for `Router` constructor + * deps: body-parser@1.18.3 + - Fix deprecation warnings on Node.js 10+ + - Fix stack trace for strict json parse error + - deps: depd@~1.1.2 + - deps: http-errors@~1.6.3 + - deps: iconv-lite@0.4.23 + - deps: qs@6.5.2 + - deps: raw-body@2.3.3 + - deps: type-is@~1.6.16 + * deps: proxy-addr@~2.0.4 + - deps: ipaddr.js@1.8.0 + * deps: qs@6.5.2 + * deps: safe-buffer@5.1.2 + +4.16.3 / 2018-03-12 +=================== + + * deps: accepts@~1.3.5 + - deps: mime-types@~2.1.18 + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: finalhandler@1.1.1 + - Fix 404 output for bad / missing pathnames + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + * deps: proxy-addr@~2.0.3 + - deps: ipaddr.js@1.6.0 + * deps: send@0.16.2 + - Fix incorrect end tag in default error & redirects + - deps: depd@~1.1.2 + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + * deps: serve-static@1.13.2 + - Fix incorrect end tag in redirects + - deps: encodeurl@~1.0.2 + - deps: send@0.16.2 + * deps: statuses@~1.4.0 + * deps: type-is@~1.6.16 + - deps: mime-types@~2.1.18 + +4.16.2 / 2017-10-09 +=================== + + * Fix `TypeError` in `res.send` when given `Buffer` and `ETag` header set + * perf: skip parsing of entire `X-Forwarded-Proto` header + +4.16.1 / 2017-09-29 +=================== + + * deps: send@0.16.1 + * deps: serve-static@1.13.1 + - Fix regression when `root` is incorrectly set to a file + - deps: send@0.16.1 + +4.16.0 / 2017-09-28 +=================== + + * Add `"json escape"` setting for `res.json` and `res.jsonp` + * Add `express.json` and `express.urlencoded` to parse bodies + * Add `options` argument to `res.download` + * Improve error message when autoloading invalid view engine + * Improve error messages when non-function provided as middleware + * Skip `Buffer` encoding when not generating ETag for small response + * Use `safe-buffer` for improved Buffer API + * deps: accepts@~1.3.4 + - deps: mime-types@~2.1.16 + * deps: content-type@~1.0.4 + - perf: remove argument reassignment + - perf: skip parameter parsing when no parameters + * deps: etag@~1.8.1 + - perf: replace regular expression with substring + * deps: finalhandler@1.1.0 + - Use `res.headersSent` when available + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: proxy-addr@~2.0.2 + - Fix trimming leading / trailing OWS in `X-Forwarded-For` + - deps: forwarded@~0.1.2 + - deps: ipaddr.js@1.5.2 + - perf: reduce overhead when no `X-Forwarded-For` header + * deps: qs@6.5.1 + - Fix parsing & compacting very deep objects + * deps: send@0.16.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Fix missing `` in default error & redirects + - Set charset as "UTF-8" for .js and .json + - Use instance methods on steam to check for listeners + - deps: mime@1.4.1 + - perf: improve path validation speed + * deps: serve-static@1.13.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Set charset as "UTF-8" for .js and .json + - deps: send@0.16.0 + * deps: setprototypeof@1.1.0 + * deps: utils-merge@1.0.1 + * deps: vary@~1.1.2 + - perf: improve header token parsing speed + * perf: re-use options object when generating ETags + * perf: remove dead `.charset` set in `res.jsonp` + +4.15.5 / 2017-09-24 +=================== + + * deps: debug@2.6.9 + * deps: finalhandler@~1.0.6 + - deps: debug@2.6.9 + - deps: parseurl@~1.3.2 + * deps: fresh@0.5.2 + - Fix handling of modified headers with invalid dates + - perf: improve ETag match loop + - perf: improve `If-None-Match` token parsing + * deps: send@0.15.6 + - Fix handling of modified headers with invalid dates + - deps: debug@2.6.9 + - deps: etag@~1.8.1 + - deps: fresh@0.5.2 + - perf: improve `If-Match` token parsing + * deps: serve-static@1.12.6 + - deps: parseurl@~1.3.2 + - deps: send@0.15.6 + - perf: improve slash collapsing + +4.15.4 / 2017-08-06 +=================== + + * deps: debug@2.6.8 + * deps: depd@~1.1.1 + - Remove unnecessary `Buffer` loading + * deps: finalhandler@~1.0.4 + - deps: debug@2.6.8 + * deps: proxy-addr@~1.1.5 + - Fix array argument being altered + - deps: ipaddr.js@1.4.0 + * deps: qs@6.5.0 + * deps: send@0.15.4 + - deps: debug@2.6.8 + - deps: depd@~1.1.1 + - deps: http-errors@~1.6.2 + * deps: serve-static@1.12.4 + - deps: send@0.15.4 + +4.15.3 / 2017-05-16 +=================== + + * Fix error when `res.set` cannot add charset to `Content-Type` + * deps: debug@2.6.7 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@2.0.0 + * deps: finalhandler@~1.0.3 + - Fix missing `` in HTML document + - deps: debug@2.6.7 + * deps: proxy-addr@~1.1.4 + - deps: ipaddr.js@1.3.0 + * deps: send@0.15.3 + - deps: debug@2.6.7 + - deps: ms@2.0.0 + * deps: serve-static@1.12.3 + - deps: send@0.15.3 + * deps: type-is@~1.6.15 + - deps: mime-types@~2.1.15 + * deps: vary@~1.1.1 + - perf: hoist regular expression + +4.15.2 / 2017-03-06 +=================== + + * deps: qs@6.4.0 + - Fix regression parsing keys starting with `[` + +4.15.1 / 2017-03-05 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + * deps: serve-static@1.12.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - deps: send@0.15.1 + +4.15.0 / 2017-03-01 +=================== + + * Add debug message when loading view engine + * Add `next("router")` to exit from router + * Fix case where `router.use` skipped requests routes did not + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Skip routing when `req.url` is not set + * Use `%o` in path debug to tell types apart + * Use `Object.create` to setup request & response prototypes + * Use `setprototypeof` module to replace `__proto__` setting + * Use `statuses` instead of `http` module for status messages + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + - Use SHA1 instead of MD5 for ETag hashing + - Works with FIPS 140-2 OpenSSL configuration + * deps: finalhandler@~1.0.0 + - Fix exception when `err` cannot be converted to a string + - Fully URL-encode the pathname in the 404 + - Only include the pathname in the 404 message + - Send complete HTML document + - Set `Content-Security-Policy: default-src 'self'` header + - deps: debug@2.6.1 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: qs@6.3.1 + - Fix array parsing from skipping empty values + - Fix compacting nested arrays + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + * deps: serve-static@1.12.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Send complete HTML document in redirect response + - Set default CSP header in redirect response + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: send@0.15.0 + * perf: add fast match path for `*` route + * perf: improve `req.ips` performance + +4.14.1 / 2017-01-28 +=================== + + * deps: content-disposition@0.5.2 + * deps: finalhandler@0.5.1 + - Fix exception when `err.headers` is not an object + - deps: statuses@~1.3.1 + - perf: hoist regular expressions + - perf: remove duplicate validation path + * deps: proxy-addr@~1.1.3 + - deps: ipaddr.js@1.2.0 + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + * deps: serve-static@~1.11.2 + - deps: send@0.14.2 + * deps: type-is@~1.6.14 + - deps: mime-types@~2.1.13 + +4.14.0 / 2016-06-16 +=================== + + * Add `acceptRanges` option to `res.sendFile`/`res.sendfile` + * Add `cacheControl` option to `res.sendFile`/`res.sendfile` + * Add `options` argument to `req.range` + - Includes the `combine` option + * Encode URL in `res.location`/`res.redirect` if not already encoded + * Fix some redirect handling in `res.sendFile`/`res.sendfile` + * Fix Windows absolute path check using forward slashes + * Improve error with invalid arguments to `req.get()` + * Improve performance for `res.json`/`res.jsonp` in most cases + * Improve `Range` header handling in `res.sendFile`/`res.sendfile` + * deps: accepts@~1.3.3 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Many performance improvements + - deps: mime-types@~2.1.11 + - deps: negotiator@0.6.1 + * deps: content-type@~1.0.2 + - perf: enable strict mode + * deps: cookie@0.3.1 + - Add `sameSite` option + - Fix cookie `Max-Age` to never be a floating point number + - Improve error message when `encode` is not a function + - Improve error message when `expires` is not a `Date` + - Throw better error for invalid argument to parse + - Throw on invalid values provided to `serialize` + - perf: enable strict mode + - perf: hoist regular expression + - perf: use for loop in parse + - perf: use string concatenation for serialization + * deps: finalhandler@0.5.0 + - Change invalid or non-numeric status code to 500 + - Overwrite status message to match set status code + - Prefer `err.statusCode` if `err.status` is invalid + - Set response headers from `err.headers` object + - Use `statuses` instead of `http` module for status messages + * deps: proxy-addr@~1.1.2 + - Fix accepting various invalid netmasks + - Fix IPv6-mapped IPv4 validation edge cases + - IPv4 netmasks must be contiguous + - IPv6 addresses cannot be used as a netmask + - deps: ipaddr.js@1.1.1 + * deps: qs@6.2.0 + - Add `decoder` option in `parse` function + * deps: range-parser@~1.2.0 + - Add `combine` option to combine overlapping ranges + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: send@0.14.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Fix redirect error when `path` contains raw non-URL characters + - Fix redirect when `path` starts with multiple forward slashes + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + * deps: serve-static@~1.11.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Fix redirect error when `req.url` contains raw non-URL characters + - Ignore non-byte `Range` headers + - Use status code 301 for redirects + - deps: send@0.14.1 + * deps: type-is@~1.6.13 + - Fix type error when given invalid type to match against + - deps: mime-types@~2.1.11 + * deps: vary@~1.1.0 + - Only accept valid field names in the `field` argument + * perf: use strict equality when possible + +4.13.4 / 2016-01-21 +=================== + + * deps: content-disposition@0.5.1 + - perf: enable strict mode + * deps: cookie@0.1.5 + - Throw on invalid values provided to `serialize` + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: finalhandler@0.4.1 + - deps: escape-html@~1.0.3 + * deps: merge-descriptors@1.0.1 + - perf: enable strict mode + * deps: methods@~1.1.2 + - perf: enable strict mode + * deps: parseurl@~1.3.1 + - perf: enable strict mode + * deps: proxy-addr@~1.0.10 + - deps: ipaddr.js@1.0.5 + - perf: enable strict mode + * deps: range-parser@~1.0.3 + - perf: enable strict mode + * deps: send@0.13.1 + - deps: depd@~1.1.0 + - deps: destroy@~1.0.4 + - deps: escape-html@~1.0.3 + - deps: range-parser@~1.0.3 + * deps: serve-static@~1.10.2 + - deps: escape-html@~1.0.3 + - deps: parseurl@~1.3.0 + - deps: send@0.13.1 + +4.13.3 / 2015-08-02 +=================== + + * Fix infinite loop condition using `mergeParams: true` + * Fix inner numeric indices incorrectly altering parent `req.params` + +4.13.2 / 2015-07-31 +=================== + + * deps: accepts@~1.2.12 + - deps: mime-types@~2.1.4 + * deps: array-flatten@1.1.1 + - perf: enable strict mode + * deps: path-to-regexp@0.1.7 + - Fix regression with escaped round brackets and matching groups + * deps: type-is@~1.6.6 + - deps: mime-types@~2.1.4 + +4.13.1 / 2015-07-05 +=================== + + * deps: accepts@~1.2.10 + - deps: mime-types@~2.1.2 + * deps: qs@4.0.0 + - Fix dropping parameters like `hasOwnProperty` + - Fix various parsing edge cases + * deps: type-is@~1.6.4 + - deps: mime-types@~2.1.2 + - perf: enable strict mode + - perf: remove argument reassignment + +4.13.0 / 2015-06-20 +=================== + + * Add settings to debug output + * Fix `res.format` error when only `default` provided + * Fix issue where `next('route')` in `app.param` would incorrectly skip values + * Fix hiding platform issues with `decodeURIComponent` + - Only `URIError`s are a 400 + * Fix using `*` before params in routes + * Fix using capture groups before params in routes + * Simplify `res.cookie` to call `res.append` + * Use `array-flatten` module for flattening arrays + * deps: accepts@~1.2.9 + - deps: mime-types@~2.1.1 + - perf: avoid argument reassignment & argument slice + - perf: avoid negotiator recursive construction + - perf: enable strict mode + - perf: remove unnecessary bitwise operator + * deps: cookie@0.1.3 + - perf: deduce the scope of try-catch deopt + - perf: remove argument reassignments + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Always include entity length in ETags for hash length extensions + - Generate non-Stats ETags using MD5 only (no longer CRC32) + - Improve stat performance by removing hashing + - Improve support for JXcore + - Remove base64 padding in ETags to shorten + - Support "fake" stats objects in environments without fs + - Use MD5 instead of MD4 in weak ETags over 1KB + * deps: finalhandler@0.4.0 + - Fix a false-positive when unpiping in Node.js 0.8 + - Support `statusCode` property on `Error` objects + - Use `unpipe` module for unpiping requests + - deps: escape-html@1.0.2 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove argument reassignment + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * deps: path-to-regexp@0.1.6 + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + * deps: serve-static@~1.10.0 + - Add `fallthrough` option + - Fix reading options from options prototype + - Improve the default redirect response headers + - Malformed URLs now `next()` instead of 400 + - deps: escape-html@1.0.2 + - deps: send@0.13.0 + - perf: enable strict mode + - perf: remove argument reassignment + * deps: type-is@~1.6.3 + - deps: mime-types@~2.1.1 + - perf: reduce try block size + - perf: remove bitwise operations + * perf: enable strict mode + * perf: isolate `app.render` try block + * perf: remove argument reassignments in application + * perf: remove argument reassignments in request prototype + * perf: remove argument reassignments in response prototype + * perf: remove argument reassignments in routing + * perf: remove argument reassignments in `View` + * perf: skip attempting to decode zero length string + * perf: use saved reference to `http.STATUS_CODES` + +4.12.4 / 2015-05-17 +=================== + + * deps: accepts@~1.2.7 + - deps: mime-types@~2.0.11 + - deps: negotiator@0.5.3 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: etag@~1.6.0 + - Improve support for JXcore + - Support "fake" stats objects in environments without `fs` + * deps: finalhandler@0.3.6 + - deps: debug@~2.2.0 + - deps: on-finished@~2.2.1 + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + * deps: proxy-addr@~1.0.8 + - deps: ipaddr.js@1.0.1 + * deps: qs@2.4.2 + - Fix allowing parameters like `constructor` + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + * deps: serve-static@~1.9.3 + - deps: send@0.12.3 + * deps: type-is@~1.6.2 + - deps: mime-types@~2.0.11 + +4.12.3 / 2015-03-17 +=================== + + * deps: accepts@~1.2.5 + - deps: mime-types@~2.0.10 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: finalhandler@0.3.4 + - deps: debug@~2.1.3 + * deps: proxy-addr@~1.0.7 + - deps: ipaddr.js@0.1.9 + * deps: qs@2.4.1 + - Fix error when parameter `hasOwnProperty` is present + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + * deps: serve-static@~1.9.2 + - deps: send@0.12.2 + * deps: type-is@~1.6.1 + - deps: mime-types@~2.0.10 + +4.12.2 / 2015-03-02 +=================== + + * Fix regression where `"Request aborted"` is logged using `res.sendFile` + +4.12.1 / 2015-03-01 +=================== + + * Fix constructing application with non-configurable prototype properties + * Fix `ECONNRESET` errors from `res.sendFile` usage + * Fix `req.host` when using "trust proxy" hops count + * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count + * Fix wrong `code` on aborted connections from `res.sendFile` + * deps: merge-descriptors@1.0.0 + +4.12.0 / 2015-02-23 +=================== + + * Fix `"trust proxy"` setting to inherit when app is mounted + * Generate `ETag`s for all request responses + - No longer restricted to only responses for `GET` and `HEAD` requests + * Use `content-type` to parse `Content-Type` headers + * deps: accepts@~1.2.4 + - Fix preference sorting to be stable for long acceptable lists + - deps: mime-types@~2.0.9 + - deps: negotiator@0.5.1 + * deps: cookie-signature@1.0.6 + * deps: send@0.12.1 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + * deps: serve-static@~1.9.1 + - deps: send@0.12.1 + * deps: type-is@~1.6.0 + - fix argument reassignment + - fix false-positives in `hasBody` `Transfer-Encoding` check + - support wildcard for both type and subtype (`*/*`) + - deps: mime-types@~2.0.9 + +4.11.2 / 2015-02-01 +=================== + + * Fix `res.redirect` double-calling `res.end` for `HEAD` requests + * deps: accepts@~1.2.3 + - deps: mime-types@~2.0.8 + * deps: proxy-addr@~1.0.6 + - deps: ipaddr.js@0.1.8 + * deps: type-is@~1.5.6 + - deps: mime-types@~2.0.8 + +4.11.1 / 2015-01-20 +=================== + + * deps: send@0.11.1 + - Fix root path disclosure + * deps: serve-static@~1.8.1 + - Fix redirect loop in Node.js 0.11.14 + - Fix root path disclosure + - deps: send@0.11.1 + +4.11.0 / 2015-01-13 +=================== + + * Add `res.append(field, val)` to append headers + * Deprecate leading `:` in `name` for `app.param(name, fn)` + * Deprecate `req.param()` -- use `req.params`, `req.body`, or `req.query` instead + * Deprecate `app.param(fn)` + * Fix `OPTIONS` responses to include the `HEAD` method properly + * Fix `res.sendFile` not always detecting aborted connection + * Match routes iteratively to prevent stack overflows + * deps: accepts@~1.2.2 + - deps: mime-types@~2.0.7 + - deps: negotiator@0.5.0 + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + * deps: serve-static@~1.8.0 + - deps: send@0.11.0 + +4.10.8 / 2015-01-13 +=================== + + * Fix crash from error within `OPTIONS` response handler + * deps: proxy-addr@~1.0.5 + - deps: ipaddr.js@0.1.6 + +4.10.7 / 2015-01-04 +=================== + + * Fix `Allow` header for `OPTIONS` to not contain duplicate methods + * Fix incorrect "Request aborted" for `res.sendFile` when `HEAD` or 304 + * deps: debug@~2.1.1 + * deps: finalhandler@0.3.3 + - deps: debug@~2.1.1 + - deps: on-finished@~2.2.0 + * deps: methods@~1.1.1 + * deps: on-finished@~2.2.0 + * deps: serve-static@~1.7.2 + - Fix potential open redirect when mounted at root + * deps: type-is@~1.5.5 + - deps: mime-types@~2.0.7 + +4.10.6 / 2014-12-12 +=================== + + * Fix exception in `req.fresh`/`req.stale` without response headers + +4.10.5 / 2014-12-10 +=================== + + * Fix `res.send` double-calling `res.end` for `HEAD` requests + * deps: accepts@~1.1.4 + - deps: mime-types@~2.0.4 + * deps: type-is@~1.5.4 + - deps: mime-types@~2.0.4 + +4.10.4 / 2014-11-24 +=================== + + * Fix `res.sendfile` logging standard write errors + +4.10.3 / 2014-11-23 +=================== + + * Fix `res.sendFile` logging standard write errors + * deps: etag@~1.5.1 + * deps: proxy-addr@~1.0.4 + - deps: ipaddr.js@0.1.5 + * deps: qs@2.3.3 + - Fix `arrayLimit` behavior + +4.10.2 / 2014-11-09 +=================== + + * Correctly invoke async router callback asynchronously + * deps: accepts@~1.1.3 + - deps: mime-types@~2.0.3 + * deps: type-is@~1.5.3 + - deps: mime-types@~2.0.3 + +4.10.1 / 2014-10-28 +=================== + + * Fix handling of URLs containing `://` in the path + * deps: qs@2.3.2 + - Fix parsing of mixed objects and values + +4.10.0 / 2014-10-23 +=================== + + * Add support for `app.set('views', array)` + - Views are looked up in sequence in array of directories + * Fix `res.send(status)` to mention `res.sendStatus(status)` + * Fix handling of invalid empty URLs + * Use `content-disposition` module for `res.attachment`/`res.download` + - Sends standards-compliant `Content-Disposition` header + - Full Unicode support + * Use `path.resolve` in view lookup + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: etag@~1.5.0 + - Improve string performance + - Slightly improve speed for weak ETags over 1KB + * deps: finalhandler@0.3.2 + - Terminate in progress response only on error + - Use `on-finished` to determine request status + - deps: debug@~2.1.0 + - deps: on-finished@~2.1.1 + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + * deps: qs@2.3.0 + - Fix parsing of mixed implicit and explicit arrays + * deps: send@0.10.1 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + - deps: on-finished@~2.1.1 + * deps: serve-static@~1.7.1 + - deps: send@0.10.1 + +4.9.8 / 2014-10-17 +================== + + * Fix `res.redirect` body when redirect status specified + * deps: accepts@~1.1.2 + - Fix error when media type has invalid parameter + - deps: negotiator@0.4.9 + +4.9.7 / 2014-10-10 +================== + + * Fix using same param name in array of paths + +4.9.6 / 2014-10-08 +================== + + * deps: accepts@~1.1.1 + - deps: mime-types@~2.0.2 + - deps: negotiator@0.4.8 + * deps: serve-static@~1.6.4 + - Fix redirect loop when index file serving disabled + * deps: type-is@~1.5.2 + - deps: mime-types@~2.0.2 + +4.9.5 / 2014-09-24 +================== + + * deps: etag@~1.4.0 + * deps: proxy-addr@~1.0.3 + - Use `forwarded` npm module + * deps: send@0.9.3 + - deps: etag@~1.4.0 + * deps: serve-static@~1.6.3 + - deps: send@0.9.3 + +4.9.4 / 2014-09-19 +================== + + * deps: qs@2.2.4 + - Fix issue with object keys starting with numbers truncated + +4.9.3 / 2014-09-18 +================== + + * deps: proxy-addr@~1.0.2 + - Fix a global leak when multiple subnets are trusted + - deps: ipaddr.js@0.1.3 + +4.9.2 / 2014-09-17 +================== + + * Fix regression for empty string `path` in `app.use` + * Fix `router.use` to accept array of middleware without path + * Improve error message for bad `app.use` arguments + +4.9.1 / 2014-09-16 +================== + + * Fix `app.use` to accept array of middleware without path + * deps: depd@0.4.5 + * deps: etag@~1.3.1 + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + * deps: serve-static@~1.6.2 + - deps: send@0.9.2 + +4.9.0 / 2014-09-08 +================== + + * Add `res.sendStatus` + * Invoke callback for sendfile when client aborts + - Applies to `res.sendFile`, `res.sendfile`, and `res.download` + - `err` will be populated with request aborted error + * Support IP address host in `req.subdomains` + * Use `etag` to generate `ETag` headers + * deps: accepts@~1.1.0 + - update `mime-types` + * deps: cookie-signature@1.0.5 + * deps: debug@~2.0.0 + * deps: finalhandler@0.2.0 + - Set `X-Content-Type-Options: nosniff` header + - deps: debug@~2.0.0 + * deps: fresh@0.2.4 + * deps: media-typer@0.3.0 + - Throw error when parameter format invalid on parse + * deps: qs@2.2.3 + - Fix issue where first empty value in array is discarded + * deps: range-parser@~1.0.2 + * deps: send@0.9.1 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + - deps: fresh@0.2.4 + * deps: serve-static@~1.6.1 + - Add `lastModified` option + - deps: send@0.9.1 + * deps: type-is@~1.5.1 + - fix `hasbody` to be true for `content-length: 0` + - deps: media-typer@0.3.0 + - deps: mime-types@~2.0.1 + * deps: vary@~1.0.0 + - Accept valid `Vary` header string as `field` + +4.8.8 / 2014-09-04 +================== + + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + * deps: serve-static@~1.5.4 + - deps: send@0.8.5 + +4.8.7 / 2014-08-29 +================== + + * deps: qs@2.2.2 + - Remove unnecessary cloning + +4.8.6 / 2014-08-27 +================== + + * deps: qs@2.2.0 + - Array parsing fix + - Performance improvements + +4.8.5 / 2014-08-18 +================== + + * deps: send@0.8.3 + - deps: destroy@1.0.3 + - deps: on-finished@2.1.0 + * deps: serve-static@~1.5.3 + - deps: send@0.8.3 + +4.8.4 / 2014-08-14 +================== + + * deps: qs@1.2.2 + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + * deps: serve-static@~1.5.2 + - deps: send@0.8.2 + +4.8.3 / 2014-08-10 +================== + + * deps: parseurl@~1.3.0 + * deps: qs@1.2.1 + * deps: serve-static@~1.5.1 + - Fix parsing of weird `req.originalUrl` values + - deps: parseurl@~1.3.0 + - deps: utils-merge@1.0.0 + +4.8.2 / 2014-08-07 +================== + + * deps: qs@1.2.0 + - Fix parsing array of objects + +4.8.1 / 2014-08-06 +================== + + * fix incorrect deprecation warnings on `res.download` + * deps: qs@1.1.0 + - Accept urlencoded square brackets + - Accept empty values in implicit array notation + +4.8.0 / 2014-08-05 +================== + + * add `res.sendFile` + - accepts a file system path instead of a URL + - requires an absolute path or `root` option specified + * deprecate `res.sendfile` -- use `res.sendFile` instead + * support mounted app as any argument to `app.use()` + * deps: qs@1.0.2 + - Complete rewrite + - Limits array length to 20 + - Limits object depth to 5 + - Limits parameters to 1,000 + * deps: send@0.8.1 + - Add `extensions` option + * deps: serve-static@~1.5.0 + - Add `extensions` option + - deps: send@0.8.1 + +4.7.4 / 2014-08-04 +================== + + * fix `res.sendfile` regression for serving directory index files + * deps: send@0.7.4 + - Fix incorrect 403 on Windows and Node.js 0.11 + - Fix serving index files without root dir + * deps: serve-static@~1.4.4 + - deps: send@0.7.4 + +4.7.3 / 2014-08-04 +================== + + * deps: send@0.7.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + * deps: serve-static@~1.4.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + - deps: send@0.7.3 + +4.7.2 / 2014-07-27 +================== + + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + * deps: send@0.7.2 + - deps: depd@0.4.4 + * deps: serve-static@~1.4.2 + +4.7.1 / 2014-07-26 +================== + + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + * deps: send@0.7.1 + - deps: depd@0.4.3 + * deps: serve-static@~1.4.1 + +4.7.0 / 2014-07-25 +================== + + * fix `req.protocol` for proxy-direct connections + * configurable query parser with `app.set('query parser', parser)` + - `app.set('query parser', 'extended')` parse with "qs" module + - `app.set('query parser', 'simple')` parse with "querystring" core module + - `app.set('query parser', false)` disable query string parsing + - `app.set('query parser', true)` enable simple parsing + * deprecate `res.json(status, obj)` -- use `res.status(status).json(obj)` instead + * deprecate `res.jsonp(status, obj)` -- use `res.status(status).jsonp(obj)` instead + * deprecate `res.send(status, body)` -- use `res.status(status).send(body)` instead + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: finalhandler@0.1.0 + - Respond after request fully read + - deps: debug@1.0.4 + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - Cap `maxAge` value to 1 year + - deps: debug@1.0.4 + - deps: depd@0.4.2 + * deps: serve-static@~1.4.0 + - deps: parseurl@~1.2.0 + - deps: send@0.7.0 + * perf: prevent multiple `Buffer` creation in `res.send` + +4.6.1 / 2014-07-12 +================== + + * fix `subapp.mountpath` regression for `app.use(subapp)` + +4.6.0 / 2014-07-11 +================== + + * accept multiple callbacks to `app.use()` + * add explicit "Rosetta Flash JSONP abuse" protection + - previous versions are not vulnerable; this is just explicit protection + * catch errors in multiple `req.param(name, fn)` handlers + * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead + * fix `res.send(status, num)` to send `num` as json (not error) + * remove unnecessary escaping when `res.jsonp` returns JSON response + * support non-string `path` in `app.use(path, fn)` + - supports array of paths + - supports `RegExp` + * router: fix optimization on router exit + * router: refactor location of `try` blocks + * router: speed up standard `app.use(fn)` + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + * deps: finalhandler@0.0.3 + - deps: debug@1.0.3 + * deps: methods@1.1.0 + - add `CONNECT` + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + * deps: path-to-regexp@0.1.3 + * deps: send@0.6.0 + - deps: debug@1.0.3 + * deps: serve-static@~1.3.2 + - deps: parseurl@~1.1.3 + - deps: send@0.6.0 + * perf: fix arguments reassign deopt in some `res` methods + +4.5.1 / 2014-07-06 +================== + + * fix routing regression when altering `req.method` + +4.5.0 / 2014-07-04 +================== + + * add deprecation message to non-plural `req.accepts*` + * add deprecation message to `res.send(body, status)` + * add deprecation message to `res.vary()` + * add `headers` option to `res.sendfile` + - use to set headers on successful file transfer + * add `mergeParams` option to `Router` + - merges `req.params` from parent routes + * add `req.hostname` -- correct name for what `req.host` returns + * deprecate things with `depd` module + * deprecate `req.host` -- use `req.hostname` instead + * fix behavior when handling request without routes + * fix handling when `route.all` is only route + * invoke `router.param()` only when route matches + * restore `req.params` after invoking router + * use `finalhandler` for final response handling + * use `media-typer` to alter content-type charset + * deps: accepts@~1.0.7 + * deps: send@0.5.0 + - Accept string for `maxage` (converted by `ms`) + - Include link in default redirect response + * deps: serve-static@~1.3.0 + - Accept string for `maxAge` (converted by `ms`) + - Add `setHeaders` option + - Include HTML link in redirect response + - deps: send@0.5.0 + * deps: type-is@~1.3.2 + +4.4.5 / 2014-06-26 +================== + + * deps: cookie-signature@1.0.4 + - fix for timing attacks + +4.4.4 / 2014-06-20 +================== + + * fix `res.attachment` Unicode filenames in Safari + * fix "trim prefix" debug message in `express:router` + * deps: accepts@~1.0.5 + * deps: buffer-crc32@0.2.3 + +4.4.3 / 2014-06-11 +================== + + * fix persistence of modified `req.params[name]` from `app.param()` + * deps: accepts@1.0.3 + - deps: negotiator@0.4.6 + * deps: debug@1.0.2 + * deps: send@0.4.3 + - Do not throw uncatchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + * deps: serve-static@1.2.3 + - Do not throw uncatchable error on file open race condition + - deps: send@0.4.3 + +4.4.2 / 2014-06-09 +================== + + * fix catching errors from top-level handlers + * use `vary` module for `res.vary` + * deps: debug@1.0.1 + * deps: proxy-addr@1.0.1 + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: debug@1.0.1 + - deps: finished@1.2.1 + * deps: serve-static@1.2.2 + - fix "event emitter leak" warnings + - deps: send@0.4.2 + * deps: type-is@1.2.1 + +4.4.1 / 2014-06-02 +================== + + * deps: methods@1.0.1 + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + * deps: serve-static@1.2.1 + - use `escape-html` for escaping + - deps: send@0.4.1 + +4.4.0 / 2014-05-30 +================== + + * custom etag control with `app.set('etag', val)` + - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation + - `app.set('etag', 'weak')` weak tag + - `app.set('etag', 'strong')` strong etag + - `app.set('etag', false)` turn off + - `app.set('etag', true)` standard etag + * mark `res.send` ETag as weak and reduce collisions + * update accepts to 1.0.2 + - Fix interpretation when header not in request + * update send to 0.4.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: debug@0.8.1 + * update serve-static to 1.2.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: send@0.4.0 + +4.3.2 / 2014-05-28 +================== + + * fix handling of errors from `router.param()` callbacks + +4.3.1 / 2014-05-23 +================== + + * revert "fix behavior of multiple `app.VERB` for the same path" + - this caused a regression in the order of route execution + +4.3.0 / 2014-05-21 +================== + + * add `req.baseUrl` to access the path stripped from `req.url` in routes + * fix behavior of multiple `app.VERB` for the same path + * fix issue routing requests among sub routers + * invoke `router.param()` only when necessary instead of every match + * proper proxy trust with `app.set('trust proxy', trust)` + - `app.set('trust proxy', 1)` trust first hop + - `app.set('trust proxy', 'loopback')` trust loopback addresses + - `app.set('trust proxy', '10.0.0.1')` trust single IP + - `app.set('trust proxy', '10.0.0.1/16')` trust subnet + - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list + - `app.set('trust proxy', false)` turn off + - `app.set('trust proxy', true)` trust everything + * set proper `charset` in `Content-Type` for `res.send` + * update type-is to 1.2.0 + - support suffix matching + +4.2.0 / 2014-05-11 +================== + + * deprecate `app.del()` -- use `app.delete()` instead + * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead + - the edge-case `res.json(status, num)` requires `res.status(status).json(num)` + * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead + - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)` + * fix `req.next` when inside router instance + * include `ETag` header in `HEAD` requests + * keep previous `Content-Type` for `res.jsonp` + * support PURGE method + - add `app.purge` + - add `router.purge` + - include PURGE in `app.all` + * update debug to 0.8.0 + - add `enable()` method + - change from stderr to stdout + * update methods to 1.0.0 + - add PURGE + +4.1.2 / 2014-05-08 +================== + + * fix `req.host` for IPv6 literals + * fix `res.jsonp` error if callback param is object + +4.1.1 / 2014-04-27 +================== + + * fix package.json to reflect supported node version + +4.1.0 / 2014-04-24 +================== + + * pass options from `res.sendfile` to `send` + * preserve casing of headers in `res.header` and `res.set` + * support unicode file names in `res.attachment` and `res.download` + * update accepts to 1.0.1 + - deps: negotiator@0.4.0 + * update cookie to 0.1.2 + - Fix for maxAge == 0 + - made compat with expires field + * update send to 0.3.0 + - Accept API options in options object + - Coerce option types + - Control whether to generate etags + - Default directory access to 403 when index disabled + - Fix sending files with dots without root set + - Include file path in etag + - Make "Can't set headers after they are sent." catchable + - Send full entity-body for multi range requests + - Set etags to "weak" + - Support "If-Range" header + - Support multiple index paths + - deps: mime@1.2.11 + * update serve-static to 1.1.0 + - Accept options directly to `send` module + - Resolve relative paths at middleware setup + - Use parseurl to parse the URL from request + - deps: send@0.3.0 + * update type-is to 1.1.0 + - add non-array values support + - add `multipart` as a shorthand + +4.0.0 / 2014-04-09 +================== + + * remove: + - node 0.8 support + - connect and connect's patches except for charset handling + - express(1) - moved to [express-generator](https://github.com/expressjs/generator) + - `express.createServer()` - it has been deprecated for a long time. Use `express()` + - `app.configure` - use logic in your own app code + - `app.router` - is removed + - `req.auth` - use `basic-auth` instead + - `req.accepted*` - use `req.accepts*()` instead + - `res.location` - relative URL resolution is removed + - `res.charset` - include the charset in the content type when using `res.set()` + - all bundled middleware except `static` + * change: + - `app.route` -> `app.mountpath` when mounting an express app in another express app + - `json spaces` no longer enabled by default in development + - `req.accepts*` -> `req.accepts*s` - i.e. `req.acceptsEncoding` -> `req.acceptsEncodings` + - `req.params` is now an object instead of an array + - `res.locals` is no longer a function. It is a plain js object. Treat it as such. + - `res.headerSent` -> `res.headersSent` to match node.js ServerResponse object + * refactor: + - `req.accepts*` with [accepts](https://github.com/expressjs/accepts) + - `req.is` with [type-is](https://github.com/expressjs/type-is) + - [path-to-regexp](https://github.com/component/path-to-regexp) + * add: + - `app.router()` - returns the app Router instance + - `app.route()` - Proxy to the app's `Router#route()` method to create a new route + - Router & Route - public API + +3.21.2 / 2015-07-31 +=================== + + * deps: connect@2.30.2 + - deps: body-parser@~1.13.3 + - deps: compression@~1.5.2 + - deps: errorhandler@~1.4.2 + - deps: method-override@~2.3.5 + - deps: serve-index@~1.7.2 + - deps: type-is@~1.6.6 + - deps: vhost@~3.0.1 + * deps: vary@~1.0.1 + - Fix setting empty header from empty `field` + - perf: enable strict mode + - perf: remove argument reassignments + +3.21.1 / 2015-07-05 +=================== + + * deps: basic-auth@~1.0.3 + * deps: connect@2.30.1 + - deps: body-parser@~1.13.2 + - deps: compression@~1.5.1 + - deps: errorhandler@~1.4.1 + - deps: morgan@~1.6.1 + - deps: pause@0.1.0 + - deps: qs@4.0.0 + - deps: serve-index@~1.7.1 + - deps: type-is@~1.6.4 + +3.21.0 / 2015-06-18 +=================== + + * deps: basic-auth@1.0.2 + - perf: enable strict mode + - perf: hoist regular expression + - perf: parse with regular expressions + - perf: remove argument reassignment + * deps: connect@2.30.0 + - deps: body-parser@~1.13.1 + - deps: bytes@2.1.0 + - deps: compression@~1.5.0 + - deps: cookie@0.1.3 + - deps: cookie-parser@~1.3.5 + - deps: csurf@~1.8.3 + - deps: errorhandler@~1.4.0 + - deps: express-session@~1.11.3 + - deps: finalhandler@0.4.0 + - deps: fresh@0.3.0 + - deps: morgan@~1.6.0 + - deps: serve-favicon@~2.3.0 + - deps: serve-index@~1.7.0 + - deps: serve-static@~1.10.0 + - deps: type-is@~1.6.3 + * deps: cookie@0.1.3 + - perf: deduce the scope of try-catch deopt + - perf: remove argument reassignments + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Always include entity length in ETags for hash length extensions + - Generate non-Stats ETags using MD5 only (no longer CRC32) + - Improve stat performance by removing hashing + - Improve support for JXcore + - Remove base64 padding in ETags to shorten + - Support "fake" stats objects in environments without fs + - Use MD5 instead of MD4 in weak ETags over 1KB + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: mkdirp@0.5.1 + - Work in global strict mode + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + +3.20.3 / 2015-05-17 +=================== + + * deps: connect@2.29.2 + - deps: body-parser@~1.12.4 + - deps: compression@~1.4.4 + - deps: connect-timeout@~1.6.2 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: errorhandler@~1.3.6 + - deps: finalhandler@0.3.6 + - deps: method-override@~2.3.3 + - deps: morgan@~1.5.3 + - deps: qs@2.4.2 + - deps: response-time@~2.3.1 + - deps: serve-favicon@~2.2.1 + - deps: serve-index@~1.6.4 + - deps: serve-static@~1.9.3 + - deps: type-is@~1.6.2 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: proxy-addr@~1.0.8 + - deps: ipaddr.js@1.0.1 + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + +3.20.2 / 2015-03-16 +=================== + + * deps: connect@2.29.1 + - deps: body-parser@~1.12.2 + - deps: compression@~1.4.3 + - deps: connect-timeout@~1.6.1 + - deps: debug@~2.1.3 + - deps: errorhandler@~1.3.5 + - deps: express-session@~1.10.4 + - deps: finalhandler@0.3.4 + - deps: method-override@~2.3.2 + - deps: morgan@~1.5.2 + - deps: qs@2.4.1 + - deps: serve-index@~1.6.3 + - deps: serve-static@~1.9.2 + - deps: type-is@~1.6.1 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: merge-descriptors@1.0.0 + * deps: proxy-addr@~1.0.7 + - deps: ipaddr.js@0.1.9 + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + +3.20.1 / 2015-02-28 +=================== + + * Fix `req.host` when using "trust proxy" hops count + * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count + +3.20.0 / 2015-02-18 +=================== + + * Fix `"trust proxy"` setting to inherit when app is mounted + * Generate `ETag`s for all request responses + - No longer restricted to only responses for `GET` and `HEAD` requests + * Use `content-type` to parse `Content-Type` headers + * deps: connect@2.29.0 + - Use `content-type` to parse `Content-Type` headers + - deps: body-parser@~1.12.0 + - deps: compression@~1.4.1 + - deps: connect-timeout@~1.6.0 + - deps: cookie-parser@~1.3.4 + - deps: cookie-signature@1.0.6 + - deps: csurf@~1.7.0 + - deps: errorhandler@~1.3.4 + - deps: express-session@~1.10.3 + - deps: http-errors@~1.3.1 + - deps: response-time@~2.3.0 + - deps: serve-index@~1.6.2 + - deps: serve-static@~1.9.1 + - deps: type-is@~1.6.0 + * deps: cookie-signature@1.0.6 + * deps: send@0.12.1 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + +3.19.2 / 2015-02-01 +=================== + + * deps: connect@2.28.3 + - deps: compression@~1.3.1 + - deps: csurf@~1.6.6 + - deps: errorhandler@~1.3.3 + - deps: express-session@~1.10.2 + - deps: serve-index@~1.6.1 + - deps: type-is@~1.5.6 + * deps: proxy-addr@~1.0.6 + - deps: ipaddr.js@0.1.8 + +3.19.1 / 2015-01-20 +=================== + + * deps: connect@2.28.2 + - deps: body-parser@~1.10.2 + - deps: serve-static@~1.8.1 + * deps: send@0.11.1 + - Fix root path disclosure + +3.19.0 / 2015-01-09 +=================== + + * Fix `OPTIONS` responses to include the `HEAD` method property + * Use `readline` for prompt in `express(1)` + * deps: commander@2.6.0 + * deps: connect@2.28.1 + - deps: body-parser@~1.10.1 + - deps: compression@~1.3.0 + - deps: connect-timeout@~1.5.0 + - deps: csurf@~1.6.4 + - deps: debug@~2.1.1 + - deps: errorhandler@~1.3.2 + - deps: express-session@~1.10.1 + - deps: finalhandler@0.3.3 + - deps: method-override@~2.3.1 + - deps: morgan@~1.5.1 + - deps: serve-favicon@~2.2.0 + - deps: serve-index@~1.6.0 + - deps: serve-static@~1.8.0 + - deps: type-is@~1.5.5 + * deps: debug@~2.1.1 + * deps: methods@~1.1.1 + * deps: proxy-addr@~1.0.5 + - deps: ipaddr.js@0.1.6 + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + +3.18.6 / 2014-12-12 +=================== + + * Fix exception in `req.fresh`/`req.stale` without response headers + +3.18.5 / 2014-12-11 +=================== + + * deps: connect@2.27.6 + - deps: compression@~1.2.2 + - deps: express-session@~1.9.3 + - deps: http-errors@~1.2.8 + - deps: serve-index@~1.5.3 + - deps: type-is@~1.5.4 + +3.18.4 / 2014-11-23 +=================== + + * deps: connect@2.27.4 + - deps: body-parser@~1.9.3 + - deps: compression@~1.2.1 + - deps: errorhandler@~1.2.3 + - deps: express-session@~1.9.2 + - deps: qs@2.3.3 + - deps: serve-favicon@~2.1.7 + - deps: serve-static@~1.5.1 + - deps: type-is@~1.5.3 + * deps: etag@~1.5.1 + * deps: proxy-addr@~1.0.4 + - deps: ipaddr.js@0.1.5 + +3.18.3 / 2014-11-09 +=================== + + * deps: connect@2.27.3 + - Correctly invoke async callback asynchronously + - deps: csurf@~1.6.3 + +3.18.2 / 2014-10-28 +=================== + + * deps: connect@2.27.2 + - Fix handling of URLs containing `://` in the path + - deps: body-parser@~1.9.2 + - deps: qs@2.3.2 + +3.18.1 / 2014-10-22 +=================== + + * Fix internal `utils.merge` deprecation warnings + * deps: connect@2.27.1 + - deps: body-parser@~1.9.1 + - deps: express-session@~1.9.1 + - deps: finalhandler@0.3.2 + - deps: morgan@~1.4.1 + - deps: qs@2.3.0 + - deps: serve-static@~1.7.1 + * deps: send@0.10.1 + - deps: on-finished@~2.1.1 + +3.18.0 / 2014-10-17 +=================== + + * Use `content-disposition` module for `res.attachment`/`res.download` + - Sends standards-compliant `Content-Disposition` header + - Full Unicode support + * Use `etag` module to generate `ETag` headers + * deps: connect@2.27.0 + - Use `http-errors` module for creating errors + - Use `utils-merge` module for merging objects + - deps: body-parser@~1.9.0 + - deps: compression@~1.2.0 + - deps: connect-timeout@~1.4.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: express-session@~1.9.0 + - deps: finalhandler@0.3.1 + - deps: method-override@~2.3.0 + - deps: morgan@~1.4.0 + - deps: response-time@~2.2.0 + - deps: serve-favicon@~2.1.6 + - deps: serve-index@~1.5.0 + - deps: serve-static@~1.7.0 + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: send@0.10.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + +3.17.8 / 2014-10-15 +=================== + + * deps: connect@2.26.6 + - deps: compression@~1.1.2 + - deps: csurf@~1.6.2 + - deps: errorhandler@~1.2.2 + +3.17.7 / 2014-10-08 +=================== + + * deps: connect@2.26.5 + - Fix accepting non-object arguments to `logger` + - deps: serve-static@~1.6.4 + +3.17.6 / 2014-10-02 +=================== + + * deps: connect@2.26.4 + - deps: morgan@~1.3.2 + - deps: type-is@~1.5.2 + +3.17.5 / 2014-09-24 +=================== + + * deps: connect@2.26.3 + - deps: body-parser@~1.8.4 + - deps: serve-favicon@~2.1.5 + - deps: serve-static@~1.6.3 + * deps: proxy-addr@~1.0.3 + - Use `forwarded` npm module + * deps: send@0.9.3 + - deps: etag@~1.4.0 + +3.17.4 / 2014-09-19 +=================== + + * deps: connect@2.26.2 + - deps: body-parser@~1.8.3 + - deps: qs@2.2.4 + +3.17.3 / 2014-09-18 +=================== + + * deps: proxy-addr@~1.0.2 + - Fix a global leak when multiple subnets are trusted + - deps: ipaddr.js@0.1.3 + +3.17.2 / 2014-09-15 +=================== + + * Use `crc` instead of `buffer-crc32` for speed + * deps: connect@2.26.1 + - deps: body-parser@~1.8.2 + - deps: depd@0.4.5 + - deps: express-session@~1.8.2 + - deps: morgan@~1.3.1 + - deps: serve-favicon@~2.1.3 + - deps: serve-static@~1.6.2 + * deps: depd@0.4.5 + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + +3.17.1 / 2014-09-08 +=================== + + * Fix error in `req.subdomains` on empty host + +3.17.0 / 2014-09-08 +=================== + + * Support `X-Forwarded-Host` in `req.subdomains` + * Support IP address host in `req.subdomains` + * deps: connect@2.26.0 + - deps: body-parser@~1.8.1 + - deps: compression@~1.1.0 + - deps: connect-timeout@~1.3.0 + - deps: cookie-parser@~1.3.3 + - deps: cookie-signature@1.0.5 + - deps: csurf@~1.6.1 + - deps: debug@~2.0.0 + - deps: errorhandler@~1.2.0 + - deps: express-session@~1.8.1 + - deps: finalhandler@0.2.0 + - deps: fresh@0.2.4 + - deps: media-typer@0.3.0 + - deps: method-override@~2.2.0 + - deps: morgan@~1.3.0 + - deps: qs@2.2.3 + - deps: serve-favicon@~2.1.3 + - deps: serve-index@~1.2.1 + - deps: serve-static@~1.6.1 + - deps: type-is@~1.5.1 + - deps: vhost@~3.0.0 + * deps: cookie-signature@1.0.5 + * deps: debug@~2.0.0 + * deps: fresh@0.2.4 + * deps: media-typer@0.3.0 + - Throw error when parameter format invalid on parse + * deps: range-parser@~1.0.2 + * deps: send@0.9.1 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + - deps: fresh@0.2.4 + * deps: vary@~1.0.0 + - Accept valid `Vary` header string as `field` + +3.16.10 / 2014-09-04 +==================== + + * deps: connect@2.25.10 + - deps: serve-static@~1.5.4 + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + +3.16.9 / 2014-08-29 +=================== + + * deps: connect@2.25.9 + - deps: body-parser@~1.6.7 + - deps: qs@2.2.2 + +3.16.8 / 2014-08-27 +=================== + + * deps: connect@2.25.8 + - deps: body-parser@~1.6.6 + - deps: csurf@~1.4.1 + - deps: qs@2.2.0 + +3.16.7 / 2014-08-18 +=================== + + * deps: connect@2.25.7 + - deps: body-parser@~1.6.5 + - deps: express-session@~1.7.6 + - deps: morgan@~1.2.3 + - deps: serve-static@~1.5.3 + * deps: send@0.8.3 + - deps: destroy@1.0.3 + - deps: on-finished@2.1.0 + +3.16.6 / 2014-08-14 +=================== + + * deps: connect@2.25.6 + - deps: body-parser@~1.6.4 + - deps: qs@1.2.2 + - deps: serve-static@~1.5.2 + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + +3.16.5 / 2014-08-11 +=================== + + * deps: connect@2.25.5 + - Fix backwards compatibility in `logger` + +3.16.4 / 2014-08-10 +=================== + + * Fix original URL parsing in `res.location` + * deps: connect@2.25.4 + - Fix `query` middleware breaking with argument + - deps: body-parser@~1.6.3 + - deps: compression@~1.0.11 + - deps: connect-timeout@~1.2.2 + - deps: express-session@~1.7.5 + - deps: method-override@~2.1.3 + - deps: on-headers@~1.0.0 + - deps: parseurl@~1.3.0 + - deps: qs@1.2.1 + - deps: response-time@~2.0.1 + - deps: serve-index@~1.1.6 + - deps: serve-static@~1.5.1 + * deps: parseurl@~1.3.0 + +3.16.3 / 2014-08-07 +=================== + + * deps: connect@2.25.3 + - deps: multiparty@3.3.2 + +3.16.2 / 2014-08-07 +=================== + + * deps: connect@2.25.2 + - deps: body-parser@~1.6.2 + - deps: qs@1.2.0 + +3.16.1 / 2014-08-06 +=================== + + * deps: connect@2.25.1 + - deps: body-parser@~1.6.1 + - deps: qs@1.1.0 + +3.16.0 / 2014-08-05 +=================== + + * deps: connect@2.25.0 + - deps: body-parser@~1.6.0 + - deps: compression@~1.0.10 + - deps: csurf@~1.4.0 + - deps: express-session@~1.7.4 + - deps: qs@1.0.2 + - deps: serve-static@~1.5.0 + * deps: send@0.8.1 + - Add `extensions` option + +3.15.3 / 2014-08-04 +=================== + + * fix `res.sendfile` regression for serving directory index files + * deps: connect@2.24.3 + - deps: serve-index@~1.1.5 + - deps: serve-static@~1.4.4 + * deps: send@0.7.4 + - Fix incorrect 403 on Windows and Node.js 0.11 + - Fix serving index files without root dir + +3.15.2 / 2014-07-27 +=================== + + * deps: connect@2.24.2 + - deps: body-parser@~1.5.2 + - deps: depd@0.4.4 + - deps: express-session@~1.7.2 + - deps: morgan@~1.2.2 + - deps: serve-static@~1.4.2 + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + * deps: send@0.7.2 + - deps: depd@0.4.4 + +3.15.1 / 2014-07-26 +=================== + + * deps: connect@2.24.1 + - deps: body-parser@~1.5.1 + - deps: depd@0.4.3 + - deps: express-session@~1.7.1 + - deps: morgan@~1.2.1 + - deps: serve-index@~1.1.4 + - deps: serve-static@~1.4.1 + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + * deps: send@0.7.1 + - deps: depd@0.4.3 + +3.15.0 / 2014-07-22 +=================== + + * Fix `req.protocol` for proxy-direct connections + * Pass options from `res.sendfile` to `send` + * deps: connect@2.24.0 + - deps: body-parser@~1.5.0 + - deps: compression@~1.0.9 + - deps: connect-timeout@~1.2.1 + - deps: debug@1.0.4 + - deps: depd@0.4.2 + - deps: express-session@~1.7.0 + - deps: finalhandler@0.1.0 + - deps: method-override@~2.1.2 + - deps: morgan@~1.2.0 + - deps: multiparty@3.3.1 + - deps: parseurl@~1.2.0 + - deps: serve-static@~1.4.0 + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - Cap `maxAge` value to 1 year + - deps: debug@1.0.4 + - deps: depd@0.4.2 + +3.14.0 / 2014-07-11 +=================== + + * add explicit "Rosetta Flash JSONP abuse" protection + - previous versions are not vulnerable; this is just explicit protection + * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead + * fix `res.send(status, num)` to send `num` as json (not error) + * remove unnecessary escaping when `res.jsonp` returns JSON response + * deps: basic-auth@1.0.0 + - support empty password + - support empty username + * deps: connect@2.23.0 + - deps: debug@1.0.3 + - deps: express-session@~1.6.4 + - deps: method-override@~2.1.0 + - deps: parseurl@~1.1.3 + - deps: serve-static@~1.3.1 + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + * deps: methods@1.1.0 + - add `CONNECT` + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + +3.13.0 / 2014-07-03 +=================== + + * add deprecation message to `app.configure` + * add deprecation message to `req.auth` + * use `basic-auth` to parse `Authorization` header + * deps: connect@2.22.0 + - deps: csurf@~1.3.0 + - deps: express-session@~1.6.1 + - deps: multiparty@3.3.0 + - deps: serve-static@~1.3.0 + * deps: send@0.5.0 + - Accept string for `maxage` (converted by `ms`) + - Include link in default redirect response + +3.12.1 / 2014-06-26 +=================== + + * deps: connect@2.21.1 + - deps: cookie-parser@1.3.2 + - deps: cookie-signature@1.0.4 + - deps: express-session@~1.5.2 + - deps: type-is@~1.3.2 + * deps: cookie-signature@1.0.4 + - fix for timing attacks + +3.12.0 / 2014-06-21 +=================== + + * use `media-typer` to alter content-type charset + * deps: connect@2.21.0 + - deprecate `connect(middleware)` -- use `app.use(middleware)` instead + - deprecate `connect.createServer()` -- use `connect()` instead + - fix `res.setHeader()` patch to work with get -> append -> set pattern + - deps: compression@~1.0.8 + - deps: errorhandler@~1.1.1 + - deps: express-session@~1.5.0 + - deps: serve-index@~1.1.3 + +3.11.0 / 2014-06-19 +=================== + + * deprecate things with `depd` module + * deps: buffer-crc32@0.2.3 + * deps: connect@2.20.2 + - deprecate `verify` option to `json` -- use `body-parser` npm module instead + - deprecate `verify` option to `urlencoded` -- use `body-parser` npm module instead + - deprecate things with `depd` module + - use `finalhandler` for final response handling + - use `media-typer` to parse `content-type` for charset + - deps: body-parser@1.4.3 + - deps: connect-timeout@1.1.1 + - deps: cookie-parser@1.3.1 + - deps: csurf@1.2.2 + - deps: errorhandler@1.1.0 + - deps: express-session@1.4.0 + - deps: multiparty@3.2.9 + - deps: serve-index@1.1.2 + - deps: type-is@1.3.1 + - deps: vhost@2.0.0 + +3.10.5 / 2014-06-11 +=================== + + * deps: connect@2.19.6 + - deps: body-parser@1.3.1 + - deps: compression@1.0.7 + - deps: debug@1.0.2 + - deps: serve-index@1.1.1 + - deps: serve-static@1.2.3 + * deps: debug@1.0.2 + * deps: send@0.4.3 + - Do not throw uncatchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + +3.10.4 / 2014-06-09 +=================== + + * deps: connect@2.19.5 + - fix "event emitter leak" warnings + - deps: csurf@1.2.1 + - deps: debug@1.0.1 + - deps: serve-static@1.2.2 + - deps: type-is@1.2.1 + * deps: debug@1.0.1 + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: finished@1.2.1 + - deps: debug@1.0.1 + +3.10.3 / 2014-06-05 +=================== + + * use `vary` module for `res.vary` + * deps: connect@2.19.4 + - deps: errorhandler@1.0.2 + - deps: method-override@2.0.2 + - deps: serve-favicon@2.0.1 + * deps: debug@1.0.0 + +3.10.2 / 2014-06-03 +=================== + + * deps: connect@2.19.3 + - deps: compression@1.0.6 + +3.10.1 / 2014-06-03 +=================== + + * deps: connect@2.19.2 + - deps: compression@1.0.4 + * deps: proxy-addr@1.0.1 + +3.10.0 / 2014-06-02 +=================== + + * deps: connect@2.19.1 + - deprecate `methodOverride()` -- use `method-override` npm module instead + - deps: body-parser@1.3.0 + - deps: method-override@2.0.1 + - deps: multiparty@3.2.8 + - deps: response-time@2.0.0 + - deps: serve-static@1.2.1 + * deps: methods@1.0.1 + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + +3.9.0 / 2014-05-30 +================== + + * custom etag control with `app.set('etag', val)` + - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation + - `app.set('etag', 'weak')` weak tag + - `app.set('etag', 'strong')` strong etag + - `app.set('etag', false)` turn off + - `app.set('etag', true)` standard etag + * Include ETag in HEAD requests + * mark `res.send` ETag as weak and reduce collisions + * update connect to 2.18.0 + - deps: compression@1.0.3 + - deps: serve-index@1.1.0 + - deps: serve-static@1.2.0 + * update send to 0.4.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: debug@0.8.1 + +3.8.1 / 2014-05-27 +================== + + * update connect to 2.17.3 + - deps: body-parser@1.2.2 + - deps: express-session@1.2.1 + - deps: method-override@1.0.2 + +3.8.0 / 2014-05-21 +================== + + * keep previous `Content-Type` for `res.jsonp` + * set proper `charset` in `Content-Type` for `res.send` + * update connect to 2.17.1 + - fix `res.charset` appending charset when `content-type` has one + - deps: express-session@1.2.0 + - deps: morgan@1.1.1 + - deps: serve-index@1.0.3 + +3.7.0 / 2014-05-18 +================== + + * proper proxy trust with `app.set('trust proxy', trust)` + - `app.set('trust proxy', 1)` trust first hop + - `app.set('trust proxy', 'loopback')` trust loopback addresses + - `app.set('trust proxy', '10.0.0.1')` trust single IP + - `app.set('trust proxy', '10.0.0.1/16')` trust subnet + - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list + - `app.set('trust proxy', false)` turn off + - `app.set('trust proxy', true)` trust everything + * update connect to 2.16.2 + - deprecate `res.headerSent` -- use `res.headersSent` + - deprecate `res.on("header")` -- use on-headers module instead + - fix edge-case in `res.appendHeader` that would append in wrong order + - json: use body-parser + - urlencoded: use body-parser + - dep: bytes@1.0.0 + - dep: cookie-parser@1.1.0 + - dep: csurf@1.2.0 + - dep: express-session@1.1.0 + - dep: method-override@1.0.1 + +3.6.0 / 2014-05-09 +================== + + * deprecate `app.del()` -- use `app.delete()` instead + * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead + - the edge-case `res.json(status, num)` requires `res.status(status).json(num)` + * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead + - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)` + * support PURGE method + - add `app.purge` + - add `router.purge` + - include PURGE in `app.all` + * update connect to 2.15.0 + * Add `res.appendHeader` + * Call error stack even when response has been sent + * Patch `res.headerSent` to return Boolean + * Patch `res.headersSent` for node.js 0.8 + * Prevent default 404 handler after response sent + * dep: compression@1.0.2 + * dep: connect-timeout@1.1.0 + * dep: debug@^0.8.0 + * dep: errorhandler@1.0.1 + * dep: express-session@1.0.4 + * dep: morgan@1.0.1 + * dep: serve-favicon@2.0.0 + * dep: serve-index@1.0.2 + * update debug to 0.8.0 + * add `enable()` method + * change from stderr to stdout + * update methods to 1.0.0 + - add PURGE + * update mkdirp to 0.5.0 + +3.5.3 / 2014-05-08 +================== + + * fix `req.host` for IPv6 literals + * fix `res.jsonp` error if callback param is object + +3.5.2 / 2014-04-24 +================== + + * update connect to 2.14.5 + * update cookie to 0.1.2 + * update mkdirp to 0.4.0 + * update send to 0.3.0 + +3.5.1 / 2014-03-25 +================== + + * pin less-middleware in generated app + +3.5.0 / 2014-03-06 +================== + + * bump deps + +3.4.8 / 2014-01-13 +================== + + * prevent incorrect automatic OPTIONS responses #1868 @dpatti + * update binary and examples for jade 1.0 #1876 @yossi, #1877 @reqshark, #1892 @matheusazzi + * throw 400 in case of malformed paths @rlidwka + +3.4.7 / 2013-12-10 +================== + + * update connect + +3.4.6 / 2013-12-01 +================== + + * update connect (raw-body) + +3.4.5 / 2013-11-27 +================== + + * update connect + * res.location: remove leading ./ #1802 @kapouer + * res.redirect: fix `res.redirect('toString') #1829 @michaelficarra + * res.send: always send ETag when content-length > 0 + * router: add Router.all() method + +3.4.4 / 2013-10-29 +================== + + * update connect + * update supertest + * update methods + * express(1): replace bodyParser() with urlencoded() and json() #1795 @chirag04 + +3.4.3 / 2013-10-23 +================== + + * update connect + +3.4.2 / 2013-10-18 +================== + + * update connect + * downgrade commander + +3.4.1 / 2013-10-15 +================== + + * update connect + * update commander + * jsonp: check if callback is a function + * router: wrap encodeURIComponent in a try/catch #1735 (@lxe) + * res.format: now includes charset @1747 (@sorribas) + * res.links: allow multiple calls @1746 (@sorribas) + +3.4.0 / 2013-09-07 +================== + + * add res.vary(). Closes #1682 + * update connect + +3.3.8 / 2013-09-02 +================== + + * update connect + +3.3.7 / 2013-08-28 +================== + + * update connect + +3.3.6 / 2013-08-27 +================== + + * Revert "remove charset from json responses. Closes #1631" (causes issues in some clients) + * add: req.accepts take an argument list + +3.3.4 / 2013-07-08 +================== + + * update send and connect + +3.3.3 / 2013-07-04 +================== + + * update connect + +3.3.2 / 2013-07-03 +================== + + * update connect + * update send + * remove .version export + +3.3.1 / 2013-06-27 +================== + + * update connect + +3.3.0 / 2013-06-26 +================== + + * update connect + * add support for multiple X-Forwarded-Proto values. Closes #1646 + * change: remove charset from json responses. Closes #1631 + * change: return actual booleans from req.accept* functions + * fix jsonp callback array throw + +3.2.6 / 2013-06-02 +================== + + * update connect + +3.2.5 / 2013-05-21 +================== + + * update connect + * update node-cookie + * add: throw a meaningful error when there is no default engine + * change generation of ETags with res.send() to GET requests only. Closes #1619 + +3.2.4 / 2013-05-09 +================== + + * fix `req.subdomains` when no Host is present + * fix `req.host` when no Host is present, return undefined + +3.2.3 / 2013-05-07 +================== + + * update connect / qs + +3.2.2 / 2013-05-03 +================== + + * update qs + +3.2.1 / 2013-04-29 +================== + + * add app.VERB() paths array deprecation warning + * update connect + * update qs and remove all ~ semver crap + * fix: accept number as value of Signed Cookie + +3.2.0 / 2013-04-15 +================== + + * add "view" constructor setting to override view behaviour + * add req.acceptsEncoding(name) + * add req.acceptedEncodings + * revert cookie signature change causing session race conditions + * fix sorting of Accept values of the same quality + +3.1.2 / 2013-04-12 +================== + + * add support for custom Accept parameters + * update cookie-signature + +3.1.1 / 2013-04-01 +================== + + * add X-Forwarded-Host support to `req.host` + * fix relative redirects + * update mkdirp + * update buffer-crc32 + * remove legacy app.configure() method from app template. + +3.1.0 / 2013-01-25 +================== + + * add support for leading "." in "view engine" setting + * add array support to `res.set()` + * add node 0.8.x to travis.yml + * add "subdomain offset" setting for tweaking `req.subdomains` + * add `res.location(url)` implementing `res.redirect()`-like setting of Location + * use app.get() for x-powered-by setting for inheritance + * fix colons in passwords for `req.auth` + +3.0.6 / 2013-01-04 +================== + + * add http verb methods to Router + * update connect + * fix mangling of the `res.cookie()` options object + * fix jsonp whitespace escape. Closes #1132 + +3.0.5 / 2012-12-19 +================== + + * add throwing when a non-function is passed to a route + * fix: explicitly remove Transfer-Encoding header from 204 and 304 responses + * revert "add 'etag' option" + +3.0.4 / 2012-12-05 +================== + + * add 'etag' option to disable `res.send()` Etags + * add escaping of urls in text/plain in `res.redirect()` + for old browsers interpreting as html + * change crc32 module for a more liberal license + * update connect + +3.0.3 / 2012-11-13 +================== + + * update connect + * update cookie module + * fix cookie max-age + +3.0.2 / 2012-11-08 +================== + + * add OPTIONS to cors example. Closes #1398 + * fix route chaining regression. Closes #1397 + +3.0.1 / 2012-11-01 +================== + + * update connect + +3.0.0 / 2012-10-23 +================== + + * add `make clean` + * add "Basic" check to req.auth + * add `req.auth` test coverage + * add cb && cb(payload) to `res.jsonp()`. Closes #1374 + * add backwards compat for `res.redirect()` status. Closes #1336 + * add support for `res.json()` to retain previously defined Content-Types. Closes #1349 + * update connect + * change `res.redirect()` to utilize a pathname-relative Location again. Closes #1382 + * remove non-primitive string support for `res.send()` + * fix view-locals example. Closes #1370 + * fix route-separation example + +3.0.0rc5 / 2012-09-18 +================== + + * update connect + * add redis search example + * add static-files example + * add "x-powered-by" setting (`app.disable('x-powered-by')`) + * add "application/octet-stream" redirect Accept test case. Closes #1317 + +3.0.0rc4 / 2012-08-30 +================== + + * add `res.jsonp()`. Closes #1307 + * add "verbose errors" option to error-pages example + * add another route example to express(1) so people are not so confused + * add redis online user activity tracking example + * update connect dep + * fix etag quoting. Closes #1310 + * fix error-pages 404 status + * fix jsonp callback char restrictions + * remove old OPTIONS default response + +3.0.0rc3 / 2012-08-13 +================== + + * update connect dep + * fix signed cookies to work with `connect.cookieParser()` ("s:" prefix was missing) [tnydwrds] + * fix `res.render()` clobbering of "locals" + +3.0.0rc2 / 2012-08-03 +================== + + * add CORS example + * update connect dep + * deprecate `.createServer()` & remove old stale examples + * fix: escape `res.redirect()` link + * fix vhost example + +3.0.0rc1 / 2012-07-24 +================== + + * add more examples to view-locals + * add scheme-relative redirects (`res.redirect("//foo.com")`) support + * update cookie dep + * update connect dep + * update send dep + * fix `express(1)` -h flag, use -H for hogan. Closes #1245 + * fix `res.sendfile()` socket error handling regression + +3.0.0beta7 / 2012-07-16 +================== + + * update connect dep for `send()` root normalization regression + +3.0.0beta6 / 2012-07-13 +================== + + * add `err.view` property for view errors. Closes #1226 + * add "jsonp callback name" setting + * add support for "/foo/:bar*" non-greedy matches + * change `res.sendfile()` to use `send()` module + * change `res.send` to use "response-send" module + * remove `app.locals.use` and `res.locals.use`, use regular middleware + +3.0.0beta5 / 2012-07-03 +================== + + * add "make check" support + * add route-map example + * add `res.json(obj, status)` support back for BC + * add "methods" dep, remove internal methods module + * update connect dep + * update auth example to utilize cores pbkdf2 + * updated tests to use "supertest" + +3.0.0beta4 / 2012-06-25 +================== + + * Added `req.auth` + * Added `req.range(size)` + * Added `res.links(obj)` + * Added `res.send(body, status)` support back for backwards compat + * Added `.default()` support to `res.format()` + * Added 2xx / 304 check to `req.fresh` + * Revert "Added + support to the router" + * Fixed `res.send()` freshness check, respect res.statusCode + +3.0.0beta3 / 2012-06-15 +================== + + * Added hogan `--hjs` to express(1) [nullfirm] + * Added another example to content-negotiation + * Added `fresh` dep + * Changed: `res.send()` always checks freshness + * Fixed: expose connects mime module. Closes #1165 + +3.0.0beta2 / 2012-06-06 +================== + + * Added `+` support to the router + * Added `req.host` + * Changed `req.param()` to check route first + * Update connect dep + +3.0.0beta1 / 2012-06-01 +================== + + * Added `res.format()` callback to override default 406 behaviour + * Fixed `res.redirect()` 406. Closes #1154 + +3.0.0alpha5 / 2012-05-30 +================== + + * Added `req.ip` + * Added `{ signed: true }` option to `res.cookie()` + * Removed `res.signedCookie()` + * Changed: dont reverse `req.ips` + * Fixed "trust proxy" setting check for `req.ips` + +3.0.0alpha4 / 2012-05-09 +================== + + * Added: allow `[]` in jsonp callback. Closes #1128 + * Added `PORT` env var support in generated template. Closes #1118 [benatkin] + * Updated: connect 2.2.2 + +3.0.0alpha3 / 2012-05-04 +================== + + * Added public `app.routes`. Closes #887 + * Added _view-locals_ example + * Added _mvc_ example + * Added `res.locals.use()`. Closes #1120 + * Added conditional-GET support to `res.send()` + * Added: coerce `res.set()` values to strings + * Changed: moved `static()` in generated apps below router + * Changed: `res.send()` only set ETag when not previously set + * Changed connect 2.2.1 dep + * Changed: `make test` now runs unit / acceptance tests + * Fixed req/res proto inheritance + +3.0.0alpha2 / 2012-04-26 +================== + + * Added `make benchmark` back + * Added `res.send()` support for `String` objects + * Added client-side data exposing example + * Added `res.header()` and `req.header()` aliases for BC + * Added `express.createServer()` for BC + * Perf: memoize parsed urls + * Perf: connect 2.2.0 dep + * Changed: make `expressInit()` middleware self-aware + * Fixed: use app.get() for all core settings + * Fixed redis session example + * Fixed session example. Closes #1105 + * Fixed generated express dep. Closes #1078 + +3.0.0alpha1 / 2012-04-15 +================== + + * Added `app.locals.use(callback)` + * Added `app.locals` object + * Added `app.locals(obj)` + * Added `res.locals` object + * Added `res.locals(obj)` + * Added `res.format()` for content-negotiation + * Added `app.engine()` + * Added `res.cookie()` JSON cookie support + * Added "trust proxy" setting + * Added `req.subdomains` + * Added `req.protocol` + * Added `req.secure` + * Added `req.path` + * Added `req.ips` + * Added `req.fresh` + * Added `req.stale` + * Added comma-delimited / array support for `req.accepts()` + * Added debug instrumentation + * Added `res.set(obj)` + * Added `res.set(field, value)` + * Added `res.get(field)` + * Added `app.get(setting)`. Closes #842 + * Added `req.acceptsLanguage()` + * Added `req.acceptsCharset()` + * Added `req.accepted` + * Added `req.acceptedLanguages` + * Added `req.acceptedCharsets` + * Added "json replacer" setting + * Added "json spaces" setting + * Added X-Forwarded-Proto support to `res.redirect()`. Closes #92 + * Added `--less` support to express(1) + * Added `express.response` prototype + * Added `express.request` prototype + * Added `express.application` prototype + * Added `app.path()` + * Added `app.render()` + * Added `res.type()` to replace `res.contentType()` + * Changed: `res.redirect()` to add relative support + * Changed: enable "jsonp callback" by default + * Changed: renamed "case sensitive routes" to "case sensitive routing" + * Rewrite of all tests with mocha + * Removed "root" setting + * Removed `res.redirect('home')` support + * Removed `req.notify()` + * Removed `app.register()` + * Removed `app.redirect()` + * Removed `app.is()` + * Removed `app.helpers()` + * Removed `app.dynamicHelpers()` + * Fixed `res.sendfile()` with non-GET. Closes #723 + * Fixed express(1) public dir for windows. Closes #866 + +2.5.9/ 2012-04-02 +================== + + * Added support for PURGE request method [pbuyle] + * Fixed `express(1)` generated app `app.address()` before `listening` [mmalecki] + +2.5.8 / 2012-02-08 +================== + + * Update mkdirp dep. Closes #991 + +2.5.7 / 2012-02-06 +================== + + * Fixed `app.all` duplicate DELETE requests [mscdex] + +2.5.6 / 2012-01-13 +================== + + * Updated hamljs dev dep. Closes #953 + +2.5.5 / 2012-01-08 +================== + + * Fixed: set `filename` on cached templates [matthewleon] + +2.5.4 / 2012-01-02 +================== + + * Fixed `express(1)` eol on 0.4.x. Closes #947 + +2.5.3 / 2011-12-30 +================== + + * Fixed `req.is()` when a charset is present + +2.5.2 / 2011-12-10 +================== + + * Fixed: express(1) LF -> CRLF for windows + +2.5.1 / 2011-11-17 +================== + + * Changed: updated connect to 1.8.x + * Removed sass.js support from express(1) + +2.5.0 / 2011-10-24 +================== + + * Added ./routes dir for generated app by default + * Added npm install reminder to express(1) app gen + * Added 0.5.x support + * Removed `make test-cov` since it wont work with node 0.5.x + * Fixed express(1) public dir for windows. Closes #866 + +2.4.7 / 2011-10-05 +================== + + * Added mkdirp to express(1). Closes #795 + * Added simple _json-config_ example + * Added shorthand for the parsed request's pathname via `req.path` + * Changed connect dep to 1.7.x to fix npm issue... + * Fixed `res.redirect()` __HEAD__ support. [reported by xerox] + * Fixed `req.flash()`, only escape args + * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie] + +2.4.6 / 2011-08-22 +================== + + * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode] + +2.4.5 / 2011-08-19 +================== + + * Added support for routes to handle errors. Closes #809 + * Added `app.routes.all()`. Closes #803 + * Added "basepath" setting to work in conjunction with reverse proxies etc. + * Refactored `Route` to use a single array of callbacks + * Added support for multiple callbacks for `app.param()`. Closes #801 +Closes #805 + * Changed: removed .call(self) for route callbacks + * Dependency: `qs >= 0.3.1` + * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808 + +2.4.4 / 2011-08-05 +================== + + * Fixed `res.header()` intention of a set, even when `undefined` + * Fixed `*`, value no longer required + * Fixed `res.send(204)` support. Closes #771 + +2.4.3 / 2011-07-14 +================== + + * Added docs for `status` option special-case. Closes #739 + * Fixed `options.filename`, exposing the view path to template engines + +2.4.2. / 2011-07-06 +================== + + * Revert "removed jsonp stripping" for XSS + +2.4.1 / 2011-07-06 +================== + + * Added `res.json()` JSONP support. Closes #737 + * Added _extending-templates_ example. Closes #730 + * Added "strict routing" setting for trailing slashes + * Added support for multiple envs in `app.configure()` calls. Closes #735 + * Changed: `res.send()` using `res.json()` + * Changed: when cookie `path === null` don't default it + * Changed; default cookie path to "home" setting. Closes #731 + * Removed _pids/logs_ creation from express(1) + +2.4.0 / 2011-06-28 +================== + + * Added chainable `res.status(code)` + * Added `res.json()`, an explicit version of `res.send(obj)` + * Added simple web-service example + +2.3.12 / 2011-06-22 +================== + + * \#express is now on freenode! come join! + * Added `req.get(field, param)` + * Added links to Japanese documentation, thanks @hideyukisaito! + * Added; the `express(1)` generated app outputs the env + * Added `content-negotiation` example + * Dependency: connect >= 1.5.1 < 2.0.0 + * Fixed view layout bug. Closes #720 + * Fixed; ignore body on 304. Closes #701 + +2.3.11 / 2011-06-04 +================== + + * Added `npm test` + * Removed generation of dummy test file from `express(1)` + * Fixed; `express(1)` adds express as a dep + * Fixed; prune on `prepublish` + +2.3.10 / 2011-05-27 +================== + + * Added `req.route`, exposing the current route + * Added _package.json_ generation support to `express(1)` + * Fixed call to `app.param()` function for optional params. Closes #682 + +2.3.9 / 2011-05-25 +================== + + * Fixed bug-ish with `../' in `res.partial()` calls + +2.3.8 / 2011-05-24 +================== + + * Fixed `app.options()` + +2.3.7 / 2011-05-23 +================== + + * Added route `Collection`, ex: `app.get('/user/:id').remove();` + * Added support for `app.param(fn)` to define param logic + * Removed `app.param()` support for callback with return value + * Removed module.parent check from express(1) generated app. Closes #670 + * Refactored router. Closes #639 + +2.3.6 / 2011-05-20 +================== + + * Changed; using devDependencies instead of git submodules + * Fixed redis session example + * Fixed markdown example + * Fixed view caching, should not be enabled in development + +2.3.5 / 2011-05-20 +================== + + * Added export `.view` as alias for `.View` + +2.3.4 / 2011-05-08 +================== + + * Added `./examples/say` + * Fixed `res.sendfile()` bug preventing the transfer of files with spaces + +2.3.3 / 2011-05-03 +================== + + * Added "case sensitive routes" option. + * Changed; split methods supported per rfc [slaskis] + * Fixed route-specific middleware when using the same callback function several times + +2.3.2 / 2011-04-27 +================== + + * Fixed view hints + +2.3.1 / 2011-04-26 +================== + + * Added `app.match()` as `app.match.all()` + * Added `app.lookup()` as `app.lookup.all()` + * Added `app.remove()` for `app.remove.all()` + * Added `app.remove.VERB()` + * Fixed template caching collision issue. Closes #644 + * Moved router over from connect and started refactor + +2.3.0 / 2011-04-25 +================== + + * Added options support to `res.clearCookie()` + * Added `res.helpers()` as alias of `res.locals()` + * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel * Dependency `connect >= 1.4.0` + * Changed; auto set Content-Type in res.attachement [Aaron Heckmann] + * Renamed "cache views" to "view cache". Closes #628 + * Fixed caching of views when using several apps. Closes #637 + * Fixed gotcha invoking `app.param()` callbacks once per route middleware. +Closes #638 + * Fixed partial lookup precedence. Closes #631 +Shaw] + +2.2.2 / 2011-04-12 +================== + + * Added second callback support for `res.download()` connection errors + * Fixed `filename` option passing to template engine + +2.2.1 / 2011-04-04 +================== + + * Added `layout(path)` helper to change the layout within a view. Closes #610 + * Fixed `partial()` collection object support. + Previously only anything with `.length` would work. + When `.length` is present one must still be aware of holes, + however now `{ collection: {foo: 'bar'}}` is valid, exposes + `keyInCollection` and `keysInCollection`. + + * Performance improved with better view caching + * Removed `request` and `response` locals + * Changed; errorHandler page title is now `Express` instead of `Connect` + +2.2.0 / 2011-03-30 +================== + + * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606 + * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606 + * Added `app.VERB(path)` as alias of `app.lookup.VERB()`. + * Dependency `connect >= 1.2.0` + +2.1.1 / 2011-03-29 +================== + + * Added; expose `err.view` object when failing to locate a view + * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann] + * Fixed; `res.send(undefined)` responds with 204 [aheckmann] + +2.1.0 / 2011-03-24 +================== + + * Added `/_?` partial lookup support. Closes #447 + * Added `request`, `response`, and `app` local variables + * Added `settings` local variable, containing the app's settings + * Added `req.flash()` exception if `req.session` is not available + * Added `res.send(bool)` support (json response) + * Fixed stylus example for latest version + * Fixed; wrap try/catch around `res.render()` + +2.0.0 / 2011-03-17 +================== + + * Fixed up index view path alternative. + * Changed; `res.locals()` without object returns the locals + +2.0.0rc3 / 2011-03-17 +================== + + * Added `res.locals(obj)` to compliment `res.local(key, val)` + * Added `res.partial()` callback support + * Fixed recursive error reporting issue in `res.render()` + +2.0.0rc2 / 2011-03-17 +================== + + * Changed; `partial()` "locals" are now optional + * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01] + * Fixed .filename view engine option [reported by drudge] + * Fixed blog example + * Fixed `{req,res}.app` reference when mounting [Ben Weaver] + +2.0.0rc / 2011-03-14 +================== + + * Fixed; expose `HTTPSServer` constructor + * Fixed express(1) default test charset. Closes #579 [reported by secoif] + * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP] + +2.0.0beta3 / 2011-03-09 +================== + + * Added support for `res.contentType()` literal + The original `res.contentType('.json')`, + `res.contentType('application/json')`, and `res.contentType('json')` + will work now. + * Added `res.render()` status option support back + * Added charset option for `res.render()` + * Added `.charset` support (via connect 1.0.4) + * Added view resolution hints when in development and a lookup fails + * Added layout lookup support relative to the page view. + For example while rendering `./views/user/index.jade` if you create + `./views/user/layout.jade` it will be used in favour of the root layout. + * Fixed `res.redirect()`. RFC states absolute url [reported by unlink] + * Fixed; default `res.send()` string charset to utf8 + * Removed `Partial` constructor (not currently used) + +2.0.0beta2 / 2011-03-07 +================== + + * Added res.render() `.locals` support back to aid in migration process + * Fixed flash example + +2.0.0beta / 2011-03-03 +================== + + * Added HTTPS support + * Added `res.cookie()` maxAge support + * Added `req.header()` _Referrer_ / _Referer_ special-case, either works + * Added mount support for `res.redirect()`, now respects the mount-point + * Added `union()` util, taking place of `merge(clone())` combo + * Added stylus support to express(1) generated app + * Added secret to session middleware used in examples and generated app + * Added `res.local(name, val)` for progressive view locals + * Added default param support to `req.param(name, default)` + * Added `app.disabled()` and `app.enabled()` + * Added `app.register()` support for omitting leading ".", either works + * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539 + * Added `app.param()` to map route params to async/sync logic + * Added; aliased `app.helpers()` as `app.locals()`. Closes #481 + * Added extname with no leading "." support to `res.contentType()` + * Added `cache views` setting, defaulting to enabled in "production" env + * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_. + * Added `req.accepts()` support for extensions + * Changed; `res.download()` and `res.sendfile()` now utilize Connect's + static file server `connect.static.send()`. + * Changed; replaced `connect.utils.mime()` with npm _mime_ module + * Changed; allow `req.query` to be pre-defined (via middleware or other parent + * Changed view partial resolution, now relative to parent view + * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`. + * Fixed `req.param()` bug returning Array.prototype methods. Closes #552 + * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()` + * Fixed; using _qs_ module instead of _querystring_ + * Fixed; strip unsafe chars from jsonp callbacks + * Removed "stream threshold" setting + +1.0.8 / 2011-03-01 +================== + + * Allow `req.query` to be pre-defined (via middleware or other parent app) + * "connect": ">= 0.5.0 < 1.0.0". Closes #547 + * Removed the long deprecated __EXPRESS_ENV__ support + +1.0.7 / 2011-02-07 +================== + + * Fixed `render()` setting inheritance. + Mounted apps would not inherit "view engine" + +1.0.6 / 2011-02-07 +================== + + * Fixed `view engine` setting bug when period is in dirname + +1.0.5 / 2011-02-05 +================== + + * Added secret to generated app `session()` call + +1.0.4 / 2011-02-05 +================== + + * Added `qs` dependency to _package.json_ + * Fixed namespaced `require()`s for latest connect support + +1.0.3 / 2011-01-13 +================== + + * Remove unsafe characters from JSONP callback names [Ryan Grove] + +1.0.2 / 2011-01-10 +================== + + * Removed nested require, using `connect.router` + +1.0.1 / 2010-12-29 +================== + + * Fixed for middleware stacked via `createServer()` + previously the `foo` middleware passed to `createServer(foo)` + would not have access to Express methods such as `res.send()` + or props like `req.query` etc. + +1.0.0 / 2010-11-16 +================== + + * Added; deduce partial object names from the last segment. + For example by default `partial('forum/post', postObject)` will + give you the _post_ object, providing a meaningful default. + * Added http status code string representation to `res.redirect()` body + * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__. + * Added `req.is()` to aid in content negotiation + * Added partial local inheritance [suggested by masylum]. Closes #102 + providing access to parent template locals. + * Added _-s, --session[s]_ flag to express(1) to add session related middleware + * Added _--template_ flag to express(1) to specify the + template engine to use. + * Added _--css_ flag to express(1) to specify the + stylesheet engine to use (or just plain css by default). + * Added `app.all()` support [thanks aheckmann] + * Added partial direct object support. + You may now `partial('user', user)` providing the "user" local, + vs previously `partial('user', { object: user })`. + * Added _route-separation_ example since many people question ways + to do this with CommonJS modules. Also view the _blog_ example for + an alternative. + * Performance; caching view path derived partial object names + * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454 + * Fixed jsonp support; _text/javascript_ as per mailinglist discussion + +1.0.0rc4 / 2010-10-14 +================== + + * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0 + * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware)) + * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass] + * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass] + * Added `partial()` support for array-like collections. Closes #434 + * Added support for swappable querystring parsers + * Added session usage docs. Closes #443 + * Added dynamic helper caching. Closes #439 [suggested by maritz] + * Added authentication example + * Added basic Range support to `res.sendfile()` (and `res.download()` etc) + * Changed; `express(1)` generated app using 2 spaces instead of 4 + * Default env to "development" again [aheckmann] + * Removed _context_ option is no more, use "scope" + * Fixed; exposing _./support_ libs to examples so they can run without installs + * Fixed mvc example + +1.0.0rc3 / 2010-09-20 +================== + + * Added confirmation for `express(1)` app generation. Closes #391 + * Added extending of flash formatters via `app.flashFormatters` + * Added flash formatter support. Closes #411 + * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold" + * Added _stream threshold_ setting for `res.sendfile()` + * Added `res.send()` __HEAD__ support + * Added `res.clearCookie()` + * Added `res.cookie()` + * Added `res.render()` headers option + * Added `res.redirect()` response bodies + * Added `res.render()` status option support. Closes #425 [thanks aheckmann] + * Fixed `res.sendfile()` responding with 403 on malicious path + * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_ + * Fixed; mounted apps settings now inherit from parent app [aheckmann] + * Fixed; stripping Content-Length / Content-Type when 204 + * Fixed `res.send()` 204. Closes #419 + * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402 + * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo] + + +1.0.0rc2 / 2010-08-17 +================== + + * Added `app.register()` for template engine mapping. Closes #390 + * Added `res.render()` callback support as second argument (no options) + * Added callback support to `res.download()` + * Added callback support for `res.sendfile()` + * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()` + * Added "partials" setting to docs + * Added default expresso tests to `express(1)` generated app. Closes #384 + * Fixed `res.sendfile()` error handling, defer via `next()` + * Fixed `res.render()` callback when a layout is used [thanks guillermo] + * Fixed; `make install` creating ~/.node_libraries when not present + * Fixed issue preventing error handlers from being defined anywhere. Closes #387 + +1.0.0rc / 2010-07-28 +================== + + * Added mounted hook. Closes #369 + * Added connect dependency to _package.json_ + + * Removed "reload views" setting and support code + development env never caches, production always caches. + + * Removed _param_ in route callbacks, signature is now + simply (req, res, next), previously (req, res, params, next). + Use _req.params_ for path captures, _req.query_ for GET params. + + * Fixed "home" setting + * Fixed middleware/router precedence issue. Closes #366 + * Fixed; _configure()_ callbacks called immediately. Closes #368 + +1.0.0beta2 / 2010-07-23 +================== + + * Added more examples + * Added; exporting `Server` constructor + * Added `Server#helpers()` for view locals + * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349 + * Added support for absolute view paths + * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363 + * Added Guillermo Rauch to the contributor list + * Added support for "as" for non-collection partials. Closes #341 + * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf] + * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo] + * Fixed instanceof `Array` checks, now `Array.isArray()` + * Fixed express(1) expansion of public dirs. Closes #348 + * Fixed middleware precedence. Closes #345 + * Fixed view watcher, now async [thanks aheckmann] + +1.0.0beta / 2010-07-15 +================== + + * Re-write + - much faster + - much lighter + - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs + +0.14.0 / 2010-06-15 +================== + + * Utilize relative requires + * Added Static bufferSize option [aheckmann] + * Fixed caching of view and partial subdirectories [aheckmann] + * Fixed mime.type() comments now that ".ext" is not supported + * Updated haml submodule + * Updated class submodule + * Removed bin/express + +0.13.0 / 2010-06-01 +================== + + * Added node v0.1.97 compatibility + * Added support for deleting cookies via Request#cookie('key', null) + * Updated haml submodule + * Fixed not-found page, now using charset utf-8 + * Fixed show-exceptions page, now using charset utf-8 + * Fixed view support due to fs.readFile Buffers + * Changed; mime.type() no longer accepts ".type" due to node extname() changes + +0.12.0 / 2010-05-22 +================== + + * Added node v0.1.96 compatibility + * Added view `helpers` export which act as additional local variables + * Updated haml submodule + * Changed ETag; removed inode, modified time only + * Fixed LF to CRLF for setting multiple cookies + * Fixed cookie compilation; values are now urlencoded + * Fixed cookies parsing; accepts quoted values and url escaped cookies + +0.11.0 / 2010-05-06 +================== + + * Added support for layouts using different engines + - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' }) + - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml' + - this.render('page.html.haml', { layout: false }) // no layout + * Updated ext submodule + * Updated haml submodule + * Fixed EJS partial support by passing along the context. Issue #307 + +0.10.1 / 2010-05-03 +================== + + * Fixed binary uploads. + +0.10.0 / 2010-04-30 +================== + + * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s + encoding is set to 'utf8' or 'utf-8'). + * Added "encoding" option to Request#render(). Closes #299 + * Added "dump exceptions" setting, which is enabled by default. + * Added simple ejs template engine support + * Added error response support for text/plain, application/json. Closes #297 + * Added callback function param to Request#error() + * Added Request#sendHead() + * Added Request#stream() + * Added support for Request#respond(304, null) for empty response bodies + * Added ETag support to Request#sendfile() + * Added options to Request#sendfile(), passed to fs.createReadStream() + * Added filename arg to Request#download() + * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request + * Performance enhanced by preventing several calls to toLowerCase() in Router#match() + * Changed; Request#sendfile() now streams + * Changed; Renamed Request#halt() to Request#respond(). Closes #289 + * Changed; Using sys.inspect() instead of JSON.encode() for error output + * Changed; run() returns the http.Server instance. Closes #298 + * Changed; Defaulting Server#host to null (INADDR_ANY) + * Changed; Logger "common" format scale of 0.4f + * Removed Logger "request" format + * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found + * Fixed several issues with http client + * Fixed Logger Content-Length output + * Fixed bug preventing Opera from retaining the generated session id. Closes #292 + +0.9.0 / 2010-04-14 +================== + + * Added DSL level error() route support + * Added DSL level notFound() route support + * Added Request#error() + * Added Request#notFound() + * Added Request#render() callback function. Closes #258 + * Added "max upload size" setting + * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254 + * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js + * Added callback function support to Request#halt() as 3rd/4th arg + * Added preprocessing of route param wildcards using param(). Closes #251 + * Added view partial support (with collections etc.) + * Fixed bug preventing falsey params (such as ?page=0). Closes #286 + * Fixed setting of multiple cookies. Closes #199 + * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml) + * Changed; session cookie is now httpOnly + * Changed; Request is no longer global + * Changed; Event is no longer global + * Changed; "sys" module is no longer global + * Changed; moved Request#download to Static plugin where it belongs + * Changed; Request instance created before body parsing. Closes #262 + * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253 + * Changed; Pre-caching view partials in memory when "cache view partials" is enabled + * Updated support to node --version 0.1.90 + * Updated dependencies + * Removed set("session cookie") in favour of use(Session, { cookie: { ... }}) + * Removed utils.mixin(); use Object#mergeDeep() + +0.8.0 / 2010-03-19 +================== + + * Added coffeescript example app. Closes #242 + * Changed; cache api now async friendly. Closes #240 + * Removed deprecated 'express/static' support. Use 'express/plugins/static' + +0.7.6 / 2010-03-19 +================== + + * Added Request#isXHR. Closes #229 + * Added `make install` (for the executable) + * Added `express` executable for setting up simple app templates + * Added "GET /public/*" to Static plugin, defaulting to /public + * Added Static plugin + * Fixed; Request#render() only calls cache.get() once + * Fixed; Namespacing View caches with "view:" + * Fixed; Namespacing Static caches with "static:" + * Fixed; Both example apps now use the Static plugin + * Fixed set("views"). Closes #239 + * Fixed missing space for combined log format + * Deprecated Request#sendfile() and 'express/static' + * Removed Server#running + +0.7.5 / 2010-03-16 +================== + + * Added Request#flash() support without args, now returns all flashes + * Updated ext submodule + +0.7.4 / 2010-03-16 +================== + + * Fixed session reaper + * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft) + +0.7.3 / 2010-03-16 +================== + + * Added package.json + * Fixed requiring of haml / sass due to kiwi removal + +0.7.2 / 2010-03-16 +================== + + * Fixed GIT submodules (HAH!) + +0.7.1 / 2010-03-16 +================== + + * Changed; Express now using submodules again until a PM is adopted + * Changed; chat example using millisecond conversions from ext + +0.7.0 / 2010-03-15 +================== + + * Added Request#pass() support (finds the next matching route, or the given path) + * Added Logger plugin (default "common" format replaces CommonLogger) + * Removed Profiler plugin + * Removed CommonLogger plugin + +0.6.0 / 2010-03-11 +================== + + * Added seed.yml for kiwi package management support + * Added HTTP client query string support when method is GET. Closes #205 + + * Added support for arbitrary view engines. + For example "foo.engine.html" will now require('engine'), + the exports from this module are cached after the first require(). + + * Added async plugin support + + * Removed usage of RESTful route funcs as http client + get() etc, use http.get() and friends + + * Removed custom exceptions + +0.5.0 / 2010-03-10 +================== + + * Added ext dependency (library of js extensions) + * Removed extname() / basename() utils. Use path module + * Removed toArray() util. Use arguments.values + * Removed escapeRegexp() util. Use RegExp.escape() + * Removed process.mixin() dependency. Use utils.mixin() + * Removed Collection + * Removed ElementCollection + * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com) ;) + +0.4.0 / 2010-02-11 +================== + + * Added flash() example to sample upload app + * Added high level restful http client module (express/http) + * Changed; RESTful route functions double as HTTP clients. Closes #69 + * Changed; throwing error when routes are added at runtime + * Changed; defaulting render() context to the current Request. Closes #197 + * Updated haml submodule + +0.3.0 / 2010-02-11 +================== + + * Updated haml / sass submodules. Closes #200 + * Added flash message support. Closes #64 + * Added accepts() now allows multiple args. fixes #117 + * Added support for plugins to halt. Closes #189 + * Added alternate layout support. Closes #119 + * Removed Route#run(). Closes #188 + * Fixed broken specs due to use(Cookie) missing + +0.2.1 / 2010-02-05 +================== + + * Added "plot" format option for Profiler (for gnuplot processing) + * Added request number to Profiler plugin + * Fixed binary encoding for multipart file uploads, was previously defaulting to UTF8 + * Fixed issue with routes not firing when not files are present. Closes #184 + * Fixed process.Promise -> events.Promise + +0.2.0 / 2010-02-03 +================== + + * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180 + * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174 + * Added expiration support to cache api with reaper. Closes #133 + * Added cache Store.Memory#reap() + * Added Cache; cache api now uses first class Cache instances + * Added abstract session Store. Closes #172 + * Changed; cache Memory.Store#get() utilizing Collection + * Renamed MemoryStore -> Store.Memory + * Fixed use() of the same plugin several time will always use latest options. Closes #176 + +0.1.0 / 2010-02-03 +================== + + * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context + * Updated node support to 0.1.27 Closes #169 + * Updated dirname(__filename) -> __dirname + * Updated libxmljs support to v0.2.0 + * Added session support with memory store / reaping + * Added quick uid() helper + * Added multi-part upload support + * Added Sass.js support / submodule + * Added production env caching view contents and static files + * Added static file caching. Closes #136 + * Added cache plugin with memory stores + * Added support to StaticFile so that it works with non-textual files. + * Removed dirname() helper + * Removed several globals (now their modules must be required) + +0.0.2 / 2010-01-10 +================== + + * Added view benchmarks; currently haml vs ejs + * Added Request#attachment() specs. Closes #116 + * Added use of node's parseQuery() util. Closes #123 + * Added `make init` for submodules + * Updated Haml + * Updated sample chat app to show messages on load + * Updated libxmljs parseString -> parseHtmlString + * Fixed `make init` to work with older versions of git + * Fixed specs can now run independent specs for those who can't build deps. Closes #127 + * Fixed issues introduced by the node url module changes. Closes 126. + * Fixed two assertions failing due to Collection#keys() returning strings + * Fixed faulty Collection#toArray() spec due to keys() returning strings + * Fixed `make test` now builds libxmljs.node before testing + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md index 4c5b6f7..bc108d5 100644 --- a/node_modules/express/Readme.md +++ b/node_modules/express/Readme.md @@ -1,48 +1,39 @@ -[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](https://expressjs.com/) +[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/) -**Fast, unopinionated, minimalist web framework for [Node.js](https://nodejs.org).** +**Fast, unopinionated, minimalist web framework for [Node.js](http://nodejs.org).** -**This project has a [Code of Conduct].** +**This project has a [Code of Conduct][].** ## Table of contents -- [Table of contents](#table-of-contents) -- [Installation](#installation) -- [Features](#features) -- [Docs \& Community](#docs--community) -- [Quick Start](#quick-start) -- [Philosophy](#philosophy) -- [Examples](#examples) -- [Contributing](#contributing) - - [Security Issues](#security-issues) - - [Running Tests](#running-tests) -- [Current project team members](#current-project-team-members) - - [TC (Technical Committee)](#tc-technical-committee) - - [TC emeriti members](#tc-emeriti-members) - - [Triagers](#triagers) - - [Emeritus Triagers](#emeritus-triagers) -- [License](#license) +* [Installation](#Installation) +* [Features](#Features) +* [Docs & Community](#docs--community) +* [Quick Start](#Quick-Start) +* [Running Tests](#Running-Tests) +* [Philosophy](#Philosophy) +* [Examples](#Examples) +* [Contributing to Express](#Contributing) +* [TC (Technical Committee)](#tc-technical-committee) +* [Triagers](#triagers) +* [License](#license) [![NPM Version][npm-version-image]][npm-url] +[![NPM Install Size][npm-install-size-image]][npm-install-size-url] [![NPM Downloads][npm-downloads-image]][npm-downloads-url] -[![Linux Build][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] [![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] ```js -import express from 'express' - +const express = require('express') const app = express() -app.get('/', (req, res) => { +app.get('/', function (req, res) { res.send('Hello World') }) -app.listen(3000, () => { - console.log('Server is running on http://localhost:3000') -}) +app.listen(3000) ``` ## Installation @@ -51,7 +42,7 @@ This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Before installing, [download and install Node.js](https://nodejs.org/en/download/). -Node.js 18 or higher is required. +Node.js 0.10 or higher is required. If this is a brand new project, make sure to create a `package.json` first with the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file). @@ -59,11 +50,11 @@ the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file). Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): -```bash -npm install express +```console +$ npm install express ``` -Follow [our installing guide](https://expressjs.com/en/starter/installing.html) +Follow [our installing guide](http://expressjs.com/en/starter/installing.html) for more information. ## Features @@ -78,11 +69,14 @@ for more information. ## Docs & Community - * [Website and Documentation](https://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)] + * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)] + * [#express](https://web.libera.chat/#express) on [Libera Chat](https://libera.chat) IRC * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules - * [Github Discussions](https://github.com/expressjs/discussions) for discussion on the development and usage of Express + * Visit the [Wiki](https://github.com/expressjs/express/wiki) + * [Google Group](https://groups.google.com/group/express-js) for discussion + * [Gitter](https://gitter.im/expressjs/express) for support and discussion -**PROTIP** Be sure to read the [migration guide to v5](https://expressjs.com/en/guide/migrating-5) +**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x). ## Quick Start @@ -90,26 +84,26 @@ for more information. Install the executable. The executable's major version will match Express's: -```bash -npm install -g express-generator@4 +```console +$ npm install -g express-generator@4 ``` Create the app: -```bash -express /tmp/foo && cd /tmp/foo +```console +$ express /tmp/foo && cd /tmp/foo ``` Install dependencies: -```bash -npm install +```console +$ npm install ``` Start the server: -```bash -npm start +```console +$ npm start ``` View the website at: http://localhost:3000 @@ -121,58 +115,51 @@ npm start HTTP APIs. Express does not force you to use any specific ORM or template engine. With support for over - 14 template engines via [@ladjs/consolidate](https://github.com/ladjs/consolidate), + 14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js), you can quickly craft your perfect framework. ## Examples - To view the examples, clone the Express repository: + To view the examples, clone the Express repo and install the dependencies: -```bash -git clone https://github.com/expressjs/express.git --depth 1 && cd express -``` - - Then install the dependencies: - -```bash -npm install +```console +$ git clone https://github.com/expressjs/express.git --depth 1 +$ cd express +$ npm install ``` Then run whichever example you want: -```bash -node examples/content-negotiation +```console +$ node examples/content-negotiation ``` ## Contributing + [![Linux Build][github-actions-ci-image]][github-actions-ci-url] + [![Windows Build][appveyor-image]][appveyor-url] + [![Test Coverage][coveralls-image]][coveralls-url] + The Express.js project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues, and more! -See the [Contributing Guide] for more technical details on contributing. +See the [Contributing Guide](Contributing.md) for more technical details on contributing. ### Security Issues -If you discover a security vulnerability in Express, please see [Security Policies and Procedures](SECURITY.md). +If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md). ### Running Tests -To run the test suite, first install the dependencies: +To run the test suite, first install the dependencies, then run `npm test`: -```bash -npm install +```console +$ npm install +$ npm test ``` -Then run `npm test`: - -```bash -npm test -``` - -## Current project team members - -For information about the governance of the express.js project, see [GOVERNANCE.md](https://github.com/expressjs/discussions/blob/HEAD/docs/GOVERNANCE.md). +## People The original author of Express is [TJ Holowaychuk](https://github.com/tj) @@ -205,14 +192,18 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj) ### Triagers * [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair** -* [bjohansebas](https://github.com/bjohansebas) - **Sebastian Beltran** * [carpasse](https://github.com/carpasse) - **Carlos Serrano** * [CBID2](https://github.com/CBID2) - **Christine Belzie** +* [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim** * [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin** +* [0ss](https://github.com/0ss) - **Salah** +* [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him) +* [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi** +* [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him) +* [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego** * [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him) -* [Phillip9587](https://github.com/Phillip9587) - **Phillip Barta** -* [efekrskl](https://github.com/efekrskl) - **Efe Karasakal** - +* [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger**
Triagers emeriti members @@ -245,16 +236,6 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj) * [sheplu](https://github.com/sheplu) - **Jean Burellier** * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav** * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** - * [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim** - * [0ss](https://github.com/0ss) - **Salah** - * [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him) - * [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him) - * [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego** - * [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin** - * [dpopp07](https://github.com/dpopp07) - **Dustin Popp** - * [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger** - * [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi** -
@@ -262,15 +243,18 @@ The original author of Express is [TJ Holowaychuk](https://github.com/tj) [MIT](LICENSE) -[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/express?branch=master +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/express/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master [coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master -[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/express/ci.yml?branch=master&label=ci +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=linux [github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml -[npm-downloads-image]: https://img.shields.io/npm/dm/express +[npm-downloads-image]: https://badgen.net/npm/dm/express [npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true +[npm-install-size-image]: https://badgen.net/packagephobia/install/express +[npm-install-size-url]: https://packagephobia.com/result?p=express [npm-url]: https://npmjs.org/package/express -[npm-version-image]: https://img.shields.io/npm/v/express +[npm-version-image]: https://badgen.net/npm/v/express [ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge [ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express -[Code of Conduct]: https://github.com/expressjs/.github/blob/HEAD/CODE_OF_CONDUCT.md -[Contributing Guide]: https://github.com/expressjs/.github/blob/HEAD/CONTRIBUTING.md +[Code of Conduct]: https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md diff --git a/node_modules/express/lib/application.js b/node_modules/express/lib/application.js index 838b882..ebb30b5 100644 --- a/node_modules/express/lib/application.js +++ b/node_modules/express/lib/application.js @@ -14,24 +14,29 @@ */ var finalhandler = require('finalhandler'); +var Router = require('./router'); +var methods = require('methods'); +var middleware = require('./middleware/init'); +var query = require('./middleware/query'); var debug = require('debug')('express:application'); var View = require('./view'); -var http = require('node:http'); -var methods = require('./utils').methods; +var http = require('http'); var compileETag = require('./utils').compileETag; var compileQueryParser = require('./utils').compileQueryParser; var compileTrust = require('./utils').compileTrust; -var resolve = require('node:path').resolve; -var once = require('once') -var Router = require('router'); +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var merge = require('utils-merge'); +var resolve = require('path').resolve; +var setPrototypeOf = require('setprototypeof') /** * Module variables. * @private */ +var hasOwnProperty = Object.prototype.hasOwnProperty var slice = Array.prototype.slice; -var flatten = Array.prototype.flat; /** * Application prototype. @@ -57,29 +62,11 @@ var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default'; */ app.init = function init() { - var router = null; - - this.cache = Object.create(null); - this.engines = Object.create(null); - this.settings = Object.create(null); + this.cache = {}; + this.engines = {}; + this.settings = {}; this.defaultConfiguration(); - - // Setup getting to lazily add base router - Object.defineProperty(this, 'router', { - configurable: true, - enumerable: true, - get: function getrouter() { - if (router === null) { - router = new Router({ - caseSensitive: this.enabled('case sensitive routing'), - strict: this.enabled('strict routing') - }); - } - - return router; - } - }); }; /** @@ -94,7 +81,7 @@ app.defaultConfiguration = function defaultConfiguration() { this.enable('x-powered-by'); this.set('etag', 'weak'); this.set('env', env); - this.set('query parser', 'simple') + this.set('query parser', 'extended'); this.set('subdomain offset', 2); this.set('trust proxy', false); @@ -115,10 +102,10 @@ app.defaultConfiguration = function defaultConfiguration() { } // inherit protos - Object.setPrototypeOf(this.request, parent.request) - Object.setPrototypeOf(this.response, parent.response) - Object.setPrototypeOf(this.engines, parent.engines) - Object.setPrototypeOf(this.settings, parent.settings) + setPrototypeOf(this.request, parent.request) + setPrototypeOf(this.response, parent.response) + setPrototypeOf(this.engines, parent.engines) + setPrototypeOf(this.settings, parent.settings) }); // setup locals @@ -138,6 +125,32 @@ app.defaultConfiguration = function defaultConfiguration() { if (env === 'production') { this.enable('view cache'); } + + Object.defineProperty(this, 'router', { + get: function() { + throw new Error('\'app.router\' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.'); + } + }); +}; + +/** + * lazily adds the base router if it has not yet been added. + * + * We cannot add the base router in the defaultConfiguration because + * it reads app settings which might be set after that has run. + * + * @private + */ +app.lazyrouter = function lazyrouter() { + if (!this._router) { + this._router = new Router({ + caseSensitive: this.enabled('case sensitive routing'), + strict: this.enabled('strict routing') + }); + + this._router.use(query(this.get('query parser fn'))); + this._router.use(middleware.init(this)); + } }; /** @@ -150,31 +163,22 @@ app.defaultConfiguration = function defaultConfiguration() { */ app.handle = function handle(req, res, callback) { + var router = this._router; + // final handler var done = callback || finalhandler(req, res, { env: this.get('env'), onerror: logerror.bind(this) }); - // set powered by header - if (this.enabled('x-powered-by')) { - res.setHeader('X-Powered-By', 'Express'); + // no routes + if (!router) { + debug('no routes defined on app'); + done(); + return; } - // set circular references - req.res = res; - res.req = req; - - // alter the prototypes - Object.setPrototypeOf(req, this.request) - Object.setPrototypeOf(res, this.response) - - // setup locals - if (!res.locals) { - res.locals = Object.create(null); - } - - this.router.handle(req, res, done); + router.handle(req, res, done); }; /** @@ -207,14 +211,15 @@ app.use = function use(fn) { } } - var fns = flatten.call(slice.call(arguments, offset), Infinity); + var fns = flatten(slice.call(arguments, offset)); if (fns.length === 0) { throw new TypeError('app.use() requires a middleware function') } - // get router - var router = this.router; + // setup router + this.lazyrouter(); + var router = this._router; fns.forEach(function (fn) { // non-express app @@ -230,8 +235,8 @@ app.use = function use(fn) { router.use(path, function mounted_app(req, res, next) { var orig = req.app; fn.handle(req, res, function (err) { - Object.setPrototypeOf(req, orig.request) - Object.setPrototypeOf(res, orig.response) + setPrototypeOf(req, orig.request) + setPrototypeOf(res, orig.response) next(err); }); }); @@ -254,7 +259,8 @@ app.use = function use(fn) { */ app.route = function route(path) { - return this.router.route(path); + this.lazyrouter(); + return this._router.route(path); }; /** @@ -320,6 +326,8 @@ app.engine = function engine(ext, fn) { */ app.param = function param(name, fn) { + this.lazyrouter(); + if (Array.isArray(name)) { for (var i = 0; i < name.length; i++) { this.param(name[i], fn); @@ -328,7 +336,7 @@ app.param = function param(name, fn) { return this; } - this.router.param(name, fn); + this._router.param(name, fn); return this; }; @@ -351,7 +359,17 @@ app.param = function param(name, fn) { app.set = function set(setting, val) { if (arguments.length === 1) { // app.get(setting) - return this.settings[setting]; + var settings = this.settings + + while (settings && settings !== Object.prototype) { + if (hasOwnProperty.call(settings, setting)) { + return settings[setting] + } + + settings = Object.getPrototypeOf(settings) + } + + return undefined } debug('set "%s" to %o', setting, val); @@ -468,14 +486,16 @@ app.disable = function disable(setting) { * Delegate `.VERB(...)` calls to `router.VERB(...)`. */ -methods.forEach(function (method) { - app[method] = function (path) { +methods.forEach(function(method){ + app[method] = function(path){ if (method === 'get' && arguments.length === 1) { // app.get(setting) return this.set(path); } - var route = this.route(path); + this.lazyrouter(); + + var route = this._router.route(path); route[method].apply(route, slice.call(arguments, 1)); return this; }; @@ -492,7 +512,9 @@ methods.forEach(function (method) { */ app.all = function all(path) { - var route = this.route(path); + this.lazyrouter(); + + var route = this._router.route(path); var args = slice.call(arguments, 1); for (var i = 0; i < methods.length; i++) { @@ -502,6 +524,10 @@ app.all = function all(path) { return this; }; +// del -> delete alias + +app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead'); + /** * Render the given view `name` name with `options` * and a callback accepting an error and the @@ -524,6 +550,7 @@ app.render = function render(name, options, callback) { var done = callback; var engines = this.engines; var opts = options; + var renderOptions = {}; var view; // support callback function as second arg @@ -532,8 +559,16 @@ app.render = function render(name, options, callback) { opts = {}; } + // merge app.locals + merge(renderOptions, this.locals); + + // merge options._locals + if (opts._locals) { + merge(renderOptions, opts._locals); + } + // merge options - var renderOptions = { ...this.locals, ...opts._locals, ...opts }; + merge(renderOptions, opts); // set .cache unless explicitly provided if (renderOptions.cache == null) { @@ -583,8 +618,8 @@ app.render = function render(name, options, callback) { * and HTTPS server you may do so with the "http" * and "https" modules as shown here: * - * var http = require('node:http') - * , https = require('node:https') + * var http = require('http') + * , https = require('https') * , express = require('express') * , app = express(); * @@ -596,14 +631,9 @@ app.render = function render(name, options, callback) { */ app.listen = function listen() { - var server = http.createServer(this) - var args = slice.call(arguments) - if (typeof args[args.length - 1] === 'function') { - var done = args[args.length - 1] = once(args[args.length - 1]) - server.once('error', done) - } - return server.listen.apply(server, args) -} + var server = http.createServer(this); + return server.listen.apply(server, arguments); +}; /** * Log error using console.error. diff --git a/node_modules/express/lib/express.js b/node_modules/express/lib/express.js index 2d502eb..d188a16 100644 --- a/node_modules/express/lib/express.js +++ b/node_modules/express/lib/express.js @@ -13,10 +13,11 @@ */ var bodyParser = require('body-parser') -var EventEmitter = require('node:events').EventEmitter; +var EventEmitter = require('events').EventEmitter; var mixin = require('merge-descriptors'); var proto = require('./application'); -var Router = require('router'); +var Route = require('./router/route'); +var Router = require('./router'); var req = require('./request'); var res = require('./response'); @@ -67,7 +68,7 @@ exports.response = res; * Expose constructors. */ -exports.Route = Router.Route; +exports.Route = Route; exports.Router = Router; /** @@ -75,7 +76,41 @@ exports.Router = Router; */ exports.json = bodyParser.json +exports.query = require('./middleware/query'); exports.raw = bodyParser.raw exports.static = require('serve-static'); exports.text = bodyParser.text exports.urlencoded = bodyParser.urlencoded + +/** + * Replace removed middleware with an appropriate error message. + */ + +var removedMiddlewares = [ + 'bodyParser', + 'compress', + 'cookieSession', + 'session', + 'logger', + 'cookieParser', + 'favicon', + 'responseTime', + 'errorHandler', + 'timeout', + 'methodOverride', + 'vhost', + 'csrf', + 'directory', + 'limit', + 'multipart', + 'staticCache' +] + +removedMiddlewares.forEach(function (name) { + Object.defineProperty(exports, name, { + get: function () { + throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.'); + }, + configurable: true + }); +}); diff --git a/node_modules/express/lib/middleware/init.js b/node_modules/express/lib/middleware/init.js new file mode 100644 index 0000000..dfd0427 --- /dev/null +++ b/node_modules/express/lib/middleware/init.js @@ -0,0 +1,43 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var setPrototypeOf = require('setprototypeof') + +/** + * Initialization middleware, exposing the + * request and response to each other, as well + * as defaulting the X-Powered-By header field. + * + * @param {Function} app + * @return {Function} + * @api private + */ + +exports.init = function(app){ + return function expressInit(req, res, next){ + if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express'); + req.res = res; + res.req = req; + req.next = next; + + setPrototypeOf(req, app.request) + setPrototypeOf(res, app.response) + + res.locals = res.locals || Object.create(null); + + next(); + }; +}; + diff --git a/node_modules/express/lib/middleware/query.js b/node_modules/express/lib/middleware/query.js new file mode 100644 index 0000000..7e91669 --- /dev/null +++ b/node_modules/express/lib/middleware/query.js @@ -0,0 +1,47 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var merge = require('utils-merge') +var parseUrl = require('parseurl'); +var qs = require('qs'); + +/** + * @param {Object} options + * @return {Function} + * @api public + */ + +module.exports = function query(options) { + var opts = merge({}, options) + var queryparse = qs.parse; + + if (typeof options === 'function') { + queryparse = options; + opts = undefined; + } + + if (opts !== undefined && opts.allowPrototypes === undefined) { + // back-compat for qs module + opts.allowPrototypes = true; + } + + return function query(req, res, next){ + if (!req.query) { + var val = parseUrl(req).query; + req.query = queryparse(val, opts); + } + + next(); + }; +}; diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js index 69990da..3f1eeca 100644 --- a/node_modules/express/lib/request.js +++ b/node_modules/express/lib/request.js @@ -14,9 +14,10 @@ */ var accepts = require('accepts'); -var isIP = require('node:net').isIP; +var deprecate = require('depd')('express'); +var isIP = require('net').isIP; var typeis = require('type-is'); -var http = require('node:http'); +var http = require('http'); var fresh = require('fresh'); var parseRange = require('range-parser'); var parse = require('parseurl'); @@ -146,6 +147,9 @@ req.acceptsEncodings = function(){ return accept.encodings.apply(accept, arguments); }; +req.acceptsEncoding = deprecate.function(req.acceptsEncodings, + 'req.acceptsEncoding: Use acceptsEncodings instead'); + /** * Check if the given `charset`s are acceptable, * otherwise you should respond with 406 "Not Acceptable". @@ -160,6 +164,9 @@ req.acceptsCharsets = function(){ return accept.charsets.apply(accept, arguments); }; +req.acceptsCharset = deprecate.function(req.acceptsCharsets, + 'req.acceptsCharset: Use acceptsCharsets instead'); + /** * Check if the given `lang`s are acceptable, * otherwise you should respond with 406 "Not Acceptable". @@ -169,10 +176,14 @@ req.acceptsCharsets = function(){ * @public */ -req.acceptsLanguages = function(...languages) { - return accepts(this).languages(...languages); +req.acceptsLanguages = function(){ + var accept = accepts(this); + return accept.languages.apply(accept, arguments); }; +req.acceptsLanguage = deprecate.function(req.acceptsLanguages, + 'req.acceptsLanguage: Use acceptsLanguages instead'); + /** * Parse Range header field, capping to the given `size`. * @@ -205,27 +216,38 @@ req.range = function range(size, options) { }; /** - * Parse the query string of `req.url`. + * Return the value of param `name` when present or `defaultValue`. * - * This uses the "query parser" setting to parse the raw - * string into an object. + * - Checks route placeholders, ex: _/user/:id_ + * - Checks body params, ex: id=12, {"id":12} + * - Checks query string params, ex: ?id=12 * + * To utilize request bodies, `req.body` + * should be an object. This can be done by using + * the `bodyParser()` middleware. + * + * @param {String} name + * @param {Mixed} [defaultValue] * @return {String} - * @api public + * @public */ -defineGetter(req, 'query', function query(){ - var queryparse = this.app.get('query parser fn'); +req.param = function param(name, defaultValue) { + var params = this.params || {}; + var body = this.body || {}; + var query = this.query || {}; - if (!queryparse) { - // parsing is disabled - return Object.create(null); - } + var args = arguments.length === 1 + ? 'name' + : 'name, default'; + deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead'); - var querystring = parse(this).query; + if (null != params[name] && params.hasOwnProperty(name)) return params[name]; + if (null != body[name]) return body[name]; + if (null != query[name]) return query[name]; - return queryparse(querystring); -}); + return defaultValue; +}; /** * Check if the incoming request contains the "Content-Type" @@ -282,12 +304,12 @@ req.is = function is(types) { */ defineGetter(req, 'protocol', function protocol(){ - var proto = this.socket.encrypted + var proto = this.connection.encrypted ? 'https' : 'http'; var trust = this.app.get('trust proxy fn'); - if (!trust(this.socket.remoteAddress, 0)) { + if (!trust(this.connection.remoteAddress, 0)) { return proto; } @@ -392,7 +414,7 @@ defineGetter(req, 'path', function path() { }); /** - * Parse the "Host" header field to a host. + * Parse the "Host" header field to a hostname. * * When the "trust proxy" setting trusts the socket * address, the "X-Forwarded-Host" header field will @@ -402,35 +424,18 @@ defineGetter(req, 'path', function path() { * @public */ -defineGetter(req, 'host', function host(){ +defineGetter(req, 'hostname', function hostname(){ var trust = this.app.get('trust proxy fn'); - var val = this.get('X-Forwarded-Host'); + var host = this.get('X-Forwarded-Host'); - if (!val || !trust(this.socket.remoteAddress, 0)) { - val = this.get('Host'); - } else if (val.indexOf(',') !== -1) { + if (!host || !trust(this.connection.remoteAddress, 0)) { + host = this.get('Host'); + } else if (host.indexOf(',') !== -1) { // Note: X-Forwarded-Host is normally only ever a // single value, but this is to be safe. - val = val.substring(0, val.indexOf(',')).trimRight() + host = host.substring(0, host.indexOf(',')).trimRight() } - return val || undefined; -}); - -/** - * Parse the "Host" header field to a hostname. - * - * When the "trust proxy" setting trusts the socket - * address, the "X-Forwarded-Host" header field will - * be trusted. - * - * @return {String} - * @api public - */ - -defineGetter(req, 'hostname', function hostname(){ - var host = this.host; - if (!host) return; // IPv6 literal support @@ -444,9 +449,15 @@ defineGetter(req, 'hostname', function hostname(){ : host; }); +// TODO: change req.host to return host in next major + +defineGetter(req, 'host', deprecate.function(function host(){ + return this.hostname; +}, 'req.host: Use req.hostname instead')); + /** * Check if the request is fresh, aka - * Last-Modified or the ETag + * Last-Modified and/or the ETag * still match. * * @return {Boolean} diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js index 7a2f0ec..2b654f4 100644 --- a/node_modules/express/lib/response.js +++ b/node_modules/express/lib/response.js @@ -12,17 +12,18 @@ * @private */ +var Buffer = require('safe-buffer').Buffer var contentDisposition = require('content-disposition'); var createError = require('http-errors') var deprecate = require('depd')('express'); var encodeUrl = require('encodeurl'); var escapeHtml = require('escape-html'); -var http = require('node:http'); +var http = require('http'); +var isAbsolute = require('./utils').isAbsolute; var onFinished = require('on-finished'); -var mime = require('mime-types') -var path = require('node:path'); -var pathIsAbsolute = require('node:path').isAbsolute; +var path = require('path'); var statuses = require('statuses') +var merge = require('utils-merge'); var sign = require('cookie-signature').sign; var normalizeType = require('./utils').normalizeType; var normalizeTypes = require('./utils').normalizeTypes; @@ -30,9 +31,9 @@ var setCharset = require('./utils').setCharset; var cookie = require('cookie'); var send = require('send'); var extname = path.extname; +var mime = send.mime; var resolve = path.resolve; var vary = require('vary'); -const { Buffer } = require('node:buffer'); /** * Response prototype. @@ -49,28 +50,24 @@ var res = Object.create(http.ServerResponse.prototype) module.exports = res /** - * Set the HTTP status code for the response. + * Module variables. + * @private + */ + +var charsetRegExp = /;\s*charset\s*=/; + +/** + * Set status `code`. * - * Expects an integer value between 100 and 999 inclusive. - * Throws an error if the provided status code is not an integer or if it's outside the allowable range. - * - * @param {number} code - The HTTP status code to set. - * @return {ServerResponse} - Returns itself for chaining methods. - * @throws {TypeError} If `code` is not an integer. - * @throws {RangeError} If `code` is outside the range 100 to 999. + * @param {Number} code + * @return {ServerResponse} * @public */ res.status = function status(code) { - // Check if the status code is not an integer - if (!Number.isInteger(code)) { - throw new TypeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be an integer.`); + if ((typeof code === 'string' || Math.floor(code) !== code) && code > 99 && code < 1000) { + deprecate('res.status(' + JSON.stringify(code) + '): use res.status(' + Math.floor(code) + ') instead') } - // Check if the status code is outside of Node's valid range - if (code < 100 || code > 999) { - throw new RangeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be greater than 99 and less than 1000.`); - } - this.statusCode = code; return this; }; @@ -82,11 +79,7 @@ res.status = function status(code) { * * res.links({ * next: 'http://api.example.com/users?page=2', - * last: 'http://api.example.com/users?page=5', - * pages: [ - * 'http://api.example.com/users?page=1', - * 'http://api.example.com/users?page=2' - * ] + * last: 'http://api.example.com/users?page=5' * }); * * @param {Object} links @@ -94,18 +87,11 @@ res.status = function status(code) { * @public */ -res.links = function(links) { +res.links = function(links){ var link = this.get('Link') || ''; if (link) link += ', '; - return this.set('Link', link + Object.keys(links).map(function(rel) { - // Allow multiple links if links[rel] is an array - if (Array.isArray(links[rel])) { - return links[rel].map(function (singleLink) { - return `<${singleLink}>; rel="${rel}"`; - }).join(', '); - } else { - return `<${links[rel]}>; rel="${rel}"`; - } + return this.set('Link', link + Object.keys(links).map(function(rel){ + return '<' + links[rel] + '>; rel="' + rel + '"'; }).join(', ')); }; @@ -131,6 +117,31 @@ res.send = function send(body) { // settings var app = this.app; + // allow status / body + if (arguments.length === 2) { + // res.send(body, status) backwards compat + if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') { + deprecate('res.send(body, status): Use res.status(status).send(body) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.send(status, body): Use res.status(status).send(body) instead'); + this.statusCode = arguments[0]; + chunk = arguments[1]; + } + } + + // disambiguate res.send(status) and res.send(status, num) + if (typeof chunk === 'number' && arguments.length === 1) { + // res.send(status) will set status message as text string + if (!this.get('Content-Type')) { + this.type('txt'); + } + + deprecate('res.send(status): Use res.sendStatus(status) instead'); + this.statusCode = chunk; + chunk = statuses.message[chunk] + } + switch (typeof chunk) { // string defaulting to html case 'string': @@ -143,7 +154,7 @@ res.send = function send(body) { case 'object': if (chunk === null) { chunk = ''; - } else if (ArrayBuffer.isView(chunk)) { + } else if (Buffer.isBuffer(chunk)) { if (!this.get('Content-Type')) { this.type('bin'); } @@ -196,7 +207,7 @@ res.send = function send(body) { } // freshness - if (req.fresh) this.status(304); + if (req.fresh) this.statusCode = 304; // strip irrelevant headers if (204 === this.statusCode || 304 === this.statusCode) { @@ -237,12 +248,27 @@ res.send = function send(body) { */ res.json = function json(obj) { + var val = obj; + + // allow status / body + if (arguments.length === 2) { + // res.json(body, status) backwards compat + if (typeof arguments[1] === 'number') { + deprecate('res.json(obj, status): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.json(status, obj): Use res.status(status).json(obj) instead'); + this.statusCode = arguments[0]; + val = arguments[1]; + } + } + // settings var app = this.app; var escape = app.get('json escape') var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); - var body = stringify(obj, replacer, spaces, escape) + var body = stringify(val, replacer, spaces, escape) // content-type if (!this.get('Content-Type')) { @@ -265,12 +291,27 @@ res.json = function json(obj) { */ res.jsonp = function jsonp(obj) { + var val = obj; + + // allow status / body + if (arguments.length === 2) { + // res.jsonp(body, status) backwards compat + if (typeof arguments[1] === 'number') { + deprecate('res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead'); + this.statusCode = arguments[1]; + } else { + deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead'); + this.statusCode = arguments[0]; + val = arguments[1]; + } + } + // settings var app = this.app; var escape = app.get('json escape') var replacer = app.get('json replacer'); var spaces = app.get('json spaces'); - var body = stringify(obj, replacer, spaces, escape) + var body = stringify(val, replacer, spaces, escape) var callback = this.req.query[app.get('jsonp callback name')]; // content-type @@ -328,7 +369,7 @@ res.jsonp = function jsonp(obj) { res.sendStatus = function sendStatus(statusCode) { var body = statuses.message[statusCode] || String(statusCode) - this.status(statusCode); + this.statusCode = statusCode; this.type('txt'); return this.send(body); @@ -396,15 +437,12 @@ res.sendFile = function sendFile(path, options, callback) { opts = {}; } - if (!opts.root && !pathIsAbsolute(path)) { + if (!opts.root && !isAbsolute(path)) { throw new TypeError('path must be absolute or specify root to res.sendFile'); } // create file stream var pathname = encodeURI(path); - - // wire application etag option to send - opts.etag = this.app.enabled('etag'); var file = send(req, pathname, opts); // transfer @@ -419,6 +457,78 @@ res.sendFile = function sendFile(path, options, callback) { }); }; +/** + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `callback(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.headersSent` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendfile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendfile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendfile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @public + */ + +res.sendfile = function (path, options, callback) { + var done = callback; + var req = this.req; + var res = this; + var next = req.next; + var opts = options || {}; + + // support function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // create file stream + var file = send(req, path, opts); + + // transfer + sendfile(res, file, opts, function (err) { + if (done) return done(err); + if (err && err.code === 'EISDIR') return next(); + + // next() all but write errors + if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') { + next(err); + } + }); +}; + +res.sendfile = deprecate.function(res.sendfile, + 'res.sendfile: Use res.sendFile instead'); + /** * Transfer the file at the given `path` as an attachment. * @@ -489,10 +599,8 @@ res.download = function download (path, filename, options, callback) { }; /** - * Set _Content-Type_ response header with `type` through `mime.contentType()` + * Set _Content-Type_ response header with `type` through `mime.lookup()` * when it does not contain "/", or set the Content-Type to `type` otherwise. - * When no mapping is found though `mime.contentType()`, the type is set to - * "application/octet-stream". * * Examples: * @@ -510,7 +618,7 @@ res.download = function download (path, filename, options, callback) { res.contentType = res.type = function contentType(type) { var ct = type.indexOf('/') === -1 - ? (mime.contentType(type) || 'application/octet-stream') + ? mime.lookup(type) : type; return this.set('Content-Type', ct); @@ -659,9 +767,6 @@ res.append = function append(field, val) { * * Aliased as `res.header()`. * - * When the set header is "Content-Type", the type is expanded to include - * the charset if not present using `mime.contentType()`. - * * @param {String|Object} field * @param {String|Array} val * @return {ServerResponse} for chaining @@ -680,7 +785,10 @@ res.header = function header(field, val) { if (Array.isArray(value)) { throw new TypeError('Content-Type cannot be set to an Array'); } - value = mime.contentType(value) + if (!charsetRegExp.test(value)) { + var charset = mime.charsets.lookup(value.split(';')[0]); + if (charset) value += '; charset=' + charset.toLowerCase(); + } } this.setHeader(field, value); @@ -714,10 +822,15 @@ res.get = function(field){ */ res.clearCookie = function clearCookie(name, options) { - // Force cookie expiration by setting expires to the past - const opts = { path: '/', ...options, expires: new Date(1)}; - // ensure maxAge is not passed - delete opts.maxAge + if (options) { + if (options.maxAge) { + deprecate('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'); + } + if (options.expires) { + deprecate('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'); + } + } + var opts = merge({ expires: new Date(1), path: '/' }, options); return this.cookie(name, '', opts); }; @@ -747,7 +860,7 @@ res.clearCookie = function clearCookie(name, options) { */ res.cookie = function (name, value, options) { - var opts = { ...options }; + var opts = merge({}, options); var secret = this.req.secret; var signed = opts.signed; @@ -799,13 +912,27 @@ res.cookie = function (name, value, options) { */ res.location = function location(url) { - return this.set('Location', encodeUrl(url)); + var loc; + + // "back" is an alias for the referrer + if (url === 'back') { + deprecate('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices'); + loc = this.req.get('Referrer') || '/'; + } else { + loc = String(url); + } + + return this.set('Location', encodeUrl(loc)); }; /** * Redirect to the given `url` with optional response `status` * defaulting to 302. * + * The resulting `url` is determined by `res.location()`, so + * it will play nicely with mounted apps, relative paths, + * `"back"` etc. + * * Examples: * * res.redirect('/foo/bar'); @@ -823,20 +950,13 @@ res.redirect = function redirect(url) { // allow status / url if (arguments.length === 2) { - status = arguments[0] - address = arguments[1] - } - - if (!address) { - deprecate('Provide a url argument'); - } - - if (typeof address !== 'string') { - deprecate('Url must be a string'); - } - - if (typeof status !== 'number') { - deprecate('Status must be a number'); + if (typeof arguments[0] === 'number') { + status = arguments[0]; + address = arguments[1]; + } else { + deprecate('res.redirect(url, status): Use res.redirect(status, url) instead'); + status = arguments[1]; + } } // Set location header @@ -859,7 +979,7 @@ res.redirect = function redirect(url) { }); // Respond - this.status(status); + this.statusCode = status; this.set('Content-Length', Buffer.byteLength(body)); if (this.req.method === 'HEAD') { @@ -879,6 +999,12 @@ res.redirect = function redirect(url) { */ res.vary = function(field){ + // checks for back-compat + if (!field || (Array.isArray(field) && !field.length)) { + deprecate('res.vary(): Provide a field name'); + return this; + } + vary(this, field); return this; diff --git a/node_modules/express/lib/router/index.js b/node_modules/express/lib/router/index.js new file mode 100644 index 0000000..abb3a6f --- /dev/null +++ b/node_modules/express/lib/router/index.js @@ -0,0 +1,673 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var Route = require('./route'); +var Layer = require('./layer'); +var methods = require('methods'); +var mixin = require('utils-merge'); +var debug = require('debug')('express:router'); +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var parseUrl = require('parseurl'); +var setPrototypeOf = require('setprototypeof') + +/** + * Module variables. + * @private + */ + +var objectRegExp = /^\[object (\S+)\]$/; +var slice = Array.prototype.slice; +var toString = Object.prototype.toString; + +/** + * Initialize a new `Router` with the given `options`. + * + * @param {Object} [options] + * @return {Router} which is a callable function + * @public + */ + +var proto = module.exports = function(options) { + var opts = options || {}; + + function router(req, res, next) { + router.handle(req, res, next); + } + + // mixin Router class functions + setPrototypeOf(router, proto) + + router.params = {}; + router._params = []; + router.caseSensitive = opts.caseSensitive; + router.mergeParams = opts.mergeParams; + router.strict = opts.strict; + router.stack = []; + + return router; +}; + +/** + * Map the given param placeholder `name`(s) to the given callback. + * + * Parameter mapping is used to provide pre-conditions to routes + * which use normalized placeholders. For example a _:user_id_ parameter + * could automatically load a user's information from the database without + * any additional code, + * + * The callback uses the same signature as middleware, the only difference + * being that the value of the placeholder is passed, in this case the _id_ + * of the user. Once the `next()` function is invoked, just like middleware + * it will continue on to execute the route, or subsequent parameter functions. + * + * Just like in middleware, you must either respond to the request or call next + * to avoid stalling the request. + * + * app.param('user_id', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * return next(err); + * } else if (!user) { + * return next(new Error('failed to load user')); + * } + * req.user = user; + * next(); + * }); + * }); + * + * @param {String} name + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +proto.param = function param(name, fn) { + // param logic + if (typeof name === 'function') { + deprecate('router.param(fn): Refactor to use path params'); + this._params.push(name); + return; + } + + // apply param functions + var params = this._params; + var len = params.length; + var ret; + + if (name[0] === ':') { + deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.slice(1)) + ', fn) instead') + name = name.slice(1) + } + + for (var i = 0; i < len; ++i) { + if (ret = params[i](name, fn)) { + fn = ret; + } + } + + // ensure we end up with a + // middleware function + if ('function' !== typeof fn) { + throw new Error('invalid param() call for ' + name + ', got ' + fn); + } + + (this.params[name] = this.params[name] || []).push(fn); + return this; +}; + +/** + * Dispatch a req, res into the router. + * @private + */ + +proto.handle = function handle(req, res, out) { + var self = this; + + debug('dispatching %s %s', req.method, req.url); + + var idx = 0; + var protohost = getProtohost(req.url) || '' + var removed = ''; + var slashAdded = false; + var sync = 0 + var paramcalled = {}; + + // store options for OPTIONS request + // only used if OPTIONS request + var options = []; + + // middleware and routes + var stack = self.stack; + + // manage inter-router variables + var parentParams = req.params; + var parentUrl = req.baseUrl || ''; + var done = restore(out, req, 'baseUrl', 'next', 'params'); + + // setup next layer + req.next = next; + + // for options requests, respond with a default if nothing else responds + if (req.method === 'OPTIONS') { + done = wrap(done, function(old, err) { + if (err || options.length === 0) return old(err); + sendOptionsResponse(res, options, old); + }); + } + + // setup basic req values + req.baseUrl = parentUrl; + req.originalUrl = req.originalUrl || req.url; + + next(); + + function next(err) { + var layerError = err === 'route' + ? null + : err; + + // remove added slash + if (slashAdded) { + req.url = req.url.slice(1) + slashAdded = false; + } + + // restore altered req.url + if (removed.length !== 0) { + req.baseUrl = parentUrl; + req.url = protohost + removed + req.url.slice(protohost.length) + removed = ''; + } + + // signal to exit router + if (layerError === 'router') { + setImmediate(done, null) + return + } + + // no more matching layers + if (idx >= stack.length) { + setImmediate(done, layerError); + return; + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + // get pathname of request + var path = getPathname(req); + + if (path == null) { + return done(layerError); + } + + // find next matching layer + var layer; + var match; + var route; + + while (match !== true && idx < stack.length) { + layer = stack[idx++]; + match = matchLayer(layer, path); + route = layer.route; + + if (typeof match !== 'boolean') { + // hold on to layerError + layerError = layerError || match; + } + + if (match !== true) { + continue; + } + + if (!route) { + // process non-route handlers normally + continue; + } + + if (layerError) { + // routes do not match with a pending error + match = false; + continue; + } + + var method = req.method; + var has_method = route._handles_method(method); + + // build up automatic options response + if (!has_method && method === 'OPTIONS') { + appendMethods(options, route._options()); + } + + // don't even bother matching route + if (!has_method && method !== 'HEAD') { + match = false; + } + } + + // no match + if (match !== true) { + return done(layerError); + } + + // store route for dispatch on change + if (route) { + req.route = route; + } + + // Capture one-time layer values + req.params = self.mergeParams + ? mergeParams(layer.params, parentParams) + : layer.params; + var layerPath = layer.path; + + // this should be done for the layer + self.process_params(layer, paramcalled, req, res, function (err) { + if (err) { + next(layerError || err) + } else if (route) { + layer.handle_request(req, res, next) + } else { + trim_prefix(layer, layerError, layerPath, path) + } + + sync = 0 + }); + } + + function trim_prefix(layer, layerError, layerPath, path) { + if (layerPath.length !== 0) { + // Validate path is a prefix match + if (layerPath !== path.slice(0, layerPath.length)) { + next(layerError) + return + } + + // Validate path breaks on a path separator + var c = path[layerPath.length] + if (c && c !== '/' && c !== '.') return next(layerError) + + // Trim off the part of the url that matches the route + // middleware (.use stuff) needs to have the path stripped + debug('trim prefix (%s) from url %s', layerPath, req.url); + removed = layerPath; + req.url = protohost + req.url.slice(protohost.length + removed.length) + + // Ensure leading slash + if (!protohost && req.url[0] !== '/') { + req.url = '/' + req.url; + slashAdded = true; + } + + // Setup base URL (no trailing slash) + req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' + ? removed.substring(0, removed.length - 1) + : removed); + } + + debug('%s %s : %s', layer.name, layerPath, req.originalUrl); + + if (layerError) { + layer.handle_error(layerError, req, res, next); + } else { + layer.handle_request(req, res, next); + } + } +}; + +/** + * Process any parameters for the layer. + * @private + */ + +proto.process_params = function process_params(layer, called, req, res, done) { + var params = this.params; + + // captured parameters from the layer, keys and values + var keys = layer.keys; + + // fast track + if (!keys || keys.length === 0) { + return done(); + } + + var i = 0; + var name; + var paramIndex = 0; + var key; + var paramVal; + var paramCallbacks; + var paramCalled; + + // process params in order + // param callbacks can be async + function param(err) { + if (err) { + return done(err); + } + + if (i >= keys.length ) { + return done(); + } + + paramIndex = 0; + key = keys[i++]; + name = key.name; + paramVal = req.params[name]; + paramCallbacks = params[name]; + paramCalled = called[name]; + + if (paramVal === undefined || !paramCallbacks) { + return param(); + } + + // param previously called with same value or error occurred + if (paramCalled && (paramCalled.match === paramVal + || (paramCalled.error && paramCalled.error !== 'route'))) { + // restore value + req.params[name] = paramCalled.value; + + // next param + return param(paramCalled.error); + } + + called[name] = paramCalled = { + error: null, + match: paramVal, + value: paramVal + }; + + paramCallback(); + } + + // single param callbacks + function paramCallback(err) { + var fn = paramCallbacks[paramIndex++]; + + // store updated value + paramCalled.value = req.params[key.name]; + + if (err) { + // store error + paramCalled.error = err; + param(err); + return; + } + + if (!fn) return param(); + + try { + fn(req, res, paramCallback, paramVal, key.name); + } catch (e) { + paramCallback(e); + } + } + + param(); +}; + +/** + * Use the given middleware function, with optional path, defaulting to "/". + * + * Use (like `.all`) will run for any http METHOD, but it will not add + * handlers for those methods so OPTIONS requests will not consider `.use` + * functions even if they could respond. + * + * The other difference is that _route_ path is stripped and not visible + * to the handler function. The main effect of this feature is that mounted + * handlers can operate without any code changes regardless of the "prefix" + * pathname. + * + * @public + */ + +proto.use = function use(fn) { + var offset = 0; + var path = '/'; + + // default path to '/' + // disambiguate router.use([fn]) + if (typeof fn !== 'function') { + var arg = fn; + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1; + path = fn; + } + } + + var callbacks = flatten(slice.call(arguments, offset)); + + if (callbacks.length === 0) { + throw new TypeError('Router.use() requires a middleware function') + } + + for (var i = 0; i < callbacks.length; i++) { + var fn = callbacks[i]; + + if (typeof fn !== 'function') { + throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) + } + + // add the middleware + debug('use %o %s', path, fn.name || '') + + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: false, + end: false + }, fn); + + layer.route = undefined; + + this.stack.push(layer); + } + + return this; +}; + +/** + * Create a new Route for the given path. + * + * Each route contains a separate middleware stack and VERB handlers. + * + * See the Route api documentation for details on adding handlers + * and middleware to routes. + * + * @param {String} path + * @return {Route} + * @public + */ + +proto.route = function route(path) { + var route = new Route(path); + + var layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: this.strict, + end: true + }, route.dispatch.bind(route)); + + layer.route = route; + + this.stack.push(layer); + return route; +}; + +// create Router#VERB functions +methods.concat('all').forEach(function(method){ + proto[method] = function(path){ + var route = this.route(path) + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; +}); + +// append methods to a list of methods +function appendMethods(list, addition) { + for (var i = 0; i < addition.length; i++) { + var method = addition[i]; + if (list.indexOf(method) === -1) { + list.push(method); + } + } +} + +// get pathname of request +function getPathname(req) { + try { + return parseUrl(req).pathname; + } catch (err) { + return undefined; + } +} + +// Get get protocol + host for a URL +function getProtohost(url) { + if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { + return undefined + } + + var searchIndex = url.indexOf('?') + var pathLength = searchIndex !== -1 + ? searchIndex + : url.length + var fqdnIndex = url.slice(0, pathLength).indexOf('://') + + return fqdnIndex !== -1 + ? url.substring(0, url.indexOf('/', 3 + fqdnIndex)) + : undefined +} + +// get type for error message +function gettype(obj) { + var type = typeof obj; + + if (type !== 'object') { + return type; + } + + // inspect [[Class]] for objects + return toString.call(obj) + .replace(objectRegExp, '$1'); +} + +/** + * Match path to a layer. + * + * @param {Layer} layer + * @param {string} path + * @private + */ + +function matchLayer(layer, path) { + try { + return layer.match(path); + } catch (err) { + return err; + } +} + +// merge params with parent params +function mergeParams(params, parent) { + if (typeof parent !== 'object' || !parent) { + return params; + } + + // make copy of parent for base + var obj = mixin({}, parent); + + // simple non-numeric merging + if (!(0 in params) || !(0 in parent)) { + return mixin(obj, params); + } + + var i = 0; + var o = 0; + + // determine numeric gaps + while (i in params) { + i++; + } + + while (o in parent) { + o++; + } + + // offset numeric indices in params before merge + for (i--; i >= 0; i--) { + params[i + o] = params[i]; + + // create holes for the merge when necessary + if (i < o) { + delete params[i]; + } + } + + return mixin(obj, params); +} + +// restore obj props after function +function restore(fn, obj) { + var props = new Array(arguments.length - 2); + var vals = new Array(arguments.length - 2); + + for (var i = 0; i < props.length; i++) { + props[i] = arguments[i + 2]; + vals[i] = obj[props[i]]; + } + + return function () { + // restore vals + for (var i = 0; i < props.length; i++) { + obj[props[i]] = vals[i]; + } + + return fn.apply(this, arguments); + }; +} + +// send an OPTIONS response +function sendOptionsResponse(res, options, next) { + try { + var body = options.join(','); + res.set('Allow', body); + res.send(body); + } catch (err) { + next(err); + } +} + +// wrap a function +function wrap(old, fn) { + return function proxy() { + var args = new Array(arguments.length + 1); + + args[0] = old; + for (var i = 0, len = arguments.length; i < len; i++) { + args[i + 1] = arguments[i]; + } + + fn.apply(this, args); + }; +} diff --git a/node_modules/express/lib/router/layer.js b/node_modules/express/lib/router/layer.js new file mode 100644 index 0000000..4dc8e86 --- /dev/null +++ b/node_modules/express/lib/router/layer.js @@ -0,0 +1,181 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var pathRegexp = require('path-to-regexp'); +var debug = require('debug')('express:router:layer'); + +/** + * Module variables. + * @private + */ + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * Module exports. + * @public + */ + +module.exports = Layer; + +function Layer(path, options, fn) { + if (!(this instanceof Layer)) { + return new Layer(path, options, fn); + } + + debug('new %o', path) + var opts = options || {}; + + this.handle = fn; + this.name = fn.name || ''; + this.params = undefined; + this.path = undefined; + this.regexp = pathRegexp(path, this.keys = [], opts); + + // set fast path flags + this.regexp.fast_star = path === '*' + this.regexp.fast_slash = path === '/' && opts.end === false +} + +/** + * Handle the error for the layer. + * + * @param {Error} error + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handle_error = function handle_error(error, req, res, next) { + var fn = this.handle; + + if (fn.length !== 4) { + // not a standard error handler + return next(error); + } + + try { + fn(error, req, res, next); + } catch (err) { + next(err); + } +}; + +/** + * Handle the request for the layer. + * + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handle_request = function handle(req, res, next) { + var fn = this.handle; + + if (fn.length > 3) { + // not a standard request handler + return next(); + } + + try { + fn(req, res, next); + } catch (err) { + next(err); + } +}; + +/** + * Check if this route matches `path`, if so + * populate `.params`. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +Layer.prototype.match = function match(path) { + var match + + if (path != null) { + // fast path non-ending match for / (any path matches) + if (this.regexp.fast_slash) { + this.params = {} + this.path = '' + return true + } + + // fast path for * (everything matched in a param) + if (this.regexp.fast_star) { + this.params = {'0': decode_param(path)} + this.path = path + return true + } + + // match the path + match = this.regexp.exec(path) + } + + if (!match) { + this.params = undefined; + this.path = undefined; + return false; + } + + // store values + this.params = {}; + this.path = match[0] + + var keys = this.keys; + var params = this.params; + + for (var i = 1; i < match.length; i++) { + var key = keys[i - 1]; + var prop = key.name; + var val = decode_param(match[i]) + + if (val !== undefined || !(hasOwnProperty.call(params, prop))) { + params[prop] = val; + } + } + + return true; +}; + +/** + * Decode param value. + * + * @param {string} val + * @return {string} + * @private + */ + +function decode_param(val) { + if (typeof val !== 'string' || val.length === 0) { + return val; + } + + try { + return decodeURIComponent(val); + } catch (err) { + if (err instanceof URIError) { + err.message = 'Failed to decode param \'' + val + '\''; + err.status = err.statusCode = 400; + } + + throw err; + } +} diff --git a/node_modules/express/lib/router/route.js b/node_modules/express/lib/router/route.js new file mode 100644 index 0000000..a65756d --- /dev/null +++ b/node_modules/express/lib/router/route.js @@ -0,0 +1,230 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('express:router:route'); +var flatten = require('array-flatten'); +var Layer = require('./layer'); +var methods = require('methods'); + +/** + * Module variables. + * @private + */ + +var slice = Array.prototype.slice; +var toString = Object.prototype.toString; + +/** + * Module exports. + * @public + */ + +module.exports = Route; + +/** + * Initialize `Route` with the given `path`, + * + * @param {String} path + * @public + */ + +function Route(path) { + this.path = path; + this.stack = []; + + debug('new %o', path) + + // route handlers for various http methods + this.methods = {}; +} + +/** + * Determine if the route handles a given method. + * @private + */ + +Route.prototype._handles_method = function _handles_method(method) { + if (this.methods._all) { + return true; + } + + // normalize name + var name = typeof method === 'string' + ? method.toLowerCase() + : method + + if (name === 'head' && !this.methods['head']) { + name = 'get'; + } + + return Boolean(this.methods[name]); +}; + +/** + * @return {Array} supported HTTP methods + * @private + */ + +Route.prototype._options = function _options() { + var methods = Object.keys(this.methods); + + // append automatic head + if (this.methods.get && !this.methods.head) { + methods.push('head'); + } + + for (var i = 0; i < methods.length; i++) { + // make upper case + methods[i] = methods[i].toUpperCase(); + } + + return methods; +}; + +/** + * dispatch req, res into this route + * @private + */ + +Route.prototype.dispatch = function dispatch(req, res, done) { + var idx = 0; + var stack = this.stack; + var sync = 0 + + if (stack.length === 0) { + return done(); + } + var method = typeof req.method === 'string' + ? req.method.toLowerCase() + : req.method + + if (method === 'head' && !this.methods['head']) { + method = 'get'; + } + + req.route = this; + + next(); + + function next(err) { + // signal to exit route + if (err && err === 'route') { + return done(); + } + + // signal to exit router + if (err && err === 'router') { + return done(err) + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + var layer = stack[idx++] + + // end of layers + if (!layer) { + return done(err) + } + + if (layer.method && layer.method !== method) { + next(err) + } else if (err) { + layer.handle_error(err, req, res, next); + } else { + layer.handle_request(req, res, next); + } + + sync = 0 + } +}; + +/** + * Add a handler for all HTTP verbs to this route. + * + * Behaves just like middleware and can respond or call `next` + * to continue processing. + * + * You can use multiple `.all` call to add multiple handlers. + * + * function check_something(req, res, next){ + * next(); + * }; + * + * function validate_user(req, res, next){ + * next(); + * }; + * + * route + * .all(validate_user) + * .all(check_something) + * .get(function(req, res, next){ + * res.send('hello world'); + * }); + * + * @param {function} handler + * @return {Route} for chaining + * @api public + */ + +Route.prototype.all = function all() { + var handles = flatten(slice.call(arguments)); + + for (var i = 0; i < handles.length; i++) { + var handle = handles[i]; + + if (typeof handle !== 'function') { + var type = toString.call(handle); + var msg = 'Route.all() requires a callback function but got a ' + type + throw new TypeError(msg); + } + + var layer = Layer('/', {}, handle); + layer.method = undefined; + + this.methods._all = true; + this.stack.push(layer); + } + + return this; +}; + +methods.forEach(function(method){ + Route.prototype[method] = function(){ + var handles = flatten(slice.call(arguments)); + + for (var i = 0; i < handles.length; i++) { + var handle = handles[i]; + + if (typeof handle !== 'function') { + var type = toString.call(handle); + var msg = 'Route.' + method + '() requires a callback function but got a ' + type + throw new Error(msg); + } + + debug('%s %o', method, this.path) + + var layer = Layer('/', {}, handle); + layer.method = method; + + this.methods[method] = true; + this.stack.push(layer); + } + + return this; + }; +}); diff --git a/node_modules/express/lib/utils.js b/node_modules/express/lib/utils.js index 4f21e7e..56e12b9 100644 --- a/node_modules/express/lib/utils.js +++ b/node_modules/express/lib/utils.js @@ -12,21 +12,16 @@ * @api private */ -var { METHODS } = require('node:http'); +var Buffer = require('safe-buffer').Buffer +var contentDisposition = require('content-disposition'); var contentType = require('content-type'); +var deprecate = require('depd')('express'); +var flatten = require('array-flatten'); +var mime = require('send').mime; var etag = require('etag'); -var mime = require('mime-types') var proxyaddr = require('proxy-addr'); var qs = require('qs'); -var querystring = require('node:querystring'); -const { Buffer } = require('node:buffer'); - - -/** - * A list of lowercased HTTP methods that are supported by Node.js. - * @api private - */ -exports.methods = METHODS.map((method) => method.toLowerCase()); +var querystring = require('querystring'); /** * Return strong ETag for `body`. @@ -50,6 +45,31 @@ exports.etag = createETagGenerator({ weak: false }) exports.wetag = createETagGenerator({ weak: true }) +/** + * Check if `path` looks absolute. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +exports.isAbsolute = function(path){ + if ('/' === path[0]) return true; + if (':' === path[1] && ('\\' === path[2] || '/' === path[2])) return true; // Windows device path + if ('\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path +}; + +/** + * Flatten the given `arr`. + * + * @param {Array} arr + * @return {Array} + * @api private + */ + +exports.flatten = deprecate.function(flatten, + 'utils.flatten: use array-flatten npm module instead'); + /** * Normalize the given `type`, for example "html" becomes "text/html". * @@ -61,7 +81,7 @@ exports.wetag = createETagGenerator({ weak: true }) exports.normalizeType = function(type){ return ~type.indexOf('/') ? acceptParams(type) - : { value: (mime.lookup(type) || 'application/octet-stream'), params: {} } + : { value: mime.lookup(type), params: {} }; }; /** @@ -72,10 +92,27 @@ exports.normalizeType = function(type){ * @api private */ -exports.normalizeTypes = function(types) { - return types.map(exports.normalizeType); +exports.normalizeTypes = function(types){ + var ret = []; + + for (var i = 0; i < types.length; ++i) { + ret.push(exports.normalizeType(types[i])); + } + + return ret; }; +/** + * Generate Content-Disposition header appropriate for the filename. + * non-ascii filenames are urlencoded and a filename* parameter is added + * + * @param {String} filename + * @return {String} + * @api private + */ + +exports.contentDisposition = deprecate.function(contentDisposition, + 'utils.contentDisposition: use content-disposition npm module instead'); /** * Parse accept params `str` returning an @@ -87,33 +124,16 @@ exports.normalizeTypes = function(types) { */ function acceptParams (str) { - var length = str.length; - var colonIndex = str.indexOf(';'); - var index = colonIndex === -1 ? length : colonIndex; - var ret = { value: str.slice(0, index).trim(), quality: 1, params: {} }; + var parts = str.split(/ *; */); + var ret = { value: parts[0], quality: 1, params: {} } - while (index < length) { - var splitIndex = str.indexOf('=', index); - if (splitIndex === -1) break; - - var colonIndex = str.indexOf(';', index); - var endIndex = colonIndex === -1 ? length : colonIndex; - - if (splitIndex > endIndex) { - index = str.lastIndexOf(';', splitIndex - 1) + 1; - continue; - } - - var key = str.slice(index, splitIndex).trim(); - var value = str.slice(splitIndex + 1, endIndex).trim(); - - if (key === 'q') { - ret.quality = parseFloat(value); + for (var i = 1; i < parts.length; ++i) { + var pms = parts[i].split(/ *= */); + if ('q' === pms[0]) { + ret.quality = parseFloat(pms[1]); } else { - ret.params[key] = value; + ret.params[pms[0]] = pms[1]; } - - index = endIndex + 1; } return ret; @@ -172,6 +192,7 @@ exports.compileQueryParser = function compileQueryParser(val) { fn = querystring.parse; break; case false: + fn = newObject; break; case 'extended': fn = parseExtendedQueryString; @@ -269,3 +290,14 @@ function parseExtendedQueryString(str) { allowPrototypes: true }); } + +/** + * Return new empty object. + * + * @return {Object} + * @api private + */ + +function newObject() { + return {}; +} diff --git a/node_modules/express/lib/view.js b/node_modules/express/lib/view.js index d66b4a2..c08ab4d 100644 --- a/node_modules/express/lib/view.js +++ b/node_modules/express/lib/view.js @@ -14,8 +14,8 @@ */ var debug = require('debug')('express:view'); -var path = require('node:path'); -var fs = require('node:fs'); +var path = require('path'); +var fs = require('fs'); /** * Module variables. @@ -131,31 +131,8 @@ View.prototype.lookup = function lookup(name) { */ View.prototype.render = function render(options, callback) { - var sync = true; - debug('render "%s"', this.path); - - // render, normalizing sync callbacks - this.engine(this.path, options, function onRender() { - if (!sync) { - return callback.apply(this, arguments); - } - - // copy arguments - var args = new Array(arguments.length); - var cntx = this; - - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - // force callback to be async - return process.nextTick(function renderTick() { - return callback.apply(cntx, args); - }); - }); - - sync = false; + this.engine(this.path, options, callback); }; /** diff --git a/node_modules/express/package.json b/node_modules/express/package.json index 8f35883..4322f1a 100644 --- a/node_modules/express/package.json +++ b/node_modules/express/package.json @@ -1,7 +1,7 @@ { "name": "express", "description": "Fast, unopinionated, minimalist web framework", - "version": "5.2.1", + "version": "4.22.1", "author": "TJ Holowaychuk ", "contributors": [ "Aaron Heckmann ", @@ -14,7 +14,7 @@ ], "license": "MIT", "repository": "expressjs/express", - "homepage": "https://expressjs.com/", + "homepage": "http://expressjs.com/", "funding": { "type": "opencollective", "url": "https://opencollective.com/express" @@ -32,66 +32,69 @@ "api" ], "dependencies": { - "accepts": "^2.0.0", - "body-parser": "^2.2.1", - "content-disposition": "^1.0.0", - "content-type": "^1.0.5", - "cookie": "^0.7.1", - "cookie-signature": "^1.2.1", - "debug": "^4.4.0", - "depd": "^2.0.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "finalhandler": "^2.1.0", - "fresh": "^2.0.0", - "http-errors": "^2.0.0", - "merge-descriptors": "^2.0.0", - "mime-types": "^3.0.0", - "on-finished": "^2.4.1", - "once": "^1.4.0", - "parseurl": "^1.3.3", - "proxy-addr": "^2.0.7", - "qs": "^6.14.0", - "range-parser": "^1.2.1", - "router": "^2.2.0", - "send": "^1.1.0", - "serve-static": "^2.2.0", - "statuses": "^2.0.1", - "type-is": "^2.0.1", - "vary": "^1.1.2" + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.14.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" }, "devDependencies": { "after": "0.8.2", - "connect-redis": "^8.0.1", - "cookie-parser": "1.4.7", - "cookie-session": "2.1.1", - "ejs": "^3.1.10", + "connect-redis": "3.4.2", + "cookie-parser": "1.4.6", + "cookie-session": "2.0.0", + "ejs": "3.1.9", "eslint": "8.47.0", - "express-session": "^1.18.1", + "express-session": "1.17.2", "hbs": "4.2.0", - "marked": "^15.0.3", + "marked": "0.7.0", "method-override": "3.0.0", - "mocha": "^10.7.3", - "morgan": "1.10.1", - "nyc": "^17.1.0", + "mocha": "^6.2.2", + "morgan": "1.10.0", + "nyc": "^14.1.1", "pbkdf2-password": "1.2.1", - "supertest": "^6.3.0", + "supertest": "^6.1.6", "vhost": "~3.0.2" }, "engines": { - "node": ">= 18" + "node": ">= 0.10.0" }, "files": [ "LICENSE", + "History.md", "Readme.md", "index.js", "lib/" ], "scripts": { "lint": "eslint .", - "lint:fix": "eslint . --fix", - "test": "mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", + "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/", "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test", "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md index 8b011be..77ce54d 100644 --- a/node_modules/finalhandler/HISTORY.md +++ b/node_modules/finalhandler/HISTORY.md @@ -1,31 +1,8 @@ -v2.1.1. / 2025-12-01 +v1.3.2 / 2025-12-01 ================== -* update engines field in the package.json to reflect the current compatibility (Node <18). See: 2.0.0 -* Minor changes (package metadata) - -v2.1.0 / 2025-03-05 -================== - - * deps: - * use caret notation for dependency versions - * encodeurl@^2.0.0 - * debug@^4.4.0 - * remove `ServerResponse.headersSent` support check - * remove setImmediate support check - * update test dependencies - * remove unnecessary devDependency `safe-buffer` - * remove `unpipe` package and use native `unpipe()` method - * remove unnecessary devDependency `readable-stream` - * refactor: use object spread to copy error headers - * refactor: use replaceAll instead of replace with a regex - * refactor: replace setHeaders function with optimized inline header setting - -v2.0.0 / 2024-09-02 -================== - - * drop support for node <18 - * ignore status message for HTTP/2 (#53) + * deps: use tilde notation for dependencies + * deps: statuses@~2.0.2 v1.3.1 / 2024-09-11 ================== diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md index e40f729..6244a13 100644 --- a/node_modules/finalhandler/README.md +++ b/node_modules/finalhandler/README.md @@ -5,7 +5,6 @@ [![Node.js Version][node-image]][node-url] [![Build Status][github-actions-ci-image]][github-actions-ci-url] [![Test Coverage][coveralls-image]][coveralls-url] -[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] Node.js function to invoke as the final step to respond to HTTP request. @@ -22,7 +21,7 @@ $ npm install finalhandler ## API ```js -const finalhandler = require('finalhandler') +var finalhandler = require('finalhandler') ``` ### finalhandler(req, res, [options]) @@ -60,11 +59,11 @@ as `onerror(err, req, res)`. ### always 404 ```js -const finalhandler = require('finalhandler') -const http = require('http') +var finalhandler = require('finalhandler') +var http = require('http') -const server = http.createServer((req, res) => { - const done = finalhandler(req, res) +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) done() }) @@ -74,14 +73,14 @@ server.listen(3000) ### perform simple action ```js -const finalhandler = require('finalhandler') -const fs = require('fs') -const http = require('http') +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') -const server = http.createServer((req, res) => { - const done = finalhandler(req, res) +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) - fs.readFile('index.html', (err, buf) => { + fs.readFile('index.html', function (err, buf) { if (err) return done(err) res.setHeader('Content-Type', 'text/html') res.end(buf) @@ -94,14 +93,14 @@ server.listen(3000) ### use with middleware-style functions ```js -const finalhandler = require('finalhandler') -const http = require('http') -const serveStatic = require('serve-static') +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') -const serve = serveStatic('public') +var serve = serveStatic('public') -const server = http.createServer((req, res) => { - const done = finalhandler(req, res) +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) serve(req, res, done) }) @@ -111,14 +110,14 @@ server.listen(3000) ### keep log of all errors ```js -const finalhandler = require('finalhandler') -const fs = require('fs') -const http = require('http') +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') -const server = http.createServer((req, res) => { - const done = finalhandler(req, res, { onerror: logerror }) +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res, { onerror: logerror }) - fs.readFile('index.html', (err, buf) => { + fs.readFile('index.html', function (err, buf) { if (err) return done(err) res.setHeader('Content-Type', 'text/html') res.end(buf) @@ -146,5 +145,3 @@ function logerror (err) { [downloads-url]: https://npmjs.org/package/finalhandler [github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg [github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml -[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/pillarjs/finalhandler/badge -[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/pillarjs/finalhandler \ No newline at end of file diff --git a/node_modules/finalhandler/SECURITY.md b/node_modules/finalhandler/SECURITY.md new file mode 100644 index 0000000..6e23249 --- /dev/null +++ b/node_modules/finalhandler/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `finalhandler` team and community take all security bugs seriously. Thank +you for improving the security of Express. We appreciate your efforts and +responsible disclosure and will make every effort to acknowledge your +contributions. + +Report security bugs by emailing the current owner(s) of `finalhandler`. This +information can be found in the npm registry using the command +`npm owner ls finalhandler`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/pillarjs/finalhandler/issues) +asking for the current contact information. + +To ensure the timely response to your report, please ensure that the entirety +of the report is contained within the email body and not solely behind a web +link or an attachment. + +At least one owner will acknowledge your email within 48 hours, and will send a +more detailed response within 48 hours indicating the next steps in handling +your report. After the initial reply to your report, the owners will +endeavor to keep you informed of the progress towards a fix and full +announcement, and may ask for additional information or guidance. diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js index bf15e48..ec34be9 100644 --- a/node_modules/finalhandler/index.js +++ b/node_modules/finalhandler/index.js @@ -17,12 +17,20 @@ var escapeHtml = require('escape-html') var onFinished = require('on-finished') var parseUrl = require('parseurl') var statuses = require('statuses') +var unpipe = require('unpipe') /** * Module variables. * @private */ +var DOUBLE_SPACE_REGEXP = /\x20{2}/g +var NEWLINE_REGEXP = /\n/g + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } var isFinished = onFinished.isFinished /** @@ -34,8 +42,8 @@ var isFinished = onFinished.isFinished function createHtmlDocument (message) { var body = escapeHtml(message) - .replaceAll('\n', '
') - .replaceAll(' ', '  ') + .replace(NEWLINE_REGEXP, '
') + .replace(DOUBLE_SPACE_REGEXP, '  ') return '\n' + '\n' + @@ -81,7 +89,7 @@ function finalhandler (req, res, options) { var status // ignore 404 on in-flight response - if (!err && res.headersSent) { + if (!err && headersSent(res)) { debug('cannot 404 after headers sent') return } @@ -111,11 +119,11 @@ function finalhandler (req, res, options) { // schedule onerror callback if (err && onerror) { - setImmediate(onerror, err, req, res) + defer(onerror, err, req, res) } // cannot actually respond - if (res.headersSent) { + if (headersSent(res)) { debug('cannot %d after headers sent', status) if (req.socket) { req.socket.destroy() @@ -141,7 +149,15 @@ function getErrorHeaders (err) { return undefined } - return { ...err.headers } + var headers = Object.create(null) + var keys = Object.keys(err.headers) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + headers[key] = err.headers[key] + } + + return headers } /** @@ -230,6 +246,20 @@ function getResponseStatusCode (res) { return status } +/** + * Determine if the response headers have been sent. + * + * @param {object} res + * @returns {boolean} + * @private + */ + +function headersSent (res) { + return typeof res.headersSent !== 'boolean' + ? Boolean(res._header) + : res.headersSent +} + /** * Send response. * @@ -259,9 +289,7 @@ function send (req, res, status, headers, message) { res.removeHeader('Content-Range') // response headers - for (const [key, value] of Object.entries(headers ?? {})) { - res.setHeader(key, value) - } + setHeaders(res, headers) // security headers res.setHeader('Content-Security-Policy', "default-src 'none'") @@ -285,9 +313,29 @@ function send (req, res, status, headers, message) { } // unpipe everything from the request - req.unpipe() + unpipe(req) // flush the request onFinished(req, write) req.resume() } + +/** + * Set response headers from an object. + * + * @param {OutgoingMessage} res + * @param {object} headers + * @private + */ + +function setHeaders (res, headers) { + if (!headers) { + return + } + + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + res.setHeader(key, headers[key]) + } +} diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json index 869ddc2..ce618dc 100644 --- a/node_modules/finalhandler/package.json +++ b/node_modules/finalhandler/package.json @@ -1,41 +1,41 @@ { "name": "finalhandler", "description": "Node.js final http responder", - "version": "2.1.1", + "version": "1.3.2", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "pillarjs/finalhandler", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, "dependencies": { - "debug": "^4.4.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "on-finished": "^2.4.1", - "parseurl": "^1.3.3", - "statuses": "^2.0.1" + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" }, "devDependencies": { - "eslint": "^7.32.0", - "eslint-config-standard": "^14.1.1", - "eslint-plugin-import": "^2.31.0", - "eslint-plugin-markdown": "^2.2.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.2.0", - "eslint-plugin-standard": "^4.1.0", - "mocha": "^11.0.1", - "nyc": "^17.1.0", - "supertest": "^7.0.0" + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.26.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.0.0", + "nyc": "15.1.0", + "readable-stream": "2.3.6", + "safe-buffer": "5.2.1", + "supertest": "6.2.4" }, "files": [ "LICENSE", "HISTORY.md", + "SECURITY.md", "index.js" ], "engines": { - "node": ">= 18.0.0" + "node": ">= 0.8" }, "scripts": { "lint": "eslint .", diff --git a/node_modules/fraction.js/CHANGELOG.md b/node_modules/fraction.js/CHANGELOG.md deleted file mode 100644 index ec492a7..0000000 --- a/node_modules/fraction.js/CHANGELOG.md +++ /dev/null @@ -1,38 +0,0 @@ -# CHANGELOG - -v5.2.2 - - Improved documentation and removed unecessary check - -v5.2.1: - - 2bb7b05: Added negative sign check - -v5.2: - - 6f9d124: Implemented log and improved simplify - - b773e7a: Added named export to TS definition - - 70304f9: Fixed merge conflict - - 3b940d3: Implemented other comparing functions - - 10acdfc: Update README.md - - ba41d00: Update README.md - - 73ded97: Update README.md - - acabc39: Fixed param parsing - -v5.0.5: - - 2c9d4c2: Improved roundTo() and param parser - -v5.0.4: - - 39e61e7: Fixed bignum param passing - -v5.0.3: - - 7d9a3ec: Upgraded bundler for code quality - -v5.0.2: - - c64b1d6: fixed esm export - -v5.0.1: - - e440f9c: Fixed CJS export - - 9bbdd29: Fixed CJS export - -v5.0.0: - - ac7cd06: Fixed readme - - 33cc9e5: Added crude build - - 1adcc76: Release breaking v5.0. Fraction.js now builds on BigInt. The API stays the same as v4, except that the object attributes `n`, `d`, and `s`, are not Number but BigInt and may break code that directly accesses these attributes. \ No newline at end of file diff --git a/node_modules/fraction.js/LICENSE b/node_modules/fraction.js/LICENSE deleted file mode 100644 index 8741015..0000000 --- a/node_modules/fraction.js/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 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/node_modules/fraction.js/README.md b/node_modules/fraction.js/README.md deleted file mode 100644 index e53343e..0000000 --- a/node_modules/fraction.js/README.md +++ /dev/null @@ -1,520 +0,0 @@ -# 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) - -Do you find the limitations of floating-point arithmetic frustrating, especially when rational and irrational numbers like π or √2 are stored within the same finite precision? This can lead to avoidable inaccuracies such as: - -```javascript -1 / 98 * 98 // Results in 0.9999999999999999 -``` - -For applications requiring higher precision or where working with fractions is preferable, consider incorporating *Fraction.js* into your project. - -The library effectively addresses precision issues, as demonstrated below: - -```javascript -Fraction(1).div(98).mul(98) // Returns 1 -``` - -*Fraction.js* uses a `BigInt` representation for both the numerator and denominator, ensuring minimal performance overhead while maximizing accuracy. Its design is optimized for precision, making it an ideal choice as a foundational library for other math tools, such as [Polynomial.js](https://github.com/rawify/Polynomial.js) and [Math.js](https://github.com/josdejong/mathjs). - -## Convert Decimal to Fraction - -One of the core features of *Fraction.js* is its ability to seamlessly convert decimal numbers into fractions. - -```javascript -let x = new Fraction(1.88); -let res = x.toFraction(true); // Returns "1 22/25" as a string -``` - -This is particularly useful when you need precise fraction representations instead of dealing with the limitations of floating-point arithmetic. What if you allow some error tolerance? - -```javascript -let x = new Fraction(0.33333); -let res = x.simplify(0.001) // Error < 0.001 - .toFraction(); // Returns "1/3" as a string -``` - -## Precision - -As native `BigInt` support in JavaScript becomes more common, libraries like *Fraction.js* use it to handle calculations with higher precision. This improves the speed and accuracy of math operations with large numbers, providing a better solution for tasks that need more precision than floating-point numbers can offer. - -## Examples / Motivation - -A simple example of using *Fraction.js* might look like this: - -```javascript -var f = new Fraction("9.4'31'"); // 9.4313131313131... -f.mul([-4, 3]).mod("4.'8'"); // 4.88888888888888... -``` - -The result can then be displayed as: - -```javascript -console.log(f.toFraction()); // -4154 / 1485 -``` - -Additionally, you can access the internal attributes of the fraction, such as the sign (s), numerator (n), and denominator (d). Keep in mind that these values are stored as `BigInt`: - -```javascript -Number(f.s) * Number(f.n) / Number(f.d) = -1 * 4154 / 1485 = -2.797306... -``` - -If you attempted to calculate this manually using floating-point arithmetic, you'd get something like: - -```javascript -(9.4313131 * (-4 / 3)) % 4.888888 = -2.797308133... -``` - -While the result is reasonably close, it’s not as accurate as the fraction-based approach that *Fraction.js* provides, especially when dealing with repeating decimals or complex operations. This highlights the value of precision that the library brings. - -### Laplace Probability - -Here's a straightforward example of using *Fraction.js* to calculate probabilities. Let's determine the probability of rolling a specific outcome on a fair die: - -- **P({3})**: The probability of rolling a 3. -- **P({1, 4})**: The probability of rolling either 1 or 4. -- **P({2, 4, 6})**: The probability of rolling 2, 4, or 6. - -#### 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 - -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).valueOf() < 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](https://raw.org/article/rational-numbers-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().toFraction()); // = 3416/9999 -``` - -### 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() imprecision 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 log(base) - -Returns the logarithm of the actual number to a given rational base. 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 rational numbers are equal - -### boolean lt(n) - -Check if this rational number is less than another - -### boolean lte(n) - -Check if this rational number is less than or equal another - -### boolean gt(n) - -Check if this rational number is greater than another - -### boolean gte(n) - -Check if this rational number is greater than or equal another - -### 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 given object. For repeating decimal places, digits within repeating cycles are enclosed in parentheses, e.g., `1/3 = "0.(3)"`. For other numbers, the string will include up to the specified `decimalPlaces` significant digits, including any trailing zeros if truncation occurs. For example, `1/2` will be represented as `"0.5"`, without additional trailing zeros. - -**Note:** Since both `valueOf()` and `toString()` are provided, `toString()` will only be invoked implicitly when the object is used in a string context. For instance, when using the plus operator like `"123" + new Fraction`, `valueOf()` will be called first, as JavaScript attempts to combine primitives before concatenating them, with the string type taking precedence. However, `alert(new Fraction)` or `String(new Fraction)` will behave as expected. To ensure specific behavior, explicitly call either `toString()` or `valueOf()`. - -### String toLatex(showMixed=false) - -Generates an exact LaTeX representation of the actual object. You can see a [live demo](https://raw.org/article/rational-numbers-in-javascript/) on my blog. - -The optional boolean parameter indicates if you want to show the a mixed fraction. "1 1/3" instead of "4/3" - -### String toFraction(showMixed=false) - -Gets a string representation of the fraction - -The optional boolean parameter indicates if you want to showa mixed fraction. "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 - -You can install `Fraction.js` via npm: - -```bash -npm install fraction.js -``` - -Or with yarn: - -```bash -yarn add fraction.js -``` - -Alternatively, download or clone the repository: - -```bash -git clone https://github.com/rawify/Fraction.js -``` - -## Usage - -Include the `fraction.min.js` file in your project: - -```html - - -``` - -Or in a Node.js project: - -```javascript -const Fraction = require('fraction.js'); -``` - -or - -```javascript -import Fraction from 'fraction.js'; -``` - - -## 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. - -## Building the library - -After cloning the Git repository run: - -```bash -npm install -npm run build -``` - -## Run a test - -Testing the source against the shipped test suite is as easy as - -```bash -npm run test -``` - -## Copyright and Licensing - -Copyright (c) 2025, [Robert Eisele](https://raw.org/) -Licensed under the MIT license. diff --git a/node_modules/fraction.js/dist/fraction.js b/node_modules/fraction.js/dist/fraction.js deleted file mode 100644 index 816d5db..0000000 --- a/node_modules/fraction.js/dist/fraction.js +++ /dev/null @@ -1,1045 +0,0 @@ -'use strict'; - -/** - * - * 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 as BigInt or Number - * - * Double form - * - Single double value as Number - * - * 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); - * - */ - -// 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_ZERO = BigInt(0); -const C_ONE = BigInt(1); -const C_TWO = BigInt(2); -const C_THREE = BigInt(3); -const C_FIVE = BigInt(5); -const C_TEN = BigInt(10); -const MAX_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); - -// 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; -} - -function ifloor(x) { - return typeof x === 'bigint' ? x : Math.floor(x); -} - -// 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; -} - -const FACTORSTEPS = [C_TWO * C_TWO, C_TWO, C_TWO * C_TWO, C_TWO, C_TWO * C_TWO, C_TWO * C_THREE, C_TWO, C_TWO * C_THREE]; // repeats -function factorize(n) { - - const factors = Object.create(null); - if (n <= C_ONE) { - factors[n] = C_ONE; - return factors; - } - - const add = (p) => { factors[p] = (factors[p] || C_ZERO) + C_ONE; }; - - while (n % C_TWO === C_ZERO) { add(C_TWO); n /= C_TWO; } - while (n % C_THREE === C_ZERO) { add(C_THREE); n /= C_THREE; } - while (n % C_FIVE === C_ZERO) { add(C_FIVE); n /= C_FIVE; } - - // 30-wheel trial division: test only residues coprime to 2*3*5 - // Residue step pattern after 5: 7,11,13,17,19,23,29,31, ... - for (let si = 0, p = C_TWO + C_FIVE; p * p <= n;) { - while (n % p === C_ZERO) { add(p); n /= p; } - p += FACTORSTEPS[si]; - si = (si + 1) & 7; // fast modulo 8 - } - if (n > C_ONE) add(n); - return factors; -} - -const parse = function (p1, p2) { - - let n = C_ZERO, d = C_ONE, s = C_ONE; - - if (p1 === undefined || p1 === null) { // No argument - /* void */ - } else if (p2 !== undefined) { // Two arguments - - if (typeof p1 === "bigint") { - n = p1; - } else if (isNaN(p1)) { - throw InvalidParameter(); - } else if (p1 % 1 !== 0) { - throw NonIntegerParameter(); - } else { - n = BigInt(p1); - } - - if (typeof p2 === "bigint") { - d = p2; - } else if (isNaN(p2)) { - throw InvalidParameter(); - } else if (p2 % 1 !== 0) { - throw NonIntegerParameter(); - } else { - d = BigInt(p2); - } - - s = n * d; - - } 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 (typeof p1 === "bigint") { - n = p1; - } else { - throw InvalidParameter(); - } - s = n * d; - } 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 { - - 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.replace(/_/g, '').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 if (typeof p1 === "bigint") { - n = p1; - s = p1; - d = C_ONE; - } 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']); - } -} - -const DivisionByZero = function () { return new Error("Division by Zero"); }; -const InvalidParameter = function () { return new Error("Invalid argument"); }; -const 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) - * Ex: new Fraction(20, 10).mod().equals(0) ? "is Integer" - **/ - "mod": function (a, b) { - - if (a === undefined) { - return newFraction(this["s"] * this["n"] % this["d"], C_ONE); - } - - parse(a, b); - if (C_ZERO === P["n"] * this["d"]) { - throw DivisionByZero(); - } - - /** - * I derived the rational modulo similar to the modulo for integers - * - * https://raw.org/book/analysis/rational-numbers/ - * - * n1/d1 = (n2/d2) * q + r, where 0 ≤ r < n2/d2 - * => d2 * n1 = n2 * d1 * q + d1 * d2 * r - * => r = (d2 * n1 - n2 * d1 * q) / (d1 * d2) - * = (d2 * n1 - n2 * d1 * floor((d2 * n1) / (n2 * d1))) / (d1 * d2) - * = ((d2 * n1) % (n2 * d1)) / (d1 * d2) - */ - 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); - - // https://raw.org/book/analysis/rational-numbers/ - // 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); - - // https://raw.org/book/analysis/rational-numbers/ - // 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); - }, - - /** - * Calculates the logarithm of a fraction to a given rational base - * - * Ex: new Fraction(27, 8).log(9, 4) => 3/2 - */ - "log": function (a, b) { - - parse(a, b); - - if (this['s'] <= C_ZERO || P['s'] <= C_ZERO) return null; - - const allPrimes = Object.create(null); - - const baseFactors = factorize(P['n']); - const T1 = factorize(P['d']); - - const numberFactors = factorize(this['n']); - const T2 = factorize(this['d']); - - for (const prime in T1) { - baseFactors[prime] = (baseFactors[prime] || C_ZERO) - T1[prime]; - } - for (const prime in T2) { - numberFactors[prime] = (numberFactors[prime] || C_ZERO) - T2[prime]; - } - - for (const prime in baseFactors) { - if (prime === '1') continue; - allPrimes[prime] = true; - } - for (const prime in numberFactors) { - if (prime === '1') continue; - allPrimes[prime] = true; - } - - let retN = null; - let retD = null; - - // Iterate over all unique primes to determine if a consistent ratio exists - for (const prime in allPrimes) { - - const baseExponent = baseFactors[prime] || C_ZERO; - const numberExponent = numberFactors[prime] || C_ZERO; - - if (baseExponent === C_ZERO) { - if (numberExponent !== C_ZERO) { - return null; // Logarithm cannot be expressed as a rational number - } - continue; // Skip this prime since both exponents are zero - } - - // Calculate the ratio of exponents for this prime - let curN = numberExponent; - let curD = baseExponent; - - // Simplify the current ratio - const gcdValue = gcd(curN, curD); - curN /= gcdValue; - curD /= gcdValue; - - // Check if this is the first ratio; otherwise, ensure ratios are consistent - if (retN === null && retD === null) { - retN = curN; - retD = curD; - } else if (curN * retD !== retN * curD) { - return null; // Ratios do not match, logarithm cannot be rational - } - } - - return retN !== null && retD !== null - ? newFraction(retN, retD) - : null; - }, - - /** - * 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"]; - }, - - /** - * Check if this rational number is less than another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "lt": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] < P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is less than or equal another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "lte": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] <= P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is greater than another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "gt": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] > P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is greater than or equal another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "gte": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] >= P["s"] * P["n"] * this["d"]; - }, - - /** - * Compare two rational numbers - * < 0 iff this < that - * > 0 iff this > that - * = 0 iff this = that - * - * Ex: new Fraction(19.6).compare([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(ifloor(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(ifloor(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) = ifloor(n / d) + (n % d) / d >= 0.5 ? 1 : 0 - = ifloor(n / d) + 2(n % d) >= d ? 1 : 0 - s < 0: - round(n / d) =-ifloor(n / d) - (n % d) / d > 0.5 ? 1 : 0 - =-ifloor(n / d) - 2(n % d) > d ? 1 : 0 - - =>: - - round(s * n / d) = s * ifloor(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(ifloor(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); - }, - - /** - * 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) - ⇔ k = floor((a * y) / (b * x)) - */ - - parse(a, b); - - const n = this['n'] * P['d']; - const d = this['d'] * P['n']; - const r = n % d; - - // round(n / d) = ifloor(n / d) + 2(n % d) >= d ? 1 : 0 - let k = ifloor(n / d); - if (r + r >= d) { - k++; - } - return newFraction(this['s'] * k * P['n'], P['d']); - }, - - /** - * Check if two rational numbers are divisible - * - * Ex: new Fraction(19.6).divisible(1.5); - */ - "divisible": function (a, b) { - - parse(a, b); - if (P['n'] === C_ZERO) return false; - return (this['n'] * P['d']) % (P['n'] * this['d']) === C_ZERO; - }, - - /** - * Returns a decimal representation of the fraction - * - * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 - **/ - 'valueOf': function () { - //if (this['n'] <= MAX_INTEGER && this['d'] <= MAX_INTEGER) { - 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 = 15) { - - let N = this["n"]; - let D = this["d"]; - - 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 += ifloor(N / D); - - N %= D; - N *= C_TEN; - - if (N) - str += "."; - - if (cycLen) { - - for (let i = cycOff; i--;) { - str += ifloor(N / D); - N %= D; - N *= C_TEN; - } - str += "("; - for (let i = cycLen; i--;) { - str += ifloor(N / D); - N %= D; - N *= C_TEN; - } - str += ")"; - } else { - for (let i = dec; N && i--;) { - str += ifloor(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 (showMixed = false) { - - let n = this["n"]; - let d = this["d"]; - let str = this['s'] < C_ZERO ? "-" : ""; - - if (d === C_ONE) { - str += n; - } else { - const whole = ifloor(n / d); - if (showMixed && 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 (showMixed = false) { - - let n = this["n"]; - let d = this["d"]; - let str = this['s'] < C_ZERO ? "-" : ""; - - if (d === C_ONE) { - str += n; - } else { - const whole = ifloor(n / d); - if (showMixed && 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']; - const res = []; - - while (b) { - res.push(ifloor(a / b)); - const t = a % b; - a = b; - b = t; - } - return res; - }, - - "simplify": function (eps = 1e-3) { - - // Continued fractions give best approximations for a max denominator, - // generally outperforming mediants in denominator–accuracy trade-offs. - // Semiconvergents can further reduce the denominator within tolerance. - - const ieps = BigInt(Math.ceil(1 / eps)); - - 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]); - } - - let t = s['sub'](thisABS); - if (t['n'] * ieps < t['d']) { // More robust than Math.abs(t.valueOf()) < eps - return s['mul'](this['s']); - } - } - return this; - } -}; - -Object.defineProperty(Fraction, "__esModule", { 'value': true }); -Fraction['default'] = Fraction; -Fraction['Fraction'] = Fraction; -module['exports'] = Fraction; diff --git a/node_modules/fraction.js/dist/fraction.min.js b/node_modules/fraction.js/dist/fraction.min.js deleted file mode 100644 index 97b02ee..0000000 --- a/node_modules/fraction.js/dist/fraction.min.js +++ /dev/null @@ -1,21 +0,0 @@ -/* -Fraction.js v5.3.4 8/22/2025 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2025, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -'use strict';(function(F){function D(){return Error("Parameters must be integer")}function x(){return Error("Invalid argument")}function C(){return Error("Division by Zero")}function q(a,b){var d=g,c=h;let f=h;if(void 0!==a&&null!==a)if(void 0!==b){if("bigint"===typeof a)d=a;else{if(isNaN(a))throw x();if(0!==a%1)throw D();d=BigInt(a)}if("bigint"===typeof b)c=b;else{if(isNaN(b))throw x();if(0!==b%1)throw D();c=BigInt(b)}f=d*c}else if("object"===typeof a){if("d"in a&&"n"in a)d=BigInt(a.n),c=BigInt(a.d), -"s"in a&&(d*=BigInt(a.s));else if(0 in a)d=BigInt(a[0]),1 in a&&(c=BigInt(a[1]));else if("bigint"===typeof a)d=a;else throw x();f=d*c}else if("number"===typeof a){if(isNaN(a))throw x();0>a&&(f=-h,a=-a);if(0===a%1)d=BigInt(a);else{b=1;var k=0,l=1,m=1;let r=1;1<=a&&(b=10**Math.floor(1+Math.log10(a)),a/=b);for(;1E7>=l&&1E7>=r;)if(c=(k+m)/(l+r),a===c){1E7>=l+r?(d=k+m,c=l+r):r>l?(d=m,c=r):(d=k,c=l);break}else a>c?(k+=m,l+=r):(m+=k,r+=l),1E7h&&(b[a]=(b[a]||g)+h);return b}function y(a,b){if(!a)return b;if(!b)return a;for(;;){a%=b;if(!a)return b;b%=a;if(!b)return a}}function v(a,b){q(a,b);if(this instanceof v)a=y(e.d,e.n),this.s=e.s,this.n=e.n/a,this.d=e.d/a;else return n(e.s*e.n,e.d)}"undefined"===typeof BigInt&& -(BigInt=function(a){if(isNaN(a))throw Error("");return a});const g=BigInt(0),h=BigInt(1),p=BigInt(2),B=BigInt(3),z=BigInt(5),t=BigInt(10),e={s:h,n:g,d:h},G=[p*p,p,p*p,p,p*p,p*B,p,p*B];v.prototype={s:h,n:g,d:h,abs:function(){return n(this.n,this.d)},neg:function(){return n(-this.s*this.n,this.d)},add:function(a,b){q(a,b);return n(this.s*this.n*e.d+e.s*this.d*e.n,this.d*e.d)},sub:function(a,b){q(a,b);return n(this.s*this.n*e.d-e.s*this.d*e.n,this.d*e.d)},mul:function(a,b){q(a,b);return n(this.s*e.s* -this.n*e.n,this.d*e.d)},div:function(a,b){q(a,b);return n(this.s*e.s*this.n*e.d,this.d*e.n)},clone:function(){return n(this.s*this.n,this.d)},mod:function(a,b){if(void 0===a)return n(this.s*this.n%this.d,h);q(a,b);if(g===e.n*this.d)throw C();return n(this.s*e.d*this.n%(e.n*this.d),e.d*this.d)},gcd:function(a,b){q(a,b);return n(y(e.n,this.n)*y(e.d,this.d),e.d*this.d)},lcm:function(a,b){q(a,b);return e.n===g&&this.n===g?n(g,h):n(e.n*this.n,y(e.n,this.n)*y(e.d,this.d))},inverse:function(){return n(this.s* -this.d,this.n)},pow:function(a,b){q(a,b);if(e.d===h)return e.se.s*e.n*this.d},gte:function(a,b){q(a,b);return this.s*this.n*e.d>=e.s*e.n*this.d},compare:function(a,b){q(a,b);a=this.s*this.n*e.d-e.s*e.n*this.d;return(gg&&this.s>=g?h:g),a)},floor:function(a){a=t**BigInt(a||0);return n(u(this.s*a*this.n/ -this.d)-(a*this.n%this.d>g&&this.s=g?h:g)+a*this.n%this.d*p>this.d?h:g),a)},roundTo:function(a,b){q(a,b);var d=this.n*e.d;a=this.d*e.n;b=d%a;d=u(d/a);b+b>=a&&d++;return n(this.s*d*e.n,e.d)},divisible:function(a,b){q(a,b);return e.n===g?!1:this.n*e.d%(e.n*this.d)===g},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(a=15){let b=this.n,d=this.d;var c;a:{for(c=d;c%p===g;c/= -p);for(;c%z===g;c/=z);if(c===h)c=g;else{for(var f=t%c,k=1;f!==h;k++)if(f=f*t%c,2E3g;k=k*k%d,l>>=h)l&h&&(m=m*k%d);k=m;for(l=0;300>l;l++){if(f===k){f=BigInt(l);break a}f=f*t%d;k=k*t%d}f=0}k=f;f=this.sg&&(c+=f,c+=" ",b%=d);c=c+b+"/"+d}return c},toLatex:function(a=!1){let b=this.n,d=this.d,c=this.sg&&(c+=f,b%=d);c=c+"\\frac{"+b+"}{"+d;c+="}"}return c},toContinued:function(){let a=this.n,b=this.d;const d=[];for(;b;){d.push(u(a/b));const c=a%b;a=b;b=c}return d},simplify:function(a=.001){a=BigInt(Math.ceil(1/a));const b=this.abs(),d=b.toContinued();for(let f=1;f , 1 => ] - * { n => , d => } - * - * Integer form - * - Single integer value as BigInt or Number - * - * Double form - * - Single double value as Number - * - * 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); - * - */ - -// 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_ZERO = BigInt(0); -const C_ONE = BigInt(1); -const C_TWO = BigInt(2); -const C_THREE = BigInt(3); -const C_FIVE = BigInt(5); -const C_TEN = BigInt(10); -const MAX_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); - -// 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; -} - -function ifloor(x) { - return typeof x === 'bigint' ? x : Math.floor(x); -} - -// 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; -} - -const FACTORSTEPS = [C_TWO * C_TWO, C_TWO, C_TWO * C_TWO, C_TWO, C_TWO * C_TWO, C_TWO * C_THREE, C_TWO, C_TWO * C_THREE]; // repeats -function factorize(n) { - - const factors = Object.create(null); - if (n <= C_ONE) { - factors[n] = C_ONE; - return factors; - } - - const add = (p) => { factors[p] = (factors[p] || C_ZERO) + C_ONE; }; - - while (n % C_TWO === C_ZERO) { add(C_TWO); n /= C_TWO; } - while (n % C_THREE === C_ZERO) { add(C_THREE); n /= C_THREE; } - while (n % C_FIVE === C_ZERO) { add(C_FIVE); n /= C_FIVE; } - - // 30-wheel trial division: test only residues coprime to 2*3*5 - // Residue step pattern after 5: 7,11,13,17,19,23,29,31, ... - for (let si = 0, p = C_TWO + C_FIVE; p * p <= n;) { - while (n % p === C_ZERO) { add(p); n /= p; } - p += FACTORSTEPS[si]; - si = (si + 1) & 7; // fast modulo 8 - } - if (n > C_ONE) add(n); - return factors; -} - -const parse = function (p1, p2) { - - let n = C_ZERO, d = C_ONE, s = C_ONE; - - if (p1 === undefined || p1 === null) { // No argument - /* void */ - } else if (p2 !== undefined) { // Two arguments - - if (typeof p1 === "bigint") { - n = p1; - } else if (isNaN(p1)) { - throw InvalidParameter(); - } else if (p1 % 1 !== 0) { - throw NonIntegerParameter(); - } else { - n = BigInt(p1); - } - - if (typeof p2 === "bigint") { - d = p2; - } else if (isNaN(p2)) { - throw InvalidParameter(); - } else if (p2 % 1 !== 0) { - throw NonIntegerParameter(); - } else { - d = BigInt(p2); - } - - s = n * d; - - } 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 (typeof p1 === "bigint") { - n = p1; - } else { - throw InvalidParameter(); - } - s = n * d; - } 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 { - - 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.replace(/_/g, '').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 if (typeof p1 === "bigint") { - n = p1; - s = p1; - d = C_ONE; - } 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']); - } -} - -const DivisionByZero = function () { return new Error("Division by Zero"); }; -const InvalidParameter = function () { return new Error("Invalid argument"); }; -const 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) - * Ex: new Fraction(20, 10).mod().equals(0) ? "is Integer" - **/ - "mod": function (a, b) { - - if (a === undefined) { - return newFraction(this["s"] * this["n"] % this["d"], C_ONE); - } - - parse(a, b); - if (C_ZERO === P["n"] * this["d"]) { - throw DivisionByZero(); - } - - /** - * I derived the rational modulo similar to the modulo for integers - * - * https://raw.org/book/analysis/rational-numbers/ - * - * n1/d1 = (n2/d2) * q + r, where 0 ≤ r < n2/d2 - * => d2 * n1 = n2 * d1 * q + d1 * d2 * r - * => r = (d2 * n1 - n2 * d1 * q) / (d1 * d2) - * = (d2 * n1 - n2 * d1 * floor((d2 * n1) / (n2 * d1))) / (d1 * d2) - * = ((d2 * n1) % (n2 * d1)) / (d1 * d2) - */ - 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); - - // https://raw.org/book/analysis/rational-numbers/ - // 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); - - // https://raw.org/book/analysis/rational-numbers/ - // 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); - }, - - /** - * Calculates the logarithm of a fraction to a given rational base - * - * Ex: new Fraction(27, 8).log(9, 4) => 3/2 - */ - "log": function (a, b) { - - parse(a, b); - - if (this['s'] <= C_ZERO || P['s'] <= C_ZERO) return null; - - const allPrimes = Object.create(null); - - const baseFactors = factorize(P['n']); - const T1 = factorize(P['d']); - - const numberFactors = factorize(this['n']); - const T2 = factorize(this['d']); - - for (const prime in T1) { - baseFactors[prime] = (baseFactors[prime] || C_ZERO) - T1[prime]; - } - for (const prime in T2) { - numberFactors[prime] = (numberFactors[prime] || C_ZERO) - T2[prime]; - } - - for (const prime in baseFactors) { - if (prime === '1') continue; - allPrimes[prime] = true; - } - for (const prime in numberFactors) { - if (prime === '1') continue; - allPrimes[prime] = true; - } - - let retN = null; - let retD = null; - - // Iterate over all unique primes to determine if a consistent ratio exists - for (const prime in allPrimes) { - - const baseExponent = baseFactors[prime] || C_ZERO; - const numberExponent = numberFactors[prime] || C_ZERO; - - if (baseExponent === C_ZERO) { - if (numberExponent !== C_ZERO) { - return null; // Logarithm cannot be expressed as a rational number - } - continue; // Skip this prime since both exponents are zero - } - - // Calculate the ratio of exponents for this prime - let curN = numberExponent; - let curD = baseExponent; - - // Simplify the current ratio - const gcdValue = gcd(curN, curD); - curN /= gcdValue; - curD /= gcdValue; - - // Check if this is the first ratio; otherwise, ensure ratios are consistent - if (retN === null && retD === null) { - retN = curN; - retD = curD; - } else if (curN * retD !== retN * curD) { - return null; // Ratios do not match, logarithm cannot be rational - } - } - - return retN !== null && retD !== null - ? newFraction(retN, retD) - : null; - }, - - /** - * 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"]; - }, - - /** - * Check if this rational number is less than another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "lt": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] < P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is less than or equal another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "lte": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] <= P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is greater than another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "gt": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] > P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is greater than or equal another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "gte": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] >= P["s"] * P["n"] * this["d"]; - }, - - /** - * Compare two rational numbers - * < 0 iff this < that - * > 0 iff this > that - * = 0 iff this = that - * - * Ex: new Fraction(19.6).compare([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(ifloor(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(ifloor(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) = ifloor(n / d) + (n % d) / d >= 0.5 ? 1 : 0 - = ifloor(n / d) + 2(n % d) >= d ? 1 : 0 - s < 0: - round(n / d) =-ifloor(n / d) - (n % d) / d > 0.5 ? 1 : 0 - =-ifloor(n / d) - 2(n % d) > d ? 1 : 0 - - =>: - - round(s * n / d) = s * ifloor(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(ifloor(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); - }, - - /** - * 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) - ⇔ k = floor((a * y) / (b * x)) - */ - - parse(a, b); - - const n = this['n'] * P['d']; - const d = this['d'] * P['n']; - const r = n % d; - - // round(n / d) = ifloor(n / d) + 2(n % d) >= d ? 1 : 0 - let k = ifloor(n / d); - if (r + r >= d) { - k++; - } - return newFraction(this['s'] * k * P['n'], P['d']); - }, - - /** - * Check if two rational numbers are divisible - * - * Ex: new Fraction(19.6).divisible(1.5); - */ - "divisible": function (a, b) { - - parse(a, b); - if (P['n'] === C_ZERO) return false; - return (this['n'] * P['d']) % (P['n'] * this['d']) === C_ZERO; - }, - - /** - * Returns a decimal representation of the fraction - * - * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 - **/ - 'valueOf': function () { - //if (this['n'] <= MAX_INTEGER && this['d'] <= MAX_INTEGER) { - 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 = 15) { - - let N = this["n"]; - let D = this["d"]; - - 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 += ifloor(N / D); - - N %= D; - N *= C_TEN; - - if (N) - str += "."; - - if (cycLen) { - - for (let i = cycOff; i--;) { - str += ifloor(N / D); - N %= D; - N *= C_TEN; - } - str += "("; - for (let i = cycLen; i--;) { - str += ifloor(N / D); - N %= D; - N *= C_TEN; - } - str += ")"; - } else { - for (let i = dec; N && i--;) { - str += ifloor(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 (showMixed = false) { - - let n = this["n"]; - let d = this["d"]; - let str = this['s'] < C_ZERO ? "-" : ""; - - if (d === C_ONE) { - str += n; - } else { - const whole = ifloor(n / d); - if (showMixed && 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 (showMixed = false) { - - let n = this["n"]; - let d = this["d"]; - let str = this['s'] < C_ZERO ? "-" : ""; - - if (d === C_ONE) { - str += n; - } else { - const whole = ifloor(n / d); - if (showMixed && 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']; - const res = []; - - while (b) { - res.push(ifloor(a / b)); - const t = a % b; - a = b; - b = t; - } - return res; - }, - - "simplify": function (eps = 1e-3) { - - // Continued fractions give best approximations for a max denominator, - // generally outperforming mediants in denominator–accuracy trade-offs. - // Semiconvergents can further reduce the denominator within tolerance. - - const ieps = BigInt(Math.ceil(1 / eps)); - - 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]); - } - - let t = s['sub'](thisABS); - if (t['n'] * ieps < t['d']) { // More robust than Math.abs(t.valueOf()) < eps - return s['mul'](this['s']); - } - } - return this; - } -}; -export { - Fraction as default, Fraction -}; diff --git a/node_modules/fraction.js/examples/angles.js b/node_modules/fraction.js/examples/angles.js deleted file mode 100644 index 436947e..0000000 --- a/node_modules/fraction.js/examples/angles.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ - -// This example generates a list of angles with human readable radians - -var Fraction = require('fraction.js'); - -var tab = []; -for (var d = 1; d <= 360; d++) { - - var pi = Fraction(2, 360).mul(d); - var tau = Fraction(1, 360).mul(d); - - if (pi.d <= 6n && pi.d != 5n) - tab.push([ - d, - pi.toFraction() + "pi", - tau.toFraction() + "tau"]); -} - -console.table(tab); diff --git a/node_modules/fraction.js/examples/approx.js b/node_modules/fraction.js/examples/approx.js deleted file mode 100644 index 36aa030..0000000 --- a/node_modules/fraction.js/examples/approx.js +++ /dev/null @@ -1,54 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -const Fraction = require('fraction.js'); - -// Another rational approximation, not using Farey Sequences but Binary Search using the mediant -function approximate(p, precision) { - - var num1 = Math.floor(p); - var den1 = 1; - - var num2 = num1 + 1; - var den2 = 1; - - if (p !== num1) { - - while (den1 <= precision && den2 <= precision) { - - var m = (num1 + num2) / (den1 + den2); - - if (p === m) { - - if (den1 + den2 <= precision) { - den1 += den2; - num1 += num2; - den2 = precision + 1; - } else if (den1 > den2) { - den2 = precision + 1; - } else { - den1 = precision + 1; - } - break; - - } else if (p < m) { - num2 += num1; - den2 += den1; - } else { - num1 += num2; - den1 += den2; - } - } - } - - if (den1 > precision) { - den1 = den2; - num1 = num2; - } - return new Fraction(num1, den1); -} - diff --git a/node_modules/fraction.js/examples/egyptian.js b/node_modules/fraction.js/examples/egyptian.js deleted file mode 100644 index 66fc209..0000000 --- a/node_modules/fraction.js/examples/egyptian.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -const Fraction = require('fraction.js'); - -// Based on http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fractions/egyptian.html -function egyptian(a, b) { - - var res = []; - - do { - var t = Math.ceil(b / a); - var x = new Fraction(a, b).sub(1, t); - res.push(t); - a = Number(x.n); - b = Number(x.d); - } while (a !== 0n); - return res; -} -console.log("1 / " + egyptian(521, 1050).join(" + 1 / ")); diff --git a/node_modules/fraction.js/examples/hesse-convergence.js b/node_modules/fraction.js/examples/hesse-convergence.js deleted file mode 100644 index c33a58b..0000000 --- a/node_modules/fraction.js/examples/hesse-convergence.js +++ /dev/null @@ -1,111 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -const Fraction = require('fraction.js'); - -/* -We have the polynom f(x) = 1/3x_1^2 + x_2^2 + x_1 * x_2 + 3 - -The gradient of f(x): - -grad(x) = | x_1^2+x_2 | - | 2x_2+x_1 | - -And thus the Hesse-Matrix H: -| 2x_1 1 | -| 1 2 | - -The inverse Hesse-Matrix H^-1 is -| -2 / (1-4x_1) 1 / (1 - 4x_1) | -| 1 / (1 - 4x_1) -2x_1 / (1 - 4x_1) | - -We now want to find lim ->oo x[n], with the starting element of (3 2)^T - -*/ - -// Get the Hesse Matrix -function H(x) { - - var z = Fraction(1).sub(Fraction(4).mul(x[0])); - - return [ - Fraction(-2).div(z), - Fraction(1).div(z), - Fraction(1).div(z), - Fraction(-2).mul(x[0]).div(z), - ]; -} - -// Get the gradient of f(x) -function grad(x) { - - return [ - Fraction(x[0]).mul(x[0]).add(x[1]), - Fraction(2).mul(x[1]).add(x[0]) - ]; -} - -// A simple matrix multiplication helper -function matrMult(m, v) { - - return [ - Fraction(m[0]).mul(v[0]).add(Fraction(m[1]).mul(v[1])), - Fraction(m[2]).mul(v[0]).add(Fraction(m[3]).mul(v[1])) - ]; -} - -// A simple vector subtraction helper -function vecSub(a, b) { - - return [ - Fraction(a[0]).sub(b[0]), - Fraction(a[1]).sub(b[1]) - ]; -} - -// Main function, gets a vector and the actual index -function run(V, j) { - - var t = H(V); - //console.log("H(X)"); - for (var i in t) { - - // console.log(t[i].toFraction()); - } - - var s = grad(V); - //console.log("vf(X)"); - for (var i in s) { - - // console.log(s[i].toFraction()); - } - - //console.log("multiplication"); - var r = matrMult(t, s); - for (var i in r) { - - // console.log(r[i].toFraction()); - } - - var R = (vecSub(V, r)); - - console.log("X" + j); - console.log(R[0].toFraction(), "= " + R[0].valueOf()); - console.log(R[1].toFraction(), "= " + R[1].valueOf()); - console.log("\n"); - - return R; -} - - -// Set the starting vector -var v = [3, 2]; - -for (var i = 0; i < 15; i++) { - - v = run(v, i); -} diff --git a/node_modules/fraction.js/examples/integrate.js b/node_modules/fraction.js/examples/integrate.js deleted file mode 100644 index 6376aed..0000000 --- a/node_modules/fraction.js/examples/integrate.js +++ /dev/null @@ -1,67 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -const Fraction = require('fraction.js'); - -// NOTE: This is a nice example, but a stable version of this is served with Polynomial.js: -// https://github.com/rawify/Polynomial.js - -function integrate(poly) { - - poly = poly.replace(/\s+/g, ""); - - var regex = /(\([+-]?[0-9/]+\)|[+-]?[0-9/]+)x(?:\^(\([+-]?[0-9/]+\)|[+-]?[0-9]+))?/g; - var arr; - var res = {}; - while (null !== (arr = regex.exec(poly))) { - - var a = (arr[1] || "1").replace("(", "").replace(")", "").split("/"); - var b = (arr[2] || "1").replace("(", "").replace(")", "").split("/"); - - var exp = new Fraction(b).add(1); - var key = "" + exp; - - if (res[key] !== undefined) { - res[key] = { x: new Fraction(a).div(exp).add(res[key].x), e: exp }; - } else { - res[key] = { x: new Fraction(a).div(exp), e: exp }; - } - } - - var str = ""; - var c = 0; - for (var i in res) { - if (res[i].x.s !== -1n && c > 0) { - str += "+"; - } else if (res[i].x.s === -1n) { - str += "-"; - } - if (res[i].x.n !== res[i].x.d) { - if (res[i].x.d !== 1n) { - str += res[i].x.n + "/" + res[i].x.d; - } else { - str += res[i].x.n; - } - } - str += "x"; - if (res[i].e.n !== res[i].e.d) { - str += "^"; - if (res[i].e.d !== 1n) { - str += "(" + res[i].e.n + "/" + res[i].e.d + ")"; - } else { - str += res[i].e.n; - } - } - c++; - } - return str; -} - -var poly = "-2/3x^3-2x^2+3x+8x^3-1/3x^(4/8)"; - -console.log("f(x): " + poly); -console.log("F(x): " + integrate(poly)); diff --git a/node_modules/fraction.js/examples/ratio-chain.js b/node_modules/fraction.js/examples/ratio-chain.js deleted file mode 100644 index fab7876..0000000 --- a/node_modules/fraction.js/examples/ratio-chain.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -Given the ratio a : b : c = 2 : 3 : 4 -What is c, given a = 40? - -A general ratio chain is a_1 : a_2 : a_3 : ... : a_n = r_1 : r2 : r_3 : ... : r_n. -Now each term can be expressed as a_i = r_i * x for some unknown proportional constant x. -If a_k is known it follows that x = a_k / r_k. Substituting x into the first equation yields -a_i = r_i / r_k * a_k. - -Given an array r and a given value a_k, the following function calculates all a_i: -*/ - -function calculateRatios(r, a_k, k) { - const x = Fraction(a_k).div(r[k]); - return r.map(r_i => x.mul(r_i)); -} - -// Example usage: -const r = [2, 3, 4]; // Ratio array representing a : b : c = 2 : 3 : 4 -const a_k = 40; // Given value of a (corresponding to r[0]) -const k = 0; // Index of the known value (a corresponds to r[0]) - -const result = calculateRatios(r, a_k, k); -console.log(result); // Output: [40, 60, 80] diff --git a/node_modules/fraction.js/examples/rational-pow.js b/node_modules/fraction.js/examples/rational-pow.js deleted file mode 100644 index 1268e27..0000000 --- a/node_modules/fraction.js/examples/rational-pow.js +++ /dev/null @@ -1,29 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -const Fraction = require('fraction.js'); - -// Calculates (a/b)^(c/d) if result is rational -// Derivation: https://raw.org/book/analysis/rational-numbers/ -function root(a, b, c, d) { - - // Initial estimate - let x = Fraction(100 * (Math.floor(Math.pow(a / b, c / d)) || 1), 100); - const abc = Fraction(a, b).pow(c); - - for (let i = 0; i < 30; i++) { - const n = abc.mul(x.pow(1 - d)).sub(x).div(d).add(x) - - if (x.n === n.n && x.d === n.d) { - return n; - } - x = n; - } - return null; -} - -root(18, 2, 1, 2); // 3/1 diff --git a/node_modules/fraction.js/examples/tape-measure.js b/node_modules/fraction.js/examples/tape-measure.js deleted file mode 100644 index 14ec524..0000000 --- a/node_modules/fraction.js/examples/tape-measure.js +++ /dev/null @@ -1,16 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ -const Fraction = require('fraction.js'); - -function closestTapeMeasure(frac) { - - // A tape measure is usually divided in parts of 1/16 - - return Fraction(frac).roundTo("1/16"); -} -console.log(closestTapeMeasure("1/3")); // 5/16 diff --git a/node_modules/fraction.js/examples/toFraction.js b/node_modules/fraction.js/examples/toFraction.js deleted file mode 100644 index f935e47..0000000 --- a/node_modules/fraction.js/examples/toFraction.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ - -const Fraction = require('fraction.js'); - -function toFraction(frac) { - - var map = { - '1:4': "¼", - '1:2': "½", - '3:4': "¾", - '1:7': "⅐", - '1:9': "⅑", - '1:10': "⅒", - '1:3': "⅓", - '2:3': "⅔", - '1:5': "⅕", - '2:5': "⅖", - '3:5': "⅗", - '4:5': "⅘", - '1:6': "⅙", - '5:6': "⅚", - '1:8': "⅛", - '3:8': "⅜", - '5:8': "⅝", - '7:8': "⅞" - }; - return map[frac.n + ":" + frac.d] || frac.toFraction(false); -} -console.log(toFraction(Fraction(0.25))); // ¼ diff --git a/node_modules/fraction.js/examples/valueOfPi.js b/node_modules/fraction.js/examples/valueOfPi.js deleted file mode 100644 index 8fc877e..0000000 --- a/node_modules/fraction.js/examples/valueOfPi.js +++ /dev/null @@ -1,42 +0,0 @@ -/* -Fraction.js v5.0.0 10/1/2024 -https://raw.org/article/rational-numbers-in-javascript/ - -Copyright (c) 2024, Robert Eisele (https://raw.org/) -Licensed under the MIT license. -*/ - -var Fraction = require("fraction.js") - -function valueOfPi(val) { - - let minLen = Infinity, minI = 0, min = null; - const choose = [val, val * Math.PI, val / Math.PI]; - for (let i = 0; i < choose.length; i++) { - let el = new Fraction(choose[i]).simplify(1e-13); - let len = Math.log(Number(el.n) + 1) + Math.log(Number(el.d)); - if (len < minLen) { - minLen = len; - minI = i; - min = el; - } - } - - if (minI == 2) { - return min.toFraction().replace(/(\d+)(\/\d+)?/, (_, p, q) => - (p == "1" ? "" : p) + "π" + (q || "")); - } - - if (minI == 1) { - return min.toFraction().replace(/(\d+)(\/\d+)?/, (_, p, q) => - p + (!q ? "/π" : "/(" + q.slice(1) + "π)")); - } - return min.toFraction(); -} - -console.log(valueOfPi(-3)); // -3 -console.log(valueOfPi(4 * Math.PI)); // 4π -console.log(valueOfPi(3.14)); // 157/50 -console.log(valueOfPi(3 / 2 * Math.PI)); // 3π/2 -console.log(valueOfPi(Math.PI / 2)); // π/2 -console.log(valueOfPi(-1 / (2 * Math.PI))); // -1/(2π) diff --git a/node_modules/fraction.js/fraction.d.mts b/node_modules/fraction.js/fraction.d.mts deleted file mode 100644 index 0604ad7..0000000 --- a/node_modules/fraction.js/fraction.d.mts +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Interface representing a fraction with numerator and denominator. - */ -export interface NumeratorDenominator { - n: number | bigint; - d: number | bigint; -} - -/** - * Type for handling multiple types of input for Fraction operations. - */ -export type FractionInput = - | Fraction - | number - | bigint - | string - | [number | bigint | string, number | bigint | string] - | NumeratorDenominator; - -/** - * Function signature for Fraction operations like add, sub, mul, etc. - */ -export type FractionParam = { - (numerator: number | bigint, denominator: number | bigint): Fraction; - (num: FractionInput): Fraction; -}; - -/** - * Fraction class representing a rational number with numerator and denominator. - */ -declare class Fraction { - constructor(); - constructor(num: FractionInput); - constructor(numerator: number | bigint, denominator: number | bigint); - - s: bigint; - n: bigint; - d: bigint; - - abs(): Fraction; - neg(): Fraction; - - add: FractionParam; - sub: FractionParam; - mul: FractionParam; - div: FractionParam; - pow: FractionParam; - log: FractionParam; - gcd: FractionParam; - lcm: FractionParam; - - mod(): Fraction; - mod(num: FractionInput): Fraction; - - ceil(places?: number): Fraction; - floor(places?: number): Fraction; - round(places?: number): Fraction; - roundTo: FractionParam; - - inverse(): Fraction; - simplify(eps?: number): Fraction; - - equals(num: FractionInput): boolean; - lt(num: FractionInput): boolean; - lte(num: FractionInput): boolean; - gt(num: FractionInput): boolean; - gte(num: FractionInput): boolean; - compare(num: FractionInput): number; - divisible(num: FractionInput): boolean; - - valueOf(): number; - toString(decimalPlaces?: number): string; - toLatex(showMixed?: boolean): string; - toFraction(showMixed?: boolean): string; - toContinued(): bigint[]; - clone(): Fraction; -} - -export { Fraction as default, Fraction }; \ No newline at end of file diff --git a/node_modules/fraction.js/fraction.d.ts b/node_modules/fraction.js/fraction.d.ts deleted file mode 100644 index 97222b9..0000000 --- a/node_modules/fraction.js/fraction.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -declare class Fraction { - constructor(); - constructor(num: Fraction.FractionInput); - constructor(numerator: number | bigint, denominator: number | bigint); - - s: bigint; - n: bigint; - d: bigint; - - abs(): Fraction; - neg(): Fraction; - - add: Fraction.FractionParam; - sub: Fraction.FractionParam; - mul: Fraction.FractionParam; - div: Fraction.FractionParam; - pow: Fraction.FractionParam; - log: Fraction.FractionParam; - gcd: Fraction.FractionParam; - lcm: Fraction.FractionParam; - - mod(): Fraction; - mod(num: Fraction.FractionInput): Fraction; - - ceil(places?: number): Fraction; - floor(places?: number): Fraction; - round(places?: number): Fraction; - roundTo: Fraction.FractionParam; - - inverse(): Fraction; - simplify(eps?: number): Fraction; - - equals(num: Fraction.FractionInput): boolean; - lt(num: Fraction.FractionInput): boolean; - lte(num: Fraction.FractionInput): boolean; - gt(num: Fraction.FractionInput): boolean; - gte(num: Fraction.FractionInput): boolean; - compare(num: Fraction.FractionInput): number; - divisible(num: Fraction.FractionInput): boolean; - - valueOf(): number; - toString(decimalPlaces?: number): string; - toLatex(showMixed?: boolean): string; - toFraction(showMixed?: boolean): string; - toContinued(): bigint[]; - clone(): Fraction; - - static default: typeof Fraction; - static Fraction: typeof Fraction; -} - -declare namespace Fraction { - interface NumeratorDenominator { n: number | bigint; d: number | bigint; } - type FractionInput = - | Fraction - | number - | bigint - | string - | [number | bigint | string, number | bigint | string] - | NumeratorDenominator; - - type FractionParam = { - (numerator: number | bigint, denominator: number | bigint): Fraction; - (num: FractionInput): Fraction; - }; -} - -/** - * Export matches CJS runtime: - * module.exports = Fraction; - * module.exports.default = Fraction; - * module.exports.Fraction = Fraction; - */ -declare const FractionExport: typeof Fraction & { - default: typeof Fraction; - Fraction: typeof Fraction; -}; - -export = FractionExport; \ No newline at end of file diff --git a/node_modules/fraction.js/package.json b/node_modules/fraction.js/package.json deleted file mode 100644 index 03f7986..0000000 --- a/node_modules/fraction.js/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "fraction.js", - "title": "Fraction.js", - "version": "5.3.4", - "description": "The RAW rational numbers library", - "homepage": "https://raw.org/article/rational-numbers-in-javascript/", - "bugs": "https://github.com/rawify/Fraction.js/issues", - "keywords": [ - "math", - "numbers", - "parser", - "ratio", - "fraction", - "fractions", - "rational", - "rationals", - "rational numbers", - "bigint", - "arbitrary precision", - "mixed numbers", - "decimal", - "numerator", - "denominator", - "simplification" - ], - "private": false, - "main": "./dist/fraction.js", - "module": "./dist/fraction.mjs", - "browser": "./dist/fraction.min.js", - "unpkg": "./dist/fraction.min.js", - "types": "./fraction.d.mts", - "exports": { - ".": { - "types": { - "import": "./fraction.d.mts", - "require": "./fraction.d.ts" - }, - "import": "./dist/fraction.mjs", - "require": "./dist/fraction.js", - "browser": "./dist/fraction.min.js" - }, - "./package.json": "./package.json" - }, - "typesVersions": { - "<4.7": { - "*": [ - "fraction.d.ts" - ] - } - }, - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/rawify/Fraction.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 Fraction", - "test": "mocha tests/*.js" - }, - "devDependencies": { - "crude-build": "^0.1.2", - "mocha": "*" - } -} \ No newline at end of file diff --git a/node_modules/fraction.js/src/fraction.js b/node_modules/fraction.js/src/fraction.js deleted file mode 100644 index 4292c48..0000000 --- a/node_modules/fraction.js/src/fraction.js +++ /dev/null @@ -1,1046 +0,0 @@ -/** - * @license Fraction.js v5.3.4 8/22/2025 - * https://raw.org/article/rational-numbers-in-javascript/ - * - * Copyright (c) 2025, Robert Eisele (https://raw.org/) - * Licensed under the MIT license. - **/ - -/** - * - * 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 as BigInt or Number - * - * Double form - * - Single double value as Number - * - * 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); - * - */ - -// 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_ZERO = BigInt(0); -const C_ONE = BigInt(1); -const C_TWO = BigInt(2); -const C_THREE = BigInt(3); -const C_FIVE = BigInt(5); -const C_TEN = BigInt(10); -const MAX_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); - -// 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; -} - -function ifloor(x) { - return typeof x === 'bigint' ? x : Math.floor(x); -} - -// 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; -} - -const FACTORSTEPS = [C_TWO * C_TWO, C_TWO, C_TWO * C_TWO, C_TWO, C_TWO * C_TWO, C_TWO * C_THREE, C_TWO, C_TWO * C_THREE]; // repeats -function factorize(n) { - - const factors = Object.create(null); - if (n <= C_ONE) { - factors[n] = C_ONE; - return factors; - } - - const add = (p) => { factors[p] = (factors[p] || C_ZERO) + C_ONE; }; - - while (n % C_TWO === C_ZERO) { add(C_TWO); n /= C_TWO; } - while (n % C_THREE === C_ZERO) { add(C_THREE); n /= C_THREE; } - while (n % C_FIVE === C_ZERO) { add(C_FIVE); n /= C_FIVE; } - - // 30-wheel trial division: test only residues coprime to 2*3*5 - // Residue step pattern after 5: 7,11,13,17,19,23,29,31, ... - for (let si = 0, p = C_TWO + C_FIVE; p * p <= n;) { - while (n % p === C_ZERO) { add(p); n /= p; } - p += FACTORSTEPS[si]; - si = (si + 1) & 7; // fast modulo 8 - } - if (n > C_ONE) add(n); - return factors; -} - -const parse = function (p1, p2) { - - let n = C_ZERO, d = C_ONE, s = C_ONE; - - if (p1 === undefined || p1 === null) { // No argument - /* void */ - } else if (p2 !== undefined) { // Two arguments - - if (typeof p1 === "bigint") { - n = p1; - } else if (isNaN(p1)) { - throw InvalidParameter(); - } else if (p1 % 1 !== 0) { - throw NonIntegerParameter(); - } else { - n = BigInt(p1); - } - - if (typeof p2 === "bigint") { - d = p2; - } else if (isNaN(p2)) { - throw InvalidParameter(); - } else if (p2 % 1 !== 0) { - throw NonIntegerParameter(); - } else { - d = BigInt(p2); - } - - s = n * d; - - } 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 (typeof p1 === "bigint") { - n = p1; - } else { - throw InvalidParameter(); - } - s = n * d; - } 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 { - - 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.replace(/_/g, '').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 if (typeof p1 === "bigint") { - n = p1; - s = p1; - d = C_ONE; - } 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']); - } -} - -const DivisionByZero = function () { return new Error("Division by Zero"); }; -const InvalidParameter = function () { return new Error("Invalid argument"); }; -const 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) - * Ex: new Fraction(20, 10).mod().equals(0) ? "is Integer" - **/ - "mod": function (a, b) { - - if (a === undefined) { - return newFraction(this["s"] * this["n"] % this["d"], C_ONE); - } - - parse(a, b); - if (C_ZERO === P["n"] * this["d"]) { - throw DivisionByZero(); - } - - /** - * I derived the rational modulo similar to the modulo for integers - * - * https://raw.org/book/analysis/rational-numbers/ - * - * n1/d1 = (n2/d2) * q + r, where 0 ≤ r < n2/d2 - * => d2 * n1 = n2 * d1 * q + d1 * d2 * r - * => r = (d2 * n1 - n2 * d1 * q) / (d1 * d2) - * = (d2 * n1 - n2 * d1 * floor((d2 * n1) / (n2 * d1))) / (d1 * d2) - * = ((d2 * n1) % (n2 * d1)) / (d1 * d2) - */ - 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); - - // https://raw.org/book/analysis/rational-numbers/ - // 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); - - // https://raw.org/book/analysis/rational-numbers/ - // 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); - }, - - /** - * Calculates the logarithm of a fraction to a given rational base - * - * Ex: new Fraction(27, 8).log(9, 4) => 3/2 - */ - "log": function (a, b) { - - parse(a, b); - - if (this['s'] <= C_ZERO || P['s'] <= C_ZERO) return null; - - const allPrimes = Object.create(null); - - const baseFactors = factorize(P['n']); - const T1 = factorize(P['d']); - - const numberFactors = factorize(this['n']); - const T2 = factorize(this['d']); - - for (const prime in T1) { - baseFactors[prime] = (baseFactors[prime] || C_ZERO) - T1[prime]; - } - for (const prime in T2) { - numberFactors[prime] = (numberFactors[prime] || C_ZERO) - T2[prime]; - } - - for (const prime in baseFactors) { - if (prime === '1') continue; - allPrimes[prime] = true; - } - for (const prime in numberFactors) { - if (prime === '1') continue; - allPrimes[prime] = true; - } - - let retN = null; - let retD = null; - - // Iterate over all unique primes to determine if a consistent ratio exists - for (const prime in allPrimes) { - - const baseExponent = baseFactors[prime] || C_ZERO; - const numberExponent = numberFactors[prime] || C_ZERO; - - if (baseExponent === C_ZERO) { - if (numberExponent !== C_ZERO) { - return null; // Logarithm cannot be expressed as a rational number - } - continue; // Skip this prime since both exponents are zero - } - - // Calculate the ratio of exponents for this prime - let curN = numberExponent; - let curD = baseExponent; - - // Simplify the current ratio - const gcdValue = gcd(curN, curD); - curN /= gcdValue; - curD /= gcdValue; - - // Check if this is the first ratio; otherwise, ensure ratios are consistent - if (retN === null && retD === null) { - retN = curN; - retD = curD; - } else if (curN * retD !== retN * curD) { - return null; // Ratios do not match, logarithm cannot be rational - } - } - - return retN !== null && retD !== null - ? newFraction(retN, retD) - : null; - }, - - /** - * 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"]; - }, - - /** - * Check if this rational number is less than another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "lt": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] < P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is less than or equal another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "lte": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] <= P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is greater than another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "gt": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] > P["s"] * P["n"] * this["d"]; - }, - - /** - * Check if this rational number is greater than or equal another - * - * Ex: new Fraction(19.6).lt([98, 5]); - **/ - "gte": function (a, b) { - - parse(a, b); - return this["s"] * this["n"] * P["d"] >= P["s"] * P["n"] * this["d"]; - }, - - /** - * Compare two rational numbers - * < 0 iff this < that - * > 0 iff this > that - * = 0 iff this = that - * - * Ex: new Fraction(19.6).compare([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(ifloor(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(ifloor(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) = ifloor(n / d) + (n % d) / d >= 0.5 ? 1 : 0 - = ifloor(n / d) + 2(n % d) >= d ? 1 : 0 - s < 0: - round(n / d) =-ifloor(n / d) - (n % d) / d > 0.5 ? 1 : 0 - =-ifloor(n / d) - 2(n % d) > d ? 1 : 0 - - =>: - - round(s * n / d) = s * ifloor(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(ifloor(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); - }, - - /** - * 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) - ⇔ k = floor((a * y) / (b * x)) - */ - - parse(a, b); - - const n = this['n'] * P['d']; - const d = this['d'] * P['n']; - const r = n % d; - - // round(n / d) = ifloor(n / d) + 2(n % d) >= d ? 1 : 0 - let k = ifloor(n / d); - if (r + r >= d) { - k++; - } - return newFraction(this['s'] * k * P['n'], P['d']); - }, - - /** - * Check if two rational numbers are divisible - * - * Ex: new Fraction(19.6).divisible(1.5); - */ - "divisible": function (a, b) { - - parse(a, b); - if (P['n'] === C_ZERO) return false; - return (this['n'] * P['d']) % (P['n'] * this['d']) === C_ZERO; - }, - - /** - * Returns a decimal representation of the fraction - * - * Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183 - **/ - 'valueOf': function () { - //if (this['n'] <= MAX_INTEGER && this['d'] <= MAX_INTEGER) { - 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 = 15) { - - let N = this["n"]; - let D = this["d"]; - - 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 += ifloor(N / D); - - N %= D; - N *= C_TEN; - - if (N) - str += "."; - - if (cycLen) { - - for (let i = cycOff; i--;) { - str += ifloor(N / D); - N %= D; - N *= C_TEN; - } - str += "("; - for (let i = cycLen; i--;) { - str += ifloor(N / D); - N %= D; - N *= C_TEN; - } - str += ")"; - } else { - for (let i = dec; N && i--;) { - str += ifloor(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 (showMixed = false) { - - let n = this["n"]; - let d = this["d"]; - let str = this['s'] < C_ZERO ? "-" : ""; - - if (d === C_ONE) { - str += n; - } else { - const whole = ifloor(n / d); - if (showMixed && 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 (showMixed = false) { - - let n = this["n"]; - let d = this["d"]; - let str = this['s'] < C_ZERO ? "-" : ""; - - if (d === C_ONE) { - str += n; - } else { - const whole = ifloor(n / d); - if (showMixed && 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']; - const res = []; - - while (b) { - res.push(ifloor(a / b)); - const t = a % b; - a = b; - b = t; - } - return res; - }, - - "simplify": function (eps = 1e-3) { - - // Continued fractions give best approximations for a max denominator, - // generally outperforming mediants in denominator–accuracy trade-offs. - // Semiconvergents can further reduce the denominator within tolerance. - - const ieps = BigInt(Math.ceil(1 / eps)); - - 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]); - } - - let t = s['sub'](thisABS); - if (t['n'] * ieps < t['d']) { // More robust than Math.abs(t.valueOf()) < eps - return s['mul'](this['s']); - } - } - return this; - } -}; diff --git a/node_modules/fraction.js/tests/fraction.test.js b/node_modules/fraction.js/tests/fraction.test.js deleted file mode 100644 index b65833c..0000000 --- a/node_modules/fraction.js/tests/fraction.test.js +++ /dev/null @@ -1,1806 +0,0 @@ -const Fraction = require('fraction.js'); -const assert = require('assert'); - -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"); }; - -var tests = [{ - set: "", - expectError: InvalidParameter() -}, { - set: "foo", - expectError: InvalidParameter() -}, { - set: " 123", - expectError: InvalidParameter() -}, { - set: 0, - expect: 0 -}, { - set: .2, - expect: "0.2" -}, { - set: .333, - expect: "0.333" -}, { - set: 1.1, - expect: "1.1" -}, { - set: 1.2, - expect: "1.2" -}, { - set: 1.3, - expect: "1.3" -}, { - set: 1.4, - expect: "1.4" -}, { - set: 1.5, - expect: "1.5" -}, { - set: 2.555, - expect: "2.555" -}, { - set: 1e12, - expect: "1000000000000" -}, { - set: " - ", - expectError: InvalidParameter() -}, { - set: ".5", - expect: "0.5" -}, { - set: "2_000_000", - expect: "2000000" -}, { - set: "-.5", - expect: "-0.5" -}, { - set: "123", - expect: "123" -}, { - set: "-123", - expect: "-123" -}, { - set: "123.4", - expect: "123.4" -}, { - set: "-123.4", - expect: "-123.4" -}, { - set: "123.", - expect: "123" -}, { - set: "-123.", - expect: "-123" -}, { - set: "123.4(56)", - expect: "123.4(56)" -}, { - set: "-123.4(56)", - expect: "-123.4(56)" -}, { - set: "123.(4)", - expect: "123.(4)" -}, { - set: "-123.(4)", - expect: "-123.(4)" -}, { - set: "0/0", - expectError: DivisionByZero() -}, { - set: "9/0", - expectError: DivisionByZero() -}, { - label: "0/1+0/1", - set: "0/1", - param: "0/1", - expect: "0" -}, { - label: "1/9+0/1", - set: "1/9", - param: "0/1", - expect: "0.(1)" -}, { - set: "123/456", - expect: "0.269(736842105263157894)" -}, { - set: "-123/456", - expect: "-0.269(736842105263157894)" -}, { - set: "19 123/456", - expect: "19.269(736842105263157894)" -}, { - set: "-19 123/456", - expect: "-19.269(736842105263157894)" -}, { - set: "123.(22)123", - expectError: InvalidParameter() -}, { - set: "+33.3(3)", - expect: "33.(3)" -}, { - set: "3.'09009'", - expect: "3.(09009)" -}, { - set: "123.(((", - expectError: InvalidParameter() -}, { - set: "123.((", - expectError: InvalidParameter() -}, { - set: "123.()", - expectError: InvalidParameter() -}, { - set: null, - expect: "0" // I would say it's just fine -}, { - set: [22, 7], - expect: '3.(142857)' // We got Pi! - almost ;o -}, { - set: "355/113", - expect: "3.(1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168)" // Yay, a better PI -}, { - set: "3 1/7", - expect: '3.(142857)' -}, { - set: [36, -36], - expect: "-1" -}, { - set: [1n, 3n], - expect: "0.(3)" -}, { - set: 1n, - set2: 3n, - expect: "0.(3)" -}, { - set: { n: 1n, d: 3n }, - expect: "0.(3)" -}, { - set: { n: 1n, d: 3n }, - expect: "0.(3)" -}, { - set: [1n, 3n], - expect: "0.(3)" -}, { - set: "9/12", - expect: "0.75" -}, { - set: "0.09(33)", - expect: "0.09(3)" -}, { - set: 1 / 2, - expect: "0.5" -}, { - set: 1 / 3, - expect: "0.(3)" -}, { - set: "0.'3'", - expect: "0.(3)" -}, { - set: "0.00002", - expect: "0.00002" -}, { - set: 7 / 8, - expect: "0.875" -}, { - set: 0.003, - expect: "0.003" -}, { - set: 4, - expect: "4" -}, { - set: -99, - expect: "-99" -}, { - set: "-92332.1192", - expect: "-92332.1192" -}, { - set: '88.92933(12111)', - expect: "88.92933(12111)" -}, { - set: '-192322.823(123)', - expect: "-192322.8(231)" -}, { - label: "-99.12 % 0.09(34)", - set: '-99.12', - fn: "mod", - param: "0.09(34)", - expect: "-0.07(95)" -}, { - label: "0.4 / 0.1", - set: .4, - fn: "div", - param: ".1", - expect: "4" -}, { - label: "1 / -.1", - set: 1, - fn: "div", - param: "-.1", - expect: "-10" -}, { - label: "1 - (-1)", - set: 1, - fn: "sub", - param: "-1", - expect: "2" -}, { - label: "1 + (-1)", - set: 1, - fn: "add", - param: "-1", - expect: "0" -}, { - label: "-187 % 12", - set: '-187', - fn: "mod", - param: "12", - expect: "-7" -}, { - label: "Negate by 99 * -1", - set: '99', - fn: "mul", - param: "-1", - expect: "-99" -}, { - label: "0.5050000000000000000000000", - set: "0.5050000000000000000000000", - expect: "101/200", - fn: "toFraction", - param: true -}, { - label: "0.505000000(0000000000)", - set: "0.505000000(0000000000)", - expect: "101/200", - fn: "toFraction", - param: true -}, { - set: [20, -5], - expect: "-4", - fn: "toFraction", - param: true -}, { - set: [-10, -7], - expect: "1 3/7", - fn: "toFraction", - param: true -}, { - set: [21, -6], - expect: "-3 1/2", - fn: "toFraction", - param: true -}, { - set: "10/78", - expect: "5/39", - fn: "toFraction", - param: true -}, { - set: "0/91", - expect: "0", - fn: "toFraction", - param: true -}, { - set: "-0/287", - expect: "0", - fn: "toFraction", - param: true -}, { - set: "-5/20", - expect: "-1/4", - fn: "toFraction", - param: true -}, { - set: "42/9", - expect: "4 2/3", - fn: "toFraction", - param: true -}, { - set: "71/23", - expect: "3 2/23", - fn: "toFraction", - param: true -}, { - set: "6/3", - expect: "2", - fn: "toFraction", - param: true -}, { - set: "28/4", - expect: "7", - fn: "toFraction", - param: true -}, { - set: "105/35", - expect: "3", - fn: "toFraction", - param: true -}, { - set: "4/6", - expect: "2/3", - fn: "toFraction", - param: true -}, { - label: "99.(9) + 66", - set: '99.(999999)', - fn: "add", - param: "66", - expect: "166" -}, { - label: "123.32 / 33.'9821'", - set: '123.32', - fn: "div", - param: "33.'9821'", - expect: "3.628958880242975" -}, { - label: "-82.124 / 66.(3)", - set: '-82.124', - fn: "div", - param: "66.(3)", - expect: "-1.238(050251256281407035175879396984924623115577889447236180904522613065326633165829145728643216080402010)" -}, { - label: "100 - .91", - set: '100', - fn: "sub", - param: ".91", - expect: "99.09" -}, { - label: "381.(33411) % 11.119(356)", - set: '381.(33411)', - fn: "mod", - param: "11.119(356)", - expect: "3.275(997225017295217)" -}, { - label: "13/26 mod 1", - set: '13/26', - fn: "mod", - param: "1.000", - expect: "0.5" -}, { - label: "381.(33411) % 1", // Extract fraction part of a number - set: '381.(33411)', - fn: "mod", - param: "1", - expect: "0.(33411)" -}, { - label: "-222/3", - set: { - n: 3, - d: 222, - s: -1 - }, - fn: "inverse", - param: null, - expect: "-74" -}, { - label: "inverse", - set: 1 / 2, - fn: "inverse", - param: null, - expect: "2" -}, { - label: "abs(-222/3)", - set: { - n: -222, - d: 3 - }, - fn: "abs", - param: null, - expect: "74" -}, { - label: "9 % -2", - set: 9, - fn: "mod", - param: "-2", - expect: "1" -}, { - label: "-9 % 2", - set: '-9', - fn: "mod", - param: "-2", - expect: "-1" -}, { - label: "1 / 195312500", - set: '1', - fn: "div", - param: "195312500", - expect: "0.00000000512" -}, { - label: "10 / 0", - set: 10, - fn: "div", - param: 0, - expectError: DivisionByZero() -}, { - label: "-3 / 4", - set: [-3, 4], - fn: "inverse", - param: null, - expect: "-1.(3)" -}, { - label: "-19.6", - set: [-98, 5], - fn: "equals", - param: '-19.6', - expect: "true" // actually, we get a real bool but we call toString() in the test below -}, { - label: "-19.6", - set: [98, -5], - fn: "equals", - param: '-19.6', - expect: "true" -}, { - label: "99/88", - set: [99, 88], - fn: "equals", - param: [88, 99], - expect: "false" -}, { - label: "99/88", - set: [99, -88], - fn: "equals", - param: [9, 8], - expect: "false" -}, { - label: "12.5", - set: 12.5, - fn: "add", - param: 0, - expect: "12.5" -}, { - label: "0/1 -> 1/0", - set: 0, - fn: "inverse", - param: null, - expectError: DivisionByZero() -}, { - label: "abs(-100.25)", - set: -100.25, - fn: "abs", - param: null, - expect: "100.25" -}, { - label: "0.022222222", - set: '0.0(22222222)', - fn: "abs", - param: null, - expect: "0.0(2)" -}, { - label: "1.5 | 100.5", - set: 100.5, - fn: "divisible", - param: '1.5', - expect: "true" -}, { - label: "1.5 | 100.6", - set: 100.6, - fn: "divisible", - param: 1.6, - expect: "false" -}, { - label: "(1/6) | (2/3)", // == 4 - set: [2, 3], - fn: "divisible", - param: [1, 6], - expect: "true" -}, { - label: "(1/6) | (2/5)", - set: [2, 5], - fn: "divisible", - param: [1, 6], - expect: "false" -}, { - label: "0 | (2/5)", - set: [2, 5], - fn: "divisible", - param: 0, - expect: "false" -}, { - label: "6 | 0", - set: 0, - fn: "divisible", - param: 6, - expect: "true" -}, { - label: "fmod(4.55, 0.05)", // http://phpjs.org/functions/fmod/ (comment section) - set: 4.55, - fn: "mod", - param: 0.05, - expect: "0" -}, { - label: "fmod(99.12, 0.4)", - set: 99.12, - fn: "mod", - param: "0.4", - expect: "0.32" -}, { - label: "fmod(fmod(1.0,0.1))", // http://stackoverflow.com/questions/4218961/why-fmod1-0-0-1-1 - set: 1.0, - fn: "mod", - param: 0.1, - expect: "0" -}, { - label: "bignum", - set: [5385020324, 1673196525], - fn: "add", - param: 0, - expect: "3.21(840276592733181776121606516006839065124164060763872313206005492988936251824931324190982287630557922656455433410609073551596098372245902196097377144624418820138297860736950789447760776337973807350574075570710380240599651018280712721418065340531352107607323652551812465663589637206543923464101146157950573080469432602963360804254598843372567965379918536467197121390148715495330113717514444395585868193217769203770011415724163065662594535928766646225254382476081224230369471990147720394052336440275597631903998844367669243157195775313960803259497565595290726533154854597848271290188102679689703515252041298615534717298077104242133182771222884293284077911887845930112722413166618308629346454087334421161315763550250022184333666363549254920906556389124702491239037207539024741878423396797336762338781453063321417070239253574830368476888869943116813489676593728283053898883754853602746993512910863832926021645903191198654921901657666901979730085800889408373591978384009612977172541043856160291750546158945674358246709841810124486123947693472528578195558946669459524487119048971249805817042322628538808374587079661786890216019304725725509141850506771761314768448972244907094819599867385572056456428511886850828834945135927771544947477105237234460548500123140047759781236696030073335228807028510891749551057667897081007863078128255137273847732859712937785356684266362554153643129279150277938809369688357439064129062782986595074359241811119587401724970711375341877428295519559485099934689381452068220139292962014728066686607540019843156200674036183526020650801913421377683054893985032630879985)" -}, { - label: "ceil(0.4)", - set: 0.4, - fn: "ceil", - param: null, - expect: "1" -}, - - -{ - label: "1 < 2", - set: 1, - fn: "lt", - param: 2, - expect: "true" -}, { - label: "2 < 2", - set: 2, - fn: "lt", - param: 2, - expect: "false" -}, { - label: "3 > 2", - set: 3, - fn: "gt", - param: 2, - expect: "true" -}, { - label: "2 > 2", - set: 2, - fn: "gt", - param: 2, - expect: "false" -}, { - label: "1 <= 2", - set: 1, - fn: "lte", - param: 2, - expect: "true" -}, { - label: "2 <= 2", - set: 2, - fn: "lte", - param: 2, - expect: "true" -}, { - label: "3 <= 2", - set: 3, - fn: "lte", - param: 2, - expect: "false" -}, { - label: "3 >= 2", - set: 3, - fn: "gte", - param: 2, - expect: "true" -}, { - label: "2 >= 2", - set: 2, - fn: "gte", - param: 2, - expect: "true" -}, { - label: "ceil(0.5)", - set: 0.5, - fn: "ceil", - param: null, - expect: "1" -}, { - label: "ceil(0.23, 2)", - set: 0.23, - fn: "ceil", - param: 2, - expect: "0.23" -}, { - label: "ceil(0.6)", - set: 0.6, - fn: "ceil", - param: null, - expect: "1" -}, { - label: "ceil(-0.4)", - set: -0.4, - fn: "ceil", - param: null, - expect: "0" -}, { - label: "ceil(-0.5)", - set: -0.5, - fn: "ceil", - param: null, - expect: "0" -}, { - label: "ceil(-0.6)", - set: -0.6, - fn: "ceil", - param: null, - expect: "0" -}, { - label: "floor(0.4)", - set: 0.4, - fn: "floor", - param: null, - expect: "0" -}, { - label: "floor(0.4, 1)", - set: 0.4, - fn: "floor", - param: 1, - expect: "0.4" -}, { - label: "floor(0.5)", - set: 0.5, - fn: "floor", - param: null, - expect: "0" -}, { - label: "floor(0.6)", - set: 0.6, - fn: "floor", - param: null, - expect: "0" -}, { - label: "floor(-0.4)", - set: -0.4, - fn: "floor", - param: null, - expect: "-1" -}, { - label: "floor(-0.5)", - set: -0.5, - fn: "floor", - param: null, - expect: "-1" -}, { - label: "floor(-0.6)", - set: -0.6, - fn: "floor", - param: null, - expect: "-1" -}, { - label: "floor(10.4)", - set: 10.4, - fn: "floor", - param: null, - expect: "10" -}, { - label: "floor(10.4, 1)", - set: 10.4, - fn: "floor", - param: 1, - expect: "10.4" -}, { - label: "floor(10.5)", - set: 10.5, - fn: "floor", - param: null, - expect: "10" -}, { - label: "floor(10.6)", - set: 10.6, - fn: "floor", - param: null, - expect: "10" -}, { - label: "floor(-10.4)", - set: -10.4, - fn: "floor", - param: null, - expect: "-11" -}, { - label: "floor(-10.5)", - set: -10.5, - fn: "floor", - param: null, - expect: "-11" -}, { - label: "floor(-10.6)", - set: -10.6, - fn: "floor", - param: null, - expect: "-11" -}, { - label: "floor(-10.543,3)", - set: -10.543, - fn: "floor", - param: 3, - expect: "-10.543" -}, { - label: "floor(10.543,3)", - set: 10.543, - fn: "floor", - param: 3, - expect: "10.543" -}, { - label: "round(-10.543,3)", - set: -10.543, - fn: "round", - param: 3, - expect: "-10.543" -}, { - label: "round(10.543,3)", - set: 10.543, - fn: "round", - param: 3, - expect: "10.543" -}, { - label: "round(10.4)", - set: 10.4, - fn: "round", - param: null, - expect: "10" -}, { - label: "round(10.5)", - set: 10.5, - fn: "round", - param: null, - expect: "11" -}, { - label: "round(10.5, 1)", - set: 10.5, - fn: "round", - param: 1, - expect: "10.5" -}, { - label: "round(10.6)", - set: 10.6, - fn: "round", - param: null, - expect: "11" -}, { - label: "round(-10.4)", - set: -10.4, - fn: "round", - param: null, - expect: "-10" -}, { - label: "round(-10.5)", - set: -10.5, - fn: "round", - param: null, - expect: "-10" -}, { - label: "round(-10.6)", - set: -10.6, - fn: "round", - param: null, - expect: "-11" -}, { - label: "round(-0.4)", - set: -0.4, - fn: "round", - param: null, - expect: "0" -}, { - label: "round(-0.5)", - set: -0.5, - fn: "round", - param: null, - expect: "0" -}, { - label: "round(-0.6)", - set: -0.6, - fn: "round", - param: null, - expect: "-1" -}, { - label: "round(-0)", - set: -0, - fn: "round", - param: null, - expect: "0" -}, { - label: "round(big fraction)", - set: [ - '409652136432929109317120'.repeat(100), - '63723676445298091081155'.repeat(100) - ], - fn: "round", - param: null, - expect: "6428570341270001560623330590225448467479093479780591305451264291405695842465355472558570608574213642" -}, { - label: "round(big numerator)", - set: ['409652136432929109317'.repeat(100), 10], - fn: "round", - param: null, - expect: '409652136432929109317'.repeat(99) + '40965213643292910932' -}, { - label: "17402216385200408/5539306332998545", - set: [17402216385200408, 5539306332998545], - fn: "add", - param: 0, - expect: "3.141587653589870" -}, { - label: "17402216385200401/553930633299855", - set: [17402216385200401, 553930633299855], - fn: "add", - param: 0, - expect: "31.415876535898660" -}, { - label: "1283191/418183", - set: [1283191, 418183], - fn: "add", - param: 0, - expect: "3.068491545567371" -}, { - label: "1.001", - set: "1.001", - fn: "add", - param: 0, - expect: "1.001" -}, { - label: "99+1", - set: [99, 1], - fn: "add", - param: 1, - expect: "100" -}, { - label: "gcd(5/8, 3/7)", - set: [5, 8], - fn: "gcd", - param: [3, 7], - expect: "0.017(857142)" // == 1/56 -}, { - label: "gcd(52, 39)", - set: 52, - fn: "gcd", - param: 39, - expect: "13" -}, { - label: "gcd(51357, 3819)", - set: 51357, - fn: "gcd", - param: 3819, - expect: "57" -}, { - label: "gcd(841, 299)", - set: 841, - fn: "gcd", - param: 299, - expect: "1" -}, { - label: "gcd(2/3, 7/5)", - set: [2, 3], - fn: "gcd", - param: [7, 5], - expect: "0.0(6)" // == 1/15 -}, { - label: "lcm(-3, 3)", - set: -3, - fn: "lcm", - param: 3, - expect: "3" -}, { - label: "lcm(3,-3)", - set: 3, - fn: "lcm", - param: -3, - expect: "3" -}, { - label: "lcm(0,3)", - set: 0, - fn: "lcm", - param: 3, - expect: "0" -}, { - label: "lcm(3, 0)", - set: 3, - fn: "lcm", - param: 0, - expect: "0" -}, { - label: "lcm(0, 0)", - set: 0, - fn: "lcm", - param: 0, - expect: "0" -}, { - label: "lcm(200, 333)", - set: 200, - fn: "lcm", - param: 333, expect: "66600" -}, -{ - label: "1 + -1", - set: 1, - fn: "add", - param: -1, - expect: "0" -}, { - label: "3/10+3/14", - set: "3/10", - fn: "add", - param: "3/14", - expect: "0.5(142857)" -}, { - label: "3/10-3/14", - set: "3/10", - fn: "sub", - param: "3/14", - expect: "0.0(857142)" -}, { - label: "3/10*3/14", - set: "3/10", - fn: "mul", - param: "3/14", - expect: "0.06(428571)" -}, { - label: "3/10 / 3/14", - set: "3/10", - fn: "div", - param: "3/14", - expect: "1.4" -}, { - label: "1-2", - set: "1", - fn: "sub", - param: "2", - expect: "-1" -}, { - label: "1--1", - set: "1", - fn: "sub", - param: "-1", - expect: "2" -}, { - label: "0/1*1/3", - set: "0/1", - fn: "mul", - param: "1/3", - expect: "0" -}, { - label: "3/10 * 8/12", - set: "3/10", - fn: "mul", - param: "8/12", - expect: "0.2" -}, { - label: ".5+5", - set: ".5", - fn: "add", - param: 5, expect: "5.5" -}, -{ - label: "10/12-5/60", - set: "10/12", - fn: "sub", - param: "5/60", - expect: "0.75" -}, { - label: "10/15 / 3/4", - set: "10/15", - fn: "div", - param: "3/4", - expect: "0.(8)" -}, { - label: "1/4 + 3/8", - set: "1/4", - fn: "add", - param: "3/8", - expect: "0.625" -}, { - label: "2-1/3", - set: "2", - fn: "sub", - param: "1/3", - expect: "1.(6)" -}, { - label: "5*6", - set: "5", - fn: "mul", - param: 6, - expect: "30" -}, { - label: "1/2-1/5", - set: "1/2", - fn: "sub", - param: "1/5", - expect: "0.3" -}, { - label: "1/2-5", - set: "1/2", - fn: "add", - param: -5, - expect: "-4.5" -}, { - label: "1*-1", - set: "1", - fn: "mul", - param: -1, - expect: "-1" -}, { - label: "5/10", - set: 5.0, - fn: "div", - param: 10, - expect: "0.5" -}, { - label: "1/-1", - set: "1", - fn: "div", - param: -1, - expect: "-1" -}, { - label: "4/5 + 13/2", - set: "4/5", - fn: "add", - param: "13/2", - expect: "7.3" -}, { - label: "4/5 + 61/2", - set: "4/5", - fn: "add", - param: "61/2", - expect: "31.3" -}, { - label: "0.8 + 6.5", - set: "0.8", - fn: "add", - param: "6.5", - expect: "7.3" -}, { - label: "2/7 inverse", - set: "2/7", - fn: "inverse", - param: null, - expect: "3.5" -}, { - label: "neg 1/3", - set: "1/3", - fn: "neg", - param: null, - expect: "-0.(3)" -}, { - label: "1/2+1/3", - set: "1/2", - fn: "add", - param: "1/3", - expect: "0.8(3)" -}, { - label: "1/2+3", - set: ".5", - fn: "add", - param: 3, - expect: "3.5" -}, { - label: "1/2+3.14", - set: "1/2", - fn: "add", - param: "3.14", - expect: "3.64" -}, { - label: "3.5 < 4.1", - set: 3.5, - fn: "compare", - param: 4.1, - expect: "-1" -}, { - label: "3.5 > 4.1", - set: 4.1, - fn: "compare", - param: 3.1, - expect: "1" -}, { - label: "-3.5 > -4.1", - set: -3.5, - fn: "compare", - param: -4.1, - expect: "1" -}, { - label: "-3.5 > -4.1", - set: -4.1, - fn: "compare", - param: -3.5, - expect: "-1" -}, { - label: "4.3 == 4.3", - set: 4.3, - fn: "compare", - param: 4.3, - expect: "0" -}, { - label: "-4.3 == -4.3", - set: -4.3, - fn: "compare", - param: -4.3, - expect: "0" -}, { - label: "-4.3 < 4.3", - set: -4.3, - fn: "compare", - param: 4.3, - expect: "-1" -}, { - label: "4.3 == -4.3", - set: 4.3, - fn: "compare", - param: -4.3, - expect: "1" -}, { - label: "2^0.5", - set: 2, - fn: "pow", - param: 0.5, - expect: "null" -}, { - label: "(-8/27)^(1/3)", - set: [-8, 27], - fn: "pow", - param: [1, 3], - expect: "null" -}, { - label: "(-8/27)^(2/3)", - set: [-8, 27], - fn: "pow", - param: [2, 3], - expect: "null" -}, { - label: "(-32/243)^(5/3)", - set: [-32, 243], - fn: "pow", - param: [5, 3], - expect: "null" -}, { - label: "sqrt(0)", - set: 0, - fn: "pow", - param: 0.5, - expect: "0" -}, { - label: "27^(2/3)", - set: 27, - fn: "pow", - param: "2/3", - expect: "9" -}, { - label: "(243/1024)^(2/5)", - set: "243/1024", - fn: "pow", - param: "2/5", - expect: "0.5625" -}, { - label: "-0.5^-3", - set: -0.5, - fn: "pow", - param: -3, - expect: "-8" -}, { - label: "", - set: -3, - fn: "pow", - param: -3, - expect: "-0.(037)" -}, { - label: "-3", - set: -3, - fn: "pow", - param: 2, - expect: "9" -}, { - label: "-3", - set: -3, - fn: "pow", - param: 3, - expect: "-27" -}, { - label: "0^0", - set: 0, - fn: "pow", - param: 0, - expect: "1" -}, { - label: "2/3^7", - set: [2, 3], - fn: "pow", - param: 7, - expect: "0.(058527663465935070873342478280749885688157293095564700502972107910379515317786922725194330132601737540009144947416552354823959762231367169638774577046181984453589391860996799268404206675811614083219021490626428898033836305441243712848651120256)" -}, { - label: "-0.6^4", - set: -0.6, - fn: "pow", - param: 4, - expect: "0.1296" -}, { - label: "8128371:12394 - 8128371/12394", - set: "8128371:12394", - fn: "sub", - param: "8128371/12394", - expect: "0" -}, { - label: "3/4 + 1/4", - set: "3/4", - fn: "add", - param: "1/4", - expect: "1" -}, { - label: "1/10 + 2/10", - set: "1/10", - fn: "add", - param: "2/10", - expect: "0.3" -}, { - label: "5/10 + 2/10", - set: "5/10", - fn: "add", - param: "2/10", - expect: "0.7" -}, { - label: "18/10 + 2/10", - set: "18/10", - fn: "add", - param: "2/10", - expect: "2" -}, { - label: "1/3 + 1/6", - set: "1/3", - fn: "add", - param: "1/6", - expect: "0.5" -}, { - label: "1/3 + 2/6", - set: "1/3", - fn: "add", - param: "2/6", - expect: "0.(6)" -}, { - label: "3/4 / 1/4", - set: "3/4", - fn: "div", - param: "1/4", - expect: "3" -}, { - label: "1/10 / 2/10", - set: "1/10", - fn: "div", - param: "2/10", - expect: "0.5" -}, { - label: "5/10 / 2/10", - set: "5/10", - fn: "div", - param: "2/10", - expect: "2.5" -}, { - label: "18/10 / 2/10", - set: "18/10", - fn: "div", - param: "2/10", - expect: "9" -}, { - label: "1/3 / 1/6", - set: "1/3", - fn: "div", - param: "1/6", - expect: "2" -}, { - label: "1/3 / 2/6", - set: "1/3", - fn: "div", - param: "2/6", - expect: "1" -}, { - label: "3/4 * 1/4", - set: "3/4", - fn: "mul", - param: "1/4", - expect: "0.1875" -}, { - label: "1/10 * 2/10", - set: "1/10", - fn: "mul", - param: "2/10", - expect: "0.02" -}, { - label: "5/10 * 2/10", - set: "5/10", - fn: "mul", - param: "2/10", - expect: "0.1" -}, { - label: "18/10 * 2/10", - set: "18/10", - fn: "mul", - param: "2/10", - expect: "0.36" -}, { - label: "1/3 * 1/6", - set: "1/3", - fn: "mul", - param: "1/6", - expect: "0.0(5)" -}, { - label: "1/3 * 2/6", - set: "1/3", - fn: "mul", - param: "2/6", - expect: "0.(1)" -}, { - label: "5/4 - 1/4", - set: "5/4", - fn: "sub", - param: "1/4", - expect: "1" -}, { - label: "5/10 - 2/10", - set: "5/10", - fn: "sub", - param: "2/10", - expect: "0.3" -}, { - label: "9/10 - 2/10", - set: "9/10", - fn: "sub", - param: "2/10", - expect: "0.7" -}, { - label: "22/10 - 2/10", - set: "22/10", - fn: "sub", - param: "2/10", - expect: "2" -}, { - label: "2/3 - 1/6", - set: "2/3", - fn: "sub", - param: "1/6", - expect: "0.5" -}, { - label: "3/3 - 2/6", - set: "3/3", - fn: "sub", - param: "2/6", - expect: "0.(6)" -}, { - label: "0.006999999999999999", - set: 0.006999999999999999, - fn: "add", - param: 0, - expect: "0.007" -}, { - label: "1/7 - 1", - set: 1 / 7, - fn: "add", - param: -1, - expect: "-0.(857142)" -}, { - label: "0.0065 + 0.0005", - set: 0.0065, - fn: "add", - param: 0.0005, - expect: "0.007" -}, { - label: "6.5/.5", - set: 6.5, - fn: "div", - param: .5, - expect: "13" -}, { - label: "0.999999999999999999999999999", - set: 0.999999999999999999999999999, - fn: "sub", - param: 1, - expect: "0" -}, { - label: "0.5833333333333334", - set: 0.5833333333333334, - fn: "add", - param: 0, - expect: "0.58(3)" -}, { - label: "1.75/3", - set: 1.75 / 3, - fn: "add", - param: 0, - expect: "0.58(3)" -}, { - label: "3.3333333333333", - set: 3.3333333333333, - fn: "add", - param: 0, - expect: "3.(3)" -}, { - label: "4.285714285714285714285714", - set: 4.285714285714285714285714, - fn: "add", - param: 0, - expect: "4.(285714)" -}, { - label: "-4", - set: -4, - fn: "neg", - param: 0, - expect: "4" -}, { - label: "4", - set: 4, - fn: "neg", - param: 0, - expect: "-4" -}, { - label: "0", - set: 0, - fn: "neg", - param: 0, - expect: "0" -}, { - label: "6869570742453802/5329686054127205", - set: "6869570742453802/5329686054127205", - fn: "neg", - param: 0, - expect: "-1.288925965373540" -}, { - label: "686970702/53212205", - set: "686970702/53212205", - fn: "neg", - param: 0, - expect: "-12.910021338149772" -}, { - label: "1/3000000000000000", - set: "1/3000000000000000", - fn: "add", - param: 0, - expect: "0.000000000000000(3)" -}, { - label: "toString(15) .0000000000000003", - set: ".0000000000000003", - fn: "toString", - param: 15, - expect: "0.000000000000000" -}, { - label: "toString(16) .0000000000000003", - set: ".0000000000000003", - fn: "toString", - param: 16, - expect: "0.0000000000000003" -}, { - label: "12 / 4.3", - set: 12, - set2: 4.3, - fn: "toString", - param: null, - expectError: NonIntegerParameter() -}, { - label: "12.5 / 4", - set: 12.5, - set2: 4, - fn: "toString", - param: null, - expectError: NonIntegerParameter() -}, { - label: "0.9 round to multiple of 1/8", - set: .9, - fn: "roundTo", - param: "1/8", - expect: "0.875" -}, { - label: "1/3 round to multiple of 1/16", - set: 1 / 3, - fn: "roundTo", - param: "1/16", - expect: "0.3125" -}, { - label: "1/3 round to multiple of 1/16", - set: -1 / 3, - fn: "roundTo", - param: "1/16", - expect: "-0.3125" -}, { - label: "1/2 round to multiple of 1/4", - set: 1 / 2, - fn: "roundTo", - param: "1/4", - expect: "0.5" -}, { - label: "1/4 round to multiple of 1/2", - set: 1 / 4, - fn: "roundTo", - param: "1/2", - expect: "0.5" -}, { - label: "10/3 round to multiple of 1/2", - set: "10/3", - fn: "roundTo", - param: "1/2", - expect: "3.5" -}, { - label: "-10/3 round to multiple of 1/2", - set: "-10/3", - fn: "roundTo", - param: "1/2", - expect: "-3.5" -}, { - label: "log_2(8)", - set: "8", - fn: "log", - param: "2", - expect: "3" // because 2^3 = 8 -}, { - label: "log_2(3)", - set: "3", - fn: "log", - param: "2", - expect: 'null' // because 2^(p/q) != 3 -}, { - label: "log_10(1000)", - set: "1000", - fn: "log", - param: "10", - expect: "3" // because 10^3 = 1000 -}, { - label: "log_27(81)", - set: "81", - fn: "log", - param: "27", - expect: "1.(3)" // because 27^(4/3) = 81 -}, { - label: "log_27(9)", - set: "9", - fn: "log", - param: "27", - expect: "0.(6)" // because 27^(2/3) = 9 -}, { - label: "log_9/4(27/8)", - set: "27/8", - fn: "log", - param: "9/4", - expect: "1.5" // because (9/4)^(3/2) = 27/8 -}]; - -describe('Fraction', function () { - for (var i = 0; i < tests.length; i++) { - - (function (i) { - var action; - - if (tests[i].fn) { - action = function () { - var x = Fraction(tests[i].set, tests[i].set2)[tests[i].fn](tests[i].param); - if (x === null) return "null"; - return x.toString(); - }; - } else { - action = function () { - var x = new Fraction(tests[i].set, tests[i].set2); - if (x === null) return "null"; - return x.toString(); - }; - } - - it(String(tests[i].label || tests[i].set), function () { - if (tests[i].expectError) { - assert.throws(action, tests[i].expectError); - } else { - assert.equal(action(), tests[i].expect); - } - }); - - })(i); - } -}); - -describe('JSON', function () { - - it("Should be possible to stringify the object", function () { - - if (typeof Fraction(1).n !== 'number') { - return; - } - assert.equal('{"s":1,"n":14623,"d":330}', JSON.stringify(new Fraction("44.3(12)"))); - assert.equal('{"s":-1,"n":2,"d":1}', JSON.stringify(new Fraction(-1 / 2).inverse())); - }); -}); - -describe('Arguments', function () { - - it("Should be possible to use different kind of params", function () { - - // String - var fraction = new Fraction("0.1"); - assert.equal("1/10", fraction.n + "/" + fraction.d); - - var fraction = new Fraction("6234/6460"); - assert.equal("3117/3230", fraction.n + "/" + fraction.d); - - // Two params - var fraction = new Fraction(1, 2); - assert.equal("1/2", fraction.n + "/" + fraction.d); - - // Object - var fraction = new Fraction({ n: 1, d: 3 }); - assert.equal("1/3", fraction.n + "/" + fraction.d); - - // Array - var fraction = new Fraction([1, 4]); - assert.equal("1/4", fraction.n + "/" + fraction.d); - }); -}); - -describe('fractions', function () { - - it("Should pass 0.08 = 2/25", function () { - - var fraction = new Fraction("0.08"); - assert.equal("2/25", fraction.n + "/" + fraction.d); - }); - - it("Should pass 0.200 = 1/5", function () { - - var fraction = new Fraction("0.200"); - assert.equal("1/5", fraction.n + "/" + fraction.d); - }); - - it("Should pass 0.125 = 1/8", function () { - - var fraction = new Fraction("0.125"); - assert.equal("1/8", fraction.n + "/" + fraction.d); - }); - - it("Should pass 8.36 = 209/25", function () { - - var fraction = new Fraction(8.36); - assert.equal("209/25", fraction.n + "/" + fraction.d); - }); - -}); - -describe('constructors', function () { - - it("Should pass 0.08 = 2/25", function () { - - var tmp = new Fraction({ d: 4, n: 2, s: -1 }); - assert.equal("-1/2", tmp.s * tmp.n + "/" + tmp.d); - - var tmp = new Fraction(-88.3); - assert.equal("-883/10", tmp.s * tmp.n + "/" + tmp.d); - - var tmp = new Fraction(-88.3).clone(); - assert.equal("-883/10", tmp.s * tmp.n + "/" + tmp.d); - - var tmp = new Fraction("123.'3'"); - assert.equal("370/3", tmp.s * tmp.n + "/" + tmp.d); - - var tmp = new Fraction("123.'3'").clone(); - assert.equal("370/3", tmp.s * tmp.n + "/" + tmp.d); - - var tmp = new Fraction([-1023461776, 334639305]); - tmp = tmp.add([4, 25]); - assert.equal("-4849597436/1673196525", tmp.s * tmp.n + "/" + tmp.d); - }); -}); - -describe('Latex Output', function () { - - it("Should pass 123.'3' = \\frac{370}{3}", function () { - - var tmp = new Fraction("123.'3'"); - assert.equal("\\frac{370}{3}", tmp.toLatex()); - }); - - it("Should pass 1.'3' = \\frac{4}{3}", function () { - - var tmp = new Fraction("1.'3'"); - assert.equal("\\frac{4}{3}", tmp.toLatex()); - }); - - it("Should pass -1.0000000000 = -1", function () { - - var tmp = new Fraction("-1.0000000000"); - assert.equal('-1', tmp.toLatex()); - }); - - it("Should pass -0.0000000000 = 0", function () { - - var tmp = new Fraction("-0.0000000000"); - assert.equal('0', tmp.toLatex()); - }); -}); - -describe('Fraction Output', function () { - - it("Should pass 123.'3' = 123 1/3", function () { - - var tmp = new Fraction("123.'3'"); - assert.equal('370/3', tmp.toFraction()); - }); - - it("Should pass 1.'3' = 1 1/3", function () { - - var tmp = new Fraction("1.'3'"); - assert.equal('4/3', tmp.toFraction()); - }); - - it("Should pass -1.0000000000 = -1", function () { - - var tmp = new Fraction("-1.0000000000"); - assert.equal('-1', tmp.toFraction()); - }); - - it("Should pass -0.0000000000 = 0", function () { - - var tmp = new Fraction("-0.0000000000"); - assert.equal('0', tmp.toFraction()); - }); - - it("Should pass 1/-99/293 = -1/29007", function () { - - var tmp = new Fraction(-99).inverse().div(293); - assert.equal('-1/29007', tmp.toFraction()); - }); - - it('Should work with large calculations', function () { - var x = Fraction(1123875); - var y = Fraction(1238750184); - var z = Fraction(1657134); - var r = Fraction(77344464613500, 92063); - assert.equal(x.mul(y).div(z).toFraction(), r.toFraction()); - }); -}); - -describe('Fraction toContinued', function () { - - it("Should pass 415/93", function () { - - var tmp = new Fraction(415, 93); - assert.equal('4,2,6,7', tmp.toContinued().toString()); - }); - - it("Should pass 0/2", function () { - - var tmp = new Fraction(0, 2); - assert.equal('0', tmp.toContinued().toString()); - }); - - it("Should pass 1/7", function () { - - var tmp = new Fraction(1, 7); - assert.equal('0,7', tmp.toContinued().toString()); - }); - - it("Should pass 23/88", function () { - - var tmp = new Fraction('23/88'); - assert.equal('0,3,1,4,1,3', tmp.toContinued().toString()); - }); - - it("Should pass 1/99", function () { - - var tmp = new Fraction('1/99'); - assert.equal('0,99', tmp.toContinued().toString()); - }); - - it("Should pass 1768/99", function () { - - var tmp = new Fraction('1768/99'); - assert.equal('17,1,6,14', tmp.toContinued().toString()); - }); - - it("Should pass 1768/99", function () { - - var tmp = new Fraction('7/8'); - assert.equal('0,1,7', tmp.toContinued().toString()); - }); - -}); - - -describe('Fraction simplify', function () { - - it("Should pass 415/93", function () { - - var tmp = new Fraction(415, 93); - assert.equal('9/2', tmp.simplify(0.1).toFraction()); - assert.equal('58/13', tmp.simplify(0.01).toFraction()); - assert.equal('415/93', tmp.simplify(0.0001).toFraction()); - }); - -}); diff --git a/node_modules/fresh/HISTORY.md b/node_modules/fresh/HISTORY.md index fd3888a..4586996 100644 --- a/node_modules/fresh/HISTORY.md +++ b/node_modules/fresh/HISTORY.md @@ -1,13 +1,3 @@ -2.0.0 - 2024-09-04 -========== - * Drop support for Node.js <18 - -1.0.0 - 2024-09-04 -========== - - * Drop support for Node.js below 0.8 - * Fix: Ignore `If-Modified-Since` in the presence of `If-None-Match`, according to [spec](https://www.rfc-editor.org/rfc/rfc9110.html#section-13.1.3-5). Fixes [#35](https://github.com/jshttp/fresh/issues/35) - 0.5.2 / 2017-09-13 ================== diff --git a/node_modules/fresh/README.md b/node_modules/fresh/README.md index fd79c5b..1c1c680 100644 --- a/node_modules/fresh/README.md +++ b/node_modules/fresh/README.md @@ -3,7 +3,7 @@ [![NPM Version][npm-image]][npm-url] [![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] +[![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] HTTP response freshness testing @@ -20,6 +20,8 @@ $ npm install fresh ## API + + ```js var fresh = require('fresh') ``` @@ -40,7 +42,7 @@ to make handling these requests transparent. This module is designed to only follow the HTTP specifications, not to work-around all kinda of client bugs (especially since this module -typically does not receive enough information to understand what the +typically does not recieve enough information to understand what the client actually is). There is a known issue that in certain versions of Safari, Safari @@ -55,16 +57,16 @@ links to further reading on this Safari bug. ### API usage - + ```js var reqHeaders = { 'if-none-match': '"foo"' } -var resHeaders = { etag: '"bar"' } +var resHeaders = { 'etag': '"bar"' } fresh(reqHeaders, resHeaders) // => false var reqHeaders = { 'if-none-match': '"foo"' } -var resHeaders = { etag: '"foo"' } +var resHeaders = { 'etag': '"foo"' } fresh(reqHeaders, resHeaders) // => true ``` @@ -93,7 +95,7 @@ var server = http.createServer(function (req, res) { function isFresh (req, res) { return fresh(req.headers, { - etag: res.getHeader('ETag'), + 'etag': res.getHeader('ETag'), 'last-modified': res.getHeader('Last-Modified') }) } @@ -105,12 +107,12 @@ server.listen(3000) [MIT](LICENSE) -[ci-image]: https://img.shields.io/github/workflow/status/jshttp/fresh/ci/master?label=ci -[ci-url]: https://github.com/jshttp/fresh/actions/workflows/ci.yml [npm-image]: https://img.shields.io/npm/v/fresh.svg [npm-url]: https://npmjs.org/package/fresh [node-version-image]: https://img.shields.io/node/v/fresh.svg [node-version-url]: https://nodejs.org/en/ +[travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg +[travis-url]: https://travis-ci.org/jshttp/fresh [coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg [coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master [downloads-image]: https://img.shields.io/npm/dm/fresh.svg diff --git a/node_modules/fresh/index.js b/node_modules/fresh/index.js index fc3dea7..d154f5a 100644 --- a/node_modules/fresh/index.js +++ b/node_modules/fresh/index.js @@ -48,26 +48,27 @@ function fresh (reqHeaders, resHeaders) { return false } - // if-none-match takes precedent over if-modified-since - if (noneMatch) { - if (noneMatch === '*') { - return true - } - var etag = resHeaders.etag + // if-none-match + if (noneMatch && noneMatch !== '*') { + var etag = resHeaders['etag'] if (!etag) { return false } + var etagStale = true var matches = parseTokenList(noneMatch) for (var i = 0; i < matches.length; i++) { var match = matches[i] if (match === etag || match === 'W/' + etag || 'W/' + match === etag) { - return true + etagStale = false + break } } - return false + if (etagStale) { + return false + } } // if-modified-since diff --git a/node_modules/fresh/package.json b/node_modules/fresh/package.json index 5d7e215..c2fa0f4 100644 --- a/node_modules/fresh/package.json +++ b/node_modules/fresh/package.json @@ -1,7 +1,7 @@ { "name": "fresh", "description": "HTTP response freshness testing", - "version": "2.0.0", + "version": "0.5.2", "author": "TJ Holowaychuk (http://tjholowaychuk.com)", "contributors": [ "Douglas Christopher Wilson ", @@ -18,15 +18,15 @@ "devDependencies": { "beautify-benchmark": "0.2.4", "benchmark": "2.1.4", - "eslint": "8.12.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.0.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.0", - "nyc": "15.1.0" + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5" }, "files": [ "HISTORY.md", @@ -34,13 +34,13 @@ "index.js" ], "engines": { - "node": ">= 0.8" + "node": ">= 0.6" }, "scripts": { "bench": "node benchmark/index.js", - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" } } diff --git a/node_modules/iconv-lite/Changelog.md b/node_modules/iconv-lite/Changelog.md new file mode 100644 index 0000000..f252313 --- /dev/null +++ b/node_modules/iconv-lite/Changelog.md @@ -0,0 +1,162 @@ +# 0.4.24 / 2018-08-22 + + * Added MIK encoding (#196, by @Ivan-Kalatchev) + + +# 0.4.23 / 2018-05-07 + + * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) + * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) + + +# 0.4.22 / 2018-05-05 + + * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) + * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) + + +# 0.4.21 / 2018-04-06 + + * Fix encoding canonicalization (#156) + * Fix the paths in the "browser" field in package.json (#174 by @LMLB) + * Removed "contributors" section in package.json - see Git history instead. + + +# 0.4.20 / 2018-04-06 + + * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) + + +# 0.4.19 / 2017-09-09 + + * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) + * Re-generated windows1255 codec, because it was updated in iconv project + * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 + + +# 0.4.18 / 2017-06-13 + + * Fixed CESU-8 regression in Node v8. + + +# 0.4.17 / 2017-04-22 + + * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) + + +# 0.4.16 / 2017-04-22 + + * Added support for React Native (#150) + * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) + * Fixed typo in Readme (#138 by @jiangzhuo) + * Fixed build for Node v6.10+ by making correct version comparison + * Added a warning if iconv-lite is loaded not as utf-8 (see #142) + + +# 0.4.15 / 2016-11-21 + + * Fixed typescript type definition (#137) + + +# 0.4.14 / 2016-11-20 + + * Preparation for v1.0 + * Added Node v6 and latest Node versions to Travis CI test rig + * Deprecated Node v0.8 support + * Typescript typings (@larssn) + * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) + * Add ms prefix to dbcs windows encodings (@rokoroku) + + +# 0.4.13 / 2015-10-01 + + * Fix silly mistake in deprecation notice. + + +# 0.4.12 / 2015-09-26 + + * Node v4 support: + * Added CESU-8 decoding (#106) + * Added deprecation notice for `extendNodeEncodings` + * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) + + +# 0.4.11 / 2015-07-03 + + * Added CESU-8 encoding. + + +# 0.4.10 / 2015-05-26 + + * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not + just spaces. This should minimize the importance of "default" endianness. + + +# 0.4.9 / 2015-05-24 + + * Streamlined BOM handling: strip BOM by default, add BOM when encoding if + addBOM: true. Added docs to Readme. + * UTF16 now uses UTF16-LE by default. + * Fixed minor issue with big5 encoding. + * Added io.js testing on Travis; updated node-iconv version to test against. + Now we just skip testing SBCS encodings that node-iconv doesn't support. + * (internal refactoring) Updated codec interface to use classes. + * Use strict mode in all files. + + +# 0.4.8 / 2015-04-14 + + * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) + + +# 0.4.7 / 2015-02-05 + + * stop official support of Node.js v0.8. Should still work, but no guarantees. + reason: Packages needed for testing are hard to get on Travis CI. + * work in environment where Object.prototype is monkey patched with enumerable + props (#89). + + +# 0.4.6 / 2015-01-12 + + * fix rare aliases of single-byte encodings (thanks @mscdex) + * double the timeout for dbcs tests to make them less flaky on travis + + +# 0.4.5 / 2014-11-20 + + * fix windows-31j and x-sjis encoding support (@nleush) + * minor fix: undefined variable reference when internal error happens + + +# 0.4.4 / 2014-07-16 + + * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) + * fixed streaming base64 encoding + + +# 0.4.3 / 2014-06-14 + + * added encodings UTF-16BE and UTF-16 with BOM + + +# 0.4.2 / 2014-06-12 + + * don't throw exception if `extendNodeEncodings()` is called more than once + + +# 0.4.1 / 2014-06-11 + + * codepage 808 added + + +# 0.4.0 / 2014-06-10 + + * code is rewritten from scratch + * all widespread encodings are supported + * streaming interface added + * browserify compatibility added + * (optional) extend core primitive encodings to make usage even simpler + * moved from vows to mocha as the testing framework + + diff --git a/node_modules/iconv-lite/README.md b/node_modules/iconv-lite/README.md index 78a7a5f..c981c37 100644 --- a/node_modules/iconv-lite/README.md +++ b/node_modules/iconv-lite/README.md @@ -1,40 +1,38 @@ -## iconv-lite: Pure JS character encoding conversion +## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-downloads-url] -[![License][license-image]][license-url] -[![NPM Install Size][npm-install-size-image]][npm-install-size-url] + * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). + * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. + * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). + * Intuitive encode/decode API + * Streaming support for Node v0.10+ + * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings. + * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included). + * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. + * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`). + * License: MIT. -* No need for native code compilation. Quick to install, works on Windows, Web, and in sandboxed environments. -* Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), - [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. -* Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). -* Intuitive encode/decode API, including Streaming support. -* In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). -* Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. -* React Native is supported (need to install `stream` module to enable Streaming API). +[![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true&downloadRank=true)](https://npmjs.org/packages/iconv-lite/) ## Usage - ### Basic API - ```javascript var iconv = require('iconv-lite'); -// Convert from an encoded buffer to a js string. +// Convert from an encoded buffer to js string. str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); -// Convert from a js string to an encoded buffer. +// Convert from js string to an encoded buffer. buf = iconv.encode("Sample input string", 'win1251'); // Check if encoding is supported iconv.encodingExists("us-ascii") ``` -### Streaming API - +### Streaming API (Node v0.10+) ```javascript -// Decode stream (from binary data stream to js strings) + +// Decode stream (from binary stream to js strings) http.createServer(function(req, res) { var converterStream = iconv.decodeStream('win1251'); req.pipe(converterStream); @@ -59,10 +57,44 @@ http.createServer(function(req, res) { }); ``` +### [Deprecated] Extend Node.js own encodings +> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility). + +```javascript +// After this call all Node basic primitives will understand iconv-lite encodings. +iconv.extendNodeEncodings(); + +// Examples: +buf = new Buffer(str, 'win1251'); +buf.write(str, 'gbk'); +str = buf.toString('latin1'); +assert(Buffer.isEncoding('iso-8859-15')); +Buffer.byteLength(str, 'us-ascii'); + +http.createServer(function(req, res) { + req.setEncoding('big5'); + req.collect(function(err, body) { + console.log(body); + }); +}); + +fs.createReadStream("file.txt", "shift_jis"); + +// External modules are also supported (if they use Node primitives, which they probably do). +request = require('request'); +request({ + url: "http://github.com/", + encoding: "cp932" +}); + +// To remove extensions +iconv.undoExtendNodeEncodings(); +``` + ## Supported encodings * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. - * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap. * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. Aliases like 'latin1', 'us-ascii' also supported. @@ -74,6 +106,7 @@ Most singlebyte encodings are generated automatically from [node-iconv](https:// Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + ## Encoding/decoding speed Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). @@ -100,39 +133,24 @@ smart about endianness in the following ways: overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. -## UTF-32 Encodings - -This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. - * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. - * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) - ## Other notes When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). Untranslatable characters are set to � or ?. No transliteration is currently supported. -Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see [#65](https://github.com/ashtuchkin/iconv-lite/issues/65), [#77](https://github.com/ashtuchkin/iconv-lite/issues/77)). +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). ## Testing -```sh -git clone git@github.com:ashtuchkin/iconv-lite.git -cd iconv-lite -npm install -npm test +```bash +$ git clone git@github.com:ashtuchkin/iconv-lite.git +$ cd iconv-lite +$ npm install +$ npm test -# To view performance: -npm run test:performance +$ # To view performance: +$ node test/performance.js -# To view test coverage: -npm run test:cov -open coverage/index.html +$ # To view test coverage: +$ npm run coverage +$ open coverage/lcov-report/index.html ``` - -[npm-downloads-image]: https://badgen.net/npm/dm/iconv-lite -[npm-downloads-url]: https://npmcharts.com/compare/iconv-lite?minimal=true -[npm-url]: https://npmjs.org/package/iconv-lite -[npm-version-image]: https://badgen.net/npm/v/iconv-lite -[npm-install-size-image]: https://badgen.net/packagephobia/install/iconv-lite -[npm-install-size-url]: https://packagephobia.com/result?p=iconv-lite -[license-image]: https://img.shields.io/npm/l/iconv-lite.svg -[license-url]: https://github.com/ashtuchkin/iconv-lite/blob/HEAD/LICENSE \ No newline at end of file diff --git a/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/iconv-lite/encodings/dbcs-codec.js index bfec7f2..1fe3e16 100644 --- a/node_modules/iconv-lite/encodings/dbcs-codec.js +++ b/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -1,532 +1,555 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer +"use strict"; +var Buffer = require("safer-buffer").Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. -exports._dbcs = DBCSCodec +exports._dbcs = DBCSCodec; -var UNASSIGNED = -1 -var GB18030_CODE = -2 -var SEQ_START = -10 -var NODE_START = -1000 -var UNASSIGNED_NODE = new Array(0x100) -var DEF_CHAR = -1 +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; + +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; -for (var i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED } // Class DBCSCodec reads and initializes mapping tables. -function DBCSCodec (codecOptions, iconv) { - this.encodingName = codecOptions.encodingName - if (!codecOptions) { throw new Error("DBCS codec is called without the data.") } - if (!codecOptions.table) { throw new Error("Encoding '" + this.encodingName + "' has no data.") } +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); - // Load tables. - var mappingTable = codecOptions.table() + // Load tables. + var mappingTable = codecOptions.table(); - // Decode tables: MBCS -> Unicode. - // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. - // Trie root is decodeTables[0]. - // Values: >= 0 -> unicode character code. can be > 0xFFFF - // == UNASSIGNED -> unknown/unassigned sequence. - // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. - // <= NODE_START -> index of the next node in our trie to process next byte. - // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. - this.decodeTables = [] - this.decodeTables[0] = UNASSIGNED_NODE.slice(0) // Create root node. + // Decode tables: MBCS -> Unicode. - // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. - this.decodeTableSeq = [] + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. - // Actual mapping tables consist of chunks. Use them to fill up decode tables. - for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]) } + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === "function") { - this.gb18030 = codecOptions.gb18030() // Load GB18030 ranges. + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); - // Add GB18030 common decode nodes. - var commonThirdByteNodeIdx = this.decodeTables.length - this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + this.defaultCharUnicode = iconv.defaultCharUnicode; - var commonFourthByteNodeIdx = this.decodeTables.length - this.decodeTables.push(UNASSIGNED_NODE.slice(0)) + + // Encode tables: Unicode -> DBCS. - // Fill out the tree - var firstByteNode = this.decodeTables[0] - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]] - for (var j = 0x30; j <= 0x39; j++) { - if (secondByteNode[j] === UNASSIGNED) { - secondByteNode[j] = NODE_START - commonThirdByteNodeIdx - } else if (secondByteNode[j] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 2") + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); - var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]] - for (var k = 0x81; k <= 0xFE; k++) { - if (thirdByteNode[k] === UNASSIGNED) { - thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx - } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { - continue - } else if (thirdByteNode[k] > NODE_START) { - throw new Error("gb18030 decode tables conflict at byte 3") - } + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } - var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]] - for (var l = 0x30; l <= 0x39; l++) { - if (fourthByteNode[l] === UNASSIGNED) { fourthByteNode[l] = GB18030_CODE } - } + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); + + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 decode tables. + var thirdByteNodeIdx = this.decodeTables.length; + var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); + + var fourthByteNodeIdx = this.decodeTables.length; + var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); + + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; + var secondByteNode = this.decodeTables[secondByteNodeIdx]; + for (var j = 0x30; j <= 0x39; j++) + secondByteNode[j] = NODE_START - thirdByteNodeIdx; } - } - } - } - - this.defaultCharUnicode = iconv.defaultCharUnicode - - // Encode tables: Unicode -> DBCS. - - // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. - // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. - // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). - // == UNASSIGNED -> no conversion found. Output a default char. - // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. - this.encodeTable = [] - - // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of - // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key - // means end of sequence (needed when one sequence is a strict subsequence of another). - // Objects are kept separately from encodeTable to increase performance. - this.encodeTableSeq = [] - - // Some chars can be decoded, but need not be encoded. - var skipEncodeChars = {} - if (codecOptions.encodeSkipVals) { - for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { - var val = codecOptions.encodeSkipVals[i] - if (typeof val === "number") { skipEncodeChars[val] = true } else { - for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true } - } - } - } - - // Use decode trie to recursively fill out encode tables. - this._fillEncodeTable(0, 0, skipEncodeChars) - - // Add more encoding pairs when needed. - if (codecOptions.encodeAdd) { - for (var uChar in codecOptions.encodeAdd) { - if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) { this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]) } - } - } - - this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)] - if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"] - if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0) + for (var i = 0x81; i <= 0xFE; i++) + thirdByteNode[i] = NODE_START - fourthByteNodeIdx; + for (var i = 0x30; i <= 0x39; i++) + fourthByteNode[i] = GB18030_CODE + } } -DBCSCodec.prototype.encoder = DBCSEncoder -DBCSCodec.prototype.decoder = DBCSDecoder +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers -DBCSCodec.prototype._getDecodeTrieNode = function (addr) { - var bytes = [] - for (; addr > 0; addr >>>= 8) { bytes.push(addr & 0xFF) } - if (bytes.length == 0) { bytes.push(0) } +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); - var node = this.decodeTables[0] - for (var i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. - var val = node[bytes[i]] + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; - if (val == UNASSIGNED) { // Create new node. - node[bytes[i]] = NODE_START - this.decodeTables.length - this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)) - } else if (val <= NODE_START) { // Existing node. - node = this.decodeTables[NODE_START - val] - } else { throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)) } - } - return node + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; } -DBCSCodec.prototype._addDecodeChunk = function (chunk) { - // First element of chunk is the hex mbcs code where we start. - var curAddr = parseInt(chunk[0], 16) - // Choose the decoding node where we'll write our chars. - var writeTable = this._getDecodeTrieNode(curAddr) - curAddr = curAddr & 0xFF +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); - // Write all other elements of the chunk to the table. - for (var k = 1; k < chunk.length; k++) { - var part = chunk[k] - if (typeof part === "string") { // String, write as-is. - for (var l = 0; l < part.length;) { - var code = part.charCodeAt(l++) - if (code >= 0xD800 && code < 0xDC00) { // Decode surrogate - var codeTrail = part.charCodeAt(l++) - if (codeTrail >= 0xDC00 && codeTrail < 0xE000) { writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00) } else { throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]) } - } else if (code > 0x0FF0 && code <= 0x0FFF) { // Character sequence (our own encoding used) - var len = 0xFFF - code + 2 - var seq = [] - for (var m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)) } // Simple variation: don't support surrogates or subsequences in seq. + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; - writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length - this.decodeTableSeq.push(seq) - } else { writeTable[curAddr++] = code } // Basic char - } - } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. - var charCode = writeTable[curAddr - 1] + 1 - for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++ } - } else { throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]) } - } - if (curAddr > 0xFF) { throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr) } + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); } // Encoder helpers -DBCSCodec.prototype._getEncodeBucket = function (uCode) { - var high = uCode >> 8 // This could be > 0xFF because of astral characters. - if (this.encodeTable[high] === undefined) { - this.encodeTable[high] = UNASSIGNED_NODE.slice(0) - } // Create bucket on demand. - return this.encodeTable[high] +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; } -DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { - var bucket = this._getEncodeBucket(uCode) - var low = uCode & 0xFF - if (bucket[low] <= SEQ_START) { this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode } // There's already a sequence, set a single-char subsequence of it. - else if (bucket[low] == UNASSIGNED) { bucket[low] = dbcsCode } +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; } -DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { - // Get the root of character tree according to first character of the sequence. - var uCode = seq[0] - var bucket = this._getEncodeBucket(uCode) - var low = uCode & 0xFF +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; - var node - if (bucket[low] <= SEQ_START) { - // There's already a sequence with - use it. - node = this.encodeTableSeq[SEQ_START - bucket[low]] - } else { - // There was no sequence object - allocate a new one. - node = {} - if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low] // If a char was set before - make it a single-char subsequence. - bucket[low] = SEQ_START - this.encodeTableSeq.length - this.encodeTableSeq.push(node) - } - - // Traverse the character tree, allocating new nodes as needed. - for (var j = 1; j < seq.length - 1; j++) { - var oldVal = node[uCode] - if (typeof oldVal === "object") { node = oldVal } else { - node = node[uCode] = {} - if (oldVal !== undefined) { node[DEF_CHAR] = oldVal } + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; } - } - - // Set the leaf to given dbcsCode. - uCode = seq[seq.length - 1] - node[uCode] = dbcsCode -} - -DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { - var node = this.decodeTables[nodeIdx] - var hasValues = false - var subNodeEmpty = {} - for (var i = 0; i < 0x100; i++) { - var uCode = node[i] - var mbCode = prefix + i - if (skipEncodeChars[mbCode]) { continue } - - if (uCode >= 0) { - this._setEncodeChar(uCode, mbCode) - hasValues = true - } else if (uCode <= NODE_START) { - var subNodeIdx = NODE_START - uCode - if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). - var newPrefix = (mbCode << 8) >>> 0 // NOTE: '>>> 0' keeps 32-bit num positive. - if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) { hasValues = true } else { subNodeEmpty[subNodeIdx] = true } - } - } else if (uCode <= SEQ_START) { - this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode) - hasValues = true + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); } - } - return hasValues + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; } +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; + + if (uCode >= 0) + this._setEncodeChar(uCode, mbCode); + else if (uCode <= NODE_START) + this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); + else if (uCode <= SEQ_START) + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + } +} + + + // == Encoder ================================================================== -function DBCSEncoder (options, codec) { - // Encoder state - this.leadSurrogate = -1 - this.seqObj = undefined - - // Static data - this.encodeTable = codec.encodeTable - this.encodeTableSeq = codec.encodeTableSeq - this.defaultCharSingleByte = codec.defCharSB - this.gb18030 = codec.gb18030 +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; } -DBCSEncoder.prototype.write = function (str) { - var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)) - var leadSurrogate = this.leadSurrogate - var seqObj = this.seqObj - var nextChar = -1 - var i = 0; var j = 0 +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; - while (true) { - // 0. Get next character. - if (nextChar === -1) { - if (i == str.length) break - var uCode = str.charCodeAt(i++) - } else { - var uCode = nextChar - nextChar = -1 + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } + + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; + + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; + + } else if (resCode == undefined) { // Current character is not part of the sequence. + + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. + + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } } - // 1. Handle surrogates. - if (uCode >= 0xD800 && uCode < 0xE000) { // Char is one of surrogates. - if (uCode < 0xDC00) { // We've got lead surrogate. - if (leadSurrogate === -1) { - leadSurrogate = uCode - continue - } else { - leadSurrogate = uCode - // Double lead surrogate found. - uCode = UNASSIGNED - } - } else { // We've got trail surrogate. - if (leadSurrogate !== -1) { - uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00) - leadSurrogate = -1 - } else { - // Incomplete surrogate pair - only trail surrogate found. - uCode = UNASSIGNED - } - } - } else if (leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - nextChar = uCode; uCode = UNASSIGNED // Write an error, then current char. - leadSurrogate = -1 - } - - // 2. Convert uCode character. - var dbcsCode = UNASSIGNED - if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence - var resCode = seqObj[uCode] - if (typeof resCode === "object") { // Sequence continues. - seqObj = resCode - continue - } else if (typeof resCode === "number") { // Sequence finished. Write it. - dbcsCode = resCode - } else if (resCode == undefined) { // Current character is not part of the sequence. - // Try default character for this sequence - resCode = seqObj[DEF_CHAR] - if (resCode !== undefined) { - dbcsCode = resCode // Found. Write it. - nextChar = uCode // Current character will be written too in the next iteration. - } else { - // TODO: What if we have no default? (resCode == undefined) - // Then, we should write first char of the sequence as-is and try the rest recursively. - // Didn't do it for now because no encoding has this situation yet. - // Currently, just skip the sequence and write current char. - } - } - seqObj = undefined - } else if (uCode >= 0) { // Regular character - var subtable = this.encodeTable[uCode >> 8] - if (subtable !== undefined) { dbcsCode = subtable[uCode & 0xFF] } - - if (dbcsCode <= SEQ_START) { // Sequence start - seqObj = this.encodeTableSeq[SEQ_START - dbcsCode] - continue - } - - if (dbcsCode == UNASSIGNED && this.gb18030) { - // Use GB18030 algorithm to find character(s) to write. - var idx = findIdx(this.gb18030.uChars, uCode) - if (idx != -1) { - var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]) - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600 - newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260 - newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10 - newBuf[j++] = 0x30 + dbcsCode - continue - } - } - } - - // 3. Write dbcsCode character. - if (dbcsCode === UNASSIGNED) { dbcsCode = this.defaultCharSingleByte } - - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode - } else if (dbcsCode < 0x10000) { - newBuf[j++] = dbcsCode >> 8 // high byte - newBuf[j++] = dbcsCode & 0xFF // low byte - } else if (dbcsCode < 0x1000000) { - newBuf[j++] = dbcsCode >> 16 - newBuf[j++] = (dbcsCode >> 8) & 0xFF - newBuf[j++] = dbcsCode & 0xFF - } else { - newBuf[j++] = dbcsCode >>> 24 - newBuf[j++] = (dbcsCode >>> 16) & 0xFF - newBuf[j++] = (dbcsCode >>> 8) & 0xFF - newBuf[j++] = dbcsCode & 0xFF - } - } - - this.seqObj = seqObj - this.leadSurrogate = leadSurrogate - return newBuf.slice(0, j) + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); } -DBCSEncoder.prototype.end = function () { - if (this.leadSurrogate === -1 && this.seqObj === undefined) { return } // All clean. Most often case. +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. - var newBuf = Buffer.alloc(10); var j = 0 + var newBuf = Buffer.alloc(10), j = 0; - if (this.seqObj) { // We're in the sequence. - var dbcsCode = this.seqObj[DEF_CHAR] - if (dbcsCode !== undefined) { // Write beginning of the sequence. - if (dbcsCode < 0x100) { - newBuf[j++] = dbcsCode - } else { - newBuf[j++] = dbcsCode >> 8 // high byte - newBuf[j++] = dbcsCode & 0xFF // low byte - } - } else { - // See todo above. + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; } - this.seqObj = undefined - } - if (this.leadSurrogate !== -1) { - // Incomplete surrogate pair - only lead surrogate found. - newBuf[j++] = this.defaultCharSingleByte - this.leadSurrogate = -1 - } - - return newBuf.slice(0, j) + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + + return newBuf.slice(0, j); } // Export for testing -DBCSEncoder.prototype.findIdx = findIdx +DBCSEncoder.prototype.findIdx = findIdx; + // == Decoder ================================================================== -function DBCSDecoder (options, codec) { - // Decoder state - this.nodeIdx = 0 - this.prevBytes = [] +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBuf = Buffer.alloc(0); - // Static data - this.decodeTables = codec.decodeTables - this.decodeTableSeq = codec.decodeTableSeq - this.defaultCharUnicode = codec.defaultCharUnicode - this.gb18030 = codec.gb18030 + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; } -DBCSDecoder.prototype.write = function (buf) { - var newBuf = Buffer.alloc(buf.length * 2) - var nodeIdx = this.nodeIdx - var prevBytes = this.prevBytes; var prevOffset = this.prevBytes.length - var seqStart = -this.prevBytes.length // idx of the start of current parsed sequence. - var uCode +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, + seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. + uCode; - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset] + if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. + prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; - // Lookup in current trie node. - var uCode = this.decodeTables[nodeIdx][curByte] + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; - if (uCode >= 0) { - // Normal character, just use it. - } else if (uCode === UNASSIGNED) { // Unknown char. - // TODO: Callback with seq. - uCode = this.defaultCharUnicode.charCodeAt(0) - i = seqStart // Skip one byte ('i' will be incremented by the for loop) and try to parse again. - } else if (uCode === GB18030_CODE) { - if (i >= 3) { - var ptr = (buf[i - 3] - 0x81) * 12600 + (buf[i - 2] - 0x30) * 1260 + (buf[i - 1] - 0x81) * 10 + (curByte - 0x30) - } else { - var ptr = (prevBytes[i - 3 + prevOffset] - 0x81) * 12600 + - (((i - 2 >= 0) ? buf[i - 2] : prevBytes[i - 2 + prevOffset]) - 0x30) * 1260 + - (((i - 1 >= 0) ? buf[i - 1] : prevBytes[i - 1 + prevOffset]) - 0x81) * 10 + - (curByte - 0x30) - } - var idx = findIdx(this.gb18030.gbChars, ptr) - uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx] - } else if (uCode <= NODE_START) { // Go to next trie node. - nodeIdx = NODE_START - uCode - continue - } else if (uCode <= SEQ_START) { // Output a sequence of chars. - var seq = this.decodeTableSeq[SEQ_START - uCode] - for (var k = 0; k < seq.length - 1; k++) { - uCode = seq[k] - newBuf[j++] = uCode & 0xFF - newBuf[j++] = uCode >> 8 - } - uCode = seq[seq.length - 1] - } else { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte) } + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); + i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). + uCode = this.defaultCharUnicode.charCodeAt(0); + } + else if (uCode === GB18030_CODE) { + var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); + var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); - // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode >= 0x10000) { - uCode -= 0x10000 - var uCodeLead = 0xD800 | (uCode >> 10) - newBuf[j++] = uCodeLead & 0xFF - newBuf[j++] = uCodeLead >> 8 + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode > 0xFFFF) { + uCode -= 0x10000; + var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; - uCode = 0xDC00 | (uCode & 0x3FF) + uCode = 0xDC00 + uCode % 0x400; + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + + // Reset trie node. + nodeIdx = 0; seqStart = i+1; } - newBuf[j++] = uCode & 0xFF - newBuf[j++] = uCode >> 8 - // Reset trie node. - nodeIdx = 0; seqStart = i + 1 - } - - this.nodeIdx = nodeIdx - this.prevBytes = (seqStart >= 0) - ? Array.prototype.slice.call(buf, seqStart) - : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)) - - return newBuf.slice(0, j).toString("ucs2") + this.nodeIdx = nodeIdx; + this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); + return newBuf.slice(0, j).toString('ucs2'); } -DBCSDecoder.prototype.end = function () { - var ret = "" +DBCSDecoder.prototype.end = function() { + var ret = ''; - // Try to parse all remaining chars. - while (this.prevBytes.length > 0) { - // Skip 1 character in the buffer. - ret += this.defaultCharUnicode - var bytesArr = this.prevBytes.slice(1) + // Try to parse all remaining chars. + while (this.prevBuf.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var buf = this.prevBuf.slice(1); - // Parse remaining as usual. - this.prevBytes = [] - this.nodeIdx = 0 - if (bytesArr.length > 0) { ret += this.write(bytesArr) } - } + // Parse remaining as usual. + this.prevBuf = Buffer.alloc(0); + this.nodeIdx = 0; + if (buf.length > 0) + ret += this.write(buf); + } - this.prevBytes = [] - this.nodeIdx = 0 - return ret + this.nodeIdx = 0; + return ret; } // Binary search for GB18030. Returns largest i such that table[i] <= val. -function findIdx (table, val) { - if (table[0] > val) { return -1 } +function findIdx(table, val) { + if (table[0] > val) + return -1; - var l = 0; var r = table.length - while (l < r - 1) { // always table[l] <= val < table[r] - var mid = l + ((r - l + 1) >> 1) - if (table[mid] <= val) { l = mid } else { r = mid } - } - return l + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + Math.floor((r-l+1)/2); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; } + diff --git a/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/iconv-lite/encodings/dbcs-data.js index a3858d4..4b61914 100644 --- a/node_modules/iconv-lite/encodings/dbcs-data.js +++ b/node_modules/iconv-lite/encodings/dbcs-data.js @@ -1,185 +1,176 @@ -"use strict" +"use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) - // == Japanese/ShiftJIS ==================================================== - // All japanese encodings are based on JIS X set of standards: - // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. - // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. - // Has several variations in 1978, 1983, 1990 and 1997. - // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. - // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. - // 2 planes, first is superset of 0208, second - revised 0212. - // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html - // Byte encodings are: - // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte - // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. - // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. - // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. - // 0x00-0x7F - lower part of 0201 - // 0x8E, 0xA1-0xDF - upper part of 0201 - // (0xA1-0xFE)x2 - 0208 plane (94x94). - // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). - // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. - // Used as-is in ISO2022 family. - // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, - // 0201-1976 Roman, 0208-1978, 0208-1983. - // * ISO2022-JP-1: Adds esc seq for 0212-1990. - // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. - // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. - // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. - // - // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. - // - // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + 'shiftjis': { + type: '_dbcs', + table: function() { return require('./tables/shiftjis.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', - shiftjis: { - type: "_dbcs", - table: function () { return require("./tables/shiftjis.json") }, - encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E }, - encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] - }, - csshiftjis: "shiftjis", - mskanji: "shiftjis", - sjis: "shiftjis", - windows31j: "shiftjis", - ms31j: "shiftjis", - xsjis: "shiftjis", - windows932: "shiftjis", - ms932: "shiftjis", - 932: "shiftjis", - cp932: "shiftjis", + 'eucjp': { + type: '_dbcs', + table: function() { return require('./tables/eucjp.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, - eucjp: { - type: "_dbcs", - table: function () { return require("./tables/eucjp.json") }, - encodeAdd: { "\u00a5": 0x5C, "\u203E": 0x7E } - }, + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. - // TODO: KDDI extension to Shift_JIS - // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. - // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. - // == Chinese/GBK ========================================================== - // http://en.wikipedia.org/wiki/GBK - // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder - // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 - gb2312: "cp936", - gb231280: "cp936", - gb23121980: "cp936", - csgb2312: "cp936", - csiso58gb231280: "cp936", - euccn: "cp936", + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', - // Microsoft's CP936 is a subset and approximation of GBK. - windows936: "cp936", - ms936: "cp936", - 936: "cp936", - cp936: { - type: "_dbcs", - table: function () { return require("./tables/cp936.json") } - }, + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json') }, + }, - // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. - gbk: { - type: "_dbcs", - table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) } - }, - xgbk: "gbk", - isoir58: "gbk", + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', - // GB18030 is an algorithmic extension of GBK. - // Main source: https://www.w3.org/TR/encoding/#gbk-encoder - // http://icu-project.org/docs/papers/gb18030.html - // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml - // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 - gb18030: { - type: "_dbcs", - table: function () { return require("./tables/cp936.json").concat(require("./tables/gbk-added.json")) }, - gb18030: function () { return require("./tables/gb18030-ranges.json") }, - encodeSkipVals: [0x80], - encodeAdd: { "€": 0xA2E3 } - }, + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + gb18030: function() { return require('./tables/gb18030-ranges.json') }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, - chinese: "gb18030", + 'chinese': 'gb18030', - // == Korean =============================================================== - // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. - windows949: "cp949", - ms949: "cp949", - 949: "cp949", - cp949: { - type: "_dbcs", - table: function () { return require("./tables/cp949.json") } - }, - cseuckr: "cp949", - csksc56011987: "cp949", - euckr: "cp949", - isoir149: "cp949", - korean: "cp949", - ksc56011987: "cp949", - ksc56011989: "cp949", - ksc5601: "cp949", + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return require('./tables/cp949.json') }, + }, - // == Big5/Taiwan/Hong Kong ================================================ - // There are lots of tables for Big5 and cp950. Please see the following links for history: - // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html - // Variations, in roughly number of defined chars: - // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ - // * Big5-2003 (Taiwan standard) almost superset of cp950. - // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. - // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. - // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. - // Plus, it has 4 combining sequences. - // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 - // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. - // Implementations are not consistent within browsers; sometimes labeled as just big5. - // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. - // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 - // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. - // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt - // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt - // - // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder - // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', - windows950: "cp950", - ms950: "cp950", - 950: "cp950", - cp950: { - type: "_dbcs", - table: function () { return require("./tables/cp950.json") } - }, - // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. - big5: "big5hkscs", - big5hkscs: { - type: "_dbcs", - table: function () { return require("./tables/cp950.json").concat(require("./tables/big5-added.json")) }, - encodeSkipVals: [ - // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of - // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. - // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. - 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, - 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, - 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, - 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, - 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. - // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 - 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce - ] - }, + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json') }, + }, - cnbig5: "big5hkscs", - csbig5: "big5hkscs", - xxbig5: "big5hkscs" -} + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, + encodeSkipVals: [0xa2cc], + }, + + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; diff --git a/node_modules/iconv-lite/encodings/index.js b/node_modules/iconv-lite/encodings/index.js index 9d90e3c..e304003 100644 --- a/node_modules/iconv-lite/encodings/index.js +++ b/node_modules/iconv-lite/encodings/index.js @@ -1,23 +1,22 @@ -"use strict" - -var mergeModules = require("../lib/helpers/merge-exports") +"use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ - require("./internal"), - require("./utf32"), - require("./utf16"), - require("./utf7"), - require("./sbcs-codec"), - require("./sbcs-data"), - require("./sbcs-data-generated"), - require("./dbcs-codec"), - require("./dbcs-data") -] + require("./internal"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data"), +]; -// Put all encoding/alias/codec definitions to single object and export it. +// Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { - var module = modules[i] - mergeModules(exports, module) + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; } diff --git a/node_modules/iconv-lite/encodings/internal.js b/node_modules/iconv-lite/encodings/internal.js index 4e5c3ff..05ce38b 100644 --- a/node_modules/iconv-lite/encodings/internal.js +++ b/node_modules/iconv-lite/encodings/internal.js @@ -1,218 +1,188 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer +"use strict"; +var Buffer = require("safer-buffer").Buffer; // Export Node.js internal encodings. module.exports = { - // Encodings - utf8: { type: "_internal", bomAware: true }, - cesu8: { type: "_internal", bomAware: true }, - unicode11utf8: "utf8", + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", - ucs2: { type: "_internal", bomAware: true }, - utf16le: "ucs2", + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", - binary: { type: "_internal" }, - base64: { type: "_internal" }, - hex: { type: "_internal" }, + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, - // Codec. - _internal: InternalCodec -} + // Codec. + _internal: InternalCodec, +}; -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ -function InternalCodec (codecOptions, iconv) { - this.enc = codecOptions.encodingName - this.bomAware = codecOptions.bomAware +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; - if (this.enc === "base64") { this.encoder = InternalEncoderBase64 } else if (this.enc === "utf8") { this.encoder = InternalEncoderUtf8 } else if (this.enc === "cesu8") { - this.enc = "utf8" // Use utf8 for decoding. - this.encoder = InternalEncoderCesu8 + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; - // Add decoder for versions of Node not supporting CESU-8 - if (Buffer.from("eda0bdedb2a9", "hex").toString() !== "💩") { - this.decoder = InternalDecoderCesu8 - this.defaultCharUnicode = iconv.defaultCharUnicode + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } } - } } -InternalCodec.prototype.encoder = InternalEncoder -InternalCodec.prototype.decoder = InternalDecoder +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. -var StringDecoder = require("string_decoder").StringDecoder +var StringDecoder = require('string_decoder').StringDecoder; -function InternalDecoder (options, codec) { - this.decoder = new StringDecoder(codec.enc) +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; + + +function InternalDecoder(options, codec) { + StringDecoder.call(this, codec.enc); } -InternalDecoder.prototype.write = function (buf) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf) - } +InternalDecoder.prototype = StringDecoder.prototype; - return this.decoder.write(buf) -} -InternalDecoder.prototype.end = function () { - return this.decoder.end() -} - -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Encoder is mostly trivial -function InternalEncoder (options, codec) { - this.enc = codec.enc +function InternalEncoder(options, codec) { + this.enc = codec.enc; } -InternalEncoder.prototype.write = function (str) { - return Buffer.from(str, this.enc) +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); } -InternalEncoder.prototype.end = function () { +InternalEncoder.prototype.end = function() { } -// ------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. -function InternalEncoderBase64 (options, codec) { - this.prevStr = "" +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; } -InternalEncoderBase64.prototype.write = function (str) { - str = this.prevStr + str - var completeQuads = str.length - (str.length % 4) - this.prevStr = str.slice(completeQuads) - str = str.slice(0, completeQuads) +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); - return Buffer.from(str, "base64") + return Buffer.from(str, "base64"); } -InternalEncoderBase64.prototype.end = function () { - return Buffer.from(this.prevStr, "base64") +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); } -// ------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // CESU-8 encoder is also special. -function InternalEncoderCesu8 (options, codec) { +function InternalEncoderCesu8(options, codec) { } -InternalEncoderCesu8.prototype.write = function (str) { - var buf = Buffer.alloc(str.length * 3); var bufIdx = 0 - for (var i = 0; i < str.length; i++) { - var charCode = str.charCodeAt(i) - // Naive implementation, but it works because CESU-8 is especially easy - // to convert from UTF-16 (which all JS strings are encoded in). - if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) { - buf[bufIdx++] = 0xC0 + (charCode >>> 6) - buf[bufIdx++] = 0x80 + (charCode & 0x3f) - } else { // charCode will always be < 0x10000 in javascript. - buf[bufIdx++] = 0xE0 + (charCode >>> 12) - buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f) - buf[bufIdx++] = 0x80 + (charCode & 0x3f) +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } } - } - return buf.slice(0, bufIdx) + return buf.slice(0, bufIdx); } -InternalEncoderCesu8.prototype.end = function () { +InternalEncoderCesu8.prototype.end = function() { } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ -function InternalDecoderCesu8 (options, codec) { - this.acc = 0 - this.contBytes = 0 - this.accBytes = 0 - this.defaultCharUnicode = codec.defaultCharUnicode +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; } -InternalDecoderCesu8.prototype.write = function (buf) { - var acc = this.acc; var contBytes = this.contBytes; var accBytes = this.accBytes - var res = "" - for (var i = 0; i < buf.length; i++) { - var curByte = buf[i] - if ((curByte & 0xC0) !== 0x80) { // Leading byte - if (contBytes > 0) { // Previous code is invalid - res += this.defaultCharUnicode - contBytes = 0 - } +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } - if (curByte < 0x80) { // Single-byte code - res += String.fromCharCode(curByte) - } else if (curByte < 0xE0) { // Two-byte code - acc = curByte & 0x1F - contBytes = 1; accBytes = 1 - } else if (curByte < 0xF0) { // Three-byte code - acc = curByte & 0x0F - contBytes = 2; accBytes = 1 - } else { // Four or more are not supported for CESU-8. - res += this.defaultCharUnicode - } - } else { // Continuation byte - if (contBytes > 0) { // We're waiting for it. - acc = (acc << 6) | (curByte & 0x3f) - contBytes--; accBytes++ - if (contBytes === 0) { - // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) - if (accBytes === 2 && acc < 0x80 && acc > 0) { - res += this.defaultCharUnicode - } else if (accBytes === 3 && acc < 0x800) { - res += this.defaultCharUnicode - } else { - // Actually add character. - res += String.fromCharCode(acc) - } + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } } - } else { // Unexpected continuation byte - res += this.defaultCharUnicode - } } - } - this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes - return res + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; } -InternalDecoderCesu8.prototype.end = function () { - var res = 0 - if (this.contBytes > 0) { res += this.defaultCharUnicode } - return res -} - -// ------------------------------------------------------------------------------ -// check the chunk boundaries for surrogate pair - -function InternalEncoderUtf8 (options, codec) { - this.highSurrogate = "" -} - -InternalEncoderUtf8.prototype.write = function (str) { - if (this.highSurrogate) { - str = this.highSurrogate + str - this.highSurrogate = "" - } - - if (str.length > 0) { - var charCode = str.charCodeAt(str.length - 1) - if (charCode >= 0xd800 && charCode < 0xdc00) { - this.highSurrogate = str[str.length - 1] - str = str.slice(0, str.length - 1) - } - } - - return Buffer.from(str, this.enc) -} - -InternalEncoderUtf8.prototype.end = function () { - if (this.highSurrogate) { - var str = this.highSurrogate - this.highSurrogate = "" - return Buffer.from(str, this.enc) - } +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; } diff --git a/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/iconv-lite/encodings/sbcs-codec.js index 0e2fc92..abac5ff 100644 --- a/node_modules/iconv-lite/encodings/sbcs-codec.js +++ b/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -1,75 +1,72 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer +"use strict"; +var Buffer = require("safer-buffer").Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that -// correspond to encoded bytes (if 128 - then lower half is ASCII). +// correspond to encoded bytes (if 128 - then lower half is ASCII). -exports._sbcs = SBCSCodec -function SBCSCodec (codecOptions, iconv) { - if (!codecOptions) { - throw new Error("SBCS codec is called without the data.") - } - - // Prepare char buffer for decoding. - if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) { - throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)") - } - - if (codecOptions.chars.length === 128) { - var asciiString = "" - for (var i = 0; i < 128; i++) { - asciiString += String.fromCharCode(i) +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; } - codecOptions.chars = asciiString + codecOptions.chars - } - this.decodeBuf = Buffer.from(codecOptions.chars, "ucs2") + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); - // Encoding buffer. - var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)) + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; - for (var i = 0; i < codecOptions.chars.length; i++) { - encodeBuf[codecOptions.chars.charCodeAt(i)] = i - } - - this.encodeBuf = encodeBuf + this.encodeBuf = encodeBuf; } -SBCSCodec.prototype.encoder = SBCSEncoder -SBCSCodec.prototype.decoder = SBCSDecoder +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; -function SBCSEncoder (options, codec) { - this.encodeBuf = codec.encodeBuf + +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; } -SBCSEncoder.prototype.write = function (str) { - var buf = Buffer.alloc(str.length) - for (var i = 0; i < str.length; i++) { - buf[i] = this.encodeBuf[str.charCodeAt(i)] - } - - return buf +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; } -SBCSEncoder.prototype.end = function () { +SBCSEncoder.prototype.end = function() { } -function SBCSDecoder (options, codec) { - this.decodeBuf = codec.decodeBuf + +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; } -SBCSDecoder.prototype.write = function (buf) { - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var decodeBuf = this.decodeBuf - var newBuf = Buffer.alloc(buf.length * 2) - var idx1 = 0; var idx2 = 0 - for (var i = 0; i < buf.length; i++) { - idx1 = buf[i] * 2; idx2 = i * 2 - newBuf[idx2] = decodeBuf[idx1] - newBuf[idx2 + 1] = decodeBuf[idx1 + 1] - } - return newBuf.toString("ucs2") +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); } -SBCSDecoder.prototype.end = function () { +SBCSDecoder.prototype.end = function() { } diff --git a/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/iconv-lite/encodings/sbcs-data.js index d8f8e17..fdb81a3 100644 --- a/node_modules/iconv-lite/encodings/sbcs-data.js +++ b/node_modules/iconv-lite/encodings/sbcs-data.js @@ -1,178 +1,174 @@ -"use strict" +"use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { - // Not supported by iconv, not sure why. - 10029: "maccenteuro", - maccenteuro: { - type: "_sbcs", - chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, - 808: "cp808", - ibm808: "cp808", - cp808: { - type: "_sbcs", - chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " - }, + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, - mik: { - type: "_sbcs", - chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, - cp720: { - type: "_sbcs", - chars: "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" - }, + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", - // Aliases of generated encodings. - ascii8bit: "ascii", - usascii: "ascii", - ansix34: "ascii", - ansix341968: "ascii", - ansix341986: "ascii", - csascii: "ascii", - cp367: "ascii", - ibm367: "ascii", - isoir6: "ascii", - iso646us: "ascii", - iso646irv: "ascii", - us: "ascii", + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", - latin1: "iso88591", - latin2: "iso88592", - latin3: "iso88593", - latin4: "iso88594", - latin5: "iso88599", - latin6: "iso885910", - latin7: "iso885913", - latin8: "iso885914", - latin9: "iso885915", - latin10: "iso885916", + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", - csisolatin1: "iso88591", - csisolatin2: "iso88592", - csisolatin3: "iso88593", - csisolatin4: "iso88594", - csisolatincyrillic: "iso88595", - csisolatinarabic: "iso88596", - csisolatingreek: "iso88597", - csisolatinhebrew: "iso88598", - csisolatin5: "iso88599", - csisolatin6: "iso885910", + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", - l1: "iso88591", - l2: "iso88592", - l3: "iso88593", - l4: "iso88594", - l5: "iso88599", - l6: "iso885910", - l7: "iso885913", - l8: "iso885914", - l9: "iso885915", - l10: "iso885916", + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", - isoir14: "iso646jp", - isoir57: "iso646cn", - isoir100: "iso88591", - isoir101: "iso88592", - isoir109: "iso88593", - isoir110: "iso88594", - isoir144: "iso88595", - isoir127: "iso88596", - isoir126: "iso88597", - isoir138: "iso88598", - isoir148: "iso88599", - isoir157: "iso885910", - isoir166: "tis620", - isoir179: "iso885913", - isoir199: "iso885914", - isoir203: "iso885915", - isoir226: "iso885916", + "cp819": "iso88591", + "ibm819": "iso88591", - cp819: "iso88591", - ibm819: "iso88591", + "cyrillic": "iso88595", - cyrillic: "iso88595", + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", - arabic: "iso88596", - arabic8: "iso88596", - ecma114: "iso88596", - asmo708: "iso88596", + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", - greek: "iso88597", - greek8: "iso88597", - ecma118: "iso88597", - elot928: "iso88597", + "hebrew": "iso88598", + "hebrew8": "iso88598", - hebrew: "iso88598", - hebrew8: "iso88598", + "turkish": "iso88599", + "turkish8": "iso88599", - turkish: "iso88599", - turkish8: "iso88599", + "thai": "iso885911", + "thai8": "iso885911", - thai: "iso885911", - thai8: "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", - celtic: "iso885914", - celtic8: "iso885914", - isoceltic: "iso885914", + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", - tis6200: "tis620", - tis62025291: "tis620", - tis62025330: "tis620", + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", - 10000: "macroman", - 10006: "macgreek", - 10007: "maccyrillic", - 10079: "maciceland", - 10081: "macturkish", + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", - cspc8codepage437: "cp437", - cspc775baltic: "cp775", - cspc850multilingual: "cp850", - cspcp852: "cp852", - cspc862latinhebrew: "cp862", - cpgr: "cp869", + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", - msee: "cp1250", - mscyrl: "cp1251", - msansi: "cp1252", - msgreek: "cp1253", - msturk: "cp1254", - mshebr: "cp1255", - msarab: "cp1256", - winbaltrim: "cp1257", + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", - cp20866: "koi8r", - 20866: "koi8r", - ibm878: "koi8r", - cskoi8r: "koi8r", + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", - cp21866: "koi8u", - 21866: "koi8u", - ibm1168: "koi8u", + "strk10482002": "rk1048", - strk10482002: "rk1048", + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", - tcvn5712: "tcvn", - tcvn57121: "tcvn", + "gb198880": "iso646cn", + "cn": "iso646cn", - gb198880: "iso646cn", - cn: "iso646cn", + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", - csiso14jisc6220ro: "iso646jp", - jisc62201969ro: "iso646jp", - jp: "iso646jp", + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", - cshproman8: "hproman8", - r8: "hproman8", - roman8: "hproman8", - xroman8: "hproman8", - ibm1051: "hproman8", + "mac": "macintosh", + "csmacintosh": "macintosh", +}; - mac: "macintosh", - csmacintosh: "macintosh" -} diff --git a/node_modules/iconv-lite/encodings/tables/gbk-added.json b/node_modules/iconv-lite/encodings/tables/gbk-added.json index b742e36..8abfa9f 100644 --- a/node_modules/iconv-lite/encodings/tables/gbk-added.json +++ b/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -27,7 +27,7 @@ ["a7c2","",14], ["a7f2","",12], ["a896","",10], -["a8bc","ḿ"], +["a8bc",""], ["a8bf","ǹ"], ["a8c1",""], ["a8ea","",20], @@ -51,6 +51,5 @@ ["fca1","",93], ["fda1","",93], ["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], -["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], -["8135f437",""] +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93] ] diff --git a/node_modules/iconv-lite/encodings/utf16.js b/node_modules/iconv-lite/encodings/utf16.js index ae60d98..54765ae 100644 --- a/node_modules/iconv-lite/encodings/utf16.js +++ b/node_modules/iconv-lite/encodings/utf16.js @@ -1,66 +1,69 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer +"use strict"; +var Buffer = require("safer-buffer").Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== -exports.utf16be = Utf16BECodec -function Utf16BECodec () { +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { } -Utf16BECodec.prototype.encoder = Utf16BEEncoder -Utf16BECodec.prototype.decoder = Utf16BEDecoder -Utf16BECodec.prototype.bomAware = true +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; + // -- Encoding -function Utf16BEEncoder () { +function Utf16BEEncoder() { } -Utf16BEEncoder.prototype.write = function (str) { - var buf = Buffer.from(str, "ucs2") - for (var i = 0; i < buf.length; i += 2) { - var tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp - } - return buf +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; + } + return buf; } -Utf16BEEncoder.prototype.end = function () { +Utf16BEEncoder.prototype.end = function() { } + // -- Decoding -function Utf16BEDecoder () { - this.overflowByte = -1 +function Utf16BEDecoder() { + this.overflowByte = -1; } -Utf16BEDecoder.prototype.write = function (buf) { - if (buf.length == 0) { return "" } +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; - var buf2 = Buffer.alloc(buf.length + 1) - var i = 0; var j = 0 + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; - if (this.overflowByte !== -1) { - buf2[0] = buf[0] - buf2[1] = this.overflowByte - i = 1; j = 2 - } + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } - for (; i < buf.length - 1; i += 2, j += 2) { - buf2[j] = buf[i + 1] - buf2[j + 1] = buf[i] - } + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } - this.overflowByte = (i == buf.length - 1) ? buf[buf.length - 1] : -1 + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; - return buf2.slice(0, j).toString("ucs2") + return buf2.slice(0, j).toString('ucs2'); } -Utf16BEDecoder.prototype.end = function () { - this.overflowByte = -1 +Utf16BEDecoder.prototype.end = function() { } + // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. @@ -69,119 +72,106 @@ Utf16BEDecoder.prototype.end = function () { // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). -exports.utf16 = Utf16Codec -function Utf16Codec (codecOptions, iconv) { - this.iconv = iconv +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; } -Utf16Codec.prototype.encoder = Utf16Encoder -Utf16Codec.prototype.decoder = Utf16Decoder +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; + // -- Encoding (pass-through) -function Utf16Encoder (options, codec) { - options = options || {} - if (options.addBOM === undefined) { options.addBOM = true } - this.encoder = codec.iconv.getEncoder("utf-16le", options) +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); } -Utf16Encoder.prototype.write = function (str) { - return this.encoder.write(str) +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); } -Utf16Encoder.prototype.end = function () { - return this.encoder.end() +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); } + // -- Decoding -function Utf16Decoder (options, codec) { - this.decoder = null - this.initialBufs = [] - this.initialBufsLen = 0 +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBytes = []; + this.initialBytesLen = 0; - this.options = options || {} - this.iconv = codec.iconv + this.options = options || {}; + this.iconv = codec.iconv; } -Utf16Decoder.prototype.write = function (buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf) - this.initialBufsLen += buf.length +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBytes.push(buf); + this.initialBytesLen += buf.length; + + if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) + return ''; - if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) - { return "" } - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - - return this.decoder.write(buf) -} - -Utf16Decoder.prototype.end = function () { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - var trail = this.decoder.end() - if (trail) { resStr += trail } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - return this.decoder.end() -} - -function detectEncoding (bufs, defaultEncoding) { - var b = [] - var charsProcessed = 0 - // Number of ASCII chars when decoded as LE or BE. - var asciiCharsLE = 0 - var asciiCharsBE = 0 - - outerLoop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i] - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]) - if (b.length === 2) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE) return "utf-16le" - if (b[0] === 0xFE && b[1] === 0xFF) return "utf-16be" - } - - if (b[0] === 0 && b[1] !== 0) asciiCharsBE++ - if (b[0] !== 0 && b[1] === 0) asciiCharsLE++ - - b.length = 0 - charsProcessed++ - - if (charsProcessed >= 100) { - break outerLoop - } - } + // We have enough bytes -> detect endianness. + var buf = Buffer.concat(this.initialBytes), + encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + this.initialBytes.length = this.initialBytesLen = 0; } - } - // Make decisions. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - if (asciiCharsBE > asciiCharsLE) return "utf-16be" - if (asciiCharsBE < asciiCharsLE) return "utf-16le" - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || "utf-16le" + return this.decoder.write(buf); } + +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var buf = Buffer.concat(this.initialBytes), + encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var res = this.decoder.write(buf), + trail = this.decoder.end(); + + return trail ? (res + trail) : res; + } + return this.decoder.end(); +} + +function detectEncoding(buf, defaultEncoding) { + var enc = defaultEncoding || 'utf-16le'; + + if (buf.length >= 2) { + // Check BOM. + if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM + enc = 'utf-16be'; + else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM + enc = 'utf-16le'; + else { + // No BOM found. Try to deduce encoding from initial content. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions + _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. + + for (var i = 0; i < _len; i += 2) { + if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; + if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; + } + + if (asciiCharsBE > asciiCharsLE) + enc = 'utf-16be'; + else if (asciiCharsBE < asciiCharsLE) + enc = 'utf-16le'; + } + } + + return enc; +} + + diff --git a/node_modules/iconv-lite/encodings/utf32.js b/node_modules/iconv-lite/encodings/utf32.js deleted file mode 100644 index 7231789..0000000 --- a/node_modules/iconv-lite/encodings/utf32.js +++ /dev/null @@ -1,307 +0,0 @@ -"use strict" - -var Buffer = require("safer-buffer").Buffer - -// == UTF32-LE/BE codec. ========================================================== - -exports._utf32 = Utf32Codec - -function Utf32Codec (codecOptions, iconv) { - this.iconv = iconv - this.bomAware = true - this.isLE = codecOptions.isLE -} - -exports.utf32le = { type: "_utf32", isLE: true } -exports.utf32be = { type: "_utf32", isLE: false } - -// Aliases -exports.ucs4le = "utf32le" -exports.ucs4be = "utf32be" - -Utf32Codec.prototype.encoder = Utf32Encoder -Utf32Codec.prototype.decoder = Utf32Decoder - -// -- Encoding - -function Utf32Encoder (options, codec) { - this.isLE = codec.isLE - this.highSurrogate = 0 -} - -Utf32Encoder.prototype.write = function (str) { - var src = Buffer.from(str, "ucs2") - var dst = Buffer.alloc(src.length * 2) - var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE - var offset = 0 - - for (var i = 0; i < src.length; i += 2) { - var code = src.readUInt16LE(i) - var isHighSurrogate = (code >= 0xD800 && code < 0xDC00) - var isLowSurrogate = (code >= 0xDC00 && code < 0xE000) - - if (this.highSurrogate) { - if (isHighSurrogate || !isLowSurrogate) { - // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low - // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character - // (technically wrong, but expected by some applications, like Windows file names). - write32.call(dst, this.highSurrogate, offset) - offset += 4 - } else { - // Create 32-bit value from high and low surrogates; - var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000 - - write32.call(dst, codepoint, offset) - offset += 4 - this.highSurrogate = 0 - - continue - } - } - - if (isHighSurrogate) { this.highSurrogate = code } else { - // Even if the current character is a low surrogate, with no previous high surrogate, we'll - // encode it as a semi-invalid stand-alone character for the same reasons expressed above for - // unpaired high surrogates. - write32.call(dst, code, offset) - offset += 4 - this.highSurrogate = 0 - } - } - - if (offset < dst.length) { dst = dst.slice(0, offset) } - - return dst -} - -Utf32Encoder.prototype.end = function () { - // Treat any leftover high surrogate as a semi-valid independent character. - if (!this.highSurrogate) { return } - - var buf = Buffer.alloc(4) - - if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) } - - this.highSurrogate = 0 - - return buf -} - -// -- Decoding - -function Utf32Decoder (options, codec) { - this.isLE = codec.isLE - this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0) - this.overflow = [] -} - -Utf32Decoder.prototype.write = function (src) { - if (src.length === 0) { return "" } - - var i = 0 - var codepoint = 0 - var dst = Buffer.alloc(src.length + 4) - var offset = 0 - var isLE = this.isLE - var overflow = this.overflow - var badChar = this.badChar - - if (overflow.length > 0) { - for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) } - - if (overflow.length === 4) { - // NOTE: codepoint is a signed int32 and can be negative. - // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). - if (isLE) { - codepoint = overflow[i] | (overflow[i + 1] << 8) | (overflow[i + 2] << 16) | (overflow[i + 3] << 24) - } else { - codepoint = overflow[i + 3] | (overflow[i + 2] << 8) | (overflow[i + 1] << 16) | (overflow[i] << 24) - } - overflow.length = 0 - - offset = _writeCodepoint(dst, offset, codepoint, badChar) - } - } - - // Main loop. Should be as optimized as possible. - for (; i < src.length - 3; i += 4) { - // NOTE: codepoint is a signed int32 and can be negative. - if (isLE) { - codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24) - } else { - codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24) - } - offset = _writeCodepoint(dst, offset, codepoint, badChar) - } - - // Keep overflowing bytes. - for (; i < src.length; i++) { - overflow.push(src[i]) - } - - return dst.slice(0, offset).toString("ucs2") -} - -function _writeCodepoint (dst, offset, codepoint, badChar) { - // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. - if (codepoint < 0 || codepoint > 0x10FFFF) { - // Not a valid Unicode codepoint - codepoint = badChar - } - - // Ephemeral Planes: Write high surrogate. - if (codepoint >= 0x10000) { - codepoint -= 0x10000 - - var high = 0xD800 | (codepoint >> 10) - dst[offset++] = high & 0xff - dst[offset++] = high >> 8 - - // Low surrogate is written below. - var codepoint = 0xDC00 | (codepoint & 0x3FF) - } - - // Write BMP char or low surrogate. - dst[offset++] = codepoint & 0xff - dst[offset++] = codepoint >> 8 - - return offset -}; - -Utf32Decoder.prototype.end = function () { - this.overflow.length = 0 -} - -// == UTF-32 Auto codec ============================================================= -// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. -// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 -// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); - -// Encoder prepends BOM (which can be overridden with (addBOM: false}). - -exports.utf32 = Utf32AutoCodec -exports.ucs4 = "utf32" - -function Utf32AutoCodec (options, iconv) { - this.iconv = iconv -} - -Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder -Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder - -// -- Encoding - -function Utf32AutoEncoder (options, codec) { - options = options || {} - - if (options.addBOM === undefined) { - options.addBOM = true - } - - this.encoder = codec.iconv.getEncoder(options.defaultEncoding || "utf-32le", options) -} - -Utf32AutoEncoder.prototype.write = function (str) { - return this.encoder.write(str) -} - -Utf32AutoEncoder.prototype.end = function () { - return this.encoder.end() -} - -// -- Decoding - -function Utf32AutoDecoder (options, codec) { - this.decoder = null - this.initialBufs = [] - this.initialBufsLen = 0 - this.options = options || {} - this.iconv = codec.iconv -} - -Utf32AutoDecoder.prototype.write = function (buf) { - if (!this.decoder) { - // Codec is not chosen yet. Accumulate initial bytes. - this.initialBufs.push(buf) - this.initialBufsLen += buf.length - - if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) - { return "" } - - // We have enough bytes -> detect endianness. - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - - return this.decoder.write(buf) -} - -Utf32AutoDecoder.prototype.end = function () { - if (!this.decoder) { - var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) - this.decoder = this.iconv.getDecoder(encoding, this.options) - - var resStr = "" - for (var i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } - - var trail = this.decoder.end() - if (trail) { resStr += trail } - - this.initialBufs.length = this.initialBufsLen = 0 - return resStr - } - - return this.decoder.end() -} - -function detectEncoding (bufs, defaultEncoding) { - var b = [] - var charsProcessed = 0 - var invalidLE = 0; var invalidBE = 0 // Number of invalid chars when decoded as LE or BE. - var bmpCharsLE = 0; var bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE. - - outerLoop: - for (var i = 0; i < bufs.length; i++) { - var buf = bufs[i] - for (var j = 0; j < buf.length; j++) { - b.push(buf[j]) - if (b.length === 4) { - if (charsProcessed === 0) { - // Check BOM first. - if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { - return "utf-32le" - } - if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { - return "utf-32be" - } - } - - if (b[0] !== 0 || b[1] > 0x10) invalidBE++ - if (b[3] !== 0 || b[2] > 0x10) invalidLE++ - - if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++ - if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++ - - b.length = 0 - charsProcessed++ - - if (charsProcessed >= 100) { - break outerLoop - } - } - } - } - - // Make decisions. - if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return "utf-32be" - if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return "utf-32le" - - // Couldn't decide (likely all zeros or not enough data). - return defaultEncoding || "utf-32le" -} diff --git a/node_modules/iconv-lite/encodings/utf7.js b/node_modules/iconv-lite/encodings/utf7.js index fe72a9d..b7631c2 100644 --- a/node_modules/iconv-lite/encodings/utf7.js +++ b/node_modules/iconv-lite/encodings/utf7.js @@ -1,122 +1,122 @@ -"use strict" -var Buffer = require("safer-buffer").Buffer +"use strict"; +var Buffer = require("safer-buffer").Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 -exports.utf7 = Utf7Codec -exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7 -function Utf7Codec (codecOptions, iconv) { - this.iconv = iconv +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; }; -Utf7Codec.prototype.encoder = Utf7Encoder -Utf7Codec.prototype.decoder = Utf7Decoder -Utf7Codec.prototype.bomAware = true +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; + // -- Encoding -// Why scape ()?./? -// eslint-disable-next-line no-useless-escape -var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; -function Utf7Encoder (options, codec) { - this.iconv = codec.iconv +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; } -Utf7Encoder.prototype.write = function (str) { - // Naive implementation. - // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". - return Buffer.from(str.replace(nonDirectChars, function (chunk) { - return "+" + (chunk === "+" - ? "" - : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + - "-" - }.bind(this))) +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); } -Utf7Encoder.prototype.end = function () { +Utf7Encoder.prototype.end = function() { } + // -- Decoding -function Utf7Decoder (options, codec) { - this.iconv = codec.iconv - this.inBase64 = false - this.base64Accum = "" +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; } -// Why scape /? -// eslint-disable-next-line no-useless-escape -var base64Regex = /[A-Za-z0-9\/+]/ -var base64Chars = [] -for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) } +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); -var plusChar = "+".charCodeAt(0) -var minusChar = "-".charCodeAt(0) -var andChar = "&".charCodeAt(0) +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); -Utf7Decoder.prototype.write = function (buf) { - var res = ""; var lastI = 0 - var inBase64 = this.inBase64 - var base64Accum = this.base64Accum +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; - // The decoder is more involved as we must handle chunks in stream. + // The decoder is more involved as we must handle chunks in stream. - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '+' - if (buf[i] == plusChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. - lastI = i + 1 - inBase64 = true - } - } else { // We decode base64. - if (!base64Chars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" - res += "+" - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii") - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + buf.slice(lastI, i).toString(); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } } - - if (buf[i] != minusChar) // Minus is absorbed after base64. - { i-- } - - lastI = i + 1 - inBase64 = false - base64Accum = "" - } } - } - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii") + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + buf.slice(lastI).toString(); - var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded) + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") - } + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } - this.inBase64 = inBase64 - this.base64Accum = base64Accum + this.inBase64 = inBase64; + this.base64Accum = base64Accum; - return res + return res; } -Utf7Decoder.prototype.end = function () { - var res = "" - if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - this.inBase64 = false - this.base64Accum = "" - return res + this.inBase64 = false; + this.base64Accum = ''; + return res; } + // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: @@ -128,156 +128,163 @@ Utf7Decoder.prototype.end = function () { // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. -exports.utf7imap = Utf7IMAPCodec -function Utf7IMAPCodec (codecOptions, iconv) { - this.iconv = iconv + +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; }; -Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder -Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder -Utf7IMAPCodec.prototype.bomAware = true +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; + // -- Encoding -function Utf7IMAPEncoder (options, codec) { - this.iconv = codec.iconv - this.inBase64 = false - this.base64Accum = Buffer.alloc(6) - this.base64AccumIdx = 0 +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; } -Utf7IMAPEncoder.prototype.write = function (str) { - var inBase64 = this.inBase64 - var base64Accum = this.base64Accum - var base64AccumIdx = this.base64AccumIdx - var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0 +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; - for (var i = 0; i < str.length; i++) { - var uChar = str.charCodeAt(i) - if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'. - if (inBase64) { - if (base64AccumIdx > 0) { - bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) - base64AccumIdx = 0 + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } + + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } } - - buf[bufIdx++] = minusChar // Write '-', then go to direct mode. - inBase64 = false - } - - if (!inBase64) { - buf[bufIdx++] = uChar // Write direct character - - if (uChar === andChar) // Ampersand -> '&-' - { buf[bufIdx++] = minusChar } - } - } else { // Non-direct character - if (!inBase64) { - buf[bufIdx++] = andChar // Write '&', then go to base64 mode. - inBase64 = true - } - if (inBase64) { - base64Accum[base64AccumIdx++] = uChar >> 8 - base64Accum[base64AccumIdx++] = uChar & 0xFF - - if (base64AccumIdx == base64Accum.length) { - bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx) - base64AccumIdx = 0 - } - } - } - } - - this.inBase64 = inBase64 - this.base64AccumIdx = base64AccumIdx - - return buf.slice(0, bufIdx) -} - -Utf7IMAPEncoder.prototype.end = function () { - var buf = Buffer.alloc(10); var bufIdx = 0 - if (this.inBase64) { - if (this.base64AccumIdx > 0) { - bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx) - this.base64AccumIdx = 0 } - buf[bufIdx++] = minusChar // Write '-', then go to direct mode. - this.inBase64 = false - } + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; - return buf.slice(0, bufIdx) + return buf.slice(0, bufIdx); } +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } + + return buf.slice(0, bufIdx); +} + + // -- Decoding -function Utf7IMAPDecoder (options, codec) { - this.iconv = codec.iconv - this.inBase64 = false - this.base64Accum = "" +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; } -var base64IMAPChars = base64Chars.slice() -base64IMAPChars[",".charCodeAt(0)] = true +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; -Utf7IMAPDecoder.prototype.write = function (buf) { - var res = ""; var lastI = 0 - var inBase64 = this.inBase64 - var base64Accum = this.base64Accum +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; - // The decoder is more involved as we must handle chunks in stream. - // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). - for (var i = 0; i < buf.length; i++) { - if (!inBase64) { // We're in direct mode. - // Write direct chars until '&' - if (buf[i] == andChar) { - res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars. - lastI = i + 1 - inBase64 = true - } - } else { // We decode base64. - if (!base64IMAPChars[buf[i]]) { // Base64 ended. - if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" - res += "&" - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/") - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } } - - if (buf[i] != minusChar) // Minus may be absorbed after base64. - { i-- } - - lastI = i + 1 - inBase64 = false - base64Accum = "" - } } - } - if (!inBase64) { - res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars. - } else { - var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/") + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); - var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. - base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. - b64str = b64str.slice(0, canBeDecoded) + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); - res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be") - } + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } - this.inBase64 = inBase64 - this.base64Accum = base64Accum + this.inBase64 = inBase64; + this.base64Accum = base64Accum; - return res + return res; } -Utf7IMAPDecoder.prototype.end = function () { - var res = "" - if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") } +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); - this.inBase64 = false - this.base64Accum = "" - return res + this.inBase64 = false; + this.base64Accum = ''; + return res; } + + diff --git a/node_modules/iconv-lite/lib/bom-handling.js b/node_modules/iconv-lite/lib/bom-handling.js index a86a6b5..1050872 100644 --- a/node_modules/iconv-lite/lib/bom-handling.js +++ b/node_modules/iconv-lite/lib/bom-handling.js @@ -1,48 +1,52 @@ -"use strict" +"use strict"; -var BOMChar = "\uFEFF" +var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper -function PrependBOMWrapper (encoder, options) { - this.encoder = encoder - this.addBOM = true +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; } -PrependBOMWrapper.prototype.write = function (str) { - if (this.addBOM) { - str = BOMChar + str - this.addBOM = false - } +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } - return this.encoder.write(str) + return this.encoder.write(str); } -PrependBOMWrapper.prototype.end = function () { - return this.encoder.end() +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); } -// ------------------------------------------------------------------------------ -exports.StripBOM = StripBOMWrapper -function StripBOMWrapper (decoder, options) { - this.decoder = decoder - this.pass = false - this.options = options || {} +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; } -StripBOMWrapper.prototype.write = function (buf) { - var res = this.decoder.write(buf) - if (this.pass || !res) { return res } +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; - if (res[0] === BOMChar) { - res = res.slice(1) - if (typeof this.options.stripBOM === "function") { this.options.stripBOM() } - } + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } - this.pass = true - return res + this.pass = true; + return res; } -StripBOMWrapper.prototype.end = function () { - return this.decoder.end() +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); } + diff --git a/node_modules/iconv-lite/lib/extend-node.js b/node_modules/iconv-lite/lib/extend-node.js new file mode 100644 index 0000000..87f5394 --- /dev/null +++ b/node_modules/iconv-lite/lib/extend-node.js @@ -0,0 +1,217 @@ +"use strict"; +var Buffer = require("buffer").Buffer; +// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer + +// == Extend Node primitives to use iconv-lite ================================= + +module.exports = function (iconv) { + var original = undefined; // Place to keep original methods. + + // Node authors rewrote Buffer internals to make it compatible with + // Uint8Array and we cannot patch key functions since then. + // Note: this does use older Buffer API on a purpose + iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array); + + iconv.extendNodeEncodings = function extendNodeEncodings() { + if (original) return; + original = {}; + + if (!iconv.supportsNodeEncodingsExtension) { + console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); + console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); + return; + } + + var nodeNativeEncodings = { + 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, + 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, + }; + + Buffer.isNativeEncoding = function(enc) { + return enc && nodeNativeEncodings[enc.toLowerCase()]; + } + + // -- SlowBuffer ----------------------------------------------------------- + var SlowBuffer = require('buffer').SlowBuffer; + + original.SlowBufferToString = SlowBuffer.prototype.toString; + SlowBuffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.SlowBufferToString.call(this, encoding, start, end); + + // Otherwise, use our decoding method. + if (typeof start == 'undefined') start = 0; + if (typeof end == 'undefined') end = this.length; + return iconv.decode(this.slice(start, end), encoding); + } + + original.SlowBufferWrite = SlowBuffer.prototype.write; + SlowBuffer.prototype.write = function(string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.SlowBufferWrite.call(this, string, offset, length, encoding); + + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError('attempt to write beyond buffer bounds'); + + // Otherwise, use our encoding method. + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + } + + // -- Buffer --------------------------------------------------------------- + + original.BufferIsEncoding = Buffer.isEncoding; + Buffer.isEncoding = function(encoding) { + return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); + } + + original.BufferByteLength = Buffer.byteLength; + Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferByteLength.call(this, str, encoding); + + // Slow, I know, but we don't have a better way yet. + return iconv.encode(str, encoding).length; + } + + original.BufferToString = Buffer.prototype.toString; + Buffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferToString.call(this, encoding, start, end); + + // Otherwise, use our decoding method. + if (typeof start == 'undefined') start = 0; + if (typeof end == 'undefined') end = this.length; + return iconv.decode(this.slice(start, end), encoding); + } + + original.BufferWrite = Buffer.prototype.write; + Buffer.prototype.write = function(string, offset, length, encoding) { + var _offset = offset, _length = length, _encoding = encoding; + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferWrite.call(this, string, _offset, _length, _encoding); + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError('attempt to write beyond buffer bounds'); + + // Otherwise, use our encoding method. + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + + // TODO: Set _charsWritten. + } + + + // -- Readable ------------------------------------------------------------- + if (iconv.supportsStreams) { + var Readable = require('stream').Readable; + + original.ReadableSetEncoding = Readable.prototype.setEncoding; + Readable.prototype.setEncoding = function setEncoding(enc, options) { + // Use our own decoder, it has the same interface. + // We cannot use original function as it doesn't handle BOM-s. + this._readableState.decoder = iconv.getDecoder(enc, options); + this._readableState.encoding = enc; + } + + Readable.prototype.collect = iconv._collect; + } + } + + // Remove iconv-lite Node primitive extensions. + iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { + if (!iconv.supportsNodeEncodingsExtension) + return; + if (!original) + throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.") + + delete Buffer.isNativeEncoding; + + var SlowBuffer = require('buffer').SlowBuffer; + + SlowBuffer.prototype.toString = original.SlowBufferToString; + SlowBuffer.prototype.write = original.SlowBufferWrite; + + Buffer.isEncoding = original.BufferIsEncoding; + Buffer.byteLength = original.BufferByteLength; + Buffer.prototype.toString = original.BufferToString; + Buffer.prototype.write = original.BufferWrite; + + if (iconv.supportsStreams) { + var Readable = require('stream').Readable; + + Readable.prototype.setEncoding = original.ReadableSetEncoding; + delete Readable.prototype.collect; + } + + original = undefined; + } +} diff --git a/node_modules/iconv-lite/lib/helpers/merge-exports.js b/node_modules/iconv-lite/lib/helpers/merge-exports.js deleted file mode 100644 index e79e041..0000000 --- a/node_modules/iconv-lite/lib/helpers/merge-exports.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict" - -var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn - -function mergeModules (target, module) { - for (var key in module) { - if (hasOwn(module, key)) { - target[key] = module[key] - } - } -} - -module.exports = mergeModules diff --git a/node_modules/iconv-lite/lib/index.d.ts b/node_modules/iconv-lite/lib/index.d.ts index b11d99e..0547eb3 100644 --- a/node_modules/iconv-lite/lib/index.d.ts +++ b/node_modules/iconv-lite/lib/index.d.ts @@ -1,129 +1,24 @@ -/* --------------------------------------------------------------------------------------------- +/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. * REQUIREMENT: This definition is dependent on the @types/node definition. * Install with `npm install @types/node --save-dev` - *-------------------------------------------------------------------------------------------- */ + *--------------------------------------------------------------------------------------------*/ -/* --------------------------------------------------------------------------------------------- - * This file provides detailed typings for the public API of iconv-lite - *-------------------------------------------------------------------------------------------- */ +declare module 'iconv-lite' { + export function decode(buffer: Buffer, encoding: string, options?: Options): string; -import type Stream = require("stream") -import type { Encoding } from "../types/encodings" + export function encode(content: string, encoding: string, options?: Options): Buffer; -declare namespace iconv { - export interface DecodeOptions { - /** - * Strip the Byte Order Mark (BOM) from the input, - * when decoding, if the codec is BOM-aware. @default true - */ - stripBOM?: boolean; - /** Override the default endianness for `UTF-16` and `UTF-32` decodings. */ - defaultEncoding?: "utf16be" | "utf32be"; - } + export function encodingExists(encoding: string): boolean; - export interface EncodeOptions { - /** - * Add a Byte Order Mark (BOM) to the output, when encoding, - * if the codec is BOM-aware. @default false - */ - addBOM?: boolean; - /** Override the default endianness for `UTF-32` encoding. */ - defaultEncoding?: "utf32be"; - } + export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; - export interface EncoderStream { - write(str: string): Buffer; - end(): Buffer | undefined; - } - - export interface DecoderStream { - write(buf: Buffer): string; - end(): string | undefined; - } - - export interface Codec { - encoder: new (options?: EncodeOptions, codec?: Codec) => EncoderStream; - decoder: new (options?: DecodeOptions, codec?: Codec) => DecoderStream; - bomAware?: boolean; - [key: string]: any; - } - - /** Encodes a `string` into a `Buffer`, using the provided `encoding`. */ - export function encode (content: string, encoding: Encoding, options?: EncodeOptions): Buffer - - /** Decodes a `Buffer` into a `string`, using the provided `encoding`. */ - export function decode (buffer: Buffer | Uint8Array, encoding: Encoding, options?: DecodeOptions): string - - /** Checks if a given encoding is supported by `iconv-lite`. */ - export function encodingExists (encoding: string): encoding is Encoding - - /** Legacy alias for {@link iconv.encode}. */ - export const toEncoding: typeof iconv.encode - - /** Legacy alias for {@link iconv.decode}. */ - export const fromEncoding: typeof iconv.decode - - /** Creates a stream that decodes binary data from a given `encoding` into strings. */ - export function decodeStream (encoding: Encoding, options?: DecodeOptions): NodeJS.ReadWriteStream - - /** Creates a stream that encodes strings into binary data in a given `encoding`. */ - export function encodeStream (encoding: Encoding, options?: EncodeOptions): NodeJS.ReadWriteStream - - /** - * Explicitly enable Streaming API in browser environments by passing in: - * ```js - * require('stream') - * ``` - * @example iconv.enableStreamingAPI(require('stream')); - */ - export function enableStreamingAPI (stream_module: { Transform: typeof Stream.Transform }): void - - /** Creates and returns a low-level encoder stream. */ - export function getEncoder (encoding: Encoding, options?: EncodeOptions): EncoderStream - - /** Creates and returns a low-level decoder stream. */ - export function getDecoder (encoding: Encoding, options?: DecodeOptions): DecoderStream - - /** - * Returns a codec object for the given `encoding`. - * @throws If the `encoding` is not recognized. - */ - export function getCodec (encoding: Encoding): Codec - - /** Strips all non-alphanumeric characters and appended year from `encoding`. */ - export function _canonicalizeEncoding (encoding: Encoding): string - - /** A cache of all loaded encoding definitions. */ - export let encodings: Record< - Encoding, - | string - | { - type: string; - [key: string]: any; - } - > | null - - /** A cache of initialized codec objects. */ - export let _codecDataCache: Record - - /** The character used for untranslatable `Unicode` characters. @default "�" */ - export let defaultCharUnicode: string - - /** The character used for untranslatable `single-byte` characters. @default "?" */ - export let defaultCharSingleByte: string - - /** - * Skip deprecation warning when strings are used instead of Buffers during decoding. - * Note: {@link iconv.decode} converts the string to Buffer regardless. - */ - export let skipDecodeWarning: boolean - - /** @readonly Whether or not, Streaming API is enabled. */ - export const supportsStreams: boolean - - export type { iconv as Iconv, Encoding } + export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; } -export = iconv +export interface Options { + stripBOM?: boolean; + addBOM?: boolean; + defaultEncoding?: string; +} diff --git a/node_modules/iconv-lite/lib/index.js b/node_modules/iconv-lite/lib/index.js index bd5d6bc..5391919 100644 --- a/node_modules/iconv-lite/lib/index.js +++ b/node_modules/iconv-lite/lib/index.js @@ -1,182 +1,153 @@ -"use strict" +"use strict"; -var Buffer = require("safer-buffer").Buffer +// Some environments don't have global Buffer (e.g. React Native). +// Solution would be installing npm modules "buffer" and "stream" explicitly. +var Buffer = require("safer-buffer").Buffer; -var bomHandling = require("./bom-handling") -var mergeModules = require("./helpers/merge-exports") +var bomHandling = require("./bom-handling"), + iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. -// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true -module.exports.encodings = null +iconv.encodings = null; // Characters emitted in case of error. -module.exports.defaultCharUnicode = "�" -module.exports.defaultCharSingleByte = "?" +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; // Public API. -module.exports.encode = function encode (str, encoding, options) { - str = "" + (str || "") // Ensure string. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. - var encoder = module.exports.getEncoder(encoding, options) + var encoder = iconv.getEncoder(encoding, options); - var res = encoder.write(str) - var trail = encoder.end() - - return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } -module.exports.decode = function decode (buf, encoding, options) { - if (typeof buf === "string") { - if (!module.exports.skipDecodeWarning) { - console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding") - module.exports.skipDecodeWarning = true +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } + + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } - buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer. - } + var decoder = iconv.getDecoder(encoding, options); - var decoder = module.exports.getDecoder(encoding, options) + var res = decoder.write(buf); + var trail = decoder.end(); - var res = decoder.write(buf) - var trail = decoder.end() - - return trail ? (res + trail) : res + return trail ? (res + trail) : res; } -module.exports.encodingExists = function encodingExists (enc) { - try { - module.exports.getCodec(enc) - return true - } catch (e) { - return false - } +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; + } } // Legacy aliases to convert functions -module.exports.toEncoding = module.exports.encode -module.exports.fromEncoding = module.exports.decode +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. -module.exports._codecDataCache = { __proto__: null } +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); -module.exports.getCodec = function getCodec (encoding) { - if (!module.exports.encodings) { - var raw = require("../encodings") - // TODO: In future versions when old nodejs support is removed can use object.assign - module.exports.encodings = { __proto__: null } // Initialize as empty object. - mergeModules(module.exports.encodings, raw) - } + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - var enc = module.exports._canonicalizeEncoding(encoding) + var codecDef = iconv.encodings[enc]; - // Traverse iconv.encodings to find actual codec. - var codecOptions = {} - while (true) { - var codec = module.exports._codecDataCache[enc] + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; - if (codec) { return codec } + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; - var codecDef = module.exports.encodings[enc] + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; - switch (typeof codecDef) { - case "string": // Direct alias to other encoding. - enc = codecDef - break + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; - case "object": // Alias with options. Can be layered. - for (var key in codecDef) { codecOptions[key] = codecDef[key] } + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); - if (!codecOptions.encodingName) { codecOptions.encodingName = enc } + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; - enc = codecDef.type - break - - case "function": // Codec itself. - if (!codecOptions.encodingName) { codecOptions.encodingName = enc } - - // The codec function must load all tables and return object with .encoder and .decoder methods. - // It'll be called only once (for each different options object). - // - codec = new codecDef(codecOptions, module.exports) - - module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later. - return codec - - default: - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')") + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } } - } } -module.exports._canonicalizeEncoding = function (encoding) { - // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. - return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "") +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); } -module.exports.getEncoder = function getEncoder (encoding, options) { - var codec = module.exports.getCodec(encoding) - var encoder = new codec.encoder(options, codec) +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); - if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) } + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); - return encoder + return encoder; } -module.exports.getDecoder = function getDecoder (encoding, options) { - var codec = module.exports.getCodec(encoding) - var decoder = new codec.decoder(options, codec) +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); - if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) } + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); - return decoder + return decoder; } -// Streaming API -// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add -// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. -// If you would like to enable it explicitly, please add the following code to your app: -// > iconv.enableStreamingAPI(require('stream')); -module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) { - if (module.exports.supportsStreams) { return } - // Dependency-inject stream module to create IconvLite stream classes. - var streams = require("./streams")(streamModule) +// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. +var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; +if (nodeVer) { - // Not public API yet, but expose the stream classes. - module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream - module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream + // Load streaming support in Node v0.10+ + var nodeVerArr = nodeVer.split(".").map(Number); + if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { + require("./streams")(iconv); + } - // Streaming API. - module.exports.encodeStream = function encodeStream (encoding, options) { - return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options) - } - - module.exports.decodeStream = function decodeStream (encoding, options) { - return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options) - } - - module.exports.supportsStreams = true + // Load Node primitive extensions. + require("./extend-node")(iconv); } -// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). -var streamModule -try { - streamModule = require("stream") -} catch (e) {} - -if (streamModule && streamModule.Transform) { - module.exports.enableStreamingAPI(streamModule) -} else { - // In rare cases where 'stream' module is not available by default, throw a helpful exception. - module.exports.encodeStream = module.exports.decodeStream = function () { - throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.") - } -} - -// Some environments, such as browsers, may not load JavaScript files as UTF-8 -// eslint-disable-next-line no-constant-condition -if ("Ā" !== "\u0100") { - console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.") +if ("Ā" != "\u0100") { + console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); } diff --git a/node_modules/iconv-lite/lib/streams.js b/node_modules/iconv-lite/lib/streams.js index ebfed8e..4409552 100644 --- a/node_modules/iconv-lite/lib/streams.js +++ b/node_modules/iconv-lite/lib/streams.js @@ -1,105 +1,121 @@ -"use strict" +"use strict"; -var Buffer = require("safer-buffer").Buffer +var Buffer = require("buffer").Buffer, + Transform = require("stream").Transform; -// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), -// we opt to dependency-inject it instead of creating a hard dependency. -module.exports = function (streamModule) { - var Transform = streamModule.Transform - // == Encoder stream ======================================================= - - function IconvLiteEncoderStream (conv, options) { - this.conv = conv - options = options || {} - options.decodeStrings = false // We accept only strings, so we don't need to decode them. - Transform.call(this, options) - } - - IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } - }) - - IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { - if (typeof chunk !== "string") { - return done(new Error("Iconv encoding stream needs strings as its input.")) +// == Exports ================================================================== +module.exports = function(iconv) { + + // Additional Public API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } - try { - var res = this.conv.write(chunk) - if (res && res.length) this.push(res) - done() - } catch (e) { - done(e) + iconv.decodeStream = function decodeStream(encoding, options) { + return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } - } - IconvLiteEncoderStream.prototype._flush = function (done) { - try { - var res = this.conv.end() - if (res && res.length) this.push(res) - done() - } catch (e) { - done(e) - } - } + iconv.supportsStreams = true; - IconvLiteEncoderStream.prototype.collect = function (cb) { - var chunks = [] - this.on("error", cb) - this.on("data", function (chunk) { chunks.push(chunk) }) - this.on("end", function () { - cb(null, Buffer.concat(chunks)) - }) - return this - } - // == Decoder stream ======================================================= + // Not published yet. + iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; + iconv._collect = IconvLiteDecoderStream.prototype.collect; +}; - function IconvLiteDecoderStream (conv, options) { - this.conv = conv - options = options || {} - options.encoding = this.encoding = "utf8" // We output strings. - Transform.call(this, options) - } - IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } - }) - - IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { - if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) } - try { - var res = this.conv.write(chunk) - if (res && res.length) this.push(res, this.encoding) - done() - } catch (e) { - done(e) - } - } - - IconvLiteDecoderStream.prototype._flush = function (done) { - try { - var res = this.conv.end() - if (res && res.length) this.push(res, this.encoding) - done() - } catch (e) { - done(e) - } - } - - IconvLiteDecoderStream.prototype.collect = function (cb) { - var res = "" - this.on("error", cb) - this.on("data", function (chunk) { res += chunk }) - this.on("end", function () { - cb(null, res) - }) - return this - } - - return { - IconvLiteEncoderStream: IconvLiteEncoderStream, - IconvLiteDecoderStream: IconvLiteDecoderStream - } +// == Encoder stream ======================================================= +function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); } + +IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } +}); + +IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; +} + + +// == Decoder stream ======================================================= +function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); +} + +IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } +}); + +IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; +} + diff --git a/node_modules/iconv-lite/package.json b/node_modules/iconv-lite/package.json index 2a57357..a7c74fc 100644 --- a/node_modules/iconv-lite/package.json +++ b/node_modules/iconv-lite/package.json @@ -1,7 +1,7 @@ { "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", - "version": "0.7.2", + "version": "0.4.24", "license": "MIT", "keywords": [ "iconv", @@ -12,59 +12,35 @@ "author": "Alexander Shtuchkin ", "main": "./lib/index.js", "typings": "./lib/index.d.ts", - "homepage": "https://github.com/pillarjs/iconv-lite", - "bugs": "https://github.com/pillarjs/iconv-lite/issues", - "files": [ - "lib/", - "encodings/", - "types/" - ], - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", "repository": { "type": "git", - "url": "https://github.com/pillarjs/iconv-lite.git" + "url": "git://github.com/ashtuchkin/iconv-lite.git" }, "engines": { "node": ">=0.10.0" }, "scripts": { - "lint": "eslint", - "lint:fix": "eslint --fix", - "test": "mocha --reporter spec --check-leaks --grep .", - "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", - "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", - "test:performance": "node --allow-natives-syntax performance/index.js", - "test:tap": "mocha --reporter tap --check-leaks --grep .", - "test:typescript": "tsc && attw --pack", - "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz", - "typegen": "node generation/gen-typings.js" + "coverage": "istanbul cover _mocha -- --grep .", + "coverage-open": "open coverage/lcov-report/index.html", + "test": "mocha --reporter spec --grep ." }, "browser": { - "stream": false + "./lib/extend-node": false, + "./lib/streams": false }, "devDependencies": { - "@arethetypeswrong/cli": "^0.17.4", - "@stylistic/eslint-plugin": "^5.1.0", - "@stylistic/eslint-plugin-js": "^4.1.0", - "@types/node": "^24.0.12", - "async": "^3.2.0", - "bench-node": "^0.10.0", - "eslint": "^9.0.0", - "errto": "^0.2.1", - "expect-type": "^1.2.0", - "iconv": "^2.3.5", - "mocha": "^6.2.2", - "neostandard": "^0.12.0", - "nyc": "^14.1.1", - "request": "^2.88.2", - "semver": "^6.3.0", - "typescript": "~5.9.2", - "unorm": "^1.6.0" + "mocha": "^3.1.0", + "request": "~2.87.0", + "unorm": "*", + "errto": "*", + "async": "*", + "istanbul": "*", + "semver": "*", + "iconv": "*" }, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" + "safer-buffer": ">= 2.1.2 < 3" } } diff --git a/node_modules/iconv-lite/types/encodings.d.ts b/node_modules/iconv-lite/types/encodings.d.ts deleted file mode 100644 index bedbe33..0000000 --- a/node_modules/iconv-lite/types/encodings.d.ts +++ /dev/null @@ -1,423 +0,0 @@ -/* - * --------------------------------------------------------------------------------------------- - * DO NOT EDIT THIS FILE MANUALLY. - * THIS FILE IS AUTOMATICALLY GENERATED. - * TO UPDATE, RUN `npm run typegen` AND COMMIT THE CHANGES. - * --------------------------------------------------------------------------------------------- - */ - -/** A union of all supported encoding strings in `iconv-lite`. */ -export type Encoding = - | "10000" - | "10006" - | "10007" - | "10029" - | "10079" - | "10081" - | "1046" - | "1124" - | "1125" - | "1129" - | "1133" - | "1161" - | "1162" - | "1163" - | "1250" - | "1251" - | "1252" - | "1253" - | "1254" - | "1255" - | "1256" - | "1257" - | "1258" - | "20866" - | "21866" - | "28591" - | "28592" - | "28593" - | "28594" - | "28595" - | "28596" - | "28597" - | "28598" - | "28599" - | "28600" - | "28601" - | "28603" - | "28604" - | "28605" - | "28606" - | "437" - | "737" - | "775" - | "808" - | "850" - | "852" - | "855" - | "856" - | "857" - | "858" - | "860" - | "861" - | "862" - | "863" - | "864" - | "865" - | "866" - | "869" - | "874" - | "922" - | "932" - | "936" - | "949" - | "950" - | "ansix34" - | "ansix341968" - | "ansix341986" - | "arabic" - | "arabic8" - | "armscii8" - | "ascii" - | "ascii8bit" - | "asmo708" - | "base64" - | "big5" - | "big5hkscs" - | "binary" - | "celtic" - | "celtic8" - | "cesu8" - | "chinese" - | "cn" - | "cnbig5" - | "cp1046" - | "cp1124" - | "cp1125" - | "cp1129" - | "cp1133" - | "cp1161" - | "cp1162" - | "cp1163" - | "cp1250" - | "cp1251" - | "cp1252" - | "cp1253" - | "cp1254" - | "cp1255" - | "cp1256" - | "cp1257" - | "cp1258" - | "cp20866" - | "cp21866" - | "cp28591" - | "cp28592" - | "cp28593" - | "cp28594" - | "cp28595" - | "cp28596" - | "cp28597" - | "cp28598" - | "cp28599" - | "cp28600" - | "cp28601" - | "cp28603" - | "cp28604" - | "cp28605" - | "cp28606" - | "cp367" - | "cp437" - | "cp720" - | "cp737" - | "cp775" - | "cp808" - | "cp819" - | "cp850" - | "cp852" - | "cp855" - | "cp856" - | "cp857" - | "cp858" - | "cp860" - | "cp861" - | "cp862" - | "cp863" - | "cp864" - | "cp865" - | "cp866" - | "cp869" - | "cp874" - | "cp922" - | "cp932" - | "cp936" - | "cp949" - | "cp950" - | "cpgr" - | "csascii" - | "csbig5" - | "cseuckr" - | "csgb2312" - | "cshproman8" - | "csibm1046" - | "csibm1124" - | "csibm1125" - | "csibm1129" - | "csibm1133" - | "csibm1161" - | "csibm1162" - | "csibm1163" - | "csibm437" - | "csibm737" - | "csibm775" - | "csibm850" - | "csibm852" - | "csibm855" - | "csibm856" - | "csibm857" - | "csibm858" - | "csibm860" - | "csibm861" - | "csibm862" - | "csibm863" - | "csibm864" - | "csibm865" - | "csibm866" - | "csibm869" - | "csibm922" - | "csiso14jisc6220ro" - | "csiso58gb231280" - | "csisolatin1" - | "csisolatin2" - | "csisolatin3" - | "csisolatin4" - | "csisolatin5" - | "csisolatin6" - | "csisolatinarabic" - | "csisolatincyrillic" - | "csisolatingreek" - | "csisolatinhebrew" - | "cskoi8r" - | "csksc56011987" - | "csmacintosh" - | "cspc775baltic" - | "cspc850multilingual" - | "cspc862latinhebrew" - | "cspc8codepage437" - | "cspcp852" - | "csshiftjis" - | "cyrillic" - | "ecma114" - | "ecma118" - | "elot928" - | "euccn" - | "eucjp" - | "euckr" - | "gb18030" - | "gb198880" - | "gb2312" - | "gb23121980" - | "gb231280" - | "gbk" - | "georgianacademy" - | "georgianps" - | "greek" - | "greek8" - | "hebrew" - | "hebrew8" - | "hex" - | "hproman8" - | "ibm1046" - | "ibm1051" - | "ibm1124" - | "ibm1125" - | "ibm1129" - | "ibm1133" - | "ibm1161" - | "ibm1162" - | "ibm1163" - | "ibm1168" - | "ibm367" - | "ibm437" - | "ibm737" - | "ibm775" - | "ibm808" - | "ibm819" - | "ibm850" - | "ibm852" - | "ibm855" - | "ibm856" - | "ibm857" - | "ibm858" - | "ibm860" - | "ibm861" - | "ibm862" - | "ibm863" - | "ibm864" - | "ibm865" - | "ibm866" - | "ibm869" - | "ibm878" - | "ibm922" - | "iso646cn" - | "iso646irv" - | "iso646jp" - | "iso646us" - | "iso88591" - | "iso885910" - | "iso885911" - | "iso885913" - | "iso885914" - | "iso885915" - | "iso885916" - | "iso88592" - | "iso88593" - | "iso88594" - | "iso88595" - | "iso88596" - | "iso88597" - | "iso88598" - | "iso88599" - | "isoceltic" - | "isoir100" - | "isoir101" - | "isoir109" - | "isoir110" - | "isoir126" - | "isoir127" - | "isoir138" - | "isoir14" - | "isoir144" - | "isoir148" - | "isoir149" - | "isoir157" - | "isoir166" - | "isoir179" - | "isoir199" - | "isoir203" - | "isoir226" - | "isoir57" - | "isoir58" - | "isoir6" - | "jisc62201969ro" - | "jp" - | "koi8r" - | "koi8ru" - | "koi8t" - | "koi8u" - | "korean" - | "ksc5601" - | "ksc56011987" - | "ksc56011989" - | "l1" - | "l10" - | "l2" - | "l3" - | "l4" - | "l5" - | "l6" - | "l7" - | "l8" - | "l9" - | "latin1" - | "latin10" - | "latin2" - | "latin3" - | "latin4" - | "latin5" - | "latin6" - | "latin7" - | "latin8" - | "latin9" - | "mac" - | "maccenteuro" - | "maccroatian" - | "maccyrillic" - | "macgreek" - | "maciceland" - | "macintosh" - | "macroman" - | "macromania" - | "macthai" - | "macturkish" - | "macukraine" - | "mik" - | "ms31j" - | "ms932" - | "ms936" - | "ms949" - | "ms950" - | "msansi" - | "msarab" - | "mscyrl" - | "msee" - | "msgreek" - | "mshebr" - | "mskanji" - | "msturk" - | "pt154" - | "r8" - | "rk1048" - | "roman8" - | "shiftjis" - | "sjis" - | "strk10482002" - | "tcvn" - | "tcvn5712" - | "tcvn57121" - | "thai" - | "thai8" - | "tis620" - | "tis6200" - | "tis62025291" - | "tis62025330" - | "turkish" - | "turkish8" - | "ucs2" - | "ucs4" - | "ucs4be" - | "ucs4le" - | "unicode11utf7" - | "unicode11utf8" - | "us" - | "usascii" - | "utf16" - | "utf16be" - | "utf16le" - | "utf32" - | "utf32be" - | "utf32le" - | "utf7" - | "utf7imap" - | "utf8" - | "viscii" - | "win1250" - | "win1251" - | "win1252" - | "win1253" - | "win1254" - | "win1255" - | "win1256" - | "win1257" - | "win1258" - | "win874" - | "winbaltrim" - | "windows1250" - | "windows1251" - | "windows1252" - | "windows1253" - | "windows1254" - | "windows1255" - | "windows1256" - | "windows1257" - | "windows1258" - | "windows31j" - | "windows874" - | "windows932" - | "windows936" - | "windows949" - | "windows950" - | "xgbk" - | "xroman8" - | "xsjis" - | "xxbig5" - | (string & {}) diff --git a/node_modules/is-promise/LICENSE b/node_modules/is-promise/LICENSE deleted file mode 100644 index 27cc9f3..0000000 --- a/node_modules/is-promise/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Forbes Lindesay - -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. \ No newline at end of file diff --git a/node_modules/is-promise/index.d.ts b/node_modules/is-promise/index.d.ts deleted file mode 100644 index 2107b42..0000000 --- a/node_modules/is-promise/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function isPromise(obj: PromiseLike | S): obj is PromiseLike; -export default isPromise; diff --git a/node_modules/is-promise/index.js b/node_modules/is-promise/index.js deleted file mode 100644 index 1bed087..0000000 --- a/node_modules/is-promise/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = isPromise; -module.exports.default = isPromise; - -function isPromise(obj) { - return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; -} diff --git a/node_modules/is-promise/index.mjs b/node_modules/is-promise/index.mjs deleted file mode 100644 index bf9e99b..0000000 --- a/node_modules/is-promise/index.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export default function isPromise(obj) { - return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; -} diff --git a/node_modules/is-promise/package.json b/node_modules/is-promise/package.json deleted file mode 100644 index 2a3c540..0000000 --- a/node_modules/is-promise/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "is-promise", - "version": "4.0.0", - "description": "Test whether an object looks like a promises-a+ promise", - "main": "./index.js", - "scripts": { - "test": "node test" - }, - "files": [ - "index.js", - "index.mjs", - "index.d.ts" - ], - "exports": { - ".": [ - { - "import": "./index.mjs", - "require": "./index.js", - "default": "./index.js" - }, - "./index.js" - ] - }, - "repository": { - "type": "git", - "url": "https://github.com/then/is-promise.git" - }, - "author": "ForbesLindesay", - "license": "MIT" -} diff --git a/node_modules/is-promise/readme.md b/node_modules/is-promise/readme.md deleted file mode 100644 index d53d34b..0000000 --- a/node_modules/is-promise/readme.md +++ /dev/null @@ -1,33 +0,0 @@ - - -# is-promise - - Test whether an object looks like a promises-a+ promise - - [![Build Status](https://img.shields.io/travis/then/is-promise/master.svg)](https://travis-ci.org/then/is-promise) - [![Dependency Status](https://img.shields.io/david/then/is-promise.svg)](https://david-dm.org/then/is-promise) - [![NPM version](https://img.shields.io/npm/v/is-promise.svg)](https://www.npmjs.org/package/is-promise) - - - -## Installation - - $ npm install is-promise - -You can also use it client side via npm. - -## API - -```typescript -import isPromise from 'is-promise'; - -isPromise(Promise.resolve());//=>true -isPromise({then:function () {...}});//=>true -isPromise(null);//=>false -isPromise({});//=>false -isPromise({then: true})//=>false -``` - -## License - - MIT diff --git a/node_modules/javascript-natural-sort/.gitattributes b/node_modules/javascript-natural-sort/.gitattributes deleted file mode 100644 index 412eeda..0000000 --- a/node_modules/javascript-natural-sort/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# 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/node_modules/javascript-natural-sort/.idea/.name b/node_modules/javascript-natural-sort/.idea/.name deleted file mode 100644 index f9bd021..0000000 --- a/node_modules/javascript-natural-sort/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -javascript-natural-sort \ No newline at end of file diff --git a/node_modules/javascript-natural-sort/.idea/encodings.xml b/node_modules/javascript-natural-sort/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/node_modules/javascript-natural-sort/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/javascript-natural-sort/.idea/javascript-natural-sort.iml b/node_modules/javascript-natural-sort/.idea/javascript-natural-sort.iml deleted file mode 100644 index 6b8184f..0000000 --- a/node_modules/javascript-natural-sort/.idea/javascript-natural-sort.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/javascript-natural-sort/.idea/misc.xml b/node_modules/javascript-natural-sort/.idea/misc.xml deleted file mode 100644 index 1162f43..0000000 --- a/node_modules/javascript-natural-sort/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/javascript-natural-sort/.idea/modules.xml b/node_modules/javascript-natural-sort/.idea/modules.xml deleted file mode 100644 index 63a98c1..0000000 --- a/node_modules/javascript-natural-sort/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/javascript-natural-sort/.idea/scopes/scope_settings.xml b/node_modules/javascript-natural-sort/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/node_modules/javascript-natural-sort/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/node_modules/javascript-natural-sort/.idea/vcs.xml b/node_modules/javascript-natural-sort/.idea/vcs.xml deleted file mode 100644 index c80f219..0000000 --- a/node_modules/javascript-natural-sort/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/node_modules/javascript-natural-sort/.idea/workspace.xml b/node_modules/javascript-natural-sort/.idea/workspace.xml deleted file mode 100644 index e229274..0000000 --- a/node_modules/javascript-natural-sort/.idea/workspace.xml +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1388535088299 - 1388535088299 - - - 1388535399296 - 1388535399296 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/node_modules/javascript-natural-sort/.npmignore b/node_modules/javascript-natural-sort/.npmignore deleted file mode 100644 index 5ebd21a..0000000 --- a/node_modules/javascript-natural-sort/.npmignore +++ /dev/null @@ -1,163 +0,0 @@ -################# -## 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/node_modules/javascript-natural-sort/README.md b/node_modules/javascript-natural-sort/README.md deleted file mode 100644 index 8270bd1..0000000 --- a/node_modules/javascript-natural-sort/README.md +++ /dev/null @@ -1,76 +0,0 @@ -### 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/node_modules/javascript-natural-sort/index.html b/node_modules/javascript-natural-sort/index.html deleted file mode 100644 index 9c0bf7e..0000000 --- a/node_modules/javascript-natural-sort/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - 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/node_modules/javascript-natural-sort/naturalSort.js b/node_modules/javascript-natural-sort/naturalSort.js deleted file mode 100644 index 28dd64d..0000000 --- a/node_modules/javascript-natural-sort/naturalSort.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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/node_modules/javascript-natural-sort/package.json b/node_modules/javascript-natural-sort/package.json deleted file mode 100644 index 4b1bf07..0000000 --- a/node_modules/javascript-natural-sort/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "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/node_modules/javascript-natural-sort/speed-tests.html b/node_modules/javascript-natural-sort/speed-tests.html deleted file mode 100644 index 090259b..0000000 --- a/node_modules/javascript-natural-sort/speed-tests.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - diff --git a/node_modules/javascript-natural-sort/unit-tests.html b/node_modules/javascript-natural-sort/unit-tests.html deleted file mode 100644 index 7b11540..0000000 --- a/node_modules/javascript-natural-sort/unit-tests.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - js-naturalsort test suite - - - - - - - -

js-naturalsort test suite

-

-

-
    - - diff --git a/node_modules/mathjs/CONTRIBUTING.md b/node_modules/mathjs/CONTRIBUTING.md deleted file mode 100644 index 474a34f..0000000 --- a/node_modules/mathjs/CONTRIBUTING.md +++ /dev/null @@ -1,24 +0,0 @@ -## 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/node_modules/mathjs/HISTORY.md b/node_modules/mathjs/HISTORY.md deleted file mode 100644 index e21b3e8..0000000 --- a/node_modules/mathjs/HISTORY.md +++ /dev/null @@ -1,3194 +0,0 @@ -# History - -# 2026-02-10, 15.1.1 - -- Fix: #3631 Handle bigints in `compareNatural` (#3632). Thanks @Dheemanth07. -- Fix: #3578 interpret empty true-expr of conditional as error (#3581). - Thanks @gwhitney. -- Fix: #3597 added nullish type definitions (#3601). Thanks @Ayo1984. -- Docs: Correct several arithmetic and relational documentation examples - and add History (#3630). Thanks @Anadian. -- Docs: fix #3565, update Matrix documentation (#3591). Thanks @orelbn. -- Docs: #3341 add per-function HISTORY sections (#3606). Thanks @gwhitney. -- Docs: describe that `setDistinct` sorts the elements (see #3602). - -# 2025-11-05, 15.1.0 - -- Feat: implement functions `isFinite` and `isBounded` (#3554, #3553). - Thanks @gwhitney. -- Feat: add function `bernoulli` to calculate Bernoulli numbers (#3551). - Thanks @gwhitney. -- Feat: support for optional chaining `object?.key` (#3547). - Thanks @NilsDietrich. -- Fix: #3580, #3586, #3587 issues with the optional chaining operator: disallow - double dot `?..`, allow optional function calls, throw errors on invalid uses - of `?.` (#3585). Thanks @AnslemHack. -- Fix: #3579 conditional parsed as optional chaining (#3584). -- Fix: #3564 Avoid error throws when mapping/filtering empty arrays/matrices. - (#3567). Thanks @richardt-cla. -- Fix: #3574 respect tolerances in function `isInteger` (#3575). - Thanks @gwhitney. -- Fix: #3562 serializing units missing an internal property (#3572). - -# 2025-10-10, 15.0.0 - -!!! BE CAREFUL: BREAKING CHANGES !!! - -- Feat: #3349 Decouple precedence of unary percentage operator and binary - modulus operator (that both use symbol `%`), and raise the former (#3432). - Thanks @kiprobinsonknack. -- Feat: #1753 enhance Kronecker product to handle arbitrary dimension (#3461, - #3455). Thanks @gwhitney and @Delaney. -- Feat: #2344 matrix subset according to the type of input (#3485). - Thanks @dvd101x. -- Fix: #3501 parse `%` as unary only when not followed by a term (#3505). - Thanks @gwhitney. -- Fix: #3421 require a space or delimiter after hex, bin, and oct values (#3463). -- Fix: #3529 Change function `size` to always return an `Array` (#3535). -- Fix: #3530 throw an error when trying to flatten a `SparseMatrix` (#3536). - -# 2025-10-10, 14.9.1 - -- Fix: issue in HISTORY.md listing all fixes of `v14.8.2` under `v14.9.0`. - -# 2025-10-10, 14.9.0 - -- Feat: improve the performance of `map` with multiple arguments (#3526). - Thanks @dvd101x. -- Fix: #3541 throw an error when evaluating a range with a step of zero - (#3548). Thanks @dvd101x. - -# 2025-10-03, 14.8.2 - -- Fix: improve performance in functions like `map` when passing a unary - function (#3546). Thanks @dvd101x. -- Fix: improve the type definition of `abs(complex)` which returns a `number` - (#3543). Thanks @joshkel. -- Fix: add missing type definitions for `ctranspose` (#3545). Thanks @joshkel. -- Fix: typos in code comments (#3544). Thanks @joshkel. - -# 2025-09-26, 14.8.1 - -- Fix: #3538 `config` printing a warning when using `{ number: 'bigint' }` - (#3540). - -# 2025-09-24, 14.8.0 - -- Feat: #3353 support for the nullish coalescing operator `??` in the - expression parser (#3497). Thanks @ikemHood. - -# 2025-09-05, 14.7.0 - -- Feat: faster `DenseMatrix` symbol iterator (#3521). Thanks @dvd101x. -- Feat: implement serialization support for `Parser`, fixing #3509 (#3525). -- Fix: #3519, #3368 categories "Core functions" and "Construction functions" - missing from the generated function overview. -- Fix: #3517 `printTransformDependencies` not exported in the type definitions. -- Fix: add missing type definition for function `diff` (#3520). Thanks @dodokw. -- Fix: #3396 improve documentation of function `range`. -- Fix: #3523 cleanup old polyfills from the browser bundle - by removing `core-js` (#3524). - -# 2025-07-25, 14.6.0 - -- Feat: new function `toBest(unit, unitList, offset)`, and corresponding - method `unit.toBest(...)` (#3484). Thanks @Mundi93, @EliaAlesiani, and - @HeavyRainLQ. -- Fix: #3512 `sign` of zero not returning zero in case of a fraction (#3513). - Thanks @kyle-compute. - -# 2025-07-02, 14.5.3 - -- Fix: #2199 parse non-breaking white space ` ` as white space - (#3487). Thanks donmccurdy. -- Fix: refine the type definitions of `scope` (#3490). Thanks @JayChang4w. -- Fix: #3493 type definitions of `unit(number)` (#3495). Thanks @mrft. -- Fix: #3494 type definitions not supporting `unit.to(unit)` (#3495). - Thanks @mrft. -- Fix: #3499 refine type definitions of `add` and `multiply` to not allow zero - or one argument (#3495). Thanks @mrft. - -# 2025-05-30, 14.5.2 - -- Fix: add embedded docs for the deprecated physical constant `coulomb`, - see #3472. -- Fix: #3469 add `ResultSet` interface and improve `isResultSet` typing - (#3481). Thanks @ranidam. - -# 2025-05-28, 14.5.1 - -- Fix: #3482 mathjs throwing an error related to `BigInt` when loading in - specific environments. -- Fix: syntax section of function `numeric` (see #3448). -- Fix: #3472 rename physical constant `coulomb` to `coulombConstant`. The old - name is still available for backward compatibility. -- Fix: support multiplication of arrays with units (#3456). Thanks @Delaney. - -# 2025-05-21, 14.5.0 - -- Feat: improve the performance of the `map` and `forEach` methods of - `DenseMatrix` (#3446). Thanks @dvd101x. -- Feat: improve the performance of `subset` (#3467). Thanks @dvd101x. -- Feat: define embedded docs for `compile`, `evaluate`, `parse`, and `parser`, - and add tests for the examples in embedded docs (#3413). Thanks @dvd101x. -- Fix: #3450 support multiplication of valueless units by arbitrary types - (#3454). -- Fix: #3474 correctly parse `(lbf in)` (#3476). Thanks @costerwi. - -# 2025-03-28, 14.4.0 - -- Feat: improve the performance of function `flatten` (#3400). Thanks @dvd101x. -- Feat: improve the performance of `map` and `forEach` (#3409). - Thanks @dvd101x. -- Feat: add LaTeX representation for fractions (#3434, #3419). Thanks @orelbn. -- Fix: #3422 allow dot operators after symbol E (#3425). -- Fix: issue in the `nthRoots` latex function template string (#3427). - Thanks @aitee. -- Fix: upgrade to the latest version of `@babel/runtime`. - -# 2025-03-06, 14.3.1 - -- Fix: #3350 cannot import a constant that is a complex number. - -# 2025-02-28, 14.3.0 - -- Feat: improved performance of function `flatten` (#3354). Thanks @dvd101x. -- Feat: improved performance of `DenseMatrix` Symbol.iterator (#3395). - Thanks @dvd101x. -- Feat: improved performance of functions `map` and `forEach` (#3399). - Thanks @dvd101x. -- Fix: #3390 issue in callback optimization and add error handling for invalid - argument types (#3394). Thanks @dvd101x. -- Fix: #3356 add missing eigsDependencies export to TypeScript definitions - (#3397). Thanks @porst17. -- Fix: #3406 infer the correct type for multi-dimensional arrays in function - `multiply` (#3408). Thanks @orelbn. -- Fix: #3387 use utility `math.isNaN` for consistent `max` and `min` results - (#3389). Thanks @orelbn. - -# 2025-02-05, 14.2.1 - -- Fix: #3377 remove redundant dependency `@lambdatest/node-tunnel`. - -# 2025-01-30, 14.2.0 - -- Feat: #3041, #3340 rename `apply` to `mapSlices` (#3357). Function - `apply` is still available but is now marked deprecated. Thanks @gwhitney. -- Fix: #3247 don't override type-native floor/ceil within tolerance of value - (#3369). Thanks @gwhitney. -- Fix: #3360 add bigint support to matrix indices and ranges (#3361). - Thanks @gwhitney. -- Fix: #3115 type definitions for matrixFrom* (#3371). Thanks @Hudsxn - and @gwhitney. - -# 2025-01-24, 14.1.0 - -- Feat: implement `bigint` support in functions `log`, `log2`, `log10`, - `larger`, `smaller`, `max`, `min` (#3345). Thanks @gwhitney. -- Fix: #3342 hexadecimal input not turned into a `bigint` (#3348). -- Fix `randomInt()` not working (#3345). -- Docs: fixed description of `sign` in the embedded docs (#3338). - Thanks @witer33. - -# 2024-12-11, 14.0.1 - -- Fix: make derivative much faster (#3322). Thanks @paulftw. -- Fix: #3317 export `Fraction` type from the `fraction.js` library instead of - using a custom interface (#3330). Thanks @fchu. - -# 2024-11-20, 14.0.0 - -!!! BE CAREFUL: BREAKING CHANGES !!! - -- Feat: Upgrade to `fraction.js@5`, using `bigint` under the hood (#3283). -- Feat: Implement support for `Unit` in functions `ceil`, `floor`, and `fix`. - Possible breaking changes in the type definitions of arrays and matrices - due to the introduction of generics (#3269). Thanks @orelbn. -- Feat: Implement support for `log(x: Fraction, base: Fraction)`. -- Fix: #3301 precedence of `%` (mod) being higher than `*` and `/` (#3311). - Thanks @nkumawat34. -- Fix: #3222 prevent `math.import(...)` from overriding units unless you - specify `{ override: true }` (#3225). -- Fix: #3219 let functions `dotDivide`, `dotPow`, `bitXor`, `xor`, `equal`, - `larger`, `largerEq`, `smaller`, `smallerEq`, and `unequal` return a sparse - matrix when the input is two sparse matrices (#3307). Thanks @Aakash-Rana. -- Fix: Improve type definitions of arrays (#3306). Thanks @orelbn. - -# 2024-11-20, 13.2.3 - -- Fix: #3260 improve type definitions and documentation on the callback - indices of `map`, `filter`, and `forEach`. -- Fix: #3323 support functions in function `clone`. -- Docs: fix a broken link in the documentation (#3316). - Thanks @emmanuel-ferdman. - -# 2024-11-13, 13.2.2 - -- Fix: #1455 implicit multiplication of a fraction with unit `in` is incorrect - (#3315). Thanks @nkumawat34. - -# 2024-11-06, 13.2.1 - -- Update to the latest version of `complex.js`. -- Fix `Index.dimension(dim)` accepting non-numeric input. -- Fix: #3290 should validate variables names in method `Parser.set` (#3308). - Thanks @nkumawat34. - -# 2024-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). Thanks @dvd101x. -- Change the behavior of the internal `nearlyEqual` to align with Python and - Julia (#3152, #2838). Thanks @dvd101x. -- 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/node_modules/mathjs/LICENSE b/node_modules/mathjs/LICENSE deleted file mode 100644 index 9cf8c11..0000000 --- a/node_modules/mathjs/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - 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/node_modules/mathjs/NOTICE b/node_modules/mathjs/NOTICE deleted file mode 100644 index 1cc6eb6..0000000 --- a/node_modules/mathjs/NOTICE +++ /dev/null @@ -1,16 +0,0 @@ -math.js -https://github.com/josdejong/mathjs - -Copyright (C) 2013-2026 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/node_modules/mathjs/README.md b/node_modules/mathjs/README.md deleted file mode 100644 index 649bb6e..0000000 --- a/node_modules/mathjs/README.md +++ /dev/null @@ -1,242 +0,0 @@ -![math.js](https://raw.githubusercontent.com/josdejong/mathjs/develop/misc/img/mathjs.svg) - -[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/2026.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. It should include a History section with one line, indicating the upcoming version number in which the function will be created. -- 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) -- make sure to read that page, as Typescript definitions must be added in _multiple_ places in the code. -- 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 LambdaTest, first set the environment variables `LT_USERNAME` and `LT_ACCESS_KEY` with your username and access key and then execute: - - npm run test:lambdatest - -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 [TestMu AI](https://www.testmu.ai) (formerly LambdaTest) every time a commit is pushed to GitHub. GitHub Actions runs the tests for different versions of node.js, and TestMu AI runs the tests on all major browsers. - -[![TestMu AI](https://raw.github.com/josdejong/mathjs/develop/misc/testmu-ai.svg)](https://www.testmu.ai) - -Thanks, GitHub Actions and TestMu AI for the generous free hosting of this open source project! - -## License - -mathjs is published under the Apache 2.0 license: - -``` -Copyright (C) 2013-2026 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/node_modules/mathjs/bin/cli.js b/node_modules/mathjs/bin/cli.js deleted file mode 100644 index 2fb3610..0000000 --- a/node_modules/mathjs/bin/cli.js +++ /dev/null @@ -1,446 +0,0 @@ -#!/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-2026 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/node_modules/mathjs/bin/package.json b/node_modules/mathjs/bin/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/mathjs/bin/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/mathjs/bin/repl.js b/node_modules/mathjs/bin/repl.js deleted file mode 100644 index 9ad06fe..0000000 --- a/node_modules/mathjs/bin/repl.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/mathjs/lib/browser/math.js b/node_modules/mathjs/lib/browser/math.js deleted file mode 100644 index 8cc5b57..0000000 --- a/node_modules/mathjs/lib/browser/math.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! 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={144(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({},n),s?t({},r):{}),m=Object.keys(p),d=function(){var e=!1;m.forEach(function(t,n){e||l.length>=t.length&&l.slice(0,t.length)===t&&(f+=p[m[n]],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}},880(e){e.exports=function e(t,n){"use strict";var r,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(n).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}},391(e,t,n){var r=n(180),i=n(181),o=n(31),a=n(67),s=n(833),u=n(717),c=n(801);c.alea=r,c.xor128=i,c.xorwow=o,c.xorshift7=a,c.xor4096=s,c.tychei=u,e.exports=c},180(e,t,n){var r;!function(e,i){function o(e){var t,n=this,r=(t=4022871197,function(e){e=String(e);for(var n=0;n>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=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 n=new o(e),r=t&&t.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.alea=s}(0,e=n.nmd(e),n.amdD)},717(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,i=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>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):n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.tychei=s}(0,e=n.nmd(e),n.amdD)},181(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";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:n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xor128=s}(0,e=n.nmd(e),n.amdD)},833(e,t,n){var r;!function(e,i){function o(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,o=t.i;return t.w=r=r+1640531527|0,n=i[o+34&127],e=i[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,i,o,a,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),i=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,o>=0&&(a=a+1640531527|0,i=0==(n=s[127&o]^=r+a)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)r=s[i+34&127],n=s[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[i]=r^n;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 n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&(r.X&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xor4096=s}(0,e=n.nmd(e),n.amdD)},67(e,t,n){var r;!function(e,i){function o(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)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 n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&(r.x&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xorshift7=s}(0,e=n.nmd(e),n.amdD)},31(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";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:n+=e;for(var r=0;r>>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 n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xorwow=s}(0,e=n.nmd(e),n.amdD)},801(e,t,n){var r;!function(i,o,a){var s,u=256,c=a.pow(u,6),l=a.pow(2,52),f=2*l,p=255;function m(e,t,n){var r=[],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,n=t&&t.plugins;return[+new Date,i,n,i.screen,x(o)]}}():e,3),r),m=new d(r),b=function(){for(var e=m.g(6),t=c,n=0;e=f;)e/=2,t/=2,n>>>=1;return(e+n)/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||n||function(e,t,n,r){return r&&(r.S&&h(r,m),e.state=function(){return h(m,{})}),n?(a.random=e,t):e})(b,p,"global"in t?t.global:this==a,t.state)}function d(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,a=r.S=[];for(n||(e=[n++]);i1&&void 0!==arguments[1]?arguments[1]:"any";const n=t?p(t).index:c.length,r=[];for(let t=0;t{const n=u.get(t);return!n.isAny&&n.test(e)});return t.length?t:["any"]}function g(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function y(e,t,n){if(!g(e))throw new TypeError(r);const i=n&&n.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}n.push(r)}}if(u=n,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("..."),n=(t?e.length>3?e.slice(3):"any":e).split("|").map(e=>p(e.trim()));let r=!1,i=t?"...":"";return{types:n.map(function(e){return r=e.isAny||r,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:r,hasConversion:!1,restParam:t}}function w(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 n=t[0].conversionsTo;if(1===e.length)return n;n=n.concat([]);const r=new Set(e);for(let e=1;ee.name));let n=e.hasAny,r=e.name;const i=t.map(function(e){const t=p(e.from);return n=t.isAny||n,r+="|"+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:r,hasAny:n,hasConversion:i.length>0,restParam:e.restParam}}function v(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 n=e.trim();if(""===n)return t;const r=n.split(",");for(let e=0;e=n+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=A(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=A(e[0]),r=A(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(A),function(e){for(let n=0;n{const r=C(e.params,t);let i;for(i of r)n.add(i)}),n.has("any")?["any"]:Array.from(n)}function F(e,t,n){let r,i;const o=e||"unnamed";let a,s=n;for(a=0;a{const r=A(M(n.params,a));(a0){const e=h(t[a]);return r=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+a+")"),r.data={category:"wrongType",fn:o,index:a,actual:e,expected:i},r}}else s=e}const u=s.map(function(e){return E(e.params)?1/0:e.params.length});if(t.lengthc)return r=new TypeError("Too many arguments in function "+o+" (expected: "+c+", actual: "+t.length+")"),r.data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:c},r;const l=[];for(let e=0;e0)return 1;const r=O(e)-O(t);return r<0?-1:r>0?1:0}function z(e,t){const n=e.params,r=t.params,i=H(n),o=H(r),a=E(n),s=E(r);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 n)u.hasAny&&++c,u.hasConversion&&++l;let f=0,p=0;for(u of r)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=(n.length-r.length)*(a?-1:1);if(0!==m)return m;const d=[];let h,g=0;for(let e=0;ee.hasConversion)){const r=E(e),i=e.map(q);n=function(){const e=[],n=r?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,n+1,r.concat([i]))},Array.prototype.concat.apply([],i.map(o))}var i,o;return[r]}(e,0,[])}function R(e,t){const n=Math.max(e.length,t.length);for(let r=0;r=r:a?r>=i:r===i}function P(e,t,n){const r=[];let i;for(i of e){let e=n[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;r.push(e)}return r}function U(e,t,n){const r=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(r.length).fill(!1);let o=!0;for(;o;){o=!1;let e=!0;for(let a=0;a{const r=e[n];if(t.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}(r);const i=[],o=[],a={},s=[];let u;for(u in r){if(!Object.prototype.hasOwnProperty.call(r,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(r[u]);const n=e.map(w);let c;for(c of k(n)){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=U(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),v=p[5]&&p[5].params.length<=2&&!E(p[5].params),M=d&&h&&g&&y&&b&&v;for(let e=0;ee.test),oe=p.map(e=>e.implementation),ae=function(){for(let e=ne;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 n=p(t);if(n.test(e))return e;const r=n.conversionsTo;if(0===r.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 n=p(e.to),r=n.conversionsTo.find(t=>t.from===e.from);if(r){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+n.name+'"');f.removeConversion({from:r.from,to:e.to,convert:r.convert})}n.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),n=function(e,t){for(let n=0;nt.from===e.from);if(!n)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(n.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},f.resolve=function(e,t){if(!g(e))throw new TypeError(r);const n=e._typedFunctionData.signatures;for(let e=0;e{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";n.d(r,{default:()=>Nx});var e={};n.r(e),n.d(e,{createAbs:()=>_o,createAccessorNode:()=>Gp,createAcos:()=>of,createAcosh:()=>Af,createAcot:()=>Mf,createAcoth:()=>Tf,createAcsc:()=>Ff,createAcsch:()=>Of,createAdd:()=>Bp,createAddScalar:()=>Ro,createAnd:()=>el,createAndTransform:()=>fx,createArg:()=>Ss,createArrayNode:()=>Vp,createAsec:()=>zf,createAsech:()=>qf,createAsin:()=>Rf,createAsinh:()=>Pf,createAssignmentNode:()=>em,createAtan:()=>Uf,createAtan2:()=>Lf,createAtanh:()=>Hf,createAtomicMass:()=>my,createAvogadro:()=>dy,createBellNumbers:()=>jh,createBernoulli:()=>Kd,createBigNumberClass:()=>On,createBigint:()=>Li,createBignumber:()=>Vi,createBin:()=>sc,createBitAnd:()=>ys,createBitAndTransform:()=>dx,createBitNot:()=>bs,createBitOr:()=>vs,createBitOrTransform:()=>hx,createBitXor:()=>As,createBlockNode:()=>nm,createBohrMagneton:()=>Vg,createBohrRadius:()=>Kg,createBoltzmann:()=>hy,createBoolean:()=>Zi,createCatalan:()=>$h,createCbrt:()=>Lo,createCeil:()=>Jo,createChain:()=>gd,createChainClass:()=>cd,createClassicalElectronRadius:()=>ey,createClone:()=>ii,createColumn:()=>$s,createColumnTransform:()=>ky,createCombinations:()=>ih,createCombinationsWithRep:()=>sh,createCompare:()=>nl,createCompareNatural:()=>al,createCompareText:()=>cl,createCompile:()=>Im,createComplex:()=>Wi,createComplexClass:()=>jn,createComposition:()=>Gh,createConcat:()=>js,createConcatTransform:()=>Ky,createConditionalNode:()=>im,createConductanceQuantum:()=>Wg,createConj:()=>Cs,createConstantNode:()=>mm,createCorr:()=>Xd,createCos:()=>Zf,createCosh:()=>Wf,createCot:()=>Yf,createCoth:()=>Xf,createCoulomb:()=>Hg,createCoulombConstant:()=>Gg,createCount:()=>Gs,createCreateUnit:()=>nf,createCross:()=>Vs,createCsc:()=>Qf,createCsch:()=>ep,createCtranspose:()=>Pu,createCube:()=>Qo,createCumSum:()=>Rd,createCumSumTransform:()=>ax,createDeepEqual:()=>Tl,createDenseMatrixClass:()=>ni,createDerivative:()=>og,createDet:()=>yd,createDeuteronMass:()=>ay,createDiag:()=>Ys,createDiff:()=>pu,createDiffTransform:()=>tx,createDistance:()=>zd,createDivide:()=>Od,createDivideScalar:()=>vc,createDot:()=>zp,createDotDivide:()=>qc,createDotMultiply:()=>Ka,createDotPow:()=>zc,createE:()=>Ag,createEfimovFactor:()=>py,createEigs:()=>vd,createElectricConstant:()=>Lg,createElectronMass:()=>ty,createElementaryCharge:()=>Zg,createEqual:()=>fl,createEqualScalar:()=>Pi,createEqualText:()=>dl,createErf:()=>Zu,createEvaluate:()=>km,createExp:()=>Ko,createExpm:()=>Ed,createExpm1:()=>ta,createFactorial:()=>wh,createFalse:()=>xg,createFaraday:()=>gy,createFermiCoupling:()=>ny,createFft:()=>Lu,createFibonacciHeapClass:()=>jl,createFilter:()=>Js,createFilterTransform:()=>Ly,createFineStructure:()=>ry,createFirstRadiation:()=>yy,createFix:()=>oa,createFlatten:()=>Ks,createFloor:()=>la,createForEach:()=>tu,createForEachTransform:()=>$y,createFormat:()=>ac,createFraction:()=>Yi,createFractionClass:()=>ir,createFreqz:()=>fg,createFunctionAssignmentNode:()=>hm,createFunctionNode:()=>Dm,createGamma:()=>gh,createGasConstant:()=>by,createGcd:()=>Sa,createGetMatrixDataType:()=>iu,createGravitationConstant:()=>Rg,createGravity:()=>Ty,createHartreeEnergy:()=>iy,createHasNumericValue:()=>Ai,createHelp:()=>dd,createHelpClass:()=>ud,createHex:()=>cc,createHypot:()=>Dp,createI:()=>Og,createIdentity:()=>au,createIfft:()=>Hu,createIm:()=>Ts,createImmutableDenseMatrixClass:()=>Rl,createIndex:()=>kp,createIndexClass:()=>Pl,createIndexNode:()=>ym,createIndexTransform:()=>Hy,createInfinity:()=>wg,createIntersect:()=>Id,createInv:()=>xd,createInverseConductanceQuantum:()=>Yg,createInvmod:()=>Ja,createIsBounded:()=>Oi,createIsFinite:()=>zi,createIsInteger:()=>mi,createIsNaN:()=>Fi,createIsNegative:()=>wi,createIsNumeric:()=>Ni,createIsPositive:()=>Mi,createIsPrime:()=>xc,createIsZero:()=>Ti,createKldivergence:()=>Nh,createKlitzing:()=>Qg,createKron:()=>uu,createLN10:()=>Cg,createLN2:()=>Mg,createLOG10E:()=>Bg,createLOG2E:()=>Tg,createLarger:()=>Nl,createLargerEq:()=>Sl,createLcm:()=>Ca,createLeafCount:()=>Vh,createLeftShift:()=>Yc,createLgamma:()=>xh,createLog:()=>Tc,createLog10:()=>Oa,createLog1p:()=>Fc,createLog2:()=>za,createLoschmidt:()=>xy,createLsolve:()=>Pc,createLsolveAll:()=>$c,createLup:()=>Lm,createLusolve:()=>od,createLyap:()=>Dd,createMad:()=>$d,createMagneticConstant:()=>jg,createMagneticFluxQuantum:()=>Jg,createMap:()=>lu,createMapSlices:()=>Io,createMapSlicesTransform:()=>qy,createMapTransform:()=>Gy,createMatrix:()=>Xi,createMatrixClass:()=>ar,createMatrixFromColumns:()=>ro,createMatrixFromFunction:()=>Ki,createMatrixFromRows:()=>to,createMax:()=>ql,createMaxTransform:()=>Vy,createMean:()=>Ud,createMeanTransform:()=>Wy,createMedian:()=>Ld,createMin:()=>kl,createMinTransform:()=>Yy,createMod:()=>ya,createMode:()=>tc,createMolarMass:()=>My,createMolarMassC12:()=>Cy,createMolarPlanckConstant:()=>wy,createMolarVolume:()=>vy,createMultinomial:()=>Ah,createMultiply:()=>ka,createMultiplyScalar:()=>Ia,createNaN:()=>vg,createNeutronMass:()=>sy,createNode:()=>Pp,createNorm:()=>_p,createNot:()=>Is,createNthRoot:()=>Pa,createNthRoots:()=>Oc,createNuclearMagneton:()=>Xg,createNull:()=>bg,createNullish:()=>ks,createNullishTransform:()=>mx,createNumber:()=>ji,createNumeric:()=>bc,createObjectNode:()=>bm,createOct:()=>uc,createOnes:()=>mu,createOperatorNode:()=>Nm,createOr:()=>Rs,createOrTransform:()=>px,createParenthesisNode:()=>Am,createParse:()=>_m,createParser:()=>jm,createParserClass:()=>Rm,createPartitionSelect:()=>_l,createPermutations:()=>Mh,createPhi:()=>Sg,createPi:()=>Ng,createPickRandom:()=>Oh,createPinv:()=>wd,createPlanckCharge:()=>Oy,createPlanckConstant:()=>Pg,createPlanckLength:()=>By,createPlanckMass:()=>Fy,createPlanckTemperature:()=>_y,createPlanckTime:()=>Dy,createPolynomialRoot:()=>sd,createPow:()=>Nc,createPrint:()=>pc,createPrintTransform:()=>lx,createProd:()=>ic,createProtonMass:()=>oy,createQr:()=>$m,createQuantileSeq:()=>Wd,createQuantileSeqTransform:()=>ix,createQuantumOfCirculation:()=>uy,createRandom:()=>Ih,createRandomInt:()=>kh,createRange:()=>yu,createRangeClass:()=>or,createRangeNode:()=>Mm,createRangeTransform:()=>Jy,createRationalize:()=>sg,createRe:()=>Bs,createReducedPlanckConstant:()=>Ug,createRelationalNode:()=>Tm,createReplacer:()=>mg,createReshape:()=>bu,createResize:()=>wu,createResolve:()=>tg,createResultSet:()=>Ve,createReviver:()=>pg,createRightArithShift:()=>Xc,createRightLogShift:()=>Kc,createRotate:()=>Nu,createRotationMatrix:()=>Au,createRound:()=>Sc,createRow:()=>Su,createRowTransform:()=>Xy,createRydberg:()=>cy,createSQRT1_2:()=>Fg,createSQRT2:()=>Dg,createSackurTetrode:()=>Ny,createSchur:()=>Bd,createSec:()=>tp,createSech:()=>rp,createSecondRadiation:()=>Ey,createSetCartesian:()=>lp,createSetDifference:()=>pp,createSetDistinct:()=>dp,createSetIntersect:()=>gp,createSetIsSubset:()=>xp,createSetMultiplicity:()=>wp,createSetPowerset:()=>Np,createSetSize:()=>Ap,createSetSymDifference:()=>Mp,createSetUnion:()=>Tp,createSign:()=>ja,createSimplify:()=>Xh,createSimplifyConstant:()=>Qh,createSimplifyCore:()=>eg,createSin:()=>ip,createSinh:()=>ap,createSize:()=>Cu,createSlu:()=>nd,createSmaller:()=>gl,createSmallerEq:()=>bl,createSolveODE:()=>Gu,createSort:()=>Il,createSpaClass:()=>Ll,createSparse:()=>ef,createSparseMatrixClass:()=>Ui,createSpeedOfLight:()=>kg,createSplitUnit:()=>oo,createSqrt:()=>La,createSqrtm:()=>Sd,createSquare:()=>Ha,createSqueeze:()=>Bu,createStd:()=>Yd,createStdTransform:()=>nx,createStefanBoltzmann:()=>Ay,createStirlingS2:()=>Ph,createString:()=>Hi,createSubset:()=>Du,createSubsetTransform:()=>Qy,createSubtract:()=>Za,createSubtractScalar:()=>Uo,createSum:()=>qd,createSumTransform:()=>rx,createSylvester:()=>Cd,createSymbolNode:()=>Bm,createSymbolicEqual:()=>rg,createTan:()=>sp,createTanh:()=>up,createTau:()=>Eg,createThomsonCrossSection:()=>ly,createTo:()=>dc,createToBest:()=>gc,createTrace:()=>Ip,createTranspose:()=>ku,createTrue:()=>yg,createTypeOf:()=>qi,createTyped:()=>$e,createUnaryMinus:()=>Fo,createUnaryPlus:()=>Oo,createUnequal:()=>Fl,createUnitClass:()=>Jl,createUnitFunction:()=>Ql,createUppercaseE:()=>zg,createUppercasePi:()=>_g,createUsolve:()=>jc,createUsolveAll:()=>Gc,createVacuumImpedance:()=>$g,createVariance:()=>Zd,createVarianceTransform:()=>ux,createVersion:()=>Ig,createWeakMixingAngle:()=>fy,createWienDisplacement:()=>Sy,createXgcd:()=>Wa,createXor:()=>Ps,createZeros:()=>ju,createZeta:()=>Ku,createZpk2tf:()=>cg});var t=n(369);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,n){if(a(e,t))return e[t]=n,n;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))}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,n){this.a=e,this.b=t,this.bKeys=n,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 n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function m(){return new Map}function d(e){if(!e)return m();if(q(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 w(e){return e&&!0===e.constructor.prototype.isUnit||!1}function v(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 B(e){return"boolean"==typeof e}function F(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function D(e){return e&&!0===e.constructor.prototype.isHelp||!1}function O(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 q(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 k(e){return q(e)&&q(e.a)&&q(e.b)}function R(e){return q(e)&&I(e.wrappedObject)}function P(e){return null===e}function U(e){return void 0===e}function j(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 ne(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function re(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 n={};for(const r in e)me(e,r)&&(n[r]=t(e[r]));return n}(e,ae);if("function"===t)return e;throw new TypeError(`Cannot clone: unknown type of value (value: ${e})`)}function se(e,t){for(const n in t)me(t,n)&&(e[n]=t[n]);return e}function ue(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(const n in t)if(me(t,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(t[n]&&t[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n]&&e[n].constructor===Object?ue(e[n],t[n]):e[n]=t[n];else{if(Array.isArray(t[n]))throw new TypeError("Arrays are not supported by deepExtend");e[n]=t[n]}return e}function ce(e,t){let n,r,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,i=e.length;r!function(e){return e&&"?"===e[0]}(e)).every(e=>void 0!==n[e])){const r=t.filter(e=>void 0===n[e]);throw new Error(`Cannot create function "${e}", some dependencies are missing: ${r.map(e=>`"${e}"`).join(", ")}.`)}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),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||!!Number.isFinite(e)&&e===Math.round(e)}function xe(e,t){if("bigint"===t.number)try{BigInt(e)}catch(e){return t.numberFallback}return t.number}const be=Math.sign||function(e){return e>0?1:e<0?-1:0},we=Math.log2||function(e){return Math.log(e)/Math.LN2},ve=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 n;return t&&(e=-e),Number.isFinite(e)?(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3):n=e,t?-n:n},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,n){const r={2:"0b",8:"0o",16:"0x"}[t];let i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!ye(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!ye(e))throw new Error("Value must be an integer");e<0&&(e+=2**n),i=`i${n}`}let o="";return e<0&&(e=-e,o="-"),`${o}${r}${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:n,precision:r,wordSize:i}=Ce(t);switch(n){case"fixed":return Be(e,r);case"exponential":return Fe(e,r);case"engineering":return function(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);const n=De(Te(e),t),r=n.exponent,i=n.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(h(t))for(;t>i.length||r-o+1>i.length;)i.push(0);else{const e=Math.abs(r-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"+(r>=0?"+":"")+o.toString();return n.sign+l}(e,r);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,n){if(isNaN(e)||!Number.isFinite(e))return String(e);const r=je(null==n?void 0:n.lowerExp,-3),i=je(null==n?void 0:n.upperExp,5),o=Te(e),a=t?De(o,t):o;if(a.exponent=i)return Fe(e,t);{let e=a.coefficients;const n=a.exponent;e.length0?n:0;return r{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==e.wordSize&&(n=Ue(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation)}return{notation:r,precision:t,wordSize:n}}function Te(e){const t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);const n=t[1],r=t[2];let i=parseFloat(t[4]||"0");const o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;const a=r.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:n,coefficients:a,exponent:i}}function Be(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);const n=Te(e),r="number"==typeof t?De(n,n.exponent+1+t):n;let i=r.coefficients,o=r.exponent+1;const a=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function De(e,t){const n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;for(;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){let e=t-1;for(r[e]++;10===r[e];)r.pop(),0===e&&(r.unshift(0),n.exponent++,e++),e--,r[e]++}return n}function Oe(e){const t=[];for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:1e-8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return!isNaN(e)&&!isNaN(t)&&(Number.isFinite(e)&&Number.isFinite(t)?e===t||Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r):e===t)}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)},qe=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},ke=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 Ue(e,t){return h(e)?e:g(e)?e.toNumber():void t()}function je(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:n,DenseMatrix:r,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:w},{name:"identifier",test:e=>v&&/^[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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1C8A\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-\uA7DC\uA7F1-\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{105C0}-\u{105F3}\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{10940}-\u{10959}\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{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\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{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\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{11BC0}-\u{11BE0}\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{11DB0}-\u{11DDB}\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{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\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{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF2}\u{16FF3}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152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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{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}][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-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6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D\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-\u1C8A\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-\uA7DC\uA7F1-\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{105C0}-\u{105F3}\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{10940}-\u{10959}\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{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\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{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\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{11BC0}-\u{11BE0}\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{11DB0}-\u{11DDB}\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{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\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{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF2}\u{16FF3}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\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}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C}-\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{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}]*$/u.test(e)},{name:"string",test:v},{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:B},{name:"ResultSet",test:F},{name:"Help",test:D},{name:"function",test:O},{name:"Date",test:_},{name:"RegExp",test:z},{name:"null",test:P},{name:"undefined",test:U},{name:"AccessorNode",test:j},{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:ne},{name:"SymbolNode",test:re},{name:"Map",test:q},{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 n||Ge(e),new n(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return n||Ge(e),new n(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)}},{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 n||Ge(e),new n(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){n||Ge(e);try{return new n(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 r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),o.onMismatch=(e,t,n)=>{const r=o.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&A(t[0])&&n.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=r.data,t}throw r},o.onMismatch=(e,t,n)=>{const r=o.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&A(t[0])&&n.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=r.data,t}throw r},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.map(String).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},nt=!0,rt="[DecimalError] ",it=rt+"Invalid argument: ",ot=rt+"Precision limit exceeded",at=rt+"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=Ke.length-1,gt=et.length-1,yt={toStringTag:st};function xt(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;tn)throw Error(it+e)}function wt(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=ct(10,7-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>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=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==ct(10,t-3)-1,a}function vt(e,t,n){for(var r,i,o=[0],a=0,s=e.length;an-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}yt.absoluteValue=yt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Et(e)},yt.ceil=function(){return Et(new this.constructor(this),this.e+1,2)},yt.clampedTo=yt.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(it+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},yt.comparedTo=yt.cmp=function(e){var t,n,r,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,n=(r=a.length)<(i=s.length)?r:i;ts[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},yt.cosine=yt.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;(r=t.d.length)<32?i=(1/Pt(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=Rt(e,1,t.times(i),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,Ut(r,n)),r.precision=e,r.rounding=t,Et(2==Ye||3==Ye?n.neg():n,e,t,!0)):new r(1):new r(NaN)},yt.cubeRoot=yt.cbrt=function(){var e,t,n,r,i,o,a,s,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(nt=!1,(o=l.s*ct(l.s*l,1/3))&&Math.abs(o)!=1/0?r=new f(o.toString()):(n=xt(l.d),(o=((e=l.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=ct(n,1/3),e=ut((e+1)/3)-(e%3==(e<0?-1:2)),(r=new f(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=l.s),a=(e=f.precision)+3;;)if(c=(u=(s=r).times(s).times(s)).plus(l),r=Nt(c.plus(l).times(s),c.plus(u),a+2,1),xt(s.d).slice(0,a)===(n=xt(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Et(r,e+1,1),t=!r.times(r).times(r).eq(l));break}if(!i&&(Et(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}a+=4,i=1}return nt=!0,Et(r,e,f.rounding,t)},yt.decimalPlaces=yt.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-ut(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},yt.dividedBy=yt.div=function(e){return Nt(this,new this.constructor(e))},yt.dividedToIntegerBy=yt.divToInt=function(e){var t=this.constructor;return Et(Nt(this,new t(e),0,1,1),t.precision,t.rounding)},yt.equals=yt.eq=function(e){return 0===this.cmp(e)},yt.floor=function(){return Et(new this.constructor(this),this.e+1,3)},yt.greaterThan=yt.gt=function(e){return this.cmp(e)>0},yt.greaterThanOrEqualTo=yt.gte=function(e){var t=this.cmp(e);return 1==t||0===t},yt.hyperbolicCosine=yt.cosh=function(){var e,t,n,r,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;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/Pt(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=Rt(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 Et(o,a.precision=n,a.rounding=r,!0)},yt.hyperbolicSine=yt.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=Rt(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=Rt(o,2,i=i.times(1/Pt(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=n,Et(i,t,n,!0)},yt.hyperbolicTangent=yt.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,Nt(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},yt.inverseCosine=yt.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return-1!==n?0===n?e.isNeg()?Ct(t,r,i):new t(0):new t(NaN):e.isZero()?Ct(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},yt.inverseHyperbolicCosine=yt.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,nt=!1,n=n.times(n).minus(1).sqrt().plus(n),nt=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},yt.inverseHyperbolicSine=yt.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,nt=!1,n=n.times(n).plus(1).sqrt().plus(n),nt=!0,r.precision=e,r.rounding=t,n.ln())},yt.inverseHyperbolicTangent=yt.atanh=function(){var e,t,n,r,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,r=i.sd(),Math.max(r,e)<2*-i.e-1?Et(new o(i),e,t,!0):(o.precision=n=r-i.e,i=Nt(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},yt.inverseSine=yt.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=Ct(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},yt.inverseTangent=yt.atan=function(){var e,t,n,r,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<=gt)return(a=Ct(l,f+4,p).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=gt)return(a=Ct(l,f+4,p).times(.5)).s=c.s,a}for(l.precision=s=f+10,l.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(nt=!1,t=Math.ceil(s/7),r=1,u=c.times(c),a=new l(c),i=c;-1!==e;)if(i=i.times(u),o=a.minus(i.div(r+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<this.d.length-2},yt.isNaN=function(){return!this.s},yt.isNegative=yt.isNeg=function(){return this.s<0},yt.isPositive=yt.isPos=function(){return this.s>0},yt.isZero=function(){return!!this.d&&0===this.d[0]},yt.lessThan=yt.lt=function(e){return this.cmp(e)<0},yt.lessThanOrEqualTo=yt.lte=function(e){return this.cmp(e)<1},yt.logarithm=yt.log=function(e){var t,n,r,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(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(nt=!1,a=zt(c,s=f+5),r=t?Mt(l,s+10):zt(e,s),wt((u=Nt(a,r,s,1)).d,i=f,p))do{if(a=zt(c,s+=10),r=t?Mt(l,s+10):zt(e,s),u=Nt(a,r,s,1),!o){+xt(u.d).slice(i+1,i+15)+1==1e14&&(u=Et(u,f+1,0));break}}while(wt(u.d,i+=10,p));return nt=!0,Et(u,f,p)},yt.minus=yt.sub=function(e){var t,n,r,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 nt?Et(e,s,u):e}if(n=ut(e.e/7),l=ut(m.e/7),c=c.slice(),o=l-n){for((f=o<0)?(t=c,o=-o,a=p.length):(t=p,n=l,a=c.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((f=(r=c.length)<(a=p.length))&&(a=r),r=0;r0;--r)c[a++]=0;for(r=p.length;r>o;){if(c[--r](a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,n=l,l=c,c=n),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/dt|0,c[i]%=dt;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=St(c,r),nt?Et(e,s,u):e},yt.precision=yt.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(it+e);return n.d?(t=Tt(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},yt.round=function(){var e=this,t=e.constructor;return Et(new t(e),e.e+1,t.rounding)},yt.sine=yt.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Rt(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=Rt(e,2,t=t.times(1/Pt(5,n)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,Ut(r,n)),r.precision=e,r.rounding=t,Et(Ye>2?n.neg():n,e,t,!0)):new r(NaN)},yt.squareRoot=yt.sqrt=function(){var e,t,n,r,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(nt=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=xt(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=ut((u+1)/2)-(u<0||u%2),r=new l(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new l(c.toString()),n=(u=l.precision)+3;;)if(r=(o=r).plus(Nt(a,o,n+2,1)).times(.5),xt(o.d).slice(0,n)===(t=xt(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Et(r,u+1,1),e=!r.times(r).eq(a));break}if(!i&&(Et(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return nt=!0,Et(r,u,l.rounding,e)},yt.tangent=yt.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=Nt(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,Et(2==Ye||4==Ye?n.neg():n,e,t,!0)):new r(NaN)},yt.times=yt.mul=function(e){var t,n,r,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(n=ut(l.e/7)+ut(e.e/7),(u=p.length)<(c=m.length)&&(o=p,p=m,m=o,a=u,u=c,c=a),o=[],r=a=u+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=u+r;i>r;)s=o[i]+m[r]*p[i-r-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?++n:o.shift(),e.d=o,e.e=St(o,n),nt?Et(e,f.precision,f.rounding):e},yt.toBinary=function(e,t){return jt(this,2,e,t)},yt.toDecimalPlaces=yt.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(bt(e,0,Xe),void 0===t?t=r.rounding:bt(t,0,8),Et(n,e+n.e+1,t))},yt.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=At(r,!0):(bt(e,0,Xe),void 0===t?t=i.rounding:bt(t,0,8),n=At(r=Et(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},yt.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=At(i):(bt(e,0,Xe),void 0===t?t=o.rounding:bt(t,0,8),n=At(r=Et(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},yt.toFraction=function(e){var t,n,r,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=n=new h(1),r=u=new h(0),a=(o=(t=new h(r)).e=Tt(d)-m.e-1)%7,t.d[0]=ct(10,a<0?7+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(nt=!1,s=new h(xt(d)),l=h.precision,h.precision=o=7*d.length*2;f=Nt(s,t,0,1,1),1!=(i=n.plus(f.times(r))).cmp(e);)n=r,r=i,i=c,c=u.plus(f.times(i)),u=i,i=t,t=s.minus(f.times(i)),s=i;return i=Nt(e.minus(n),r,0,1,1),u=u.plus(i.times(c)),n=n.plus(i.times(r)),u.s=c.s=m.s,p=Nt(c,r,o,1).minus(m).abs().cmp(Nt(u,n,o,1).minus(m).abs())<1?[c,r]:[u,n],h.precision=l,nt=!0,p},yt.toHexadecimal=yt.toHex=function(e,t){return jt(this,16,e,t)},yt.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:bt(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(nt=!1,n=Nt(n,e,0,t,1).times(e),nt=!0,Et(n)):(e.s=n.s,n=e),n},yt.toNumber=function(){return+this},yt.toOctal=function(e,t){return jt(this,8,e,t)},yt.toPower=yt.pow=function(e){var t,n,r,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(r=u.precision,o=u.rounding,e.eq(1))return Et(s,r,o);if((t=ut(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=Ft(u,s,n,r),e.s<0?new u(1).div(i):Et(i,r,o);if((a=s.s)<0){if(tu.maxE+1||t0?a/0:0):(nt=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=_t(e.times(zt(s,r+n)),r)).d&&wt((i=Et(i,r+5,1)).d,r,o)&&(t=r+10,+xt((i=Et(_t(e.times(zt(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Et(i,r+1,0))),i.s=a,nt=!0,u.rounding=o,Et(i,r,o))},yt.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=At(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(bt(e,1,Xe),void 0===t?t=i.rounding:bt(t,0,8),n=At(r=Et(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},yt.toSignificantDigits=yt.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(bt(e,1,Xe),void 0===t?t=n.rounding:bt(t,0,8)),Et(new n(this),e,t)},yt.toString=function(){var e=this,t=e.constructor,n=At(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},yt.truncated=yt.trunc=function(){return Et(new this.constructor(this),this.e+1,1)},yt.valueOf=yt.toJSON=function(){var e=this,t=e.constructor,n=At(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var Nt=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]1;)e.shift()}return function(r,i,o,a,s,u){var c,l,f,p,m,d,h,g,y,x,b,w,v,N,E,A,S,M,C,T,B=r.constructor,F=r.s==i.s?1:-1,D=r.d,O=i.d;if(!(D&&D[0]&&O&&O[0]))return new B(r.s&&i.s&&(D?!O||D[0]!=O[0]:O)?D&&0==D[0]||!O?0*F:F/0:NaN);for(u?(m=1,l=r.e-i.e):(u=dt,m=7,l=ut(r.e/m)-ut(i.e/m)),C=O.length,S=D.length,x=(y=new B(F)).d=[],f=0;O[f]==(D[f]||0);f++);if(O[f]>(D[f]||0)&&l--,null==o?(N=o=B.precision,a=B.rounding):N=s?o+(r.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,O=O[0],N++;(f1&&(O=e(O,p,u),D=e(D,p,u),C=O.length,S=D.length),A=C,w=(b=D.slice(0,C)).length;w=u/2&&++M;do{p=0,(c=t(O,b,C,w))<0?(v=b[0],C!=w&&(v=v*u+(b[1]||0)),(p=v/M|0)>1?(p>=u&&(p=u-1),1==(c=t(h=e(O,p,u),b,g=h.length,w=b.length))&&(p--,n(h,C=10;p/=10)f++;y.e=f+l*m-1,Et(y,s?o+y.e+1:o,a,d)}return y}}();function Et(e,t,n,r){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+=7,a=t,u=(l=f[p=0])/ct(10,i-a-1)%10|0;else if((p=Math.ceil((o+1)/7))>=(s=f.length)){if(!r)break e;for(;s++<=p;)f.push(0);l=u=0,i=1,a=(o%=7)-7+1}else{for(l=s=f[p],i=1;s>=10;s/=10)i++;u=(a=(o%=7)-7+i)<0?0:l/ct(10,i-a-1)%10|0}if(r=r||t<0||void 0!==f[p+1]||(a<0?l:l%ct(10,i-a-1)),c=n<4?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?a>0?l/ct(10,i-a):0:f[p-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=ct(10,(7-t%7)%7),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,7-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 nt&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Bt(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Bt(-i-1)+o,n&&(r=n-a)>0&&(o+=Bt(r))):i>=a?(o+=Bt(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Bt(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Bt(r))),o}function St(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function Mt(e,t,n){if(t>ht)throw nt=!0,n&&(e.precision=n),Error(ot);return Et(new e(Ke),t,1,!0)}function Ct(e,t,n){if(t>gt)throw Error(ot);return Et(new e(et),t,n,!0)}function Tt(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Bt(e){for(var t="";e--;)t+="0";return t}function Ft(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(nt=!1;;){if(n%2&&Lt((o=o.times(t)).d,a)&&(i=!0),0===(n=ut(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}Lt((t=t.times(t)).d,a)}return nt=!0,o}function Dt(e){return 1&e.d[e.d.length-1]}function Ot(e,t,n){for(var r,i,o=new e(t[0]),a=0;++a17)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?(nt=!1,u=d):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=r=Math.log(ct(2,f))/Math.LN10*2+5|0,n=o=a=new p(1),p.precision=u;;){if(o=Et(o.times(e),u,1),n=n.times(++l),xt((s=a.plus(Nt(o,n,u,1))).d).slice(0,u)===xt(a.d).slice(0,u)){for(i=f;i--;)a=Et(a.times(a),u,1);if(null!=t)return p.precision=d,a;if(!(c<3&&wt(a.d,u-r,m,c)))return Et(a,p.precision=d,m,nt=!0);p.precision=u+=10,n=o=s=new p(1),l=0,c++}a=s}}function zt(e,t){var n,r,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?(nt=!1,l=x):l=t,g.precision=l+=10,r=(n=xt(h)).charAt(0),!(Math.abs(o=d.e)<15e14))return c=Mt(g,l+2,x).times(o+""),d=zt(new g(r+"."+n.slice(1)),l-10).plus(c),g.precision=x,null==t?Et(d,x,y,nt=!0):d;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=xt((d=d.times(e)).d)).charAt(0),m++;for(o=d.e,r>1?(d=new g("0."+n),o++):d=new g(r+"."+n.slice(1)),f=d,u=a=d=Nt(d.minus(1),d.plus(1),l,1),p=Et(d.times(d),l,1),i=3;;){if(a=Et(a.times(p),l,1),xt((c=u.plus(Nt(a,new g(i),l,1))).d).slice(0,l)===xt(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(Mt(g,l+2,x).times(o+""))),u=Nt(u,new g(m),l,1),null!=t)return g.precision=x,u;if(!wt(u.d,l-10,y,s))return Et(u,g.precision=x,y,nt=!0);g.precision=l+=10,c=a=d=Nt(f.minus(1),f.plus(1),l,1),p=Et(d.times(d),l,1),i=s=1}u=c,i+=2}}function It(e){return String(e.s*e.s/0)}function qt(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),re.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))n=16,t=t.toLowerCase();else if(lt.test(t))n=2;else{if(!pt.test(t))throw Error(it+t);n=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,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=Ft(r,new r(n),o,2*o)),o=l=(c=vt(t,n,dt)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=St(c,l),e.d=c,nt=!1,a&&(e=Nt(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?ct(2,u):Fn.pow(2,u))),nt=!0,e)}function Rt(e,t,n,r,i){var o,a,s,u,c=e.precision,l=Math.ceil(c/7);for(nt=!1,u=n.times(n),s=new e(r);;){if(a=Nt(s.times(u),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=Nt(a.times(u),new e(t++*t++),c,1),void 0!==(a=s.plus(r)).d[l]){for(o=l;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return nt=!0,a.d.length=l+1,a}function Pt(e,t){for(var n=e;--t;)n*=e;return n}function Ut(e,t){var n,r=t.s<0,i=Ct(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return Ye=r?4:1,t;if((n=t.divToInt(i)).isZero())Ye=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return Ye=Dt(n)?r?2:3:r?4:1,t;Ye=Dt(n)?r?1:4:r?3:2}return t.minus(i).abs()}function jt(e,t,n,r){var i,o,a,s,u,c,l,f,p,m=e.constructor,d=void 0!==n;if(d?(bt(n,1,Xe),void 0===r?r=m.rounding:bt(r,0,8)):(n=m.precision,r=m.rounding),e.isFinite()){for(d?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(a=(l=At(e)).indexOf("."))>=0&&(l=l.replace(".",""),(p=new m(1)).e=l.length-a,p.d=vt(At(p),10,i),p.e=p.d.length),o=u=(f=vt(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=Nt(e,p,n,r,0,i)).d,o=e.e,c=We),a=f[n],s=i/2,c=c||void 0!==f[n+1],c=r<4?(void 0!==a||c)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||c||6===r&&1&f[n-1]||r===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>i-1;)f[n]=0,n||(++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=vt(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 $t(e){return new this(e).abs()}function Ht(e){return new this(e).acos()}function Gt(e){return new this(e).acosh()}function Zt(e,t){return new this(e).plus(t)}function Vt(e){return new this(e).asin()}function Wt(e){return new this(e).asinh()}function Yt(e){return new this(e).atan()}function Jt(e){return new this(e).atanh()}function Xt(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?Ct(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=Ct(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(Nt(e,t,o,1)),t=Ct(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Nt(e,t,o,1)):(n=Ct(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Qt(e){return new this(e).cbrt()}function Kt(e){return Et(e=new this(e),e.e+1,2)}function en(e,t,n){return new this(e).clamp(t,n)}function tn(e){if(!e||"object"!=typeof e)throw Error(rt+"Object expected");var t,n,r,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]&&r<=o[t+2]))throw Error(it+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=tt[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(it+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(at);this[n]=!0}else this[n]=!1}return this}function nn(e){return new this(e).cos()}function rn(e){return new this(e).cosh()}function on(e,t){return new this(e).div(t)}function an(e){return new this(e).exp()}function sn(e){return Et(e=new this(e),e.e+1,3)}function un(){var e,t,n=new this(0);for(nt=!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(r*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function wn(e){return Et(e=new this(e),e.e+1,this.rounding)}function vn(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Nn(e){return new this(e).sin()}function En(e){return new this(e).sinh()}function An(e){return new this(e).sqrt()}function Sn(e,t){return new this(e).sub(t)}function Mn(){var e=0,t=arguments,n=new this(t[e]);for(nt=!1;n.s&&++eo.maxE?(i.e=NaN,i.d=null):e.e=10;n/=10)t++;return void(nt?t>o.maxE?(i.e=NaN,i.d=null):t{let{on:t,config:n}=e;const r=Dn.clone({precision:n.precision,modulo:Dn.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0}),_n=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},zn=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},In=function(e,t){return(e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},qn=function(){throw SyntaxError("Invalid Param")};function kn(e,t){const n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const Rn={re:0,im:0},Pn=function(e,t){const n=Rn;if(null==e)n.re=n.im=0;else if(void 0!==t)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return Un.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return Un.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else 2===e.length?(n.re=e[0],n.im=e[1]):qn();break;case"string":n.im=n.re=0;const t=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let r=1,i=0;null===t&&qn();for(let e=0;e0&&qn();break;case"number":n.im=0,n.re=e;break;default:qn()}return isNaN(n.re)||isNaN(n.im),n};function Un(e,t){if(!(this instanceof Un))return new Un(e,t);const n=Pn(e,t);this.re=n.re,this.im=n.im}Un.prototype={re:0,im:0,sign:function(){const e=In(this.re,this.im);return new Un(this.re/e,this.im/e)},add:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?Un.NAN:Un.INFINITY:new Un(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?Un.NAN:Un.INFINITY:new Un(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;return r&&a||i&&o?Un.NAN:r||i?Un.INFINITY:0===n.im&&0===this.im?new Un(this.re*n.re,0):new Un(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;if(o&&a||r&&i)return Un.NAN;if(a||r)return Un.INFINITY;if(o||i)return Un.ZERO;if(0===n.im)return new Un(this.re/n.re,this.im/n.re);if(Math.abs(n.re)0)return new Un(Math.pow(this.re,n.re),0);if(0===this.re)switch((n.re%4+4)%4){case 0:return new Un(Math.pow(this.im,n.re),0);case 1:return new Un(0,Math.pow(this.im,n.re));case 2:return new Un(-Math.pow(this.im,n.re),0);case 3:return new Un(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return Un.ZERO;const i=Math.atan2(this.im,this.re),o=kn(this.re,this.im);let a=Math.exp(n.re*o-n.im*i),s=n.im*o+n.re*i;return new Un(a*Math.cos(s),a*Math.sin(s))},sqrt:function(){const e=this.re,t=this.im;if(0===t)return e>=0?new Un(Math.sqrt(e),0):new Un(0,Math.sqrt(-e));const n=In(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new Un(r,t<0?-i:i):new Un(i,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return 0===this.im?new Un(e,0):new Un(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new Un(Math.expm1(e)*Math.cos(t)+function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return 0===t&&e>0?new Un(Math.log(e),0):new Un(kn(e,t),Math.atan2(t,e))},abs:function(){return In(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new Un(Math.sin(e)*_n(t),Math.cos(e)*zn(t))},cos:function(){const e=this.re,t=this.im;return new Un(Math.cos(e)*_n(t),-Math.sin(e)*zn(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+_n(t);return new Un(Math.sin(e)/n,zn(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-_n(t);return new Un(-Math.sin(e)/n,zn(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*_n(2*t)+.5*Math.cos(2*e);return new Un(Math.cos(e)*_n(t)/n,Math.sin(e)*zn(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*_n(2*t)-.5*Math.cos(2*e);return new Un(Math.sin(e)*_n(t)/n,-Math.cos(e)*zn(t)/n)},asin:function(){const e=this.re,t=this.im,n=new Un(t*t-e*e+1,-2*e*t).sqrt(),r=new Un(n.re-t,n.im+e).log();return new Un(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new Un(t*t-e*e+1,-2*e*t).sqrt(),r=new Un(n.re-t,n.im+e).log();return new Un(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(0===e){if(1===t)return new Un(0,1/0);if(-1===t)return new Un(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new Un((1-t*t-e*e)/n,-2*e/n).log();return new Un(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(0===t)return new Un(Math.atan2(1,e),0);const n=e*e+t*t;return 0!==n?new Un(e/n,-t/n).atan():new Un(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Un(0,1/0);const n=e*e+t*t;return 0!==n?new Un(e/n,-t/n).acos():new Un(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Un(Math.PI/2,1/0);const n=e*e+t*t;return 0!==n?new Un(e/n,-t/n).asin():new Un(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new Un(zn(e)*Math.cos(t),_n(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new Un(_n(e)*Math.cos(t),zn(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=_n(e)+Math.cos(t);return new Un(zn(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=_n(e)-Math.cos(t);return new Un(zn(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-_n(2*e);return new Un(-2*zn(e)*Math.cos(t)/n,2*_n(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+_n(2*e);return new Un(2*_n(e)*Math.cos(t)/n,-2*zn(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&0===t,r=1-e,i=1+e,o=r*r+t*t,a=0!==o?new Un((i*r-t*t)/o,(t*r+i*t)/o):new Un(-1!==e?e/0:0,0!==t?t/0:0),s=a.re;return a.re=kn(a.re,a.im)/2,a.im=Math.atan2(a.im,s)/2,n&&(a.im=-a.im),a},acoth:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Un(0,Math.PI/2);const n=e*e+t*t;return 0!==n?new Un(e/n,-t/n).atanh():new Un(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(0===t)return new Un(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return 0!==n?new Un(e/n,-t/n).asinh():new Un(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return Un.INFINITY;const n=e*e+t*t;return 0!==n?new Un(e/n,-t/n).acosh():new Un(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Un.INFINITY;if(this.isInfinite())return Un.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new Un(e/n,-t/n)},conjugate:function(){return new Un(this.re,-this.im)},neg:function(){return new Un(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Un(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Un(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Un(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=Pn(e,t);return Math.abs(n.re-this.re)<=Un.EPSILON&&Math.abs(n.im-this.im)<=Un.EPSILON},clone:function(){return new Un(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)(Object.defineProperty(Un,"name",{value:"Complex"}),Un.prototype.constructor=Un,Un.prototype.type="Complex",Un.prototype.isComplex=!0,Un.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Un.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Un.prototype.format=function(e){let t="",n=this.im,r=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(r/n)t.re?1:e.ret.im?1:e.im1&&(t[n]=(t[n]||Ln)+$n):t[e]=(t[e]||Ln)+$n,t}const Qn=function(e,t){let n=Ln,r=$n,i=$n;if(null==e);else if(void 0!==t){if("bigint"==typeof e)n=e;else{if(isNaN(e))throw nr();if(e%1!=0)throw rr();n=BigInt(e)}if("bigint"==typeof t)r=t;else{if(isNaN(t))throw nr();if(t%1!=0)throw rr();r=BigInt(t)}i=n*r}else if("object"==typeof e){if("d"in e&&"n"in e)n=BigInt(e.n),r=BigInt(e.d),"s"in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else{if("bigint"!=typeof e)throw nr();n=e}i=n*r}else if("number"==typeof e){if(isNaN(e))throw nr();if(e<0&&(i=-$n,e=-e),e%1==0)n=BigInt(e);else{let t=1,i=0,o=1,a=1,s=1,u=1e7;for(e>=1&&(t=10**Math.floor(1+Math.log10(e)),e/=t);o<=u&&s<=u;){let t=(i+a)/(o+s);if(e===t){o+s<=u?(n=i+a,r=o+s):s>o?(n=a,r=s):(n=i,r=o);break}e>t?(i+=a,o+=s):(a+=i,s+=o),o>u?(n=a,r=s):(n=i,r=o)}n=BigInt(n)*BigInt(t),r=BigInt(r)}}else if("string"==typeof e){let t=0,o=Ln,a=Ln,s=Ln,u=$n,c=$n,l=e.replace(/_/g,"").match(/\d+|./g);if(null===l)throw nr();if("-"===l[t]?(i=-$n,t++):"+"===l[t]&&t++,l.length===t+1?a=Wn(l[t++],i):"."===l[t+1]||"."===l[t]?("."!==l[t]&&(o=Wn(l[t++],i)),t++,(t+1===l.length||"("===l[t+1]&&")"===l[t+3]||"'"===l[t+1]&&"'"===l[t+3])&&(a=Wn(l[t],i),u=Zn**BigInt(l[t].length),t++),("("===l[t]&&")"===l[t+2]||"'"===l[t]&&"'"===l[t+2])&&(s=Wn(l[t+1],i),c=Zn**BigInt(l[t+1].length)-$n,t+=3)):"/"===l[t+1]||":"===l[t+1]?(a=Wn(l[t],i),u=Wn(l[t+2],$n),t+=3):"/"===l[t+3]&&" "===l[t+1]&&(o=Wn(l[t],i),a=Wn(l[t+2],i),u=Wn(l[t+4],$n),t+=5),!(l.length<=t))throw nr();r=u*c,i=n=s+r*o+c*a}else{if("bigint"!=typeof e)throw nr();n=e,i=e,r=$n}if(r===Ln)throw tr();Vn.s=iVn.s*Vn.n*this.d},gte:function(e,t){return Qn(e,t),this.s*this.n*Vn.d>=Vn.s*Vn.n*this.d},compare:function(e,t){Qn(e,t);let n=this.s*this.n*Vn.d-Vn.s*Vn.n*this.d;return(LnLn&&this.s>=Ln?$n:Ln),e)},floor:function(e){return e=Zn**BigInt(e||0),Jn(Yn(this.s*e*this.n/this.d)-(e*this.n%this.d>Ln&&this.s=Ln?$n:Ln)+Hn*(e*this.n%this.d)>this.d?$n:Ln),e)},roundTo:function(e,t){Qn(e,t);const n=this.n*Vn.d,r=this.d*Vn.n,i=n%r;let o=Yn(n/r);return i+i>=r&&o++,Jn(this.s*o*Vn.n,Vn.d)},divisible:function(e,t){return Qn(e,t),!(!(Vn.n*this.d)||this.n*Vn.d%(Vn.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e){let t=this.n,n=this.d;e=e||15;let r=function(e,t){for(;t%Hn===Ln;t/=Hn);for(;t%Gn===Ln;t/=Gn);if(t===$n)return Ln;let n=Zn%t,r=1;for(;n!==$n;r++)if(n=n*Zn%t,r>2e3)return Ln;return BigInt(r)}(0,n),i=function(e,t,n){let r=$n,i=function(e,t,n){let r=$n;for(;t>Ln;e=e*e%n,t>>=$n)t&$n&&(r=r*e%n);return r}(Zn,n,t);for(let e=0;e<300;e++){if(r===i)return BigInt(e);r=r*Zn%t,i=i*Zn%t}return 0}(0,n,r),o=this.sLn&&(r+=i,r+=" ",t%=n),r+=t,r+="/",r+=n}return r},toLatex:function(e){let t=this.n,n=this.d,r=this.sLn&&(r+=i,t%=n),r+="\\frac{",r+=t,r+="}{",r+=n,r+="}"}return r},toContinued:function(){let e=this.n,t=this.d,n=[];do{n.push(Yn(e/t));let r=e%t;e=t,t=r}while(e!==$n);return n},simplify:function(e){const t=BigInt(1/(e||.001)|0),n=this.abs(),r=n.toContinued();for(let e=1;e=0;t--)i=i.inverse().add(r[t]);let o=i.sub(n);if(o.n*t(Object.defineProperty(er,"name",{value:"Fraction"}),er.prototype.constructor=er,er.prototype.type="Fraction",er.prototype.isFraction=!0,er.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},er.fromJSON=function(e){return new er(e)},er),{isClass:!0}),or=de("Range",[],()=>{function e(t,n,r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");const i=null!=t,o=null!=n,a=null!=r;if(i)if(g(t))t=t.toNumber();else if("number"!=typeof t&&!y(t))throw new TypeError("Parameter start must be a number or bigint");if(o)if(g(n))n=n.toNumber();else if("number"!=typeof n&&!y(n))throw new TypeError("Parameter end must be a number or bigint");if(a)if(g(r))r=r.toNumber();else if("number"!=typeof r&&!y(r))throw new TypeError("Parameter step must be a number or bigint");if(this.start=i?parseFloat(t):0,this.end=o?parseFloat(n):0,this.step=a?parseFloat(r):1,a&&_e(this.step,0))throw new Error("Step must not be zero")}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;const n=t.split(":").map(function(e){return parseFloat(e)});if(n.some(function(e){return isNaN(e)}))return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[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,n=this.step,r=this.end-t;return be(n)===be(r)?e=Math.ceil(r/n):0===r&&(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 n=this.step,r=this.end;let i=0;if(n>0)for(;tr;)e(t,[i],this),t+=n,i++},e.prototype.map=function(e){const t=[];return this.forEach(function(n,r,i){t[r[0]]=e(n,r,i)}),t},e.prototype.toArray=function(){const e=[];return this.forEach(function(t,n){e[n[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}),ar=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,n){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,n){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 sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0?"+":"")+r.toString()}(e,r);case"bin":return ur(e,2,i);case"oct":return ur(e,8,i);case"hex":return ur(e,16,i);case"auto":{const n=lr(null==t?void 0:t.lowerExp,-3),i=lr(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";let o;const a=e.toSignificantDigits(r),s=a.e;return o=s>=n&&smr(n)+": "+pr(e[n],t)).join(", ")+"}":String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function mr(e){const t=String(e);let n="",r=0;for(;r/g,">"),t}function gr(e,t){if(Array.isArray(e)){let n="[";const r=e.length;for(let i=0;it?1:-1}function xr(e,t,n){if(!(this instanceof xr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function br(e,t,n){if(!(this instanceof br))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=n),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 wr(e){const t=[];for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function vr(e,t,n){let r;const i=e.length;if(i!==t[n])throw new xr(i,t[n]);if(n")}function Nr(e,t){if(0===t.length){if(Array.isArray(e))throw new xr(e.length,0)}else vr(e,t,0)}function Er(e,t){const n=e.isMatrix?e._size:wr(e);t._sourceSize.forEach((e,t)=>{if(null!==e&&e!==n[t])throw new xr(e,n[t])})}function Ar(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 br(e,t)}}function Sr(e){for(let t=0;t=0){if(t%n!==0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);r[i]=-t/n}return r}function Fr(e){return e.reduce((e,t)=>e*t,1)}function Dr(e,t){const n=t||wr(e);for(;Array.isArray(e)&&1===e.length;)e=e[0],n.shift();let r=n.length;for(;1===n[r-1];)r--;return r1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;if("boolean"!=typeof t)throw new TypeError("Boolean expected for second argument of flatten");const n=[];return t?function e(t){if(Array.isArray(t[0]))for(let n=0;nt.test(e))}function Ur(e,t){return Array.prototype.join.call(e,t)}function jr(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;const t=[];let n=0;t[0]={value:e[0],identifier:0};for(let r=1;r1)return e.slice(1).reduce(function(e,n){return Hr(e,n,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Zr(){for(var e=arguments.length,t=new Array(e),n=0;ne.length),i=Math.max(...r),o=new Array(i).fill(null);for(let e=0;eo[t]&&(o[t]=n[e])}}for(let e=0;e1||e[i]>t[o])throw new Error(`shape mismatch: mismatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[o]}`)}}function Wr(e,t){let n=wr(e);if(ce(n,t))return e;Vr(n,t);const r=Zr(n,t),i=r.length,o=[...Array(i-n.length).fill(1),...n];let a=function(e){return sr([],e)}(e);n.lengthe[t],e)}function Xr(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return[];if(n)return function e(n){if(Array.isArray(n)){const t=n.length,r=Array(t);for(let i=0;i2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return;if(n)return void function e(n){if(Array.isArray(n)){const t=n.length;for(let r=0;r0),s=n.isMatrix?n.get(a):Jr(n,a);o=function(e,n,r,i){const o=[n,r,i];for(let n=3;n>0;n--){const r=o.slice(0,n);if(null!==t.resolve(e,r))return n}}(e,s,a,n)}if(n.isMatrix&&"mixed"!==n.dataType&&void 0!==n.dataType){const t=function(e,t){const n=[];if(Object.entries(e.signatures).forEach(e=>{let[r,i]=e;r.split(",").length===t&&n.push(i)}),1===n.length)return n[0]}(e,o);a=void 0!==t?t:e}else a=e;return o>=1&&o<=3?{isUnary:1===o,fn:function(){for(var t=arguments.length,n=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 ${n} cannot apply callback arguments ${r}(${e.join(", ")}) at index ${JSON.stringify(t[1])}`)}throw new TypeError(`Function ${n} cannot apply callback arguments to function ${r}: ${e.message}`)}(e,t,n,r)}}xr.prototype=new RangeError,xr.prototype.constructor=RangeError,xr.prototype.name="DimensionError",xr.prototype.isDimensionError=!0,br.prototype=new RangeError,br.prototype.constructor=RangeError,br.prototype.name="IndexError",br.prototype.isIndexError=!0;const ni=de("DenseMatrix",["Matrix","config"],e=>{let{Matrix:t,config:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!v(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,Nr(this._data,this._size),this._datatype=t||e.datatype;else if(N(e))this._data=a(e),this._size=wr(this._data),Nr(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 i(e,t,n){if(0===t.length){let t=e._data;for(;N(t);)t=t[0];return t}return e._size=t.slice(0),e._data=Mr(e._data,e._size,n),e}function o(e,t,n){const r=e._size.slice(0);let o=!1;for(;r.lengthr[e]&&(r[e]=t[e],o=!0);o&&i(e,r,n)}function a(e){return E(e)?a(e.valueOf()):N(e)?e.map(a):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 $r(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,i){switch(arguments.length){case 1:return function(e,t){if(!T(t))throw new TypeError("Invalid index");if(n.legacySubset?t.size().every(e=>1===e):t.isScalar())return e.get(t.min());{const i=t.size();if(i.length!==e._size.length)throw new xr(i.length,e._size.length);const o=t.min(),a=t.max();for(let t=0,n=e._size.length;t1&&void 0!==arguments[1]?arguments[1]:0;const a=t.dimension(o);return h(a)?r[o]=null:r[o]=a.size()[0],s=a,u=o(Ar(t,i.length),e(i[t],o+1)):e=>(Ar(e,i.length),i[e]),h(s)?u(s):s.map(u).valueOf();var s,u}(e),size:r.filter(e=>null!==e)}}(e._data,t);return s._size=u.size,s._datatype=e._datatype,s._data=u.data,n.legacySubset?s.reshape(t.size()):s}}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");const i=t.size(),a=t.isScalar();let s;if(E(n)?(s=n.size(),n=n.valueOf()):s=wr(n),a){if(0!==s.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(!ce(s,i)){if(0===s.length)n=Wr([n],i);else try{n=Wr(n,i)}catch(e){}s=wr(n)}if(i.length");o(e,t.max().map(function(e){return e+1}),r),function(e,t,n){const r=t.size().length-1;!function e(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=t.dimension(o),s=(t,r)=>{Ar(t,n.length),e(n[t],i[r[0]],o+1)},u=(e,t)=>{Ar(e,n.length),n[e]=i[t[0]]};oArray.isArray(e)&&1===e.length?e[0]:e);return i(n?this.clone():this,r,t)},r.prototype.reshape=function(e,t){const n=t?this.clone():this;n._data=Tr(n._data,e);const r=n._size.reduce((e,t)=>e*t);return n._size=Br(e,r),n},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.map=function(e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this,r=n._size.length-1;if(r<0)return n.clone();const i=Kr(e,n,"map",t),o=i.fn,a=n.create(void 0,n._datatype);if(a._size=n._size,t||i.isUnary)return a._data=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=Array(t.length);if(n1&&void 0!==arguments[1]?arguments[1]:0;const a=Array(t.length);if(i2&&void 0!==arguments[2]&&arguments[2];const n=this,r=n._size.length-1;if(r<0)return;const i=Kr(e,n,"map",t),o=i.fn;if(t||i.isUnary)return void function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(n1&&void 0!==arguments[1]?arguments[1]:0;if(ie*t,1);for(let r=0;r=0&&(t[n]++,!(t[n][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 pr(this._data,e)},r.prototype.toString=function(){return pr(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=Mr(f,e,i);for(let e=0;e{let{typed:t}=e;return t(ri,{any:ae})});function oi(e){const t=e.length,n=e[0].length;let r,i;const o=[];for(i=0;it(e),!1,!0):Qr(e,t,!0)}function ui(e,t,n){if(!n)return E(e)?e.map(e=>t(e),!1,!0):Xr(e,t,!0);const r=e=>0===e?e:t(e);return E(e)?e.map(e=>r(e),!1,!0):Xr(e,r,!0)}function ci(e,t,n){const r=Array.isArray(e)?wr(e):e.size();if(t<0||t>=r.length)throw new br(t,r.length);return E(e)?e.create(li(e.valueOf(),t,n),e.datatype()):li(e,t,n)}function li(e,t,n){let r,i,o,a;if(t<=0){if(Array.isArray(e[0])){for(a=oi(e),i=[],r=0;r{let{typed:t,equal:n}=e;return t(pi,{number:e=>!!Number.isFinite(e)&&n(e,Math.round(e)),BigNumber:e=>!!e.isFinite()&&n(e.round(),e),bigint:e=>!0,Fraction:e=>1n===e.d,"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),di="number";function hi(e){return e<0}function gi(e){return e>0}function yi(e){return Number.isNaN(e)}function xi(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<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(n),r)):e.eq(t))}hi.signature=di,gi.signature=di,yi.signature=di;const bi="isNegative",wi=de(bi,["typed","config"],e=>{let{typed:t,config:n}=e;return t(bi,{number:e=>!_e(e,0,n.relTol,n.absTol)&&hi(e),BigNumber:e=>!xi(e,new e.constructor(0),n.relTol,n.absTol)&&e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e<0n,Fraction:e=>e.s<0n,Unit:t.referToSelf(e=>n=>t.find(e,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),vi="isNumeric",Ni=de(vi,["typed"],e=>{let{typed:t}=e;return t(vi,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Ei="hasNumericValue",Ai=de(Ei,["typed","isNumeric"],e=>{let{typed:t,isNumeric:n}=e;return t(Ei,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})}),Si="isPositive",Mi=de(Si,["typed","config"],e=>{let{typed:t,config:n}=e;return t(Si,{number:e=>!_e(e,0,n.relTol,n.absTol)&&gi(e),BigNumber:e=>!(xi(e,new e.constructor(0),n.relTol,n.absTol)||e.isNeg()||e.isZero()||e.isNaN()),bigint:e=>e>0n,Fraction:e=>e.s>0n&&e.n>0n,Unit:t.referToSelf(e=>n=>t.find(e,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Ci="isZero",Ti=de(Ci,["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return t(Ci,{"number | BigNumber | Complex | Fraction":e=>n(e,0),bigint:e=>0n===e,Unit:t.referToSelf(e=>n=>t.find(e,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Bi="isNaN",Fi=de(Bi,["typed"],e=>{let{typed:t}=e;return t(Bi,{number:yi,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=>ui(t,e))})}),Di="isBounded",Oi=de(Di,["typed"],e=>{let{typed:t}=e;return t(Di,{number:e=>Number.isFinite(e),"BigNumber | Complex":e=>e.isFinite(),"bigint | Fraction":()=>!0,"null | undefined":()=>!1,Unit:t.referToSelf(e=>t=>e(t.value)),"Array | Matrix":t.referToSelf(e=>t=>(Array.isArray(t)||(t=t.valueOf()),t.every(t=>e(t))))})}),_i="isFinite",zi=de(_i,["typed","isBounded","map"],e=>{let{typed:t,isBounded:n,map:r}=e;return t(_i,{"Array | Matrix":e=>r(e,n),any:e=>n(e)})}),Ii="typeOf",qi=de(Ii,["typed"],e=>{let{typed:t}=e;return t(Ii,{any:oe})}),ki=de("compareUnits",["typed"],e=>{let{typed:t}=e;return{"Unit, Unit":t.referToSelf(e=>(n,r)=>{if(!n.equalBase(r))throw new Error("Cannot compare units with different base");return t.find(e,[n.valueType(),r.valueType()])(n.value,r.value)})}}),Ri="equalScalar",Pi=de(Ri,["typed","config"],e=>{let{typed:t,config:n}=e;const r=ki({typed:t});return t(Ri,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return _e(e,t,n.relTol,n.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||xi(e,t,n.relTol,n.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,n,r){return _e(e.re,t.re,n,r)&&_e(e.im,t.im,n,r)}(e,t,n.relTol,n.absTol)}},r)}),Ui=(de(Ri,["typed","config"],e=>{let{typed:t,config:n}=e;return t(Ri,{"number, number":function(e,t){return _e(e,t,n.relTol,n.absTol)}})}),de("SparseMatrix",["typed","equalScalar","Matrix"],e=>{let{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!v(t))throw new Error("Invalid datatype: "+t);if(E(e))!function(e,t,n){"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=n||t._datatype):o(e,t.valueOf(),n||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,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;const o=r.length;let a=0,s=n,u=0;if(v(i)&&(s=t.find(n,[i,i])||n,u=t.convert(0,i)),o>0){let t=0;do{e._ptr.push(e._index.length);for(let n=0;nd){for(p=d;pl){if(c){let t=0;for(p=0;pr-1&&(e._values.splice(m,1),e._index.splice(m,1),t++)}e._ptr[p]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function c(e,t,n,r,i){const o=r[0],a=r[1],s=[];let u,c;for(u=0;u");if(1===i.length)s(t.dimension(0),(t,i)=>{Ar(t),e.set([t,0],n[i[0]],r)});else{const i=t.dimension(0),o=t.dimension(1);s(i,(t,i)=>{Ar(t),s(o,(o,a)=>{Ar(o),e.set([t,o],n[i[0]][a[0]],r)})})}}return e;function s(e,t){h(e)?t(e,[0]):e.forEach(t)}}(this,e,t,n);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 xr(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");const t=e[0],n=e[1];Ar(t,this._size[0]),Ar(n,this._size[1]);const r=a(t,this._ptr[n],this._ptr[n+1],this._index);return rl-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]),Ar(o,l),Ar(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!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach(function(e){if(!h(e)||!ye(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+pr(r)+")")}),u(n?this.clone():this,r[0],r[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: "+pr(e)+")")});const n=this._size[0]*this._size[1];if(n!==(e=Br(e,n))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");const r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;const i=[];for(let e=0;e=0&&n<=a&&y(e._values[i],n-0,t-0)}else{const i={};for(let t=n;t "+(this._values?pr(this._values[o],e):"X")}return i},i.prototype.toString=function(){return pr(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,n=e<0?-e:0,r=this._size[0],o=this._size[1],a=Math.min(r-n,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(r)){if(r.length!==d)throw new Error("Invalid value array length");y=function(e){return r[e]}}else if(E(r)){const e=r.size();if(1!==e.length||e[0]!==d)throw new Error("Invalid matrix length");y=function(e){return r.get([e])}}else y=function(){return r};const x=[],b=[],w=[];for(let e=0;e=0&&t=u||i[l]!==t)){const e=r?r[c]:void 0;i.splice(l,0,t),r&&r.splice(l,0,e),i.splice(l<=c?c+1:c,1),r&&r.splice(l<=c?c+1:c,1);continue}if(l=u||i[c]!==e)){const t=r?r[l]:void 0;i.splice(c,0,e),r&&r.splice(c,0,t),i.splice(c<=l?l+1:l,1),r&&r.splice(c<=l?l+1:l,1)}}}},i},{isClass:!0})),ji=de("number",["typed"],e=>{let{typed:t}=e;const n=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 n=0;for(let t=0;t2**n-1)throw new SyntaxError(`String "${e}" is out of range`);i>=2**(n-1)&&(i-=2**n)}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 n=t.clone();return n.value=e(t.value),n}),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))});return n.fromJSON=function(e){return parseFloat(e.value)},n}),Li=de("bigint",["typed"],e=>{let{typed:t}=e;const n=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=>ui(t,e))});return n.fromJSON=function(e){return BigInt(e.value)},n}),$i="string",Hi=de($i,["typed"],e=>{let{typed:t}=e;return t($i,{"":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=>ui(t,e)),any:function(e){return String(e)}})}),Gi="boolean",Zi=de(Gi,["typed"],e=>{let{typed:t}=e;return t(Gi,{"":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 n=Number(e);if(""!==e&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Vi=de("bignumber",["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(e){return new n(e+"")},string:function(e){const t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){const r=t[2],i=n(t[1]),o=new n(2).pow(Number(r));if(i.gt(o.sub(1)))throw new SyntaxError(`String "${e}" is out of range`);const a=new n(2).pow(Number(r)-1);return i.gte(a)?i.sub(o):i}return new n(e)},BigNumber:function(e){return e},bigint:function(e){return new n(e.toString())},Unit:t.referToSelf(e=>t=>{const n=t.clone();return n.value=e(t.value),n}),Fraction:function(e){return new n(String(e.n)).div(String(e.d)).times(String(e.s))},null:function(e){return new n(0)},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Wi=de("complex",["typed","Complex"],e=>{let{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(e){return new n(e,0)},"number, number":function(e,t){return new n(e,t)},"BigNumber, BigNumber":function(e,t){return new n(e.toNumber(),t.toNumber())},Fraction:function(e){return new n(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return n(e)},null:function(e){return n(0)},Object:function(e){if("re"in e&&"im"in e)return new n(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new n(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=>ui(t,e))})}),Yi=de("fraction",["typed","Fraction"],e=>{let{typed:t,Fraction:n}=e;return t("fraction",{number:function(e){if(!Number.isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new n(e)},string:function(e){return new n(e)},"number, number":function(e,t){return new n(e,t)},"bigint, bigint":function(e,t){return new n(e,t)},null:function(e){return new n(0)},BigNumber:function(e){return new n(e.toString())},bigint:function(e){return new n(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf(e=>t=>{const n=t.clone();return n.value=e(t.value),n}),Object:function(e){return new n(e)},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Ji="matrix",Xi=de(Ji,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{let{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Ji,{"":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,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new i(e,n);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}),Qi="matrixFromFunction",Ki=de(Qi,["typed","matrix","isZero"],e=>{let{typed:t,matrix:n,isZero:r}=e;return t(Qi,{"Array | Matrix, function, string, string":function(e,t,n,r){return i(e,t,n,r)},"Array | Matrix, function, string":function(e,t,n){return i(e,t,n)},"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,n){return i(e,n,t)},"Array | Matrix, string, string, function":function(e,t,n,r){return i(e,r,t,n)}});function i(e,t,i,o){let a;return a=void 0!==o?n(i,o):n(i),a.resize(e),a.forEach(function(e,n){const i=t(n);r(i)||a.set(n,i)}),a}}),eo="matrixFromRows",to=de(eo,["typed","matrix","flatten","size"],e=>{let{typed:t,matrix:n,flatten:r,size:i}=e;return t(eo,{"...Array":function(e){return o(e)},"...Matrix":function(e){return n(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]),n=[];for(const i of e){const e=a(i);if(e!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|e));n.push(r(i))}return n}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.")}}),no="matrixFromColumns",ro=de(no,["typed","matrix","flatten","size"],e=>{let{typed:t,matrix:n,flatten:r,size:i}=e;return t(no,{"...Array":function(e){return o(e)},"...Matrix":function(e){return n(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]),n=[];for(let e=0;e{let{typed:t}=e;return t(io,{"Unit, Array":function(e,t){return e.splitUnit(t)}})}),ao="number",so="number, number";function uo(e){return Math.abs(e)}function co(e,t){return e+t}function lo(e,t){return e-t}function fo(e,t){return e*t}function po(e){return-e}function mo(e){return e}function ho(e){return Ee(e)}function go(e){return e*e*e}function yo(e){return Math.exp(e)}function xo(e){return Ae(e)}function bo(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 n;const r=e*t;for(;0!==t;)n=t,t=e%n,e=n;return Math.abs(r/e)}function wo(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function vo(e){return ve(e)}function No(e){return we(e)}function Eo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=t<0;if(n&&(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 n?1/0:0;if(!isFinite(e))return n?0:e;let r=Math.pow(Math.abs(e),1/t);return r=e<0?-r:r,n?1/r:r}function Ao(e){return be(e)}function So(e){return e*e}function Mo(e,t){let n,r,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;)r=Math.floor(e/t),i=e-r*t,n=a,a=s-r*a,s=n,n=u,u=c-r*u,c=n,e=t,t=i;return o=e<0?[-e,-s,-c]:[e,e?s:0,c],o}function Co(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function To(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(Be(e,t))}uo.signature=ao,co.signature=so,lo.signature=so,fo.signature=so,po.signature=ao,mo.signature=ao,ho.signature=ao,go.signature=ao,yo.signature=ao,xo.signature=ao,bo.signature=so,vo.signature=ao,No.signature=ao,Ao.signature=ao,So.signature=ao,Mo.signature=so,Co.signature=so;const Bo="unaryMinus",Fo=de(Bo,["typed"],e=>{let{typed:t}=e;return t(Bo,{number:po,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf(e=>n=>{const r=n.clone();return r.value=t.find(e,r.valueType())(n.value),r}),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0))})}),Do="unaryPlus",Oo=de(Do,["typed","config","numeric"],e=>{let{typed:t,config:n,numeric:r}=e;return t(Do,{number:mo,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=>ui(t,e,!0)),boolean:function(e){return r(e?1:0,n.number)},string:function(e){return r(e,xe(e,n))}})}),_o=de("abs",["typed"],e=>{let{typed:t}=e;return t("abs",{number:uo,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0))})}),zo="mapSlices",Io=de(zo,["typed","isInteger"],e=>{let{typed:t,isInteger:n}=e;return t(zo,{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw new TypeError("Integer number expected for dimension");const i=Array.isArray(e)?wr(e):e.size();if(t<0||t>=i.length)throw new br(t,i.length);return E(e)?e.create(qo(e.valueOf(),t,r),e.datatype()):qo(e,t,r)}})},{formerly:"apply"});function qo(e,t,n){let r,i,o;if(t<=0){if(Array.isArray(e[0])){for(o=function(e){const t=e.length,n=e[0].length;let r,i;const o=[];for(i=0;i{let{typed:t}=e;return t(ko,{"number, number":co,"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=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");const i=n.clone();return i.value=t.find(e,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})}),Po="subtractScalar",Uo=de(Po,["typed"],e=>{let{typed:t}=e;return t(Po,{"number, number":lo,"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=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");const i=n.clone();return i.value=t.find(e,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})}),jo="cbrt",Lo=de(jo,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],e=>{let{config:t,typed:n,isNegative:r,unaryMinus:i,matrix:o,Complex:a,BigNumber:s,Fraction:u}=e;return n(jo,{number:ho,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=r(e.value);let n;t&&(e.value=i(e.value)),n=g(e.value)?new s(1).div(3):b(e.value)?new u(1,3):1/3;const o=e.pow(n);return t&&(o.value=i(o.value)),o}}});function c(e,n){const r=e.arg()/3,i=e.abs(),s=new a(ho(i),0).mul(new a(0,r).exp());if(n){const e=[s,new a(ho(i),0).mul(new a(0,r+2*Math.PI/3).exp()),new a(ho(i),0).mul(new a(0,r-2*Math.PI/3).exp())];return"Array"===t.matrix?e:o(e)}return s}}),$o=de("matAlgo11xS0s",["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return function(e,r,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=n,h=0,g=i;"string"==typeof l&&(m=l,d=t.find(n,[m,m]),h=t.convert(0,m),r=t.convert(r,m),g=t.find(i,[m,m]));const y=[],x=[],b=[];for(let e=0;e{let{typed:t,DenseMatrix:n}=e;return function(e,r,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,r=t.convert(r,m),d=t.find(i,[m,m]));const h=[],g=[],y=[];for(let e=0;e{let{typed:t}=e;return function(e,r,i,o){const a=e._data,s=e._size,u=e._datatype;let c,l=i;"string"==typeof u&&(c=u,r=t.convert(r,c),l=t.find(i,[c,c]));const f=s.length>0?n(l,0,s,s[0],a,r,o):[];return e.createDenseMatrix({data:f,size:ae(s),datatype:c})};function n(e,t,r,i,o,a,s){const u=[];if(t===r.length-1)for(let t=0;t{let{typed:t,config:n,round:r}=e;function i(e){const t=Math.ceil(e),i=r(e);return t===i?t:_e(e,i,n.relTol,n.absTol)&&!_e(e,t,n.relTol,n.absTol)?i:t}return t(Zo,{number:i,"number, number":function(e,t){if(!ye(t))throw new RangeError("number of decimals in function ceil must be an integer");if(t<0||t>15)throw new RangeError("number of decimals in ceil number must be in range 0-15");const n=10**t;return i(e*n)/n}})}),Jo=de(Zo,Vo,e=>{let{typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=e;const u=$o({typed:t,equalScalar:o}),c=Ho({typed:t,DenseMatrix:s}),l=Go({typed:t}),f=Yo({typed:t,config:n,round:r});function p(e){const t=(e,t)=>xi(e,t,n.relTol,n.absTol),i=e.ceil(),o=r(e);return i.eq(o)?i:t(e,o)&&!t(e,i)?o:i}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:p,"BigNumber, BigNumber":function(e,t){const n=Wo.pow(t);return p(e.mul(n)).div(n)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,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())},"Unit, number, Unit":t.referToSelf(e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>e(t,n.toNumber(),r)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>ui(t,t=>e(t,n,r),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,n)=>e(t,0,n)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,n)=>ui(t,t=>e(t,n),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>u(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>l(t,n,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,n)=>l(i(n),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):"dense"===n.storage()?l(n,t,e,!0):c(n,t,e,!0))})}),Xo="cube",Qo=de(Xo,["typed"],e=>{let{typed:t}=e;return t(Xo,{number:go,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)}})}),Ko=de("exp",["typed"],e=>{let{typed:t}=e;return t("exp",{number:yo,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})}),ea="expm1",ta=de(ea,["typed","Complex"],e=>{let{typed:t,Complex:n}=e;return t(ea,{number:xo,Complex:function(e){const t=Math.exp(e.re);return new n(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})}),na="fix",ra=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],ia=de(na,["typed","ceil","floor"],e=>{let{typed:t,ceil:n,floor:r}=e;return t(na,{number:function(e){return e>0?r(e):n(e)},"number, number":function(e,t){return e>0?r(e,t):n(e,t)}})}),oa=de(na,ra,e=>{let{typed:t,Complex:n,matrix:r,ceil:i,floor:o,equalScalar:a,zeros:s,DenseMatrix:u}=e;const c=Ho({typed:t,DenseMatrix:u}),l=Go({typed:t}),f=ia({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 n(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 n(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 r=t.toNumber();return new n(e.re>0?o(e.re,r):i(e.re,r),e.im>0?o(e.im,r):i(e.im,r))},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)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.s<0n?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0n?i(e,t):o(e,t)},"Unit, number, Unit":t.referToSelf(e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>e(t,n.toNumber(),r)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>ui(t,t=>e(t,n,r),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,n)=>e(t,0,n)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(e=>(t,n)=>ui(t,t=>e(t,n),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,n)=>l(r(n),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,n)=>a(t,0)?s(n.size(),n.storage()):"dense"===n.storage()?l(n,t,e,!0):c(n,t,e,!0))})}),aa="floor",sa=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],ua=new Dn(10),ca=de(aa,["typed","config","round"],e=>{let{typed:t,config:n,round:r}=e;function i(e){const t=Math.floor(e),i=r(e);return t===i?t:_e(e,i,n.relTol,n.absTol)&&!_e(e,t,n.relTol,n.absTol)?i:t}return t(aa,{number:i,"number, number":function(e,t){if(!ye(t))throw new RangeError("number of decimals in function floor must be an integer");if(t<0||t>15)throw new RangeError("number of decimals in floor number must be in range 0 - 15");const n=10**t;return i(e*n)/n}})}),la=de(aa,sa,e=>{let{typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=e;const u=$o({typed:t,equalScalar:o}),c=Ho({typed:t,DenseMatrix:s}),l=Go({typed:t}),f=ca({typed:t,config:n,round:r});function p(e){const t=(e,t)=>xi(e,t,n.relTol,n.absTol),i=e.floor(),o=r(e);return i.eq(o)?i:t(e,o)&&!t(e,i)?o:i}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:p,"BigNumber, BigNumber":function(e,t){const n=ua.pow(t);return p(e.mul(n)).div(n)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,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())},"Unit, number, Unit":t.referToSelf(e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>e(t,n.toNumber(),r)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>ui(t,t=>e(t,n,r),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,n)=>e(t,0,n)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,n)=>ui(t,t=>e(t,n),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>u(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>l(t,n,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,n)=>l(i(n),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):"dense"===n.storage()?l(n,t,e,!0):c(n,t,e,!0))})}),fa=de("matAlgo02xDS0",["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return function(e,r,i,o){const a=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._values,l=r._index,f=r._ptr,p=r._size,m=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==p.length)throw new xr(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=n,x=0,b=i;"string"==typeof u&&u===m&&"mixed"!==u&&(g=u,y=t.find(n,[g,g]),x=t.convert(0,g),b=t.find(i,[g,g]));const w=[],v=[],N=[];for(let e=0;e{let{typed:t}=e;return function(e,n,r,i){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=n._values,c=n._index,l=n._ptr,f=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(a.length!==f.length)throw new xr(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=r;"string"==typeof s&&s===p&&"mixed"!==s&&(h=s,g=t.convert(0,h),y=t.find(r,[h,h]));const x=[];for(let e=0;e{let{typed:t,equalScalar:n}=e;return function(e,r,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=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==m.length)throw new xr(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=n,b=0,w=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(n,[y,y]),b=t.convert(0,y),w=t.find(i,[y,y]));const v=o&&l?[]:void 0,N=[],E=[],A=v?[]:void 0,S=v?[]:void 0,M=[],C=[];let T,B,F,D;for(B=0;B{let{typed:t}=e;return function(e,r,i){const o=e._data,a=e._size,s=e._datatype,u=r._data,c=r._size,l=r._datatype,f=[];if(a.length!==c.length)throw new xr(a.length,c.length);for(let e=0;e0?n(m,0,f,f[0],o,u):[];return e.createDenseMatrix({data:d,size:f,datatype:p})};function n(e,t,r,i,o,a){const s=[];if(t===r.length-1)for(let t=0;tfunction(e,t){return ce(e.size(),t)?e:e.create(Wr(e.valueOf(),t),e.datatype())}(e,n))}const ga=de("matrixAlgorithmSuite",["typed","matrix"],e=>{let{typed:t,matrix:n}=e;const r=da({typed:t}),i=Go({typed:t});return function(e){const o=e.elop,a=e.SD||e.DS;let s;o?(s={"DenseMatrix, DenseMatrix":(e,t)=>r(...ha(e,t),o),"Array, Array":(e,t)=>r(...ha(n(e),n(t)),o).valueOf(),"Array, DenseMatrix":(e,t)=>r(...ha(n(e),t),o),"DenseMatrix, Array":(e,t)=>r(...ha(e,n(t)),o)},e.SS&&(s["SparseMatrix, SparseMatrix"]=(t,n)=>e.SS(...ha(t,n),o,!1)),e.DS&&(s["DenseMatrix, SparseMatrix"]=(t,n)=>e.DS(...ha(t,n),o,!1),s["Array, SparseMatrix"]=(t,r)=>e.DS(...ha(n(t),r),o,!1)),a&&(s["SparseMatrix, DenseMatrix"]=(e,t)=>a(...ha(t,e),o,!0),s["SparseMatrix, Array"]=(e,t)=>a(...ha(n(t),e),o,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,n)=>r(...ha(t,n),e)),"Array, Array":t.referToSelf(e=>(t,i)=>r(...ha(n(t),n(i)),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,i)=>r(...ha(n(t),i),e)),"DenseMatrix, Array":t.referToSelf(e=>(t,i)=>r(...ha(t,n(i)),e))},e.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf(t=>(n,r)=>e.SS(...ha(n,r),t,!1))),e.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf(t=>(n,r)=>e.DS(...ha(n,r),t,!1)),s["Array, SparseMatrix"]=t.referToSelf(t=>(r,i)=>e.DS(...ha(n(r),i),t,!1))),a&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf(e=>(t,n)=>a(...ha(n,t),e,!0)),s["SparseMatrix, Array"]=t.referToSelf(e=>(t,r)=>a(...ha(n(r),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(n(e),t,o,!1).valueOf(),s[u+", Array"]=(e,t)=>i(n(t),e,o,!0).valueOf()):(s["DenseMatrix,"+u]=t.referToSelf(e=>(t,n)=>i(t,n,e,!1)),s[u+", DenseMatrix"]=t.referToSelf(e=>(t,n)=>i(n,t,e,!0)),s["Array,"+u]=t.referToSelf(e=>(t,r)=>i(n(t),r,e,!1).valueOf()),s[u+", Array"]=t.referToSelf(e=>(t,r)=>i(n(r),t,e,!0).valueOf())));const c=void 0!==e.sS?e.sS:e.Ss;return o?(e.Ss&&(s["SparseMatrix,"+u]=(t,n)=>e.Ss(t,n,o,!1)),c&&(s[u+", SparseMatrix"]=(e,t)=>c(t,e,o,!0))):(e.Ss&&(s["SparseMatrix,"+u]=t.referToSelf(t=>(n,r)=>e.Ss(n,r,t,!1))),c&&(s[u+", SparseMatrix"]=t.referToSelf(e=>(t,n)=>c(n,t,e,!0)))),o&&o.signatures&&se(s,o.signatures),s}}),ya=de("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{let{typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s,concat:u}=e;const c=la({typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}),l=fa({typed:t,equalScalar:o}),f=pa({typed:t}),p=ma({typed:t,equalScalar:o}),m=$o({typed:t,equalScalar:o}),d=Ho({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 n=e%t;return 0n===n?n:n+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},ga({typed:t,matrix:i,concat:u})({SS:p,DS:f,SD:l,Ss:m,sS:d}))}),xa=de("matAlgo01xDSid",["typed"],e=>{let{typed:t}=e;return function(e,n,r,i){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=n._values,c=n._index,l=n._ptr,f=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(a.length!==f.length)throw new xr(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(r,[h,h]):r;let y,x;const b=[];for(y=0;y{let{typed:t,equalScalar:n}=e;return function(e,r,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=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==m.length)throw new xr(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=n,b=0,w=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(n,[y,y]),b=t.convert(0,y),w=t.find(i,[y,y]));const v=o&&l?[]:void 0,N=[],E=[],A=o&&l?[]:void 0,S=o&&l?[]:void 0,M=[],C=[];let T,B,F,D,O;for(B=0;B{let{typed:t,DenseMatrix:n}=e;return function(e,r,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,r=t.convert(r,m),d=t.find(i,[m,m]));const h=[],g=[],y=[];for(let e=0;eArray.isArray(e))}const Sa=de("gcd",["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,config:r,round:i,equalScalar:o,zeros:a,BigNumber:s,DenseMatrix:u,concat:c}=e;const l=ya({typed:t,config:r,round:i,matrix:n,equalScalar:o,zeros:a,DenseMatrix:u,concat:c}),f=xa({typed:t}),p=ba({typed:t,equalScalar:o}),m=wa({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 n;for(;0!==t;)n=l(e,t),e=t,t=n;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 n=new s(0);for(;!t.isZero();){const n=l(e,t);e=t,t=n}return e.lt(n)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},ga({typed:t,matrix:n,concat:c})({SS:p,DS:f,Ss:m}),{[Ea]:t.referToSelf(e=>(t,n,r)=>{let i=e(t,n);for(let t=0;tt=>{if(1===t.length&&Array.isArray(t[0])&&Aa(t[0]))return e(...t[0]);if(Aa(t))return e(...t);throw new va("gcd() supports only 1d matrices!")}),Matrix:t.referToSelf(e=>t=>e(t.toArray()))})}),Ma=de("matAlgo06xS0S0",["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return function(e,r,i){const o=e._values,a=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,c=r._size,l=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(a.length!==c.length)throw new xr(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=n,h=0,g=i;"string"==typeof s&&s===l&&"mixed"!==s&&(m=s,d=t.find(n,[m,m]),h=t.convert(0,m),g=t.find(i,[m,m]));const y=o&&u?[]:void 0,x=[],b=[],w=y?[]:void 0,v=[],N=[];for(let t=0;t{let{typed:t,matrix:n,equalScalar:r,concat:i}=e;const o=fa({typed:t,equalScalar:r}),a=Ma({typed:t,equalScalar:r}),s=$o({typed:t,equalScalar:r}),u=ga({typed:t,matrix:n,concat:i}),c="number | BigNumber | Fraction | Matrix | Array",l={};return l[`${c}, ${c}, ...${c}`]=t.referToSelf(e=>(t,n,r)=>{let i=e(t,n);for(let t=0;te.lcm(t)},u({SS:a,DS:o,Ss:s}),l)});function Ta(e,t,n,r){return function(i){if(i>0||n.predictable){if(i<=0)return NaN;const n=i.toString(16),r=n.substring(0,15);return e*(n.length-r.length)+t(Number("0x"+r))}return r(i.toNumber())}}const Ba="log10",Fa=["typed","config","Complex"],Da=vo(16),Oa=de(Ba,Fa,e=>{let{typed:t,config:n,Complex:r}=e;function i(e){return e.log().div(Math.LN10)}function o(e){return i(new r(e,0))}return t(Ba,{number:function(e){return e>=0||n.predictable?vo(e):o(e)},bigint:Ta(Da,vo,n,o),Complex:i,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log():o(e.toNumber())},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),_a="log2",za=de(_a,["typed","config","Complex"],e=>{let{typed:t,config:n,Complex:r}=e;function i(e){return o(new r(e,0))}return t(_a,{number:function(e){return e>=0||n.predictable?No(e):i(e)},bigint:Ta(4,No,n,i),Complex:o,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log(2):i(e.toNumber())},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))});function o(e){const t=Math.sqrt(e.re*e.re+e.im*e.im);return new r(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}),Ia=de("multiplyScalar",["typed"],e=>{let{typed:t}=e;return t("multiplyScalar",{"number, number":fo,"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)})}),qa="multiply",ka=de(qa,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],e=>{let{typed:t,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:o,dot:a}=e;const s=$o({typed:t,equalScalar:o}),u=Go({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,n){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=n._data,c=n._datatype||n.getDataType(),l=a[0],f=a[1];let p,m=r,d=i;s&&c&&s===c&&"string"==typeof s&&"mixed"!==s&&(p=s,m=t.find(r,[p,p]),d=t.find(i,[p,p]));const h=[];for(let e=0;et){let e=0;for(let r=0;r(t,r)=>{c(wr(t),wr(r));const i=e(n(t),n(r));return E(i)?i.valueOf():i}),"Matrix, Matrix":function(e,n){const o=e.size(),s=n.size();return c(o,s),1===o.length?1===s.length?function(e,t,n){if(0===n)throw new Error("Cannot multiply two empty vectors");return a(e,t)}(e,n,o[0]):function(e,n){if("dense"!==n.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,n){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=n._data,c=n._size,l=n._datatype||n.getDataType(),f=a[0],p=c[1];let m,d=r,h=i;s&&l&&s===l&&"string"==typeof s&&"mixed"!==s&&(m=s,d=t.find(r,[m,m]),h=t.find(i,[m,m]));const g=[];for(let e=0;e(t,r)=>e(t,n(r))),"Array, Matrix":t.referToSelf(e=>(t,r)=>e(n(t,r.storage()),r)),"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(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(e=>(t,n,r)=>{let i=e(t,n);for(let t=0;t{let{typed:t,matrix:n,equalScalar:r,BigNumber:i,concat:o}=e;const a=xa({typed:t}),s=fa({typed:t,equalScalar:r}),u=Ma({typed:t,equalScalar:r}),c=$o({typed:t,equalScalar:r}),l=ga({typed:t,matrix:n,concat:o});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(Ra,{number:Eo,"number, number":Eo,BigNumber:e=>p(e,new i(2)),"BigNumber, BigNumber":p,Complex:f,"Complex, number":f,Array:t.referTo("DenseMatrix,number",e=>t=>e(n(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,n)=>{if(1===n.density())return u(t,n,e);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t.referToSelf(e=>(t,n)=>{if(1===n.density())return a(t,n,e,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",e=>(t,r)=>e(n(t),r)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>{if(1===n.density())return c(n,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 n=i.precision,r=i.clone({precision:n+2}),o=new i(0),a=new r(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 r(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(n))}}),Ua="sign",ja=de(Ua,["typed","BigNumber","Fraction","complex"],e=>{let{typed:t,BigNumber:n,complex:r,Fraction:i}=e;return t(Ua,{number:Ao,Complex:function(e){return 0===e.im?r(Ao(e.re)):e.sign()},BigNumber:function(e){return new n(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return 0n===e.n?new i(0):new i(e.s)},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0)),Unit:t.referToSelf(e=>n=>{if(!n._isDerived()&&0!==n.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,n.valueType())(n.value)})})}),La=de("sqrt",["config","typed","Complex"],e=>{let{config:t,typed:n,Complex:r}=e;return n("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 r(e,0).sqrt()}}),$a="square",Ha=de($a,["typed"],e=>{let{typed:t}=e;return t($a,{number:So,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)}})}),Ga="subtract",Za=de(Ga,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:o,DenseMatrix:a,concat:s}=e;const u=xa({typed:t}),c=pa({typed:t}),l=ma({typed:t,equalScalar:r}),f=wa({typed:t,DenseMatrix:a}),p=Ho({typed:t,DenseMatrix:a}),m=ga({typed:t,matrix:n,concat:s});return t(Ga,{"any, any":i},m({elop:i,SS:l,DS:u,SD:c,Ss:p,sS:f}))}),Va="xgcd",Wa=de(Va,["typed","config","matrix","BigNumber"],e=>{let{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(Va,{"number, number":function(e,t){const i=Mo(e,t);return"Array"===n.matrix?i:r(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"===n.matrix?l:r(l)}})}),Ya="invmod",Ja=de(Ya,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],e=>{let{typed:t,config:n,BigNumber:r,xgcd:i,equal:o,smaller:a,mod:s,add:u,isInteger:c}=e;return t(Ya,{"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 n=i(e,t);n=n.valueOf();let[l,f]=n;return o(l,r(1))?(f=s(f,t),a(f,r(0))&&(f=u(f,t)),f):NaN}}),Xa=de("matAlgo09xS0Sf",["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return function(e,r,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=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==m.length)throw new xr(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=n,b=0,w=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(n,[y,y]),b=t.convert(0,y),w=t.find(i,[y,y]));const v=o&&l?[]:void 0,N=[],E=[],A=v?[]:void 0,S=[];let M,C,T,B,F;for(C=0;C{let{typed:t,matrix:n,equalScalar:r,multiplyScalar:i,concat:o}=e;const a=fa({typed:t,equalScalar:r}),s=Xa({typed:t,equalScalar:r}),u=$o({typed:t,equalScalar:r}),c=ga({typed:t,matrix:n,concat:o});return t(Qa,c({elop:i,SS:s,DS:a,Ss:u}))});function es(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");const n=e.constructor;if(e.isNaN()||t.isNaN())return new n(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 n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return rs(e,t,function(e,t){return e&t})}function ts(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");const t=e.constructor,n=t.precision;t.config({precision:1e9});const r=e.plus(new t(1));return r.s=-r.s||null,t.config({precision:n}),r}function ns(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");const n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);const r=new n(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:e.isFinite()&&t.isFinite()?rs(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function rs(e,t,n){const r=e.constructor;let i,o;const a=+(e.s<0),s=+(t.s<0);if(a){i=is(ts(e));for(let e=0;e0;)n(u[--f],c[--p])===m&&(d=d.plus(h)),h=h.times(g);for(;p>0;)n(l,c[--p])===m&&(d=d.plus(h)),h=h.times(g);return r.config({precision:y}),0===m&&(d.s=-d.s),d}function is(e){const t=e.d;let n=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 os(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");const n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new n(0);const r=new n(-1);return e.eq(r)?ts(t):t.eq(r)?ts(e):e.isFinite()&&t.isFinite()?rs(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new n(e.isNegative()===t.isNegative()?1/0:-1/0):r}function as(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");const n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new n(2).pow(t)):new n(NaN)}function ss(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");const n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new n(2).pow(t)).floor():e.isNegative()?new n(-1):e.isFinite()?new n(0):new n(NaN)}const us="number, number";function cs(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function bitAnd");return e&t}function ls(e){if(!ye(e))throw new Error("Integer expected in function bitNot");return~e}function fs(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function bitOr");return e|t}function ps(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function bitXor");return e^t}function ms(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function leftShift");return e<>t}function hs(e,t){if(!ye(e)||!ye(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}cs.signature=us,ls.signature="number",fs.signature=us,ps.signature=us,ms.signature=us,ds.signature=us,hs.signature=us;const gs="bitAnd",ys=de(gs,["typed","matrix","equalScalar","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,concat:i}=e;const o=fa({typed:t,equalScalar:r}),a=Ma({typed:t,equalScalar:r}),s=$o({typed:t,equalScalar:r}),u=ga({typed:t,matrix:n,concat:i});return t(gs,{"number, number":cs,"BigNumber, BigNumber":es,"bigint, bigint":(e,t)=>e&t},u({SS:a,DS:o,Ss:s}))}),xs="bitNot",bs=de(xs,["typed"],e=>{let{typed:t}=e;return t(xs,{number:ls,BigNumber:ts,bigint:e=>~e,"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),ws="bitOr",vs=de(ws,["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=e;const a=xa({typed:t}),s=ba({typed:t,equalScalar:r}),u=wa({typed:t,DenseMatrix:i}),c=ga({typed:t,matrix:n,concat:o});return t(ws,{"number, number":fs,"BigNumber, BigNumber":ns,"bigint, bigint":(e,t)=>e|t},c({SS:s,DS:a,Ss:u}))}),Ns=de("matAlgo07xSSf",["typed","SparseMatrix"],e=>{let{typed:t,SparseMatrix:n}=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 xr(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=0,d=o;"string"==typeof s&&s===c&&"mixed"!==s&&(p=s,m=t.convert(0,p),d=t.find(o,[p,p]));const h=[],g=[],y=new Array(f+1).fill(0),x=[],b=[],w=[],v=[];for(let t=0;t{let{typed:t,matrix:n,DenseMatrix:r,concat:i,SparseMatrix:o}=e;const a=pa({typed:t}),s=Ns({typed:t,SparseMatrix:o}),u=Ho({typed:t,DenseMatrix:r}),c=ga({typed:t,matrix:n,concat:i});return t(Es,{"number, number":ps,"BigNumber, BigNumber":os,"bigint, bigint":(e,t)=>e^t},c({SS:s,DS:a,Ss:u}))}),Ss=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=>ui(t,e))})}),Ms="conj",Cs=de(Ms,["typed"],e=>{let{typed:t}=e;return t(Ms,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),Unit:t.referToSelf(e=>t=>new t.constructor(e(t.toNumeric()),t.formatUnits())),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Ts=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=>ui(t,e))})}),Bs=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=>ui(t,e))})}),Fs="number, number";function Ds(e){return!e}function Os(e,t){return!(!e&&!t)}function _s(e,t){return!!e!=!!t}function zs(e,t){return!(!e||!t)}Ds.signature="number",Os.signature=Fs,_s.signature=Fs,zs.signature=Fs;const Is=de("not",["typed"],e=>{let{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:Ds,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=>n=>t.find(e,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),qs="nullish",ks=de(qs,["typed","matrix","size","flatten","deepEqual"],e=>{let{typed:t,matrix:n,size:r,flatten:i,deepEqual:o}=e;const a=pa({typed:t}),s=Go({typed:t}),u=da({typed:t});return t(qs,{"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any":(e,t)=>e,"null, any":(e,t)=>t,"undefined, any":(e,t)=>t,"SparseMatrix, Array | Matrix":(e,t)=>{const n=r(e),i=r(t);if(o(n,i))return e;throw new xr(n,i)},"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,n)=>u(t,n,e)),"DenseMatrix, SparseMatrix":t.referToSelf(e=>(t,n)=>a(t,n,e,!1)),"DenseMatrix, Array":t.referToSelf(e=>(t,r)=>u(t,n(r),e)),"DenseMatrix, any":t.referToSelf(e=>(t,n)=>s(t,n,e,!1)),"Array, Array":t.referToSelf(e=>(t,r)=>u(n(t),n(r),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,r)=>u(n(t),r,e)),"Array, SparseMatrix":t.referToSelf(e=>(t,r)=>a(n(t),r,e,!1)),"Array, any":t.referToSelf(e=>(t,r)=>s(n(t),r,e,!1).valueOf())})}),Rs=de("or",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=e;const a=pa({typed:t}),s=ma({typed:t,equalScalar:r}),u=Ho({typed:t,DenseMatrix:i}),c=ga({typed:t,matrix:n,concat:o});return t("or",{"number, number":Os,"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":Os,"Unit, Unit":t.referToSelf(e=>(t,n)=>e(t.value||0,n.value||0))},c({SS:s,DS:a,Ss:u}))}),Ps=de("xor",["typed","matrix","DenseMatrix","concat","SparseMatrix"],e=>{let{typed:t,matrix:n,DenseMatrix:r,concat:i,SparseMatrix:o}=e;const a=pa({typed:t}),s=Ns({typed:t,SparseMatrix:o}),u=Ho({typed:t,DenseMatrix:r}),c=ga({typed:t,matrix:n,concat:i});return t("xor",{"number, number":_s,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"bigint, bigint":_s,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf(e=>(t,n)=>e(t.value||0,n.value||0))},c({SS:s,DS:a,Ss:u}))}),Us="concat",js=de(Us,["typed","matrix","isInteger"],e=>{let{typed:t,matrix:n,isInteger:r}=e;return t(Us,{"...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 br(a,o+1)}else{const e=ae(n).valueOf(),r=wr(e);if(u[t]=e,o=a,a=r.length-1,t>0&&a!==o)throw new xr(o+1,a+1)}}if(0===u.length)throw new SyntaxError("At least one matrix expected");let c=u.shift();for(;u.length;)c=Gr(c,u.shift(),a);return s?n(c):c},"...string":function(e){return e.join("")}})}),Ls="column",$s=de(Ls,["typed","Index","matrix","range"],e=>{let{typed:t,Index:n,matrix:r,range:i}=e;return t(Ls,{"Matrix, number":o,"Array, number":function(e,t){return o(r(ae(e)),t).valueOf()}});function o(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");Ar(t,e.size()[1]);const o=i(0,e.size()[0]),a=new n(o,[t]),s=e.subset(a);return E(s)?s:r([[s]])}}),Hs="count",Gs=de(Hs,["typed","size","prod"],e=>{let{typed:t,size:n,prod:r}=e;return t(Hs,{string:function(e){return e.length},"Matrix | Array":function(e){return r(n(e))}})}),Zs="cross",Vs=de(Zs,["typed","matrix","subtract","multiply"],e=>{let{typed:t,matrix:n,subtract:r,multiply:i}=e;return t(Zs,{"Matrix, Matrix":function(e,t){return n(o(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(o(e.toArray(),t))},"Array, Matrix":function(e,t){return n(o(e,t.toArray()))},"Array, Array":o});function o(e,t){const n=Math.max(wr(e).length,wr(t).length);e=Dr(e),t=Dr(t);const o=wr(e),a=wr(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=[r(i(e[1],t[2]),i(e[2],t[1])),r(i(e[2],t[0]),i(e[0],t[2])),r(i(e[0],t[1]),i(e[1],t[0]))];return n>1?[s]:s}}),Ws="diag",Ys=de(Ws,["typed","matrix","DenseMatrix","SparseMatrix"],e=>{let{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Ws,{Array:function(e){return o(e,0,wr(e),null)},"Array, number":function(e,t){return o(e,t,wr(e),null)},"Array, BigNumber":function(e,t){return o(e,t.toNumber(),wr(e),null)},"Array, string":function(e,t){return o(e,0,wr(e),t)},"Array, number, string":function(e,t,n){return o(e,t,wr(e),n)},"Array, BigNumber, string":function(e,t,n){return o(e,t.toNumber(),wr(e),n)},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,n){return o(e,t,e.size(),n)},"Matrix, BigNumber, string":function(e,t,n){return o(e,t.toNumber(),e.size(),n)}});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,n,o,a,s){const u=[o+a,o+s];if(n&&"sparse"!==n&&"dense"!==n)throw new TypeError(`Unknown matrix type ${n}"`);const c="sparse"===n?i.diagonal(u,e,t):r.diagonal(u,e,t);return null!==n?c:c.valueOf()}(e,t,a,o[0],u,s);case 2:return function(e,t,r,i,o,a){if(E(e)){const i=e.diagonal(t);return null!==r?r!==i.storage()?n(i,r):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":Xs,"Matrix, function":function(e,t){return e.create(Xs(e.valueOf(),t),e.datatype())},"Array, RegExp":Pr,"Matrix, RegExp":function(e,t){return e.create(Pr(e.valueOf(),t),e.datatype())}})});function Xs(e,t){const n=Kr(t,e,"filter");return n.isUnary?Rr(e,n.fn):Rr(e,function(e,t,r){return n.fn(e,[t],r)})}const Qs="flatten",Ks=de(Qs,["typed"],e=>{let{typed:t}=e;return t(Qs,{Array:function(e){return Ir(e)},DenseMatrix:function(e){return e.create(Ir(e.valueOf(),!0),e.datatype())},SparseMatrix:function(e){throw new TypeError("SparseMatrix is not supported by function flatten because it does not support 1D vectors. Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())")}})}),eu="forEach",tu=de(eu,["typed"],e=>{let{typed:t}=e;return t(eu,{"Array, function":nu,"Matrix, function":function(e,t){e.forEach(t)}})});function nu(e,t){const n=Kr(t,e,eu);Qr(e,n.fn,n.isUnary)}const ru="getMatrixDataType",iu=de(ru,["typed"],e=>{let{typed:t}=e;return t(ru,{Array:function(e){return $r(e,oe)},Matrix:function(e){return e.getDataType()}})}),ou="identity",au=de(ou,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],e=>{let{typed:t,config:n,matrix:r,BigNumber:i,DenseMatrix:o,SparseMatrix:a}=e;return t(ou,{"":function(){return"Matrix"===n.matrix?r([]):[]},string:function(e){return r(e)},"number | BigNumber":function(e){return u(e,e,"Matrix"===n.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"===n.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,n){return u(e,t,n)},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?r(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,n){const r=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=r?new i(1):1,u=r?new r(0):0,c=[e,t];if(n){if("sparse"===n)return a.diagonal(c,s,0,u);if("dense"===n)return o.diagonal(c,s,0,u);throw new TypeError(`Unknown matrix type "${n}"`)}const l=Mr([],c,u),f=e{let{typed:t,matrix:n,multiplyScalar:r}=e;return t(su,{"Matrix, Matrix":function(e,t){return n(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(i(e.toArray(),t))},"Array, Matrix":function(e,t){return n(i(e,t.toArray()))},"Array, Array":i});function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(n<0){let r=wr(e).length,i=wr(t).length;for(n=Math.max(r,i);r++t.map(t=>r(e,t)))}(e,t):e.flatMap(e=>t.map(t=>i(e,t,n-1)))}}),cu="map",lu=de(cu,["typed"],e=>{let{typed:t}=e;return t(cu,{"Array, function":r,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,i,o)=>function(e,i){if("function"!=typeof i)throw new Error("Last argument must be a callback function");const o=e[0].isMatrix,a=e.map(e=>e.isMatrix?e.size():wr(e)),s=Zr(...a),u=e.length,c=o?(e,t)=>e.get(t):Jr,l=e.map((e,t)=>{const n=a[t].map(()=>0);return e.isMatrix?e.get(n):Jr(e,n)}),f=t.isTypedFunction(i)?function(e,n,r,i){return null!==t.resolve(e,[...n,r,...i])?2:null!==t.resolve(e,[...n,r])?1:(t.resolve(e,n),0)}(i,l,s.map(()=>0),e):function(e,t){const n=e.toString();if(/arguments/.test(n))return 2;const r=n.match(/\(.*?\)/);return/\.\.\./.test(r)||e.length>t+1?2:e.length===t+1?1:0}(i,u);if(f<2){const t=n(f,i,null);return function(e,t){const n=e[0],r=e.map(e=>e.isMatrix?e.valueOf():e),i=e.map(e=>e.isMatrix?e.size():wr(e)),o=Zr(...i),a=i.map(e=>o.length-e.length),s=o.length-1,u=t.length>1?[]:null,c=function e(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=o[r],c=Array(i);if(ra[n]>r?e:1===e.length?e[0]:e[t]),r+1);else for(let e=0;e1===t.length?t[0]:t[e]),u?u.slice():void 0);return c}(r,0);if(n.isMatrix){const e=n.create();return e._data=c,e._size=o,e}return c}(e,t)}const p=o?e.map(t=>t.isMatrix?t.create(Wr(t.toArray(),s),t.datatype()):e[0].create(Wr(t.valueOf(),s))):e.map(e=>e.isMatrix?Wr(e.toArray(),s):Wr(e,s)),m=n(f,i,p),d=(e,t)=>m([e,...p.slice(1).map(e=>c(e,t))],t);return o?p[0].map(d):r(p[0],d)}([e,i,...o.slice(0,o.length-1)],o[o.length-1])});function n(e,t,n){switch(e){case 0:return e=>t(...e);case 1:return(e,n)=>t(...e,n);case 2:return(e,r)=>t(...e,r,...n)}}function r(e,t){const n=Kr(t,e,cu);return Xr(e,n.fn,n.isUnary)}}),fu="diff",pu=de(fu,["typed","matrix","subtract","number"],e=>{let{typed:t,matrix:n,subtract:r,number:i}=e;return t(fu,{"Array | Matrix":function(e){return E(e)?n(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)?n(o(e.toArray(),t)):o(e,t)},"Array, BigNumber":t.referTo("Array,number",e=>(t,n)=>e(t,i(n))),"Matrix, BigNumber":t.referTo("Matrix,number",e=>(t,n)=>e(t,i(n)))});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 n=[];return e.forEach(e=>{n.push(o(e,t-1))}),n}if(0===t)return a(e);throw RangeError("Cannot have negative dimension")}function a(e){const t=[],n=e.length;for(let r=1;r{let{typed:t,config:n,matrix:r,BigNumber:i}=e;return t("ones",{"":function(){return"Array"===n.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"===n.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 n=function(e){let t=!1;return e.forEach(function(e,n,r){g(e)&&(t=!0,r[n]=e.toNumber())}),t}(e),o=n?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 n=r(t);return e.length>0?n.resize(e,o):n}{const t=[];return e.length>0?Mr(t,e,o):t}}});function du(){throw new Error('No "bignumber" implementation available')}function hu(){throw new Error('No "fraction" implementation available')}const gu="range",yu=de(gu,["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],e=>{let{typed:t,config:n,matrix:r,bignumber:i,smaller:o,smallerEq:a,larger:s,largerEq:u,add:c,isZero:l,isPositive:f}=e;return t(gu,{string:m,"string, boolean":m,number:function(e){throw new TypeError(`Too few arguments to function range(): ${e}`)},boolean:function(e){throw new TypeError(`Unexpected type of argument 1 to function range(): ${e}, number|bigint|BigNumber|Fraction`)},"number, number":function(e,t){return p(d(e,t,1,!1))},"number, number, number":function(e,t,n){return p(d(e,t,n,!1))},"number, number, boolean":function(e,t,n){return p(d(e,t,1,n))},"number, number, number, boolean":function(e,t,n,r){return p(d(e,t,n,r))},"bigint, bigint|number":function(e,t){return p(d(e,t,1n,!1))},"number, bigint":function(e,t){return p(d(BigInt(e),t,1n,!1))},"bigint, bigint|number, bigint|number":function(e,t,n){return p(d(e,t,BigInt(n),!1))},"number, bigint, bigint|number":function(e,t,n){return p(d(BigInt(e),t,BigInt(n),!1))},"bigint, bigint|number, boolean":function(e,t,n){return p(d(e,t,1n,n))},"number, bigint, boolean":function(e,t,n){return p(d(BigInt(e),t,1n,n))},"bigint, bigint|number, bigint|number, boolean":function(e,t,n,r){return p(d(e,t,BigInt(n),r))},"number, bigint, bigint|number, boolean":function(e,t,n,r){return p(d(BigInt(e),t,BigInt(n),r))},"BigNumber, BigNumber":function(e,t){return p(d(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,n){return p(d(e,t,n,!1))},"BigNumber, BigNumber, boolean":function(e,t,n){return p(d(e,t,new(0,e.constructor)(1),n))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,n,r){return p(d(e,t,n,r))},"Fraction, Fraction":function(e,t){return p(d(e,t,1,!1))},"Fraction, Fraction, Fraction":function(e,t,n){return p(d(e,t,n,!1))},"Fraction, Fraction, boolean":function(e,t,n){return p(d(e,t,1,n))},"Fraction, Fraction, Fraction, boolean":function(e,t,n,r){return p(d(e,t,n,r))},"Unit, Unit, Unit":function(e,t,n){return p(d(e,t,n,!1))},"Unit, Unit, Unit, boolean":function(e,t,n,r){return p(d(e,t,n,r))}});function p(e){return"Matrix"===n.matrix?r?r(e):function(){throw new Error('No "matrix" implementation available')}():e}function m(e,t){const r=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(!r)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===n.number?(void 0===i&&du(),p(d(i(r.start),i(r.end),i(r.step)))):p(d(r.start,r.end,r.step,t))}function d(e,t,n,r){const i=[];if(l(n))throw new Error("Step must be non-zero");const p=f(n)?r?a:o:r?u:s;let m=e;for(;p(m,t);)i.push(m),m=c(m,n);return i}}),xu="reshape",bu=de(xu,["typed","isInteger","matrix"],e=>{let{typed:t,isInteger:n}=e;return t(xu,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach(function(e){if(!n(e))throw new TypeError("Invalid size for dimension: "+e)}),Tr(e,t)}})}),wu=de("resize",["config","matrix"],e=>{let{config:t,matrix:n}=e;return function(e,r,i){if(2!==arguments.length&&3!==arguments.length)throw new va("resize",arguments.length,2,3);if(E(r)&&(r=r.valueOf()),g(r[0])&&(r=r.map(function(e){return g(e)?e.toNumber():e})),E(e))return e.resize(r,i,!0);if("string"==typeof e)return function(e,t,n){if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";if(1!==t.length)throw new xr(t.length,1);const r=t[0];if("number"!=typeof r||!ye(r))throw new TypeError("Invalid size, must contain positive integers (size: "+pr(t)+")");if(e.length>r)return e.substring(0,r);if(e.length{let{typed:t,multiply:n,rotationMatrix:r}=e;return t(vu,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),n(r(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),n(r(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,o){return i(e,3),n(r(t,o),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,o){return i(e,3),n(r(t,o),e)}});function i(e,t){const n=Array.isArray(e)?wr(e):e.size();if(n.length>2)throw new RangeError(`Vector must be of dimensions 1x${t}`);if(2===n.length&&1!==n[1])throw new RangeError(`Vector must be of dimensions 1x${t}`);if(n[0]!==t)throw new RangeError(`Vector must be of dimensions 1x${t}`)}}),Eu="rotationMatrix",Au=de(Eu,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],e=>{let{typed:t,config:n,multiplyScalar:r,addScalar:i,unaryMinus:o,norm:a,BigNumber:s,matrix:u,DenseMatrix:c,SparseMatrix:l,cos:f,sin:p}=e;return t(Eu,{"":function(){return"Matrix"===n.matrix?u([]):[]},string:function(e){return u(e)},"number | BigNumber | Complex | Unit":function(e){return m(e,"Matrix"===n.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 n=u(t);return d(n),x(e,n,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){d(t);const r=t.storage()||("Matrix"===n.matrix?"dense":void 0);return x(e,t,r)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,n){const r=u(t);return d(r),x(e,r,n)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,n){return d(t),x(e,t,n)}});function m(e,t){const n=g(e)?new s(-1):-1,i=f(e),o=p(e);return y([[i,r(n,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)=>r(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,n){const r=a(t);if(0===r)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])/r):t.get([0])/r,d=u?new u(t.get([1])/r):t.get([1])/r,x=u?new u(t.get([2])/r):t.get([2])/r,b=f(e),w=i(c,o(b)),v=p(e);return y([[i(b,h([m,m,w])),i(h([m,d,w]),h([l,x,v])),i(h([m,x,w]),h([d,v]))],[i(h([m,d,w]),h([x,v])),i(b,h([d,d,w])),i(h([d,x,w]),h([l,m,v]))],[i(h([m,x,w]),h([l,d,v])),i(h([d,x,w]),h([m,v])),i(b,h([x,x,w]))]],n)}}),Su=de("row",["typed","Index","matrix","range"],e=>{let{typed:t,Index:n,matrix:r,range:i}=e;return t("row",{"Matrix, number":o,"Array, number":function(e,t){return o(r(ae(e)),t).valueOf()}});function o(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");Ar(t,e.size()[0]);const o=i(0,e.size()[1]),a=new n([t],o),s=e.subset(a);return E(s)?s:r([[s]])}}),Mu="size",Cu=de(Mu,["typed"],e=>{let{typed:t}=e;return t(Mu,{Matrix:e=>e.size(),Array:wr,string:e=>[e.length],"number | Complex | BigNumber | Unit | boolean | null":e=>[]})}),Tu="squeeze",Bu=de(Tu,["typed"],e=>{let{typed:t}=e;return t(Tu,{Array:function(e){return Dr(ae(e))},Matrix:function(e){const t=Dr(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return ae(e)}})}),Fu="subset",Du=de(Fu,["typed","matrix","zeros","add"],e=>{let{typed:t,matrix:n,zeros:r,add:i}=e;return t(Fu,{"Matrix, Index":function(e,t){return Sr(t)?n():(Er(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",function(e){return function(t,r){const i=e(n(t),r);return r.isScalar()?i:i.valueOf()}}),"Object, Index":zu,"string, Index":Ou,"Matrix, Index, any, any":function(e,t,n,o){return Sr(t)?e:(Er(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 n=t.size();if(!n.every(e=>e>0))return e;try{return i(e,r(n))}catch(t){return e}}(n,t),o))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,r,i,o){const a=e(n(t),r,i,o);return a.isMatrix?a.valueOf():a}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,r,i){return e(n(t),r,i,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,n,r){return e(t,n,r,void 0)}}),"string, Index, string":_u,"string, Index, string, string":_u,"Object, Index, any":Iu})});function Ou(e,t){if(!T(t))throw new TypeError("Index expected");if(Sr(t))return"";if(Er(Array.from(e),t),1!==t.size().length)throw new xr(t.size().length,1);const n=e.length;Ar(t.min()[0],n),Ar(t.max()[0],n);const r=t.dimension(0);let i="";function o(t){i+=e.charAt(t)}return Number.isInteger(r)?o(r):r.forEach(o),i}function _u(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(Sr(t))return e;if(Er(Array.from(e),t),1!==t.size().length)throw new xr(t.size().length,1);if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";const i=t.dimension(0);if((Number.isInteger(i)?1:i.size()[0])!==n.length)throw new xr(i.size()[0],n.length);const o=e.length;Ar(t.min()[0]),Ar(t.max()[0]);const a=[];for(let t=0;to)for(let e=o-1,t=a.length;e{let{typed:t,matrix:n}=e;return t(qu,{Array:e=>r(n(e)).valueOf(),Matrix:r,any:ae});function r(e){const t=e.size();let n;switch(t.length){case 1:n=e.clone();break;case 2:{const r=t[0],i=t[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+pr(t)+")");switch(e.storage()){case"dense":n=function(e,t,n){const r=e._data,i=[];let o;for(let e=0;e{let{typed:t,transpose:n,conj:r}=e;return t(Ru,{any:function(e){return r(n(e))}})}),Uu="zeros",ju=de(Uu,["typed","config","matrix","BigNumber"],e=>{let{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(Uu,{"":function(){return"Array"===n.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"===n.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 n=function(e){let t=!1;return e.forEach(function(e,n,r){g(e)&&(t=!0,r[n]=e.toNumber())}),t}(e),o=n?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 n=r(t);return e.length>0?n.resize(e,o):n}{const t=[];return e.length>0?Mr(t,e,o):t}}}),Lu=de("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],e=>{let{typed:t,matrix:n,addScalar:r,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=wr(e);return 1===t.length?g(e,t[0]):h(e.map(e=>d(e,t.slice(1))),0)}function h(e,t){const n=wr(e);if(0!==t)return new Array(n[0]).fill(0).map((n,r)=>h(e[r],t-1));if(1===n.length)return g(e);function r(e){const t=wr(e);return new Array(t[1]).fill(0).map((n,r)=>new Array(t[0]).fill(0).map((t,n)=>e[n][r]))}return r(h(r(e),1))}function g(e){const t=e.length;if(1===t)return[e[0]];if(t%2==0){const n=[...g(e.filter((e,t)=>t%2==0)),...g(e.filter((e,t)=>t%2==1))];for(let e=0;ei(e[o],r[t-1+o])),...new Array(h-t).fill(0)],x=[...new Array(t+t-1).fill(0).map((e,t)=>o(1,r[t])),...new Array(h-(t+t-1)).fill(0)],b=g(y),w=g(x),v=new Array(h).fill(0).map((e,t)=>i(b[t],w[t])),N=c(l(d(l(v))),h),E=[];for(let e=t-1;e{let{typed:t,fft:n,dotDivide:r,conj:i}=e;return t($u,{"Array | Matrix":function(e){const t=E(e)?e.size():wr(e);return r(i(n(i(e))),t.reduce((e,t)=>e*t,1))}})}),Gu=de("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],e=>{let{typed:t,add:n,subtract:r,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(w))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');const b=m[0],v=m[1],N=f(v,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,v,A,M,S].filter(e=>void 0!==e);if(!C.every(E)&&!C.every(w))throw new Error('Inconsistent type of "t" dependant variables');const T=x.tol?x.tol:1e-4,B=x.minDelta?x.minDelta:.2,F=x.maxDelta?x.maxDelta:5,D=x.maxIter?x.maxIter:1e4,O=[b,v,...h,S,M].some(g),[_,z,I,q]=O?[d(e.a),d(e.c),d(e.b),d(e.bp)]:[e.a,e.c,e.b,e.bp];let k=A?N?A:y(A):o(r(v,b),1);const R=[b],P=[h],U=r(I,q);let j=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=n(e,o);return t(a,i)?r(i,e):o}}(N);for(;$(R[j],v);){const e=[];k=H(R[j],v,k),e.push(t(R[j],P[j]));for(let r=1;rw(e)?e.value:e)));r1/4&&(R.push(n(R[j],k)),P.push(n(P[j],i(k,I,e))),j++);let o=.84*(T/r)**.2;if(p(o,B)?o=B:f(o,F)&&(o=F),o=O?d(o):o,k=i(k,o),S&&f(u(k),S)?k=N?S:y(S):M&&p(u(k),M)&&(k=N?M:y(M)),L++,L>D)throw new Error("Maximum number of iterations reached, try changing options")}return{t:R,y:P}}}function b(e,t,n,r){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,n,r)}function v(e,t,n,r){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,n,r)}function N(e,t,n,r){const i=r.method?r.method:"RK45",o={RK23:b,RK45:v};if(i.toUpperCase()in o){const a={...r};return delete a.method,o[i.toUpperCase()](e,t,n,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,n,r){const i=N(e,t.toArray(),n.toArray(),r);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,n)=>N(e,t,n,{}),"function, Matrix, Matrix":(e,t,n)=>A(e,t,n,{}),"function, Array, number | BigNumber | Unit":(e,t,n)=>{const r=N(e,t,[n],{});return{t:r.t,y:r.y.map(e=>e[0])}},"function, Matrix, number | BigNumber | Unit":(e,t,n)=>{const r=N(e,t.toArray(),[n],{});return{t:m(r.t),y:m(r.y.map(e=>e[0]))}},"function, Array, number | BigNumber | Unit, Object":(e,t,n,r)=>{const i=N(e,t,[n],r);return{t:i.t,y:i.y.map(e=>e[0])}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,n,r)=>{const i=N(e,t.toArray(),[n],r);return{t:m(i.t),y:m(i.y.map(e=>e[0]))}}})}),Zu=de("erf",["typed"],e=>{let{typed:t}=e;return t("name",{number:function(e){const t=Math.abs(e);return t>=Xu?be(e):t<=Vu?be(e)*function(e){const t=e*e;let n,r=Yu[0][4]*t,i=t;for(n=0;n<3;n+=1)r=(r+Yu[0][n])*t,i=(i+Ju[0][n])*t;return e*(r+Yu[0][3])/(i+Ju[0][3])}(t):t<=4?be(e)*(1-function(e){let t,n=Yu[1][8]*e,r=e;for(t=0;t<7;t+=1)n=(n+Yu[1][t])*e,r=(r+Ju[1][t])*e;const i=(n+Yu[1][7])/(r+Ju[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,n=1/(e*e),r=Yu[2][5]*n,i=n;for(t=0;t<4;t+=1)r=(r+Yu[2][t])*n,i=(i+Ju[2][t])*n;let o=n*(r+Yu[2][4])/(i+Ju[2][4]);o=(Wu-o)/e,n=parseInt(16*e)/16;const a=(e-n)*(e+n);return Math.exp(-n*n)*Math.exp(-a)*o}(t))},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Vu=.46875,Wu=.5641895835477563,Yu=[[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]],Ju=[[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]],Xu=Math.pow(2,53),Qu="zeta",Ku=de(Qu,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isBounded","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],e=>{let{typed:t,config:n,multiply:r,pow:i,divide:o,factorial:a,equal:s,smallerEq:u,isBounded:c,isNegative:l,gamma:f,sin:p,subtract:m,add:d,Complex:h,BigNumber:g,pi:y}=e;return t(Qu,{number:e=>x(e,e=>e,()=>20),BigNumber:e=>x(e,e=>new g(e),()=>Math.abs(Math.log10(n.relTol))),Complex:function(e){return 0===e.re&&0===e.im?new h(-.5):1===e.re?new h(NaN,NaN):e.re===1/0&&0===e.im?new h(1):e.im===1/0||e.re===-1/0?new h(NaN,NaN):b(e,e=>e,e=>Math.round(19.5+.9*Math.abs(e.im)),e=>e.re)}});function x(e,t,n){return s(e,0)?t(-.5):s(e,1)?t(NaN):c(e)?b(e,t,n,e=>e):l(e)?t(NaN):t(1)}function b(e,t,n,a){const s=n(e);if(a(e)>-(s-1)/2)return function(e,t,n){const a=o(1,r(w(n(0),t),m(1,i(2,m(1,e)))));let s=n(0);for(let a=n(1);u(a,t);a=d(a,1))s=d(s,o(r((-1)**(a-1),w(a,t)),i(a,e)));return r(a,s)}(e,t(s),t);{let s=r(i(2,e),i(t(y),m(e,1)));return s=r(s,p(r(o(t(y),2),e))),s=r(s,f(m(1,e))),r(s,b(m(1,e),t,n,a))}}function w(e,t){let n=e;for(let s=e;u(s,t);s=d(s,1)){const e=o(r(a(d(t,m(s,1))),i(4,s)),r(a(m(t,s)),a(r(2,s))));n=d(n,e)}return r(t,n)}}),ec="mode",tc=de(ec,["typed","isNaN","isNumeric"],e=>{let{typed:t,isNaN:n,isNumeric:r}=e;return t(ec,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=Ir(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 nc(e,t,n){let r;return String(e).includes("Unexpected type")?(r=arguments.length>2?" (type: "+oe(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):String(e).includes("complex numbers")?(r=arguments.length>2?" (type: "+oe(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}const rc="prod",ic=de(rc,["typed","config","multiplyScalar","numeric"],e=>{let{typed:t,config:n,multiplyScalar:r,numeric:i}=e;return t(rc,{"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(si(e,function(e){try{t=void 0===t?e:r(t,e)}catch(t){throw nc(t,"prod",e)}}),"string"==typeof t&&(t=i(t,xe(t,n))),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}}),oc="format",ac=de(oc,["typed"],e=>{let{typed:t}=e;return t(oc,{any:pr,"any, Object | function | number | BigNumber":pr})}),sc=de("bin",["typed","format"],e=>{let{typed:t,format:n}=e;return t("bin",{"number | BigNumber":function(e){return n(e,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"bin",wordSize:t})}})}),uc=de("oct",["typed","format"],e=>{let{typed:t,format:n}=e;return t("oct",{"number | BigNumber":function(e){return n(e,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"oct",wordSize:t})}})}),cc=de("hex",["typed","format"],e=>{let{typed:t,format:n}=e;return t("hex",{"number | BigNumber":function(e){return n(e,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:"hex",wordSize:t})}})}),lc=/\$([\w.]+)/g,fc="print",pc=de(fc,["typed"],e=>{let{typed:t}=e;return t(fc,{"string, Object | Array":mc,"string, Object | Array, number | Object":mc})});function mc(e,t,n){return e.replace(lc,function(e,r){const i=r.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?v(o)?o:pr(o,n):e})}const dc=de("to",["typed","matrix","concat"],e=>{let{typed:t,matrix:n,concat:r}=e;return t("to",{"Unit, Unit | string":(e,t)=>e.to(t)},ga({typed:t,matrix:n,concat:r})({Ds:!0}))}),hc="toBest",gc=de(hc,["typed"],e=>{let{typed:t}=e;return t(hc,{Unit:e=>e.toBest(),"Unit, string":(e,t)=>e.toBest(t.split(",")),"Unit, string, Object":(e,t,n)=>e.toBest(t.split(","),n),"Unit, Array":(e,t)=>e.toBest(t),"Unit, Array, Object":(e,t,n)=>e.toBest(t,n)})}),yc="isPrime",xc=de(yc,["typed"],e=>{let{typed:t}=e;return t(yc,{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,n){let r=1;for(;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(n)):(t=t.sub(1),r=e.mul(r).mod(n));return r}const n=e.constructor.clone({precision:2*e.toFixed(0).length});let r=0,i=(e=new n(e)).sub(1);for(;i.mod(2).eq(0);)i=i.div(2),r+=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=>ui(t,e))})}),bc=de("numeric",["number","?bignumber","?fraction"],e=>{let{number:t,bignumber:n,fraction:r}=e;const i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:e=>t(e),BigNumber:n?e=>n(e):du,bigint:e=>BigInt(e),Fraction:r?e=>r(e):hu};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 n=oe(e);if(!(n in i))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; 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===n?e:o[t](e)}}),wc="divideScalar",vc=de(wc,["typed","numeric"],e=>{let{typed:t,numeric:n}=e;return t(wc,{"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)})}),Nc=de("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],e=>{let{typed:t,config:n,identity:r,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||n.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 r=e.pow(t);if(null!=r)return r;if(n.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(n.predictable&&!ye(t)&&e<0)try{const n=u(t),r=s(n);if((t===r||Math.abs((t-r)/t)<1e-14)&&n.d%2n==1n)return(n.n%2n==0n?1:-1)*Math.pow(-e,t)}catch(e){}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:ye(t)||e>=0||n.predictable?Co(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 n=wr(e);if(2!==n.length)throw new Error("For A^b, A must be 2 dimensional (A has "+n.length+" dimensions)");if(n[0]!==n[1])throw new Error("For A^b, A must be square (size is "+n[0]+"x"+n[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=r(n[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))}}),Ec="Number of decimals in function round must be an integer",Ac="round",Sc=de(Ac,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{let{typed:t,config:n,matrix:r,equalScalar:i,zeros:o,BigNumber:a,DenseMatrix:s}=e;const u=$o({typed:t,equalScalar:i}),c=Ho({typed:t,DenseMatrix:s}),l=Go({typed:t});function f(e){return Math.abs(Te(e).exponent)}return t(Ac,{number:function(e){const t=To(e,f(n.relTol));return To(_e(e,t,n.relTol,n.absTol)?t:e)},"number, number":function(e,t){const r=f(n.relTol);if(t>=r)return To(e,t);const i=To(e,r);return To(_e(e,i,n.relTol,n.absTol)?i:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ec);return new a(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(Ec);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ec);const n=t.toNumber();return e.round(n)},BigNumber:function(e){const t=new a(e).toDecimalPlaces(f(n.relTol));return(xi(e,t,n.relTol,n.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ec);const r=f(n.relTol);if(t>=r)return e.toDecimalPlaces(t.toNumber());const i=e.toDecimalPlaces(r);return(xi(e,i,n.relTol,n.absTol)?i:e).toDecimalPlaces(t.toNumber())},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(Ec);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ec);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>e(t,n.toNumber(),r)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,n,r)=>ui(t,t=>e(t,n,r),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,n)=>e(t,0,n)),"Array | Matrix":t.referToSelf(e=>t=>ui(t,e,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>u(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>l(t,n,e,!1)),"Array, number | BigNumber":t.referToSelf(e=>(t,n)=>l(r(t),n,e,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(e=>(t,n)=>i(t,0)?o(n.size(),n.storage()):c(n,t,e,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(e=>(t,n)=>i(t,0)?o(n.size(),n.storage()):l(n,t,e,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(e=>(t,n)=>l(r(n),t,e,!0).valueOf())})}),Mc=["config","typed","typeOf","divideScalar","Complex"],Cc=Math.log(16),Tc=de("log",Mc,e=>{let{typed:t,typeOf:n,config:r,divideScalar:i,Complex:o}=e;function a(e){return e.log()}function s(e){return a(new o(e,0))}return t("log",{number:function(e){return e>=0||r.predictable?wo(e):s(e)},bigint:Ta(Cc,wo,r,s),Complex:a,BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():s(e.toNumber())},"any, any":t.referToSelf(e=>(t,r)=>{if("Fraction"===n(t)&&"Fraction"===n(r)){const e=t.log(r);if(null!==e)return e}return i(e(t),e(r))})})}),Bc="log1p",Fc=de(Bc,["typed","config","divideScalar","log","Complex"],e=>{let{typed:t,config:n,divideScalar:r,log:i,Complex:o}=e;return t(Bc,{number:function(e){return e>=-1||n.predictable?Ne(e):a(new o(e,0))},Complex:a,BigNumber:function(e){const t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():a(new o(e.toNumber(),0))},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e)),"any, any":t.referToSelf(e=>(t,n)=>r(e(t),i(n)))});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))}}),Dc="nthRoots",Oc=de(Dc,["config","typed","divideScalar","Complex"],e=>{let{typed:t,config:n,divideScalar:r,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 n="number"==typeof e;let r;(n||0===e.re||0===e.im)&&(r=n?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:n,matrix:r,pow:i,DenseMatrix:o,concat:a,SparseMatrix:s}=e;const u=pa({typed:t}),c=Ns({typed:t,SparseMatrix:s}),l=$o({typed:t,equalScalar:n}),f=Ho({typed:t,DenseMatrix:o}),p=ga({typed:t,matrix:r,concat:a}),m={};for(const e in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,e)&&(e.includes("Matrix")||e.includes("Array")||(m[e]=i.signatures[e]));const d=t(m);return t(_c,p({elop:d,SS:c,DS:u,Ss:l,sS:f}))}),Ic="dotDivide",qc=de(Ic,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat","SparseMatrix"],e=>{let{typed:t,matrix:n,equalScalar:r,divideScalar:i,DenseMatrix:o,concat:a,SparseMatrix:s}=e;const u=fa({typed:t,equalScalar:r}),c=pa({typed:t}),l=Ns({typed:t,SparseMatrix:s}),f=$o({typed:t,equalScalar:r}),p=Ho({typed:t,DenseMatrix:o}),m=ga({typed:t,matrix:n,concat:a});return t(Ic,m({elop:i,SS:l,DS:c,SD:u,Ss:f,sS:p}))});function kc(e){let{DenseMatrix:t}=e;return function(e,n,r){const i=e.size();if(2!==i.length)throw new RangeError("Matrix must be two dimensional (size: "+pr(i)+")");const o=i[0];if(o!==i[1])throw new RangeError("Matrix must be square (size: "+pr(i)+")");let a=[];if(E(n)){const e=n.size(),i=n._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:n,divideScalar:r,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=kc({DenseMatrix:s});return t(Rc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const n=(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(n))}if(a(s,0))throw new Error("Linear system cannot be solved since matrix is singular");const g=r(t,s);for(let e=0,t=c.length;e{let{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=kc({DenseMatrix:s});return t(Uc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const n=(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=n[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 n=p[t];n===e?s=f[t]:n=0;e--){const t=n[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=r(t,u);for(let t=e-1;t>=0;t--)n[t]=[o(n[t][0]||0,i(s,p[t][e]))]}f[e]=[s]}return new s({data:f,size:[c,1]})}}),Lc="lsolveAll",$c=de(Lc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e=>{let{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=kc({DenseMatrix:s});return t(Lc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const n=[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(n))}if(a(g,0))if(a(u[e],0)){if(0===s){const t=[...u];t[e]=1;for(let e=0,n=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(n(e),t).map(e=>e.valueOf())}});function c(e,t){const n=[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]}))}}),Hc="usolveAll",Gc=de(Hc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e=>{let{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:o,equalScalar:a,DenseMatrix:s}=e;const u=kc({DenseMatrix:s});return t(Hc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){const n=[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=n.length;for(let s=0;s=d;t--){const n=p[t];n===e?h=f[t]:nnew 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(n(e),t).map(e=>e.valueOf())}});function c(e,t){const n=[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=n.length;for(let s=0;s=0;n--)e[n]=o(e[n],c[n][t]);n.push(e)}}else{if(0===s)return[];n.splice(s,1),s-=1,e-=1}else{u[t]=r(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 n.map(e=>new s({data:e.map(e=>[e]),size:[l,1]}))}}),Zc=de("matAlgo08xS0Sid",["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return function(e,r,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=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==m.length)throw new xr(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=n,b=0,w=i;"string"==typeof c&&c===d&&"mixed"!==c&&(y=c,x=t.find(n,[y,y]),b=t.convert(0,y),w=t.find(i,[y,y]));const v=[],N=[],E=[],A=[],S=[];let M,C,T,B;for(let e=0;e{let{typed:t,matrix:n}=e;return{"Array, number":t.referTo("DenseMatrix, number",e=>(t,r)=>e(n(t),r).valueOf()),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",e=>(t,r)=>e(n(t),r).valueOf()),"number, Array":t.referTo("number, DenseMatrix",e=>(t,r)=>e(t,n(r)).valueOf()),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",e=>(t,r)=>e(t,n(r)).valueOf())}}),Wc="leftShift",Yc=de(Wc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:o,concat:a}=e;const s=xa({typed:t}),u=fa({typed:t,equalScalar:r}),c=Zc({typed:t,equalScalar:r}),l=wa({typed:t,DenseMatrix:o}),f=$o({typed:t,equalScalar:r}),p=Go({typed:t}),m=ga({typed:t,matrix:n,concat:a}),d=Vc({typed:t,matrix:n});return t(Wc,{"number, number":ms,"BigNumber, BigNumber":as,"bigint, bigint":(e,t)=>e<(t,n)=>r(n,0)?t.clone():f(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):l(n,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):p(n,t,e,!0))},d,m({SS:c,DS:s,SD:u}))}),Jc="rightArithShift",Xc=de(Jc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:o,concat:a}=e;const s=xa({typed:t}),u=fa({typed:t,equalScalar:r}),c=Zc({typed:t,equalScalar:r}),l=wa({typed:t,DenseMatrix:o}),f=$o({typed:t,equalScalar:r}),p=Go({typed:t}),m=ga({typed:t,matrix:n,concat:a}),d=Vc({typed:t,matrix:n});return t(Jc,{"number, number":ds,"BigNumber, BigNumber":ss,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():f(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):l(n,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):p(n,t,e,!0))},d,m({SS:c,DS:s,SD:u}))}),Qc="rightLogShift",Kc=de(Qc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:o,concat:a}=e;const s=xa({typed:t}),u=fa({typed:t,equalScalar:r}),c=Zc({typed:t,equalScalar:r}),l=wa({typed:t,DenseMatrix:o}),f=$o({typed:t,equalScalar:r}),p=Go({typed:t}),m=ga({typed:t,matrix:n,concat:a}),d=Vc({typed:t,matrix:n});return t(Qc,{"number, number":hs,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():f(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():p(t,n,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):l(n,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):p(n,t,e,!0))},d,m({SS:c,DS:s,SD:u}))}),el=de("and",["typed","matrix","equalScalar","zeros","not","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,not:o,concat:a}=e;const s=fa({typed:t,equalScalar:r}),u=Ma({typed:t,equalScalar:r}),c=$o({typed:t,equalScalar:r}),l=Go({typed:t}),f=ga({typed:t,matrix:n,concat:a});return t("and",{"number, number":zs,"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":zs,"Unit, Unit":t.referToSelf(e=>(t,n)=>e(t.value||0,n.value||0)),"SparseMatrix, any":t.referToSelf(e=>(t,n)=>o(n)?i(t.size(),t.storage()):c(t,n,e,!1)),"DenseMatrix, any":t.referToSelf(e=>(t,n)=>o(n)?i(t.size(),t.storage()):l(t,n,e,!1)),"any, SparseMatrix":t.referToSelf(e=>(t,n)=>o(t)?i(t.size(),t.storage()):c(n,t,e,!0)),"any, DenseMatrix":t.referToSelf(e=>(t,n)=>o(t)?i(t.size(),t.storage()):l(n,t,e,!0)),"Array, any":t.referToSelf(e=>(t,r)=>e(n(t),r).valueOf()),"any, Array":t.referToSelf(e=>(t,r)=>e(t,n(r)).valueOf())},f({SS:u,DS:s}))}),tl="compare",nl=de(tl,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],e=>{let{typed:t,config:n,equalScalar:r,matrix:i,BigNumber:o,Fraction:a,DenseMatrix:s,concat:u}=e;const c=pa({typed:t}),l=ma({typed:t,equalScalar:r}),f=Ho({typed:t,DenseMatrix:s}),p=ga({typed:t,matrix:i,concat:u}),m=ki({typed:t});return t(tl,rl({typed:t,config:n}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return xi(e,t,n.relTol,n.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}))}),rl=de(tl,["typed","config"],e=>{let{typed:t,config:n}=e;return t(tl,{"number, number":function(e,t){return _e(e,t,n.relTol,n.absTol)?0:e>t?1:-1}})});var il=n(880);const ol="compareNatural",al=de(ol,["typed","compare"],e=>{let{typed:t,compare:n}=e;const r=n.signatures["boolean,boolean"];return t(ol,{"any, any":function e(t,a){const s=oe(t),u=oe(a);let c;if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s&&"bigint"!==s||"number"!==u&&"BigNumber"!==u&&"Fraction"!==u&&"bigint"!==u))return c=n(t,a),"0"!==c.toString()?c>0?1:-1:il(s,u);const l=["Array","DenseMatrix","SparseMatrix"];if(l.includes(s)||l.includes(u))return c=i(e,t,a),0!==c?c:il(s,u);if(s!==u)return il(s,u);if("Complex"===s)return function(e,t){return e.re>t.re?1:e.ret.im?1:e.imn.length?1:t.length{let{typed:t,matrix:n,concat:r}=e;const i=ga({typed:t,matrix:n,concat:r});return t(sl,yr,i({elop:yr,Ds:!0}))}),ll="equal",fl=de(ll,["typed","matrix","equalScalar","DenseMatrix","SparseMatrix"],e=>{let{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o,SparseMatrix:a}=e;const s=pa({typed:t}),u=Ns({typed:t,SparseMatrix:a}),c=Ho({typed:t,DenseMatrix:i}),l=ga({typed:t,matrix:n});return t(ll,pl({typed:t,equalScalar:r}),l({elop:r,SS:u,DS:s,Ss:c}))}),pl=de(ll,["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return t(ll,{"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:n(e,t)}})}),ml="equalText",dl=de(ml,["typed","compareText","isZero"],e=>{let{typed:t,compareText:n,isZero:r}=e;return t(ml,{"any, any":function(e,t){return r(n(e,t))}})}),hl="smaller",gl=de(hl,["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],e=>{let{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:o,concat:a,SparseMatrix:s}=e;const u=pa({typed:t}),c=Ns({typed:t,SparseMatrix:s}),l=Ho({typed:t,DenseMatrix:o}),f=ga({typed:t,matrix:i,concat:a}),p=ki({typed:t});function m(e,t){return e.lt(t)&&!xi(e,t,n.relTol,n.absTol)}return t(hl,yl({typed:t,config:n}),{"boolean, boolean":(e,t)=>ee-1===e.compare(t),"Fraction, BigNumber":function(e,t){return m(r(e),t)},"BigNumber, Fraction":function(e,t){return m(e,r(t))},"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},p,f({SS:c,DS:u,Ss:l}))}),yl=de(hl,["typed","config"],e=>{let{typed:t,config:n}=e;return t(hl,{"number, number":function(e,t){return e{let{typed:t,config:n,matrix:r,DenseMatrix:i,concat:o,SparseMatrix:a}=e;const s=pa({typed:t}),u=Ns({typed:t,SparseMatrix:a}),c=Ho({typed:t,DenseMatrix:i}),l=ga({typed:t,matrix:r,concat:o}),f=ki({typed:t});return t(xl,wl({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||xi(e,t,n.relTol,n.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")}},f,l({SS:u,DS:s,Ss:c}))}),wl=de(xl,["typed","config"],e=>{let{typed:t,config:n}=e;return t(xl,{"number, number":function(e,t){return e<=t||_e(e,t,n.relTol,n.absTol)}})}),vl="larger",Nl=de(vl,["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],e=>{let{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:o,concat:a,SparseMatrix:s}=e;const u=pa({typed:t}),c=Ns({typed:t,SparseMatrix:s}),l=Ho({typed:t,DenseMatrix:o}),f=ga({typed:t,matrix:i,concat:a}),p=ki({typed:t});function m(e,t){return e.gt(t)&&!xi(e,t,n.relTol,n.absTol)}return t(vl,El({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":m,"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>1===e.compare(t),"Fraction, BigNumber":function(e,t){return m(r(e),t)},"BigNumber, Fraction":function(e,t){return m(e,r(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,f({SS:c,DS:u,Ss:l}))}),El=de(vl,["typed","config"],e=>{let{typed:t,config:n}=e;return t(vl,{"number, number":function(e,t){return e>t&&!_e(e,t,n.relTol,n.absTol)}})}),Al="largerEq",Sl=de(Al,["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],e=>{let{typed:t,config:n,matrix:r,DenseMatrix:i,concat:o,SparseMatrix:a}=e;const s=pa({typed:t}),u=Ns({typed:t,SparseMatrix:a}),c=Ho({typed:t,DenseMatrix:i}),l=ga({typed:t,matrix:r,concat:o}),f=ki({typed:t});return t(Al,Ml({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||xi(e,t,n.relTol,n.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")}},f,l({SS:u,DS:s,Ss:c}))}),Ml=de(Al,["typed","config"],e=>{let{typed:t,config:n}=e;return t(Al,{"number, number":function(e,t){return e>=t||_e(e,t,n.relTol,n.absTol)}})}),Cl="deepEqual",Tl=de(Cl,["typed","equal"],e=>{let{typed:t,equal:n}=e;return t(Cl,{"any, any":function(e,t){return r(e.valueOf(),t.valueOf())}});function r(e,t){if(Array.isArray(e)){if(Array.isArray(t)){const n=e.length;if(n!==t.length)return!1;for(let i=0;i{let{typed:t,config:n,equalScalar:r,matrix:i,DenseMatrix:o,concat:a,SparseMatrix:s}=e;const u=pa({typed:t}),c=Ns({typed:t,SparseMatrix:s}),l=Ho({typed:t,DenseMatrix:o}),f=ga({typed:t,matrix:i,concat:a});return t(Bl,Dl({typed:t,equalScalar:r}),f({elop:function(e,t){return!r(e,t)},SS:c,DS:u,Ss:l}))}),Dl=de(Bl,["typed","equalScalar"],e=>{let{typed:t,equalScalar:n}=e;return t(Bl,{"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:!n(e,t)}})}),Ol="partitionSelect",_l=de(Ol,["typed","isNumeric","isNaN","compare"],e=>{let{typed:t,isNumeric:n,isNaN:r,compare:i}=e;const o=i,a=(e,t)=>-i(e,t);return t(Ol,{"Array | Matrix, number":function(e,t){return s(e,t,o)},"Array | Matrix, number, string":function(e,t,n){if("asc"===n)return s(e,t,o);if("desc"===n)return s(e,t,a);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(e,t,n){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,n)}if(Array.isArray(e))return u(e,t,n)}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[r];e[r]=e[n],e[n]=t,--r}else++n;i(e[n],s)>0&&--n,t<=n?a=n:o=n+1}return e[t]}}),zl="sort",Il=de(zl,["typed","matrix","compare","compareNatural"],e=>{let{typed:t,matrix:n,compare:r,compareNatural:i}=e;const o=r,a=(e,t)=>-r(e,t);return t(zl,{Array:function(e){return u(e),e.sort(o)},Matrix:function(e){return c(e),n(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),n(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),n(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!==wr(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}}),ql=de("max",["typed","config","numeric","larger","isNaN"],e=>{let{typed:t,config:n,numeric:r,larger:i,isNaN:o}=e;return t("max",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){return ci(e,t.valueOf(),a)},"...":function(e){if(ai(e))throw new TypeError("Scalar values expected in function max");return s(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw nc(e,"max",t)}}function s(e){let t;if(si(e,function(e){try{(o(e)||void 0===t||i(e,t))&&(t=e)}catch(t){throw nc(t,"max",e)}}),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=r(t,xe(t,n))),t}}),kl=de("min",["typed","config","numeric","smaller","isNaN"],e=>{let{typed:t,config:n,numeric:r,smaller:i,isNaN:o}=e;return t("min",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){return ci(e,t.valueOf(),a)},"...":function(e){if(ai(e))throw new TypeError("Scalar values expected in function min");return s(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw nc(e,"min",t)}}function s(e){let t;if(si(e,function(e){try{(o(e)||void 0===t||i(e,t))&&(t=e)}catch(t){throw nc(t,"min",e)}}),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=r(t,xe(t,n))),t}}),Rl=de("ImmutableDenseMatrix",["smaller","DenseMatrix"],e=>{let{smaller:t,DenseMatrix:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!v(t))throw new Error("Invalid datatype: "+t);if(E(e)||N(e)){const r=new n(e,t);this._data=r._data,this._size=r._size,this._datatype=r._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 r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(e){switch(arguments.length){case 1:{const t=n.prototype.subset.call(this,e);return E(t)?new r({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")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:ae(this._data),size:ae(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(null===this._min){let e=null;this.forEach(function(n){(null===e||t(n,e))&&(e=n)}),this._min=null!==e?e:void 0}return this._min},r.prototype.max=function(){if(null===this._max){let e=null;this.forEach(function(n){(null===e||t(e,n))&&(e=n)}),this._max=null!==e?e:void 0}return this._max},r},{isClass:!0}),Pl=de("Index",["ImmutableDenseMatrix","getMatrixDataType"],e=>{let{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(){if(!(this instanceof r))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(n)}),t}const jl=de("FibonacciHeap",["smaller","larger"],e=>{let{smaller:t,larger:n}=e;const r=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,n){t.left.right=t.right,t.right.left=t.left,n.degree--,n.child===t&&(n.child=t.right),0===n.degree&&(n.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 n=t.parent;n&&(t.mark?(o(e,t,n),a(n)):t.mark=!0)}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,n){const r={key:e,value:n,degree:0};if(this._minimum){const n=this._minimum;r.left=n,r.right=n.right,n.right=r,r.right.left=r,t(e,n.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},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)*r)+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(n(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 n=0;n{let{addScalar:t,equalScalar:n,FibonacciHeap:r}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new r}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 n=this._heap.insert(e,t);this._values[e]=n}},i.prototype.get=function(e){const t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,n){let r=this._values[e];r?r.value=t(r.value,n):(r=this._heap.insert(e,n),this._values[e]=r)},i.prototype.forEach=function(e,t,r){const i=this._heap,o=this._values,a=[];let s=i.extractMinimum();for(s&&a.push(s);s&&s.key<=t;)s.key>=e&&(n(s.value,0)||r(s.key,s.value,this)),s=i.extractMinimum(),s&&a.push(s);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};return n=null==n?Number.POSITIVE_INFINITY:n,t=null==t?JSON.stringify:t,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:$l(n||Number.POSITIVE_INFINITY)});const i=[];for(let e=0;e{let{on:t,config:n,addScalar:r,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,v=!1,N=!0;function E(e,t){if(!(this instanceof E))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=v,this.skipAutomaticSimplification=N,void 0===t)this.units=[],this.dimensions=P.map(e=>0);else if("string"==typeof t){const e=E.parse(t);this.units=e.units,this.dimensions=e.dimensions}else{if(!w(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=>sr({},e))}this.value=this._normalize(e)}let A,S,M;function C(){for(;" "===M||"\t"===M;)B()}function T(e){return e>="0"&&e<="9"}function B(){S++,M=A.charAt(S)}function F(e){S=e,M=A.charAt(S)}function D(){let e="";const t=S;if("+"===M?B():"-"===M&&(e+=M,B()),!function(e){return e>="0"&&e<="9"||"."===e}(M))return F(t),null;if("."===M){if(e+=M,B(),!T(M))return F(t),null}else{for(;T(M);)e+=M,B();"."===M&&(e+=M,B())}for(;T(M);)e+=M,B();if("E"===M||"e"===M){let t="";const n=S;if(t+=M,B(),"+"!==M&&"-"!==M||(t+=M,B()),!T(M))return F(n),e;for(e+=t;T(M);)e+=M,B()}return e}function O(){let e="";for(;T(M)||E.isValidAlpha(M);)e+=M,B();const t=e.charAt(0);return E.isValidAlpha(t)?e:null}function _(e){return M===e?(B(),e):null}Object.defineProperty(E,"name",{value:"Unit"}),E.prototype.constructor=E,E.prototype.type="Unit",E.prototype.isUnit=!0,E.parse=function(e,t){if(t=t||{},A=e,S=-1,M="","string"!=typeof A)throw new TypeError("Invalid argument in Unit.parse, string expected");const r=new E;r.units=[];let i=1,o=!1;B(),C();const a=D();let s=null;if(a){if("BigNumber"===n.number)s=new g(a);else if("Fraction"===n.number)try{s=new y(a)}catch(e){s=parseFloat(a)}else s=parseFloat(a);C(),_("*")?(i=1,o=!0):_("/")&&(i=-1,o=!0)}const u=[];let c=1;for(;;){for(C();"("===M;)u.push(i),c*=i,i=1,B(),C();let t;if(!M)break;{const e=M;if(t=O(),null===t)throw new SyntaxError('Unexpected "'+e+'" in "'+A+'" at index '+S.toString())}const n=z(t);if(null===n)throw new SyntaxError('Unit "'+t+'" not found.');let a=i*c;if(C(),_("^")){C();const t=D();if(null===t)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');a*=t}r.units.push({unit:n.unit,prefix:n.prefix,power:a});for(let e=0;e1||Math.abs(this.units[0].power-1)>1e-15)},E.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;let t=e;const n=E._getNumberConverter(oe(e));for(let e=0;e{if(me(L,e)){const t=L[e];return{unit:t,prefix:t.prefixes[""]}}for(const t in L)if(me(L,t)&&fr(e,t)){const n=L[t],r=e.length-t.length,i=e.substring(0,r),o=me(n.prefixes,i)?n.prefixes[i]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null},{hasher:e=>e[0],limit:100});function I(e){return e.equalBase(U.NONE)&&null!==e.value&&!n.predictable?e.value:e}function q(e){return E._getNumberConverter(oe(e))(1)}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.skipAutomaticSimplification||null===e.value?e.clone():e.simplify();!function(e){let t=!1;void 0!==e.value&&null!==e.value&&x(e.value)&&(t=Math.abs(e.value.re)<1e-14);for(const n in e.units)me(e.units,n)&&e.units[n].unit&&("VA"===e.units[n].unit.name&&t?e.units[n].unit=L.VAR:"VAR"!==e.units[n].unit.name||t||(e.units[n].unit=L.VA))}(n),function(e,t){1!==e.units.length||e.fixPrefix||Math.abs(e.units[0].power-Math.round(e.units[0].power))<1e-14&&(e.units[0].prefix=e._bestPrefix(t))}(n,t.offset);const r=n._denormalize(n.value),i=null!==n.value?m(r,t||{}):"",o=n.formatUnits();return{simp:n,valueStr:i,unitStr:o}}E.isValuelessUnit=function(e){return null!==z(e)},E.prototype.hasBase=function(e){if("string"==typeof e&&(e=U[e]),!e)return!1;for(let t=0;t1e-12)return!1;return!0},E.prototype.equalBase=function(e){for(let t=0;t1e-12)return!1;return!0},E.prototype.equals=function(e){return this.equalBase(e)&&f(this.value,e.value)},E.prototype.multiply=function(e){const t=this.clone(),n=w(e)?e:new E(e);for(let e=0;e0?this.formatUnits():null,fixPrefix:this.fixPrefix,skipSimp:this.skipAutomaticSimplification}},E.fromJSON=function(e){var t,n,r;const i=new E(e.value,null!==(t=e.unit)&&void 0!==t?t:void 0);return i.fixPrefix=null!==(n=e.fixPrefix)&&void 0!==n?n:v,i.skipAutomaticSimplification=null!==(r=e.skipSimp)&&void 0!==r?r:N,i},E.prototype.valueOf=E.prototype.toString,E.prototype.simplify=function(){const e=this.clone(),t=[];let n;for(const t in Z)if(me(Z,t)&&e.hasBase(U[t])){n=t;break}if("NONE"===n)e.units=[];else{let r;if(n&&me(Z,n)&&(r=Z[n]),r)e.units=[{unit:r.unit,prefix:r.prefix,power:1}];else{let n=!1;for(let r=0;r1e-12&&(me(Z,i)?t.push({unit:Z[i].unit,prefix:Z[i].prefix,power:e.dimensions[r]||0}):n=!0)}t.length1e-12){if(!me(G.si,r))throw new Error("Cannot express custom unit "+r+" in SI units");t.push({unit:G.si[r].unit,prefix:G.si[r].prefix,power:e.dimensions[n]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},E.prototype.formatUnits=function(){let e="",t="",n=0,r=0;for(let t=0;t0?(n++,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&&r++;if(r>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),n>1&&r>0&&(e="("+e+")"),r>1&&n>0&&(t="("+t+")");let i=e;return n>0&&r>0&&(i+=" / "),i+=t,i},E.prototype.toBest=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&!Array.isArray(e))throw new Error("Invalid unit type. Expected string or Unit.");const n=this.units[0].unit.prefixes;if(e&&e.length>0){const t=e.map(e=>{let t=null;if("string"==typeof e){if(t=E.parse(e),!t)throw new Error("Invalid unit type. Expected compatible string or Unit.")}else if(!w(e))throw new Error("Invalid unit type. Expected compatible string or Unit.");null===t&&(t=e.clone());try{return this.to(t.formatUnits()),t}catch(e){throw new Error("Invalid unit type. Expected compatible string or Unit.")}}).map(e=>e.units[0].prefix);this.units[0].unit.prefixes=t.reduce((e,t)=>(e[t.name]=t,e),{}),this.units[0].prefix=t[0]}const r=k(this,t).simp;return this.units[0].unit.prefixes=n,r.fixPrefix=!0,r},E.prototype.format=function(e){const{simp:t,valueStr:n,unitStr:r}=k(this,e);let i=n;return t.value&&x(t.value)&&(i="("+i+")"),r.length>0&&i.length>0&&(i+=" "),i+=r,i},E.prototype._bestPrefix=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.2;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 t=null!==this.value?u(this.value):0,n=u(this.units[0].unit.value);let r=this.units[0].prefix;if(0===t)return r;const i=this.units[0].power;let o=Math.log(t/Math.pow(r.value*n,i))/Math.LN10-e;if(o>-2.200001&&o<1.800001)return r;o=Math.abs(o);const a=this.units[0].unit.prefixes;for(const s in a)if(me(a,s)){const u=a[s];if(u.scientific){const a=Math.abs(Math.log(t/Math.pow(u.value*n,i))/Math.LN10-e);(a0)},L={meter:{name:"meter",base:U.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:R.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:R.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:R.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:R.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:R.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:R.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:R.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:R.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:R.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:R.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:R.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:R.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:R.NONE,value:.238480942392,offset:0},g:{name:"g",base:U.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:R.NONE,value:604800,offset:0},month:{name:"month",base:U.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:R.SHORT,value:new y(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:R.SHORT,value:new y(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:R.LONG,value:new y(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:R.LONG,value:new y(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:R.SHORT,value:h.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},$={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 H(e){if("BigNumber"===e.number){const e=Vl(g);L.rad.value=new g(1),L.deg.value=e.div(180),L.grad.value=e.div(200),L.cycle.value=e.times(2),L.arcsec.value=e.div(648e3),L.arcmin.value=e.div(10800)}else L.rad.value=1,L.deg.value=Math.PI/180,L.grad.value=Math.PI/200,L.cycle.value=2*Math.PI,L.arcsec.value=Math.PI/648e3,L.arcmin.value=Math.PI/10800;L.radian.value=L.rad.value,L.degree.value=L.deg.value,L.gradian.value=L.grad.value}H(n),t&&t("config",function(e,t){e.number!==t.number&&H(e)});const G={si:{NONE:{unit:j,prefix:R.NONE[""]},LENGTH:{unit:L.m,prefix:R.SHORT[""]},MASS:{unit:L.g,prefix:R.SHORT.k},TIME:{unit:L.s,prefix:R.SHORT[""]},CURRENT:{unit:L.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:L.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:L.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:L.mol,prefix:R.SHORT[""]},ANGLE:{unit:L.rad,prefix:R.SHORT[""]},BIT:{unit:L.bits,prefix:R.SHORT[""]},FORCE:{unit:L.N,prefix:R.SHORT[""]},ENERGY:{unit:L.J,prefix:R.SHORT[""]},POWER:{unit:L.W,prefix:R.SHORT[""]},PRESSURE:{unit:L.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:L.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:L.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:L.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:L.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:L.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:L.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:L.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:L.T,prefix:R.SHORT[""]},FREQUENCY:{unit:L.Hz,prefix:R.SHORT[""]}}};G.cgs=JSON.parse(JSON.stringify(G.si)),G.cgs.LENGTH={unit:L.m,prefix:R.SHORT.c},G.cgs.MASS={unit:L.g,prefix:R.SHORT[""]},G.cgs.FORCE={unit:L.dyn,prefix:R.SHORT[""]},G.cgs.ENERGY={unit:L.erg,prefix:R.NONE[""]},G.us=JSON.parse(JSON.stringify(G.si)),G.us.LENGTH={unit:L.ft,prefix:R.NONE[""]},G.us.MASS={unit:L.lbm,prefix:R.NONE[""]},G.us.TEMPERATURE={unit:L.degF,prefix:R.NONE[""]},G.us.FORCE={unit:L.lbf,prefix:R.NONE[""]},G.us.ENERGY={unit:L.BTU,prefix:R.BTU[""]},G.us.POWER={unit:L.hp,prefix:R.NONE[""]},G.us.PRESSURE={unit:L.psi,prefix:R.NONE[""]},G.auto=JSON.parse(JSON.stringify(G.si));let Z=G.auto;E.setUnitSystem=function(e){if(!me(G,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(G).join(", "));Z=G[e]},E.getUnitSystem=function(){for(const e in G)if(me(G,e)&&G[e]===Z)return e},E.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new g(String(e.n)).div(String(e.d)).times(String(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}},E.prototype._numberConverter=function(){const e=E.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},E._getNumberConverter=function(e){if(!E.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return E.typeConverters[e]};for(const e in L)if(me(L,e)){const t=L[e];t.dimensions=t.base.dimensions}for(const e in $)if(me($,e)){const t=L[$[e]],n={};for(const e in t)me(t,e)&&(n[e]=t[e]);n.name=e,L[e]=n}return E.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},E.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)&&E.deleteUnit(t),e[t].aliases)for(let n=0;n0&&!E.isValidAlpha(M)&&!T(M))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);let n,r,i,o=null,a=[],s=0;if(t&&"Unit"===t.type)o=t.clone();else if("string"==typeof t)""!==t&&(n=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');n=t.definition,r=t.prefixes,s=t.offset,i=t.baseName,t.aliases&&(a=t.aliases.valueOf())}if(a)for(let e=0;e1e-12){n=!1;break}if(n){t=!0,u.base=U[e];break}}if(!t){i=i||e+"_STUFF";const t={dimensions:o.dimensions.slice(0)};t.key=i,U[i]=t,Z[i]={unit:u,prefix:R.NONE[""]},u.base=U[i]}}else{if(i=i||e+"_STUFF",P.indexOf(i)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');P.push(i);for(const e in U)me(U,e)&&(U[e].dimensions[P.length-1]=0);const t={dimensions:[]};for(let e=0;e{let{typed:t,Unit:n}=e;return t(Xl,{Unit:function(e){return e.clone()},string:function(e){return n.isValuelessUnit(e)?new n(null,e):n.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new n(e,t)},"number | BigNumber | Fraction":function(e){return new n(e)},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),Kl="sparse",ef=de(Kl,["typed","SparseMatrix"],e=>{let{typed:t,SparseMatrix:n}=e;return t(Kl,{"":function(){return new n([])},string:function(e){return new n([],e)},"Array | Matrix":function(e){return new n(e)},"Array | Matrix, string":function(e,t){return new n(e,t)}})}),tf="createUnit",nf=de(tf,["typed","Unit"],e=>{let{typed:t,Unit:n}=e;return t(tf,{"Object, Object":function(e,t){return n.createUnit(e,t)},Object:function(e){return n.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){const i={};return i[e]=t,n.createUnit(i,r)},"string, Unit | string | Object":function(e,t){const r={};return r[e]=t,n.createUnit(r,{})},string:function(e){const t={};return t[e]={},n.createUnit(t,{})}})}),rf="acos",of=de(rf,["typed","config","Complex"],e=>{let{typed:t,config:n,Complex:r}=e;return t(rf,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.acos(e):new r(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})}),af="number";function sf(e){return ze(e)}function uf(e){return Math.atan(1/e)}function cf(e){return Number.isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function lf(e){return Math.asin(1/e)}function ff(e){const t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function pf(e){return Math.acos(1/e)}function mf(e){const t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}function df(e){return Ie(e)}function hf(e){return qe(e)}function gf(e){return 1/Math.tan(e)}function yf(e){const t=Math.exp(2*e);return(t+1)/(t-1)}function xf(e){return 1/Math.sin(e)}function bf(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*be(e)}function wf(e){return 1/Math.cos(e)}function vf(e){return 2/(Math.exp(e)+Math.exp(-e))}function Nf(e){return Re(e)}sf.signature=af,uf.signature=af,cf.signature=af,lf.signature=af,ff.signature=af,pf.signature=af,mf.signature=af,df.signature=af,hf.signature=af,gf.signature=af,yf.signature=af,xf.signature=af,bf.signature=af,wf.signature=af,vf.signature=af,Nf.signature=af;const Ef="acosh",Af=de(Ef,["typed","config","Complex"],e=>{let{typed:t,config:n,Complex:r}=e;return t(Ef,{number:function(e){return e>=1||n.predictable?sf(e):e<=-1?new r(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})}),Sf="acot",Mf=de(Sf,["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t(Sf,{number:uf,Complex:function(e){return e.acot()},BigNumber:function(e){return new n(1).div(e).atan()}})}),Cf="acoth",Tf=de(Cf,["typed","config","Complex","BigNumber"],e=>{let{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Cf,{number:function(e){return e>=1||e<=-1||n.predictable?cf(e):new r(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})}),Bf="acsc",Ff=de(Bf,["typed","config","Complex","BigNumber"],e=>{let{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Bf,{number:function(e){return e<=-1||e>=1||n.predictable?lf(e):new r(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})}),Df="acsch",Of=de(Df,["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t(Df,{number:ff,Complex:function(e){return e.acsch()},BigNumber:function(e){return new n(1).div(e).asinh()}})}),_f="asec",zf=de(_f,["typed","config","Complex","BigNumber"],e=>{let{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(_f,{number:function(e){return e<=-1||e>=1||n.predictable?pf(e):new r(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})}),If="asech",qf=de(If,["typed","config","Complex","BigNumber"],e=>{let{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(If,{number:function(e){if(e<=1&&e>=-1||n.predictable){const t=1/e;if(t>0||n.predictable)return mf(e);const i=Math.sqrt(t*t-1);return new r(Math.log(i-t),Math.PI)}return new r(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})}),kf="asin",Rf=de(kf,["typed","config","Complex"],e=>{let{typed:t,config:n,Complex:r}=e;return t(kf,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.asin(e):new r(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})}),Pf=de("asinh",["typed"],e=>{let{typed:t}=e;return t("asinh",{number:df,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})}),Uf=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()}})}),jf="atan2",Lf=de(jf,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:o,concat:a}=e;const s=fa({typed:t,equalScalar:r}),u=pa({typed:t}),c=Xa({typed:t,equalScalar:r}),l=$o({typed:t,equalScalar:r}),f=Ho({typed:t,DenseMatrix:o}),p=ga({typed:t,matrix:n,concat:a});return t(jf,{"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}))}),$f="atanh",Hf=de($f,["typed","config","Complex"],e=>{let{typed:t,config:n,Complex:r}=e;return t($f,{number:function(e){return e<=1&&e>=-1||n.predictable?hf(e):new r(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})}),Gf=de("trigUnit",["typed"],e=>{let{typed:t}=e;return{Unit:t.referToSelf(e=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,n.valueType())(n.value)})}}),Zf=de("cos",["typed"],e=>{let{typed:t}=e;const n=Gf({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},n)}),Vf="cosh",Wf=de(Vf,["typed"],e=>{let{typed:t}=e;return t(Vf,{number:ke,"Complex | BigNumber":e=>e.cosh()})}),Yf=de("cot",["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t("cot",{number:gf,Complex:e=>e.cot(),BigNumber:e=>new n(1).div(e.tan())},Gf({typed:t}))}),Jf="coth",Xf=de(Jf,["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t(Jf,{number:yf,Complex:e=>e.coth(),BigNumber:e=>new n(1).div(e.tanh())})}),Qf=de("csc",["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t("csc",{number:xf,Complex:e=>e.csc(),BigNumber:e=>new n(1).div(e.sin())},Gf({typed:t}))}),Kf="csch",ep=de(Kf,["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t(Kf,{number:bf,Complex:e=>e.csch(),BigNumber:e=>new n(1).div(e.sinh())})}),tp=de("sec",["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t("sec",{number:wf,Complex:e=>e.sec(),BigNumber:e=>new n(1).div(e.cos())},Gf({typed:t}))}),np="sech",rp=de(np,["typed","BigNumber"],e=>{let{typed:t,BigNumber:n}=e;return t(np,{number:vf,Complex:e=>e.sech(),BigNumber:e=>new n(1).div(e.cosh())})}),ip=de("sin",["typed"],e=>{let{typed:t}=e;const n=Gf({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},n)}),op="sinh",ap=de(op,["typed"],e=>{let{typed:t}=e;return t(op,{number:Nf,"Complex | BigNumber":e=>e.sinh()})}),sp=de("tan",["typed"],e=>{let{typed:t}=e;const n=Gf({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},n)}),up=de("tanh",["typed"],e=>{let{typed:t}=e;return t("tanh",{number:Pe,"Complex | BigNumber":e=>e.tanh()})}),cp="setCartesian",lp=de(cp,["typed","size","subset","compareNatural","Index","DenseMatrix"],e=>{let{typed:t,size:n,subset:r,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(cp,{"Array | Matrix, Array | Matrix":function(e,t){let s=[];if(0!==r(n(e),new o(0))&&0!==r(n(t),new o(0))){const n=Ir(Array.isArray(e)?e:e.toArray()).sort(i),r=Ir(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(let e=0;e{let{typed:t,size:n,subset:r,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(fp,{"Array | Matrix, Array | Matrix":function(e,t){let s;if(0===r(n(e),new o(0)))s=[];else{if(0===r(n(t),new o(0)))return Ir(e.toArray());{const n=jr(Ir(Array.isArray(e)?e:e.toArray()).sort(i)),r=jr(Ir(Array.isArray(t)?t:t.toArray()).sort(i));let o;s=[];for(let e=0;e{let{typed:t,size:n,subset:r,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(mp,{"Array | Matrix":function(e){let t;if(0===r(n(e),new o(0)))t=[];else{const n=Ir(Array.isArray(e)?e:e.toArray()).sort(i);t=[],t.push(n[0]);for(let e=1;e{let{typed:t,size:n,subset:r,compareNatural:i,Index:o,DenseMatrix:a}=e;return t(hp,{"Array | Matrix, Array | Matrix":function(e,t){let s;if(0===r(n(e),new o(0))||0===r(n(t),new o(0)))s=[];else{const n=jr(Ir(Array.isArray(e)?e:e.toArray()).sort(i)),r=jr(Ir(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(let e=0;e{let{typed:t,size:n,subset:r,compareNatural:i,Index:o}=e;return t(yp,{"Array | Matrix, Array | Matrix":function(e,t){if(0===r(n(e),new o(0)))return!0;if(0===r(n(t),new o(0)))return!1;const a=jr(Ir(Array.isArray(e)?e:e.toArray()).sort(i)),s=jr(Ir(Array.isArray(t)?t:t.toArray()).sort(i));let u;for(let e=0;e{let{typed:t,size:n,subset:r,compareNatural:i,Index:o}=e;return t(bp,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===r(n(t),new o(0)))return 0;const a=Ir(Array.isArray(t)?t:t.toArray());let s=0;for(let t=0;t{let{typed:t,size:n,subset:r,compareNatural:i,Index:o}=e;return t(vp,{"Array | Matrix":function(e){if(0===r(n(e),new o(0)))return[];const t=Ir(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 n=e.length-1;n>0;n--)for(let r=0;re[r+1].length&&(t=e[r],e[r]=e[r+1],e[r+1]=t);return e}(s)}});function a(e,t){const n=[];for(let r=0;r{let{typed:t,compareNatural:n}=e;return t(Ep,{"Array | Matrix":function(e){return Array.isArray(e)?Ir(e).length:Ir(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?Ir(e).length:Ir(e.toArray()).length;{const t=Ir(Array.isArray(e)?e:e.toArray()).sort(n);let r=1;for(let e=1;e{let{typed:t,size:n,concat:r,subset:i,setDifference:o,Index:a}=e;return t(Sp,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(n(e),new a(0)))return Ir(t);if(0===i(n(t),new a(0)))return Ir(e);const s=Ir(e),u=Ir(t);return r(o(s,u),o(u,s))}})}),Cp="setUnion",Tp=de(Cp,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],e=>{let{typed:t,size:n,concat:r,subset:i,setIntersect:o,setSymDifference:a,Index:s}=e;return t(Cp,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(n(e),new s(0)))return Ir(t);if(0===i(n(t),new s(0)))return Ir(e);const u=Ir(e),c=Ir(t);return r(a(u,c),o(u,c))}})}),Bp=de("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],e=>{let{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:o,SparseMatrix:a,concat:s}=e;const u=xa({typed:t}),c=ba({typed:t,equalScalar:i}),l=wa({typed:t,DenseMatrix:o}),f=ga({typed:t,matrix:n,concat:s});return t("add",{"any, any":r,"any, any, ...any":t.referToSelf(e=>(t,n,r)=>{let i=e(t,n);for(let t=0;t{let{typed:t,abs:n,addScalar:r,divideScalar:i,multiplyScalar:o,sqrt:a,smaller:s,isPositive:u}=e;return t(Fp,{"... number | BigNumber":c,Array:c,Matrix:e=>c(Ir(e.toArray(),!0))});function c(e){let t=0,c=0;for(let a=0;a{let{typed:t,abs:n,add:r,pow:i,conj:o,sqrt:a,multiply:s,equalScalar:u,larger:c,smaller:l,matrix:f,ctranspose:p,eigs:m}=e;return t(Op,{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 r=n(e);c(r,t)&&(t=r)},!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){let t;return e.forEach(function(e){const r=n(e);t&&!l(r,t)||(t=r)},!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=r(i(n(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=r(t[a]||0,n(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=r(t[a]||0,n(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,n){t=r(t,s(e,o(e)))}),n(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 r=p(e),i=s(r,e),o=m(i).values.toArray(),u=o[o.length-1];return n(a(u))}(e);throw new Error("Unsupported parameter value "+t)}(e,t);throw new RangeError("Invalid matrix dimensions")}}}),zp=de("dot",["typed","addScalar","multiplyScalar","conj","size"],e=>{let{typed:t,addScalar:n,multiplyScalar:r,conj:i,size:o}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,s){const u=a(e,s),c=E(e)?e._data:e,l=E(e)?e._datatype||e.getDataType():void 0,f=E(s)?s._data:s,p=E(s)?s._datatype||s.getDataType():void 0,m=2===o(e).length,d=2===o(s).length;let h=n,g=r;if(l&&p&&l===p&&"string"==typeof l&&"mixed"!==l){const e=l;h=t.find(n,[e,e]),g=t.find(r,[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 n=o(e),r=o(t);let i,a;if(1===n.length)i=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(", ")+")");i=n[0]}if(1===r.length)a=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(", ")+")");a=r[0]}if(i!==a)throw new RangeError("Vectors must have equal length ("+i+" != "+a+")");if(0===i)throw new RangeError("Cannot calculate the dot product of empty vectors");return i}}),Ip=de("trace",["typed","matrix","add"],e=>{let{typed:t,matrix:n,add:r}=e;return t("trace",{Array:function(e){return i(n(e))},SparseMatrix:function(e){const t=e._values,n=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: "+pr(o)+")")},DenseMatrix:i,any:ae});function i(e){const t=e._size,n=e._data;switch(t.length){case 1:if(1===t[0])return ae(n[0]);throw new RangeError("Matrix must be square (size: "+pr(t)+")");case 2:{const e=t[0];if(e===t[1]){let t=0;for(let i=0;i{let{typed:t,Index:n}=e;return t(qp,{"...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}),r=new n;return n.apply(r,t),r}})}),Rp=new Set(["end"]),Pp=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,{}),n={};return{evaluate:function(t){const r=d(t);return function(e){for(const t of[...Rp])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(r),e(r,n,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,n){t.forEach(function(t,r,i){n(t,r,i),e(t,n)})}(this,e)}transform(e){return function t(n,r,i){const o=e(n,r,i);return o!==n?o:n.map(t)}(this,null,null)}filter(e){const t=[];return this.traverse(function(n,r,i){e(n,r,i)&&t.push(n)}),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 Up(e){return Up="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},Up(e)}function jp(e,t,n){return(t=function(e){var t=function(e){if("object"!=Up(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Up(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Up(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lp(e){return e&&e.isIndexError?new br(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function $p(e){let{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"==typeof e.subset)return e.subset(n);if("string"==typeof e)return t(e,n);if("object"==typeof e){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return i(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw Lp(e)}}}const Hp="AccessorNode",Gp=de(Hp,["subset","Node"],e=>{let{subset:t,Node:n}=e;const r=$p({subset:t});function o(e){return!(j(e)||L(e)||Z(e)||Y(e)||Q(e)||ee(e)||re(e))}class a extends n{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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,this.optionalChaining=n}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Hp}get isAccessorNode(){return!0}_compile(e,t){const n=this.object._compile(e,t),o=this.index._compile(e,t),a=this.optionalChaining,s=j(this.object)&&this.object.optionalChaining;if(this.index.isObjectProperty()){const e=this.index.getObjectProperty();return function(t,r,o){const u=o||{},c=n(t,r,u);if(a&&null==c)u.optionalShortCircuit=!0;else if(!s||null==u||!u.optionalShortCircuit)return i(c,e)}}return function(e,t,i){const u=i||{},c=n(e,t,u);if(a&&null==c)return void(u.optionalShortCircuit=!0);if(s&&null!=u&&u.optionalShortCircuit)return;const l=o(e,t,c);return r(c,l)}}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)),this.optionalChaining)}clone(){return new a(this.object,this.index,this.optionalChaining)}_toString(e){let t=this.object.toString(e);return o(this.object)&&(t="("+t+")"),t+(this.optionalChaining?this.index.dotNotation?"?":"?.":"")+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:Hp,object:this.object,index:this.index,optionalChaining:this.optionalChaining}}static fromJSON(e){return new a(e.object,e.index,e.optionalChaining)}}return jp(a,"name",Hp),a},{isClass:!0,isNode:!0}),Zp="ArrayNode",Vp=de(Zp,["Node"],e=>{let{Node:t}=e;class n 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 Zp}get isArrayNode(){return!0}_compile(e,t){const n=qr(this.items,function(n){return n._compile(e,t)});if("Array"!==e.config.matrix){const t=e.matrix;return function(e,r,i){return t(qr(n,function(t){return t(e,r,i)}))}}return function(e,t,r){return qr(n,function(n){return n(e,t,r)})}}forEach(e){for(let t=0;t['+this.items.map(function(t){return t.toHTML(e)}).join(',')+']'}_toTex(e){return function t(n,r){const i=n.some(L)&&!n.every(L),o=r||i,a=o?"&":"\\\\",s=n.map(function(n){return n.items?t(n.items,!r):n.toTex(e)}).join(a);return i||!o||o&&!r?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}(this.items,!1)}}return jp(n,"name",Zp),n},{isClass:!0,isNode:!0}),Wp=[{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:nullish":{op:"??",associativity:"left",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Yp(e,t){if(!t||"auto"!==t)return e;let n=e;for(;ee(n);)n=n.content;return n}function Jp(e,t,n,r){let i=e;"keep"!==t&&(i=e.getContent());const o=i.getIdentifier();let a=null;for(let e=0;e{let{subset:t,matrix:n,Node:r}=e;const a=$p({subset:t}),s=function(e){let{subset:t,matrix:n}=e;return function(e,r,i){try{if(Array.isArray(e))return n(e).subset(r,i).valueOf().forEach((t,n)=>{e[n]=t}),e;if(e&&"function"==typeof e.subset)return e.subset(r,i);if("string"==typeof e)return t(e,r,i);if("object"==typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return o(e,r.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw Lp(e)}}}({subset:t,matrix:n});function u(e,t,n){t||(t="keep");const r=Jp(e,t,n),i=Jp(e.value,t,n);return"all"===t||null!==i&&i<=r}class c extends r{constructor(e,t,n){if(super(),this.object=e,this.index=n?t:null,this.value=n||t,!re(e)&&!j(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(re(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 Kp}get isAssignmentNode(){return!0}_compile(e,t){const n=this.object._compile(e,t),r=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,r,i){const a=n(t,r,i),s=u(t,r,i);return o(a,e,s),s}}if(re(this.object))return function(e,t,i){const o=n(e,t,i),a=u(e,t,i),l=r(e,t,o);return e.set(c,s(o,l,a)),a};{const n=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){const e=this.object.index.getObjectProperty();return function(t,a,c){const l=n(t,a,c),f=i(l,e),p=r(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=n(e,t,o),l=i(e,t,c),f=a(c,l),p=r(e,t,f),m=u(e,t,o);return s(c,l,s(f,p,m)),m}}}}if(!re(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){const r=u(e,t,n);return e.set(c,r),r}}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)),n=this.index?this._ifNode(e(this.index,"index",this)):null,r=this._ifNode(e(this.value,"value",this));return new c(t,n,r)}clone(){return new c(this.object,this.index,this.value)}_toString(e){const t=this.object.toString(e),n=this.index?this.index.toString(e):"";let r=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(r="("+r+")"),t+n+" = "+r}toJSON(){return{mathjs:Kp,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),n=this.index?this.index.toHTML(e):"";let r=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(r='('+r+')'),t+n+'='+r}_toTex(e){const t=this.object.toTex(e),n=this.index?this.index.toTex(e):"";let r=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(r=`\\left(${r}\\right)`),t+n+"="+r}}return jp(c,"name",Kp),c},{isClass:!0,isNode:!0}),tm="BlockNode",nm=de(tm,["ResultSet","Node"],e=>{let{ResultSet:t,Node:n}=e;class r extends n{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map(function(e){const t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!X(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}})}get type(){return tm}get isBlockNode(){return!0}_compile(e,n){const r=qr(this.blocks,function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}});return function(e,n,i){const o=[];return kr(r,function(t){const r=t.evaluate(e,n,i);t.visible&&o.push(r)}),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 jp(r,"name",tm),r},{isClass:!0,isNode:!0}),rm="ConditionalNode",im=de(rm,["Node"],e=>{let{Node:t}=e;class n extends t{constructor(e,t,n){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(n))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=n}get type(){return rm}get isConditionalNode(){return!0}_compile(e,t){const n=this.condition._compile(e,t),r=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(w(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+oe(e)+'"')}(n(e,t,o))?r(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 n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=Jp(this,t,e&&e.implicit);let r=this.condition.toString(e);const i=Jp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=n)&&(r="("+r+")");let o=this.trueExpr.toString(e);const a=Jp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=n)&&(o="("+o+")");let s=this.falseExpr.toString(e);const u=Jp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=n)&&(s="("+s+")"),r+" ? "+o+" : "+s}toJSON(){return{mathjs:rm,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new n(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=Jp(this,t,e&&e.implicit);let r=this.condition.toHTML(e);const i=Jp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=n)&&(r='('+r+')');let o=this.trueExpr.toHTML(e);const a=Jp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=n)&&(o='('+o+')');let s=this.falseExpr.toHTML(e);const u=Jp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=n)&&(s='('+s+')'),r+'?'+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 jp(n,"name",rm),n},{isClass:!0,isNode:!0});var om=n(144);const am={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{?}"},sm={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"},um={abs:{1:"\\left|${args[0]}\\right|"},add:{2:`\\left(\${args[0]}${sm.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]}${sm.dotDivide}\${args[1]}\\right)`},dotMultiply:{2:`\\left(\${args[0]}${sm.dotMultiply}\${args[1]}\\right)`},dotPow:{2:`\\left(\${args[0]}${sm.dotPow}\${args[1]}\\right)`},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:`\\left(e${sm.pow}{\${args[0]}}-1\\right)`,fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},fraction:{2:"\\frac{${args[0]}}{${args[1]}}"},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]}${sm.mod}\${args[1]}\\right)`},multiply:{2:`\\left(\${args[0]}${sm.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)${sm.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]}${sm.subtract}\${args[1]}\\right)`},unaryMinus:{1:`${sm.unaryMinus}\\left(\${args[0]}\\right)`},unaryPlus:{1:`${sm.unaryPlus}\\left(\${args[0]}\\right)`},bitAnd:{2:`\\left(\${args[0]}${sm.bitAnd}\${args[1]}\\right)`},bitNot:{1:sm.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:`\\left(\${args[0]}${sm.bitOr}\${args[1]}\\right)`},bitXor:{2:`\\left(\${args[0]}${sm.bitXor}\${args[1]}\\right)`},leftShift:{2:`\\left(\${args[0]}${sm.leftShift}\${args[1]}\\right)`},rightArithShift:{2:`\\left(\${args[0]}${sm.rightArithShift}\${args[1]}\\right)`},rightLogShift:{2:`\\left(\${args[0]}${sm.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]}${sm.and}\${args[1]}\\right)`},not:{1:sm.not+"\\left(${args[0]}\\right)"},or:{2:`\\left(\${args[0]}${sm.or}\${args[1]}\\right)`},xor:{2:`\\left(\${args[0]}${sm.xor}\${args[1]}\\right)`},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:`\\left(\${args[0]}\\right)${sm.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]}}${sm.pow}{\\frac{1}{2}}`},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:`\\left(\${args[0]}\\right)${sm.transpose}`},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:`\\left(\${args[0]}\\right)${sm.factorial}`},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:`\\left(\${args[0]}${sm.equal}\${args[1]}\\right)`},larger:{2:`\\left(\${args[0]}${sm.larger}\${args[1]}\\right)`},largerEq:{2:`\\left(\${args[0]}${sm.largerEq}\${args[1]}\\right)`},smaller:{2:`\\left(\${args[0]}${sm.smaller}\${args[1]}\\right)`},smallerEq:{2:`\\left(\${args[0]}${sm.smallerEq}\${args[1]}\\right)`},unequal:{2:`\\left(\${args[0]}${sm.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]}${sm.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)+${am.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)"}},cm={deg:"^\\circ"};function lm(e){return om(e,{preserveFormatting:!0})}function fm(e,t){return(t=void 0!==t&&t)?me(cm,e)?cm[e]:"\\mathrm{"+lm(e)+"}":me(am,e)?am[e]:lm(e)}const pm="ConstantNode",mm=de(pm,["Node","isBounded"],e=>{let{Node:t,isBounded:n}=e;class r extends t{constructor(e){super(),this.value=e}get type(){return pm}get isConstantNode(){return!0}_compile(e,t){const n=this.value;return function(){return n}}forEach(e){}map(e){return this.clone()}clone(){return new r(this.value)}_toString(e){return pr(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:pm,value:this.value}}static fromJSON(e){return new r(e.value)}_toTex(e){const t=this._toString(e);switch(oe(this.value)){case"string":return"\\mathtt{"+lm(t)+"}";case"number":case"BigNumber":{if(!n(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 jp(r,"name",pm),r},{isClass:!0,isNode:!0}),dm="FunctionAssignmentNode",hm=de(dm,["typed","Node"],e=>{let{typed:t,Node:n}=e;function r(e,t,n){const r=Jp(e,t,n),i=Jp(e.expr,t,n);return"all"===t||null!==i&&i<=r}class i extends n{constructor(e,t,n){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(n))throw new TypeError('Node expected for parameter "expr"');if(Rp.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');const r=new Set;for(const e of t){const t="string"==typeof e?e:e.name;if(r.has(t))throw new Error(`Duplicate parameter name "${t}"`);r.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=n}get type(){return dm}get isFunctionAssignmentNode(){return!0}_compile(e,n){const r=Object.create(n);kr(this.params,function(e){r[e]=!0});const i=this.expr,o=i._compile(e,r),a=this.name,s=this.params,u=Ur(this.types,","),c=a+"("+Ur(this.params,", ")+")";return function(e,n,r){const l={};l[u]=function(){const t=Object.create(n);for(let e=0;e'+hr(this.params[e])+"");let i=this.expr.toHTML(e);return r(this,t,e&&e.implicit)&&(i='('+i+')'),''+hr(this.name)+'('+n.join(',')+')='+i}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep";let n=this.expr.toTex(e);return r(this,t,e&&e.implicit)&&(n=`\\left(${n}\\right)`),"\\mathrm{"+this.name+"}\\left("+this.params.map(fm).join(",")+"\\right)="+n}}return jp(i,"name",dm),i},{isClass:!0,isNode:!0}),gm="IndexNode",ym=de(gm,["Node","size"],e=>{let{Node:t,size:n}=e;class r 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 gm}get isIndexNode(){return!0}_compile(e,t){const r=qr(this.dimensions,function(r,i){if(r.filter(e=>e.isSymbolNode&&"end"===e.name).length>0){const o=Object.create(t);o.end=!0;const a=r._compile(e,o);return function(e,t,r){if(!E(r)&&!N(r)&&!v(r))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+oe(r));const o=n(r),s=Object.create(t);return s.end=o[i],a(e,s,r)}}return r._compile(e,t)}),o=i(e,"index");return function(e,t,n){const i=qr(r,function(r){return r(e,t,n)});return o(...i)}}forEach(e){for(let t=0;t.'+hr(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 jp(r,"name",gm),r},{isClass:!0,isNode:!0}),xm="ObjectNode",bm=de(xm,["Node"],e=>{let{Node:t}=e;class n 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 xm}get isObjectNode(){return!0}_compile(e,t){const n={};for(const r in this.properties)if(me(this.properties,r)){const o=mr(r),a=JSON.parse(o),s=i(this.properties,r);n[a]=s._compile(e,t)}return function(e,t,r){const i={};for(const o in n)me(n,o)&&(i[o]=n[o](e,t,r));return i}}forEach(e){for(const t in this.properties)me(this.properties,t)&&e(this.properties[t],"properties["+mr(t)+"]",this)}map(e){const t={};for(const n in this.properties)me(this.properties,n)&&(t[n]=this._ifNode(e(this.properties[n],"properties["+mr(n)+"]",this)));return new n(t)}clone(){const e={};for(const t in this.properties)me(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)}_toString(e){const t=[];for(const n in this.properties)me(this.properties,n)&&t.push(mr(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:xm,properties:this.properties}}static fromJSON(e){return new n(e.properties)}_toHTML(e){const t=[];for(const n in this.properties)me(this.properties,n)&&t.push(''+hr(n)+':'+this.properties[n].toHTML(e));return'{'+t.join(',')+'}'}_toTex(e){const t=[];for(const n in this.properties)me(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return jp(n,"name",xm),n},{isClass:!0,isNode:!0});function wm(e,t){return new f(e,new l(t),new Set(Object.keys(t)))}const vm="OperatorNode",Nm=de(vm,["Node"],e=>{let{Node:t}=e;function n(e,t){let r=e;if("auto"===t)for(;ee(r);)r=r.content;return!!Z(r)||!!K(r)&&n(r.args[0],t)}function r(e,t,r,i,o){const a=Jp(e,t,r),s=Xp(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 n=Jp(i[0],t,r,e);if(o&&null!==n){let r,o;if("keep"===t?(r=i[0].getIdentifier(),o=e.getIdentifier()):(r=i[0].getContent().getIdentifier(),o=e.getContent().getIdentifier()),!1===Wp[a][o].latexLeftParens){u=[!1];break}if(!1===Wp[n][r].latexParens){u=[!1];break}}if(null===n){u=[!1];break}if(n<=a){u=[!0];break}u=[!1]}break;case 2:{let n;const c=Jp(i[0],t,r,e),l=Qp(e,i[0],t);let f;n=null!==c&&(c===a&&"right"===s&&!l||c=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===r)for(let e=1;e2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){const t=i.map(function(t,n){return t=t.toString(e),o[n]&&(t="("+t+")"),t});return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?t.join(" "):t.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:vm,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",n=e&&e.implicit?e.implicit:"hide",i=this.args,o=r(this,t,n,i,!1);if(1===i.length){const n=Xp(this,t);let r=i[0].toHTML(e);return o[0]&&(r='('+r+')'),"right"===n?''+hr(this.op)+""+r:r+''+hr(this.op)+""}if(2===i.length){let t=i[0].toHTML(e),r=i[1].toHTML(e);return o[0]&&(t='('+t+')'),o[1]&&(r='('+r+')'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?t+''+r:t+''+hr(this.op)+""+r}{const t=i.map(function(t,n){return t=t.toHTML(e),o[n]&&(t='('+t+')'),t});return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?t.join(''):t.join(''+hr(this.op)+""):''+hr(this.fn)+'('+t.join(',')+')'}}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",i=this.args,o=r(this,t,n,i,!0);let a=sm[this.fn];if(a=void 0===a?this.op:a,1===i.length){const n=Xp(this,t);let r=i[0].toTex(e);return o[0]&&(r=`\\left(${r}\\right)`),"right"===n?a+r:r+a}if(2===i.length){const r=i[0];let s=r.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?r.getIdentifier():r.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"===n)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,n){return t=t.toTex(e),o[n]&&(t=`\\left(${t}\\right)`),t});return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===n?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 jp(o,"name",vm),o},{isClass:!0,isNode:!0}),Em="ParenthesisNode",Am=de(Em,["Node"],e=>{let{Node:t}=e;class n extends t{constructor(e){if(super(),!X(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return Em}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 n(t)}clone(){return new n(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:Em,content:this.content}}static fromJSON(e){return new n(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 jp(n,"name",Em),n},{isClass:!0,isNode:!0}),Sm="RangeNode",Mm=de(Sm,["Node"],e=>{let{Node:t}=e;function n(e,t,n){const r=Jp(e,t,n),i={},o=Jp(e.start,t,n);if(i.start=null!==o&&o<=r||"all"===t,e.step){const o=Jp(e.step,t,n);i.step=null!==o&&o<=r||"all"===t}const a=Jp(e.end,t,n);return i.end=null!==a&&a<=r||"all"===t,i}class r extends t{constructor(e,t,n){if(super(),!X(e))throw new TypeError("Node expected");if(!X(t))throw new TypeError("Node expected");if(n&&!X(n))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=n||null}get type(){return Sm}get isRangeNode(){return!0}needsEnd(){return this.filter(function(e){return re(e)&&"end"===e.name}).length>0}_compile(e,t){const n=e.range,r=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 n(r(e,t,a),i(e,t,a),o(e,t,a))}}return function(e,t,o){return n(r(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 r(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 r(this.start,this.end,this.step&&this.step)}_toString(e){const t=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let r,i=this.start.toString(e);if(t.start&&(i="("+i+")"),r=i,this.step){let n=this.step.toString(e);t.step&&(n="("+n+")"),r+=":"+n}let o=this.end.toString(e);return t.end&&(o="("+o+")"),r+=":"+o,r}toJSON(){return{mathjs:Sm,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new r(e.start,e.end,e.step)}_toHTML(e){const t=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let r,i=this.start.toHTML(e);if(t.start&&(i='('+i+')'),r=i,this.step){let n=this.step.toHTML(e);t.step&&(n='('+n+')'),r+=':'+n}let o=this.end.toHTML(e);return t.end&&(o='('+o+')'),r+=':'+o,r}_toTex(e){const t=n(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit);let r=this.start.toTex(e);if(t.start&&(r=`\\left(${r}\\right)`),this.step){let n=this.step.toTex(e);t.step&&(n=`\\left(${n}\\right)`),r+=":"+n}let i=this.end.toTex(e);return t.end&&(i=`\\left(${i}\\right)`),r+=":"+i,r}}return jp(r,"name",Sm),r},{isClass:!0,isNode:!0}),Cm="RelationalNode",Tm=de(Cm,["Node"],e=>{let{Node:t}=e;const n={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class r 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 Cm}get isRelationalNode(){return!0}_compile(e,t){const n=this,r=this.params.map(n=>n._compile(e,t));return function(t,o,a){let s,u=r[0](t,o,a);for(let c=0;ce(t,"params["+n+"]",this),this)}map(e){return new r(this.conditionals.slice(),this.params.map((t,n)=>this._ifNode(e(t,"params["+n+"]",this)),this))}clone(){return new r(this.conditionals,this.params)}_toString(e){const t=e&&e.parenthesis?e.parenthesis:"keep",r=Jp(this,t,e&&e.implicit),i=this.params.map(function(n,i){const o=Jp(n,t,e&&e.implicit);return"all"===t||null!==o&&o<=r?"("+n.toString(e)+")":n.toString(e)});let o=i[0];for(let e=0;e('+n.toHTML(e)+')':n.toHTML(e)});let o=i[0];for(let e=0;e'+hr(n[this.conditionals[e]])+""+i[e+1];return o}_toTex(e){const t=e&&e.parenthesis?e.parenthesis:"keep",n=Jp(this,t,e&&e.implicit),r=this.params.map(function(r,i){const o=Jp(r,t,e&&e.implicit);return"all"===t||null!==o&&o<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)});let i=r[0];for(let e=0;e{let{math:t,Unit:n,Node:r}=e;function o(e){return!!n&&n.isValuelessUnit(e)}class a extends r{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 r=this.name;if(!0===t[r])return function(e,t,n){return i(t,r)};if(r in e)return function(t,n,o){return t.has(r)?t.get(r):i(e,r)};{const e=o(r);return function(t,i,o){return t.has(r)?t.get(r):e?new n(null,r):a.onUndefinedSymbol(r)}}}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=hr(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 n=!1;void 0===t[this.name]&&o(this.name)&&(n=!0);const r=fm(this.name,n);return"\\"===r[0]?r:" "+r}}return a},{isClass:!0,isNode:!0}),Fm="FunctionNode",Dm=de(Fm,["math","Node","SymbolNode"],e=>{var t;let{math:n,Node:r,SymbolNode:o}=e;const a=e=>pr(e,{truncate:78});function u(e,t,n){let r="";const i=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi;let o,a=0;for(;null!==(o=i.exec(e));)if(r+=e.substring(a,o.index),a=o.index,"$$"===o[0])r+="$",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":r+=e;break;case"object":if(X(e))r+=e.toTex(n);else{if(!Array.isArray(e))throw new TypeError("Template: "+o[1]+" has to be a Node, String or array of Nodes");r+=e.map(function(e,t){if(X(e))return e.toTex(n);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.");r+=e[o[2]].toTex(n)}}return r+=e.slice(a),r}class c extends r{constructor(e,t,n){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"');const r=typeof n;if("undefined"!==r&&"boolean"!==r)throw new TypeError("optional flag, if specified, must be boolean");this.fn=e,this.args=t||[],this.optional=!!n}get name(){return this.fn.name||""}get type(){return Fm}get isFunctionNode(){return!0}_compile(e,t){const n=this.args.map(n=>n._compile(e,t)),r=this.optional||j(this.fn)&&this.fn.optionalChaining;if(!re(this.fn)){if(j(this.fn)&&J(this.fn.index)&&this.fn.index.isObjectProperty()){const i=this.fn.object._compile(e,t),o=this.fn.index.getObjectProperty(),a=this.args;return function(t,u,c){const l=i(t,u,c);if(r&&(null==l||void 0===l[o]))return;const f=function(e,t){if(!s(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(l,o);if(null!=f&&f.rawArgs)return f(a,e,wm(t,u));{const e=n.map(e=>e(t,u,c));return f.apply(l,e)}}}{const i=this.fn.toString(),o=this.fn._compile(e,t),s=this.args;return function(t,u,c){const l=o(t,u,c);if(!r||void 0!==l){if("function"!=typeof l)throw new TypeError(`Expression '${i}' did not evaluate to a function; value is:\n ${a(l)}`);if(l.rawArgs)return l(s,e,wm(t,u));{const e=n.map(e=>e(t,u,c));return l.apply(l,e)}}}}}{const o=this.fn.name;if(t[o]){const t=this.args;return function(s,u,c){const l=i(u,o);if(!r||void 0!==l){if("function"!=typeof l)throw new TypeError(`Argument '${o}' was not a function; received: ${a(l)}`);if(l.rawArgs)return l(t,e,wm(s,u));{const e=n.map(e=>e(s,u,c));return l.apply(l,e)}}}}{const t=o in e?i(e,o):void 0,s="function"==typeof t&&!0===t.rawArgs,u=t=>{let n;if(t.has(o))n=t.get(o);else if(o in e)n=i(e,o);else{if(!r)return c.onUndefinedFunction(o);n=void 0}if("function"==typeof n||r&&void 0===n)return n;throw new TypeError(`'${o}' is not a function; its value is:\n ${a(n)}`)};if(s){const t=this.args;return function(r,i,o){const a=u(r);return!0===a.rawArgs?a(t,e,wm(r,i)):a(...n.map(e=>e(r,i,o)))}}switch(n.length){case 0:return function(e,t,n){const i=u(e);if(!r||void 0!==i)return i()};case 1:return function(e,t,i){const o=u(e);if(!r||void 0!==o)return o((0,n[0])(e,t,i))};case 2:return function(e,t,i){const o=u(e);if(r&&void 0===o)return;const a=n[0],s=n[1];return o(a(e,t,i),s(e,t,i))};default:return function(e,t,i){const o=u(e);if(!r||void 0!==o)return o(...n.map(n=>n(e,t,i)))}}}}}forEach(e){e(this.fn,"fn",this);for(let t=0;t'+hr(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 r,i;switch(um[this.name]&&(r=um[this.name]),!n[this.name]||"function"!=typeof n[this.name].toTex&&"object"!=typeof n[this.name].toTex&&"string"!=typeof n[this.name].toTex||(r=n[this.name].toTex),typeof r){case"function":i=r(this,e);break;case"string":i=u(r,this,e);break;case"object":switch(typeof r[t.length]){case"function":i=r[t.length](this,e);break;case"string":i=u(r[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,jp(c,"name",Fm),jp(c,"onUndefinedFunction",function(e){throw new Error("Undefined function "+e)}),jp(c,"fromJSON",function(e){return new t(e.fn,e.args)}),c},{isClass:!0,isNode:!0}),Om="parse",_m=de(Om,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],e=>{let{typed:t,numeric:n,config:r,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(Om,{string:function(e){return q(e,{})},"Array | Matrix":function(e){return w(e,{})},"string, Object":function(e,t){return q(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":w});function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=void 0!==t.nodes?t.nodes:{};return ui(e,function(e){if("string"!=typeof e)throw new TypeError("String expected");return q(e,n)})}const v={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,">>":!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 B(e){e.index++}function F(e){return e.expression.charAt(e.index-1)}function D(e){return e.expression.charAt(e.index+1)}function O(e){for(e.tokenType=v.NULL,e.token="",e.comment="";;){if("#"===T(e))for(;"\n"!==T(e)&&""!==T(e);)e.comment+=T(e),B(e);if(!b.isWhitespace(T(e),e.nestingLevel))break;B(e)}if(""===T(e))return void(e.tokenType=v.DELIMITER);if("\n"===T(e)&&!e.nestingLevel)return e.tokenType=v.DELIMITER,e.token=T(e),void B(e);const t=T(e),n=C(e,2),r=C(e,3);if(3===r.length&&N[r])return e.tokenType=v.DELIMITER,e.token=r,B(e),B(e),void B(e);if(2===n.length&&N[n]&&("?."!==n||!b.isDigit(e.expression.charAt(e.index+2))))return e.tokenType=v.DELIMITER,e.token=n,B(e),void B(e);if(N[t])return e.tokenType=v.DELIMITER,e.token=t,void B(e);if(b.isDigitDot(t)){e.tokenType=v.NUMBER;const t=C(e,2);if("0b"===t||"0o"===t||"0x"===t){for(e.token+=T(e),B(e),e.token+=T(e),B(e);b.isAlpha(T(e),F(e),D(e))||b.isDigit(T(e));)e.token+=T(e),B(e);if("."===T(e))for(e.token+=".",B(e);b.isAlpha(T(e),F(e),D(e))||b.isDigit(T(e));)e.token+=T(e),B(e);else if("i"===T(e))for(e.token+="i",B(e);b.isDigit(T(e));)e.token+=T(e),B(e);return}if("."===T(e)){if(e.token+=T(e),B(e),!b.isDigit(T(e)))return void(e.tokenType=v.DELIMITER)}else{for(;b.isDigit(T(e));)e.token+=T(e),B(e);b.isDecimalMark(T(e),D(e))&&(e.token+=T(e),B(e))}for(;b.isDigit(T(e));)e.token+=T(e),B(e);if("E"===T(e)||"e"===T(e))if(b.isDigit(D(e))||"-"===D(e)||"+"===D(e)){if(e.token+=T(e),B(e),"+"!==T(e)&&"-"!==T(e)||(e.token+=T(e),B(e)),!b.isDigit(T(e)))throw le(e,'Digit expected, got "'+T(e)+'"');for(;b.isDigit(T(e));)e.token+=T(e),B(e);if(b.isDecimalMark(T(e),D(e)))throw le(e,'Digit expected, got "'+T(e)+'"')}else if(b.isDecimalMark(D(e),e.expression.charAt(e.index+2)))throw B(e),le(e,'Digit expected, got "'+T(e)+'"');return}if(!b.isAlpha(T(e),F(e),D(e))){for(e.tokenType=v.UNKNOWN;""!==T(e);)e.token+=T(e),B(e);throw le(e,'Syntax error in part "'+e.token+'"')}for(;b.isAlpha(T(e),F(e),D(e))||b.isDigit(T(e));)e.token+=T(e),B(e);me(E,e.token)?e.tokenType=v.DELIMITER:e.tokenType=v.SYMBOL}function _(e){do{O(e)}while("\n"===e.token)}function z(e){e.nestingLevel++}function I(e){e.nestingLevel--}function q(e,t){const n={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:v.NULL,nestingLevel:0,conditionalLevel:null};sr(n,{expression:e,extraNodes:t}),O(n);const r=function(e){let t;const n=[];let r;for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=k(e),e.comment&&(t.comment=e.comment));"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),O(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=k(e),e.comment&&(t.comment=e.comment),r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new s(n):(t||(t=new c(void 0),e.comment&&(t.comment=e.comment)),t)}(n);if(""!==n.token)throw n.tokenType===v.DELIMITER?fe(n,"Unexpected operator "+n.token):le(n,'Unexpected part "'+n.token+'"');return r}function k(e){let t,n,r,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 n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,_(e);const r=t,i=k(e);if(":"!==e.token)throw le(e,"False part of conditional expression expected");e.conditionalLevel=null,_(e);const o=k(e);t=new u(r,i,o),e.conditionalLevel=n}return t}(e);if("="===e.token){if(re(o))return t=o.name,_(e),r=k(e),new a(new x(t),r);if(j(o)){if(o.optionalChaining)throw le(e,"Cannot assign to optional chain");return _(e),r=k(e),new a(o.object,o.index,r)}if(Y(o)&&re(o.fn)&&(i=!0,n=[],t=o.name,o.args.forEach(function(e,t){re(e)?n[t]=e.name:i=!1}),i))return _(e),r=k(e),new l(t,n,r);throw le(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=U(e);for(;"and"===e.token;)_(e),t=new d("and","and",[t,U(e)]);return t}function U(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)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};for(;me(r,e.token);){const i={name:e.token,fn:r[e.token]};n.push(i),_(e),t.push(G(e))}return 1===t.length?t[0]:2===t.length?new d(n[0].name,n[0].fn,t):new y(n.map(e=>e.fn),t)}function G(e){let t,n,r,i;t=W(e);const o={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};for(;me(o,e.token);)n=e.token,r=o[n],_(e),i=[t,W(e)],t=new d(n,r,i);return t}function W(e){let t,n,r,i;t=J(e);const o={to:"to",in:"to"};for(;me(o,e.token);)n=e.token,r=o[n],_(e),"in"===n&&"])},;".includes(e.token)?t=new d("*","multiply",[t,new x("in")],!0):(i=[t,J(e)],t=new d(n,r,i));return t}function J(e){let t;const n=[];if(":"===e.token){if(e.conditionalLevel===e.nestingLevel)throw le(e,"The true-expression of a conditional operator may not be empty");t=new c(1)}else t=X(e);if(":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(n.push(t);":"===e.token&&n.length<3;)_(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new x("end")):n.push(X(e));t=3===n.length?new g(n[0],n[2],n[1]):new g(n[0],n[1])}return t}function X(e){let t,n,r,i;t=Q(e);const o={"+":"add","-":"subtract"};for(;me(o,e.token);){n=e.token,r=o[n],_(e);const a=Q(e);i=a.isPercentage?[t,new d("*","multiply",[t,a])]:[t,a],t=new d(n,r,i)}return t}function Q(e){let t,n,r,i;t=ee(e),n=t;const o={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};for(;me(o,e.token);)r=e.token,i=o[r],_(e),n=ee(e),t=new d(r,i,[t,n]);return t}function ee(e){let t,n;for(t=te(e),n=t;e.tokenType===v.SYMBOL||"in"===e.token&&Z(t)||"in"===e.token&&K(t)&&"unaryMinus"===t.fn&&Z(t.args[0])||!(e.tokenType!==v.NUMBER||Z(n)||K(n)&&"!"!==n.op)||"("===e.token;)n=te(e),t=new d("*","multiply",[t,n],!0);return t}function te(e){let t=ne(e),n=t;const r=[];for(;"/"===e.token&&V(n);){if(r.push(sr({},e)),_(e),e.tokenType!==v.NUMBER){sr(e,r.pop());break}if(r.push(sr({},e)),_(e),e.tokenType!==v.SYMBOL&&"("!==e.token&&"in"!==e.token){r.pop(),sr(e,r.pop());break}sr(e,r.pop()),r.pop(),n=ne(e),t=new d("/","divide",[t,n])}return t}function ne(e){let t=ie(e);if("%"===e.token){const n=sr({},e);_(e);try{ie(e),sr(e,n)}catch(e){t=new d("/","divide",[t,new c(100)],!1,!0)}}return t}function ie(e){let t,n,r;const i={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return me(i,e.token)?(r=i[e.token],t=e.token,_(e),n=[ie(e)],new d(t,r,n)):function(e){let t,n,r,i;return t=function(e){let t=oe(e);for(;"??"===e.token;)_(e),t=new d("??","nullish",[t,oe(e)]);return t}(e),("^"===e.token||".^"===e.token)&&(n=e.token,r="^"===n?"pow":"dotPow",_(e),i=[t,ie(e)],t=new d(n,r,i)),t}(e)}function oe(e){let t,i,a,s;t=function(e){let t=[];if(e.tokenType===v.SYMBOL&&me(e.extraNodes,e.token)){const n=e.extraNodes[e.token];if(O(e),"("===e.token){if(t=[],z(e),O(e),")"!==e.token)for(t.push(k(e));","===e.token;)O(e),t.push(k(e));if(")"!==e.token)throw le(e,"Parenthesis ) expected");I(e),O(e)}return new n(t)}return function(e){let t,i;return e.tokenType===v.SYMBOL||e.tokenType===v.DELIMITER&&e.token in E?(i=e.token,O(e),t=me(A,i)?new c(A[i]):S.includes(i)?new c(n(i,"number")):new x(i),t=ae(e,t),t):function(e){let t,i;return'"'===e.token||"'"===e.token?(i=se(e,e.token),t=new c(i),t=ae(e,t),t):function(e){let t,i,a,s;if("["===e.token){if(z(e),O(e),"]"!==e.token){const n=ue(e);if(";"===e.token){for(a=1,i=[n];";"===e.token;)O(e),"]"!==e.token&&(i[a]=ue(e),a++);if("]"!==e.token)throw le(e,"End of matrix ] expected");I(e),O(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"},t.addConversion({from:"string",to:"Node",convert:b}),b}),zm="compile",Im=de(zm,["typed","parse"],e=>{let{typed:t,parse:n}=e;return t(zm,{string:function(e){return n(e).compile()},"Array | Matrix":function(e){return ui(e,function(e){return n(e).compile()})}})}),qm="evaluate",km=de(qm,["typed","parse"],e=>{let{typed:t,parse:n}=e;return t(qm,{string:function(e){const t=m();return n(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){const t=m();return ui(e,function(e){return n(e).compile().evaluate(t)})},"Array | Matrix, Map | Object":function(e,t){return ui(e,function(e){return n(e).compile().evaluate(t)})}})}),Rm=de("Parser",["evaluate","parse"],e=>{let{evaluate:t,parse:n}=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 n of e.keys())o(t,n,e.get(n));return t}(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(e,t){if(!function(e){if(0===e.length)return!1;for(let t=0;t0&&n.isDigit(i)))return!1}return!0}(e))throw new Error(`Invalid variable name: '${e}'. Variable names must follow the specified rules.`);return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r.prototype.toJSON=function(){const e={mathjs:"Parser",variables:{},functions:{}};for(const[t,n]of this.scope)if(O(n)){if(!Pm(n))throw new Error(`Cannot serialize external function ${t}`);e.functions[t]=`${n.syntax} = ${n.expr}`}else e.variables[t]=n;return e},r.fromJSON=function(e){const t=new r;return Object.entries(e.variables).forEach(e=>{let[n,r]=e;return t.set(n,r)}),Object.entries(e.functions).forEach(e=>{let[n,r]=e;return t.evaluate(r)}),t},r},{isClass:!0});function Pm(e){return"function"==typeof e&&"string"==typeof e.syntax&&"string"==typeof e.expr}const Um="parser",jm=de(Um,["typed","Parser"],e=>{let{typed:t,Parser:n}=e;return t(Um,{"":function(){return new n}})}),Lm=de("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],e=>{let{typed:t,matrix:n,abs:r,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],n=e._size[1],i=Math.min(t,n),s=e._values,f=e._index,d=e._ptr,h=[],g=[],y=[],x=[t,i],b=[],w=[],v=[],N=[i,n];let E,A,S;const M=[],C=[];for(E=0;E0&&e.forEach(0,A-1,function(t,n){p._forEachRow(t,h,g,y,function(r,i){r>t&&e.accumulate(r,l(a(i,n)))})});let C=A,B=e.get(A),F=r(B);e.forEach(A+1,t-1,function(e,t){const n=r(t);u(n,F)&&(C=e,F=n,B=t)}),A!==C&&(p._swapRows(A,C,x[1],h,g,y),p._swapRows(A,C,N[1],b,w,v),e.swap(A,C),T(A,C)),e.forEach(0,t-1,function(e,t){e<=A?(b.push(t),w.push(e)):(t=o(t,B),c(t,0)||(h.push(t),g.push(e)))})}return v.push(b.length),y.push(h.length),{L:new p({values:h,index:g,ptr:y,size:x}),U:new p({values:b,index:w,ptr:v,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(n(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function d(e){const t=e._size[0],n=e._size[1];let l=Math.min(t,n);const p=ae(e._data),m=[],d=[t,l],h=[],g=[l,n];let y,x,b;const w=[];for(y=0;y0)for(y=0;y{let{typed:t,matrix:n,zeros:r,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 sr(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(n(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:g});function g(e){const t=e._size[0],n=e._size[1],h=i([t],"dense"),g=h._data,y=e.clone(),x=y._data;let b,w,v;const N=r([t],"");for(v=0;v0){const e="Complex"===n[0][0].type?h(0):0;for(let t=0;t=0;){const e=n[a+s],u=n[r+e];-1===u?(s--,o[t++]=e):(n[r+e]=n[i+u],++s,n[a+s]=u)}return t}function Gm(e){return-e-2}const Zm=de("csAmd",["add","multiply","transpose"],e=>{let{add:t,multiply:n,transpose:r}=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=r(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 n=0;ns))for(const i=t[n+1];ra)n[s+p]=0,n[i+p]=-1,f++,t[p]=Gm(e),n[s+e]++;else{const e=n[u+m];-1!==e&&(c[e]=p),n[l+p]=n[u+m],n[u+m]=p}}return f}(c,d,y,N,v,E,f,x,w,S,b),H=0;for(;$e?(D=T,O=r,_=y[0+T]-e):(D=m[r++],O=d[D],_=y[0+D]),F=1;F<=_;F++)M=m[O++],(z=y[x+M])<=0||(n+=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[w+y[N+M]]=y[b+M]);D!==T&&(d[D]=Gm(T),y[E+D]=0)}for(0!==e&&(h=a),y[N+T]=n,d[T]=o,y[0+T]=a-o,y[v+T]=-2,L=i(L,l,y,E,c),I=o;I=L?y[E+D]-=z:0!==y[E+D]&&(y[E+D]=y[N+D]+e)}for(I=o;I0?(j+=e,m[P++]=D,U+=D):(d[D]=Gm(T),y[E+D]=0)}y[v+M]=P-k+1;const e=P,i=k+y[0+M];for(r=R+1;r=0))for(U=S[M],M=y[A+U],y[A+U]=-1;-1!==M&&-1!==y[b+M];M=y[b+M],L++){for(_=y[0+M],q=y[v+M],r=d[M]+1;r<=d[M]+_-1;r++)y[E+m[r]]=L;let e=M;for(C=y[b+M];-1!==C;){let t=y[0+C]===_&&y[v+C]===q;for(r=d[C]+1;t&&r<=d[C]+_-1;r++)y[E+m[r]]!==L&&(t=0);t?(d[C]=Gm(M),y[x+M]+=y[x+C],y[x+C]=0,y[v+C]=-1,C=y[b+C],y[b+e]=C):(e=C,C=y[b+C])}}for(r=o,I=o;I=0;C--)y[x+C]>0||(y[b+C]=y[w+d[C]],y[w+d[C]]=C);for(D=c;D>=0;D--)y[x+D]<=0||-1!==d[D]&&(y[b+D]=y[w+d[D]],y[w+d[D]]=D);for(T=0,M=0;M<=c;M++)-1===d[M]&&(T=Hm(M,T,y,w,b,g,E));return g.splice(g.length-1,1),g};function i(e,t,n,r,i){if(e<2||e+t<0){for(let e=0;e{let{transpose:t}=e;return function(e,n,r,i){if(!e||!n||!r)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,w=4*s,v=5*s+1;for(l=0;l=1&&N[c]++,2===e.jleaf&&N[e.q]--}-1!==n[c]&&(g[0+c]=n[c])}for(c=0;c{let{add:t,multiply:n,transpose:r}=e;const i=Zm({add:t,multiply:n,transpose:r}),o=Wm({transpose:r});return function(e,t,n){const r=t._ptr,a=t._size[1];let s;const u={};if(u.q=i(e,t),e&&!u.q)return null;if(n){const n=e?function(e,t,n){const r=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;n--)-1!==e[n]&&(o[a+n]=o[0+e[n]],o[0+e[n]]=n);for(n=0;n=0;h--)for(y=n[h],x=n[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=r[f];const t=i?i[e]:e;Jm(a,e)||(Xm(a,e),r[s+f]=t<0?0:Qm(a[t]));let p=1;for(c=r[s+f],l=t<0?0:Qm(a[t+1]);c{let{divideScalar:t,multiply:n,subtract:r}=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,w;const v=function(e,t,n,r,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[n],p=u[n+1],l=f;l{let{abs:t,divideScalar:n,multiply:r,subtract:i,larger:o,largerEq:a,SparseMatrix:s}=e;const u=ed({divideScalar:n,multiply:r,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=[],w=[],v=new s({values:x,index:b,ptr:w,size:[l,l]}),N=[];let E,A;const S=[],M=[];for(E=0;E{let{typed:t,abs:n,add:r,multiply:i,transpose:o,divideScalar:a,subtract:s,larger:u,largerEq:c,SparseMatrix:l}=e;const f=Ym({add:r,multiply:i,transpose:o}),p=td({abs:n,divideScalar:a,multiply:i,subtract:s,larger:u,largerEq:c,SparseMatrix:l});return t("slu",{"SparseMatrix, number, number":function(e,t,n){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(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");const r=f(t,e,!1),i=p(e,r,n);return{L:i.L,U:i.U,p:i.pinv,q:r.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})});function rd(e,t){let n;const r=t.length,i=[];if(e)for(n=0;n{let{typed:t,matrix:n,lup:r,slu:i,usolve:o,lsolve:a,DenseMatrix:s}=e;const u=kc({DenseMatrix:s});return t(id,{"Array, Array | Matrix":function(e,t){e=n(e);const i=r(e);return l(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){const n=r(e);return l(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){const n=r(e);return l(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,n,r){const o=i(e,n,r);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 n(e);throw new TypeError("Invalid Matrix LU decomposition")}function l(e,t,n,r,i){e=c(e),t=c(t),n&&((i=u(e,i,!0))._data=rd(n,i._data));const s=a(e,i),l=o(t,s);return r&&(l._data=rd(r,l._data)),l}}),ad="polynomialRoot",sd=de(ad,["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],e=>{let{typed:t,isZero:n,equalScalar:r,add:i,subtract:o,multiply:a,divide:s,sqrt:u,unaryMinus:c,cbrt:l,typeOf:f,im:p,re:m}=e;return t(ad,{"number|Complex, ...number|Complex":(e,t)=>{const d=[e,...t];for(;d.length>0&&n(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,n]=d,i=a(2,n),l=a(t,t),f=a(4,n,e);if(r(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,n,h]=d,g=c(a(3,h)),y=a(n,n),x=a(3,h,t),b=i(a(2,n,n,n),a(27,h,h,e)),w=a(9,h,n,t);if(r(y,x)&&r(b,w))return[s(n,g)];const v=o(y,x),N=o(b,w),E=i(a(18,h,n,t,e),a(n,n,t,t)),A=i(a(4,n,n,n,e),a(4,h,t,t,t),a(27,h,h,e,e));if(r(E,A))return[s(o(a(4,h,n,t),i(a(9,h,h,e),a(n,n,n))),a(h,v)),s(o(a(9,h,e),a(n,t)),a(2,v))];let S;return S=r(y,x)?N:s(i(N,u(o(a(N,N),a(4,v,v,v)))),2),l(S,!0).toArray().map(e=>s(i(n,e,s(v,e)),g)).map(e=>"Complex"===f(e)&&r(m(e),m(e)+p(e))?m(e):e)}default:throw new RangeError(`only implemented for cubic or lower-order polynomials, not ${d}`)}}})}),ud=de("Help",["evaluate"],e=>{let{evaluate:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){const e=this.doc||{};let n="\n";if(e.name&&(n+="Name: "+e.name+"\n\n"),e.category&&(n+="Category: "+e.category+"\n\n"),e.description&&(n+="Description:\n "+e.description+"\n\n"),e.syntax&&(n+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){n+="Examples:\n";let r=!1;const i=t("config()"),o={config:e=>(r=!0,t("config(newConfig)",{newConfig:e}))};for(let r=0;r"mathjs"!==e).forEach(n=>{t[n]=e[n]}),new n(t)},n.prototype.valueOf=n.prototype.toString,n},{isClass:!0}),cd=de("Chain",["?on","math","typed"],e=>{let{on:t,math:n,typed:r}=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 n,r};const s={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(n),t&&t("import",function(e,t,n){n||o(e,t)}),i},{isClass:!0}),ld={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"]},fd={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"]},pd={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:ld,E:ld,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:fd,PI:fd,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. Deprecated in favor of coulombConstant",examples:["coulombConstant"]},coulombConstant:{description:"Coulomb's constant",examples:["coulombConstant"]},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)","ceil(x, n)","ceil(unit, valuelessUnit)","ceil(unit, n, valuelessUnit)"],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)","ceil(3.241cm, cm)","ceil(3.241cm, 2, cm)"],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)","fix(x, n)","fix(unit, valuelessUnit)","fix(unit, n, valuelessUnit)"],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)","fix(3.241cm, cm)","fix(3.241cm, 2, cm)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)","floor(x, n)","floor(unit, valuelessUnit)","floor(unit, n, valuelessUnit)"],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)","floor(3.241cm, cm)","floor(3.241cm, 2, cm)"],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>0, -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:"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.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers","bernoulli"]},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:["parser","parse","compile"]},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:[]},parse:{name:"parse",category:"Expression",syntax:["parse(expr)","parse(expr, options)","parse([expr1, expr2, expr3, ...])","parse([expr1, expr2, expr3, ...], options)"],description:"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().",examples:['node1 = parse("sqrt(3^2 + 4^2)")',"node1.evaluate()","code1 = node1.compile()","code1.evaluate()","scope = {a: 3, b: 4}",'node2 = parse("a * b")',"node2.evaluate(scope)","code2 = node2.compile()","code2.evaluate(scope)"],seealso:["parser","evaluate","compile"]},parser:{name:"parser",category:"Expression",syntax:["parser()"],description:"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.",examples:["myParser = parser()",'myParser.evaluate("sqrt(3^2 + 4^2)")','myParser.set("x", 3)','myParser.evaluate("y = x + 3")','myParser.evaluate(["y = x + 3", "y = y + 1"])','myParser.get("y")'],seealso:["evaluate","parse","compile"]},compile:{name:"compile",category:"Expression",syntax:["compile(expr) ","compile([expr1, expr2, expr3, ...])"],description:"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.",examples:['code1 = compile("sqrt(3^2 + 4^2)")',"code1.evaluate() ",'code2 = compile("a * b")',"code2.evaluate({a: 3, b: 4})"],seealso:["parser","parse","evaluate"]},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"]},nullish:{name:"nullish",category:"Logical",syntax:["x ?? y","nullish(x, y)"],description:"Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.",examples:["null ?? 42","undefined ?? 42","0 ?? 42","false ?? 42","null ?? undefined ?? 42"],seealso:["and","or","not"]},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"]},mapSlices:{name:"mapSlices",category:"Matrix",syntax:["mapSlices(A, dim, callback)"],description:"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.",examples:["A = [[1, 2], [3, 4]]","mapSlices(A, 1, sum)","mapSlices(A, 2, prod)"],seealso:["map","forEach"]},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"]},bernoulli:{name:"bernoulli",category:"Probability",syntax:["bernoulli(n)"],description:"The nth Bernoulli number",examples:["bernoulli(4)","bernoulli(fraction(12))"],seealso:["combinations","gamma","stirlingS2"]},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. Comparing a value with NaN returns false.",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. Comparing a value with NaN returns false.",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. If any NaN values are found, the function yields the last NaN in the input.",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. If any NaN values are found, the function yields the last NaN in the input.",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","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:[]},toBest:{name:"toBest",category:"Units",syntax:["toBest(x)","toBest(x, unitList)","toBest(x, unitList, options)"],description:"Converts to the most appropriate display unit.",examples:['toBest(unit(5000, "m"))','toBest(unit(3500000, "W"))','toBest(unit(0.000000123, "A"))','toBest(unit(10, "m"), "cm")','toBest(unit(10, "m"), "mm,km", {offset: 1.5})'],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","isFinite","isBounded"]},isBounded:{name:"isBounded",category:"Utils",syntax:["isBounded(x)"],description:"Test whether a value or its entries are bounded.",examples:["isBounded(Infinity)","isBounded(bigint(3))","isBounded([3, -Infinity, -3])"],seealso:["isFinite","isNumeric","isNaN","isNegative","isPositive"]},isFinite:{name:"isFinite",category:"Utils",syntax:["isFinite(x)"],description:"Test whether a value is finite, elementwise on collections.",examples:["isFinite(Infinity)","isFinite(bigint(3))","isFinite([3, -Infinity, -3])"],seealso:["isBounded","isNumeric","isNaN","isNegative","isPositive"]},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","isFinite","isBounded"]},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"]}},md="help",dd=de(md,["typed","mathWithTransform","Help"],e=>{let{typed:t,mathWithTransform:n,Help:r}=e;return t(md,{any:function(e){let t,o=e;if("string"!=typeof e)for(t in n)if(me(n,t)&&e===n[t]){o=t;break}const a=i(pd,o);if(!a){const e="function"==typeof o?o.name:o;throw new Error('No documentation found on "'+e+'"')}return new r(a)}})}),hd="chain",gd=de(hd,["typed","Chain"],e=>{let{typed:t,Chain:n}=e;return t(hd,{"":function(){return new n},any:function(e){return new n(e)}})}),yd=de("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],e=>{let{typed:t,matrix:n,subtractScalar:r,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=n(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: "+pr(t)+")");case 2:{const n=t[0],u=t[1];if(n===u)return function(e,t){if(1===t)return ae(e[0][0]);if(2===t)return r(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));{let n=!1;const u=new Array(t).fill(0).map((e,t)=>t);for(let s=0;s{let{typed:t,matrix:n,divideScalar:r,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():wr(e);switch(t.length){case 1:if(1===t[0])return E(e)?n([r(1,e.valueOf()[0])]):[r(1,e[0])];throw new RangeError("Matrix must be square (size: "+pr(t)+")");case 2:{const r=t[0],i=t[1];if(r===i)return E(e)?n(l(e.valueOf(),r,i),e.storage()):l(e,r,i);throw new RangeError("Matrix must be square (size: "+pr(t)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+pr(t)+")")}},any:function(e){return r(1,e)}});function l(e,t,n){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[[r(1,m)]]}if(2===t){const t=s(e);if(0===t)throw Error("Cannot calculate inverse, determinant is zero");return[[r(e[1][1],t),r(a(e[0][1]),t)],[r(a(e[1][0]),t),r(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:n,inv:r,deepEqual:i,equal:o,dotDivide:a,dot:s,ctranspose:u,divideScalar:c,multiply:l,add:f,Complex:p}=e;return t(bd,{"Array | Matrix":function(e){const t=E(e)?e.size():wr(e);switch(t.length){case 1:return h(e)?u(e):1===t[0]?r(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 r(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return E(e)?n(m(e.valueOf(),i,o),e.storage()):m(e,i,o)}default:throw new RangeError("Matrix must be two dimensional (size: "+pr(t)+")")}},any:function(e){return o(e,0)?ae(e):c(1,e)}});function m(e,t,n){const{C:i,F:o}=function(e,t,n){const r=function(e,t,n){const r=ae(e);let i=0;for(let e=0;ee.filter((e,n)=>n!d(s(r[t],r[t])))}}(e,t,n),c=l(r(l(u(i),i)),u(i)),p=l(u(o),r(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 vd=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:n,matrix:r,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:w,larger:v,column:N,flatten:E,number:A,complex:S,sqrt:M,diag:C,size:T,reshape:B,qr:F,usolve:D,usolveAll:O,im:_,re:z,smaller:I,matrixFromColumns:q,dot:k}=e;const R=function(e){let{config:t,addScalar:n,subtract:r,abs:i,atan:o,cos:a,sin:s,multiplyScalar:u,inv:c,bignumber:l,multiply:f,add:p}=e;function m(e,n,r){const i=n-e;return Math.abs(i)<=t.relTol?Math.PI/4:.5*Math.atan(2*r/(n-e))}function d(e,n,a){const s=r(n,e);return i(s)<=t.relTol?l(-1).acos().div(4):u(.5,o(f(2,a,c(s))))}function h(e,t,n,r){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,n){let r=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,n){const r=e.length,i=Math.abs(t/r);let o,a;if(n){a=new Array(r);for(let e=0;e=Math.abs(i);){const t=s[0][0],r=s[0][1];o=m(e[t][t],e[r][r],e[t][r]),e=x(e,o,t,r),n&&(a=h(a,o,t,r)),s=b(e)}const u=Array(r).fill(0);for(let t=0;t=i(o);){const t=u[0][0],r=u[0][1];a=d(e[t][t],e[r][r],e[t][r]),e=y(e,a,t,r),n&&(s=g(s,a,t,r)),u=w(e)}const c=Array(r).fill(0);for(let t=0;t=5)return null;for(s=0;;){const t=h(e,a);if(w(F(B(a,[t])),r))break;if(++s>=10)return null;a=D(t)}return a}function T(e,t,n){const r="BigNumber"===n,i="Complex"===n;let o=Array(e).fill(0).map(e=>2*Math.random()-1);return r&&(o=o.map(e=>c(e))),i&&(o=o.map(e=>x(e))),o=B(o,t),D(o,n)}function B(e,t){const r=f(e);for(let o of t)o=p(o,r),e=n(e,i(a(N(o,e),N(o,o)),o));return e}function F(e){return u(s(N(e,e)))}function D(e,t){const n="Complex"===t,r="BigNumber"===t?c(1):n?x(1):1;return i(a(r,F(e)),e)}return function(e,s,f,p){let h=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const v=function(e,n,r,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,v=o(g,g);let N;s&&(N=Array(n).fill(d));let E=!1;for(;!E;){E=!0;for(let r=0;r1&&(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+n(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(v,function(e,t){const n=[];for(let e=0;ei(p,e)),A.push(...l.map(e=>({value:s,vector:r(e)})))}return A}(e,s,T,v,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:B,qr:F,inv:m,usolve:D,usolveAll:O,equal:a,complex:S,larger:v,smaller:I,matrixFromColumns:q,dot:k});return n("eigs",{Array:function(e){return U(r(e))},"Array, number|BigNumber":function(e,t){return U(r(e),{precision:t})},"Array, Object":(e,t)=>U(r(e),t),Matrix:function(e){return U(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return U(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){const n={matricize:!0};return sr(n,t),U(e,n)}});function U(e){var n;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=!("eigenvectors"in i)||i.eigenvectors,u=function(e,t,n){const r=e.toArray(),i=e.size();if(2!==i.length||i[0]!==i[1])throw new RangeError(`Matrix must be square (size: ${pr(i)})`);const a=i[0];if(function(e,t,n){for(let r=0;r{let{value:t,vector:n}=e;return{value:t,vector:r(n)}}))),a&&Object.defineProperty(u,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),u}function j(e,t,n){const r=e.datatype();if("number"===r||"BigNumber"===r||"Complex"===r)return r;let i=!1,o=!1,a=!1;for(let e=0;e{let{typed:t,abs:n,add:r,identity:i,inv:o,multiply:a}=e;return t(Nd,{Matrix:function(e){const t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+pr(t)+")");const u=t[0],c=function(e){const t=e.size()[0];let r=0;for(let i=0;i1&&(y=a(y,m),x=-x),g=g*(f-e+1)/((2*f-e+1)*e),d=r(d,a(g,y)),h=r(h,a(g*x,y));let b=a(o(h),d);for(let e=0;e{let{typed:t,abs:n,add:r,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,r(e,u(m))),m=i(.5,r(m,u(e))),t=l(n(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(Ad,{"Array | Matrix":function(e){const t=E(e)?e.size():wr(e);switch(t.length){case 1:if(1===t[0])return o(e,a);throw new RangeError("Matrix must be square (size: "+pr(t)+")");case 2:if(t[0]===t[1])return m(e);throw new RangeError("Matrix must be square (size: "+pr(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+pr(t)+")")}}})}),Md="sylvester",Cd=de(Md,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],e=>{let{typed:t,schur:n,matrixFromColumns:r,matrix:i,multiply:o,range:a,concat:s,transpose:u,index:c,subset:l,add:f,subtract:p,identity:m,lusolve:d,abs:h,config:g}=e;return t(Md,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(e,t,n){return y(i(e),t,n)},"Array, Array, Matrix":function(e,t,n){return y(i(e),i(t),n)},"Array, Matrix, Array":function(e,t,n){return y(i(e),t,i(n))},"Matrix, Array, Matrix":function(e,t,n){return y(e,i(t),n)},"Matrix, Array, Array":function(e,t,n){return y(e,i(t),i(n))},"Matrix, Matrix, Array":function(e,t,n){return y(e,t,i(n))},"Array, Array, Array":function(e,t,n){return y(i(e),i(t),i(n)).toArray()}});function y(e,t,g){const y=t.size()[0],x=e.size()[0],b=n(e),w=b.T,v=b.U,N=n(o(-1,t)),E=N.T,A=N.U,S=o(o(u(v),g),A),M=a(0,x),C=[],T=(e,t)=>s(e,t,1),B=(e,t)=>s(e,t,0);for(let e=0;e1e-5){let t=B(l(S,c(M,[e])),l(S,c(M,[e+1])));for(let n=0;n{let{typed:t,matrix:n,identity:r,multiply:i,qr:o,norm:a,subtract:s}=e;return t(Td,{Array:function(e){const t=u(n(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 n,u=e,c=r(t),l=0;do{n=u;const e=o(u),t=e.Q,r=e.R;if(u=i(r,t),c=i(c,t),l++>100)break}while(a(s(u,n))>1e-4);return{U:c,T:u}}}),Fd="lyap",Dd=de(Fd,["typed","matrix","sylvester","multiply","transpose"],e=>{let{typed:t,matrix:n,sylvester:r,multiply:i,transpose:o}=e;return t(Fd,{"Matrix, Matrix":function(e,t){return r(e,o(e),i(-1,t))},"Array, Matrix":function(e,t){return r(n(e),o(n(e)),i(-1,t))},"Matrix, Array":function(e,t){return r(e,o(n(e)),n(i(-1,t)))},"Array, Array":function(e,t){return r(n(e),o(n(e)),n(i(-1,t))).toArray()}})}),Od=de("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],e=>{let{typed:t,matrix:n,multiply:r,equalScalar:i,divideScalar:o,inv:a}=e;const s=$o({typed:t,equalScalar:i}),u=Go({typed:t});return t("divide",se({"Array | Matrix, Array | Matrix":function(e,t){return r(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(n(e),t,o,!1).valueOf()},"any, Array | Matrix":function(e,t){return r(e,a(t))}},o.signatures))}),_d="distance",zd=de(_d,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],e=>{let{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:i,divideScalar:o,deepEqual:a,sqrt:s,abs:u}=e;return t(_d,{"Array, Array, Array":function(e,t,n){if(2===e.length&&2===t.length&&2===n.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(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(a(t,n))throw new TypeError("LinePoint1 should not be same with LinePoint2");const o=r(n[1],t[1]),s=r(t[0],n[0]),u=r(i(n[0],t[1]),i(t[0],n[1]));return h(e[0],e[1],o,s,u)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,n){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(n).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(n))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(a(d(t),d(n)))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 n&&"lineTwoPtY"in n){const o=r(n.lineTwoPtY,t.lineOnePtY),a=r(t.lineOnePtX,n.lineTwoPtX),s=r(i(n.lineTwoPtX,t.lineOnePtY),i(t.lineOnePtX,n.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 n=[],r=[];for(let i=0;i{let{typed:t,config:n,abs:r,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,n){const r=g(e.valueOf(),t.valueOf(),n.valueOf());return null===r?null:a(r)},"Matrix, Matrix, Matrix, Matrix":function(e,t,n,r){const i=y(e.valueOf(),t.valueOf(),n.valueOf(),r.valueOf());return null===i?null:a(i)}});function g(e,t,n){if(e=x(e),t=x(t),n=x(n),!w(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(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])}(n))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,n,r,i,a,s,f,p,m){const d=u(e,s),h=u(r,s),g=u(t,f),y=u(i,f),x=u(n,p),b=u(a,p),w=l(l(l(m,d),g),x),v=l(l(l(o(o(h,y),b),d),g),x),N=c(w,v);return[o(e,u(N,l(r,e))),o(t,u(N,l(i,t))),o(n,u(N,l(a,n)))]}(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[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(r(x),n.relTol))return null;const b=u(y[0],m[1]),w=u(y[1],m[0]),v=u(y[0],h[1]),N=u(y[1],h[0]),E=c(o(l(l(b,w),v),N),x);return i(s(g,E),m)}(e,t,a,m)}if(3===e.length){if(!w(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!w(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w(a))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!w(m))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,n,r,i,a,s,f,m,h,g,y){const x=v(e,s,h,s,t,f,g,f,n,m,y,m),b=v(h,s,r,e,g,f,i,t,y,m,a,n),w=v(e,s,r,e,t,f,i,t,n,m,a,n),N=v(h,s,h,s,g,f,g,f,y,m,y,m),E=v(r,e,r,e,i,t,i,t,a,n,a,n),A=l(u(x,b),u(w,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(r,e))),B=o(t,u(M,l(i,t))),F=o(n,u(M,l(a,n))),D=o(s,u(C,l(h,s))),O=o(f,u(C,l(g,f))),_=o(m,u(C,l(y,m)));return p(T,D)&&p(B,O)&&p(F,_)?[T,B,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 w(e){return 3===e.length&&h(e[0])&&h(e[1])&&h(e[2])}function v(e,t,n,r,i,a,s,c,f,p,m,d){const h=u(l(e,t),l(n,r)),g=u(l(i,a),l(s,c)),y=u(l(f,p),l(m,d));return o(o(h,g),y)}}),qd=de("sum",["typed","config","add","numeric"],e=>{let{typed:t,config:n,add:r,numeric:i}=e;return t("sum",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){try{return ci(e,t,r)}catch(e){throw nc(e,"sum")}},"...":function(e){if(ai(e))throw new TypeError("Scalar values expected in function sum");return o(e)}});function o(e){let t;return si(e,function(e){try{t=void 0===t?e:r(t,e)}catch(t){throw nc(t,"sum",e)}}),void 0===t&&(t=i(0,n.number)),"string"==typeof t&&(t=i(t,xe(t,n))),t}}),kd="cumsum",Rd=de(kd,["typed","add","unaryPlus"],e=>{let{typed:t,add:n,unaryPlus:r}=e;return t(kd,{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(ai(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 nc(e,kd)}}function o(e){if(0===e.length)return[];const t=[r(e[0])];for(let r=1;r=n.length)throw new br(t,n.length);try{return s(e,t)}catch(e){throw nc(e,kd)}}function s(e,t){let n,r,i;if(t<=0){const a=e[0][0];if(Array.isArray(a)){for(i=oi(e),r=[],n=0;n{let{typed:t,add:n,divide:r}=e;return t(Pd,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{const i=ci(e,t,n),o=Array.isArray(e)?wr(e):e.size();return r(i,o[t])}catch(e){throw nc(e,"mean")}},"...":function(e){if(ai(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){let t,i=0;if(si(e,function(e){try{t=void 0===t?e:n(t,e),i++}catch(t){throw nc(t,"mean",e)}}),0===i)throw new Error("Cannot calculate the mean of an empty array");return r(t,i)}}),jd="median",Ld=de(jd,["typed","add","divide","compare","partitionSelect"],e=>{let{typed:t,add:n,divide:r,compare:i,partitionSelect:o}=e;function a(e){try{const t=(e=Ir(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){const n=t/2-1,r=o(e,n+1);let a=e[n];for(let t=0;t0&&(a=e[t]);return u(a,r)}{const n=o(e,(t-1)/2);return s(n)}}catch(e){throw nc(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 r(n(e,t),2)}});return t(jd,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(ai(e))throw new TypeError("Scalar values expected in function median");return a(e)}})}),$d=de("mad",["typed","abs","map","median","subtract"],e=>{let{typed:t,abs:n,map:r,median:i,subtract:o}=e;return t("mad",{"Array | Matrix":a,"...":function(e){return a(e)}});function a(e){if(0===(e=Ir(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{const t=i(e);return i(r(e,function(e){return n(o(e,t))}))}catch(e){throw e instanceof TypeError&&e.message.includes("median")?new TypeError(e.message.replace("median","mad")):nc(e,"mad")}}}),Hd="unbiased",Gd="variance",Zd=de(Gd,["typed","add","subtract","multiply","divide","mapSlices","isNaN"],e=>{let{typed:t,add:n,subtract:r,multiply:i,divide:o,mapSlices:a,isNaN:s}=e;return t(Gd,{"Array | Matrix":function(e){return u(e,Hd)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,Hd)},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return u(e,Hd)}});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(si(e,function(e){try{a=void 0===a?e:n(a,e),u++}catch(t){throw nc(t,"variance",e)}}),0===u)throw new Error("Cannot calculate variance of an empty array");const c=o(a,u);if(a=void 0,si(e,function(e){const t=r(e,c);a=void 0===a?i(t,t):n(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,n){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return a(e,t,e=>u(e,n))}catch(e){throw nc(e,"variance")}}}),Vd="quantileSeq",Wd=de(Vd,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],e=>{let{typed:t,bignumber:n,add:r,subtract:i,divide:o,multiply:a,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:f,larger:p,mapSlices:m}=e;return t(Vd,{"Array | Matrix, number | BigNumber":(e,t)=>g(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,n)=>d(e,t,!1,n,g),"Array | Matrix, number | BigNumber, boolean":g,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>d(e,t,n,r,g),"Array | Matrix, Array | Matrix":(e,t)=>y(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,n)=>d(e,t,!1,n,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>d(e,t,n,r,y)});function d(e,t,n,r,i){return m(e,r,e=>i(e,t,n))}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):n(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=r(t,1);a=[];for(let n=0;l(n,t);n++){const t=o(n+1,e);a.push(x(s,t,i))}return h(t)?a:n(a)}}function y(e,t,n){const r=e.valueOf(),i=t.valueOf(),o=[];for(let e=0;e0&&(d=o[e])}return r(a(d,i(1,m)),a(g,m))}}),Yd=de("std",["typed","map","sqrt","variance"],e=>{let{typed:t,map:n,sqrt:r,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)?n(e,r):r(e)}catch(e){throw e instanceof TypeError&&e.message.includes(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}}),Jd="corr",Xd=de(Jd,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],e=>{let{typed:t,matrix:n,sqrt:r,sum:i,add:o,subtract:a,multiply:s,pow:u,divide:c}=e;return t(Jd,{"Array, Array":function(e,t){return l(e,t)},"Matrix, Matrix":function(e,t){const r=l(e.toArray(),t.toArray());return Array.isArray(r)?n(r):r}});function l(e,t){const n=[];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 r=0;ro(e,s(n,t[r])),0),m=i(e.map(e=>u(e,2))),d=i(t.map(e=>u(e,2))),h=a(s(n,p),s(l,f)),g=r(s(a(s(n,m),u(l,2)),a(s(n,d),u(f,2))));return c(h,g)}}),Qd="bernoulli",Kd=de(Qd,["typed","config","isInteger","number","?BigNumber","?Fraction"],e=>{let{typed:t,config:n,number:r,BigNumber:i,Fraction:o}=e;const a=[void 0],s=[void 0];let u=[void 0],c=50;return t(Qd,{number:e=>eh(e,e=>e,a,(e,t)=>e+t,(e,t)=>e*t,(e,t)=>e/t),"bigint | Fraction":e=>eh(r(e),e=>new o(e),s,(e,t)=>e.add(t),(e,t)=>e.mul(t),(e,t)=>e.div(t)),BigNumber:e=>(n.precision!==c&&(u=[void 0],c=n.precision),eh(r(e),e=>new i(e),u,(e,t)=>e.add(t),(e,t)=>e.mul(t),(e,t)=>e.div(t)))})});function eh(e,t,n,r,i,o){if(e<0||!ye(e))throw new RangeError("Bernoulli index must be nonnegative integer");if(0===e)return t(1);if(1===e)return o(t(-1),t(2));if(e%2==1)return t(0);const a=t(1);1===n.length&&n.push([o(a,t(-3)),o(a,t(-2)),o(a,t(6))]);const s=e/2,u=t(0),c=t(2);for(;n.length<=s;){const e=n.length,a=Math.floor((e+1)/2);let s=u;for(let t=1;t>1;return th(e,n)*th(n+1,t)}function nh(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 n=e-t;let r=1,i=2;const o=t{let{typed:t}=e;return t(rh,{"number, number":nh,"BigNumber, BigNumber":function(e,t){const n=e.constructor;let r,i;const o=e.minus(t),a=new n(1);if(!oh(e)||!oh(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(r=a,t.lt(o))for(i=a;i.lte(o);i=i.plus(a))r=r.times(t.plus(i)).dividedBy(i);else for(i=a;i.lte(t);i=i.plus(a))r=r.times(o.plus(i)).dividedBy(i);return r}})});function oh(e){return e.isInteger()&&e.gte(0)}const ah="combinationsWithRep",sh=de(ah,["typed"],e=>{let{typed:t}=e;return t(ah,{"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:th(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*ch(1-e));if(e>=171.35)return 1/0;if(e>85){const t=e*e,n=t*e,r=n*e,i=r*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*r)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,t=fh[0];for(let n=1;n=1;t--)n+=mh[t]/(e+t);return ph+(e+.5)*Math.log(t)-t+Math.log(n)}dh.signature="number";const hh="gamma",gh=de(hh,["typed","config","multiplyScalar","pow","BigNumber","Complex"],e=>{let{typed:t,config:n,multiplyScalar:r,pow:i,BigNumber:o,Complex:a}=e;return t(hh,{number:ch,Complex:function e(t){if(0===t.im)return ch(t.re);if(t.re<.5){const n=new a(1-t.re,-t.im),r=new a(Math.PI*t.re,Math.PI*t.im);return new a(Math.PI).div(r.sin()).div(e(n))}t=new a(t.re-1,t.im);let n=new a(fh[0],0);for(let e=1;e2;)i-=2,u+=i,a=a.times(u);return new o(a.toPrecision(o.precision))}}),yh="lgamma",xh=de(yh,["Complex","typed"],e=>{let{Complex:t,typed:n}=e;const r=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return n(yh,{number:dh,Complex:function e(n){if(n.isNaN())return new t(NaN,NaN);if(0===n.im)return new t(dh(n.re),0);if(n.re>=7||Math.abs(n.im)>=7)return i(n);if(n.re<=.1){const i=(r=6.283185307179586,(!0^((a=n.im)>0||!(a<0)&&1/a==1/0)?-r:r)*Math.floor(.5*n.re+.25)),o=n.mul(Math.PI).sin().log(),s=e(new t(1-n.re,-n.im));return new t(1.1447298858494002,i).sub(o).sub(s)}return n.im>=0?o(n):o(n.conjugate()).conjugate();var r,a},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(e){const n=e.sub(.5).mul(e.log()).sub(e).add(ph),i=new t(1,0).div(e),o=i.div(e);let a=r[0],s=r[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+r[e],a=u*a+t}const l=i.mul(o.mul(a).add(s));return n.add(l)}function o(e){let n=0,r=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===r&&n++,r=t,e=e.add(1)}return i(e).sub(o.log()).sub(new t(0,2*n*Math.PI*1))}}),bh="factorial",wh=de(bh,["typed","gamma"],e=>{let{typed:t,gamma:n}=e;return t(bh,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return n(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return n(e.plus(1))},"Array | Matrix":t.referToSelf(e=>t=>ui(t,e))})}),vh="kldivergence",Nh=de(vh,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],e=>{let{typed:t,matrix:n,divide:r,sum:i,multiply:o,map:a,dotDivide:s,log:u,isNumeric:c}=e;return t(vh,{"Array, Array":function(e,t){return l(n(e),n(t))},"Matrix, Array":function(e,t){return l(e,n(t))},"Array, Matrix":function(e,t){return l(n(e),t)},"Matrix, Matrix":function(e,t){return l(e,t)}});function l(e,t){const n=t.size().length,l=e.size().length;if(n>1)throw new Error("first object must be one dimensional");if(l>1)throw new Error("second object must be one dimensional");if(n!==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=r(e,i(e)),p=r(t,i(t)),m=i(o(f,a(s(f,p),e=>u(e))));return c(m)?m:Number.NaN}}),Eh="multinomial",Ah=de(Eh,["typed","add","divide","multiply","factorial","isInteger","isPositive"],e=>{let{typed:t,add:n,divide:r,multiply:i,factorial:o,isInteger:a,isPositive:s}=e;return t(Eh,{"Array | Matrix":function(e){let t=0,u=1;return si(e,function(e){if(!a(e)||!s(e))throw new TypeError("Positive integer value expected in function multinomial");t=n(t,e),u=i(u,o(e))}),r(o(t),u)}})}),Sh="permutations",Mh=de(Sh,["typed","factorial"],e=>{let{typed:t,factorial:n}=e;return t(Sh,{"number | BigNumber":n,"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 th(e-t+1,e)},"BigNumber, BigNumber":function(e,t){let n,r;if(!Ch(e)||!Ch(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(n=e.mul(0).add(1),r=e.minus(t).plus(1);r.lte(e);r=r.plus(1))n=n.times(r);return n}})});function Ch(e){return e.isInteger()&&e.gte(0)}var Th=n(391);const Bh=Th(Date.now());function Fh(e){let t;var n;return t=null===(n=e)?Bh:Th(String(n)),function(){return t()}}const Dh="pickRandom",Oh=de(Dh,["typed","config","?on"],e=>{let{typed:t,config:n,on:r}=e,i=Fh(n.randomSeed);return r&&r("config",function(e,t){e.randomSeed!==t.randomSeed&&(i=Fh(e.randomSeed))}),t(Dh,{"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,n){return o(e,{number:n,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,n){return o(e,{number:t,weights:n})}});function o(e,t){let{number:n,weights:r,elementWise:o=!0}=t;const a=void 0===n;a&&(n=1);const s=E(e)?e.create:E(r)?r.create:null;e=e.valueOf(),r&&(r=r.valueOf()),!0===o&&(e=Ir(e),r=Ir(r));let u=0;if(void 0!==r){if(r.length!==e.length)throw new Error("Weights must have the same length as possibles");for(let e=0,t=r.length;e1)for(let r=0,i=e.shift();r{let{typed:t,config:n,on:r}=e,i=Fh(n.randomSeed);return r&&r("config",function(e,t){e.randomSeed!==t.randomSeed&&(i=Fh(e.randomSeed))}),t(zh,{"":()=>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,n)=>o(e,t,n)});function o(e,t,n){const r=_h(e.valueOf(),()=>a(t,n));return E(e)?e.create(r,"number"):r}function a(e,t){return e+i()*(t-e)}}),qh="randomInt",kh=de(qh,["typed","config","log2","?on"],e=>{let{typed:t,config:n,log2:r,on:i}=e,o=Fh(n.randomSeed);return i&&i("config",function(e,t){e.randomSeed!==t.randomSeed&&(o=Fh(e.randomSeed))}),t(qh,{"":()=>s(0,2),number:e=>s(0,e),"number, number":(e,t)=>s(e,t),bigint:e=>u(0n,e),"bigint, bigint":u,"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){const r=_h(e.valueOf(),()=>s(t,n));return E(e)?e.create(r,"number"):r}function s(e,t){return Math.floor(e+o()*(t-e))}function u(e,t){const n=t-e;if(n<=2n**30n)return e+BigInt(s(0,Number(n)));const i=r(n);let a=n;for(;a>=n;){a=0n;for(let e=0;e{let{typed:t,addScalar:n,subtractScalar:r,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(Rh,{"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 r=!(h(e)&&h(t)),o=r?g:d,a=r?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],r=o[e-1];for(let o=t.length;o<=e&&o<=u;++o)t[o]=o===e?1:n(i(a(o),r[o]),r[o-1])}return o[s][u]}})}),Uh="bellNumbers",jh=de(Uh,["typed","addScalar","isNegative","isInteger","stirlingS2"],e=>{let{typed:t,addScalar:n,isNegative:r,isInteger:i,stirlingS2:o}=e;return t(Uh,{"number | BigNumber":function(e){if(!i(e)||r(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");let t=0;for(let r=0;r<=e;r++)t=n(t,o(e,r));return t}})}),Lh="catalan",$h=de(Lh,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],e=>{let{typed:t,addScalar:n,divideScalar:r,multiplyScalar:i,combinations:o,isNegative:a,isInteger:s}=e;return t(Lh,{"number | BigNumber":function(e){if(!s(e)||a(e))throw new TypeError("Non-negative integer value expected in function catalan");return r(o(i(e,2),e),n(e,1))}})}),Hh="composition",Gh=de(Hh,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],e=>{let{typed:t,addScalar:n,combinations:r,isPositive:i,isNegative:o,isInteger:a,larger:s}=e;return t(Hh,{"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 r(n(e,-1),n(t,-1))}})}),Zh="leafCount",Vh=de(Zh,["parse","typed"],e=>{let{parse:t,typed:n}=e;function r(e){let t=0;return e.forEach(e=>{t+=r(e)}),t||1}return n(Zh,{Node:function(e){return r(e)}})});function Wh(e){return Z(e)||K(e)&&e.isUnary()&&Z(e.args[0])}function Yh(e){return!!Z(e)||!(!Y(e)&&!K(e)||!e.args.every(Yh))||!(!ee(e)||!Yh(e.content))}const Jh=de("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],e=>{let{FunctionNode:t,OperatorNode:n,SymbolNode:r}=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 n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,r=a;if("string"==typeof e?r=e:K(e)?r=e.fn.toString():Y(e)?r=e.name:ee(e)&&(r="paren"),me(n,r)){const e=n[r];if(me(e,t))return e[t];if(me(s,r))return s[r][t]}if(me(n,a)){const e=n[a];return me(e,t)?e[t]:s[a][t]}if(me(s,r)){const e=s[r];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 n;const r=[],i=function(e){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:s)},isAssociative:c,mergeContext:function(e,t){const n={...e};for(const r in t)me(e,r)?n[r]={...t[r],...e[r]}:n[r]=t[r];return n},flatten:function e(t,n){if(!t.args||0===t.args.length)return t;t.args=l(t,n);for(let r=0;r2&&c(t,n)){let e=t.args.pop();for(;t.args.length>0;)e=r([t.args.pop(),e]);t.args=e.args}},unflattenl:function e(t,n){if(!t.args||0===t.args.length)return;const r=f(t),i=t.args.length;for(let r=0;r2&&c(t,n)){let e=t.args.shift();for(;t.args.length>0;)e=r([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}}}}),Xh=de("simplify",["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],e=>{let{typed:t,parse:n,equal:r,resolve:i,simplifyConstant:o,simplifyCore:a,AccessorNode:s,ArrayNode:u,ConstantNode:c,FunctionNode:l,IndexNode:f,ObjectNode:p,OperatorNode:h,ParenthesisNode:g,SymbolNode:y,replacer:x}=e;const{hasProperty:b,isCommutative:w,isAssociative:v,mergeContext:N,flatten:E,unflattenr:A,unflattenl:S,createMakeNodeFunction:M,defaultContext:C,realContext:T,positiveContext:B}=Jh({FunctionNode:l,OperatorNode:h,SymbolNode:y});t.addConversion({from:"Object",to:"Map",convert:d});const F=t("simplify",{Node:q,"Node, Map":(e,t)=>q(e,!1,t),"Node, Map, Object":(e,t,n)=>q(e,!1,t,n),"Node, Array":q,"Node, Array, Map":q,"Node, Array, Map, Object":q});function D(e){return e.transform(function(e){return ee(e)?D(e.content):e})}t.removeConversion({from:"Object",to:"Map",convert:d}),F.defaultContext=C,F.realContext=T,F.positiveContext=B;const O={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=D(n(r.l)),r.r=D(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)),v(r.l,t)){const e=!w(r.l,t);let n;e&&(n=I());const i=M(r.l),o=I();r.expanded={},r.expanded.l=i([r.l,o]),E(r.expanded.l,t),A(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}F.rules=[a,{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}}},o,{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}}},o,{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 z=0;function I(){return new y("_p"+z++)}function q(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=r.consoleDebug;t=function(e,t){const n=[];for(let r=0;r ${t[n].r.toString()}`)),o){const t=a.toString({parenthesis:"all"});t!==e&&(console.log("Applying",i,"produced",t),e=t)}S(a,r.context)}u=a.toString({parenthesis:"all"})}return a}function k(e,t,n){let r=e;if(e)for(let i=0;i=2&&2===e.args.length){const r=function(e,t){const n=[];let r,i;const o=M(e);if(w(e,t))for(let t=0;t1&&(a=o(e.args.slice(0,t))),i=e.args.slice(t),r=1===i.length?i[0]:o(i),n.push(o([a,r]))}return n}(t,n);let i=[];for(let t=0;t2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}{let r=[];for(let i=0;i2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");const i=j(e.args[0],t.args[1],n);if(0===i.length)return[];const o=j(e.args[1],t.args[0],n);if(0===o.length)return[];r=[i,o]}o=function(e){if(0===e.length)return e;const t=e.reduce(U),n=[],r={};for(let e=0;e="a"&&e.name[1]<="z"?e.name.substring(0,2):e.name[0]){case"n":case"_p":o[0].placeholders[e.name]=t;break;case"c":case"cl":if(!Z(t))return[];o[0].placeholders[e.name]=t;break;case"v":if(Z(t))return[];o[0].placeholders[e.name]=t;break;case"vl":if(!re(t))return[];o[0].placeholders[e.name]=t;break;case"cd":if(!Wh(t))return[];o[0].placeholders[e.name]=t;break;case"vd":if(Wh(t))return[];o[0].placeholders[e.name]=t;break;case"ce":if(!Yh(t))return[];o[0].placeholders[e.name]=t;break;case"ve":if(Yh(t))return[];o[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof c))return[];if(!r(e.value,t.value))return[]}return o}function L(e,t){if(e instanceof c&&t instanceof c){if(!r(e.value,t.value))return!1}else if(e instanceof y&&t instanceof y){if(e.name!==t.name)return!1}else{if(!(e instanceof h&&t instanceof h||e instanceof l&&t instanceof l))return!1;if(e instanceof h){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof l&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(let n=0;n{let{typed:t,config:n,mathWithTransform:r,matrix:i,isBounded:o,fraction:a,bignumber:s,AccessorNode:u,ArrayNode:c,ConstantNode:l,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:d,SymbolNode:h}=e;const{isCommutative:g,isAssociative:y,allChildren:x,createMakeNodeFunction:w}=Jh({FunctionNode:f,OperatorNode:d,SymbolNode:h}),v=t("simplifyConstant",{Node:e=>M(D(e,{})),"Node, Object":function(e,t){return M(D(e,t))}});function N(e){return b(e)?e.valueOf():e instanceof Array?e.map(N):E(e)?i(N(e.valueOf())):e}function A(e,t,n){try{return r[e].apply(null,t)}catch(i){return t=t.map(N),T(r[e].apply(null,t),n)}}const S=t({Fraction:function(e){const t=e=>"BigNumber"===n.number&&s?s(e):Number(e),r=e.s*e.n,i=r<0n?new d("-","unaryMinus",[new l(-t(r))]):new l(t(r));return 1n===e.d?i:new d("/","divide",[i,new l(t(e.d))])},number:function(e){return e<0?B(new l(-e)):new l(e)},BigNumber:function(e){return e<0?B(new l(-e)):new l(e)},bigint:function(e){return e<0n?B(new l(-e)):new l(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new l(e)},Matrix:function(e){return new c(e.valueOf().map(e=>S(e)))}});function M(e){return X(e)?e:S(e)}function C(e,t){if(t&&!1!==t.exactFractions&&o(e)&&a){const n=a(e),r=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(n.valueOf()===e&&n.n{if(!X(i)){const n=t.pop();if(X(n))return[n,i];try{return t.push(A(e,[n,i],r)),t}catch(e){t.push(n)}}t.push(M(t.pop()));const o=1===t.length?t[0]:n(t);return[n([o,M(i)])]},[i]);return 1===o.length?o[0]:n([o[0],S(o[1])])}function D(e,t){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":case"bigint":return T(e.value,t);case"string":return e.value;default:if(!isNaN(e.value))return T(e.value,t)}return e;case"FunctionNode":if(r[e.name]&&r[e.name].rawArgs)return e;if(!["add","multiply"].includes(e.name)){const n=e.args.map(e=>D(e,t));if(!n.some(X))try{return A(e.name,n,t)}catch(e){}if("size"===e.name&&1===n.length&&L(n[0])){const e=[];let t=n[0];for(;L(t);)e.push(t.items.length),t=t.items[0];return i(e)}return new f(e.name,n.map(M))}case"OperatorNode":{const n=e.fn.toString();let r,i;const o=w(e);if(K(e)&&e.isUnary())r=[D(e.args[0],t)],i=X(r[0])?o(r):A(n,r,t);else if(y(e,t.context))if(r=x(e,t.context),r=r.map(e=>D(e,t)),g(n,t.context)){const e=[],a=[];for(let t=0;t1?(i=F(n,e,o,t),a.unshift(i),i=F(n,a,o,t)):i=F(n,r,o,t)}else i=F(n,r,o,t);else r=e.args.map(e=>D(e,t)),i=F(n,r,o,t);return i}case"ParenthesisNode":return D(e.content,t);case"AccessorNode":return function(e,t,n){if(!J(t))return new u(M(e),M(t));if(L(e)||E(e)){const r=Array.from(t.dimensions);for(;r.length>0;)if(Z(r[0])&&"string"!=typeof r[0].value){const t=T(r.shift().value,n);L(e)?e=e.items[t-1]:(e=e.valueOf()[t-1])instanceof Array&&(e=i(e))}else{if(!(r.length>1&&Z(r[1])&&"string"!=typeof r[1].value))break;{const t=T(r[1].value,n),o=[],a=L(e)?e.items:e.valueOf();for(const n of a)if(L(n))o.push(n.items[t-1]);else{if(!E(e))break;o.push(n[t-1])}if(o.length!==a.length)break;e=L(e)?new c(o):i(o),r.splice(1,1)}}return r.length===t.dimensions.length?new u(M(e),t):r.length>0?(t=new p(r),new u(M(e),t)):e}if(Q(e)&&1===t.dimensions.length&&Z(t.dimensions[0])){const n=t.dimensions[0].value;return n in e.properties?e.properties[n]:new l}return new u(M(e),t)}(D(e.object,t),D(e.index,t),t);case"ArrayNode":{const n=e.items.map(e=>D(e,t));return n.some(X)?new c(n.map(M)):i(n)}case"IndexNode":return new p(e.dimensions.map(e=>v(e,t)));case"ObjectNode":{const n={};for(const r in e.properties)n[r]=v(e.properties[r],t);return new m(n)}default:throw new Error(`Unimplemented node type in simplifyConstant: ${e.type}`)}}return v}),Kh="simplifyCore",eg=de(Kh,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],e=>{let{typed:t,parse:n,equal:r,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),w=new p(1),v=new p(!0),N=new p(!1);function E(e){return K(e)&&["and","not","or"].includes(e.op)}const{hasProperty:A,isCommutative:S}=Jh({FunctionNode:m,OperatorNode:g,SymbolNode:x});function M(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t?t.context:void 0;if(A(e,"trivial",n)){if(Y(e)&&1===e.args.length)return M(e.args[0],t);let n=!1,r=0;if(e.forEach(e=>{++r,1===r&&(n=M(e,t))}),1===r)return n}let o=e;if(Y(o)){const e=function(e){const t="OperatorNode:"+e;for(const e of Wp)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",n))for(;o.args.length>2;){const t=o.args.pop(),n=o.args.pop();o.args.push(new g(e,o.name,[t,n]))}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 n=!0;if("-"===o.op&&K(e)&&(e.isBinary()&&"subtract"===e.fn&&(o=new g("-","subtract",[e.args[1],e.args[0]]),n=!1),e.isUnary()&&"-"===e.op))return e.args[0];if(n)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(r(e.value,1))return a}if(Z(a)){if(i(a.value))return b;if(r(a.value,1))return e;if(S(o,n))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)&&r(a.value,1)?e:new g(o.op,o.fn,[e,a]);if("^"===o.op&&Z(a)){if(i(a.value))return w;if(r(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?v: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 v;if(E(a))return a}if(Z(a)){if(a.value)return v;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(j(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 n in o.properties)e[n]=M(o.properties[n],t);return new h(e)}return o}return t(Kh,{Node:M,"Node,Object":M})}),tg=de("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],e=>{let{typed:t,parse:n,ConstantNode:r,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(re(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 n=new Set(u);return n.add(e.name),s(i,t,n)}return"number"==typeof i?n(String(i)):void 0!==i?new r(i):e}if(K(e)){const n=e.args.map(function(e){return s(e,t,u)});return new o(e.op,e.fn,n,e.implicit)}if(ee(e))return new a(s(e.content,t,u));if(Y(e)){const n=e.args.map(function(e){return s(e,t,u)});return new i(e.name,n)}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,n)=>e(t,d(n))),"Matrix, Object":t.referTo("Matrix,Map",e=>(t,n)=>e(t,d(n))),"Array | Matrix, Map":t.referToSelf(e=>(t,n)=>t.map(t=>e(t,n)))})}),ng="symbolicEqual",rg=de(ng,["parse","simplify","typed","OperatorNode"],e=>{let{parse:t,simplify:n,typed:r,OperatorNode:i}=e;function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=new i("-","subtract",[e,t]),a=n(o,{},r);return Z(a)&&!a.value}return r(ng,{"Node, Node":o,"Node, Node, Object":o})}),ig="derivative",og=de(ig,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],e=>{let{typed:t,config:n,parse:r,simplify:i,equal:o,isZero:a,numeric:s,ConstantNode:u,FunctionNode:c,OperatorNode:l,ParenthesisNode:f,SymbolNode:p}=e;function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0};const r=new Map,o=t.name,a=x(e,function e(t){const n=r.get(t);if(void 0!==n)return n;const i=y(e,t,o);return r.set(t,i),i});return n.simplify?i(a):a}function d(e){const t=r(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(ig,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m,"Node, string":(e,t)=>m(e,d(t)),"Node, string, Object":(e,t,n)=>m(e,d(t),n)});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(r(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,r(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,n){return g(e.toString(),t.name,n.value)},"string, string, number":function(e,t,n){let r;return r=1===n?"{d\\over d"+t+"}":"{d^{"+n+"}\\over d"+t+"^{"+n+"}}",r+`\\left[${e}\\right]`}}),y=t("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(e,t,n){return t.name!==n},"function, ParenthesisNode, string":function(e,t,n){return e(t.content,n)},"function, FunctionAssignmentNode, string":function(e,t,n){return!t.params.includes(n)||e(t.expr,n)},"function, FunctionNode | OperatorNode, string":function(e,t,n){return t.args.every(t=>e(t,n))}}),x=t("_derivative",{"ConstantNode, function":function(){return b(0)},"SymbolNode, function":function(e,t){return t(e)?b(0):b(1)},"ParenthesisNode, function":function(e,t){return new f(x(e.content,t))},"FunctionAssignmentNode, function":function(e,t){return t(e)?b(0):x(e.expr,t)},"FunctionNode, function":function(e,t){if(t(e))return b(0);const n=e.args[0];let r,i,o,a,s=!1,u=!1;switch(e.name){case"cbrt":s=!0,i=new l("*","multiply",[b(3),new l("^","pow",[n,new l("/","divide",[b(2),b(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,i=new l("*","multiply",[b(2),new c("sqrt",[n])]);else if(2===e.args.length)return r=new l("/","divide",[b(1),e.args[1]]),x(new l("^","pow",[n,r]),t);break;case"log10":r=b(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&t(e.args[1]))i=new l("*","multiply",[n.clone(),new c("log",[r||e.args[1]])]),s=!0;else if(2===e.args.length)return x(new l("/","divide",[new c("log",[n]),new c("log",[e.args[1]])]),t)}else i=n.clone(),s=!0;break;case"pow":if(2===e.args.length)return x(new l("^","pow",[n,e.args[1]]),t);break;case"exp":i=new c("exp",[n.clone()]);break;case"sin":i=new c("cos",[n.clone()]);break;case"cos":i=new l("-","unaryMinus",[new c("sin",[n.clone()])]);break;case"tan":i=new l("^","pow",[new c("sec",[n.clone()]),b(2)]);break;case"sec":i=new l("*","multiply",[e,new c("tan",[n.clone()])]);break;case"csc":u=!0,i=new l("*","multiply",[e,new c("cot",[n.clone()])]);break;case"cot":u=!0,i=new l("^","pow",[new c("csc",[n.clone()]),b(2)]);break;case"asin":s=!0,i=new c("sqrt",[new l("-","subtract",[b(1),new l("^","pow",[n.clone(),b(2)])])]);break;case"acos":s=!0,u=!0,i=new c("sqrt",[new l("-","subtract",[b(1),new l("^","pow",[n.clone(),b(2)])])]);break;case"atan":s=!0,i=new l("+","add",[new l("^","pow",[n.clone(),b(2)]),b(1)]);break;case"asec":s=!0,i=new l("*","multiply",[new c("abs",[n.clone()]),new c("sqrt",[new l("-","subtract",[new l("^","pow",[n.clone(),b(2)]),b(1)])])]);break;case"acsc":s=!0,u=!0,i=new l("*","multiply",[new c("abs",[n.clone()]),new c("sqrt",[new l("-","subtract",[new l("^","pow",[n.clone(),b(2)]),b(1)])])]);break;case"acot":s=!0,u=!0,i=new l("+","add",[new l("^","pow",[n.clone(),b(2)]),b(1)]);break;case"sinh":i=new c("cosh",[n.clone()]);break;case"cosh":i=new c("sinh",[n.clone()]);break;case"tanh":i=new l("^","pow",[new c("sech",[n.clone()]),b(2)]);break;case"sech":u=!0,i=new l("*","multiply",[e,new c("tanh",[n.clone()])]);break;case"csch":u=!0,i=new l("*","multiply",[e,new c("coth",[n.clone()])]);break;case"coth":u=!0,i=new l("^","pow",[new c("csch",[n.clone()]),b(2)]);break;case"asinh":s=!0,i=new c("sqrt",[new l("+","add",[new l("^","pow",[n.clone(),b(2)]),b(1)])]);break;case"acosh":s=!0,i=new c("sqrt",[new l("-","subtract",[new l("^","pow",[n.clone(),b(2)]),b(1)])]);break;case"atanh":s=!0,i=new l("-","subtract",[b(1),new l("^","pow",[n.clone(),b(2)])]);break;case"asech":s=!0,u=!0,i=new l("*","multiply",[n.clone(),new c("sqrt",[new l("-","subtract",[b(1),new l("^","pow",[n.clone(),b(2)])])])]);break;case"acsch":s=!0,u=!0,i=new l("*","multiply",[new c("abs",[n.clone()]),new c("sqrt",[new l("+","add",[new l("^","pow",[n.clone(),b(2)]),b(1)])])]);break;case"acoth":s=!0,u=!0,i=new l("-","subtract",[b(1),new l("^","pow",[n.clone(),b(2)])]);break;case"abs":i=new l("/","divide",[new c(new p("abs"),[n.clone()]),n.clone()]);break;default:throw new Error('Cannot process function "'+e.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}s?(o="/",a="divide"):(o="*",a="multiply");let f=x(n,t);return u&&(f=new l("-","unaryMinus",[f])),new l(o,a,[f,i])},"OperatorNode, function":function(e,t){if(t(e))return b(0);if("+"===e.op)return new l(e.op,e.fn,e.args.map(function(e){return x(e,t)}));if("-"===e.op){if(e.isUnary())return new l(e.op,e.fn,[x(e.args[0],t)]);if(e.isBinary())return new l(e.op,e.fn,[x(e.args[0],t),x(e.args[1],t)])}if("*"===e.op){const n=e.args.filter(function(e){return t(e)});if(n.length>0){const r=e.args.filter(function(e){return!t(e)}),i=1===r.length?r[0]:new l("*","multiply",r),o=n.concat(x(i,t));return new l("*","multiply",o)}return new l("+","add",e.args.map(function(n){return new l("*","multiply",e.args.map(function(e){return e===n?x(e,t):e.clone()}))}))}if("/"===e.op&&e.isBinary()){const n=e.args[0],r=e.args[1];return t(r)?new l("/","divide",[x(n,t),r]):t(n)?new l("*","multiply",[new l("-","unaryMinus",[n]),new l("/","divide",[x(r,t),new l("^","pow",[r.clone(),b(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[x(n,t),r.clone()]),new l("*","multiply",[n.clone(),x(r,t)])]),new l("^","pow",[r.clone(),b(2)])])}if("^"===e.op&&e.isBinary()){const n=e.args[0],r=e.args[1];if(t(n))return Z(n)&&(a(n.value)||o(n.value,1))?b(0):new l("*","multiply",[e,new l("*","multiply",[new c("log",[n.clone()]),x(r.clone(),t)])]);if(t(r)){if(Z(r)){if(a(r.value))return b(0);if(o(r.value,1))return x(n,t)}const e=new l("^","pow",[n.clone(),new l("-","subtract",[r,b(1)])]);return new l("*","multiply",[r.clone(),new l("*","multiply",[x(n,t),e])])}return new l("*","multiply",[new l("^","pow",[n.clone(),r.clone()]),new l("+","add",[new l("*","multiply",[x(n,t),new l("/","divide",[r.clone(),n.clone()])]),new l("*","multiply",[x(r,t),new c("log",[n.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),n)))}return h}),ag="rationalize",sg=de(ag,["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:n,equal:r,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:w,FunctionNode:v,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]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=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)"}],n=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],r={};return r.firstRules=e.concat(t,n),r.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)"}],r.sucDivRules=n,r.firstRulesAgain=e.concat(t),r.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))"}],r}(),i=function(e,t,n,r){const i=[],o=m(e,r,t,{exactFractions:!1}),a="+-*"+((n=!!n)?"/":"");!function e(t){const n=t.type;if("FunctionNode"===n)throw new Error("There is an unsolved function call");if("OperatorNode"===n)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 n=0;n=1){let t,n;e=T(e);let i,o=!0,u=!1;for(e=m(e,r.firstRules,{},a);n=o?r.distrDivRules:r.sucDivRules,o=!o,i=(e=m(e,n,{},s)).toString(),i!==t;)u=!0,t=i;u&&(e=m(e,r.firstRulesAgain,{},a)),e=m(e,r.finalRules,{},a)}const u=[],c={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===o&&(e.args[0]=B(e.args[0],u),e.args[1]=B(e.args[1])),n&&(c.numerator=e.args[0],c.denominator=e.args[1])):(1===o&&(e=B(e,u)),n&&(c.numerator=e,c.denominator=null)),n?(c.coefficients=u,c.variables=i.variables,c.expression=e,c):e}return n(ag,{Node:C,"Node, boolean":(e,t)=>C(e,{},t),"Node, Object":C,"Node, Object, boolean":C});function T(e,t,n){const r=e.type,i=arguments.length>1;if("OperatorNode"===r&&e.isBinary()){let r,o=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(r=parseFloat(e.args[1].value),o=r>=2&&ye(r))),o){if(r>2){const t=e.args[0],n=new A("^","pow",[e.args[0].cloneDeep(),new w(r-1)]);e=new A("*","multiply",[t,n])}else e=new A("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===n?t.content=e:t.args[n]=e)}}if("ParenthesisNode"===r)T(e.content,e,"content");else if("ConstantNode"!==r&&"SymbolNode"!==r)for(let t=0;tn&&(t[e]=0),t[e]+=a.cte*("+"===a.oper?1:-1),void(n=Math.max(e,n))}a.cte=e,""===a.fire&&(t[0]+=a.cte*("+"===a.oper?1:-1))}}}(e,null,{cte:1,oper:"+",fire:""}),n=t.length-1;let i,o=!0;for(let e=n;e>=0;e--){if(0===t[e])continue;let n=new w(o?t[e]:Math.abs(t[e]));const a=t[e]<0?"-":"+";if(e>0){let i=new S(r);if(e>1){const t=new w(e);i=new A("^","pow",[i,t])}n=-1===t[e]&&o?new A("-","unaryMinus",[i]):1===Math.abs(t[e])?i:new A("*","multiply",[n,i])}i=o?n:"+"===a?new A("+","add",[i,n]):new A("-","subtract",[i,n]),o=!1}return o?new w(0):i}}),ug="zpk2tf",cg=de(ug,["typed","add","multiply","Complex","number"],e=>{let{typed:t,add:n,multiply:r,Complex:i,number:o}=e;return t(ug,{"Array,Array,number":function(e,t,n){return a(e,t,n)},"Array,Array":function(e,t){return a(e,t,1)},"Matrix,Matrix,number":function(e,t,n){return a(e.valueOf(),t.valueOf(),n)},"Matrix,Matrix":function(e,t){return a(e.valueOf(),t.valueOf(),1)}});function a(e,t,n){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:n,multiply:r,Complex:i,divide:o,matrix:a}=e;return t(lg,{"Array, Array":function(e,t){return s(e,t,u(512))},"Array, Array, Array":function(e,t,n){return s(e,t,n)},"Array, Array, number":function(e,t,n){if(n<0)throw new Error("w must be a positive number");return s(e,t,u(n))},"Matrix, Matrix":function(e,t){const n=u(512),{w:r,h:i}=s(e.valueOf(),t.valueOf(),n);return{w:a(r),h:a(i)}},"Matrix, Matrix, Matrix":function(e,t,n){const{h:r}=s(e.valueOf(),t.valueOf(),n.valueOf());return{h:a(r),w:a(n)}},"Matrix, Matrix, number":function(e,t,n){if(n<0)throw new Error("w must be a positive number");const r=u(n),{h:i}=s(e.valueOf(),t.valueOf(),r);return{h:a(i),w:a(r)}}});function s(e,t,a){const s=[],u=[];for(let o=0;o{let{classes:t}=e;return function(e,n){const r=t[n&&n.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(n):n}}),mg=de("replacer",[],()=>function(e,t){return"number"!=typeof t||Number.isFinite(t)&&!isNaN(t)?"bigint"==typeof t?{mathjs:"bigint",value:String(t)}:t:{mathjs:"number",value:String(t)}}),dg=Math.PI,hg=2*Math.PI,gg=Math.E,yg=de("true",[],()=>!0),xg=de("false",[],()=>!1),bg=de("null",[],()=>null),wg=qg("Infinity",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1/0):1/0}),vg=qg("NaN",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(NaN):NaN}),Ng=qg("pi",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?Vl(n):dg}),Eg=qg("tau",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?Wl(n):hg}),Ag=qg("e",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?Gl(n):gg}),Sg=qg("phi",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?Zl(n):1.618033988749895}),Mg=qg("LN2",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).ln():Math.LN2}),Cg=qg("LN10",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(10).ln():Math.LN10}),Tg=qg("LOG2E",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(2).ln()):Math.LOG2E}),Bg=qg("LOG10E",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(1).div(new n(10).ln()):Math.LOG10E}),Fg=qg("SQRT1_2",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n("0.5").sqrt():Math.SQRT1_2}),Dg=qg("SQRT2",["config","?BigNumber"],e=>{let{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(2).sqrt():Math.SQRT2}),Og=qg("i",["Complex"],e=>{let{Complex:t}=e;return t.I}),_g=de("PI",["pi"],e=>{let{pi:t}=e;return t}),zg=de("E",["e"],e=>{let{e:t}=e;return t}),Ig=de("version",[],()=>"15.1.1");function qg(e,t,n){return de(e,t,n,{recreateOnConfigChange:!0})}const kg=zy("speedOfLight","299792458","m s^-1"),Rg=zy("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Pg=zy("planckConstant","6.62607015e-34","J s"),Ug=zy("reducedPlanckConstant","1.0545718176461565e-34","J s"),jg=zy("magneticConstant","1.25663706212e-6","N A^-2"),Lg=zy("electricConstant","8.8541878128e-12","F m^-1"),$g=zy("vacuumImpedance","376.730313667","ohm"),Hg=zy("coulomb","8.987551792261171e9","N m^2 C^-2"),Gg=zy("coulombConstant","8.987551792261171e9","N m^2 C^-2"),Zg=zy("elementaryCharge","1.602176634e-19","C"),Vg=zy("bohrMagneton","9.2740100783e-24","J T^-1"),Wg=zy("conductanceQuantum","7.748091729863649e-5","S"),Yg=zy("inverseConductanceQuantum","12906.403729652257","ohm"),Jg=zy("magneticFluxQuantum","2.0678338484619295e-15","Wb"),Xg=zy("nuclearMagneton","5.0507837461e-27","J T^-1"),Qg=zy("klitzing","25812.807459304513","ohm"),Kg=zy("bohrRadius","5.29177210903e-11","m"),ey=zy("classicalElectronRadius","2.8179403262e-15","m"),ty=zy("electronMass","9.1093837015e-31","kg"),ny=zy("fermiCoupling","1.1663787e-5","GeV^-2"),ry=Iy("fineStructure",.0072973525693),iy=zy("hartreeEnergy","4.3597447222071e-18","J"),oy=zy("protonMass","1.67262192369e-27","kg"),ay=zy("deuteronMass","3.3435830926e-27","kg"),sy=zy("neutronMass","1.6749271613e-27","kg"),uy=zy("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),cy=zy("rydberg","10973731.568160","m^-1"),ly=zy("thomsonCrossSection","6.6524587321e-29","m^2"),fy=Iy("weakMixingAngle",.2229),py=Iy("efimovFactor",22.7),my=zy("atomicMass","1.66053906660e-27","kg"),dy=zy("avogadro","6.02214076e23","mol^-1"),hy=zy("boltzmann","1.380649e-23","J K^-1"),gy=zy("faraday","96485.33212331001","C mol^-1"),yy=zy("firstRadiation","3.7417718521927573e-16","W m^2"),xy=zy("loschmidt","2.686780111798444e25","m^-3"),by=zy("gasConstant","8.31446261815324","J K^-1 mol^-1"),wy=zy("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),vy=zy("molarVolume","0.022413969545014137","m^3 mol^-1"),Ny=Iy("sackurTetrode",-1.16487052358),Ey=zy("secondRadiation","0.014387768775039337","m K"),Ay=zy("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Sy=zy("wienDisplacement","2.897771955e-3","m K"),My=zy("molarMass","0.99999999965e-3","kg mol^-1"),Cy=zy("molarMassC12","11.9999999958e-3","kg mol^-1"),Ty=zy("gravity","9.80665","m s^-2"),By=zy("planckLength","1.616255e-35","m"),Fy=zy("planckMass","2.176435e-8","kg"),Dy=zy("planckTime","5.391245e-44","s"),Oy=zy("planckCharge","1.87554603778e-18","C"),_y=zy("planckTemperature","1.416785e+32","K");function zy(e,t,n){return de(e,["config","Unit","BigNumber"],e=>{let{config:r,Unit:i,BigNumber:o}=e;const a=new i("BigNumber"===r.number?new o(t):parseFloat(t),n);return a.fixPrefix=!0,a})}function Iy(e,t){return de(e,["config","BigNumber"],e=>{let{config:n,BigNumber:r}=e;return"BigNumber"===n.number?new r(t):t})}const qy=de("mapSlices",["typed","isInteger"],e=>{let{typed:t,isInteger:n}=e;const r=Io({typed:t,isInteger:n});return t("mapSlices",{"...any":function(e){const t=e[1];h(t)?e[1]=t-1:g(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0,...Io.meta}),ky=de("column",["typed","Index","matrix","range"],e=>{let{typed:t,Index:n,matrix:r,range:i}=e;const o=$s({typed:t,Index:n,matrix:r,range:i});return t("column",{"...any":function(e){const t=e.length-1,n=e[t];h(n)&&(e[t]=n-1);try{return o.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0});function Ry(e,t,n){const r=e.filter(function(e){return re(e)&&!(e.name in t)&&!n.has(e.name)})[0];if(!r)throw new Error('No undefined variable found in inline expression "'+e+'"');const i=r.name,o=new Map,a=new f(n,o,new Set([i])),s=e.compile();return function(e){return o.set(i,e),s.evaluate(a)}}const Py=de("transformCallback",["typed"],e=>{let{typed:t}=e;return function(e,r){return t.isTypedFunction(e)?n(e,r):Uy(e,e.length,r)};function n(e,r){const i=Object.fromEntries(Object.entries(e.signatures).map(e=>{let[i,o]=e;const a=i.split(",").length;return t.isTypedFunction(o)?[i,n(o,r)]:[i,Uy(o,a,r)]}));return"string"==typeof e.name?t(e.name,i):t(i)}});function Uy(e,t,n){return t===n?e:t===n+1?function(){for(var t=arguments.length,r=new Array(t),i=0;in+1?function(){for(var t=arguments.length,r=new Array(t),i=0;ie+1)}const Ly=de("filter",["typed"],e=>{let{typed:t}=e;function n(e,n,i){const o=Js({typed:t}),a=Py({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=r(s,i)),c&&(c=re(c)||W(c)?r(c,i):Ry(c,n,i)),o(s,a(c,u))}function r(e,t){return e.compile().evaluate(t)}return n.rawArgs=!0,n},{isTransformFunction:!0}),$y=de("forEach",["typed"],e=>{let{typed:t}=e;const n=tu({typed:t}),r=Py({typed:t});function i(e,t,i){if(0===e.length)return n();let a=e[0];if(1===e.length)return n(a);const s=e.length-1;let u=e[s];return a&&(a=o(a,i)),u&&(u=re(u)||W(u)?o(u,i):Ry(u,t,i)),n(a,r(u,s))}function o(e,t){return e.compile().evaluate(t)}return i.rawArgs=!0,i},{isTransformFunction:!0}),Hy=de("index",["Index","getMatrixDataType"],e=>{let{Index:t,getMatrixDataType:n}=e;return function(){const e=[];for(let t=0,r=arguments.length;t0?0:2;else if(r&&!0===r.isSet)r=r.map(function(e){return e-1});else if(N(r)||E(r))"boolean"!==n(r)&&(r=r.map(function(e){return e-1}));else if(h(r)||y(r))r--;else if(g(r))r=r.toNumber()-1;else if("string"!=typeof r)throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");e[t]=r}const r=new t;return t.apply(r,e),r}},{isTransformFunction:!0}),Gy=de("map",["typed"],e=>{let{typed:t}=e;const n=lu({typed:t}),r=Py({typed:t});function i(e,t,i){if(0===e.length)return n();if(1===e.length)return n(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=re(s)||W(s)?u(s,i):Ry(s,t,i)),n(...a,r(s,o));function u(e,t){return e.compile().evaluate(t)}}return i.rawArgs=!0,i},{isTransformFunction:!0});function Zy(e){if(2===e.length&&A(e[0])){const n=(e=e.slice())[1];(h(t=n)||g(t))&&(e[1]=function(e){return h(e)?e-1:g(e)?e.minus(1):e}(n))}var t;return e}const Vy=de("max",["typed","config","numeric","larger","isNaN"],e=>{let{typed:t,config:n,numeric:r,larger:i,isNaN:o}=e;const a=ql({typed:t,config:n,numeric:r,larger:i,isNaN:o});return t("max",{"...any":function(e){e=Zy(e);try{return a.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),Wy=de("mean",["typed","add","divide"],e=>{let{typed:t,add:n,divide:r}=e;const i=Ud({typed:t,add:n,divide:r});return t("mean",{"...any":function(e){e=Zy(e);try{return i.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),Yy=de("min",["typed","config","numeric","smaller","isNaN"],e=>{let{typed:t,config:n,numeric:r,smaller:i,isNaN:o}=e;const a=kl({typed:t,config:n,numeric:r,smaller:i,isNaN:o});return t("min",{"...any":function(e){e=Zy(e);try{return a.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),Jy=de("range",["typed","config","?matrix","?bignumber","equal","smaller","smallerEq","larger","largerEq","add","isZero","isPositive"],e=>{let{typed:t,config:n,matrix:r,bignumber:i,equal:o,smaller:a,smallerEq:s,larger:u,largerEq:c,add:l,isZero:f,isPositive:p}=e;const m=yu({typed:t,config:n,matrix:r,bignumber:i,equal:o,smaller:a,smallerEq:s,larger:u,largerEq:c,add:l,isZero:f,isPositive:p});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),m.apply(null,e)}})},{isTransformFunction:!0}),Xy=de("row",["typed","Index","matrix","range"],e=>{let{typed:t,Index:n,matrix:r,range:i}=e;const o=Su({typed:t,Index:n,matrix:r,range:i});return t("row",{"...any":function(e){const t=e.length-1,n=e[t];h(n)&&(e[t]=n-1);try{return o.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),Qy=de("subset",["typed","matrix","zeros","add"],e=>{let{typed:t,matrix:n,zeros:r,add:i}=e;const o=Du({typed:t,matrix:n,zeros:r,add:i});return t("subset",{"...any":function(e){try{return o.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),Ky=de("concat",["typed","matrix","isInteger"],e=>{let{typed:t,matrix:n,isInteger:r}=e;const i=js({typed:t,matrix:n,isInteger:r});return t("concat",{"...any":function(e){const t=e.length-1,n=e[t];h(n)?e[t]=n-1:g(n)&&(e[t]=n.minus(1));try{return i.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),ex="diff",tx=de(ex,["typed","matrix","subtract","number","bignumber"],e=>{let{typed:t,matrix:n,subtract:r,number:i,bignumber:o}=e;const a=pu({typed:t,matrix:n,subtract:r,number:i,bignumber:o});return t(ex,{"...any":function(e){e=Zy(e);try{return a.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),nx=de("std",["typed","map","sqrt","variance"],e=>{let{typed:t,map:n,sqrt:r,variance:i}=e;const o=Yd({typed:t,map:n,sqrt:r,variance:i});return t("std",{"...any":function(e){e=Zy(e);try{return o.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),rx=de("sum",["typed","config","add","numeric"],e=>{let{typed:t,config:n,add:r,numeric:i}=e;const o=qd({typed:t,config:n,add:r,numeric:i});return t("sum",{"...any":function(e){e=Zy(e);try{return o.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),ix=de("quantileSeq",["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],e=>{let{typed:t,bignumber:n,add:r,subtract:i,divide:o,multiply:a,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:f,larger:p,mapSlices:m}=e;const d=Wd({typed:t,bignumber:n,add:r,subtract:i,divide:o,multiply:a,partitionSelect:s,compare:u,isInteger:c,smaller:l,smallerEq:f,larger:p,mapSlices:m});return t("quantileSeq",{"Array | Matrix, number | BigNumber":d,"Array | Matrix, number | BigNumber, number":(e,t,n)=>d(e,t,h(n)),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>d(e,t,n,h(r)),"Array | Matrix, Array | Matrix":d,"Array | Matrix, Array | Matrix, number":(e,t,n)=>d(e,t,h(n)),"Array | Matrix, Array | Matrix, boolean":d,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>d(e,t,n,h(r))});function h(e){return Zy([[],e])[1]}},{isTransformFunction:!0}),ox="cumsum",ax=de(ox,["typed","add","unaryPlus"],e=>{let{typed:t,add:n,unaryPlus:r}=e;const i=Rd({typed:t,add:n,unaryPlus:r});return t(ox,{"...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 Lp(e)}}})},{isTransformFunction:!0}),sx="variance",ux=de(sx,["typed","add","subtract","multiply","divide","mapSlices","isNaN"],e=>{let{typed:t,add:n,subtract:r,multiply:i,divide:o,mapSlices:a,isNaN:s}=e;const u=Zd({typed:t,add:n,subtract:r,multiply:i,divide:o,mapSlices:a,isNaN:s});return t(sx,{"...any":function(e){e=Zy(e);try{return u.apply(null,e)}catch(e){throw Lp(e)}}})},{isTransformFunction:!0}),cx="print",lx=de(cx,["typed","matrix","zeros","add"],e=>{let{typed:t,matrix:n,zeros:r,add:i}=e;const o=pc({typed:t,matrix:n,zeros:r,add:i});return t(cx,{"string, Object | Array":function(e,t){return o(a(e),t)},"string, Object | Array, number | Object":function(e,t,n){return o(a(e),t,n)}});function a(e){return e.replace(lc,e=>"$"+e.slice(1).split(".").map(function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e}).join("."))}},{isTransformFunction:!0}),fx=de("and",["typed","matrix","zeros","add","equalScalar","not","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,not:o,concat:a}=e;const s=el({typed:t,matrix:n,equalScalar:r,zeros:i,not:o,concat:a});function u(e,t,n){const r=e[0].compile().evaluate(n);if(!A(r)&&!s(r,!0))return!1;const i=e[1].compile().evaluate(n);return s(r,i)}return u.rawArgs=!0,u},{isTransformFunction:!0}),px=de("or",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=e;const a=Rs({typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o});function s(e,t,n){const r=e[0].compile().evaluate(n);if(!A(r)&&a(r,!1))return!0;const i=e[1].compile().evaluate(n);return a(r,i)}return s.rawArgs=!0,s},{isTransformFunction:!0}),mx=de("nullish",["typed","matrix","size","flatten","deepEqual"],e=>{let{typed:t,matrix:n,size:r,flatten:i,deepEqual:o}=e;const a=ks({typed:t,matrix:n,size:r,flatten:i,deepEqual:o});function s(e,t,n){const r=e[0].compile().evaluate(n);if(!A(r)&&null!=r&&void 0!==r)return r;const i=e[1].compile().evaluate(n);return a(r,i)}return s.rawArgs=!0,s},{isTransformFunction:!0}),dx=de("bitAnd",["typed","matrix","zeros","add","equalScalar","not","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,not:o,concat:a}=e;const s=ys({typed:t,matrix:n,equalScalar:r,zeros:i,not:o,concat:a});function u(e,t,n){const r=e[0].compile().evaluate(n);if(!A(r)){if(isNaN(r))return NaN;if(0===r||!1===r)return 0}const i=e[1].compile().evaluate(n);return s(r,i)}return u.rawArgs=!0,u},{isTransformFunction:!0}),hx=de("bitOr",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{let{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=e;const a=vs({typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:o});function s(e,t,n){const r=e[0].compile().evaluate(n);if(!A(r)){if(isNaN(r))return NaN;if(-1===r)return-1;if(!0===r)return 1}const i=e[1].compile().evaluate(n);return a(r,i)}return s.rawArgs=!0,s},{isTransformFunction:!0});var gx=n(504);const yx={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null,legacySubset:!1},xx=["Matrix","Array"],bx=["number","BigNumber","bigint","Fraction"];function wx(e,t){function n(r){if(r){if(void 0!==r.epsilon){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');const e=ae(r);return e.relTol=r.epsilon,e.absTol=.001*r.epsilon,delete e.epsilon,n(e)}!0===r.legacySubset&&console.warn('Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated in the future.');const i=ae(e);vx(r,"matrix",xx),vx(r,"number",bx),ue(e,r);const o=ae(e),a=ae(r);return t("config",o,i,a),o}return ae(e)}return n.MATRIX_OPTIONS=xx,n.NUMBER_OPTIONS=bx,Object.keys(yx).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}function vx(e,t,n){void 0===e[t]||n.includes(e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}const Nx=function e(n,r){const i=sr({},yx,r);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 gx;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:w,isString:v,isArray:N,isMatrix:E,isCollection:A,isDenseMatrix:S,isSparseMatrix:M,isRange:C,isIndex:T,isBoolean:B,isResultSet:F,isHelp:D,isFunction:O,isDate:_,isRegExp:z,isObject:I,isMap:q,isPartitionedMap:k,isObjectWrappingMap:R,isNull:P,isUndefined:U,isAccessorNode:j,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:ne,isSymbolNode:re,isChain:ie});o.config=wx(i,o.emit),o.expression={transform:{},mathWithTransform:{config:o.config}};const a={};function s(){for(var e=arguments.length,t=new Array(e),n=0;n2&&void 0!==arguments[2]?arguments[2]:t.fn;if(u.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));const c=l(t)?n.expression.transform:n,p=u in n.expression.transform,m=me(c,u)?c[u]:void 0,d=function(){const r={};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?r.math=n:"mathWithTransform"===e?r.mathWithTransform=n.expression.mathWithTransform:"classes"===e?r.classes=n:r[e]=n[e]});const o=t(r);if(o&&"function"==typeof o.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===m||i.override)return o;if(e.isTypedFunction(m)&&e.isTypedFunction(o))return e(m,o);if(i.silent)return m;throw new Error('Cannot import "'+u+'": already exists')},h=null!==(o=null===(s=t.meta)||void 0===s?void 0:s.formerly)&&void 0!==o?o:"",g=l(t)||function(e){return!(e.fn.includes(".")||me(f,e.fn)||e.meta&&e.meta.isClass)}(t),y=n.expression.mathWithTransform;t.meta&&!1===t.meta.lazy?(c[u]=d(),h&&(c[h]=c[u]),m&&p?(a(u),h&&a(h)):g&&(pe(y,u,()=>c[u]),h&&pe(y,h,()=>c[u]))):(pe(c,u,d),h&&pe(c,h,d),m&&p?(a(u),h&&a(h)):g&&(pe(y,u,()=>c[u]),h&&pe(y,h,()=>c[u]))),r[u]=t,n.emit("import",u,d)}function u(e){return"function"==typeof e||"number"==typeof e||"string"==typeof e||"boolean"==typeof e||null===e||w(e)||x(e)||g(e)||b(e)||E(e)||Array.isArray(e)}function c(e){return!me(f,e)}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 n=arguments.length;if(1!==n&&2!==n)throw new va("import",n,1,2);t||(t={});const r={};!function e(n,r,i){if(Array.isArray(r))r.forEach(t=>e(n,t));else if(I(r)||"object"==typeof(o=r)&&"Module"===o[Symbol.toStringTag])for(const t in r)me(r,t)&&e(n,r[t],t);else if(he(r)||void 0!==i){const e=he(r)?l(r)?r.fn+".transform":r.fn:i;if(me(n,e)&&n[e]!==r&&!t.silent)throw new Error('Cannot import "'+e+'" twice');n[e]=r}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected");var o}(r,e);for(const e in r)if(me(r,e)){const n=r[e];if(he(n))s(n,t);else if(u(n))i(e,n,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}}}(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,n),o.factory=de,o.import(Object.values(le(n))),o.ArgumentsError=va,o.DimensionError=xr,o.IndexError=br,o}(e)})(),r.default})()); -//# sourceMappingURL=math.js.map \ No newline at end of file diff --git a/node_modules/mathjs/lib/browser/math.js.LICENSE.txt b/node_modules/mathjs/lib/browser/math.js.LICENSE.txt deleted file mode 100644 index d71174c..0000000 --- a/node_modules/mathjs/lib/browser/math.js.LICENSE.txt +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * decimal.js v10.5.0 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2025 Michael Mclaughlin - * MIT Licence - */ - -/** - * 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 15.1.1 - * @date 2026-02-10 - * - * @license - * Copyright (C) 2013-2026 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/node_modules/mathjs/lib/browser/math.js.map b/node_modules/mathjs/lib/browser/math.js.map deleted file mode 100644 index 0c19a66..0000000 --- a/node_modules/mathjs/lib/browser/math.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,KAAM,I,iCCJT,IAAIC,EAAWC,OAAOC,QAAU,SAAUC,GAAU,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAAE,IAAIG,EAASF,UAAUD,GAAI,IAAK,IAAII,KAAOD,EAAcN,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAQC,KAAQL,EAAOK,GAAOD,EAAOC,GAAU,CAAE,OAAOL,CAAQ,EAE3PS,EAAiB,CACnB,IAAK,MACL,IAAK,MACL,KAAM,oBACN,IAAK,MACLC,EAAG,MACH,IAAK,MACL,IAAK,MACL,IAAK,sBACLC,EAAG,MACH,IAAK,sBAEHC,EAAgB,CAClB,IAAU,OACV,IAAU,QACV,IAAK,IACL,KAAM,YACN,OAAQ,cACR,KAAM,eAGJC,EAAqB,SAA4BJ,EAAgBG,GACnE,OAAOf,EAAS,CAAC,EAAGY,EAAgBG,EACtC,EAUAnB,EAAOD,QAAU,SAAUsB,GAmCzB,IAlCA,IAAIC,EAAOb,UAAUC,OAAS,QAAsBa,IAAjBd,UAAU,GAAmBA,UAAU,GAAK,CAAC,EAC5Ee,EAAwBF,EAAKG,mBAC7BA,OAA+CF,IAA1BC,GAA8CA,EACnEE,EAAmBJ,EAAKK,YACxBA,OAAmCJ,IAArBG,EAAiCN,EAAqBM,EAEpEE,EAAaC,OAAOR,GACpBS,EAAS,GAETC,EAAUJ,EAAYvB,EAAS,CAAC,EAAGY,GAAiBS,EAAqBrB,EAAS,CAAC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VouB,OAAQ,CACN,UACA,qBAEFqnE,YACI,iQACJC,SAAU,CACR,WACA,UACA,WACA,eACA,WACA,iBACA,gBAEFK,QAAS,CACP,SACA,OACA,OACA,ahDkWFh7E,KiDxXsB,CACtBvjB,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,UACA,aACA,4BACA,gCAEFqnE,YACI,wHACJC,SAAU,CACR,YACA,YACA,aACA,oBACA,wBAEFK,QAAS,CAAC,QAAS,MAAO,UjDuW1BvX,KkDzXsB,CACtBhnF,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,WAEFqnE,YAAa,2DACbC,SAAU,CACR,UACA,MACA,aAEFK,QAAS,CACP,WACA,SACA,QlD2WFv4E,OmD1XwB,CACxBhmB,KAAM,SACNwI,SAAU,YACVouB,OAAQ,CACN,QACA,gBAEFqnE,YAAa,qBACbC,SAAU,CACR,YACA,QACA,UACA,YACA,cACA,eAEFK,QAAS,CACP,anD0WFv4C,UoD3X2B,CAC3BhmD,KAAM,YACNwI,SAAU,YACVouB,OAAQ,CACN,SACA,mBAEFqnE,YAAa,kCACbC,SAAU,CACR,yBACA,yBACA,UAEFK,QAAS,CACP,WACA,cACA,WpD4WFlY,YqD5X6B,CAC7BrmF,KAAM,cACNwI,SAAU,YACVouB,OAAQ,CACN,SACA,qBAEFqnE,YAAa,oCACbC,SAAU,CACR,yBACA,yBACA,UAEFK,QAAS,CACP,WACA,SACA,crD6WFrY,OsD7XwB,CACxBlmF,KAAM,SACNwI,SAAU,YACVouB,OAAQ,CACN,SACA,gBAEFqnE,YACI,+CACJC,SAAU,CACR,yBACA,UAEFK,QAAS,CACP,QtDgXFjiF,IuD9XqB,CACrBtc,KAAM,MACNwI,SAAU,aACVouB,OAAQ,CACN,UAEFqnE,YAAa,qCACbC,SAAU,CACR,WACA,UACA,gBACA,UACA,uDAEFK,QAAS,CACP,OACA,QACA,MACA,QvD6WF9W,KwD/XsB,CACtBznF,KAAM,OACNwI,SAAU,aACVouB,OAAQ,C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WAEFqnE,YAAa,gFACbC,SAAU,CACR,gBACA,WACA,qBACA,aAEFK,QAAS,CACP,MACA,QACA,MACA,UhEuXFpiF,MiExYuB,CACvBnc,KAAM,QACNwI,SAAU,aACVouB,OAAQ,CACN,WACA,kBAEFqnE,YAAa,yCACbC,SAAU,CACR,aACA,kBACA,aACA,kBACA,yBAEFK,QAAS,CACP,MACA,MACA,OACA,UjEsXFtiF,MkEzYuB,CACvBjc,KAAM,QACNwI,SAAU,aACVouB,OAAQ,CACN,YAEFqnE,YAAa,4CACbC,SAAU,CACR,iBACA,eACA,SACA,uBACA,kBAEFK,QAAS,CACP,MACA,QlE0XF70E,ImE1YqB,CACrB1pB,KAAM,MACNwI,SAAU,YACVouB,OAAQ,CACN,QACA,UACA,aAEFqnE,YACI,gEACJC,SAAU,CACR,QACA,SACA,WACA,mBACA,WACA,YAEFK,QAAS,CAAC,WnEyXV3vD,SoE3Y0B,CAC1B5uC,KAAM,WACNwI,SAAU,YACVouB,OAAQ,CACN,QACA,kBAEFqnE,YAAa,uBACbC,SAAU,CACR,gBACA,UACA,YACA,cACA,cAEFK,QAAS,CACP,WpE4XFt7C,KqE5YsB,CACtBjjD,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,UACA,cAEFqnE,YAAa,oDACbC,SAAU,CACR,YACA,aACA,eACA,6BACA,8BACA,kBACA,4BACA,gCACA,kCrE4XFjX,QsE7YyB,CACzBjnF,KAAM,UACNwI,SAAU,aACVouB,OAAQ,CACN,aACA,oBAEFqnE,YAAa,qJAGbC,SAAU,CACR,QACA,iBACA,gBACA,WAEFK,QAAS,CACP,WACA,MACA,StE2XFrX,SuE9Y0B,CAC1BlnF,KAAM,WACNwI,SAAU,aACVouB,OAAQ,CACN,cACA,qBAEFqnE,YAAc,2LAMdC,SAAU,CACR,cACA,kBAEFK,QAAS,CACP,OACA,MACA,YvE2XFrhG,IwE/YqB,CACrB8C,KAAM,MACNwI,SAAU,YACVouB,OAAQ,CACN,QACA,aAEFqn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zF,IiGhbqB,CACrBnL,KAAM,MACNwI,SAAU,UACVouB,OAAQ,CACN,UAEFqnE,YACI,iGACJC,SAAU,CACR,cACA,cACA,eAEFK,QAAS,CACP,KACA,KACA,OACA,QjGgaF74C,KkGjbsB,CACtB1lD,KAAM,OACNwI,SAAU,UACVouB,OAAQ,CACN,WAEFqnE,YACI,gGACJC,SAAU,CACR,eACA,eACA,eAEFK,QAAS,CACP,KACA,KACA,MACA,QlGiaFjmG,GmGlboB,CACpB0H,KAAM,KACNwI,SAAU,UACVouB,OAAQ,CACN,SAEFqnE,YAAa,yCACbC,SAAU,CACR,aACA,aACA,YACA,WAEFK,QAAS,CACP,KACA,OACA,MACA,QnGkaF9tE,GoGnboB,CACpBzwB,KAAM,KACNwI,SAAU,UACVouB,OAAQ,CACN,SAEFqnE,YAAa,8CACbC,SAAU,CACR,aACA,aACA,YACA,WAEFK,QAAS,CACP,KACA,OACA,MACA,QpGqaFliB,SqGtb0B,CAC1Br8E,KAAM,WACNwI,SAAU,aACVouB,OAAQ,CACN,uBACA,8BACA,uCACA,+CAEFqnE,YAAa,uDACbC,SAAU,CACR,oBACA,uBACA,2BACA,wCACA,oDAEFK,QAAS,CAAC,SAAU,QAAS,YrGsa7BiF,KsGvbsB,CACtBxjG,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,eACA,gBAEFqnE,YAAa,oDACbC,SAAU,CACR,aACA,mBAEFK,QAAS,ItG4aT/kG,MuGxbuB,CACvBwG,KAAM,QACNwI,SAAU,aACVouB,OAAQ,CACN,cACA,uBACA,oCACA,8CAEFqnE,YAAa,2JACbC,SAAU,CACR,mCACA,mBACA,0BACA,mBACA,uBACA,yBACA,wBACA,0BACA,yBAEFK,QAAS,CAAC,SAAU,WAAY,YvGoahC1J,OwGzbwB,CACxB70F,KAAM,SACNwI,SAAU,aACVouB,OAAQ,CACN,YAEFqnE,YAAa,qIACbC,SAAU,CACR,sBACA,uCACA,uBACA,iCACA,gDACA,qBAEFK,QAAS,CA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MziBqB,CACrB3lG,KAAM,MACNwI,SAAU,aACVouB,OAAQ,CACN,oBACA,UAEFqnE,YAAa,8KACbC,SAAU,CACR,kBACA,kBAEFK,QAAS,CACP,OACA,SACA,MACA,QnM0hBF1kG,IoM1iBqB,CACrBmG,KAAM,MACNwI,SAAU,aACVouB,OAAQ,CACN,oBACA,SACA,qBAEFqnE,YAAa,6HACbC,SAAU,CACR,kBACA,oBACA,oBACA,uBACA,uBACA,gCACA,iCAEFK,QAAS,CACP,OACA,SACA,MACA,OACA,MACA,MACA,apMkhBFqH,KqM3iBsB,CACtB5lG,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,qBACA,UACA,sBAEFqnE,YAAa,mDACbC,SAAU,CACR,mBACA,qBACA,qBACA,wBACA,wBACA,8BAEFK,QAAS,CACP,MACA,SACA,MACA,OACA,MACA,MACA,arMohBFsH,OsM5iBwB,CACxB7lG,KAAM,SACNwI,SAAU,aACVouB,OAAQ,CACN,uBACA,aAEFqnE,YAAa,mLACbC,SAAU,CACR,kBACA,yBAEFK,QAAS,CACP,MACA,OACA,MACA,OACA,MACA,MACA,WACA,gBtMyhBF31F,IuM7iBqB,CACrB5I,KAAM,MACNwI,SAAU,aACVouB,OAAQ,CACN,oBACA,SACA,qBAEFqnE,YAAa,6HACbC,SAAU,CACR,kBACA,oBACA,oBACA,uBACA,uBACA,gCACA,iCAEFK,QAAS,CACP,MACA,OACA,SACA,OACA,MACA,MACA,avMqhBFjzC,KwM9iBsB,CACtBtrD,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,qBACA,UACA,4BAEFqnE,YAAa,2HACbC,SAAU,CACR,sBACA,8BACA,uBAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,OACA,MACA,MACA,axMyhBFhyE,KyM/iBsB,CACtBvsB,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,qBACA,WAEFqnE,YAAa,qCACbC,SAAU,CACR,gBACA,kBACA,sBAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,MACA,MACA,MACA,azM2hBFuH,Y0MhjB6B,CAC7B9lG,KAAM,cACNwI,SAAU,aACVouB,OAAQ,CACN,iCACA,gDACA,+BAEFqnE,YAAa,uWACbC,SAAU,CACR,kCACA,yCACA,gCACA,yCAEFK,QAAS,CACP,OACA,SACA,MACA,MACA,OACA,MACA,MACA,a1M0hBFwH,I2MjjBqB,CACrB/lG,KAAM,MACNwI,SAAU,aACVouB,OAAQ,CACN,oBACA,SACA,oBACA,wBACA,oCAEFqnE,YAAa,iLACbC,SAAU,CACR,eACA,oBACA,mCACA,8BACA,2BAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,OACA,MACA,a3MyhBF3wE,I4MljBqB,CACrB5tB,KAAM,MACNwI,SAAU,aACVouB,OAAQ,CACN,oBACA,SACA,qBAEFqnE,YAAa,iCACbC,SAAU,CACR,kBACA,oBACA,qBAEFK,QAAS,CACP,MACA,OACA,SACA,MACA,OACA,MACA,a5M8hBFtW,S6MnjB0B,CAC1BjoF,KAAM,WACNwI,SAAU,aACVouB,OAAQ,CACN,yBACA,cACA,yBACA,6BACA,yCAEFqnE,YAAa,gIACbC,SAAU,CACR,oBACA,yBACA,wCACA,mCACA,gCAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,MACA,OACA,MACA,Q7M0hBFyH,K8MpjBsB,CACtBhmG,KAAM,OACNwI,SAAU,aACVouB,OAAQ,CACN,aAEFqnE,YAAa,iIACbC,SAAU,CACR,kCACA,wGAEFK,QAAS,CACP,MACA,OACA,MACA,SACA,MACA,OACA,MACA,Q9MoiBFh3E,K+MvjBsB,CACtBvnB,KAAM,OACNwI,SAAU,eACVouB,OAAQ,CACN,WAEFqnE,YAAa,oDACbC,SAAU,CACR,YACA,kBAEFK,QAAS,CACP,MACA,OACA,S/M0iBFt/E,MgNxjBuB,CACvBjf,KAAM,QACNwI,SAAU,eACVouB,OAAQ,CACN,YAEFqnE,YAAa,6FACbC,SAAU,CACR,cAEFK,QAAS,CACP,OACA,QAC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D,GACRF,EAGJ,GAAIxJ,GAAekjI,EAAYE,IAAaF,EAAWE,KAAcz2H,IAAU5F,EAAQm7H,OACrF,MAAM,IAAIpnH,MAAM,kBAAoBsoH,EAAW,WAGjDF,EAAWE,GAAYz2H,CACzB,MACE,IAAK5F,EAAQm7H,OACX,MAAM,IAAIr2H,UAAU,sCAuQ5B,IAAmBuS,CApQjB,CAGA+kH,CAAeD,EAAY/kC,GAE3B,IAAK,MAAM30F,KAAQ05H,EACjB,GAAIljI,GAAekjI,EAAY15H,GAAO,CAEpC,MAAMmD,EAAQu2H,EAAW15H,GAEzB,GAAIib,GAAU9X,GAIZ01H,EAAe11H,EAAO5F,QACjB,GAAIk8H,EAAgBt2H,GACzBg1H,EAAQn4H,EAAMmD,EAAO5F,QAErB,IAAKA,EAAQm7H,OACX,MAAM,IAAIr2H,UAAU,qCAG1B,CAEJ,CA+QF,CFjLyBw3H,CAAc7B,EA7CrC,EA6CsDl7H,EAAMi7H,GA8B5D,OA7BAj7H,EAAKymG,OAAS00B,EAIdn7H,EAAKiD,GAAG,SAAU,KAChBhK,OAAO4f,OAAOoiH,GAAmBjgI,QAAQtC,IACnCA,GAAWA,EAAQ8kB,MAAQ9kB,EAAQ8kB,KAAKi2G,wBAG1C0H,EAAeziI,EAAS,CAAEsd,UAAU,QAO1ChW,EAAKkE,OAASA,EAAO+0B,KAAK,KAAM4hG,GAGhC76H,EAAKtH,QAAUA,GAIfsH,EAAKymG,OAAOxtG,OAAO4f,OAAOgE,GAAYg+G,KAEtC76H,EAAKy1C,eAAiBA,GACtBz1C,EAAKo6B,eAAiBA,GACtBp6B,EAAKu6B,WAAaA,GAEXv6B,CACT,CD3PA,CAAsB8vC,E","sources":["webpack://math/webpack/universalModuleDefinition","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/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/./node_modules/complex.js/dist/complex.mjs","webpack://math/./src/type/complex/Complex.js","webpack://math/./node_modules/fraction.js/dist/fraction.mjs","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/isBounded.js","webpack://math/./src/function/utils/isFinite.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/mapSlices.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/utils/bigint.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/nullish.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/unit/toBest.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/expression/parse.js","webpack://math/./src/expression/embeddedDocs/function/expression/parser.js","webpack://math/./src/expression/embeddedDocs/function/expression/compile.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/nullish.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/mapSlices.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/bernoulli.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/units/toBest.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/isBounded.js","webpack://math/./src/expression/embeddedDocs/function/utils/isFinite.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/function/probability/bernoulli.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/mapSlices.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/nullish.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 ","\"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","(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 if (type === 'function') {\n // we assume that the function is immutable\n return x\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]\n * Optional object with meta information that will be attached\n * to the created factory function as property `meta`. For explanation\n * of what meta properties can be specified and what they mean, see\n * docs/core/extension.md.\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 Number.isFinite(value)\n ? (value === Math.round(value))\n : false\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') {\n try {\n BigInt(numberStr)\n } catch {\n return config.numberFallback\n }\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 (Number.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) || !Number.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) || !Number.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) || !Number.isFinite(Number(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) || !Number.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 * 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 (!Number.isFinite(a) || !Number.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)\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.map(String).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.5.0\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2025 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|bigint|Decimal}\r\n * max {number|string|bigint|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 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 // See https://github.com/MikeMcl/decimal.js/pull/217\r\n x = new Ctor(1).minus(x).div(x.plus(1)).sqrt().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 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|bigint|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|bigint|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, -1);\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|bigint|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 1);\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|bigint|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|bigint|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|bigint|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` (`n` is -1) and `min` (`n` is 1).\r\n */\r\nfunction maxOrMin(Ctor, args, n) {\r\n var k, 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\r\n // NaN?\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n }\r\n\r\n k = x.cmp(y);\r\n\r\n if (k === n || k === 0 && x.s === n) {\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 // TODO BigInt str: no need to check for decimal point, exponential form or leading zeros.\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|bigint|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|bigint|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|bigint|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|bigint|Decimal}\r\n * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} The y-coordinate.\r\n * x {number|string|bigint|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|bigint|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|bigint|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|bigint|Decimal}\r\n * min {number|string|bigint|Decimal}\r\n * max {number|string|bigint|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|bigint|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|bigint|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|bigint|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 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\r\n // Infinity or NaN?\r\n 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\r\n if (t === 'string') {\r\n if ((i = v.charCodeAt(0)) === 45) { // minus sign\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n if (i === 43) v = v.slice(1); // plus sign\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 if (t === 'bigint') {\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 return parseDecimal(x, v.toString());\r\n }\r\n\r\n throw Error(invalidArgument + 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|bigint|Decimal}\r\n * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal} The argument of the logarithm.\r\n * y {number|string|bigint|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|bigint|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|bigint|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|bigint|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, -1);\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|bigint|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 1);\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|bigint|Decimal}\r\n * y {number|string|bigint|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|bigint|Decimal}\r\n * y {number|string|bigint|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|bigint|Decimal} The base.\r\n * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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|bigint|Decimal}\r\n * y {number|string|bigint|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|bigint|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|bigint|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|bigint|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|bigint|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","'use strict';\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 * const c = new Complex('99.3+8i');\n * c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);\n *\n */\n\n\nconst cosh = Math.cosh || function (x) {\n return Math.abs(x) < 1e-9 ? 1 - x : (Math.exp(x) + Math.exp(-x)) * 0.5;\n};\n\nconst 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 */\nconst cosm1 = function (x) {\n\n const 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 let fac = 1, alt = 1, pol = {};\n for (let 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 const 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\nconst hypot = function (x, y) {\n\n x = Math.abs(x);\n y = Math.abs(y);\n\n // Ensure `x` is the larger value\n if (x < y) [x, y] = [y, x];\n\n // If both are below the threshold, use straightforward Pythagoras\n if (x < 1e8) return Math.sqrt(x * x + y * y);\n\n // For larger values, scale to avoid overflow\n y /= x;\n return x * Math.sqrt(1 + y * y);\n};\n\nconst 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 */\nfunction logHypot(a, b) {\n\n const _a = Math.abs(a);\n const _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 const fn = function(a, b) {\n a = Math.abs(a);\n b = Math.abs(b);\n let 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 * 0.5;\n b = b * 0.5;\n\n return 0.5 * Math.log(a * a + b * b) + Math.LN2;\n}\n\nconst P = { 're': 0, 'im': 0 };\nconst parse = function (a, b) {\n\n const z = P;\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 (!isFinite(a['abs']) && 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 (!isFinite(a['r']) && 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 const tokens = a.replace(/_/g, '')\n .match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);\n let plus = 1;\n let minus = 0;\n\n if (tokens === null) {\n parser_exit();\n }\n\n for (let i = 0; i < tokens.length; i++) {\n\n const 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 */\nfunction Complex(a, b) {\n\n if (!(this instanceof Complex)) {\n return new Complex(a, b);\n }\n\n const z = parse(a, b);\n\n this['re'] = z['re'];\n this['im'] = z['im'];\n}\n\nComplex.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 const abs = hypot(this['re'], this['im']);\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 const z = parse(a, b);\n\n const tInfin = this['isInfinite']();\n const zInfin = !(isFinite(z['re']) && isFinite(z['im']));\n\n if (tInfin || zInfin) {\n\n if (tInfin && zInfin) {\n // Infinity + Infinity = NaN\n return Complex['NAN'];\n }\n // Infinity + z = Infinity { where z != Infinity }\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 const z = parse(a, b);\n\n const tInfin = this['isInfinite']();\n const zInfin = !(isFinite(z['re']) && isFinite(z['im']));\n\n if (tInfin || zInfin) {\n\n if (tInfin && zInfin) {\n // Infinity - Infinity = NaN\n return Complex['NAN'];\n }\n // Infinity - z = Infinity { where z != Infinity }\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 const z = parse(a, b);\n\n const tInfin = this['isInfinite']();\n const zInfin = !(isFinite(z['re']) && isFinite(z['im']));\n const tIsZero = this['re'] === 0 && this['im'] === 0;\n const zIsZero = z['re'] === 0 && z['im'] === 0;\n\n // Infinity * 0 = NaN\n if (tInfin && zIsZero || zInfin && tIsZero) {\n return Complex['NAN'];\n }\n\n // Infinity * z = Infinity { where z != 0 }\n if (tInfin || zInfin) {\n return Complex['INFINITY'];\n }\n\n // Shortcut 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 const z = parse(a, b);\n\n const tInfin = this['isInfinite']();\n const zInfin = !(isFinite(z['re']) && isFinite(z['im']));\n const tIsZero = this['re'] === 0 && this['im'] === 0;\n const zIsZero = z['re'] === 0 && z['im'] === 0;\n\n // 0 / 0 = NaN and Infinity / Infinity = NaN\n if (tIsZero && zIsZero || tInfin && zInfin) {\n return Complex['NAN'];\n }\n\n // Infinity / 0 = Infinity\n if (zIsZero || tInfin) {\n return Complex['INFINITY'];\n }\n\n // 0 / Infinity = 0\n if (tIsZero || zInfin) {\n return Complex['ZERO'];\n }\n\n if (0 === z['im']) {\n // Divisor is real\n return new Complex(this['re'] / z['re'], this['im'] / z['re']);\n }\n\n if (Math.abs(z['re']) < Math.abs(z['im'])) {\n\n const x = z['re'] / z['im'];\n const t = z['re'] * x + z['im'];\n\n return new Complex(\n (this['re'] * x + this['im']) / t,\n (this['im'] * x - this['re']) / t);\n\n } else {\n\n const x = z['im'] / z['re'];\n const t = z['im'] * x + z['re'];\n\n return new Complex(\n (this['re'] + this['im'] * x) / t,\n (this['im'] - this['re'] * 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 const z = parse(a, b);\n\n const tIsZero = this['re'] === 0 && this['im'] === 0;\n const zIsZero = z['re'] === 0 && z['im'] === 0;\n\n if (zIsZero) {\n return Complex['ONE'];\n }\n\n // If the exponent is real\n if (z['im'] === 0) {\n\n if (this['im'] === 0 && this['re'] > 0) {\n\n return new Complex(Math.pow(this['re'], z['re']), 0);\n\n } else if (this['re'] === 0) { // If base is fully imaginary\n\n switch ((z['re'] % 4 + 4) % 4) {\n case 0:\n return new Complex(Math.pow(this['im'], z['re']), 0);\n case 1:\n return new Complex(0, Math.pow(this['im'], z['re']));\n case 2:\n return new Complex(-Math.pow(this['im'], z['re']), 0);\n case 3:\n return new Complex(0, -Math.pow(this['im'], 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 (tIsZero && z['re'] > 0) { // Same behavior as Wolframalpha, Zero if real part is zero\n return Complex['ZERO'];\n }\n\n const arg = Math.atan2(this['im'], this['re']);\n const loh = logHypot(this['re'], this['im']);\n\n let re = Math.exp(z['re'] * loh - z['im'] * arg);\n let im = z['im'] * loh + z['re'] * arg;\n return new Complex(\n re * Math.cos(im),\n re * Math.sin(im));\n },\n\n /**\n * Calculate the complex square root\n *\n * @returns {Complex}\n */\n 'sqrt': function () {\n\n const a = this['re'];\n const b = this['im'];\n\n if (b === 0) {\n // Real number case\n if (a >= 0) {\n return new Complex(Math.sqrt(a), 0);\n } else {\n return new Complex(0, Math.sqrt(-a));\n }\n }\n\n const r = hypot(a, b);\n\n let re = Math.sqrt(0.5 * (r + Math.abs(a))); // sqrt(2x) / 2 = sqrt(x / 2)\n let im = Math.abs(b) / (2 * re);\n\n if (a >= 0) {\n return new Complex(re, b < 0 ? -im : im);\n } else {\n return new Complex(im, b < 0 ? -re : re);\n }\n },\n\n /**\n * Calculate the complex exponent\n *\n * @returns {Complex}\n */\n 'exp': function () {\n\n const er = Math.exp(this['re']);\n\n if (this['im'] === 0) {\n return new Complex(er, 0);\n }\n return new Complex(\n er * Math.cos(this['im']),\n er * 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 const a = this['re'];\n const 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 const a = this['re'];\n const 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 const a = this['re'];\n const 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 const a = this['re'];\n const 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 const a = 2 * this['re'];\n const b = 2 * this['im'];\n const 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 const a = 2 * this['re'];\n const b = 2 * this['im'];\n const 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 const a = this['re'];\n const b = this['im'];\n const 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 const a = this['re'];\n const b = this['im'];\n const 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 const a = this['re'];\n const b = this['im'];\n\n const t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n const 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 const a = this['re'];\n const b = this['im'];\n\n const t1 = new Complex(\n b * b - a * a + 1,\n -2 * a * b)['sqrt']();\n\n const 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 const a = this['re'];\n const 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 const d = a * a + (1.0 - b) * (1.0 - b);\n\n const 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 const a = this['re'];\n const b = this['im'];\n\n if (b === 0) {\n return new Complex(Math.atan2(1, a), 0);\n }\n\n const 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 const a = this['re'];\n const b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Infinity);\n }\n\n const 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 const a = this['re'];\n const b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(Math.PI / 2, Infinity);\n }\n\n const 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 const a = this['re'];\n const 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 const a = this['re'];\n const 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 const a = 2 * this['re'];\n const b = 2 * this['im'];\n const 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 const a = 2 * this['re'];\n const b = 2 * this['im'];\n const 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 const a = this['re'];\n const b = this['im'];\n const 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 const a = this['re'];\n const b = this['im'];\n const 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 let tmp = this['im'];\n this['im'] = -this['re'];\n this['re'] = tmp;\n const 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 const res = this['acos']();\n if (res['im'] <= 0) {\n const tmp = res['re'];\n res['re'] = -res['im'];\n res['im'] = tmp;\n } else {\n const 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 const a = this['re'];\n const b = this['im'];\n\n const noIM = a > 1 && b === 0;\n const oneMinus = 1 - a;\n const onePlus = 1 + a;\n const d = oneMinus * oneMinus + b * b;\n\n const 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 const 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 const a = this['re'];\n const b = this['im'];\n\n if (a === 0 && b === 0) {\n return new Complex(0, Math.PI / 2);\n }\n\n const 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 const a = this['re'];\n const 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 const 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 const a = this['re'];\n const b = this['im'];\n\n if (this['isZero']()) {\n return Complex['INFINITY'];\n }\n\n const 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 const a = this['re'];\n const b = this['im'];\n\n const 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 const z = parse(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 let a = this['re'];\n let b = this['im'];\n let 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['isFinite']();\n }\n};\n\nComplex['ZERO'] = new Complex(0, 0);\nComplex['ONE'] = new Complex(1, 0);\nComplex['I'] = new Complex(0, 1);\nComplex['PI'] = new Complex(Math.PI, 0);\nComplex['E'] = new Complex(Math.E, 0);\nComplex['INFINITY'] = new Complex(Infinity, Infinity);\nComplex['NAN'] = new Complex(NaN, NaN);\nComplex['EPSILON'] = 1e-15;\nexport {\n Complex as default, Complex\n};\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","'use strict';\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 as BigInt or Number\n *\n * Double form\n * - Single double value as Number\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 * let f = new Fraction(\"9.4'31'\");\n * f.mul([-4, 3]).div(4.9);\n *\n */\n\n// Set Identity function to downgrade BigInt to Number if needed\nif (typeof BigInt === 'undefined') BigInt = function (n) { if (isNaN(n)) throw new Error(\"\"); return n; };\n\nconst C_ZERO = BigInt(0);\nconst C_ONE = BigInt(1);\nconst C_TWO = BigInt(2);\nconst C_FIVE = BigInt(5);\nconst C_TEN = BigInt(10);\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\nconst MAX_CYCLE_LEN = 2000;\n\n// Parsed data to avoid calling \"new\" all the time\nconst P = {\n \"s\": C_ONE,\n \"n\": C_ZERO,\n \"d\": C_ONE\n};\n\nfunction assign(n, s) {\n\n try {\n n = BigInt(n);\n } catch (e) {\n throw InvalidParameter();\n }\n return n * s;\n}\n\nfunction trunc(x) {\n return typeof x === 'bigint' ? x : Math.floor(x);\n}\n\n// Creates a new Fraction internally without the need of the bulky constructor\nfunction newFraction(n, d) {\n\n if (d === C_ZERO) {\n throw DivisionByZero();\n }\n\n const f = Object.create(Fraction.prototype);\n f[\"s\"] = n < C_ZERO ? -C_ONE : C_ONE;\n\n n = n < C_ZERO ? -n : n;\n\n const 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 const factors = {};\n\n let n = num;\n let i = C_TWO;\n let s = C_FIVE - C_ONE;\n\n while (s <= n) {\n\n while (n % i === C_ZERO) {\n n /= i;\n factors[i] = (factors[i] || C_ZERO) + C_ONE;\n }\n s += C_ONE + C_TWO * i++;\n }\n\n if (n !== num) {\n if (n > 1)\n factors[n] = (factors[n] || C_ZERO) + C_ONE;\n } else {\n factors[num] = (factors[num] || C_ZERO) + C_ONE;\n }\n return factors;\n}\n\nconst parse = function (p1, p2) {\n\n let n = C_ZERO, d = C_ONE, s = C_ONE;\n\n if (p1 === undefined || p1 === null) { // No argument\n /* void */\n } else if (p2 !== undefined) { // Two arguments\n\n if (typeof p1 === \"bigint\") {\n n = p1;\n } else if (isNaN(p1)) {\n throw InvalidParameter();\n } else if (p1 % 1 !== 0) {\n throw NonIntegerParameter();\n } else {\n n = BigInt(p1);\n }\n\n if (typeof p2 === \"bigint\") {\n d = p2;\n } else if (isNaN(p2)) {\n throw InvalidParameter();\n } else if (p2 % 1 !== 0) {\n throw NonIntegerParameter();\n } else {\n d = BigInt(p2);\n }\n\n s = n * d;\n\n } else if (typeof p1 === \"object\") {\n if (\"d\" in p1 && \"n\" in p1) {\n n = BigInt(p1[\"n\"]);\n d = BigInt(p1[\"d\"]);\n if (\"s\" in p1)\n n *= BigInt(p1[\"s\"]);\n } else if (0 in p1) {\n n = BigInt(p1[0]);\n if (1 in p1)\n d = BigInt(p1[1]);\n } else if (typeof p1 === \"bigint\") {\n n = p1;\n } else {\n throw InvalidParameter();\n }\n s = n * d;\n } else if (typeof p1 === \"number\") {\n\n if (isNaN(p1)) {\n throw InvalidParameter();\n }\n\n if (p1 < 0) {\n s = -C_ONE;\n p1 = -p1;\n }\n\n if (p1 % 1 === 0) {\n n = BigInt(p1);\n } else {\n\n let z = 1;\n\n let A = 0, B = 1;\n let C = 1, D = 1;\n\n let N = 10000000;\n\n if (p1 >= 1) {\n z = 10 ** Math.floor(1 + Math.log10(p1));\n p1 /= z;\n }\n\n // Using Farey Sequences\n\n while (B <= N && D <= N) {\n let 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 = BigInt(n) * BigInt(z);\n d = BigInt(d);\n }\n\n } else if (typeof p1 === \"string\") {\n\n let ndx = 0;\n\n let v = C_ZERO, w = C_ZERO, x = C_ZERO, y = C_ONE, z = C_ONE;\n\n let match = p1.replace(/_/g, '').match(/\\d+|./g);\n\n if (match === null)\n throw InvalidParameter();\n\n if (match[ndx] === '-') {// Check for minus sign at the beginning\n s = -C_ONE;\n ndx++;\n } else if (match[ndx] === '+') {// Check for plus sign at the beginning\n ndx++;\n }\n\n if (match.length === ndx + 1) { // Check if it's just a simple number \"1234\"\n w = assign(match[ndx++], s);\n } else if (match[ndx + 1] === '.' || match[ndx] === '.') { // Check if it's a decimal number\n\n if (match[ndx] !== '.') { // Handle 0.5 and .5\n v = assign(match[ndx++], s);\n }\n ndx++;\n\n // Check for decimal places\n if (ndx + 1 === match.length || match[ndx + 1] === '(' && match[ndx + 3] === ')' || match[ndx + 1] === \"'\" && match[ndx + 3] === \"'\") {\n w = assign(match[ndx], s);\n y = C_TEN ** BigInt(match[ndx].length);\n ndx++;\n }\n\n // Check for repeating places\n if (match[ndx] === '(' && match[ndx + 2] === ')' || match[ndx] === \"'\" && match[ndx + 2] === \"'\") {\n x = assign(match[ndx + 1], s);\n z = C_TEN ** BigInt(match[ndx + 1].length) - C_ONE;\n ndx += 3;\n }\n\n } else if (match[ndx + 1] === '/' || match[ndx + 1] === ':') { // Check for a simple fraction \"123/456\" or \"123:456\"\n w = assign(match[ndx], s);\n y = assign(match[ndx + 2], C_ONE);\n ndx += 3;\n } else if (match[ndx + 3] === '/' && match[ndx + 1] === ' ') { // Check for a complex fraction \"123 1/2\"\n v = assign(match[ndx], s);\n w = assign(match[ndx + 2], s);\n y = assign(match[ndx + 4], C_ONE);\n ndx += 5;\n }\n\n if (match.length <= ndx) { // Check for more tokens on the stack\n d = y * z;\n s = /* void */\n n = x + d * v + z * w;\n } else {\n throw InvalidParameter();\n }\n\n } else if (typeof p1 === \"bigint\") {\n n = p1;\n s = p1;\n d = C_ONE;\n } else {\n throw InvalidParameter();\n }\n\n if (d === C_ZERO) {\n throw DivisionByZero();\n }\n\n P[\"s\"] = s < C_ZERO ? -C_ONE : C_ONE;\n P[\"n\"] = n < C_ZERO ? -n : n;\n P[\"d\"] = d < C_ZERO ? -d : d;\n};\n\nfunction modpow(b, e, m) {\n\n let r = C_ONE;\n for (; e > C_ZERO; b = (b * b) % m, e >>= C_ONE) {\n\n if (e & C_ONE) {\n r = (r * b) % m;\n }\n }\n return r;\n}\n\nfunction cycleLen(n, d) {\n\n for (; d % C_TWO === C_ZERO;\n d /= C_TWO) {\n }\n\n for (; d % C_FIVE === C_ZERO;\n d /= C_FIVE) {\n }\n\n if (d === C_ONE) // Catch non-cyclic numbers\n return C_ZERO;\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 let rem = C_TEN % d;\n let t = 1;\n\n for (; rem !== C_ONE; t++) {\n rem = rem * C_TEN % d;\n\n if (t > MAX_CYCLE_LEN)\n 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`\n }\n return BigInt(t);\n}\n\nfunction cycleStart(n, d, len) {\n\n let rem1 = C_ONE;\n let rem2 = modpow(C_TEN, len, d);\n\n for (let 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 BigInt(t);\n\n rem1 = rem1 * C_TEN % d;\n rem2 = rem2 * C_TEN % 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 */\nfunction Fraction(a, b) {\n\n parse(a, b);\n\n if (this instanceof Fraction) {\n a = gcd(P[\"d\"], P[\"n\"]); // Abuse 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\": C_ONE,\n \"n\": C_ZERO,\n \"d\": C_ONE,\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 * Ex: new Fraction(20, 10).mod().equals(0) ? \"is Integer\"\n **/\n \"mod\": function (a, b) {\n\n if (a === undefined) {\n return newFraction(this[\"s\"] * this[\"n\"] % this[\"d\"], C_ONE);\n }\n\n parse(a, b);\n if (C_ZERO === P[\"n\"] * this[\"d\"]) {\n throw DivisionByZero();\n }\n\n /**\n * I derived the rational modulo similar to the modulo for integers\n *\n * https://raw.org/book/analysis/rational-numbers/\n *\n * n1/d1 = (n2/d2) * q + r, where 0 ≤ r < n2/d2\n * => d2 * n1 = n2 * d1 * q + d1 * d2 * r\n * => r = (d2 * n1 - n2 * d1 * q) / (d1 * d2)\n * = (d2 * n1 - n2 * d1 * floor((d2 * n1) / (n2 * d1))) / (d1 * d2)\n * = ((d2 * n1) % (n2 * d1)) / (d1 * d2)\n */\n return newFraction(\n this[\"s\"] * (P[\"d\"] * this[\"n\"]) % (P[\"n\"] * this[\"d\"]),\n P[\"d\"] * this[\"d\"]);\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 // https://raw.org/book/analysis/rational-numbers/\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 // https://raw.org/book/analysis/rational-numbers/\n // lcm(a / b, c / d) = lcm(a, c) / gcd(b, d)\n\n if (P[\"n\"] === C_ZERO && this[\"n\"] === C_ZERO) {\n return newFraction(C_ZERO, C_ONE);\n }\n return newFraction(P[\"n\"] * this[\"n\"], gcd(P[\"n\"], this[\"n\"]) * gcd(P[\"d\"], this[\"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 return newFraction(this[\"s\"] * this[\"d\"], this[\"n\"]);\n },\n\n /**\n * Calculates the fraction to some integer exponent\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'] === C_ONE) {\n\n if (P['s'] < C_ZERO) {\n return newFraction((this['s'] * this[\"d\"]) ** P['n'], this[\"n\"] ** P['n']);\n } else {\n return newFraction((this['s'] * this[\"n\"]) ** P['n'], 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\n // ⇔ (cos(c*pi/d) + i*sin(c*pi/d)) * (a/b)^(c/d) = x # DeMoivre's formula\n // From which follows that only for c=0 the root is non-complex\n if (this['s'] < C_ZERO) return null;\n\n // Now prime factor n and d\n let N = factorize(this['n']);\n let D = factorize(this['d']);\n\n // Exponentiate and take root for n and d individually\n let n = C_ONE;\n let d = C_ONE;\n for (let k in N) {\n if (k === '1') continue;\n if (k === '0') {\n n = C_ZERO;\n break;\n }\n N[k] *= P['n'];\n\n if (N[k] % P['d'] === C_ZERO) {\n N[k] /= P['d'];\n } else return null;\n n *= BigInt(k) ** N[k];\n }\n\n for (let k in D) {\n if (k === '1') continue;\n D[k] *= P['n'];\n\n if (D[k] % P['d'] === C_ZERO) {\n D[k] /= P['d'];\n } else return null;\n d *= BigInt(k) ** D[k];\n }\n\n if (P['s'] < C_ZERO) {\n return newFraction(d, n);\n }\n return newFraction(n, d);\n },\n\n /**\n * Calculates the logarithm of a fraction to a given rational base\n *\n * Ex: new Fraction(27, 8).log(9, 4) => 3/2\n */\n \"log\": function (a, b) {\n\n parse(a, b);\n\n if (this['s'] <= C_ZERO || P['s'] <= C_ZERO) return null;\n\n const allPrimes = {};\n\n const baseFactors = factorize(P['n']);\n const T1 = factorize(P['d']);\n\n const numberFactors = factorize(this['n']);\n const T2 = factorize(this['d']);\n\n for (const prime in T1) {\n baseFactors[prime] = (baseFactors[prime] || C_ZERO) - T1[prime];\n }\n for (const prime in T2) {\n numberFactors[prime] = (numberFactors[prime] || C_ZERO) - T2[prime];\n }\n\n for (const prime in baseFactors) {\n if (prime === '1') continue;\n allPrimes[prime] = true;\n }\n for (const prime in numberFactors) {\n if (prime === '1') continue;\n allPrimes[prime] = true;\n }\n\n let retN = null;\n let retD = null;\n\n // Iterate over all unique primes to determine if a consistent ratio exists\n for (const prime in allPrimes) {\n\n const baseExponent = baseFactors[prime] || C_ZERO;\n const numberExponent = numberFactors[prime] || C_ZERO;\n\n if (baseExponent === C_ZERO) {\n if (numberExponent !== C_ZERO) {\n return null; // Logarithm cannot be expressed as a rational number\n }\n continue; // Skip this prime since both exponents are zero\n }\n\n // Calculate the ratio of exponents for this prime\n let curN = numberExponent;\n let curD = baseExponent;\n\n // Simplify the current ratio\n const gcdValue = gcd(curN, curD);\n curN /= gcdValue;\n curD /= gcdValue;\n\n // Check if this is the first ratio; otherwise, ensure ratios are consistent\n if (retN === null && retD === null) {\n retN = curN;\n retD = curD;\n } else if (curN * retD !== retN * curD) {\n return null; // Ratios do not match, logarithm cannot be rational\n }\n }\n\n return retN !== null && retD !== null\n ? newFraction(retN, retD)\n : null;\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\"];\n },\n\n /**\n * Check if this rational number is less than another\n *\n * Ex: new Fraction(19.6).lt([98, 5]);\n **/\n \"lt\": function (a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] < P[\"s\"] * P[\"n\"] * this[\"d\"];\n },\n\n /**\n * Check if this rational number is less than or equal another\n *\n * Ex: new Fraction(19.6).lt([98, 5]);\n **/\n \"lte\": function (a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] <= P[\"s\"] * P[\"n\"] * this[\"d\"];\n },\n\n /**\n * Check if this rational number is greater than another\n *\n * Ex: new Fraction(19.6).lt([98, 5]);\n **/\n \"gt\": function (a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] > P[\"s\"] * P[\"n\"] * this[\"d\"];\n },\n\n /**\n * Check if this rational number is greater than or equal another\n *\n * Ex: new Fraction(19.6).lt([98, 5]);\n **/\n \"gte\": function (a, b) {\n\n parse(a, b);\n return this[\"s\"] * this[\"n\"] * P[\"d\"] >= P[\"s\"] * P[\"n\"] * this[\"d\"];\n },\n\n /**\n * Compare two rational numbers\n * < 0 iff this < that\n * > 0 iff this > that\n * = 0 iff this = that\n *\n * Ex: new Fraction(19.6).compare([98, 5]);\n **/\n \"compare\": function (a, b) {\n\n parse(a, b);\n let t = this[\"s\"] * this[\"n\"] * P[\"d\"] - P[\"s\"] * P[\"n\"] * this[\"d\"];\n\n return (C_ZERO < t) - (t < C_ZERO);\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 = C_TEN ** BigInt(places || 0);\n\n return newFraction(trunc(this[\"s\"] * places * this[\"n\"] / this[\"d\"]) +\n (places * this[\"n\"] % this[\"d\"] > C_ZERO && this[\"s\"] >= C_ZERO ? C_ONE : C_ZERO),\n 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 = C_TEN ** BigInt(places || 0);\n\n return newFraction(trunc(this[\"s\"] * places * this[\"n\"] / this[\"d\"]) -\n (places * this[\"n\"] % this[\"d\"] > C_ZERO && this[\"s\"] < C_ZERO ? C_ONE : C_ZERO),\n places);\n },\n\n /**\n * Rounds a rational numbers\n *\n * Ex: new Fraction('4.(3)').round() => (4 / 1)\n **/\n \"round\": function (places) {\n\n places = C_TEN ** BigInt(places || 0);\n\n /* Derivation:\n\n s >= 0:\n round(n / d) = trunc(n / d) + (n % d) / d >= 0.5 ? 1 : 0\n = trunc(n / d) + 2(n % d) >= d ? 1 : 0\n s < 0:\n round(n / d) =-trunc(n / d) - (n % d) / d > 0.5 ? 1 : 0\n =-trunc(n / d) - 2(n % d) > d ? 1 : 0\n\n =>:\n\n round(s * n / d) = s * trunc(n / d) + s * (C + 2(n % d) > d ? 1 : 0)\n where C = s >= 0 ? 1 : 0, to fix the >= for the positve case.\n */\n\n return newFraction(trunc(this[\"s\"] * places * this[\"n\"] / this[\"d\"]) +\n this[\"s\"] * ((this[\"s\"] >= C_ZERO ? C_ONE : C_ZERO) + C_TWO * (places * this[\"n\"] % this[\"d\"]) > this[\"d\"] ? C_ONE : C_ZERO),\n 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 ⇔ k = floor((a * y) / (b * x))\n */\n\n parse(a, b);\n\n const n = this['n'] * P['d'];\n const d = this['d'] * P['n'];\n const r = n % d;\n\n // round(n / d) = trunc(n / d) + 2(n % d) >= d ? 1 : 0\n let k = trunc(n / d);\n if (r + r >= d) {\n k++;\n }\n return newFraction(this['s'] * k * P['n'], P['d']);\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 // Best we can do so far\n return Number(this[\"s\"] * this[\"n\"]) / Number(this[\"d\"]);\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 let N = this[\"n\"];\n let D = this[\"d\"];\n\n dec = dec || 15; // 15 = decimal places when no repetition\n\n let cycLen = cycleLen(N, D); // Cycle length\n let cycOff = cycleStart(N, D, cycLen); // Cycle start\n\n let str = this['s'] < C_ZERO ? \"-\" : \"\";\n\n // Append integer part\n str += trunc(N / D);\n\n N %= D;\n N *= C_TEN;\n\n if (N)\n str += \".\";\n\n if (cycLen) {\n\n for (let i = cycOff; i--;) {\n str += trunc(N / D);\n N %= D;\n N *= C_TEN;\n }\n str += \"(\";\n for (let i = cycLen; i--;) {\n str += trunc(N / D);\n N %= D;\n N *= C_TEN;\n }\n str += \")\";\n } else {\n for (let i = dec; N && i--;) {\n str += trunc(N / D);\n N %= D;\n N *= C_TEN;\n }\n }\n return str;\n },\n\n /**\n * Returns a string-fraction representation of a Fraction object\n *\n * Ex: new Fraction(\"1.'3'\").toFraction() => \"4 1/3\"\n **/\n 'toFraction': function (showMixed) {\n\n let n = this[\"n\"];\n let d = this[\"d\"];\n let str = this['s'] < C_ZERO ? \"-\" : \"\";\n\n if (d === C_ONE) {\n str += n;\n } else {\n let whole = trunc(n / d);\n if (showMixed && whole > C_ZERO) {\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 (showMixed) {\n\n let n = this[\"n\"];\n let d = this[\"d\"];\n let str = this['s'] < C_ZERO ? \"-\" : \"\";\n\n if (d === C_ONE) {\n str += n;\n } else {\n let whole = trunc(n / d);\n if (showMixed && whole > C_ZERO) {\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 let a = this['n'];\n let b = this['d'];\n let res = [];\n\n do {\n res.push(trunc(a / b));\n let t = a % b;\n a = b;\n b = t;\n } while (a !== C_ONE);\n\n return res;\n },\n\n \"simplify\": function (eps) {\n\n const ieps = BigInt(1 / (eps || 0.001) | 0);\n\n const thisABS = this['abs']();\n const cont = thisABS['toContinued']();\n\n for (let i = 1; i < cont.length; i++) {\n\n let s = newFraction(cont[i - 1], C_ONE);\n for (let k = i - 2; k >= 0; k--) {\n s = s['inverse']()['add'](cont[k]);\n }\n\n let t = s['sub'](thisABS);\n if (t['n'] * ieps < t['d']) { // More robust than Math.abs(t.valueOf()) < eps\n return s['mul'](this['s']);\n }\n }\n return this;\n }\n};\nexport {\n Fraction as default, Fraction\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: String(this.s * this.n),\n d: String(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 { isBigInt, isBigNumber } from '../../utils/is.js'\nimport { format, sign, nearlyEqual } 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 of numbers. A range has a start, step, and end,\n * and contains functions 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 * Note that the endpoints and step may be specified with other numeric\n * types such as bigint or BigNumber, but they will be demoted to the\n * built-in `number` type and the Range will only contain numbers. The\n * rationale for this demotion is that Range objects are primarily used\n * for indexing Matrix objects, and Matrix objects may only be indexed\n * with `number`s.\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' && !isBigInt(start)) {\n throw new TypeError('Parameter start must be a number or bigint')\n }\n }\n if (hasEnd) {\n if (isBigNumber(end)) {\n end = end.toNumber()\n } else if (typeof end !== 'number' && !isBigInt(end)) {\n throw new TypeError('Parameter end must be a number or bigint')\n }\n }\n if (hasStep) {\n if (isBigNumber(step)) {\n step = step.toNumber()\n } else if (typeof step !== 'number' && !isBigInt(step)) {\n throw new TypeError('Parameter step must be a number or bigint')\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 if (hasStep && nearlyEqual(this.step, 0)) {\n throw new Error('Step must not be zero')\n }\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 === 'bigint' &&\n typeof value.n === 'bigint' &&\n typeof value.d === 'bigint') || 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 children 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} value 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 an index has empty values\n * @param {Index} 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 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 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, true) // since it has rectangular\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 one 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 dimension 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 * Parameter `size` will be mutated to match the new, unsqueezed 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 unsqueezed 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 * @param {boolean} isRectangular Optional. If the array is rectangular (not jagged)\n * @return {Array} The flattened array (1 dimensional)\n */\nexport function flatten (array, isRectangular = false) {\n if (!Array.isArray(array)) {\n // if not an array, return as is\n return array\n }\n if (typeof isRectangular !== 'boolean') {\n throw new TypeError('Boolean expected for second argument of flatten')\n }\n const flat = []\n\n if (isRectangular) {\n _flattenRectangular(array)\n } else {\n _flatten(array)\n }\n\n return flat\n\n function _flatten (array) {\n for (let i = 0; i < array.length; i++) {\n const item = array[i]\n if (Array.isArray(item)) {\n _flatten(item)\n } else {\n flat.push(item)\n }\n }\n }\n\n function _flattenRectangular (array) {\n if (Array.isArray(array[0])) {\n for (let i = 0; i < array.length; i++) {\n _flattenRectangular(array[i])\n }\n } else {\n for (let i = 0; i < array.length; i++) {\n flat.push(array[i])\n }\n }\n }\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 an array 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} 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} array\n * @returns {Array}\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 are 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 {Array}\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 gets the broadcasted size for both.\n * @param {...number[]} sizes Sizes to broadcast together\n * @returns {number[]} The broadcasted size\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 mismatch: mismatch 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 {Array} 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 {Array[]} The broadcasted arrays\n */\nexport function broadcastArrays (...arrays) {\n if (arrays.length === 0) {\n throw new Error('Insufficient number of arguments 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 {Array} The stretched array\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} index - 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(get(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 * Recursively maps over each element of nested array using a provided callback function.\n *\n * @param {Array} array - The array to be mapped.\n * @param {Function} callback - The function to execute on each element, taking three arguments:\n * - `value` (any): The current element being processed in the array.\n * - `index` (Array): The index of the current element being processed in the array.\n * - `array` (Array): The array `deepMap` was called upon.\n * @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value.\n * @returns {Array} A new array with each element being the result of the callback function.\n */\nexport function deepMap (array, callback, skipIndex = false) {\n if (array.length === 0) {\n return []\n }\n\n if (skipIndex) {\n return recursiveMap(array)\n }\n const index = []\n\n return recursiveMapWithIndex(array, 0)\n\n function recursiveMapWithIndex (value, depth) {\n if (Array.isArray(value)) {\n const N = value.length\n const result = Array(N)\n for (let i = 0; i < N; i++) {\n index[depth] = i\n result[i] = recursiveMapWithIndex(value[i], depth + 1)\n }\n return result\n } else {\n return callback(value, index.slice(0, depth), array)\n }\n }\n function recursiveMap (value) {\n if (Array.isArray(value)) {\n const N = value.length\n const result = Array(N)\n for (let i = 0; i < N; i++) {\n result[i] = recursiveMap(value[i])\n }\n return result\n } else {\n return callback(value)\n }\n }\n}\n\n/**\n * Recursively iterates over each element in a multi-dimensional array and applies a callback function.\n *\n * @param {Array} array - The multi-dimensional array to iterate over.\n * @param {Function} callback - The function to execute for each element. It receives three arguments:\n * - {any} value: The current element being processed in the array.\n * - {Array} index: The index of the current element in each dimension.\n * - {Array} array: The original array being processed.\n * @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value.\n */\nexport function deepForEach (array, callback, skipIndex = false) {\n if (array.length === 0) {\n return\n }\n\n if (skipIndex) {\n recursiveForEach(array)\n return\n }\n const index = []\n recursiveForEachWithIndex(array, 0)\n\n function recursiveForEachWithIndex (value, depth) {\n if (Array.isArray(value)) {\n const N = value.length\n for (let i = 0; i < N; i++) {\n index[depth] = i\n recursiveForEachWithIndex(value[i], depth + 1)\n }\n } else {\n callback(value, index.slice(0, depth), array)\n }\n }\n function recursiveForEach (value) {\n if (Array.isArray(value)) {\n const N = value.length\n for (let i = 0; i < N; i++) {\n recursiveForEach(value[i])\n }\n } else {\n callback(value)\n }\n }\n}\n\n/**\n * Deep clones a multidimensional array\n * @param {Array} array\n * @returns {Array} 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 * @param {boolean} isUnary If true, the callback function is unary and will be optimized as such.\n * @returns {Function} Returns a simplified version of the callback function.\n */\nexport function optimizeCallback (callback, array, name, isUnary) {\n if (typed.isTypedFunction(callback)) {\n let numberOfArguments\n if (isUnary) {\n numberOfArguments = 1\n } else {\n const size = array.isMatrix ? array.size() : arraySize(array)\n\n // Check the size of the last dimension to see if the array/matrix is empty\n const isEmpty = size.length ? size[size.length - 1] === 0 : true\n if (isEmpty) {\n // don't optimize callbacks for empty arrays/matrix, as they will never be called\n // and in fact will throw an exception when we try to access the first element below\n return { isUnary, fn: callback }\n }\n\n const firstIndex = size.map(() => 0)\n const firstValue = array.isMatrix ? array.get(firstIndex) : get(array, firstIndex)\n numberOfArguments = _findNumberOfArgumentsTyped(callback, firstValue, firstIndex, array)\n }\n let fastCallback\n if (array.isMatrix && (array.dataType !== 'mixed' && array.dataType !== undefined)) {\n const singleSignature = _findSingleSignatureWithArity(callback, numberOfArguments)\n fastCallback = (singleSignature !== undefined) ? singleSignature : callback\n } else {\n fastCallback = callback\n }\n if (numberOfArguments >= 1 && numberOfArguments <= 3) {\n return {\n isUnary: numberOfArguments === 1,\n fn: (...args) => _tryFunctionWithArgs(fastCallback, args.slice(0, numberOfArguments), name, callback.name)\n }\n }\n return { isUnary: false, fn: (...args) => _tryFunctionWithArgs(fastCallback, args, name, callback.name) }\n }\n if (isUnary === undefined) {\n return { isUnary: _findIfCallbackIsUnary(callback), fn: callback }\n } else {\n return { isUnary, fn: callback }\n }\n}\n\nfunction _findSingleSignatureWithArity (callback, arity) {\n const matchingFunctions = []\n Object.entries(callback.signatures).forEach(([signature, func]) => {\n if (signature.split(',').length === arity) {\n matchingFunctions.push(func)\n }\n })\n if (matchingFunctions.length === 1) {\n return matchingFunctions[0]\n }\n}\n\n/**\n * Determines if a given callback function is unary (i.e., takes exactly one argument).\n *\n * This function checks the following conditions to determine if the callback is unary:\n * 1. The callback function should have exactly one parameter.\n * 2. The callback function should not use the `arguments` object.\n * 3. The callback function should not use rest parameters (`...`).\n * If in doubt, this function shall return `false` to be safe\n *\n * @param {Function} callback - The callback function to be checked.\n * @returns {boolean} - Returns `true` if the callback is unary, otherwise `false`.\n */\nfunction _findIfCallbackIsUnary (callback) {\n if (callback.length !== 1) return false\n\n const callbackStr = callback.toString()\n // Check if the callback function uses `arguments`\n if (/arguments/.test(callbackStr)) return false\n\n // Extract the parameters of the callback function\n const paramsStr = callbackStr.match(/\\(.*?\\)/)\n // Check if the callback function uses rest parameters\n if (/\\.\\.\\./.test(paramsStr)) return false\n return true\n}\n\nfunction _findNumberOfArgumentsTyped (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 'config'\n]\n\nexport const createDenseMatrixClass = /* #__PURE__ */ factory(name, dependencies, ({ Matrix, config }) => {\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 = config.legacySubset\n ? index.size().every(idx => idx === 1)\n : 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 const returnMatrix = new DenseMatrix()\n const submatrix = _getSubmatrix(matrix._data, index)\n returnMatrix._size = submatrix.size\n returnMatrix._datatype = matrix._datatype\n returnMatrix._data = submatrix.data\n return config.legacySubset ? returnMatrix.reshape(index.size()) : returnMatrix\n }\n }\n\n /**\n * 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 * @return {Array} submatrix\n * @private\n */\n function _getSubmatrix (data, index) {\n const maxDepth = index.size().length - 1\n const size = Array(maxDepth)\n return { data: getSubmatrixRecursive(data), size: size.filter(x => x !== null) }\n\n function getSubmatrixRecursive (data, depth = 0) {\n const dims = index.dimension(depth)\n function _mapIndex (dim, callback) {\n // applies a callback for when the index is a Number or a Matrix\n if (isNumber(dim)) return callback(dim)\n else return dim.map(callback).valueOf()\n }\n\n if (isNumber(dims)) {\n size[depth] = null\n } else {\n size[depth] = dims.size()[0]\n }\n if (depth < maxDepth) {\n return _mapIndex(dims, dimIndex => {\n validateIndex(dimIndex, data.length)\n return getSubmatrixRecursive(data[dimIndex], depth + 1)\n })\n } else {\n return _mapIndex(dims, dimIndex => {\n validateIndex(dimIndex, data.length)\n return data[dimIndex]\n })\n }\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 submatrixSize\n if (isMatrix(submatrix)) {\n submatrixSize = submatrix.size()\n submatrix = submatrix.valueOf()\n } else {\n submatrixSize = arraySize(submatrix)\n }\n\n if (isScalar) {\n // set a scalar\n\n // check whether submatrix is a scalar\n if (submatrixSize.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(submatrixSize, iSize)) {\n if (submatrixSize.length === 0) {\n submatrix = broadcastTo([submatrix], iSize)\n } else {\n try {\n submatrix = broadcastTo(submatrix, iSize)\n } catch (error) {\n }\n }\n submatrixSize = arraySize(submatrix)\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 (submatrixSize.length < iSize.length) {\n // calculate number of missing outer dimensions\n let i = 0\n let outer = 0\n while (iSize[i] === 1 && submatrixSize[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, submatrixSize)\n }\n\n // check whether the size of the submatrix matches the index size\n if (!deepStrictEqual(iSize, submatrixSize)) {\n throw new DimensionError(iSize, submatrixSize, '>')\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 _setSubmatrix(matrix._data, index, submatrix)\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 * @private\n */\n function _setSubmatrix (data, index, submatrix) {\n const maxDepth = index.size().length - 1\n\n setSubmatrixRecursive(data, submatrix)\n\n function setSubmatrixRecursive (data, submatrix, depth = 0) {\n const range = index.dimension(depth)\n const recursiveCallback = (rangeIndex, i) => {\n validateIndex(rangeIndex, data.length)\n setSubmatrixRecursive(data[rangeIndex], submatrix[i[0]], depth + 1)\n }\n const finalCallback = (rangeIndex, i) => {\n validateIndex(rangeIndex, data.length)\n data[rangeIndex] = submatrix[i[0]]\n }\n\n if (depth < maxDepth) {\n if (isNumber(range)) recursiveCallback(range, [0])\n else range.forEach(recursiveCallback)\n } else {\n if (isNumber(range)) finalCallback(range, [0])\n else range.forEach(finalCallback)\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 * 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 * @param {boolean} skipZeros If true, the callback function is invoked only for non-zero entries\n * @param {boolean} isUnary If true, the callback function is invoked with one parameter\n *\n * @return {DenseMatrix} matrix\n */\n DenseMatrix.prototype.map = function (callback, skipZeros = false, isUnary = false) {\n const me = this\n const maxDepth = me._size.length - 1\n\n if (maxDepth < 0) return me.clone()\n\n const fastCallback = optimizeCallback(callback, me, 'map', isUnary)\n const fastCallbackFn = fastCallback.fn\n\n const result = me.create(undefined, me._datatype)\n result._size = me._size\n if (isUnary || fastCallback.isUnary) {\n result._data = iterateUnary(me._data)\n return result\n }\n if (maxDepth === 0) {\n const inputData = me.valueOf()\n const data = Array(inputData.length)\n for (let i = 0; i < inputData.length; i++) {\n data[i] = fastCallbackFn(inputData[i], [i], me)\n }\n result._data = data\n return result\n }\n\n const index = []\n result._data = iterate(me._data)\n return result\n\n function iterate (data, depth = 0) {\n const result = Array(data.length)\n if (depth < maxDepth) {\n for (let i = 0; i < data.length; i++) {\n index[depth] = i\n result[i] = iterate(data[i], depth + 1)\n }\n } else {\n for (let i = 0; i < data.length; i++) {\n index[depth] = i\n result[i] = fastCallbackFn(data[i], index.slice(), me)\n }\n }\n return result\n }\n\n function iterateUnary (data, depth = 0) {\n const result = Array(data.length)\n if (depth < maxDepth) {\n for (let i = 0; i < data.length; i++) {\n result[i] = iterateUnary(data[i], depth + 1)\n }\n } else {\n for (let i = 0; i < data.length; i++) {\n result[i] = fastCallbackFn(data[i])\n }\n }\n return result\n }\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 * @param {boolean} skipZeros If true, the callback function is invoked only for non-zero entries\n * @param {boolean} isUnary If true, the callback function is invoked with one parameter\n */\n DenseMatrix.prototype.forEach = function (callback, skipZeros = false, isUnary = false) {\n const me = this\n const maxDepth = me._size.length - 1\n\n if (maxDepth < 0) return\n\n const fastCallback = optimizeCallback(callback, me, 'map', isUnary)\n const fastCallbackFn = fastCallback.fn\n if (isUnary || fastCallback.isUnary) {\n iterateUnary(me._data)\n return\n }\n if (maxDepth === 0) {\n for (let i = 0; i < me._data.length; i++) {\n fastCallbackFn(me._data[i], [i], me)\n }\n return\n }\n const index = []\n iterate(me._data)\n\n function iterate (data, depth = 0) {\n if (depth < maxDepth) {\n for (let i = 0; i < data.length; i++) {\n index[depth] = i\n iterate(data[i], depth + 1)\n }\n } else {\n for (let i = 0; i < data.length; i++) {\n index[depth] = i\n fastCallbackFn(data[i], index.slice(), me)\n }\n }\n }\n\n function iterateUnary (data, depth = 0) {\n if (depth < maxDepth) {\n for (let i = 0; i < data.length; i++) {\n iterateUnary(data[i], depth + 1)\n }\n } else {\n for (let i = 0; i < data.length; i++) {\n fastCallbackFn(data[i])\n }\n }\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 maxDepth = this._size.length - 1\n\n if (maxDepth < 0) {\n return\n }\n\n if (maxDepth === 0) {\n for (let i = 0; i < this._data.length; i++) {\n yield ({ value: this._data[i], index: [i] })\n }\n return\n }\n\n // Multi-dimensional matrix: iterate over all elements\n const index = Array(maxDepth + 1).fill(0)\n const totalElements = this._size.reduce((a, b) => a * b, 1)\n\n for (let count = 0; count < totalElements; count++) {\n // Traverse to the current element using indices\n let current = this._data\n for (let d = 0; d < maxDepth; d++) {\n current = current[index[d]]\n }\n yield { value: current[index[maxDepth]], index: index.slice() }\n\n // Increment indices for next element\n for (let d = maxDepth; d >= 0; d--) {\n index[d]++\n if (index[d] < this._size[d]) break\n index[d] = 0\n }\n }\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, deepMap as arrayDeepMap, deepForEach as arrayDeepForEach } 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.forEach(x => callback(x), false, true)\n } else {\n arrayDeepForEach(array, callback, true)\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 (!skipZeros) {\n if (isMatrix(array)) {\n return array.map(x => callback(x), false, true)\n } else {\n return arrayDeepMap(array, callback, true)\n }\n }\n const skipZerosCallback = (x) => x === 0 ? x : callback(x)\n if (isMatrix(array)) {\n return array.map(x => skipZerosCallback(x), false, true)\n } else {\n return arrayDeepMap(array, skipZerosCallback, true)\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 { factory } from '../../utils/factory.js'\n\nconst name = 'isInteger'\nconst dependencies = ['typed', 'equal']\n\nexport const createIsInteger = /* #__PURE__ */ factory(name, dependencies, ({\n typed, equal\n}) => {\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 TypeError\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: n => Number.isFinite(n) ? equal(n, Math.round(n)) : false,\n\n BigNumber: b => b.isFinite() ? equal(b.round(), b) : false,\n\n bigint: b => true,\n\n Fraction: r => r.d === 1n,\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 < 0n, // 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, isFinite, isBounded\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 > 0n && x.n > 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'\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, isFinite, isBounded\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'\n\nconst name = 'isBounded'\nconst dependencies = ['typed']\n\nexport const createIsBounded = /* #__PURE__ */ factory(name, dependencies, ({\n typed\n}) => {\n /**\n * Test whether a value is bounded. For scalars, this test is equivalent\n * to the isFinite finiteness test. On the other hand, a Matrix or Array\n * is defined to be bounded if every entry is finite.\n *\n * Syntax:\n *\n * math.isBounded(x)\n *\n * Examples:\n *\n * math.isBounded(0) // returns true\n * math.isBounded(NaN) // returns false\n * math.isBounded(math.bignumber(Infinity)) // returns false\n * math.isBounded(math.fraction(1,3)) // returns true\n * math.isBounded(math.complex('2 - 4i')) // returns true\n * math.isBounded(-10000000000000000n) // returns true\n * math.isBounded(undefined) // returns false\n * math.isBounded(null) // returns false\n * math.isBounded([0.001, -3n, 0]) // returns true\n * math.isBounded([2, -Infinity, -3]) // returns false\n *\n * See also:\n *\n * isFinite, isNumeric, isPositive, isNegative, isNaN\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested\n * @return {boolean} Returns true when `x` is bounded.\n */\n return typed(name, {\n number: n => Number.isFinite(n),\n 'BigNumber | Complex': x => x.isFinite(),\n 'bigint | Fraction': () => true,\n 'null | undefined': () => false,\n Unit: typed.referToSelf(self => x => self(x.value)),\n 'Array | Matrix': typed.referToSelf(self => A => {\n if (!Array.isArray(A)) A = A.valueOf()\n return A.every(entry => self(entry))\n })\n })\n})\n","import { factory } from '../../utils/factory.js'\n\nconst name = 'isFinite'\nconst dependencies = ['typed', 'isBounded', 'map']\n\nexport const createIsFinite = /* #__PURE__ */ factory(name, dependencies, ({\n typed, isBounded, map\n}) => {\n /**\n * Test whether a value is finite.\n *\n * Operates elementwise on Array and Matrix values. To test if all entries\n * of an Array or Matrix are finite, use isBounded.\n *\n * Syntax:\n *\n * math.isFinite(x)\n *\n * Examples:\n *\n * math.isFinite(0) // returns true\n * math.isFinite(NaN) // returns false\n * math.isFinite(math.bignumber(Infinity)) // returns false\n * math.isFinite(math.fraction(1,3)) // returns true\n * math.isFinite(math.complex('2 - 4i')) // returns true\n * math.isFinite(-10000000000000000n) // returns true\n * math.isFinite(undefined) // returns false\n * math.isFinite(null) // returns false\n * math.isFinite([0.001, -3n, 0]) // Array [true, true, true]\n * math.isFinite([2, -Infinity, -3]) // Array [true, false, true]\n *\n * See also:\n *\n * isBounded isNumeric, isPositive, isNegative, isNaN\n *\n * History:\n *\n * v15.1 Created\n *\n * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x\n * Value to be tested\n * @return {boolean | Array | Matrix}\n * Whether the value, or its entries, are finite, as appropriate\n * to its type\n */\n return typed(name, {\n 'Array | Matrix': A => map(A, isBounded),\n any: x => isBounded(x)\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 (currently) implements 2D\n * matrices only via the format known as\n * [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS)).\n *\n * The structure/invariants of the internal data should be:\n * 1. _values is an array of the nonzero values in order from top to bottom\n * (of each column), left to right.\n * 2. _index is an array of row numbers, of the same length as and\n * corresponding positionally to _values.\n * 3. _ptr is an array of length one more than the number of columns. For j\n * less than the number of columns, the \"half-open\" span of indices\n * _ptr[j] to _ptr[j+1] (i.e. including _ptr[j] if it is less than\n * _ptr[j+1], but never including _ptr[j+1]) are the indices in _values\n * of the nonzero elements in column j. Note there are no nonzero elements\n * in column j exactly when _ptr[j] === _ptr[j+1], and that the final\n * entry in _ptr is always exactly the number of nonzero entries in the\n * matrix.\n * 4. _size is a length-2 array consisting of the number of rows followed by\n * the number of columns.\n * 5. _datatype, if set, is the mathjs typeOf value of all entries of the\n * SparseMatrix.\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 while (matrix._ptr.length <= columns) {\n matrix._ptr.push(matrix._index.length)\n }\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 function rowsCallback (i, r) {\n // update permutation vector\n pv[i] = r[0]\n // mark i in workspace\n w[i] = true\n }\n if (Number.isInteger(rows)) rowsCallback(rows, [0])\n else rows.forEach(rowsCallback)\n\n // result matrix arrays\n const values = mvalues ? [] : undefined\n const index = []\n const ptr = []\n\n // loop columns in result matrix\n function columnsCallback (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 if (Number.isInteger(columns)) columnsCallback(columns)\n else columns.forEach(columnsCallback)\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 _forEachIndex(range, (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 _forEachIndex(firstDimensionRange, (firstDataIndex, firstSubIndex) => {\n validateIndex(firstDataIndex)\n _forEachIndex(secondDimensionRange, (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 function _forEachIndex (index, callback) {\n // iterate cases where index is a Matrix or a Number\n if (isNumber(index)) callback(index, [0])\n else index.forEach(callback)\n }\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.fn(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 // TODO apply a non indexed version of algorithm in case fastCallback is not optimized\n fastCallback.fn(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.fn(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 * History:\n *\n * v13 Created\n * v14.2.1 Added conversion options\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 * History:\n *\n * v0.9 Created\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 * History:\n *\n * v0.11 Created\n * v0.16 Added conversion from BigNumber\n * v14.2.1 Added conversion from bigint\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(String(x.n)).div(String(x.d)).times(String(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 * History:\n *\n * v0.5 Created\n * v0.16 Added conversion from BigNumber\n * v6 Added conversion from Fraction\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 * History:\n *\n * v2 Created\n * v3 Added conversion from BigNumber\n * v11.8 Added conversion from Unit\n * v13 Added conversion from bigint\n * v14 Move to bigint-based fraction.js@5; construct from two bigints\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 (!Number.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 'bigint, bigint': 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 * History:\n *\n * v0.5 Created\n * v1.5 Support dense or sparse Matrix types; allow construction\n * from string, Array, or another Matrix.\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`\n * is an array.\n * Passing `size` as a Matrix or specifying a `format` will result in\n * 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 * Where:\n *\n * - `size: (number[] | Matrix)`\n * A vector giving the extent of the array to be created in each\n * dimension. If size has one entry, a vector is created; if it\n * has two, a rectangular array/Matrix is created; if three, a\n * three-dimensional array/Matrix is created; and so on.\n * - `fn: (index: number[]) => MathType`\n * The callback function that will generate the entries of the\n * matrix. It is called in turn with the index of each entry of\n * the matrix. The index is always an ordinary array of numbers\n * with the same length as _size_. So for vectors, you will get\n * indices like `[0]` or `[1]`, whereas for matrices, you will\n * get indices like `[2, 0]` or `[1,3]`. The return value may\n * be any type that can go in an array or Matrix entry, although\n * if you supply the _datatype_ argument, you must yourself ensure\n * the type of the return value matches. Note that currently,\n * your callback _fn_ will receive 0-based indices for the matrix\n * entries, regardless of whether matrixFromFunction is invoked\n * directly from JavaScript or via the mathjs expression language.\n * - `format: 'dense'|'sparse'`\n * Specifies the storage format for the resulting Matrix. Note that\n * if this argument is given, the return value will always be a\n * Matrix (rather than possibly an Array).\n * - `datatype: string`\n * Specifies the data type of entries of the new matrix. If given,\n * it should be the name of a data type that mathjs supports, as\n * returned by the math.typeOf function. It is up to the caller\n * to make certain that all values returned by _fn_ are consistent\n * with this datatype if specified.\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, typeOf, 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 = 'mapSlices'\nconst dependencies = ['typed', 'isInteger']\n\nexport const createMapSlices = /* #__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.mapSlices(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.mapSlices(A, 0, sum) // returns [4, 6]\n * math.mapSlices(A, 1, sum) // returns [3, 7]\n *\n * See also:\n *\n * map, filter, forEach\n *\n * Note:\n *\n * `mapSlices()` is also currently available via its deprecated\n * synonym `apply()`.\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 mapped on the slices 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(_mapSlices(mat.valueOf(), dim, callback), mat.datatype())\n } else {\n return _mapSlices(mat, dim, callback)\n }\n }\n })\n}, { formerly: 'apply' })\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 _mapSlices (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] = _mapSlices(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] = _mapSlices(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 1.7320508075689 + i ...\n * math.cbrt(x, true)\n * // Complex Matrix [\"1.7320508075689+i\", \"-1.7320508075689+i\", \"-2i\"]\n *\n * See also:\n *\n * square, sqrt, cube\n *\n * History:\n *\n * v2.3 Created\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 { isInteger, 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\nconst bigTen = new Decimal(10)\n\nexport const createCeilNumber = /* #__PURE__ */ factory(\n name, ['typed', 'config', 'round'], ({ typed, config, round }) => {\n function _ceilNumber (x) {\n // See ./floor.js _floorNumber for rationale here\n const c = Math.ceil(x)\n const r = round(x)\n if (c === r) return c\n if (\n nearlyEqual(x, r, config.relTol, config.absTol) &&\n !nearlyEqual(x, c, config.relTol, config.absTol)\n ) {\n return r\n }\n return c\n }\n\n return typed(name, {\n number: _ceilNumber,\n 'number, number': function (x, n) {\n if (!isInteger(n)) {\n throw new RangeError(\n 'number of decimals in function ceil must be an integer')\n }\n if (n < 0 || n > 15) {\n throw new RangeError(\n 'number of decimals in ceil number must be in range 0-15')\n }\n const shift = 10 ** n\n return _ceilNumber(x * shift) / shift\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 function _bigCeil (x) {\n // see ./floor.js _floorNumber for rationale\n const bne = (a, b) => bigNearlyEqual(a, b, config.relTol, config.absTol)\n const c = x.ceil()\n const r = round(x)\n if (c.eq(r)) return c\n if (bne(x, r) && !bne(x, c)) return r\n return c\n }\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 * math.ceil(unit, valuelessUnit)\n * math.ceil(unit, n, valuelessUnit)\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 * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.ceil(unit, 1, cm) // returns Unit 3.3 cm ...\n * math.ceil(unit, 1, mm) // returns Unit 32.5 mm\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 * History:\n *\n * v14 Handle Units\n * v7.4 Allow second \"precision\" argument\n * v5.7 Support tolerance for round-off errors\n * v2 Handle Fractions\n * v0.1 Created\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 | Unit | 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: _bigCeil,\n\n 'BigNumber, BigNumber': function (x, n) {\n const shift = bigTen.pow(n)\n return _bigCeil(x.mul(shift)).div(shift)\n },\n\n bigint: b => b,\n 'bigint, number': (b, _dummy) => b,\n 'bigint, BigNumber': (b, _dummy) => b,\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 '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 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since ceil(0) = 0\n return deepMap(x, (value) => self(value, n, unit), true)\n }),\n\n 'Array | Matrix | Unit, 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 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 [2.718281828459045, 7.3890560989306495, 20.085536923187668]\n *\n * See also:\n *\n * expm1, expm, log, pow\n *\n * History:\n *\n * v11 Don't apply elementwise, avoid confusion with matrix exponential\n * v0.20 Handle BigNumbers\n * v0.0.2 Created\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 [1.718281828459045, 6.3890560989306495, 19.085536923187668]\n *\n * See also:\n *\n * exp, expm, log, pow\n *\n * History:\n *\n * v11 Don't apply elementwise, avoids confusion with matrix exponential\n * v4.2 Created\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 * math.fix(unit, valuelessUnit)\n * math.fix(unit, n, valuelessUnit)\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 * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.fix(unit, 1, cm) // returns Unit 3.2 cm ...\n * math.fix(unit, 1, mm) // returns Unit 32.4 mm\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 * History:\n *\n * v14 Handle Units\n * v7.4 Allow second \"precision\" argument\n * v5.7 Support tolerance for round-off errors\n * v2 Handle Fractions\n * v0.1 Created\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 | Unit | 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 bigint: b => b,\n 'bigint, number': (b, _dummy) => b,\n 'bigint, BigNumber': (b, _dummy) => b,\n\n Fraction: function (x) {\n return x.s < 0n ? x.ceil() : x.floor()\n },\n\n 'Fraction, number | BigNumber': function (x, n) {\n return x.s < 0n ? ceil(x, n) : floor(x, n)\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 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since fix(0) = 0\n return deepMap(x, (value) => self(value, n, unit), true)\n }),\n\n 'Array | Matrix | Unit, 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 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 { isInteger, 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\nconst bigTen = new Decimal(10)\n\nexport const createFloorNumber = /* #__PURE__ */ factory(\n name, ['typed', 'config', 'round'], ({ typed, config, round }) => {\n function _floorNumber (x) {\n // First, if the floor and the round are identical we can be\n // quite comfortable that is the best answer:\n const f = Math.floor(x)\n const r = round(x)\n if (f === r) return f\n // OK, they are different. If x is truly distinct from f but\n // appears indistinguishable from r, presume it really is just\n // the integer r with rounding/computation error, and return that\n if (\n nearlyEqual(x, r, config.relTol, config.absTol) &&\n !nearlyEqual(x, f, config.relTol, config.absTol)\n ) {\n return r\n }\n // Otherwise (x distinct from both r and f, or indistinguishable from\n // both r and f) may as well just return f, as that's the best\n // candidate we can discern:\n return f\n }\n\n return typed(name, {\n number: _floorNumber,\n 'number, number': function (x, n) {\n if (!isInteger(n)) {\n throw new RangeError(\n 'number of decimals in function floor must be an integer')\n }\n if (n < 0 || n > 15) {\n throw new RangeError(\n 'number of decimals in floor number must be in range 0 - 15')\n }\n const shift = 10 ** n\n return _floorNumber(x * shift) / shift\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 function _bigFloor (x) {\n // see _floorNumber above for rationale\n const bne = (a, b) => bigNearlyEqual(a, b, config.relTol, config.absTol)\n const f = x.floor()\n const r = round(x)\n if (f.eq(r)) return f\n if (bne(x, r) && !bne(x, f)) return r\n return f\n }\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 * math.floor(unit, valuelessUnit)\n * math.floor(unit, n, valuelessUnit)\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 * const unit = math.unit('3.241 cm')\n * const cm = math.unit('cm')\n * const mm = math.unit('mm')\n * math.floor(unit, 1, cm) // returns Unit 3.2 cm ...\n * math.floor(unit, 1, mm) // returns Unit 32.4 mm\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 * History:\n *\n * v14 Handle Units\n * v7.4 Allow second \"precision\" argument\n * v5.7 Support tolerance for round-off errors\n * v2 Handle Fractions\n * v0.1 Created\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 | Unit | 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: _bigFloor,\n\n 'BigNumber, BigNumber': function (x, n) {\n const shift = bigTen.pow(n)\n return _bigFloor(x.mul(shift)).div(shift)\n },\n\n bigint: b => b,\n 'bigint, number': (b, _dummy) => b,\n 'bigint, BigNumber': (b, _dummy) => b,\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 '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 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => {\n // deep map collection, skip zeros since floor(0) = 0\n return deepMap(x, (value) => self(value, n, unit), true)\n }),\n\n 'Array | Matrix | Unit, 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 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 * isOdd(2) // returns false...\n * isOdd(3) // returns true\n *\n * See also:\n *\n * divide\n *\n * History:\n *\n * v13 Handle bigints\n * v11.6 Support matrix broadcasting\n * v2 Handle Fractions\n * v0.2 Created\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","/**\n * Build a bigint logarithm function from a number logarithm,\n * still returning a number. The idea is that 15 hexadecimal digits\n * (60 bits) saturates the mantissa of the log, and each additional hex\n * digit effectively just adds the log of 16 to the resulting value. So\n * convert the most significant 15 hex digits to a number and take its\n * log, and then add the log of 16 for each additional hex digit that\n * was in the bigint.\n * For negative numbers (complex logarithms), following the bignum\n * implementation, it just downgrades to number and uses the complex result.\n * @param {number} log16 the log of 16\n * @param {(number) -> number} numberLog the logarithm function for numbers\n * @param {ConfigurationObject} config the mathjs configuration\n * @param {(number) -> Complex} cplx the associated Complex log\n * @returns {(bigint) -> number} the corresponding logarithm for bigints\n */\nexport function promoteLogarithm (log16, numberLog, config, cplx) {\n return function (b) {\n if (b > 0 || config.predictable) {\n if (b <= 0) return NaN\n const s = b.toString(16)\n const s15 = s.substring(0, 15)\n return log16 * (s.length - s15.length) + numberLog(Number('0x' + s15))\n }\n return cplx(b.toNumber())\n }\n}\n","import { log10Number } from '../../plain/number/index.js'\nimport { promoteLogarithm } from '../../utils/bigint.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'log10'\nconst dependencies = ['typed', 'config', 'Complex']\nconst log16 = log10Number(16)\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\n function complexLog (c) {\n return c.log().div(Math.LN10)\n }\n\n function complexLogNumber (x) {\n return complexLog(new Complex(x, 0))\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 complexLogNumber(x)\n }\n },\n\n bigint: promoteLogarithm(log16, log10Number, config, complexLogNumber),\n\n Complex: complexLog,\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 complexLogNumber(x.toNumber())\n }\n },\n\n 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))\n })\n})\n","import { log2Number } from '../../plain/number/index.js'\nimport { promoteLogarithm } from '../../utils/bigint.js'\nimport { deepMap } from '../../utils/collection.js'\nimport { factory } from '../../utils/factory.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 function complexLog2Number (x) {\n return _log2Complex(new Complex(x, 0))\n }\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 complexLog2Number(x)\n }\n },\n\n bigint: promoteLogarithm(4, log2Number, config, complexLog2Number),\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 complexLog2Number(x.toNumber())\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\n * math.sqrt(9) // returns 3\n * math.nthRoot(64, 3) // returns 4\n *\n * See also:\n *\n * sqrt, pow\n *\n * History:\n *\n * v11.6 Support matrix broadcasting\n * v2 Handle Complex\n * v1.1 Created\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 x.n === 0n ? new Fraction(0) : new Fraction(x.s)\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', 'SparseMatrix']\n\nexport const createMatAlgo07xSSf = /* #__PURE__ */ factory(name, dependencies, ({ typed, SparseMatrix }) => {\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} SparseMatrix (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 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 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 let zero = 0\n let cf = callback\n\n // process data types\n if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {\n dt = adt\n zero = typed.convert(0, dt)\n cf = typed.find(callback, [dt, dt])\n }\n\n // result arrays for sparse format\n const cvalues = []\n const cindex = []\n const cptr = new Array(columns + 1).fill(0) // Start with column pointer array\n\n // workspaces\n const xa = []\n const xb = []\n const wa = []\n const wb = []\n\n // loop columns\n for (let j = 0; j < columns; j++) {\n const mark = j + 1\n let nonZeroCount = 0\n\n _scatter(a, j, wa, xa, mark)\n _scatter(b, j, wb, xb, mark)\n\n // loop rows\n for (let i = 0; i < rows; i++) {\n const va = wa[i] === mark ? xa[i] : zero\n const vb = wb[i] === mark ? xb[i] : zero\n\n // invoke callback\n const cij = cf(va, vb)\n // Store all non zero and true values\n if (cij !== 0 && cij !== false) {\n cindex.push(i) // row index\n cvalues.push(cij) // computed value\n nonZeroCount++\n }\n }\n\n // Update column pointer with cumulative count of non-zero values\n cptr[j + 1] = cptr[j] + nonZeroCount\n }\n\n // Return the result as a sparse matrix\n return new SparseMatrix({\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 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 'SparseMatrix'\n]\n\nexport const createBitXor = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 | Unit} x\n * A complex number or array with complex numbers\n * @return {number | BigNumber | Complex | Array | Matrix | Unit}\n * The complex conjugate of x\n */\n return typed(name, {\n 'number | BigNumber | Fraction': x => x,\n Complex: x => x.conjugate(),\n Unit: typed.referToSelf(self => x => new x.constructor(self(x.toNumeric()), x.formatUnits())),\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 { factory } from '../../utils/factory.js'\nimport { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'\nimport { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'\nimport { createMatAlgo13xDD } from '../../type/matrix/utils/matAlgo13xDD.js'\nimport { DimensionError } from '../../error/DimensionError.js'\n\nconst name = 'nullish'\nconst dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual']\n\nexport const createNullish = /* #__PURE__ */ factory(\n name,\n dependencies,\n ({ typed, matrix, size, flatten, deepEqual }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo14xDs = createMatAlgo14xDs({ typed })\n const matAlgo13xDD = createMatAlgo13xDD({ typed })\n\n /**\n * Nullish coalescing operator (??). Returns the right-hand side operand\n * when the left-hand side operand is null or undefined, and otherwise\n * returns the left-hand side operand.\n *\n * For matrices, the function is evaluated element wise.\n *\n * Syntax:\n *\n * math.nullish(x, y)\n *\n * Examples:\n *\n * math.nullish(null, 42) // returns 42\n * math.nullish(undefined, 42) // returns 42\n * math.nullish(0, 42) // returns 0\n * math.nullish(false, 42) // returns false\n * math.nullish('', 42) // returns ''\n *\n * // Object property access with fallback\n * const obj = {foo: 7, bar: 3}\n * math.nullish(obj.baz, 0) // returns 0\n *\n * See also:\n *\n * and, or, not\n *\n * @param {*} x First value to check\n * @param {*} y Fallback value\n * @return {*} Returns y when x is null or undefined, otherwise returns x\n */\n\n return typed(\n name,\n {\n // Scalar and SparseMatrix-first short-circuit handlers\n 'number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any': (x, _y) => x,\n 'null, any': (_x, y) => y,\n 'undefined, any': (_x, y) => y,\n\n // SparseMatrix-first with collection RHS: enforce exact shape match\n 'SparseMatrix, Array | Matrix': (x, y) => {\n const sx = size(x)\n const sy = size(y)\n if (deepEqual(sx, sy)) return x\n throw new DimensionError(sx, sy)\n },\n\n // DenseMatrix-first handlers (no broadcasting between collections)\n 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => matAlgo13xDD(x, y, self)),\n 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => matAlgo03xDSf(x, y, self, false)),\n 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => matAlgo13xDD(x, matrix(y), self)),\n 'DenseMatrix, any': typed.referToSelf(self => (x, y) => matAlgo14xDs(x, y, self, false)),\n\n // Array-first handlers (bridge via matrix() where needed)\n 'Array, Array': typed.referToSelf(self => (x, y) => matAlgo13xDD(matrix(x), matrix(y), self).valueOf()),\n 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => matAlgo13xDD(matrix(x), y, self)),\n 'Array, SparseMatrix': typed.referToSelf(self => (x, y) => matAlgo03xDSf(matrix(x), y, self, false)),\n 'Array, any': typed.referToSelf(self => (x, y) => matAlgo14xDs(matrix(x), y, self, false).valueOf())\n }\n )\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 'SparseMatrix'\n]\n\nexport const createXor = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 // once config.legacySubset just return result\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 * The callback is invoked with three arguments: the current value,\n * the current index, and the matrix operated upon.\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.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 if (fastCallback.isUnary) {\n return filter(x, fastCallback.fn)\n }\n return filter(x, function (value, index, array) {\n // invoke the callback function with the right number of arguments\n return fastCallback.fn(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 {DenseMatrix | Array} x Matrix to be flattened\n * @return {DenseMatrix | Array} Returns the flattened matrix\n */\n return typed(name, {\n Array: function (x) {\n return flattenArray(x)\n },\n\n DenseMatrix: 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.valueOf(), true), x.datatype())\n },\n\n SparseMatrix: function (_x) {\n throw new TypeError('SparseMatrix is not supported by function flatten ' +\n 'because it does not support 1D vectors. ' +\n 'Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())')\n }\n })\n})\n","import { optimizeCallback } from '../../utils/optimizeCallback.js'\nimport { factory } from '../../utils/factory.js'\nimport { deepForEach } 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 * The callback is invoked with three arguments: the current value,\n * the current index, and the matrix operated upon.\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.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 const fastCallback = optimizeCallback(callback, array, name)\n deepForEach(array, fastCallback.fn, fastCallback.isUnary)\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 (1-dimensional) vectors,\n * with no dimension checking\n * @param {Array} a First vector\n * @param {Array} b Second vector\n * @returns {Array} the 1-dimensional Kronecker product of a and b\n * @private\n */\n function _kron1d (a, b) {\n // TODO in core overhaul: would be faster to see if we can choose a\n // particular implementation of multiplyScalar at the beginning,\n // rather than re-dispatch for _every_ ordered pair of entries.\n return a.flatMap(x => b.map(y => multiplyScalar(x, y)))\n }\n\n /**\n * Calculate the Kronecker product of two possibly multidimensional arrays\n * @param {Array} a First array\n * @param {Array} b Second array\n * @param {number} [d] common dimension; if missing, compute and match args\n * @returns {Array} Returns the Kronecker product of x and y\n * @private\n */\n function _kron (a, b, d = -1) {\n if (d < 0) {\n let adim = size(a).length\n let bdim = size(b).length\n d = Math.max(adim, bdim)\n while (adim++ < d) a = [a]\n while (bdim++ < d) b = [b]\n }\n\n if (d === 1) return _kron1d(a, b)\n return a.flatMap(aSlice => b.map(bSlice => _kron(aSlice, bSlice, d - 1)))\n }\n})\n","import { optimizeCallback } from '../../utils/optimizeCallback.js'\nimport { arraySize, broadcastSizes, broadcastTo, get, deepMap } 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 * History:\n *\n * v0.13 Created\n * v1.1 Clone the indices on each callback in case callback mutates\n * v13.1 Support multiple inputs to the callback\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 const sizes = Arrays.map(M => M.isMatrix ? M.size() : arraySize(M))\n const newSize = broadcastSizes(...sizes)\n const numberOfArrays = Arrays.length\n\n const _get = firstArrayIsMatrix\n ? (matrix, idx) => matrix.get(idx)\n : get\n\n const firstValues = Arrays.map((collection, i) => {\n const firstIndex = sizes[i].map(() => 0)\n return collection.isMatrix ? collection.get(firstIndex) : get(collection, firstIndex)\n }\n )\n\n const callbackArgCount = typed.isTypedFunction(multiCallback)\n ? _getTypedCallbackArgCount(multiCallback, firstValues, newSize.map(() => 0), Arrays)\n : _getCallbackArgCount(multiCallback, numberOfArrays)\n\n if (callbackArgCount < 2) {\n const callback = _getLimitedCallback(callbackArgCount, multiCallback, null)\n return mapMultiple(Arrays, callback)\n }\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 const callback = _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays)\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\n function mapMultiple (collections, callback) {\n // collections can be matrices or arrays\n // callback must be a function of the form (collections, [index])\n const firstCollection = collections[0]\n const arrays = collections.map((collection) =>\n collection.isMatrix ? collection.valueOf() : collection\n )\n const sizes = collections.map((collection) =>\n collection.isMatrix ? collection.size() : arraySize(collection)\n )\n const finalSize = broadcastSizes(...sizes)\n // the offset means for each initial array, how much smaller is it than the final size\n const offsets = sizes.map((size) => finalSize.length - size.length)\n const maxDepth = finalSize.length - 1\n const callbackUsesIndex = callback.length > 1\n const index = callbackUsesIndex ? [] : null\n const resultsArray = iterate(arrays, 0)\n if (firstCollection.isMatrix) {\n const resultsMatrix = firstCollection.create()\n resultsMatrix._data = resultsArray\n resultsMatrix._size = finalSize\n return resultsMatrix\n } else {\n return resultsArray\n }\n\n function iterate (arrays, depth = 0) {\n // each array can have different sizes\n const currentDimensionSize = finalSize[depth]\n const result = Array(currentDimensionSize)\n if (depth < maxDepth) {\n for (let i = 0; i < currentDimensionSize; i++) {\n if (index) index[depth] = i\n // if there is an offset greater than the current dimension\n // pass the array, if the size of the array is 1 pass the first\n // element of the array\n result[i] = iterate(\n arrays.map((array, arrayIndex) =>\n offsets[arrayIndex] > depth\n ? array\n : array.length === 1\n ? array[0]\n : array[i]\n ),\n depth + 1\n )\n }\n } else {\n for (let i = 0; i < currentDimensionSize; i++) {\n if (index) index[depth] = i\n result[i] = callback(\n arrays.map((a) => (a.length === 1 ? a[0] : a[i])),\n index ? index.slice() : undefined\n )\n }\n }\n return result\n }\n }\n\n /**\n * Creates a limited callback based on the argument pattern.\n * @param {number} callbackArgCount - The argument pattern (0, 1, or 2)\n * @param {Function} multiCallback - The original callback function\n * @param {Array} broadcastedArrays - The broadcasted arrays (for case 2)\n * @returns {Function} The limited callback function\n */\n function _getLimitedCallback (callbackArgCount, multiCallback, broadcastedArrays) {\n switch (callbackArgCount) {\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 /**\n * Determines the argument pattern of a regular callback function.\n * @param {Function} callback - The callback function to analyze\n * @param {number} numberOfArrays - Number of arrays being processed\n * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays\n */\n function _getCallbackArgCount (callback, numberOfArrays) {\n const callbackStr = callback.toString()\n // Check if the callback function uses `arguments`\n if (/arguments/.test(callbackStr)) return 2\n\n // Extract the parameters of the callback function\n const paramsStr = callbackStr.match(/\\(.*?\\)/)\n // Check if the callback function uses rest parameters\n if (/\\.\\.\\./.test(paramsStr)) return 2\n if (callback.length > numberOfArrays + 1) { return 2 }\n if (callback.length === numberOfArrays + 1) { return 1 }\n return 0\n }\n\n /**\n * Determines the argument pattern of a typed callback function.\n * @param {Function} callback - The typed callback function to analyze\n * @param {Array} values - Sample values for signature resolution\n * @param {Array} idx - Sample index for signature resolution\n * @param {Array} arrays - Sample arrays for signature resolution\n * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays\n */\n\n function _getTypedCallbackArgCount (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 * 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 const fastCallback = optimizeCallback(callback, array, name)\n return deepMap(array, fastCallback.fn, fastCallback.isUnary)\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', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive']\n\nexport const createRange = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, bignumber, smaller, smallerEq, larger, largerEq, add, isZero, isPositive }) => {\n /**\n * Create a matrix or array containing a range of values.\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 | bigint | BigNumber | Fraction | Unit}`\n * Start of the range\n * - `end: number | bigint | BigNumber | Fraction | Unit`\n * End of the range, excluded by default, included when parameter includeEnd=true\n * - `step: number | bigint | BigNumber | Fraction | 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 * The function returns a `DenseMatrix` when the library is configured with\n * `config = { matrix: 'Matrix' }, and returns an Array otherwise.\n * Note that the type of the returned values is taken from the type of the\n * provided start/end value. If only one of these is a built-in `number` type,\n * it will be promoted to the type of the other endpoint. However, in the case\n * of Unit values, both endpoints must have compatible units, and the return\n * value will have compatible units as well.\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(2, math.fraction(8,3), math.fraction(1,3)) // [fraction(2), fraction(7,3)]\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 range's `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 string: _strRange,\n 'string, boolean': _strRange,\n\n number: function (oops) {\n throw new TypeError(`Too few arguments to function range(): ${oops}`)\n },\n\n boolean: function (oops) {\n throw new TypeError(`Unexpected type of argument 1 to function range(): ${oops}, number|bigint|BigNumber|Fraction`)\n },\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 // Handle bigints; if either limit is bigint, range should be too\n 'bigint, bigint|number': function (start, end) {\n return _out(_range(start, end, 1n, false))\n },\n 'number, bigint': function (start, end) {\n return _out(_range(BigInt(start), end, 1n, false))\n },\n 'bigint, bigint|number, bigint|number': function (start, end, step) {\n return _out(_range(start, end, BigInt(step), false))\n },\n 'number, bigint, bigint|number': function (start, end, step) {\n return _out(_range(BigInt(start), end, BigInt(step), false))\n },\n 'bigint, bigint|number, boolean': function (start, end, includeEnd) {\n return _out(_range(start, end, 1n, includeEnd))\n },\n 'number, bigint, boolean': function (start, end, includeEnd) {\n return _out(_range(BigInt(start), end, 1n, includeEnd))\n },\n 'bigint, bigint|number, bigint|number, boolean': function (start, end, step, includeEnd) {\n return _out(_range(start, end, BigInt(step), includeEnd))\n },\n 'number, bigint, bigint|number, boolean': function (start, end, step, includeEnd) {\n return _out(_range(BigInt(start), end, BigInt(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\n 'Fraction, Fraction': function (start, end) {\n return _out(_range(start, end, 1, false))\n },\n 'Fraction, Fraction, Fraction': function (start, end, step) {\n return _out(_range(start, end, step, false))\n },\n 'Fraction, Fraction, boolean': function (start, end, includeEnd) {\n return _out(_range(start, end, 1, includeEnd))\n },\n 'Fraction, Fraction, Fraction, boolean': function (start, end, step, includeEnd) {\n return _out(_range(start, end, step, includeEnd))\n },\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 if (isZero(step)) throw new Error('Step must be non-zero')\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 // once config.legacySubset just return result\n return isMatrix(result)\n ? result\n : matrix([[result]])\n }\n})\n","import { arraySize } from '../../utils/array.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'size'\nconst dependencies = ['typed']\n\nexport const createSize = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Calculate the size of a matrix or scalar. Always returns an Array containing numbers.\n *\n * Note that in mathjs v14 and older, function size could return a Matrix depending on\n * the input type and configuration.\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} A vector with size of `x`.\n */\n return typed(name, {\n Matrix: x => x.size(),\n\n Array: arraySize,\n\n string: x => [x.length],\n\n // scalar\n 'number | Complex | BigNumber | Unit | boolean | null': _x => []\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 function callback (v) {\n substr += str.charAt(v)\n }\n if (Number.isInteger(range)) {\n callback(range)\n } else {\n range.forEach(callback)\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 = Number.isInteger(range) ? 1 : 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 function callback (v, i) {\n chars[v] = replacement.charAt(i[0])\n }\n\n if (Number.isInteger(range)) {\n callback(range, [0])\n } else {\n range.forEach(callback)\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', 'isBounded', 'isNegative', 'gamma', 'sin', 'subtract', 'add', '?Complex', '?BigNumber', 'pi']\n\nexport const createZeta = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, multiply, pow, divide, factorial, equal, smallerEq, isBounded, 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 (!isBounded(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: mathIsNaN, 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) && mathIsNaN(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 * History:\n *\n * v0.4 Created\n * v0.7 Round to a consistent number of digits (rather than decimals)\n * v0.15 Added multiple number notations and configurable precision\n * v3 Added support for JSON objects\n * v9 Added binary, hexadecimal, and octal notations\n * v10.4.2 Add `truncate` option\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: '2013-03-23'\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 { factory } from '../../utils/factory.js'\n\nconst name = 'toBest'\nconst dependencies = ['typed']\n\nexport const createToBest = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {\n /**\n * Converts a unit to the most appropriate display unit.\n * When no preferred units are provided, the function automatically find the best prefix.\n * When preferred units are provided, it converts to\n * the unit that gives a value closest to 1.\n *\n * Syntax:\n *\n * math.toBest(unit)\n * math.toBest(unit, unitList)\n * math.toBest(unit, unitList, options)\n *\n * Where:\n * - `unitList` is an optional array of preferred target units as string or Unit.\n * - `options` is an optional object with options, formed as follows:\n * - `offset`: number | BigNumber\n *\n * Examples:\n *\n * math.unit(0.05, 'm').toBest(['cm', 'mm']) // returns Unit 5 cm\n * math.unit(2 / 3, 'cm').toBest() // returns Unit 0.6666666666666666 cm\n * math.unit(10, 'm').toBest(['mm', 'km'], { offset: 1.5 }) // returns Unit 10000 mm\n *\n * See also:\n *\n * unit, to, format\n *\n * @param {Unit} x The unit to be converted\n * @param {Array} [unitList=[]] Optional array of preferred target units\n * @param {Object} [options] Optional options object\n * @return {Unit} Value converted to the best matching unit\n */\n return typed(name, {\n Unit: x => x.toBest(),\n 'Unit, string': (x, unitList) => x.toBest(unitList.split(',')),\n 'Unit, string, Object': (x, unitList, options) => x.toBest(unitList.split(','), options),\n 'Unit, Array': (x, unitList) => x.toBest(unitList),\n 'Unit, Array, Object': (x, unitList, options) => x.toBest(unitList, options)\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 * math.numeric(value, outputType)\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 * History:\n *\n * v6 Created\n * v13 Added `bigint` support\n * v14.2.1 Prefer mathjs `bigint()` to built-in `BigInt()`\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 % 2n === 1n) {\n return ((yFrac.n % 2n === 0n) ? 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 | Unit | 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 // bigints can't be rounded\n bigint: b => b,\n 'bigint, number': (b, _dummy) => b,\n 'bigint, BigNumber': (b, _dummy) => b,\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 'Array | Matrix, number | BigNumber, 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 | Unit, 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 { promoteLogarithm } from '../../utils/bigint.js'\nimport { logNumber } from '../../plain/number/index.js'\n\nconst name = 'log'\nconst dependencies = ['config', 'typed', 'typeOf', 'divideScalar', 'Complex']\nconst nlg16 = Math.log(16)\n\nexport const createLog = /* #__PURE__ */ factory(name, dependencies, ({ typed, typeOf, 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 * History:\n *\n * v0.0.2 Created\n * v0.2 Add optional base argument\n * v0.3 Handle Array input\n * v0.5 Handle Matrix input\n * v0.16 Handle BigNumber input\n * v0.21 Support negative BigNumbers\n * v11 Drop Array/Matrix support in favor of explicit map of\n * the scalar log function, to avoid confusion with the log\n * of a matrix\n * v14 Allow value and base to be Fractions, when the log is rational\n *\n * @param {number | BigNumber | Fraction | Complex} x\n * Value for which to calculate the logarithm.\n * @param {number | BigNumber | Fraction | Complex} [base=e]\n * Optional base for the logarithm. If not provided, the natural\n * logarithm of `x` is calculated.\n * @return {number | BigNumber | Fraction | Complex}\n * Returns the logarithm of `x`\n */\n function complexLog (c) {\n return c.log()\n }\n\n function complexLogNumber (x) {\n return complexLog(new Complex(x, 0))\n }\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 complexLogNumber(x)\n }\n },\n\n bigint: promoteLogarithm(nlg16, logNumber, config, complexLogNumber),\n\n Complex: complexLog,\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 complexLogNumber(x.toNumber())\n }\n },\n\n 'any, any': typed.referToSelf(self => (x, base) => {\n // calculate logarithm for a specified base, log(x, base)\n\n if (typeOf(x) === 'Fraction' && typeOf(base) === 'Fraction') {\n const result = x.log(base)\n\n if (result !== null) {\n return result\n }\n }\n\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 * Note that currently the precision of Complex numbers are limited\n * to the precision of a 64-bit IEEE floating point, so even if the input\n * is a BigNumber with greater precision, rounding to 64 bits will occur\n * in computing the nth roots.\n *\n * Syntax:\n *\n * math.nthRoots(x)\n * math.nthRoots(x, root)\n *\n * Examples:\n *\n * math.nthRoots(1) // returns [ {re: 1, im: 0}, {re: -1, im: 0} ]\n *\n * math.nthRoots(1, 3)\n * // Complex [1, \"-0.5+0.866025403784439i\", \"-0.5-0.866025403784439i\"]\n *\n * See also:\n *\n * nthRoot, pow, sqrt\n *\n * History:\n *\n * v1.1 Created\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 'SparseMatrix'\n]\n\nexport const createDotPow = /* #__PURE__ */ factory(name, dependencies, ({ typed, equalScalar, matrix, pow, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 'SparseMatrix'\n]\n\nexport const createDotDivide = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, divideScalar, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo02xDS0 = createMatAlgo02xDS0({ typed, equalScalar })\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 * History:\n *\n * v0.19 Created\n * v4 Changed to compare strings by numerical value\n * v13 Change to use separate relative and absolute tolerances\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 * History:\n *\n * v15.2 Handle bigints\n * v3.14 Created\n *\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' || typeX === 'bigint') &&\n (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction' || typeY === 'bigint')) {\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 'SparseMatrix'\n]\n\nexport const createEqual = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, equalScalar, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\n const matAlgo12xSfs = createMatAlgo12xSfs({ typed, DenseMatrix })\n const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix })\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 false\n *\n * const a = math.unit('500 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 * 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 * History:\n *\n * v13 Handle bigints\n * v11.6 Support matrix broadcasting\n * v4 Compare strings by their numerical value\n * v0.24 Handle `null` and `undefined`\n * v0.23 Compare collections elementwise\n * v0.20 Compare floating-point numbers within epsilon, allowing roundoff\n * v0.2 Created\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 'bignumber',\n 'matrix',\n 'DenseMatrix',\n 'concat',\n 'SparseMatrix'\n]\n\nexport const createSmaller = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, bignumber, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 function bignumSmaller (x, y) {\n return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol)\n }\n\n return typed(\n name,\n createSmallerNumber({ typed, config }),\n {\n 'boolean, boolean': (x, y) => x < y,\n\n 'BigNumber, BigNumber': bignumSmaller,\n\n 'bigint, bigint': (x, y) => x < y,\n\n 'Fraction, Fraction': (x, y) => (x.compare(y) === -1),\n\n 'Fraction, BigNumber': function (x, y) {\n return bignumSmaller(bignumber(x), y)\n },\n\n 'BigNumber, Fraction': function (x, y) {\n return bignumSmaller(x, bignumber(y))\n },\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 'SparseMatrix'\n]\n\nexport const createSmallerEq = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 'bignumber',\n 'matrix',\n 'DenseMatrix',\n 'concat',\n 'SparseMatrix'\n]\n\nexport const createLarger = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, bignumber, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 function bignumLarger (x, y) {\n return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol)\n }\n\n return typed(\n name,\n createLargerNumber({ typed, config }),\n {\n 'boolean, boolean': (x, y) => x > y,\n\n 'BigNumber, BigNumber': bignumLarger,\n\n 'bigint, bigint': (x, y) => x > y,\n\n 'Fraction, Fraction': (x, y) => (x.compare(y) === 1),\n\n 'Fraction, BigNumber': function (x, y) {\n return bignumLarger(bignumber(x), y)\n },\n\n 'BigNumber, Fraction': function (x, y) {\n return bignumLarger(x, bignumber(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: 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 'SparseMatrix'\n]\n\nexport const createLargerEq = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 * const a = [2, 5, 1]\n * const 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 * History:\n *\n * v2 Handle Fractions\n * v0.2 Created\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 'SparseMatrix'\n]\n\nexport const createUnequal = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, equalScalar, matrix, DenseMatrix, concat, SparseMatrix }) => {\n const matAlgo03xDSf = createMatAlgo03xDSf({ typed })\n const matAlgo07xSSf = createMatAlgo07xSSf({ typed, SparseMatrix })\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 true\n *\n * const a = math.unit('500 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 * math.unequal(c, d) // returns [false, true, false]...\n * math.deepEqual(c, d) // returns false\n *\n * math.unequal(0, null) // returns true\n *\n * See also:\n *\n * equal, deepEqual, smaller, smallerEq, larger, largerEq, compare\n *\n * History:\n *\n * v13 Handle bigints\n * v11.6 Support matrix broadcasting\n * v4 Compare strings by their numeric values\n * v0.24 Handle `null` and `undefined`\n * v0.2 Created\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: mathIsNaN, 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]) && mathIsNaN(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', 'isNaN']\n\nexport const createMax = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, larger, isNaN: mathIsNaN }) => {\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 (mathIsNaN(value)) {\n res = value\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', 'isNaN']\n\nexport const createMin = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, smaller, isNaN: mathIsNaN }) => {\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 (mathIsNaN(value)) {\n min = value\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, isNumber, isString } 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 = ranges.length; i < ii; i++) {\n const arg = ranges[i]\n const argIsArray = isArray(arg)\n const argIsMatrix = isMatrix(arg)\n const argType = typeof 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 this._isScalar = false\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 } else if (argType === 'number') {\n this._dimensions.push(arg)\n } else if (argType === 'bigint') {\n this._dimensions.push(Number(arg))\n } else if (argType === '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, bigint, 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 (!isNumber(arg[i]) || !isInteger(arg[i])) {\n throw new TypeError('Index parameters must be positive integer numbers')\n }\n }\n // create matrix\n const matrix = new ImmutableDenseMatrix()\n matrix._data = arg\n matrix._size = [arg.length]\n return matrix\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] = (isString(d) || isNumber(d)) ? 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] = (isString(range) || isNumber(range)) ? 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] = (isString(range) || isNumber(range)) ? 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 if (!isNumber(dim)) {\n return null\n }\n\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 && isString(this._dimensions[0])\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(isString(dimension) || isNumber(dimension) ? 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 (isString(dimension)) {\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 const fixPrefixDefault = false\n const skipAutomaticSimplificationDefault = true\n\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 = fixPrefixDefault // 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 = skipAutomaticSimplificationDefault\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(one(other.value)) : this.value\n const valOther = other.value === null ? other._normalize(one(this.value)) : other.value\n\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(one(other.value)) : this.value\n const valOther = other.value === null ? other._normalize(one(this.value)) : 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 * Create a value one with the numeric type of `typeOfValue`.\n * For example, `one(new BigNumber(3))` returns `BigNumber(1)`\n * @param {number | Fraction | BigNumber} typeOfValue\n * @returns {number | Fraction | BigNumber}\n */\n function one (typeOfValue) {\n // TODO: this is a workaround to prevent the following BigNumber conversion error from throwing:\n // \"TypeError: Cannot implicitly convert a number with >15 significant digits to BigNumber\"\n // see https://github.com/josdejong/mathjs/issues/3450\n // https://github.com/josdejong/mathjs/pull/3375\n const convert = Unit._getNumberConverter(typeOf(typeOfValue))\n\n return convert(1)\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, \"skipSimp\": true}`\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 skipSimp: this.skipAutomaticSimplification\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 ?? fixPrefixDefault\n unit.skipAutomaticSimplification = json.skipSimp ?? skipAutomaticSimplificationDefault\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 unit, with optional formatting options.\n * @memberof Unit\n * @param {string[] | Unit[]} [units] Array of units strings or valueLess Unit objects in wich choose the best one\n * @param {Object} [options] Options for parsing the unit. See parseUnit for details.\n *\n * @return {Unit} Returns a new Unit with the given value and unit.\n */\n Unit.prototype.toBest = function (unitList = [], options = {}) {\n if (unitList && !Array.isArray(unitList)) {\n throw new Error('Invalid unit type. Expected string or Unit.')\n }\n\n const startPrefixes = this.units[0].unit.prefixes\n if (unitList && unitList.length > 0) {\n const unitObjects = unitList.map(u => {\n let unit = null\n if (typeof u === 'string') {\n unit = Unit.parse(u)\n if (!unit) {\n throw new Error('Invalid unit type. Expected compatible string or Unit.')\n }\n } else if (!isUnit(u)) {\n throw new Error('Invalid unit type. Expected compatible string or Unit.')\n }\n if (unit === null) {\n unit = u.clone()\n }\n try {\n this.to(unit.formatUnits())\n return unit\n } catch (e) {\n throw new Error('Invalid unit type. Expected compatible string or Unit.')\n }\n })\n const prefixes = unitObjects.map(el => el.units[0].prefix)\n this.units[0].unit.prefixes = prefixes.reduce((acc, prefix) => {\n acc[prefix.name] = prefix\n return acc\n }, {})\n this.units[0].prefix = prefixes[0]\n }\n\n const result = formatBest(this, options).simp\n this.units[0].unit.prefixes = startPrefixes\n result.fixPrefix = true\n return result\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 const { simp, valueStr, unitStr } = formatBest(this, options)\n let str = valueStr\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 * Helper function to normalize a unit for conversion and formatting\n * @param {Unit} unit The unit to be normalized\n * @return {Object} Object with normalized unit and value\n * @private\n */\n function formatBest (unit, 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 = unit.skipAutomaticSimplification || unit.value === null\n ? unit.clone()\n : unit.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 handleVAandVARUnits(simp)\n // Now apply the best prefix\n // Units must have only one unit and not have the fixPrefix flag set\n applyBestPrefixIfNeeded(simp, options.offset)\n\n const value = simp._denormalize(simp.value)\n const valueStr = (simp.value !== null) ? format(value, options || {}) : ''\n const unitStr = simp.formatUnits()\n return {\n simp,\n valueStr,\n unitStr\n }\n }\n\n /**\n * Helper to handle VA and VAR units\n * @param {Unit} simp The unit to be normalized\n */\n function handleVAandVARUnits (simp) {\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 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\n /**\n * Helper to apply the best prefix if needed\n * @param {Unit} simp The unit to be normalized\n */\n function applyBestPrefixIfNeeded (simp, offset) {\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(offset)\n }\n }\n }\n\n /**\n * Calculate the best prefix using current value.\n * @memberof Unit\n * @returns {Object} prefix\n * @param {number} [offset] Optional offset for the best prefix calculation (default 1.2)\n * @private\n */\n Unit.prototype._bestPrefix = function (offset = 1.2) {\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 - offset\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 - offset)\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 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(String(x.n)).div(String(x.d)).times(String(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 * History:\n *\n * v0.5 Created\n * v0.16 Support conversion from BigNumber\n * v2.5 Support BigNumber and Fraction values in units\n * v2.6 Support Complex values in units\n * v11.1 Allow the type of unit to be specifed by a unit (not just string)\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 * History:\n *\n * v1.5 Created\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 Number.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.5493061443340548 - 1.5707963267948966i\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')\n * const x = math.cos(angle)\n * const y = math.sin(angle)\n * math.atan2(y, x) * 180 / math.pi // returns 60\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 * The items of the returned array will be sorted in natural order.\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 distinct 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 5.21 cm\n *\n * math.add(\"2.3\", \"4\") // returns number 6.3\n *\n * See also:\n *\n * subtract, sum\n *\n * History:\n *\n * v13 Handle bigint arguments\n * v11.6 Support matrix broadcasting\n * v3.8 Allow more than two arguments\n * v0.0.2 Created\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(), true))\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","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 * History:\n *\n * v? Created\n * v2 Dropped support for `[start, end, step]` arguments in favor\n * of lists of arbitrary values; added support for Range\n * objects.\n * v11.10 Added support for arrays of booleans as indices.\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 * @param {boolean} [optionalChaining=false]\n * Optional property, if the accessor was written as optional-chaining\n * using `a?.b`, or `a?.[\"b\"] with bracket notation.\n * Forces evaluate to undefined if the given object is undefined or null.\n */\n constructor (object, index, optionalChaining = false) {\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 this.optionalChaining = optionalChaining\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 const optionalChaining = this.optionalChaining\n const prevOptionalChaining = isAccessorNode(this.object) && this.object.optionalChaining\n\n if (this.index.isObjectProperty()) {\n const prop = this.index.getObjectProperty()\n return function evalAccessorNode (scope, args, context) {\n const ctx = context || {}\n const object = evalObject(scope, args, ctx)\n\n if (optionalChaining && object == null) {\n ctx.optionalShortCircuit = true\n return undefined\n }\n\n if (prevOptionalChaining && ctx?.optionalShortCircuit) {\n return undefined\n }\n\n // get a property from an object evaluated using the scope.\n return getSafeProperty(object, prop)\n }\n } else {\n return function evalAccessorNode (scope, args, context) {\n const ctx = context || {}\n const object = evalObject(scope, args, ctx)\n\n if (optionalChaining && object == null) {\n ctx.optionalShortCircuit = true\n return undefined\n }\n\n if (prevOptionalChaining && ctx?.optionalShortCircuit) {\n return undefined\n }\n\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 this.optionalChaining\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, this.optionalChaining)\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 const optionalChaining = this.optionalChaining ? (this.index.dotNotation ? '?' : '?.') : ''\n return object + optionalChaining + 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 optionalChaining: this.optionalChaining\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, json.optionalChaining)\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 { // 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 { // nullish coalescing\n 'OperatorNode:nullish': {\n op: '??',\n associativity: 'left',\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 fraction: { 2: '\\\\frac{${args[0]}}{${args[1]}}' },\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', 'isBounded'\n]\n\nexport const createConstantNode = /* #__PURE__ */ factory(name, dependencies, ({ Node, isBounded }) => {\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 if (!isBounded(this.value)) {\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 expr = this.expr\n const evalExpr = 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 fn.expr = expr.toString()\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)\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, optional) {\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 const optionalType = typeof optional\n if (!(optionalType === 'undefined' || optionalType === 'boolean')) {\n throw new TypeError('optional flag, if specified, must be boolean')\n }\n\n this.fn = fn\n this.args = args || []\n this.optional = !!optional\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 const fromOptionalChaining = this.optional ||\n (isAccessorNode(this.fn) && this.fn.optionalChaining)\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 if (fromOptionalChaining) value = undefined\n else return FunctionNode.onUndefinedFunction(name)\n\n if (typeof value === 'function' ||\n (fromOptionalChaining && value === undefined)) {\n return value\n }\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 if (fromOptionalChaining && fn === undefined) return undefined\n return fn()\n }\n case 1: return function evalFunctionNode (scope, args, context) {\n const fn = resolveFn(scope)\n if (fromOptionalChaining && fn === undefined) return undefined\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 if (fromOptionalChaining && fn === undefined) return undefined\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 if (fromOptionalChaining && fn === undefined) return undefined\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 (fromOptionalChaining && fn === undefined) return undefined\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\n // Optional chaining: if the base object is nullish, short-circuit to undefined\n if (fromOptionalChaining &&\n (object == null || object[prop] === undefined)) {\n return undefined\n }\n\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 (fromOptionalChaining && fn === undefined) return undefined\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() or transformed into a functional object via node.compile().\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')\n * node2.evaluate(scope) // 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 * History:\n *\n * v0.9 Created\n * v0.13 Switched to one-based indices\n * v0.14 Added `[1,2;3,4]` notation for matrices\n * v0.18 Dropped the `function` keyword\n * v0.20 Added ternary conditional\n * v0.27 Allow multi-line expressions; allow functions that receive\n * unevaluated parameters (`rawArgs`)\n * v3 Add object notation; allow assignments internal to other\n * expressions\n * v7.3 Supported binary, octal, and hexadecimal notation\n * v9.5 Support for calculations with percentages\n * v12.4 Allow trailing commas in matrices\n * v14.8 Add nullish coalescing operator\n * v15.1 Add optional chaining operator\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 '?.': 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 // Special case: the check for '?.' is to prevent a case like 'a?.3:.7' from being interpreted as optional chaining\n // TODO: refactor the tokenization into some better way to deal with cases like 'a?.3:.7', see https://github.com/josdejong/mathjs/pull/3584\n if (\n c2.length === 2 &&\n DELIMITERS[c2] &&\n (c2 !== '?.' || !parse.isDigit(state.expression.charAt(state.index + 2)))\n ) {\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 (\n parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) ||\n parse.isDigit(currentCharacter(state))\n ) {\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 (\n parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) ||\n parse.isDigit(currentCharacter(state))\n ) {\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 (parse.isDecimalMark(nextCharacter(state), state.expression.charAt(state.index + 2))) {\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 === '\\u00A0' || (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 * 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 if (node.optionalChaining) {\n throw createSyntaxError(state, 'Cannot assign to optional chain')\n }\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' && '])},;'.includes(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 if (state.conditionalLevel === state.nestingLevel) {\n // we are in the midst of parsing a conditional operator, so not\n // a range, but rather an empty true-expr, which is considered a\n // syntax error\n throw createSyntaxError(\n state,\n 'The true-expression of a conditional operator may not be empty')\n } else {\n // implicit start of range = 1 (one-based)\n node = new ConstantNode(1)\n }\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 = parseMultiplyDivideModulus(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 = parseMultiplyDivideModulus(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, modulus\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivideModulus (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 '%': 'mod',\n mod: 'mod'\n }\n\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token\n fn = operators[name]\n getTokenSkipNewline(state)\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 = parseUnaryPercentage(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 === '(' || state.token === 'in') {\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 = parseUnaryPercentage(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 * Unary percentage operator (treated as `value / 100`)\n * @return {Node} node\n * @private\n */\n function parseUnaryPercentage (state) {\n let node = parseUnary(state)\n\n if (state.token === '%') {\n const previousState = Object.assign({}, state)\n getTokenSkipNewline(state)\n // We need to decide if this is a unary percentage % or binary modulo %\n // So we attempt to parse a unary expression at this point.\n // If it fails, then the only possibility is that this is a unary percentage.\n // If it succeeds, then we presume that this must be binary modulo, since the\n // only things that parseUnary can handle are _higher_ precedence than unary %.\n try {\n parseUnary(state)\n // Not sure if we could somehow use the result of that parseUnary? Without\n // further analysis/testing, safer just to discard and let the parse proceed\n Object.assign(state, previousState)\n } catch {\n // Not seeing a term at this point, so was a unary %\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true)\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 = parseNullishCoalescing(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 * nullish coalescing operator\n * @return {Node} node\n * @private\n */\n function parseNullishCoalescing (state) {\n let node = parseLeftHandOperators(state)\n\n while (state.token === '??') { // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state)\n node = new OperatorNode('??', 'nullish', [node, parseLeftHandOperators(state)])\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) or sqrt?.(2) with optional chaining\n * - index enclosed in square brackets [...], for example A[2,3] or A?.[2,3] with optional chaining\n * - dot notation for properties, like foo.bar or foo?.bar with optional chaining\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 // Iterate and handle chained accessors, including repeated optional chaining\n while (true) { // eslint-disable-line no-unmodified-loop-condition\n // Track whether an optional chaining operator precedes the next accessor\n let optional = false\n\n // Consume an optional chaining operator if present\n if (state.token === '?.') {\n optional = true\n // consume the '?.' token\n getToken(state)\n }\n\n const hasNextAccessor =\n (state.token === '(' || state.token === '[' || state.token === '.') &&\n (!types || types.includes(state.token))\n\n if (!(optional || hasNextAccessor)) {\n break\n }\n\n params = []\n\n if (state.token === '(') {\n if (optional || isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation: fn(2, 3) or obj.fn(2, 3) or (anything)?.(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, optional)\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), optional)\n } else {\n // dot notation like variable.prop\n // consume the `.` (if it was ?., already consumed):\n if (!optional) getToken(state)\n\n const isPropertyName = state.tokenType === TOKENTYPE.SYMBOL ||\n (state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS)\n if (!isPropertyName) {\n let message = 'Property name expected after '\n message += optional ? 'optional chain' : 'dot'\n throw createSyntaxError(state, message)\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), optional)\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 { isFunction } from '../utils/is.js'\nimport { createEmptyMap, toObject } from '../utils/map.js'\n\nconst name = 'Parser'\nconst dependencies = ['evaluate', 'parse']\n\nexport const createParserClass = /* #__PURE__ */ factory(name, dependencies, ({ evaluate, parse }) => {\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 function isValidVariableName (name) {\n if (name.length === 0) { return false }\n\n for (let i = 0; i < name.length; i++) {\n const cPrev = name.charAt(i - 1)\n const c = name.charAt(i)\n const cNext = name.charAt(i + 1)\n const valid = parse.isAlpha(c, cPrev, cNext) || (i > 0 && parse.isDigit(c))\n\n if (!valid) {\n return false\n }\n }\n\n return true\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 if (!isValidVariableName(name)) {\n throw new Error(`Invalid variable name: '${name}'. Variable names must follow the specified rules.`)\n }\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 Parser.prototype.toJSON = function () {\n const json = {\n mathjs: 'Parser',\n variables: {},\n functions: {}\n }\n\n for (const [name, value] of this.scope) {\n if (isFunction(value)) {\n if (!isExpressionFunction(value)) {\n throw new Error(`Cannot serialize external function ${name}`)\n }\n\n json.functions[name] = `${value.syntax} = ${value.expr}`\n } else {\n json.variables[name] = value\n }\n }\n\n return json\n }\n\n Parser.fromJSON = function (json) {\n const parser = new Parser()\n\n Object.entries(json.variables).forEach(([name, value]) => parser.set(name, value))\n Object.entries(json.functions).forEach(([_name, fn]) => parser.evaluate(fn))\n\n return parser\n }\n\n return Parser\n}, { isClass: true })\n\nfunction isExpressionFunction (value) {\n return typeof value === 'function' &&\n typeof value.syntax === 'string' &&\n typeof value.expr === 'string'\n}\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 `math.Parser` object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.\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 * History:\n *\n * v11.4 Created\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 { parserDocs } from './function/expression/parser.js'\nimport { parseDocs } from './function/expression/parse.js'\nimport { compileDocs } from './function/expression/compile.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 { nullishDocs } from './function/logical/nullish.js'\nimport { orDocs } from './function/logical/or.js'\nimport { xorDocs } from './function/logical/xor.js'\nimport { mapSlicesDocs } from './function/matrix/mapSlices.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 { bernoulliDocs } from './function/probability/bernoulli.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 { toBestDocs } from './function/units/toBest.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 { isBoundedDocs } from './function/utils/isBounded.js'\nimport { isFiniteDocs } from './function/utils/isFinite.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. Deprecated in favor of coulombConstant', examples: ['coulombConstant'] },\n coulombConstant: { description: 'Coulomb\\'s constant', examples: ['coulombConstant'] },\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 parse: parseDocs,\n parser: parserDocs,\n compile: compileDocs,\n\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n\n // functions - logical\n and: andDocs,\n not: notDocs,\n nullish: nullishDocs,\n or: orDocs,\n xor: xorDocs,\n\n // functions - matrix\n mapSlices: mapSlicesDocs,\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 bernoulli: bernoulliDocs,\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 toBest: toBestDocs,\n\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isBounded: isBoundedDocs,\n isFinite: isFiniteDocs,\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 'ceil(x, n)',\n 'ceil(unit, valuelessUnit)',\n 'ceil(unit, n, valuelessUnit)'\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 'ceil(3.241cm, cm)',\n 'ceil(3.241cm, 2, cm)'\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 'fix(x, n)',\n 'fix(unit, valuelessUnit)',\n 'fix(unit, n, valuelessUnit)'\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 'fix(3.241cm, cm)',\n 'fix(3.241cm, 2, cm)'\n ],\n seealso: ['ceil', 'floor', 'round']\n}\n","export const floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: [\n 'floor(x)',\n 'floor(x, n)',\n 'floor(unit, valuelessUnit)',\n 'floor(unit, n, valuelessUnit)'\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 'floor(3.241cm, cm)',\n 'floor(3.241cm, 2, cm)'\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>0, -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: '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.',\n examples: [\n 'stirlingS2(5, 3)'\n ],\n seealso: ['bellNumbers', 'bernoulli']\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: ['parser', 'parse', 'compile']\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 parseDocs = {\n name: 'parse',\n category: 'Expression',\n syntax: [\n 'parse(expr)',\n 'parse(expr, options)',\n 'parse([expr1, expr2, expr3, ...])',\n 'parse([expr1, expr2, expr3, ...], options)'\n ],\n description: 'Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().',\n examples: [\n 'node1 = parse(\"sqrt(3^2 + 4^2)\")',\n 'node1.evaluate()',\n 'code1 = node1.compile()',\n 'code1.evaluate()',\n 'scope = {a: 3, b: 4}',\n 'node2 = parse(\"a * b\")',\n 'node2.evaluate(scope)',\n 'code2 = node2.compile()',\n 'code2.evaluate(scope)'\n ],\n seealso: ['parser', 'evaluate', 'compile']\n}\n","export const parserDocs = {\n name: 'parser',\n category: 'Expression',\n syntax: [\n 'parser()'\n ],\n description: 'Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.',\n examples: [\n 'myParser = parser()',\n 'myParser.evaluate(\"sqrt(3^2 + 4^2)\")',\n 'myParser.set(\"x\", 3)',\n 'myParser.evaluate(\"y = x + 3\")',\n 'myParser.evaluate([\"y = x + 3\", \"y = y + 1\"])',\n 'myParser.get(\"y\")'\n ],\n seealso: ['evaluate', 'parse', 'compile']\n}\n","export const compileDocs = {\n name: 'compile',\n category: 'Expression',\n syntax: [\n 'compile(expr) ',\n 'compile([expr1, expr2, expr3, ...])'\n ],\n description: 'Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.',\n examples: [\n 'code1 = compile(\"sqrt(3^2 + 4^2)\")',\n 'code1.evaluate() ',\n 'code2 = compile(\"a * b\")',\n 'code2.evaluate({a: 3, b: 4})'\n ],\n seealso: ['parser', 'parse', 'evaluate']\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 nullishDocs = {\n name: 'nullish',\n category: 'Logical',\n syntax: [\n 'x ?? y',\n 'nullish(x, y)'\n ],\n description: 'Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.',\n examples: [\n 'null ?? 42',\n 'undefined ?? 42',\n '0 ?? 42',\n 'false ?? 42',\n 'null ?? undefined ?? 42'\n ],\n seealso: [\n 'and', 'or', 'not'\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 mapSlicesDocs = {\n name: 'mapSlices',\n category: 'Matrix',\n syntax: ['mapSlices(A, dim, callback)'],\n description:\n 'Generate a matrix one dimension less than A by applying callback to ' +\n 'each slice of A along dimension dim.',\n examples: [\n 'A = [[1, 2], [3, 4]]',\n 'mapSlices(A, 1, sum)', // returns [4, 6]\n 'mapSlices(A, 2, prod)' // returns [2, 12]\n ],\n seealso: ['map', 'forEach']\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 bernoulliDocs = {\n name: 'bernoulli',\n category: 'Probability',\n syntax: [\n 'bernoulli(n)'\n ],\n description: 'The nth Bernoulli number',\n examples: [\n 'bernoulli(4)',\n 'bernoulli(fraction(12))'\n ],\n seealso: ['combinations', 'gamma', 'stirlingS2']\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. Comparing a value with NaN returns false.',\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. Comparing a value with NaN returns false.',\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. If any NaN values are found, the function yields the last NaN in the input.',\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. If any NaN values are found, the function yields the last NaN in the input.',\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 '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 toBestDocs = {\n name: 'toBest',\n category: 'Units',\n syntax: [\n 'toBest(x)',\n 'toBest(x, unitList)',\n 'toBest(x, unitList, options)'\n ],\n description: 'Converts to the most appropriate display unit.',\n examples: [\n 'toBest(unit(5000, \"m\"))',\n 'toBest(unit(3500000, \"W\"))',\n 'toBest(unit(0.000000123, \"A\"))',\n 'toBest(unit(10, \"m\"), \"cm\")',\n 'toBest(unit(10, \"m\"), \"mm,km\", {offset: 1.5})'\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', 'isFinite', 'isBounded']\n}\n","export const isBoundedDocs = {\n name: 'isBounded',\n category: 'Utils',\n syntax: [\n 'isBounded(x)'\n ],\n description: 'Test whether a value or its entries are bounded.',\n examples: [\n 'isBounded(Infinity)',\n 'isBounded(bigint(3))',\n 'isBounded([3, -Infinity, -3])'\n ],\n seealso: ['isFinite', 'isNumeric', 'isNaN', 'isNegative', 'isPositive']\n}\n","export const isFiniteDocs = {\n name: 'isFinite',\n category: 'Utils',\n syntax: [\n 'isFinite(x)'\n ],\n description: 'Test whether a value is finite, elementwise on collections.',\n examples: [\n 'isFinite(Infinity)',\n 'isFinite(bigint(3))',\n 'isFinite([3, -Infinity, -3])'\n ],\n seealso: ['isBounded', 'isNumeric', 'isNaN', 'isNegative', 'isPositive']\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', 'isFinite', 'isBounded']\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 config\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 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', 'mapSlices', 'isNaN']\n\nexport const createVariance = /* #__PURE__ */ factory(name, dependencies, ({ typed, add, subtract, multiply, divide, mapSlices, isNaN: mathIsNaN }) => {\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 (mathIsNaN(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 mapSlices(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'\n\nconst name = 'quantileSeq'\nconst dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger', 'mapSlices']\n\nexport const createQuantileSeq = /* #__PURE__ */ factory(name, dependencies, ({ typed, bignumber, add, subtract, divide, multiply, partitionSelect, compare, isInteger, smaller, smallerEq, larger, mapSlices }) => {\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 mapSlices(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","import { factory } from '../../utils/factory.js'\nimport { isInteger } from '../../utils/number.js'\n\nconst name = 'bernoulli'\nconst dependencies = [\n 'typed', 'config', 'isInteger', 'number', '?BigNumber', '?Fraction'\n]\n\nexport const createBernoulli = /* #__PURE__ */ factory(name, dependencies, ({\n typed, config, number, BigNumber, Fraction\n}) => {\n /**\n * Return the `n`th Bernoulli number, for positive integers `n`\n *\n * Syntax:\n *\n * math.bernoulli(n)\n *\n * Examples:\n *\n * math.bernoulli(1) // returns -0.5\n * // All other odd Bernoulli numbers are 0:\n * math.bernoulli(7) // returns 0\n * math.bernoulli(math.bignumber(6)) // value bignumber(1).div(42)\n * // Produces exact rationals for bigint or fraction input:\n * math.bernoulli(8n) // Fraction -1,30\n * math.bernoulli(math.fraction(10)) // Fraction 5,66\n *\n * See also:\n *\n * combinations, gamma, stirlingS2\n *\n * @param {number | BigNumber | bigint | Fraction} n\n * Index of the Bernoulli number\n * @return {number | BigNumber | Fraction}\n * nth Bernoulli number, of a type corresponding to the argument n\n */\n\n const numberCache = [undefined]\n const fractionCache = [undefined]\n let bigCache = [undefined]\n let cachedPrecision = 50\n return typed(name, {\n number: index => _bernoulli(\n index, n => n, numberCache,\n (a, b) => a + b, (a, b) => a * b, (a, b) => a / b),\n 'bigint | Fraction': index => _bernoulli(\n number(index), n => new Fraction(n), fractionCache,\n (a, b) => a.add(b), (a, b) => a.mul(b), (a, b) => a.div(b)),\n BigNumber: index => {\n if (config.precision !== cachedPrecision) {\n bigCache = [undefined]\n cachedPrecision = config.precision\n }\n return _bernoulli(\n number(index), n => new BigNumber(n), bigCache,\n (a, b) => a.add(b), (a, b) => a.mul(b), (a, b) => a.div(b))\n }\n })\n})\n\n/**\n * Underlying implementation, with all operations passed in.\n * Parameters:\n * 1. index: a (positive integer) number specifying which Bernoulli number\n * to compute.\n * 2. promote: a function that takes an integer number and returns\n * the desired type for the Bernoulli number values.\n * 3. A: a cache array of partial computation data that _bernoulli should use.\n * Different cache arrays should be provided for different types.\n * 4. plus: a function that adds two values of the desired type.\n * 5. times: a function that multiplies two values of the desired type.\n * 6. divide: a function that divides one value of the desired type by another.\n */\nfunction _bernoulli (index, promote, A, plus, times, divide) {\n if (index < 0 || !isInteger(index)) {\n throw new RangeError('Bernoulli index must be nonnegative integer')\n }\n if (index === 0) return promote(1)\n if (index === 1) return divide(promote(-1), promote(2))\n if (index % 2 === 1) return promote(0)\n // We proceed as in https://math.stackexchange.com/a/2844337\n // (by no means the most efficient, but very simple to implement)\n // A cache entry consists of a triple\n // [cotangent coefficient a_n, prefactor, Bernouilli number B_2n]\n const one = promote(1)\n if (A.length === 1) {\n A.push([\n divide(one, promote(-3)),\n divide(one, promote(-2)),\n divide(one, promote(6))\n ])\n }\n const half = index / 2\n const zero = promote(0)\n const two = promote(2)\n while (A.length <= half) {\n const i = A.length // next cotangent coefficient to compute\n const lim = Math.floor((i + 1) / 2)\n let a = zero\n for (let m = 1; m < lim; ++m) {\n a = plus(a, times(A[m][0], A[i - m][0]))\n }\n a = times(a, two)\n if (i % 2 === 0) a = plus(a, times(A[lim][0], A[lim][0]))\n a = divide(a, promote(-(2 * i + 1)))\n const prefactor = divide(\n times(A[i - 1][1], promote(-i * (2 * i - 1))), two)\n A.push([a, prefactor, times(prefactor, a)])\n }\n return A[half][2]\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 Number.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 (!Number.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', 'log2', '?on']\n\nexport const createRandomInt = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, log2, 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 either 0 or 1, randomly\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, 2),\n number: (max) => _randomInt(0, max),\n 'number, number': (min, max) => _randomInt(min, max),\n bigint: (max) => _randomBigint(0n, max),\n 'bigint, bigint': _randomBigint,\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 function _randomBigint (min, max) {\n const simpleCutoff = 2n ** 30n\n const width = max - min // number of choices\n if (width <= simpleCutoff) { // do it with number type\n return min + BigInt(_randomInt(0, Number(width)))\n }\n // Too big to choose accurately that way. Instead, choose the correct\n // number of random bits to cover the width, and repeat until the\n // resulting number falls within the width\n const bits = log2(width)\n let picked = width\n while (picked >= width) {\n picked = 0n\n for (let i = 0; i < bits; ++i) {\n picked = 2n * picked + ((rng() < 0.5) ? 0n : 1n)\n }\n }\n return min + picked\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 'typed',\n 'parse',\n 'equal',\n 'resolve',\n 'simplifyConstant',\n 'simplifyCore',\n 'AccessorNode',\n 'ArrayNode',\n 'ConstantNode',\n 'FunctionNode',\n 'IndexNode',\n 'ObjectNode',\n 'OperatorNode',\n 'ParenthesisNode',\n 'SymbolNode',\n 'replacer'\n]\n\nexport const createSimplify = /* #__PURE__ */ factory(name, dependencies, (\n {\n typed,\n parse,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n replacer\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) {\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], replacer)\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 'isBounded',\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 isBounded,\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 && isBounded(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 // note: we convert await from bigint values, because bigint values gives issues with divisions: 1n/2n=0n and not 0.5\n const fromBigInt = (value) => config.number === 'BigNumber' && bignumber ? bignumber(value) : Number(value)\n\n const numeratorValue = f.s * f.n\n const numeratorNode = (numeratorValue < 0n)\n ? new OperatorNode('-', 'unaryMinus', [new ConstantNode(-fromBigInt(numeratorValue))])\n : new ConstantNode(fromBigInt(numeratorValue))\n\n return (f.d === 1n)\n ? numeratorNode\n : new OperatorNode('/', 'divide', [numeratorNode, new ConstantNode(fromBigInt(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 cache = new Map()\n const variableName = variable.name\n function isConstCached (node) {\n const cached = cache.get(node)\n if (cached !== undefined) {\n return cached\n }\n const res = _isConst(isConstCached, node, variableName)\n cache.set(node, res)\n return res\n }\n\n const res = _derivative(expr, isConstCached)\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 \n res = _derivative(res, isConst)\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 * Checks if a node is constants (e.g. 2 + 2).\n * Accepts (usually memoized) version of self as the first parameter for recursive calls.\n * 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 {function} isConst Function that tells whether sub-expression is a 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 const _isConst = typed('_isConst', {\n 'function, ConstantNode, string': function () {\n return true\n },\n\n 'function, SymbolNode, string': function (isConst, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n return node.name !== varName\n },\n\n 'function, ParenthesisNode, string': function (isConst, node, varName) {\n return isConst(node.content, varName)\n },\n\n 'function, FunctionAssignmentNode, string': function (isConst, node, varName) {\n if (!node.params.includes(varName)) {\n return true\n }\n return isConst(node.expr, varName)\n },\n\n 'function, FunctionNode | OperatorNode, string': function (isConst, node, varName) {\n return node.args.every(arg => isConst(arg, varName))\n }\n })\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {function} isConst Function that tells if a node is constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n const _derivative = typed('_derivative', {\n 'ConstantNode, function': function () {\n return createConstantNode(0)\n },\n\n 'SymbolNode, function': function (node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0)\n }\n return createConstantNode(1)\n },\n\n 'ParenthesisNode, function': function (node, isConst) {\n return new ParenthesisNode(_derivative(node.content, isConst))\n },\n\n 'FunctionAssignmentNode, function': function (node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0)\n }\n return _derivative(node.expr, isConst)\n },\n\n 'FunctionNode, function': function (node, isConst) {\n if (isConst(node)) {\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 return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), isConst)\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 && isConst(node.args[1]))) {\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 ]), isConst)\n }\n break\n case 'pow':\n if (node.args.length === 2) {\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), isConst)\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, isConst)\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative])\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative])\n },\n\n 'OperatorNode, function': function (node, isConst) {\n if (isConst(node)) {\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, isConst)\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], isConst)\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], isConst),\n _derivative(node.args[1], isConst)\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 isConst(arg)\n })\n\n if (constantTerms.length > 0) {\n const nonConstantTerms = node.args.filter(function (arg) {\n return !isConst(arg)\n })\n\n const nonConstantNode = nonConstantTerms.length === 1\n ? nonConstantTerms[0]\n : new OperatorNode('*', 'multiply', nonConstantTerms)\n\n const newArgs = constantTerms.concat(_derivative(nonConstantNode, isConst))\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, isConst)\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 (isConst(arg1)) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, isConst), arg1])\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (isConst(arg0)) {\n return new OperatorNode('*', 'multiply', [\n new OperatorNode('-', 'unaryMinus', [arg0]),\n new OperatorNode('/', 'divide', [\n _derivative(arg1, isConst),\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, isConst), arg1.clone()]),\n new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, isConst)])\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 (isConst(arg0)) {\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(), isConst)\n ])\n ])\n }\n\n if (isConst(arg1)) {\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, isConst)\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, isConst),\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, isConst),\n new OperatorNode('/', 'divide', [arg1.clone(), arg0.clone()])\n ]),\n new OperatorNode('*', 'multiply', [\n _derivative(arg1, isConst),\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' && (!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 = '15.1.1'\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') // Deprecated in favor of coulombConstant\nexport const createCoulombConstant = /* #__PURE__ */ unitFactory('coulombConstant', '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 { createMapSlices } from '../../function/matrix/mapSlices.js'\nimport { isBigNumber, isNumber } from '../../utils/is.js'\n\nconst name = 'mapSlices'\nconst dependencies = ['typed', 'isInteger']\n\n/**\n * Attach a transform function to math.mapSlices\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mapSlices\n * from one-based to zero based\n */\nexport const createMapSlicesTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, isInteger }) => {\n const mapSlices = createMapSlices({ typed, isInteger })\n\n // @see: comment of concat itself\n return typed('mapSlices', {\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 mapSlices.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}, { isTransformFunction: true, ...createMapSlices.meta })\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 {\n isArray, isBigInt, isBigNumber, isMatrix, isNumber, isRange\n} 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) || isBigInt(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, bigint, 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', 'isNaN']\n\nexport const createMaxTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, larger, isNaN: mathIsNaN }) => {\n const max = createMax({ typed, config, numeric, larger, isNaN: mathIsNaN })\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', 'isNaN']\n\nexport const createMinTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, numeric, smaller, isNaN: mathIsNaN }) => {\n const min = createMin({ typed, config, numeric, smaller, isNaN: mathIsNaN })\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', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive']\n\nexport const createRangeTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, matrix, bignumber, equal, smaller, smallerEq, larger, largerEq, add, isZero, isPositive }) => {\n const range = createRange({ typed, config, matrix, bignumber, equal, smaller, smallerEq, larger, largerEq, add, isZero, 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', 'mapSlices']\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, mapSlices }) => {\n const quantileSeq = createQuantileSeq({ typed, bignumber, add, subtract, divide, multiply, partitionSelect, compare, isInteger, smaller, smallerEq, larger, mapSlices })\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', 'mapSlices', '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, mapSlices, isNaN: mathIsNaN }) => {\n const variance = createVariance({ typed, add, subtract, multiply, divide, mapSlices, isNaN: mathIsNaN })\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 { createNullish } from '../../function/logical/nullish.js'\nimport { factory } from '../../utils/factory.js'\nimport { isCollection } from '../../utils/is.js'\n\nconst name = 'nullish'\nconst dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual']\n\nexport const createNullishTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, matrix, size, flatten, deepEqual }) => {\n const nullish = createNullish({ typed, matrix, size, flatten, deepEqual })\n\n function nullishTransform (args, math, scope) {\n const left = args[0].compile().evaluate(scope)\n\n // If left is not a collection and not nullish, short-circuit and return it\n if (!isCollection(left) && left != null && left !== undefined) {\n return left\n }\n\n // Otherwise evaluate right and apply full nullish semantics (incl. element-wise)\n const right = args[1].compile().evaluate(scope)\n return nullish(left, right)\n }\n\n nullishTransform.rawArgs = true\n\n return nullishTransform\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 // legacy behavior for matrix subset. When true, the subset function\n // returns a matrix or array with the same size as the index (except for scalars).\n // When false, it returns a matrix or array with a size depending on the type of index.\n legacySubset: false\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', 'bigint', '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 * 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\n if (options.legacySubset === true) {\n // this if is only for backwards compatibility, it can be removed in the future.\n console.warn('Warning: The configuration option \"legacySubset\" is for compatibility only and might be deprecated in the future.')\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, isObject, 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 * History:\n *\n * v0.2 Created\n * v0.7 Changed second parameter to an options object\n * v2 Dropped support for direct import of a module by name\n * v14.2 Add facility for specifying the former name of an import\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 (isObject(value) || isModule(value)) {\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 const isDefined = math[name] !== undefined\n const isValuelessUnit = math.Unit?.isValuelessUnit(name)\n if ((!isDefined && !isValuelessUnit) || 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 const former = factory.meta?.formerly ?? ''\n const needsTransform = isTransformFunctionFactory(factory) ||\n factoryAllowedInExpressions(factory)\n const withTransform = math.expression.mathWithTransform\n\n // TODO: add unit test with non-lazy factory\n if (!factory.meta || factory.meta.lazy !== false) {\n lazy(namespace, name, resolver)\n if (former) lazy(namespace, former, 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 if (former) _deleteTransform(former)\n } else {\n if (needsTransform) {\n lazy(withTransform, name, () => namespace[name])\n if (former) lazy(withTransform, former, () => namespace[name])\n }\n }\n } else {\n namespace[name] = resolver()\n if (former) namespace[former] = namespace[name]\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 if (former) _deleteTransform(former)\n } else {\n if (needsTransform) {\n lazy(withTransform, name, () => namespace[name])\n if (former) lazy(withTransform, former, () => 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 isModule (object) {\n return typeof object === 'object' && object[Symbol.toStringTag] === 'Module'\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","_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","defaultEscapes","$","_","formatEscapes","defaultEscapeMapFn","str","_ref","undefined","_ref$preserveFormatti","preserveFormatting","_ref$escapeMapFn","escapeMapFn","runningStr","String","result","escapes","escapeKeys","keys","_loop","specialCharFound","forEach","index","slice","naturalSort","a","b","oFxNcL","oFyNcL","re","sre","dre","hre","ore","s","insensitive","toLowerCase","x","replace","y","xN","split","yN","xD","parseInt","match","Date","parse","yD","cLoc","numS","Math","max","parseFloat","isNaN","alea","xor128","xorwow","xorshift7","xor4096","tychei","sr","global","Alea","seed","n","me","mash","data","h","charCodeAt","next","t","s0","c","s1","s2","copy","f","impl","opts","xg","state","prng","int32","double","quick","XorGen","strseed","d","floor","k","z","w","v","X","j","limit","init","push","pool","math","nodecrypto","width","startdenom","pow","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","r","obj","depth","prop","typ","smear","stringseed","fromCharCode","apply","random","ex","self","E","on","name","ctx","fn","once","listener","off","emit","evtArr","len","evts","liveEvents","TinyEmitter","ok","notOk","undef","NOT_TYPED_FUNCTION","create","isPlainObject","constructor","_types","test","Array","isArray","RegExp","anyType","isAny","typeMap","typeList","nConversions","typed","createCount","findType","typeName","type","get","message","otherName","TypeError","addTypes","types","beforeSpec","beforeIndex","newTypes","has","set","conversionsTo","affectedTypes","concat","clear","Map","findTypeNames","value","matches","filter","isTypedFunction","entity","findSignature","signature","exact","params","parseSignature","join","canonicalSignature","stringifyParams","signatures","_typedFunctionData","signatureMap","nParams","remainingSignatures","candidate","want","filteredSignatures","possibility","have","getParamAtIndex","restParam","hasAny","haveTypes","paramTypeSet","some","wtype","separator","map","p","parseParam","param","indexOf","typeDefs","trim","paramName","typeIndex","conversion","conversionIndex","hasConversion","expandParam","matchingConversions","typeNames","sort","t1","t2","knownTypes","Set","newMatch","from","add","availableConversions","newName","convertibleTypes","typeSet","rawSignature","rawParams","parsedParam","SyntaxError","hasRestParam","last","compileTest","test0","test1","tests","compileTests","initial","varIndex","lastTest","testRestParam","args","getTypeSetAtIndex","isExactType","mergeExpectedParams","paramSet","createError","err","expected","_name","matchingSignatures","nextMatchingDefs","actualTypes","category","actual","lengths","Infinity","min","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","offset","conversion0","conversion1","conversions","convert","arg","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","toString","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","defineProperty","_onMismatch","start","end","objectOrFn","checkName","nameSoFar","Error","getObjectName","mergeSignatures","dest","sourceFunction","destFunction","saveTyped","_validateConversion","to","maybeName","named","allSignatures","item","thisName","theseSignatures","argument","throwMismatchError","clearConversions","_findType","find","addType","beforeObjectTest","before","addConversion","override","existing","other","removeConversion","addConversions","existingConversion","findInArray","splice","resolve","tf","argList","sigs","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","id","loaded","__webpack_modules__","amdD","amdO","definition","o","enumerable","Symbol","toStringTag","nmd","paths","children","getSafeProperty","object","isSafeProperty","isSafeMethod","setSafeProperty","safeNativeProperties","Function","method","getPrototypeOf","safeNativeMethods","valueOf","toLocaleString","ObjectWrappingMap","wrappedObject","iterator","entries","values","mapIterator","delete","size","PartitionedMap","bKeys","it","done","createEmptyMap","createMap","mapOrObject","isMap","isObject","isNumber","isBigNumber","isDecimal","isBigInt","isComplex","isFraction","isUnit","isString","isMatrix","isCollection","isDenseMatrix","isSparseMatrix","isRange","isIndex","isBoolean","isResultSet","isHelp","isFunction","isDate","isRegExp","isPartitionedMap","isObjectWrappingMap","isNull","isUndefined","isAccessorNode","isNode","isArrayNode","isAssignmentNode","isBlockNode","isConditionalNode","isConstantNode","rule2Node","node","isOperatorNode","includes","op","isFunctionAssignmentNode","isFunctionNode","isIndexNode","isObjectNode","isParenthesisNode","isRangeNode","isRelationalNode","isSymbolNode","isChain","typeOf","clone","mapObject","extend","deepExtend","deepStrictEqual","deepFlatten","nestedObject","flattenedObject","_deepFlatten","lazy","valueResolver","_value","_uninitialized","configurable","property","dependencies","meta","assertAndCreate","scope","deps","properties","pickShallow","stripOptionalNotation","dependency","isOptionalDependency","missingDependencies","assertDependencies","isFactory","isInteger","Number","isFinite","round","safeNumberType","numberStr","config","number","BigInt","_unused","numberFallback","sign","log2","log","LN2","log10","LN10","log1p","cbrt","negate","exp","expm1","formatNumberToBase","base","prefix","suffix","format","notation","precision","wordSize","normalizeFormatOptions","toFixed","toExponential","rounded","roundDigits","splitNumber","exponent","coefficients","newExp","missingZeros","abs","expDiff","decimalIdx","decimals","decimalVal","toEngineering","lowerExp","_toNumberOrDefault","upperExp","zeros","dot","toPrecision","digits","toNumber","_toNumberOrThrow","splitValue","first","shift","unshift","pop","nearlyEqual","relTol","absTol","acosh","sqrt","asinh","atanh","cosh","sinh","tanh","onError","defaultValue","_createTyped","typedFunction","createTyped","BigNumber","Complex","DenseMatrix","Fraction","throwNoBignumber","throwNoComplex","MAX_SAFE_INTEGER","throwNoFraction","array","throwNoMatrix","matrix","usualError","sig","createResultSet","ResultSet","toJSON","mathjs","fromJSON","json","isClass","inexact","quadrant","EXP_LIMIT","MAX_DIGITS","NUMERALS","PI","DEFAULTS","rounding","modulo","toExpNeg","toExpPos","minE","maxE","external","decimalError","invalidArgument","precisionLimitExceeded","cryptoUnavailable","tag","mathfloor","mathpow","isBinary","isHex","isOctal","BASE","LN10_PRECISION","PI_PRECISION","P","digitsToString","ws","indexOfLastWord","getZeroString","checkInt32","checkRoundingDigits","rm","repeating","di","rd","ceil","convertBase","baseIn","baseOut","arrL","strL","charAt","reverse","absoluteValue","finalise","clampedTo","clamp","Ctor","NaN","gt","cmp","comparedTo","xdL","ydL","xd","yd","xs","ys","cosine","cos","pr","sd","isZero","tinyPow","taylorSeries","times","cos2x","minus","plus","toLessThanHalfPi","neg","cubeRoot","m","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","acos","isNeg","getPi","atan","inverseHyperbolicCosine","lte","ln","inverseHyperbolicSine","inverseHyperbolicTangent","wpr","xsd","inverseSine","asin","halfPi","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","sin","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","trunc","multiplyInteger","temp","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","guard","sum","c0","numerator","x1","parseDecimal","search","substring","parseOther","divisor","isFloat","Decimal","isHyperbolic","u","pi","atan2","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","prev","parser_exit","logHypot","_a","_b","tokens","tInfin","zInfin","tIsZero","zIsZero","loh","im","er","xx","cosm1","tmp","res","noIM","oneMinus","onePlus","places","ret","createComplexClass","toPolar","phi","strRe","strIm","epsilon","fromPolar","hasBase","C_ZERO","C_ONE","C_TWO","C_FIVE","C_TEN","InvalidParameter","newFraction","DivisionByZero","gcd","factorize","factors","p1","p2","NonIntegerParameter","A","B","C","D","N","M","ndx","allPrimes","baseFactors","T1","numberFactors","T2","prime","retN","retD","baseExponent","numberExponent","curN","curD","gcdValue","dec","cycLen","cycleLen","cycOff","rem1","rem2","modpow","cycleStart","showMixed","whole","eps","ieps","thisABS","cont","createFractionClass","createRangeClass","Range","step","hasStart","hasEnd","hasStep","nums","diff","toArray","createMatrixClass","Matrix","storage","datatype","subset","replacement","resize","reshape","skipZeros","bind","formatBigNumberToBase","big2","BigNumberCtor","endsWith","text","formatNumber","valueStr","formatBigNumber","looksLikeFraction","fraction","formatArray","stringify","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","reduce","squeeze","dims","_squeeze","unsqueeze","outer","_unsqueeze","isRectangular","flat","_flattenRectangular","_flatten","filterRegExp","regexp","entry","identify","identifier","generalize","getArrayDataType","itemType","concatRecursive","concatDim","arrays","broadcastSizes","_len","_key","dimensions","sizeMax","checkBroadcastingRules","toSize","broadcastTo","Asize","broadcastedSize","paddedSize","stretch","arrayToStretch","sizeToStretch","dimToStretch","acc","deepMap","skipIndex","recursiveMap","recursiveMapWithIndex","deepForEach","recursiveForEach","recursiveForEachWithIndex","optimizeCallback","isUnary","numberOfArguments","fastCallback","firstIndex","firstValue","testArgs","_findNumberOfArgumentsTyped","dataType","singleSignature","arity","matchingFunctions","func","_findSingleSignatureWithArity","_tryFunctionWithArgs","_len2","_key2","_findIfCallbackIsUnary","callbackStr","paramsStr","mappingFnName","callbackName","_err$data","argsDesc","_typeOf","JSON","_createCallbackError","RangeError","isDimensionError","isIndexError","createDenseMatrixClass","_datatype","preprocess","_fit","newSize","changed","createDenseMatrix","getDataType","legacySubset","idx","isScalar","returnMatrix","submatrix","maxDepth","getSubmatrixRecursive","dimIndex","_getSubmatrix","_get","iSize","submatrixSize","error","setSubmatrixRecursive","range","recursiveCallback","rangeIndex","finalCallback","_setSubmatrix","_set","indexI","sizeArray","fastCallbackFn","iterateUnary","inputData","iterate","totalElements","current","rows","row","columns","col","diagonal","kSuper","kSub","ms","swapRows","_swapRows","vi","createClone","any","objectClone","_switch","mat","I","J","containsCollections","arrayDeepForEach","arrayDeepMap","skipZerosCallback","_reduce","val","tran","scatter","mark","cindex","inverse","update","avalues","_values","aindex","_index","aptr","_ptr","k0","k1","createIsInteger","equal","bigint","isNegativeNumber","isPositiveNumber","isNaNNumber","createIsNegative","bigNearlyEqual","Unit","valueType","createIsNumeric","number | BigNumber | bigint | Fraction | boolean","Complex | Unit | string | null | undefined | Node","createHasNumericValue","isNumeric","boolean","string","createIsPositive","createIsZero","equalScalar","createIsNaN","createIsBounded","bigint | Fraction","null | undefined","createIsFinite","isBounded","createTypeOf","createCompareUnits","equalBase","createEqualScalar","compareUnits","complexEquals","createSparseMatrixClass","_ref2","SparseMatrix","_createFromArray","_createFromMatrix","ptr","zero","_getValueIndex","top","bottom","_insert","ins","_toArray","createSparseMatrix","density","kk","mvalues","mindex","mptr","pv","rowsCallback","columnsCallback","_getsubset","sSize","_forEachIndex","dataIndex","subIndex","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","input","nonDecimalWithRadixMatch","radix","integerPart","fractionalPart","getNonDecimalNumberParts","parts","makeNumberFromNonDecimalParts","wordSizeSuffixMatch","null","unit","valuelessUnit","createBigint","createString","createBoolean","lcase","createBignumber","twoPowSize","twoPowSizeSubOne","_x","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","logNumber","log10Number","log2Number","nthRootNumber","inv","signNumber","squareNumber","xgcdNumber","lastx","lasty","powNumber","roundNumber","createUnaryMinus","createUnaryPlus","numeric","createAbs","createMapSlices","_mapSlices","formerly","createAddScalar","fixPrefix","createSubtractScalar","createCbrt","unaryMinus","_cbrtComplex","third","allRoots","arg3","principal","all","createMatAlgo11xS0s","asize","adt","dt","cf","cvalues","cptr","createMatAlgo12xSfs","cdata","createMatAlgo14xDs","adata","_iterate","level","av","bv","cv","bigTen","createCeilNumber","_ceilNumber","createCeil","matAlgo11xS0s","matAlgo12xSfs","matAlgo14xDs","ceilNumber","_bigCeil","bne","bigint, number","_dummy","bigint, BigNumber","valueless","toNumeric","multiply","createCube","createExp","createExpm1","createFixNumber","createFix","fixNumber","bn","createFloorNumber","_floorNumber","createFloor","floorNumber","_bigFloor","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","element","createGcd","matAlgo01xDSid","matAlgo04xSidSid","matAlgo10xSids","Fraction, Fraction","createMatAlgo06xS0S0","createLcm","matAlgo06xS0S0","lcmTypes","lcmManySignature","lcm","promoteLogarithm","log16","numberLog","cplx","predictable","s15","createLog10","complexLog","complexLogNumber","createLog2","complexLog2Number","_log2Complex","newX","createMultiplyScalar","number | Fraction | BigNumber | Complex, Unit","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","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","nonZeroCount","_scatter","createBitXor","matAlgo07xSSf","bigBitXor","createArg","createConj","conjugate","formatUnits","createIm","createRe","notNumber","orNumber","xorNumber","andNumber","createNot","createNullish","deepEqual","number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any","_y","null, any","undefined, any","SparseMatrix, Array | Matrix","sx","sy","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","_forEach","createGetMatrixDataType","createIdentity","_identity","cols","_identityVector","minimum","createKron","_kron","adim","bdim","flatMap","_kron1d","aSlice","bSlice","_mapArray","Array|Matrix, Array|Matrix, ...Array|Matrix|function","Arrays","multiCallback","firstArrayIsMatrix","numberOfArrays","firstValues","collection","callbackArgCount","_getTypedCallbackArgCount","_getCallbackArgCount","_getLimitedCallback","collections","firstCollection","finalSize","offsets","resultsArray","currentDimensionSize","arrayIndex","resultsMatrix","mapMultiple","broadcastedArrays","broadcastedArraysCallback","_mapMultiple","createDiff","_diff","_recursive","selfAn","selfMn","_ElementDiff","obj1","obj2","obj1IsArray","obj2IsArray","arr1","arr2","_ArrayDiff","createOnes","_ones","hasBigNumbers","_normalize","noBignumber","noFraction","createRange","bignumber","smallerEq","larger","largerEq","_strRange","oops","_out","_range","includeEnd","noMatrix","_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","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","methods","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","mathIsNaN","_mode","mode","improveErrorMessage","fnName","details","createProd","_prod","createFormat","formatString","createBin","createOct","createHex","printTemplate","createPrint","_print","template","original","createTo","Unit, Unit | string","createToBest","toBest","Unit, string","unitList","Unit, string, Object","Unit, Array","Unit, Array, Object","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","nlg16","createLog","createLog1p","_log1p","_log1pComplex","xRe1p","createNthRoots","_calculateExactResult","_nthComplexRoots","aIsNumeric","roots","halfPiFactor","createDotPow","powScalarSignatures","powScalar","createDotDivide","createSolveValidation","mSize","bSize","createLsolve","solveValidation","bj","vjj","jValues","jIndices","lastIndex","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","compareNatural","keysX","keysY","compareObjects","_compareText","createCompareText","createEqual","createEqualNumber","createEqualText","createSmaller","bignumSmaller","createSmallerNumber","boolean, boolean","createSmallerEq","createSmallerEqNumber","createLarger","bignumLarger","createLargerNumber","createLargerEq","createLargerEqNumber","createDeepEqual","_deepEqual","createUnequal","createUnequalNumber","createPartitionSelect","asc","desc","_partitionSelect","quickSelect","pivot","createSort","compareAsc","compareDesc","_arrayIsVector","_matrixIsVector","_comparator","order","createMax","_max","_largest","createMin","_min","_smallest","createImmutableDenseMatrixClass","ImmutableDenseMatrix","isImmutableDenseMatrix","createIndexClass","getMatrixDataType","_isScalar","argIsArray","argIsMatrix","argType","sourceSize","_createImmutableMatrix","_booleansArrayToNumbersForIndex","ranges","_this$_dimensions$dim","isObjectProperty","getObjectProperty","strings","booleanArrayIndex","indexOfNumbers","bool","createFibonacciHeapClass","oneOverLogPhi","FibonacciHeap","_minimum","_cut","parent","left","right","degree","_cascadingCut","isFibonacciHeap","insert","isEmpty","extractMinimum","numberOfChildren","tempRight","numRoots","_linkNodes","_findMinimumNode","remove","_decreaseKey","createSpaClass","Spa","_heap","isSpa","accumulate","heap","nodes","swap","nodei","nodej","lruQueue","queue","oldIndex","hit","nuIndex","memoize","hasher","POSITIVE_INFINITY","cache","lru","hash","newVal","createBigNumberE","createBigNumberPhi","createBigNumberPi","createBigNumberTau","createUnitClass","fix","fixPrefixDefault","skipAutomaticSimplificationDefault","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","typeOfValue","formatBest","simp","simplify","isImaginary","VAR","VA","handleVAandVARUnits","_bestPrefix","applyBestPrefixIfNeeded","unitStr","isValuelessUnit","_other","inverted","valThis","valOther","_numberConverter","nominalOffset","unitOffset","W","thisUnitValue","thisNominalOffset","thisUnitOffset","otherUnitValue","otherNominalOffset","otherUnitOffset","skipSimp","_json$unit","_json$fixPrefix","_json$skipSimp","proposedUnitList","matchingBase","currentUnitSystem","matchingUnit","missingBaseDim","toSI","si","strNum","strDen","nNum","nDen","startPrefixes","el","absValue","absUnitValue","bestPrefix","bestDiff","scientific","xNumeric","xRounded","xFixed","testSum","PREFIXES","SHORT","da","G","Z","R","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","ch","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","second","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","F","volt","V","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","symbol","_validateScope","argNames","_ifNode","traverse","_traverse","path","transform","_transform","cloneDeep","customString","_getCustomString","_toString","toHTML","_toHTML","toTex","_toTex","handler","getIdentifier","getContent","_typeof","_defineProperty","toPrimitive","toPropertyKey","writable","errorTransform","accessFactory","createAccessorNode","Node","access","needParenthesis","AccessorNode","optionalChaining","super","evalObject","evalIndex","prevOptionalChaining","context","optionalShortCircuit","dotNotation","createArrayNode","ArrayNode","items","evalItems","evalItem","itemsToTex","nested","mixedItems","itemsFormRow","itemSep","itemsTex","AssignmentNode","FunctionAssignmentNode","ConditionalNode","latexLeftParens","latexRightParens","latexParens","associativity","associativeWith","RelationalNode","RangeNode","unwrapParen","_node","parenthesis","content","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","results","createConditionalNode","condition","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","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","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","exec","ReferenceError","FunctionNode","optional","optionalType","fromOptionalChaining","getSafeMethod","fnExpr","evalFn","isRaw","resolveFn","onUndefinedFunction","customTex","latexConverter","customToTex","createParse","expression","parseStart","expressions","parseMultiple","extraNodes","TOKENTYPE","NULL","DELIMITER","NUMBER","SYMBOL","UNKNOWN","DELIMITERS","NAMED_DELIMITERS","CONSTANTS","NUMERIC_CONSTANTS","ESCAPE_CHARACTERS","currentString","currentCharacter","prevCharacter","nextCharacter","getToken","tokenType","token","comment","isWhitespace","nestingLevel","c2","c3","isAlpha","isDecimalMark","createSyntaxError","getTokenSkipNewline","openParams","closeParams","conditionalLevel","parseAssignment","parseBlock","valid","parseLogicalXor","parseLogicalOr","parseConditional","parseLogicalAnd","parseBitwiseOr","parseBitwiseXor","parseBitwiseAnd","parseRelational","parseShift","operators","cond","parseConversion","parseRange","parseAddSubtract","parseMultiplyDivideModulus","rightNode","parseImplicitMultiplication","parseRule2","parseUnaryPercentage","tokenStates","parseUnary","previousState","parseLeftHandOperators","parseNullishCoalescing","parsePow","CustomNode","parseAccessors","parseStringToken","parseRow","numericType","parseEnd","parseParentheses","parseObject","parseMatrix","parseString","parseSymbol","parseCustomNodes","hasNextAccessor","quote","char","escapeChar","unicode","cPrev","cNext","isValidLatinOrGreek","isValidMathSymbol","high","low","createCompile","createEvaluate","createParserClass","Parser","isParser","getAll","toObject","getAllAsMap","isValidVariableName","variables","functions","isExpressionFunction","parser","_ref3","createParser","createLup","_denseLUP","lvalues","lindex","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","head","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","tail","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","description","examples","configChanged","originalConfig","newConfig","mayThrow","seealso","createChainClass","Chain","createLazyProxy","resolver","chainify","sigObject","createProxy","excludedNames","docs","classes","eDocs","piDocs","embeddedDocs","LOG2E","LOG10E","SQRT1_2","SQRT2","version","speedOfLight","gravitationConstant","planckConstant","reducedPlanckConstant","magneticConstant","electricConstant","vacuumImpedance","coulombConstant","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","nullish","mapSlices","diag","kron","matrixFromFunction","matrixFromRows","matrixFromColumns","ones","partitionSelect","rotate","ifft","sylvester","schur","lyap","solveODE","bernoulli","kldivergence","multinomial","permutations","pickRandom","randomInt","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","na","nd","inflateMatrix","inverseIterate","orthog","largeNum","randomOrthogonalVector","orthogonalComplement","normalize","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","console","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","middle","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","createBernoulli","numberCache","fractionCache","bigCache","cachedPrecision","_bernoulli","promote","half","prefactor","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","now","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","_randomBigint","_randomIntMatrix","picked","createStirlingS2","smallCache","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","replacer","_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","fromBigInt","numeratorValue","numeratorNode","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","group","getOperator","seclast","a0","finish","createResolve","_resolve","within","nextWithin","Node, Object","selfAM","createSymbolicEqual","_symbolicEqual","e1","e2","simplified","createDerivative","plainDerivative","variable","variableName","_derivative","isConstCached","cached","_isConst","parseIdentifier","Node, string","Node, string, Object","deriv","_derivTex","isConst","varName","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","createTau","_ref4","createE","_ref5","createPhi","_ref6","createLN2","_ref7","createLN10","_ref8","createLOG2E","_ref9","createLOG10E","_ref0","createSQRT1_2","_ref1","createSQRT2","_ref10","createI","_ref11","createUppercasePi","_ref12","createUppercaseE","_ref13","createVersion","recreateOnConfigChange","createSpeedOfLight","unitFactory","createGravitationConstant","createPlanckConstant","createReducedPlanckConstant","createMagneticConstant","createElectricConstant","createVacuumImpedance","createCoulomb","createCoulombConstant","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","createMapSlicesTransform","isTransformFunction","createColumnTransform","compileInlineExpression","argsScope","subScope","createTransformCallback","_transformTypedCallbackFunction","_transformCallbackFunction","fromEntries","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","createNullishTransform","nullishTransform","createBitAndTransform","bitAndTransform","createBitOrTransform","bitOrTransform","DEFAULT_CONFIG","MATRIX_OPTIONS","NUMBER_OPTIONS","configFactory","_config","optionsFix","validateOption","changes","factories","configInternal","emitter","Emitter","importedFactories","lazyTyped","internalImport","load","_import","_math$Unit","wrap","wrapper","_wrap","_importTransform","isDefined","silent","allowedInExpressions","_deleteTransform","_importFactory","_factory$meta$formerl","_factory$meta","namespace","isTransformFunctionFactory","existingTransform","instance","former","needsTransform","unsafe","factoryAllowedInExpressions","withTransform","isSupportedType","flatValues","flattenImports","flatName","importFactory"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/mathjs/lib/browser/package.json b/node_modules/mathjs/lib/browser/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/mathjs/lib/browser/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/mathjs/lib/cjs/constants.js b/node_modules/mathjs/lib/cjs/constants.js deleted file mode 100644 index dfe2922..0000000 --- a/node_modules/mathjs/lib/cjs/constants.js +++ /dev/null @@ -1,130 +0,0 @@ -"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'], _ref0 => { - let { - config, - BigNumber - } = _ref0; - 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'], _ref1 => { - let { - config, - BigNumber - } = _ref1; - return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2; -}); -const createSQRT2 = exports.createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref10 => { - let { - config, - BigNumber - } = _ref10; - return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2; -}); -const createI = exports.createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref11 => { - let { - Complex - } = _ref11; - return Complex.I; -}); - -// for backward compatibility with v5 -const createUppercasePi = exports.createUppercasePi = /* #__PURE__ */(0, _factory.factory)('PI', ['pi'], _ref12 => { - let { - pi - } = _ref12; - return pi; -}); -const createUppercaseE = exports.createUppercaseE = /* #__PURE__ */(0, _factory.factory)('E', ['e'], _ref13 => { - let { - e - } = _ref13; - 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/node_modules/mathjs/lib/cjs/core/config.js b/node_modules/mathjs/lib/cjs/core/config.js deleted file mode 100644 index 3ef4369..0000000 --- a/node_modules/mathjs/lib/cjs/core/config.js +++ /dev/null @@ -1,35 +0,0 @@ -"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, - // legacy behavior for matrix subset. When true, the subset function - // returns a matrix or array with the same size as the index (except for scalars). - // When false, it returns a matrix or array with a size depending on the type of index. - legacySubset: false -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/core/create.js b/node_modules/mathjs/lib/cjs/core/create.js deleted file mode 100644 index e49dd89..0000000 --- a/node_modules/mathjs/lib/cjs/core/create.js +++ /dev/null @@ -1,212 +0,0 @@ -"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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } -/** - * 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/node_modules/mathjs/lib/cjs/core/function/config.js b/node_modules/mathjs/lib/cjs/core/function/config.js deleted file mode 100644 index b0fe2ce..0000000 --- a/node_modules/mathjs/lib/cjs/core/function/config.js +++ /dev/null @@ -1,118 +0,0 @@ -"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', 'bigint', '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); - } - if (options.legacySubset === true) { - // this if is only for backwards compatibility, it can be removed in the future. - console.warn('Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated in the future.'); - } - 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/node_modules/mathjs/lib/cjs/core/function/import.js b/node_modules/mathjs/lib/cjs/core/function/import.js deleted file mode 100644 index 3185f2c..0000000 --- a/node_modules/mathjs/lib/cjs/core/function/import.js +++ /dev/null @@ -1,354 +0,0 @@ -"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 - * - * History: - * - * v0.2 Created - * v0.7 Changed second parameter to an options object - * v2 Dropped support for direct import of a module by name - * v14.2 Add facility for specifying the former name of an import - * - * @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 ((0, _is.isObject)(value) || isModule(value)) { - 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) { - var _math$Unit; - // 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; - } - const isDefined = math[name] !== undefined; - const isValuelessUnit = (_math$Unit = math.Unit) === null || _math$Unit === void 0 ? void 0 : _math$Unit.isValuelessUnit(name); - if (!isDefined && !isValuelessUnit || 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) { - var _factory$meta$formerl, _factory$meta; - 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'); - } - }; - const former = (_factory$meta$formerl = (_factory$meta = factory.meta) === null || _factory$meta === void 0 ? void 0 : _factory$meta.formerly) !== null && _factory$meta$formerl !== void 0 ? _factory$meta$formerl : ''; - const needsTransform = isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory); - const withTransform = math.expression.mathWithTransform; - - // TODO: add unit test with non-lazy factory - if (!factory.meta || factory.meta.lazy !== false) { - (0, _object.lazy)(namespace, name, resolver); - if (former) (0, _object.lazy)(namespace, former, 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); - if (former) _deleteTransform(former); - } else { - if (needsTransform) { - (0, _object.lazy)(withTransform, name, () => namespace[name]); - if (former) (0, _object.lazy)(withTransform, former, () => namespace[name]); - } - } - } else { - namespace[name] = resolver(); - if (former) namespace[former] = namespace[name]; - - // 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); - if (former) _deleteTransform(former); - } else { - if (needsTransform) { - (0, _object.lazy)(withTransform, name, () => namespace[name]); - if (former) (0, _object.lazy)(withTransform, former, () => 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 isModule(object) { - return typeof object === 'object' && object[Symbol.toStringTag] === 'Module'; - } - 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/node_modules/mathjs/lib/cjs/core/function/typed.js b/node_modules/mathjs/lib/cjs/core/function/typed.js deleted file mode 100644 index e274769..0000000 --- a/node_modules/mathjs/lib/cjs/core/function/typed.js +++ /dev/null @@ -1,461 +0,0 @@ -"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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1C8A\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-\uA7DC\uA7F1-\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{105C0}-\u{105F3}\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{10940}-\u{10959}\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{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\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{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\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{11BC0}-\u{11BE0}\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{11DB0}-\u{11DDB}\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{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\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{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF2}\u{16FF3}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\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}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52}\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{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}][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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1C8A\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-\uA7DC\uA7F1-\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{105C0}-\u{105F3}\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{10940}-\u{10959}\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{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\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{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\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{11BC0}-\u{11BE0}\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{11DB0}-\u{11DDB}\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{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\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{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF2}\u{16FF3}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\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{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{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}]*$/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); - } - }, { - 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/node_modules/mathjs/lib/cjs/defaultInstance.js b/node_modules/mathjs/lib/cjs/defaultInstance.js deleted file mode 100644 index c3fa964..0000000 --- a/node_modules/mathjs/lib/cjs/defaultInstance.js +++ /dev/null @@ -1,10 +0,0 @@ -"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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } -var _default = exports.default = (0, _create.create)(all); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js b/node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js deleted file mode 100644 index ad64246..0000000 --- a/node_modules/mathjs/lib/cjs/entry/allFactoriesAny.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.all = void 0; -var allFactories = _interopRequireWildcard(require("../factoriesAny.js")); -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } -// 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/node_modules/mathjs/lib/cjs/entry/allFactoriesNumber.js b/node_modules/mathjs/lib/cjs/entry/allFactoriesNumber.js deleted file mode 100644 index 6c240a9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/allFactoriesNumber.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.all = void 0; -var allFactories = _interopRequireWildcard(require("../factoriesNumber.js")); -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } -// 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/node_modules/mathjs/lib/cjs/entry/configReadonly.js b/node_modules/mathjs/lib/cjs/entry/configReadonly.js deleted file mode 100644 index 509c249..0000000 --- a/node_modules/mathjs/lib/cjs/entry/configReadonly.js +++ /dev/null @@ -1,22 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js deleted file mode 100644 index 51faee3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny.generated.js +++ /dev/null @@ -1,2595 +0,0 @@ -"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, "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, "bernoulliDependencies", { - enumerable: true, - get: function () { - return _dependenciesBernoulliGenerated.bernoulliDependencies; - } -}); -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, "coulombConstantDependencies", { - enumerable: true, - get: function () { - return _dependenciesCoulombConstantGenerated.coulombConstantDependencies; - } -}); -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, "isBoundedDependencies", { - enumerable: true, - get: function () { - return _dependenciesIsBoundedGenerated.isBoundedDependencies; - } -}); -Object.defineProperty(exports, "isFiniteDependencies", { - enumerable: true, - get: function () { - return _dependenciesIsFiniteGenerated.isFiniteDependencies; - } -}); -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, "mapSlicesDependencies", { - enumerable: true, - get: function () { - return _dependenciesMapSlicesGenerated.mapSlicesDependencies; - } -}); -Object.defineProperty(exports, "mapSlicesTransformDependencies", { - enumerable: true, - get: function () { - return _dependenciesMapSlicesTransformGenerated.mapSlicesTransformDependencies; - } -}); -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, "nullishDependencies", { - enumerable: true, - get: function () { - return _dependenciesNullishGenerated.nullishDependencies; - } -}); -Object.defineProperty(exports, "nullishTransformDependencies", { - enumerable: true, - get: function () { - return _dependenciesNullishTransformGenerated.nullishTransformDependencies; - } -}); -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, "toBestDependencies", { - enumerable: true, - get: function () { - return _dependenciesToBestGenerated.toBestDependencies; - } -}); -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 _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 _dependenciesBernoulliGenerated = require("./dependenciesAny/dependenciesBernoulli.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 _dependenciesCoulombConstantGenerated = require("./dependenciesAny/dependenciesCoulombConstant.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 _dependenciesIsBoundedGenerated = require("./dependenciesAny/dependenciesIsBounded.generated.js"); -var _dependenciesIsFiniteGenerated = require("./dependenciesAny/dependenciesIsFinite.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 _dependenciesMapSlicesGenerated = require("./dependenciesAny/dependenciesMapSlices.generated.js"); -var _dependenciesMapSlicesTransformGenerated = require("./dependenciesAny/dependenciesMapSlicesTransform.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 _dependenciesNullishGenerated = require("./dependenciesAny/dependenciesNullish.generated.js"); -var _dependenciesNullishTransformGenerated = require("./dependenciesAny/dependenciesNullishTransform.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 _dependenciesToBestGenerated = require("./dependenciesAny/dependenciesToBest.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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js deleted file mode 100644 index a209244..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAbs.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js deleted file mode 100644 index 1013f15..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAccessorNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js deleted file mode 100644 index 3a33acb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcos.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js deleted file mode 100644 index c11f52c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcosh.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js deleted file mode 100644 index ff6fe20..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcot.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js deleted file mode 100644 index 52eb9c1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcoth.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js deleted file mode 100644 index ec86871..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsc.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js deleted file mode 100644 index 117284d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAcsch.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js deleted file mode 100644 index fe3d875..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAdd.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js deleted file mode 100644 index 0259adb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAddScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js deleted file mode 100644 index 62b49af..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAnd.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js deleted file mode 100644 index 23cfcd9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAndTransform.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js deleted file mode 100644 index 9b63396..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArg.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js deleted file mode 100644 index 1dd6e9d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesArrayNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js deleted file mode 100644 index 4ce5ddd..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsec.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js deleted file mode 100644 index c998c7d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsech.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js deleted file mode 100644 index 16407af..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsin.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js deleted file mode 100644 index 9952f06..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAsinh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js deleted file mode 100644 index 3356a2c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAssignmentNode.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js deleted file mode 100644 index 8e74620..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js deleted file mode 100644 index d6f892b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtan2.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js deleted file mode 100644 index 8474b1b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtanh.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js deleted file mode 100644 index 22c1c3c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAtomicMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js deleted file mode 100644 index 5bc3c9f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesAvogadro.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js deleted file mode 100644 index 042691b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBellNumbers.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBernoulli.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBernoulli.generated.js deleted file mode 100644 index ed453a6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBernoulli.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.bernoulliDependencies = void 0; -var _dependenciesBigNumberClassGenerated = require("./dependenciesBigNumberClass.generated.js"); -var _dependenciesFractionClassGenerated = require("./dependenciesFractionClass.generated.js"); -var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.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 bernoulliDependencies = exports.bernoulliDependencies = { - BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, - FractionDependencies: _dependenciesFractionClassGenerated.FractionDependencies, - isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, - numberDependencies: _dependenciesNumberGenerated.numberDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createBernoulli: _factoriesAny.createBernoulli -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js deleted file mode 100644 index 3c96c2e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigNumberClass.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigint.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigint.generated.js deleted file mode 100644 index 5b2e8c6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBigint.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js deleted file mode 100644 index 872f75f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBignumber.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js deleted file mode 100644 index da90dde..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBin.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js deleted file mode 100644 index be66698..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAnd.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js deleted file mode 100644 index dcf6dc0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitAndTransform.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js deleted file mode 100644 index 4ab8f47..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitNot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js deleted file mode 100644 index 78cf43d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOr.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOrTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOrTransform.generated.js deleted file mode 100644 index 2671bc1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitOrTransform.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js deleted file mode 100644 index c5a2f60..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.bitXorDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createBitXor: _factoriesAny.createBitXor -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js deleted file mode 100644 index 10c04cc..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBlockNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js deleted file mode 100644 index 7d72bc7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrMagneton.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js deleted file mode 100644 index 476da49..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBohrRadius.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js deleted file mode 100644 index 4f5135b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoltzmann.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js deleted file mode 100644 index d52eae8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesBoolean.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js deleted file mode 100644 index 1e35a08..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCatalan.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js deleted file mode 100644 index 5608678..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCbrt.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js deleted file mode 100644 index 261c51e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCeil.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js deleted file mode 100644 index 61ba627..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChain.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js deleted file mode 100644 index 8c00a84..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js deleted file mode 100644 index e08033a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js deleted file mode 100644 index a23e7c4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesClone.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js deleted file mode 100644 index 0db7c9e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumn.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js deleted file mode 100644 index 84e9737..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesColumnTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js deleted file mode 100644 index 41d58d6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinations.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js deleted file mode 100644 index 8727fc1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js deleted file mode 100644 index f5f7b26..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompare.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js deleted file mode 100644 index 34dca1d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareNatural.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js deleted file mode 100644 index 863a8a3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompareText.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js deleted file mode 100644 index 08e0e7f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCompile.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js deleted file mode 100644 index f6fbf39..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplex.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js deleted file mode 100644 index 480c6e1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComplexClass.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js deleted file mode 100644 index 159937a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesComposition.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js deleted file mode 100644 index 5406431..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcat.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js deleted file mode 100644 index b34b69f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConcatTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js deleted file mode 100644 index e4fe8a4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConditionalNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js deleted file mode 100644 index b9c4ba4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js deleted file mode 100644 index 17e72c9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConj.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js deleted file mode 100644 index 1f22afe..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesConstantNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ConstantNodeDependencies = void 0; -var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); -var _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.generated.js"); -var _factoriesAny = require("../../factoriesAny.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const ConstantNodeDependencies = exports.ConstantNodeDependencies = { - NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - createConstantNode: _factoriesAny.createConstantNode -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCorr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCorr.generated.js deleted file mode 100644 index 44679f5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCorr.generated.js +++ /dev/null @@ -1,35 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js deleted file mode 100644 index baa3170..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCos.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js deleted file mode 100644 index 14528a6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCosh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js deleted file mode 100644 index 02c4e5f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCot.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js deleted file mode 100644 index 8dc4cb6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoth.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js deleted file mode 100644 index a9b2d72..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulomb.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulombConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulombConstant.generated.js deleted file mode 100644 index 9cbc9db..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCoulombConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.coulombConstantDependencies = 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 coulombConstantDependencies = exports.coulombConstantDependencies = { - BigNumberDependencies: _dependenciesBigNumberClassGenerated.BigNumberDependencies, - UnitDependencies: _dependenciesUnitClassGenerated.UnitDependencies, - createCoulombConstant: _factoriesAny.createCoulombConstant -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js deleted file mode 100644 index a9b2b3d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCount.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js deleted file mode 100644 index 991076b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCreateUnit.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js deleted file mode 100644 index 8be6d39..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCross.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js deleted file mode 100644 index 342c99f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsc.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js deleted file mode 100644 index 5e461e0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCsch.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js deleted file mode 100644 index 6d17118..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCtranspose.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js deleted file mode 100644 index b5de087..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCube.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSum.generated.js deleted file mode 100644 index bd1dfd0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSum.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSumTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSumTransform.generated.js deleted file mode 100644 index 4370a1e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesCumSumTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js deleted file mode 100644 index f0d2fb0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeepEqual.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js deleted file mode 100644 index 921d31e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js deleted file mode 100644 index ecac7f2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDerivative.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js deleted file mode 100644 index 1697b14..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js deleted file mode 100644 index 096e30d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDeuteronMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js deleted file mode 100644 index a4e36ec..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiag.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js deleted file mode 100644 index 94f634a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiff.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js deleted file mode 100644 index 37a03b2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDiffTransform.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js deleted file mode 100644 index 3a82821..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDistance.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js deleted file mode 100644 index eb7279a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivide.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js deleted file mode 100644 index cb63652..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDivideScalar.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js deleted file mode 100644 index 7de92d1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDot.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js deleted file mode 100644 index 70f3e77..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.dotDivideDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js deleted file mode 100644 index f69a302..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotMultiply.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js deleted file mode 100644 index 44867d9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.dotPowDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js deleted file mode 100644 index dccc3aa..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesE.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js deleted file mode 100644 index f5318a9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEfimovFactor.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js deleted file mode 100644 index 8332e40..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEigs.generated.js +++ /dev/null @@ -1,79 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js deleted file mode 100644 index 5c6f2d8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectricConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js deleted file mode 100644 index 1850f7f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElectronMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js deleted file mode 100644 index cff49e6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesElementaryCharge.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js deleted file mode 100644 index 5786ae4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.equalDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createEqual: _factoriesAny.createEqual -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js deleted file mode 100644 index 74c417d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js deleted file mode 100644 index cb8c2d4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEqualText.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js deleted file mode 100644 index c829914..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesErf.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js deleted file mode 100644 index 91fc6c7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesEvaluate.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js deleted file mode 100644 index 40d3405..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExp.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js deleted file mode 100644 index f0c0bad..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js deleted file mode 100644 index 2341cce..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesExpm1.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js deleted file mode 100644 index 5b0cb68..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFactorial.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js deleted file mode 100644 index cf7d620..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFalse.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js deleted file mode 100644 index 0b764b5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFaraday.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js deleted file mode 100644 index e83d858..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFermiCoupling.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js deleted file mode 100644 index afcb954..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFft.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js deleted file mode 100644 index a652c0d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js deleted file mode 100644 index d2a95b7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilter.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js deleted file mode 100644 index e20f07b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFilterTransform.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js deleted file mode 100644 index d23fcd1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFineStructure.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js deleted file mode 100644 index 71f6d89..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFirstRadiation.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js deleted file mode 100644 index a3991af..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFix.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js deleted file mode 100644 index 7374fba..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js deleted file mode 100644 index 0dab5f4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFloor.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js deleted file mode 100644 index 332f049..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEach.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js deleted file mode 100644 index 97f8396..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesForEachTransform.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js deleted file mode 100644 index 17e9173..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFormat.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js deleted file mode 100644 index 01a451b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFraction.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js deleted file mode 100644 index 3537798..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFractionClass.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js deleted file mode 100644 index e4b9c18..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFreqz.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js deleted file mode 100644 index 533b6a2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js deleted file mode 100644 index d49ec5c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesFunctionNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js deleted file mode 100644 index af6f35a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGamma.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js deleted file mode 100644 index 21dfe43..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGasConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js deleted file mode 100644 index a43a568..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGcd.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js deleted file mode 100644 index 82e4827..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js deleted file mode 100644 index 51b8b36..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravitationConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js deleted file mode 100644 index 3b16894..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesGravity.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js deleted file mode 100644 index 8a62590..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js deleted file mode 100644 index 6aeb4c3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHasNumericValue.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js deleted file mode 100644 index 75337a1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelp.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js deleted file mode 100644 index 3d2dcd0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHelpClass.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js deleted file mode 100644 index a3cfc5a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHex.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js deleted file mode 100644 index d77515b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesHypot.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js deleted file mode 100644 index a172b7a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesI.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js deleted file mode 100644 index dc2635c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIdentity.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js deleted file mode 100644 index b39012b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIfft.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js deleted file mode 100644 index 5f8f27a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIm.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js deleted file mode 100644 index 6096907..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js deleted file mode 100644 index 74abca3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndex.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js deleted file mode 100644 index 6731548..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexClass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js deleted file mode 100644 index 967371d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js deleted file mode 100644 index 94fc2f8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIndexTransform.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js deleted file mode 100644 index 2534c8a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInfinity.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js deleted file mode 100644 index 5ecc970..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIntersect.generated.js +++ /dev/null @@ -1,43 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js deleted file mode 100644 index 7641b37..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInv.generated.js +++ /dev/null @@ -1,33 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js deleted file mode 100644 index 37f933d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js deleted file mode 100644 index fa6d7f2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsBounded.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsBounded.generated.js deleted file mode 100644 index 9bf9764..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsBounded.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isBoundedDependencies = void 0; -var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); -var _factoriesAny = require("../../factoriesAny.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const isBoundedDependencies = exports.isBoundedDependencies = { - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createIsBounded: _factoriesAny.createIsBounded -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsFinite.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsFinite.generated.js deleted file mode 100644 index ca90114..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsFinite.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isFiniteDependencies = void 0; -var _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.generated.js"); -var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); -var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); -var _factoriesAny = require("../../factoriesAny.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const isFiniteDependencies = exports.isFiniteDependencies = { - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - mapDependencies: _dependenciesMapGenerated.mapDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createIsFinite: _factoriesAny.createIsFinite -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js deleted file mode 100644 index 5b68a58..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsInteger.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIntegerDependencies = 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 isIntegerDependencies = exports.isIntegerDependencies = { - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createIsInteger: _factoriesAny.createIsInteger -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js deleted file mode 100644 index 190d036..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNaN.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js deleted file mode 100644 index 1039abf..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNegative.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js deleted file mode 100644 index 5ba31d7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsNumeric.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js deleted file mode 100644 index 0b19335..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPositive.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js deleted file mode 100644 index 82ebfd0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsPrime.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js deleted file mode 100644 index 1d86159..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesIsZero.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js deleted file mode 100644 index 30cd592..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js +++ /dev/null @@ -1,33 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js deleted file mode 100644 index 9c6aefc..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKlitzing.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js deleted file mode 100644 index 7e6eff6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesKron.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js deleted file mode 100644 index 42d6d6f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN10.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js deleted file mode 100644 index 6ea7e58..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLN2.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js deleted file mode 100644 index d86d760..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG10E.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js deleted file mode 100644 index c85914b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLOG2E.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js deleted file mode 100644 index d6f1419..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.largerDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); -var _dependenciesBignumberGenerated = require("./dependenciesBignumber.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createLarger: _factoriesAny.createLarger -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js deleted file mode 100644 index 348aecc..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.largerEqDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createLargerEq: _factoriesAny.createLargerEq -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js deleted file mode 100644 index f279e17..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLcm.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeafCount.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeafCount.generated.js deleted file mode 100644 index 409882d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeafCount.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js deleted file mode 100644 index bd6c224..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLeftShift.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js deleted file mode 100644 index 7c12fe1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js deleted file mode 100644 index 088fc7e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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 _dependenciesTypeOfGenerated = require("./dependenciesTypeOf.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, - typeOfDependencies: _dependenciesTypeOfGenerated.typeOfDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createLog: _factoriesAny.createLog -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js deleted file mode 100644 index 865cd7c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog10.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js deleted file mode 100644 index 7b6af55..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog1p.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js deleted file mode 100644 index be63826..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLog2.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js deleted file mode 100644 index 1188507..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLoschmidt.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js deleted file mode 100644 index a7baef8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolve.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js deleted file mode 100644 index 1c2c7ce..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLsolveAll.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js deleted file mode 100644 index 84ff4ac..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLup.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js deleted file mode 100644 index fb3df3f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLusolve.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLyap.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLyap.generated.js deleted file mode 100644 index 9a092ec..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesLyap.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js deleted file mode 100644 index d8f13d2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMad.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js deleted file mode 100644 index 7812682..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js deleted file mode 100644 index 8a2d2a9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js deleted file mode 100644 index 23e401d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMap.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapSlices.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapSlices.generated.js deleted file mode 100644 index 7184200..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapSlices.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mapSlicesDependencies = 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 mapSlicesDependencies = exports.mapSlicesDependencies = { - isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMapSlices: _factoriesAny.createMapSlices -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapSlicesTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapSlicesTransform.generated.js deleted file mode 100644 index ac2fb51..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapSlicesTransform.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mapSlicesTransformDependencies = 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 mapSlicesTransformDependencies = exports.mapSlicesTransformDependencies = { - isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMapSlicesTransform: _factoriesAny.createMapSlicesTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js deleted file mode 100644 index 42567b3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMapTransform.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js deleted file mode 100644 index f085dd6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrix.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js deleted file mode 100644 index f28ed0c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixClass.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js deleted file mode 100644 index 2722b83..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js deleted file mode 100644 index affb043..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js deleted file mode 100644 index bc05055..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js deleted file mode 100644 index 0913b43..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMax.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.maxDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - largerDependencies: _dependenciesLargerGenerated.largerDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMax: _factoriesAny.createMax -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js deleted file mode 100644 index 20a9cd6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMaxTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.maxTransformDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - largerDependencies: _dependenciesLargerGenerated.largerDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMaxTransform: _factoriesAny.createMaxTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js deleted file mode 100644 index 73fb788..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMean.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js deleted file mode 100644 index 43b58de..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMeanTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js deleted file mode 100644 index 7ccea59..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMedian.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js deleted file mode 100644 index ea95fc2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMin.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.minDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMin: _factoriesAny.createMin -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js deleted file mode 100644 index e2b3c6e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMinTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.minTransformDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMinTransform: _factoriesAny.createMinTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js deleted file mode 100644 index 0c66c0c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMod.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js deleted file mode 100644 index 120cf46..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMode.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js deleted file mode 100644 index 359508e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js deleted file mode 100644 index 685080c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarMassC12.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js deleted file mode 100644 index 465673e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js deleted file mode 100644 index 025d170..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMolarVolume.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js deleted file mode 100644 index 7aac091..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultinomial.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js deleted file mode 100644 index 5058b57..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiply.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js deleted file mode 100644 index c93ed59..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js deleted file mode 100644 index 0a40ca2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNaN.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js deleted file mode 100644 index 793c05d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNeutronMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js deleted file mode 100644 index 4028831..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNode.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js deleted file mode 100644 index a9144a6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNorm.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js deleted file mode 100644 index 0b6d52a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js deleted file mode 100644 index fb7b091..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoot.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js deleted file mode 100644 index a2fd939..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNthRoots.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js deleted file mode 100644 index 016d4f9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js deleted file mode 100644 index 06e6030..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNull.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNullish.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNullish.generated.js deleted file mode 100644 index dfe4dd2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNullish.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.nullishDependencies = void 0; -var _dependenciesDeepEqualGenerated = require("./dependenciesDeepEqual.generated.js"); -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 nullishDependencies = exports.nullishDependencies = { - deepEqualDependencies: _dependenciesDeepEqualGenerated.deepEqualDependencies, - flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createNullish: _factoriesAny.createNullish -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNullishTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNullishTransform.generated.js deleted file mode 100644 index 5eca167..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNullishTransform.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.nullishTransformDependencies = void 0; -var _dependenciesDeepEqualGenerated = require("./dependenciesDeepEqual.generated.js"); -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 nullishTransformDependencies = exports.nullishTransformDependencies = { - deepEqualDependencies: _dependenciesDeepEqualGenerated.deepEqualDependencies, - flattenDependencies: _dependenciesFlattenGenerated.flattenDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - sizeDependencies: _dependenciesSizeGenerated.sizeDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createNullishTransform: _factoriesAny.createNullishTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js deleted file mode 100644 index f2daee6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumber.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js deleted file mode 100644 index 736f9de..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesNumeric.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js deleted file mode 100644 index 9d6abee..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesObjectNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js deleted file mode 100644 index 22a2fc9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOct.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js deleted file mode 100644 index 6bf6fa4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOnes.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js deleted file mode 100644 index 2787034..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOperatorNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js deleted file mode 100644 index de904e7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOr.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOrTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOrTransform.generated.js deleted file mode 100644 index 83f0370..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesOrTransform.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js deleted file mode 100644 index 08de22b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParenthesisNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js deleted file mode 100644 index de8dace..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParse.generated.js +++ /dev/null @@ -1,49 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js deleted file mode 100644 index 9fa99ea..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParser.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js deleted file mode 100644 index 665fae4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesParserClass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ParserDependencies = void 0; -var _dependenciesEvaluateGenerated = require("./dependenciesEvaluate.generated.js"); -var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); -var _factoriesAny = require("../../factoriesAny.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const ParserDependencies = exports.ParserDependencies = { - evaluateDependencies: _dependenciesEvaluateGenerated.evaluateDependencies, - parseDependencies: _dependenciesParseGenerated.parseDependencies, - createParserClass: _factoriesAny.createParserClass -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js deleted file mode 100644 index 3ec52a7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPartitionSelect.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js deleted file mode 100644 index dd90fb5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPermutations.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js deleted file mode 100644 index d11ac28..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPhi.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js deleted file mode 100644 index 98f8d9e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPi.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js deleted file mode 100644 index 492616c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPickRandom.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js deleted file mode 100644 index 73f1f8b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js +++ /dev/null @@ -1,39 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js deleted file mode 100644 index a201819..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckCharge.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js deleted file mode 100644 index 067e11d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js deleted file mode 100644 index 8e3fd7f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckLength.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js deleted file mode 100644 index 131852c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js deleted file mode 100644 index 742e2ec..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js deleted file mode 100644 index 4a24085..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPlanckTime.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js deleted file mode 100644 index 08b10fb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js deleted file mode 100644 index 9f3cf06..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js deleted file mode 100644 index 61ec88a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrint.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrintTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrintTransform.generated.js deleted file mode 100644 index de5b63c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesPrintTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js deleted file mode 100644 index 81232f7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProd.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js deleted file mode 100644 index 1676078..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesProtonMass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js deleted file mode 100644 index c84ce8e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQr.generated.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js deleted file mode 100644 index 493abb3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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 _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js deleted file mode 100644 index d7e563d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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 _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js deleted file mode 100644 index 10a77cd..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js deleted file mode 100644 index bd3adb8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandom.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js deleted file mode 100644 index bc1bde7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.randomIntDependencies = void 0; -var _dependenciesLog2Generated = require("./dependenciesLog2.generated.js"); -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 = { - log2Dependencies: _dependenciesLog2Generated.log2Dependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createRandomInt: _factoriesAny.createRandomInt -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js deleted file mode 100644 index cc7660e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRange.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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 _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); -var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); -var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.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, - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, - isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js deleted file mode 100644 index f1e48ad..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeClass.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js deleted file mode 100644 index 7aad9a9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js deleted file mode 100644 index 0e8b174..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRangeTransform.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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 _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); -var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); -var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.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, - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, - isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js deleted file mode 100644 index 7668049..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js +++ /dev/null @@ -1,63 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js deleted file mode 100644 index 35789c5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRe.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js deleted file mode 100644 index 4041248..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js deleted file mode 100644 index 62c1626..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRelationalNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js deleted file mode 100644 index 39e3ff1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReplacer.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js deleted file mode 100644 index 7587a7f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReshape.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js deleted file mode 100644 index 4c9546e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResize.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js deleted file mode 100644 index 7b174e9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js deleted file mode 100644 index 0ee382c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesResultSet.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js deleted file mode 100644 index 8507ead..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesReviver.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js deleted file mode 100644 index a2add6a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightArithShift.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js deleted file mode 100644 index ae40dd7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRightLogShift.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js deleted file mode 100644 index ac2bf2d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotate.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js deleted file mode 100644 index b64a159..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRotationMatrix.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js deleted file mode 100644 index 3b222f8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRound.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js deleted file mode 100644 index 39b94b8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRow.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js deleted file mode 100644 index 70fc593..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRowTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js deleted file mode 100644 index 6df96b5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesRydberg.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js deleted file mode 100644 index d2257d1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT1_2.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js deleted file mode 100644 index f6b0b76..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSQRT2.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js deleted file mode 100644 index 48869b7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSackurTetrode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSchur.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSchur.generated.js deleted file mode 100644 index 38fdf66..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSchur.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js deleted file mode 100644 index 7c17436..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSec.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js deleted file mode 100644 index 954a48d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSech.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js deleted file mode 100644 index 25f2773..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSecondRadiation.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js deleted file mode 100644 index 7ad7c4d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetCartesian.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js deleted file mode 100644 index 048786c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDifference.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js deleted file mode 100644 index 047735f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetDistinct.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js deleted file mode 100644 index 7f24e3a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIntersect.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js deleted file mode 100644 index 2171853..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetIsSubset.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js deleted file mode 100644 index 404a796..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js deleted file mode 100644 index d35c0d4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetPowerset.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js deleted file mode 100644 index 9b821a2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSize.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js deleted file mode 100644 index 6c4bf9b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetSymDifference.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js deleted file mode 100644 index 0ca3b74..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSetUnion.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js deleted file mode 100644 index 8a8d566..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSign.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js deleted file mode 100644 index cc38039..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js +++ /dev/null @@ -1,47 +0,0 @@ -"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 _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); -var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); -var _dependenciesReplacerGenerated = require("./dependenciesReplacer.generated.js"); -var _dependenciesResolveGenerated = require("./dependenciesResolve.generated.js"); -var _dependenciesSimplifyConstantGenerated = require("./dependenciesSimplifyConstant.generated.js"); -var _dependenciesSimplifyCoreGenerated = require("./dependenciesSimplifyCore.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 = { - 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, - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - parseDependencies: _dependenciesParseGenerated.parseDependencies, - replacerDependencies: _dependenciesReplacerGenerated.replacerDependencies, - resolveDependencies: _dependenciesResolveGenerated.resolveDependencies, - simplifyConstantDependencies: _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies, - simplifyCoreDependencies: _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSimplify: _factoriesAny.createSimplify -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js deleted file mode 100644 index a81cfc7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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 _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.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, - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSimplifyConstant: _factoriesAny.createSimplifyConstant -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js deleted file mode 100644 index 24ab57b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js +++ /dev/null @@ -1,51 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js deleted file mode 100644 index d598bb1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSin.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js deleted file mode 100644 index 3ca69c5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSinh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js deleted file mode 100644 index 3b5a2eb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSize.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sizeDependencies = void 0; -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 = { - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSize: _factoriesAny.createSize -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js deleted file mode 100644 index ce824d3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSlu.generated.js +++ /dev/null @@ -1,35 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js deleted file mode 100644 index 5c504a7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.smallerDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.generated.js"); -var _dependenciesBignumberGenerated = require("./dependenciesBignumber.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - bignumberDependencies: _dependenciesBignumberGenerated.bignumberDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSmaller: _factoriesAny.createSmaller -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js deleted file mode 100644 index ed4615b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.smallerEqDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSmallerEq: _factoriesAny.createSmallerEq -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js deleted file mode 100644 index b23de99..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSolveODE.generated.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js deleted file mode 100644 index 94036fd..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSort.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js deleted file mode 100644 index 6ffda1e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpaClass.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js deleted file mode 100644 index 89047ce..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparse.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js deleted file mode 100644 index af95c83..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js deleted file mode 100644 index 6a0daf2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js deleted file mode 100644 index 244bb24..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSplitUnit.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js deleted file mode 100644 index 693e1b3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrt.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js deleted file mode 100644 index c02cf69..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js deleted file mode 100644 index fe2dc1a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSquare.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js deleted file mode 100644 index bce917c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js deleted file mode 100644 index 3a20a73..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js deleted file mode 100644 index 9869410..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js deleted file mode 100644 index f5c4ad4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js deleted file mode 100644 index 7f7a6d4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesStirlingS2.generated.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js deleted file mode 100644 index 2a14a55..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesString.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js deleted file mode 100644 index 9f658cb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubset.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js deleted file mode 100644 index d85fe5a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubsetTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js deleted file mode 100644 index 784a909..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtract.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtractScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtractScalar.generated.js deleted file mode 100644 index 33608da..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSubtractScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js deleted file mode 100644 index 78927db..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSum.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js deleted file mode 100644 index 1961331..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSumTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSylvester.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSylvester.generated.js deleted file mode 100644 index b5db13f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSylvester.generated.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js deleted file mode 100644 index a34e548..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js deleted file mode 100644 index 562c7c7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js deleted file mode 100644 index df5060e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTan.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js deleted file mode 100644 index 8b03fed..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTanh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js deleted file mode 100644 index 3cbd68d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTau.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js deleted file mode 100644 index 6aa9bae..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js deleted file mode 100644 index 055da52..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTo.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesToBest.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesToBest.generated.js deleted file mode 100644 index 1fdcd30..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesToBest.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toBestDependencies = void 0; -var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); -var _factoriesAny = require("../../factoriesAny.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const toBestDependencies = exports.toBestDependencies = { - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createToBest: _factoriesAny.createToBest -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js deleted file mode 100644 index 0101245..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrace.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js deleted file mode 100644 index a50a2e6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTranspose.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js deleted file mode 100644 index 7a7f863..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTrue.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js deleted file mode 100644 index 2d69b03..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTypeOf.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js deleted file mode 100644 index 1cec5b5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesTyped.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js deleted file mode 100644 index 4235a84..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryMinus.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js deleted file mode 100644 index 7f50a4f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnaryPlus.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js deleted file mode 100644 index 71e47a7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.unequalDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - equalScalarDependencies: _dependenciesEqualScalarGenerated.equalScalarDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createUnequal: _factoriesAny.createUnequal -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js deleted file mode 100644 index 9da2ac5..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitClass.generated.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js deleted file mode 100644 index fc4cbfb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUnitFunction.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js deleted file mode 100644 index 21959cc..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercaseE.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js deleted file mode 100644 index 3503d4c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUppercasePi.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js deleted file mode 100644 index e54ac02..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolve.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js deleted file mode 100644 index 60f017b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesUsolveAll.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js deleted file mode 100644 index 4619717..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js deleted file mode 100644 index ac9bfc9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.varianceDependencies = void 0; -var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); -var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -var _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - divideDependencies: _dependenciesDivideGenerated.divideDependencies, - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, - subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createVariance: _factoriesAny.createVariance -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js deleted file mode 100644 index a8661c2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.varianceTransformDependencies = void 0; -var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); -var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -var _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - divideDependencies: _dependenciesDivideGenerated.divideDependencies, - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, - subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createVarianceTransform: _factoriesAny.createVarianceTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js deleted file mode 100644 index 8987e6b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesVersion.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js deleted file mode 100644 index 666712d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js deleted file mode 100644 index ffead9b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesWienDisplacement.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js deleted file mode 100644 index 5d9ffbc..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXgcd.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js deleted file mode 100644 index ce4651d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.xorDependencies = void 0; -var _dependenciesDenseMatrixClassGenerated = require("./dependenciesDenseMatrixClass.generated.js"); -var _dependenciesSparseMatrixClassGenerated = require("./dependenciesSparseMatrixClass.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, - SparseMatrixDependencies: _dependenciesSparseMatrixClassGenerated.SparseMatrixDependencies, - concatDependencies: _dependenciesConcatGenerated.concatDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createXor: _factoriesAny.createXor -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js deleted file mode 100644 index 3a5e95a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeros.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeta.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeta.generated.js deleted file mode 100644 index bc60cfa..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZeta.generated.js +++ /dev/null @@ -1,47 +0,0 @@ -"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 _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.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, - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js deleted file mode 100644 index 926b4ea..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesAny/dependenciesZpk2tf.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber.generated.js deleted file mode 100644 index 57213a4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber.generated.js +++ /dev/null @@ -1,1468 +0,0 @@ -"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, "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, "bernoulliDependencies", { - enumerable: true, - get: function () { - return _dependenciesBernoulliGenerated.bernoulliDependencies; - } -}); -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, "isBoundedDependencies", { - enumerable: true, - get: function () { - return _dependenciesIsBoundedGenerated.isBoundedDependencies; - } -}); -Object.defineProperty(exports, "isFiniteDependencies", { - enumerable: true, - get: function () { - return _dependenciesIsFiniteGenerated.isFiniteDependencies; - } -}); -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, "mapSlicesDependencies", { - enumerable: true, - get: function () { - return _dependenciesMapSlicesGenerated.mapSlicesDependencies; - } -}); -Object.defineProperty(exports, "mapSlicesTransformDependencies", { - enumerable: true, - get: function () { - return _dependenciesMapSlicesTransformGenerated.mapSlicesTransformDependencies; - } -}); -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 _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 _dependenciesBernoulliGenerated = require("./dependenciesNumber/dependenciesBernoulli.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 _dependenciesIsBoundedGenerated = require("./dependenciesNumber/dependenciesIsBounded.generated.js"); -var _dependenciesIsFiniteGenerated = require("./dependenciesNumber/dependenciesIsFinite.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 _dependenciesMapSlicesGenerated = require("./dependenciesNumber/dependenciesMapSlices.generated.js"); -var _dependenciesMapSlicesTransformGenerated = require("./dependenciesNumber/dependenciesMapSlicesTransform.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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAbs.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAbs.generated.js deleted file mode 100644 index e9485c9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAbs.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAccessorNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAccessorNode.generated.js deleted file mode 100644 index 1e76b37..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAccessorNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcos.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcos.generated.js deleted file mode 100644 index ba76716..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcos.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcosh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcosh.generated.js deleted file mode 100644 index 6d65aa0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcosh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcot.generated.js deleted file mode 100644 index fa77128..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcoth.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcoth.generated.js deleted file mode 100644 index 26e4d33..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcoth.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsc.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsc.generated.js deleted file mode 100644 index 97a796a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsc.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsch.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsch.generated.js deleted file mode 100644 index a732848..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAcsch.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAdd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAdd.generated.js deleted file mode 100644 index 0e292c9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAdd.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAddScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAddScalar.generated.js deleted file mode 100644 index 51789ef..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAddScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAnd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAnd.generated.js deleted file mode 100644 index 20f1fe3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAnd.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesArrayNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesArrayNode.generated.js deleted file mode 100644 index dc59bef..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesArrayNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsec.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsec.generated.js deleted file mode 100644 index 57e34a7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsec.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsech.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsech.generated.js deleted file mode 100644 index 8723bb2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsech.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsin.generated.js deleted file mode 100644 index 743cf4f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsin.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsinh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsinh.generated.js deleted file mode 100644 index 9a7c1bf..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAsinh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js deleted file mode 100644 index db3c7f4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan.generated.js deleted file mode 100644 index 74f6f0b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan2.generated.js deleted file mode 100644 index fe4d438..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtan2.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtanh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtanh.generated.js deleted file mode 100644 index 6f67c96..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesAtanh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBellNumbers.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBellNumbers.generated.js deleted file mode 100644 index 84a4ab6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBellNumbers.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBernoulli.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBernoulli.generated.js deleted file mode 100644 index a725419..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBernoulli.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.bernoulliDependencies = void 0; -var _dependenciesIsIntegerGenerated = require("./dependenciesIsInteger.generated.js"); -var _dependenciesNumberGenerated = require("./dependenciesNumber.generated.js"); -var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); -var _factoriesNumber = require("../../factoriesNumber.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const bernoulliDependencies = exports.bernoulliDependencies = { - isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, - numberDependencies: _dependenciesNumberGenerated.numberDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createBernoulli: _factoriesNumber.createBernoulli -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBigint.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBigint.generated.js deleted file mode 100644 index 711e272..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBigint.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitAnd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitAnd.generated.js deleted file mode 100644 index 1d8fb1a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitAnd.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitNot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitNot.generated.js deleted file mode 100644 index cb2d71e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitNot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitOr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitOr.generated.js deleted file mode 100644 index 6ce8e6e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitOr.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitXor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitXor.generated.js deleted file mode 100644 index d1b6408..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBitXor.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBlockNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBlockNode.generated.js deleted file mode 100644 index aafced2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBlockNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBoolean.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBoolean.generated.js deleted file mode 100644 index 7f19df9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesBoolean.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js deleted file mode 100644 index cc1737d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCatalan.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCbrt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCbrt.generated.js deleted file mode 100644 index 7f34821..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCbrt.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js deleted file mode 100644 index 5a99231..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCeil.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChain.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChain.generated.js deleted file mode 100644 index e4fcb16..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChain.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js deleted file mode 100644 index 099a462..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesClone.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesClone.generated.js deleted file mode 100644 index d635205..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesClone.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinations.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinations.generated.js deleted file mode 100644 index 54f291b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinations.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js deleted file mode 100644 index 3ab0e01..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompare.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompare.generated.js deleted file mode 100644 index a2ef64a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompare.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareNatural.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareNatural.generated.js deleted file mode 100644 index 79b56c2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareNatural.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareText.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareText.generated.js deleted file mode 100644 index 10831d9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompareText.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompile.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompile.generated.js deleted file mode 100644 index e05ece3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCompile.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesComposition.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesComposition.generated.js deleted file mode 100644 index 86fa60b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesComposition.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConditionalNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConditionalNode.generated.js deleted file mode 100644 index 3717bf3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConditionalNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConstantNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConstantNode.generated.js deleted file mode 100644 index 01020fb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesConstantNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ConstantNodeDependencies = void 0; -var _dependenciesNodeGenerated = require("./dependenciesNode.generated.js"); -var _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.generated.js"); -var _factoriesNumber = require("../../factoriesNumber.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const ConstantNodeDependencies = exports.ConstantNodeDependencies = { - NodeDependencies: _dependenciesNodeGenerated.NodeDependencies, - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - createConstantNode: _factoriesNumber.createConstantNode -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCorr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCorr.generated.js deleted file mode 100644 index 0406748..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCorr.generated.js +++ /dev/null @@ -1,35 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCos.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCos.generated.js deleted file mode 100644 index 7a1c466..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCos.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCosh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCosh.generated.js deleted file mode 100644 index afb0b87..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCosh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCot.generated.js deleted file mode 100644 index 8e2c524..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCoth.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCoth.generated.js deleted file mode 100644 index f5eb7b8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCoth.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsc.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsc.generated.js deleted file mode 100644 index 181723c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsc.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsch.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsch.generated.js deleted file mode 100644 index e4ea771..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCsch.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCube.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCube.generated.js deleted file mode 100644 index 6735e1b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCube.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSum.generated.js deleted file mode 100644 index 63e1596..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSum.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js deleted file mode 100644 index 5ab2c2a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDeepEqual.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDeepEqual.generated.js deleted file mode 100644 index dc54e9c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDeepEqual.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDerivative.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDerivative.generated.js deleted file mode 100644 index cf41d1f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDerivative.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivide.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivide.generated.js deleted file mode 100644 index 346757e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivide.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivideScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivideScalar.generated.js deleted file mode 100644 index 64dfeb4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesDivideScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesE.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesE.generated.js deleted file mode 100644 index cecc000..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesE.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqual.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqual.generated.js deleted file mode 100644 index a59e816..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqual.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualScalar.generated.js deleted file mode 100644 index a691430..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualText.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualText.generated.js deleted file mode 100644 index 220c175..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEqualText.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesErf.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesErf.generated.js deleted file mode 100644 index 7daf4fa..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesErf.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEvaluate.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEvaluate.generated.js deleted file mode 100644 index 7f62901..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesEvaluate.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExp.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExp.generated.js deleted file mode 100644 index 1f6a507..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExp.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExpm1.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExpm1.generated.js deleted file mode 100644 index 04cf1c6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesExpm1.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFactorial.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFactorial.generated.js deleted file mode 100644 index b610553..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFactorial.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFalse.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFalse.generated.js deleted file mode 100644 index 67e166e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFalse.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilter.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilter.generated.js deleted file mode 100644 index 141e4f7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilter.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilterTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilterTransform.generated.js deleted file mode 100644 index 9fe1a59..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFilterTransform.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js deleted file mode 100644 index f4f5c96..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFix.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js deleted file mode 100644 index 582d328..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFloor.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEach.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEach.generated.js deleted file mode 100644 index 81936d0..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEach.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEachTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEachTransform.generated.js deleted file mode 100644 index 2aa784a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesForEachTransform.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFormat.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFormat.generated.js deleted file mode 100644 index 0479849..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFormat.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js deleted file mode 100644 index 218e5fa..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionNode.generated.js deleted file mode 100644 index 62c3d4d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesFunctionNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGamma.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGamma.generated.js deleted file mode 100644 index b27dc79..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGamma.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGcd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGcd.generated.js deleted file mode 100644 index d797983..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesGcd.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js deleted file mode 100644 index 44acb49..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelp.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelp.generated.js deleted file mode 100644 index 64af532..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelp.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelpClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelpClass.generated.js deleted file mode 100644 index 6253896..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHelpClass.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHypot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHypot.generated.js deleted file mode 100644 index fb7e015..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesHypot.generated.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndex.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndex.generated.js deleted file mode 100644 index 72b8bc7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndex.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js deleted file mode 100644 index c2c40f7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIndexNode.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesInfinity.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesInfinity.generated.js deleted file mode 100644 index 1196315..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesInfinity.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsBounded.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsBounded.generated.js deleted file mode 100644 index b8a24e6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsBounded.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isBoundedDependencies = void 0; -var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); -var _factoriesNumber = require("../../factoriesNumber.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const isBoundedDependencies = exports.isBoundedDependencies = { - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createIsBounded: _factoriesNumber.createIsBounded -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsFinite.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsFinite.generated.js deleted file mode 100644 index 99cfedb..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsFinite.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isFiniteDependencies = void 0; -var _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.generated.js"); -var _dependenciesMapGenerated = require("./dependenciesMap.generated.js"); -var _dependenciesTypedGenerated = require("./dependenciesTyped.generated.js"); -var _factoriesNumber = require("../../factoriesNumber.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const isFiniteDependencies = exports.isFiniteDependencies = { - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - mapDependencies: _dependenciesMapGenerated.mapDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createIsFinite: _factoriesNumber.createIsFinite -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsInteger.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsInteger.generated.js deleted file mode 100644 index 2450b89..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsInteger.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNaN.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNaN.generated.js deleted file mode 100644 index ae67c93..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNaN.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNegative.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNegative.generated.js deleted file mode 100644 index e6772f8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNegative.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNumeric.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNumeric.generated.js deleted file mode 100644 index 6c7f4c1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsNumeric.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPositive.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPositive.generated.js deleted file mode 100644 index 1e8cedd..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPositive.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPrime.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPrime.generated.js deleted file mode 100644 index 45bdf5d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsPrime.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsZero.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsZero.generated.js deleted file mode 100644 index a760963..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesIsZero.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN10.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN10.generated.js deleted file mode 100644 index 9b1512c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN10.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN2.generated.js deleted file mode 100644 index 483a4dc..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLN2.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG10E.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG10E.generated.js deleted file mode 100644 index e86e5c4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG10E.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG2E.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG2E.generated.js deleted file mode 100644 index abf38ba..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLOG2E.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLarger.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLarger.generated.js deleted file mode 100644 index 02c305b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLarger.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLargerEq.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLargerEq.generated.js deleted file mode 100644 index f6a60a1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLargerEq.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLcm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLcm.generated.js deleted file mode 100644 index 3b1cd75..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLcm.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLeftShift.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLeftShift.generated.js deleted file mode 100644 index 64bb0d3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLeftShift.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js deleted file mode 100644 index 8afdc01..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog.generated.js deleted file mode 100644 index 57d9550..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog10.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog10.generated.js deleted file mode 100644 index edfb462..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog10.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog1p.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog1p.generated.js deleted file mode 100644 index 45acff9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog1p.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog2.generated.js deleted file mode 100644 index d80d6ec..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesLog2.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMad.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMad.generated.js deleted file mode 100644 index 9eb37a6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMad.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMap.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMap.generated.js deleted file mode 100644 index 504764d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMap.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapSlices.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapSlices.generated.js deleted file mode 100644 index e83b2f3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapSlices.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mapSlicesDependencies = 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 mapSlicesDependencies = exports.mapSlicesDependencies = { - isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMapSlices: _factoriesNumber.createMapSlices -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapSlicesTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapSlicesTransform.generated.js deleted file mode 100644 index 80962b1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapSlicesTransform.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mapSlicesTransformDependencies = 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 mapSlicesTransformDependencies = exports.mapSlicesTransformDependencies = { - isIntegerDependencies: _dependenciesIsIntegerGenerated.isIntegerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMapSlicesTransform: _factoriesNumber.createMapSlicesTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapTransform.generated.js deleted file mode 100644 index cc42590..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMapTransform.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMatrix.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMatrix.generated.js deleted file mode 100644 index 21bcd3c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMatrix.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMax.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMax.generated.js deleted file mode 100644 index 614e6c1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMax.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.maxDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - largerDependencies: _dependenciesLargerGenerated.largerDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMax: _factoriesNumber.createMax -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMaxTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMaxTransform.generated.js deleted file mode 100644 index c60d9e7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMaxTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.maxTransformDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - largerDependencies: _dependenciesLargerGenerated.largerDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMaxTransform: _factoriesNumber.createMaxTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMean.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMean.generated.js deleted file mode 100644 index 4d8c88d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMean.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMeanTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMeanTransform.generated.js deleted file mode 100644 index f2fa8f7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMeanTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js deleted file mode 100644 index c1cbb1d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMedian.generated.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMin.generated.js deleted file mode 100644 index 75de3d8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMin.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.minDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMin: _factoriesNumber.createMin -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMinTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMinTransform.generated.js deleted file mode 100644 index 227b38f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMinTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.minTransformDependencies = void 0; -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -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 = { - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - numericDependencies: _dependenciesNumericGenerated.numericDependencies, - smallerDependencies: _dependenciesSmallerGenerated.smallerDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createMinTransform: _factoriesNumber.createMinTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMod.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMod.generated.js deleted file mode 100644 index ac9ffa6..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMod.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMode.generated.js deleted file mode 100644 index 6c66983..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMode.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js deleted file mode 100644 index 17b6f75..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultinomial.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiply.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiply.generated.js deleted file mode 100644 index b7c2937..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiply.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js deleted file mode 100644 index 0501d3d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNaN.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNaN.generated.js deleted file mode 100644 index afdf6ef..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNaN.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNode.generated.js deleted file mode 100644 index 74cf58f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNode.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNorm.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNorm.generated.js deleted file mode 100644 index 9993c89..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNorm.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNot.generated.js deleted file mode 100644 index c48e858..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNthRoot.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNthRoot.generated.js deleted file mode 100644 index 221da34..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNthRoot.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNull.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNull.generated.js deleted file mode 100644 index 6a72e3c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNull.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumber.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumber.generated.js deleted file mode 100644 index e9e7af2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumber.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumeric.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumeric.generated.js deleted file mode 100644 index 7b20e94..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesNumeric.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesObjectNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesObjectNode.generated.js deleted file mode 100644 index e7da029..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesObjectNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOperatorNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOperatorNode.generated.js deleted file mode 100644 index 274dd46..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOperatorNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOr.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOr.generated.js deleted file mode 100644 index 36be79c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesOr.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js deleted file mode 100644 index f4695b4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParse.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParse.generated.js deleted file mode 100644 index 15c9ff8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParse.generated.js +++ /dev/null @@ -1,49 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParser.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParser.generated.js deleted file mode 100644 index 98aa7b7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParser.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParserClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParserClass.generated.js deleted file mode 100644 index ecce973..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesParserClass.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ParserDependencies = void 0; -var _dependenciesEvaluateGenerated = require("./dependenciesEvaluate.generated.js"); -var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); -var _factoriesNumber = require("../../factoriesNumber.js"); -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ - -const ParserDependencies = exports.ParserDependencies = { - evaluateDependencies: _dependenciesEvaluateGenerated.evaluateDependencies, - parseDependencies: _dependenciesParseGenerated.parseDependencies, - createParserClass: _factoriesNumber.createParserClass -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js deleted file mode 100644 index 2d7cfd3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPermutations.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPermutations.generated.js deleted file mode 100644 index 2c1fac4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPermutations.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPhi.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPhi.generated.js deleted file mode 100644 index 3c1e7d2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPhi.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPi.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPi.generated.js deleted file mode 100644 index cc98a69..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPi.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPickRandom.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPickRandom.generated.js deleted file mode 100644 index 667e87c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPickRandom.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPow.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPow.generated.js deleted file mode 100644 index 6a173d7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPow.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPrint.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPrint.generated.js deleted file mode 100644 index b0916fd..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesPrint.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesProd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesProd.generated.js deleted file mode 100644 index 4cab317..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesProd.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js deleted file mode 100644 index 0e24070..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js +++ /dev/null @@ -1,39 +0,0 @@ -"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 _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandom.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandom.generated.js deleted file mode 100644 index e90d8d9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandom.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js deleted file mode 100644 index 04c5ee8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.randomIntDependencies = void 0; -var _dependenciesLog2Generated = require("./dependenciesLog2.generated.js"); -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 = { - log2Dependencies: _dependenciesLog2Generated.log2Dependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createRandomInt: _factoriesNumber.createRandomInt -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js deleted file mode 100644 index 9c1a24f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRange.generated.js +++ /dev/null @@ -1,35 +0,0 @@ -"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 _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); -var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); -var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.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, - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, - isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeClass.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeClass.generated.js deleted file mode 100644 index 4dd2681..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeClass.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeNode.generated.js deleted file mode 100644 index dcdce30..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js deleted file mode 100644 index d3726da..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRangeTransform.generated.js +++ /dev/null @@ -1,35 +0,0 @@ -"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 _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); -var _dependenciesIsPositiveGenerated = require("./dependenciesIsPositive.generated.js"); -var _dependenciesIsZeroGenerated = require("./dependenciesIsZero.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, - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - isPositiveDependencies: _dependenciesIsPositiveGenerated.isPositiveDependencies, - isZeroDependencies: _dependenciesIsZeroGenerated.isZeroDependencies, - 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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js deleted file mode 100644 index 56eb3aa..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js +++ /dev/null @@ -1,59 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRelationalNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRelationalNode.generated.js deleted file mode 100644 index 729e180..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRelationalNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReplacer.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReplacer.generated.js deleted file mode 100644 index c091ba7..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReplacer.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js deleted file mode 100644 index 6f4fd77..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResultSet.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResultSet.generated.js deleted file mode 100644 index 9e97ede..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesResultSet.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReviver.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReviver.generated.js deleted file mode 100644 index c94c35b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesReviver.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightArithShift.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightArithShift.generated.js deleted file mode 100644 index 9dcd16e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightArithShift.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightLogShift.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightLogShift.generated.js deleted file mode 100644 index a95962b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRightLogShift.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRound.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRound.generated.js deleted file mode 100644 index 497ae98..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesRound.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js deleted file mode 100644 index 129a7ba..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT2.generated.js deleted file mode 100644 index a252e5a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSQRT2.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSec.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSec.generated.js deleted file mode 100644 index b616955..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSec.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSech.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSech.generated.js deleted file mode 100644 index dcec568..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSech.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSign.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSign.generated.js deleted file mode 100644 index e0a485d..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSign.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js deleted file mode 100644 index e7c5f60..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js +++ /dev/null @@ -1,47 +0,0 @@ -"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 _dependenciesEqualGenerated = require("./dependenciesEqual.generated.js"); -var _dependenciesParseGenerated = require("./dependenciesParse.generated.js"); -var _dependenciesReplacerGenerated = require("./dependenciesReplacer.generated.js"); -var _dependenciesResolveGenerated = require("./dependenciesResolve.generated.js"); -var _dependenciesSimplifyConstantGenerated = require("./dependenciesSimplifyConstant.generated.js"); -var _dependenciesSimplifyCoreGenerated = require("./dependenciesSimplifyCore.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, - equalDependencies: _dependenciesEqualGenerated.equalDependencies, - parseDependencies: _dependenciesParseGenerated.parseDependencies, - replacerDependencies: _dependenciesReplacerGenerated.replacerDependencies, - resolveDependencies: _dependenciesResolveGenerated.resolveDependencies, - simplifyConstantDependencies: _dependenciesSimplifyConstantGenerated.simplifyConstantDependencies, - simplifyCoreDependencies: _dependenciesSimplifyCoreGenerated.simplifyCoreDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSimplify: _factoriesNumber.createSimplify -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js deleted file mode 100644 index 5dea228..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js +++ /dev/null @@ -1,37 +0,0 @@ -"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 _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.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, - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - matrixDependencies: _dependenciesMatrixGenerated.matrixDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSimplifyConstant: _factoriesNumber.createSimplifyConstant -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js deleted file mode 100644 index da13883..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js +++ /dev/null @@ -1,51 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSin.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSin.generated.js deleted file mode 100644 index 7839170..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSin.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSinh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSinh.generated.js deleted file mode 100644 index 774f86a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSinh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSize.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSize.generated.js deleted file mode 100644 index d0f8f10..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSize.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sizeDependencies = void 0; -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 = { - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createSize: _factoriesNumber.createSize -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmaller.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmaller.generated.js deleted file mode 100644 index 0638bb8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmaller.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmallerEq.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmallerEq.generated.js deleted file mode 100644 index 877962a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSmallerEq.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSqrt.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSqrt.generated.js deleted file mode 100644 index b1cc9d9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSqrt.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSquare.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSquare.generated.js deleted file mode 100644 index f9ad8dd..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSquare.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js deleted file mode 100644 index 73dff61..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js deleted file mode 100644 index 369b1b8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js deleted file mode 100644 index cf455f8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesStirlingS2.generated.js +++ /dev/null @@ -1,39 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesString.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesString.generated.js deleted file mode 100644 index ef8705a..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesString.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubset.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubset.generated.js deleted file mode 100644 index 7673178..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubset.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js deleted file mode 100644 index 1cb79b8..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtract.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtract.generated.js deleted file mode 100644 index 188f60f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtract.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js deleted file mode 100644 index 9373c85..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSum.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSum.generated.js deleted file mode 100644 index 9b2904b..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSum.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSumTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSumTransform.generated.js deleted file mode 100644 index ec6215e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSumTransform.generated.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSymbolNode.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSymbolNode.generated.js deleted file mode 100644 index df354a9..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesSymbolNode.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTan.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTan.generated.js deleted file mode 100644 index 8b77910..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTan.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTanh.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTanh.generated.js deleted file mode 100644 index 9e22258..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTanh.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTau.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTau.generated.js deleted file mode 100644 index aa0458c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTau.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTrue.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTrue.generated.js deleted file mode 100644 index 53250b4..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTrue.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTypeOf.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTypeOf.generated.js deleted file mode 100644 index f354174..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTypeOf.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTyped.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTyped.generated.js deleted file mode 100644 index bf7963e..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesTyped.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js deleted file mode 100644 index b9c3371..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js deleted file mode 100644 index fe5a51c..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnequal.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnequal.generated.js deleted file mode 100644 index 3ec27ff..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUnequal.generated.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercaseE.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercaseE.generated.js deleted file mode 100644 index 18d39e3..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercaseE.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercasePi.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercasePi.generated.js deleted file mode 100644 index 720c460..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesUppercasePi.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js deleted file mode 100644 index 6747629..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.varianceDependencies = void 0; -var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); -var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -var _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - divideDependencies: _dependenciesDivideGenerated.divideDependencies, - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, - subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createVariance: _factoriesNumber.createVariance -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js deleted file mode 100644 index f90d0a1..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.varianceTransformDependencies = void 0; -var _dependenciesAddGenerated = require("./dependenciesAdd.generated.js"); -var _dependenciesDivideGenerated = require("./dependenciesDivide.generated.js"); -var _dependenciesIsNaNGenerated = require("./dependenciesIsNaN.generated.js"); -var _dependenciesMapSlicesGenerated = require("./dependenciesMapSlices.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, - divideDependencies: _dependenciesDivideGenerated.divideDependencies, - isNaNDependencies: _dependenciesIsNaNGenerated.isNaNDependencies, - mapSlicesDependencies: _dependenciesMapSlicesGenerated.mapSlicesDependencies, - multiplyDependencies: _dependenciesMultiplyGenerated.multiplyDependencies, - subtractDependencies: _dependenciesSubtractGenerated.subtractDependencies, - typedDependencies: _dependenciesTypedGenerated.typedDependencies, - createVarianceTransform: _factoriesNumber.createVarianceTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVersion.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVersion.generated.js deleted file mode 100644 index aeb1a13..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesVersion.generated.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXgcd.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXgcd.generated.js deleted file mode 100644 index 8f457ba..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXgcd.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXor.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXor.generated.js deleted file mode 100644 index 2aaaf77..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesXor.generated.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesZeta.generated.js b/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesZeta.generated.js deleted file mode 100644 index 738c777..0000000 --- a/node_modules/mathjs/lib/cjs/entry/dependenciesNumber/dependenciesZeta.generated.js +++ /dev/null @@ -1,43 +0,0 @@ -"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 _dependenciesIsBoundedGenerated = require("./dependenciesIsBounded.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, - isBoundedDependencies: _dependenciesIsBoundedGenerated.isBoundedDependencies, - 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/node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js b/node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js deleted file mode 100644 index 17859a2..0000000 --- a/node_modules/mathjs/lib/cjs/entry/impureFunctionsAny.generated.js +++ /dev/null @@ -1,775 +0,0 @@ -"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 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 ConstantNode = exports.ConstantNode = (0, _factoriesAny.createConstantNode)({ - Node, - isBounded: _pureFunctionsAnyGenerated.isBounded -}); -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, - isBounded: _pureFunctionsAnyGenerated.isBounded, - mathWithTransform, - matrix: _pureFunctionsAnyGenerated.matrix, - typed: _pureFunctionsAnyGenerated.typed -}); -const compile = exports.compile = (0, _factoriesAny.createCompile)({ - parse, - typed: _pureFunctionsAnyGenerated.typed -}); -const leafCount = exports.leafCount = (0, _factoriesAny.createLeafCount)({ - 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, - parse -}); -const parser = exports.parser = (0, _factoriesAny.createParser)({ - Parser, - typed: _pureFunctionsAnyGenerated.typed -}); -const simplify = exports.simplify = (0, _factoriesAny.createSimplify)({ - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - equal: _pureFunctionsAnyGenerated.equal, - parse, - replacer: _pureFunctionsAnyGenerated.replacer, - resolve, - simplifyConstant, - simplifyCore, - typed: _pureFunctionsAnyGenerated.typed -}); -const symbolicEqual = exports.symbolicEqual = (0, _factoriesAny.createSymbolicEqual)({ - OperatorNode, - parse, - simplify, - 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 -}); -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 -}); -(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, - isBounded: _pureFunctionsAnyGenerated.isBounded, - isNaN: _pureFunctionsAnyGenerated.isNaN, - isNumeric: _pureFunctionsAnyGenerated.isNumeric, - isPrime: _pureFunctionsAnyGenerated.isPrime, - LOG2E: _pureFunctionsAnyGenerated.LOG2E, - lgamma: _pureFunctionsAnyGenerated.lgamma, - log10: _pureFunctionsAnyGenerated.log10, - log2: _pureFunctionsAnyGenerated.log2, - map: _pureFunctionsAnyGenerated.map, - mode: _pureFunctionsAnyGenerated.mode, - 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, - size: _pureFunctionsAnyGenerated.size, - splitUnit: _pureFunctionsAnyGenerated.splitUnit, - square: _pureFunctionsAnyGenerated.square, - string: _pureFunctionsAnyGenerated.string, - subtractScalar: _pureFunctionsAnyGenerated.subtractScalar, - tan: _pureFunctionsAnyGenerated.tan, - toBest: _pureFunctionsAnyGenerated.toBest, - typeOf: _pureFunctionsAnyGenerated.typeOf, - acosh: _pureFunctionsAnyGenerated.acosh, - acsch: _pureFunctionsAnyGenerated.acsch, - asec: _pureFunctionsAnyGenerated.asec, - bignumber: _pureFunctionsAnyGenerated.bignumber, - chain, - combinationsWithRep: _pureFunctionsAnyGenerated.combinationsWithRep, - cosh: _pureFunctionsAnyGenerated.cosh, - csch: _pureFunctionsAnyGenerated.csch, - dot: _pureFunctionsAnyGenerated.dot, - hasNumericValue: _pureFunctionsAnyGenerated.hasNumericValue, - isFinite: _pureFunctionsAnyGenerated.isFinite, - isNegative: _pureFunctionsAnyGenerated.isNegative, - isZero: _pureFunctionsAnyGenerated.isZero, - matrix: _pureFunctionsAnyGenerated.matrix, - matrixFromFunction: _pureFunctionsAnyGenerated.matrixFromFunction, - multiply: _pureFunctionsAnyGenerated.multiply, - ones: _pureFunctionsAnyGenerated.ones, - randomInt: _pureFunctionsAnyGenerated.randomInt, - resize: _pureFunctionsAnyGenerated.resize, - sech: _pureFunctionsAnyGenerated.sech, - sinh: _pureFunctionsAnyGenerated.sinh, - sparse: _pureFunctionsAnyGenerated.sparse, - sqrt: _pureFunctionsAnyGenerated.sqrt, - squeeze: _pureFunctionsAnyGenerated.squeeze, - tanh: _pureFunctionsAnyGenerated.tanh, - transpose: _pureFunctionsAnyGenerated.transpose, - xgcd: _pureFunctionsAnyGenerated.xgcd, - zeros: _pureFunctionsAnyGenerated.zeros, - acoth: _pureFunctionsAnyGenerated.acoth, - asin: _pureFunctionsAnyGenerated.asin, - bin: _pureFunctionsAnyGenerated.bin, - coth: _pureFunctionsAnyGenerated.coth, - ctranspose: _pureFunctionsAnyGenerated.ctranspose, - diag: _pureFunctionsAnyGenerated.diag, - equal: _pureFunctionsAnyGenerated.equal, - fraction: _pureFunctionsAnyGenerated.fraction, - identity: _pureFunctionsAnyGenerated.identity, - isInteger: _pureFunctionsAnyGenerated.isInteger, - kron: _pureFunctionsAnyGenerated.kron, - mapSlices: _pureFunctionsAnyGenerated.mapSlices, - matrixFromColumns: _pureFunctionsAnyGenerated.matrixFromColumns, - numeric: _pureFunctionsAnyGenerated.numeric, - prod: _pureFunctionsAnyGenerated.prod, - reshape: _pureFunctionsAnyGenerated.reshape, - round: _pureFunctionsAnyGenerated.round, - unaryMinus: _pureFunctionsAnyGenerated.unaryMinus, - bernoulli: _pureFunctionsAnyGenerated.bernoulli, - cbrt: _pureFunctionsAnyGenerated.cbrt, - concat: _pureFunctionsAnyGenerated.concat, - count: _pureFunctionsAnyGenerated.count, - deepEqual: _pureFunctionsAnyGenerated.deepEqual, - divideScalar: _pureFunctionsAnyGenerated.divideScalar, - dotMultiply: _pureFunctionsAnyGenerated.dotMultiply, - floor: _pureFunctionsAnyGenerated.floor, - gcd: _pureFunctionsAnyGenerated.gcd, - isPositive: _pureFunctionsAnyGenerated.isPositive, - larger: _pureFunctionsAnyGenerated.larger, - lcm: _pureFunctionsAnyGenerated.lcm, - leftShift: _pureFunctionsAnyGenerated.leftShift, - lsolve: _pureFunctionsAnyGenerated.lsolve, - max: _pureFunctionsAnyGenerated.max, - mod: _pureFunctionsAnyGenerated.mod, - nthRoot: _pureFunctionsAnyGenerated.nthRoot, - nullish: _pureFunctionsAnyGenerated.nullish, - or: _pureFunctionsAnyGenerated.or, - qr: _pureFunctionsAnyGenerated.qr, - rightArithShift: _pureFunctionsAnyGenerated.rightArithShift, - 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, - composition: _pureFunctionsAnyGenerated.composition, - cross: _pureFunctionsAnyGenerated.cross, - det: _pureFunctionsAnyGenerated.det, - diff: _pureFunctionsAnyGenerated.diff, - distance: _pureFunctionsAnyGenerated.distance, - dotDivide: _pureFunctionsAnyGenerated.dotDivide, - equalText: _pureFunctionsAnyGenerated.equalText, - hypot: _pureFunctionsAnyGenerated.hypot, - intersect: _pureFunctionsAnyGenerated.intersect, - invmod: _pureFunctionsAnyGenerated.invmod, - largerEq: _pureFunctionsAnyGenerated.largerEq, - log: _pureFunctionsAnyGenerated.log, - lsolveAll: _pureFunctionsAnyGenerated.lsolveAll, - matrixFromRows: _pureFunctionsAnyGenerated.matrixFromRows, - min: _pureFunctionsAnyGenerated.min, - nthRoots: _pureFunctionsAnyGenerated.nthRoots, - 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, - cumsum: _pureFunctionsAnyGenerated.cumsum, - fix: _pureFunctionsAnyGenerated.fix, - index: _pureFunctionsAnyGenerated.index, - inv: _pureFunctionsAnyGenerated.inv, - log1p: _pureFunctionsAnyGenerated.log1p, - lup: _pureFunctionsAnyGenerated.lup, - pinv: _pureFunctionsAnyGenerated.pinv, - pow: _pureFunctionsAnyGenerated.pow, - setCartesian: _pureFunctionsAnyGenerated.setCartesian, - setDistinct: _pureFunctionsAnyGenerated.setDistinct, - setIsSubset: _pureFunctionsAnyGenerated.setIsSubset, - setPowerset: _pureFunctionsAnyGenerated.setPowerset, - smallerEq: _pureFunctionsAnyGenerated.smallerEq, - sort: _pureFunctionsAnyGenerated.sort, - sqrtm: _pureFunctionsAnyGenerated.sqrtm, - unequal: _pureFunctionsAnyGenerated.unequal, - and: _pureFunctionsAnyGenerated.and, - divide: _pureFunctionsAnyGenerated.divide, - expm: _pureFunctionsAnyGenerated.expm, - fft: _pureFunctionsAnyGenerated.fft, - freqz: _pureFunctionsAnyGenerated.freqz, - gamma: _pureFunctionsAnyGenerated.gamma, - ifft: _pureFunctionsAnyGenerated.ifft, - kldivergence: _pureFunctionsAnyGenerated.kldivergence, - lusolve: _pureFunctionsAnyGenerated.lusolve, - mean: _pureFunctionsAnyGenerated.mean, - median: _pureFunctionsAnyGenerated.median, - polynomialRoot: _pureFunctionsAnyGenerated.polynomialRoot, - quantileSeq: _pureFunctionsAnyGenerated.quantileSeq, - range: _pureFunctionsAnyGenerated.range, - row: _pureFunctionsAnyGenerated.row, - setDifference: _pureFunctionsAnyGenerated.setDifference, - setMultiplicity: _pureFunctionsAnyGenerated.setMultiplicity, - setSymDifference: _pureFunctionsAnyGenerated.setSymDifference, - solveODE: _pureFunctionsAnyGenerated.solveODE, - vacuumImpedance: _pureFunctionsAnyGenerated.vacuumImpedance, - atomicMass: _pureFunctionsAnyGenerated.atomicMass, - bohrMagneton: _pureFunctionsAnyGenerated.bohrMagneton, - boltzmann: _pureFunctionsAnyGenerated.boltzmann, - column: _pureFunctionsAnyGenerated.column, - conductanceQuantum: _pureFunctionsAnyGenerated.conductanceQuantum, - coulomb: _pureFunctionsAnyGenerated.coulomb, - createUnit: _pureFunctionsAnyGenerated.createUnit, - deuteronMass: _pureFunctionsAnyGenerated.deuteronMass, - eigs: _pureFunctionsAnyGenerated.eigs, - electronMass: _pureFunctionsAnyGenerated.electronMass, - factorial: _pureFunctionsAnyGenerated.factorial, - fermiCoupling: _pureFunctionsAnyGenerated.fermiCoupling, - gasConstant: _pureFunctionsAnyGenerated.gasConstant, - gravity: _pureFunctionsAnyGenerated.gravity, - klitzing: _pureFunctionsAnyGenerated.klitzing, - loschmidt: _pureFunctionsAnyGenerated.loschmidt, - mad: _pureFunctionsAnyGenerated.mad, - magneticFluxQuantum: _pureFunctionsAnyGenerated.magneticFluxQuantum, - molarMass: _pureFunctionsAnyGenerated.molarMass, - molarPlanckConstant: _pureFunctionsAnyGenerated.molarPlanckConstant, - multinomial: _pureFunctionsAnyGenerated.multinomial, - norm: _pureFunctionsAnyGenerated.norm, - permutations: _pureFunctionsAnyGenerated.permutations, - planckConstant: _pureFunctionsAnyGenerated.planckConstant, - planckMass: _pureFunctionsAnyGenerated.planckMass, - planckTime: _pureFunctionsAnyGenerated.planckTime, - reducedPlanckConstant: _pureFunctionsAnyGenerated.reducedPlanckConstant, - rotationMatrix: _pureFunctionsAnyGenerated.rotationMatrix, - rydberg: _pureFunctionsAnyGenerated.rydberg, - secondRadiation: _pureFunctionsAnyGenerated.secondRadiation, - setSize: _pureFunctionsAnyGenerated.setSize, - speedOfLight: _pureFunctionsAnyGenerated.speedOfLight, - stefanBoltzmann: _pureFunctionsAnyGenerated.stefanBoltzmann, - thomsonCrossSection: _pureFunctionsAnyGenerated.thomsonCrossSection, - variance: _pureFunctionsAnyGenerated.variance, - zeta: _pureFunctionsAnyGenerated.zeta, - avogadro: _pureFunctionsAnyGenerated.avogadro, - bohrRadius: _pureFunctionsAnyGenerated.bohrRadius, - corr: _pureFunctionsAnyGenerated.corr, - dotPow: _pureFunctionsAnyGenerated.dotPow, - elementaryCharge: _pureFunctionsAnyGenerated.elementaryCharge, - faraday: _pureFunctionsAnyGenerated.faraday, - hartreeEnergy: _pureFunctionsAnyGenerated.hartreeEnergy, - inverseConductanceQuantum: _pureFunctionsAnyGenerated.inverseConductanceQuantum, - magneticConstant: _pureFunctionsAnyGenerated.magneticConstant, - molarMassC12: _pureFunctionsAnyGenerated.molarMassC12, - neutronMass: _pureFunctionsAnyGenerated.neutronMass, - parse, - planckCharge: _pureFunctionsAnyGenerated.planckCharge, - planckTemperature: _pureFunctionsAnyGenerated.planckTemperature, - quantumOfCirculation: _pureFunctionsAnyGenerated.quantumOfCirculation, - resolve, - setIntersect: _pureFunctionsAnyGenerated.setIntersect, - simplifyConstant, - std: _pureFunctionsAnyGenerated.std, - stirlingS2: _pureFunctionsAnyGenerated.stirlingS2, - unit: _pureFunctionsAnyGenerated.unit, - bellNumbers: _pureFunctionsAnyGenerated.bellNumbers, - compile, - electricConstant: _pureFunctionsAnyGenerated.electricConstant, - firstRadiation: _pureFunctionsAnyGenerated.firstRadiation, - leafCount, - nuclearMagneton: _pureFunctionsAnyGenerated.nuclearMagneton, - planckLength: _pureFunctionsAnyGenerated.planckLength, - rotate: _pureFunctionsAnyGenerated.rotate, - setUnion: _pureFunctionsAnyGenerated.setUnion, - simplifyCore, - wienDisplacement: _pureFunctionsAnyGenerated.wienDisplacement, - classicalElectronRadius: _pureFunctionsAnyGenerated.classicalElectronRadius, - evaluate, - molarVolume: _pureFunctionsAnyGenerated.molarVolume, - schur: _pureFunctionsAnyGenerated.schur, - coulombConstant: _pureFunctionsAnyGenerated.coulombConstant, - gravitationConstant: _pureFunctionsAnyGenerated.gravitationConstant, - parser, - simplify, - symbolicEqual, - derivative, - protonMass: _pureFunctionsAnyGenerated.protonMass, - sylvester: _pureFunctionsAnyGenerated.sylvester, - help, - rationalize, - lyap: _pureFunctionsAnyGenerated.lyap, - config: _configReadonly.config -}); -(0, _extends2.default)(mathWithTransform, math, { - map: (0, _factoriesAny.createMapTransform)({ - typed: _pureFunctionsAnyGenerated.typed - }), - filter: (0, _factoriesAny.createFilterTransform)({ - typed: _pureFunctionsAnyGenerated.typed - }), - forEach: (0, _factoriesAny.createForEachTransform)({ - typed: _pureFunctionsAnyGenerated.typed - }), - mapSlices: (0, _factoriesAny.createMapSlicesTransform)({ - isInteger: _pureFunctionsAnyGenerated.isInteger, - 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 - }), - cumsum: (0, _factoriesAny.createCumSumTransform)({ - add: _pureFunctionsAnyGenerated.add, - typed: _pureFunctionsAnyGenerated.typed, - unaryPlus: _pureFunctionsAnyGenerated.unaryPlus - }), - nullish: (0, _factoriesAny.createNullishTransform)({ - deepEqual: _pureFunctionsAnyGenerated.deepEqual, - flatten: _pureFunctionsAnyGenerated.flatten, - matrix: _pureFunctionsAnyGenerated.matrix, - size: _pureFunctionsAnyGenerated.size, - 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 - }), - concat: (0, _factoriesAny.createConcatTransform)({ - isInteger: _pureFunctionsAnyGenerated.isInteger, - matrix: _pureFunctionsAnyGenerated.matrix, - typed: _pureFunctionsAnyGenerated.typed - }), - diff: (0, _factoriesAny.createDiffTransform)({ - bignumber: _pureFunctionsAnyGenerated.bignumber, - matrix: _pureFunctionsAnyGenerated.matrix, - number: _pureFunctionsAnyGenerated.number, - subtract: _pureFunctionsAnyGenerated.subtract, - typed: _pureFunctionsAnyGenerated.typed - }), - max: (0, _factoriesAny.createMaxTransform)({ - config: _configReadonly.config, - isNaN: _pureFunctionsAnyGenerated.isNaN, - larger: _pureFunctionsAnyGenerated.larger, - numeric: _pureFunctionsAnyGenerated.numeric, - typed: _pureFunctionsAnyGenerated.typed - }), - min: (0, _factoriesAny.createMinTransform)({ - config: _configReadonly.config, - isNaN: _pureFunctionsAnyGenerated.isNaN, - numeric: _pureFunctionsAnyGenerated.numeric, - smaller: _pureFunctionsAnyGenerated.smaller, - typed: _pureFunctionsAnyGenerated.typed - }), - or: (0, _factoriesAny.createOrTransform)({ - DenseMatrix: _pureFunctionsAnyGenerated.DenseMatrix, - concat: _pureFunctionsAnyGenerated.concat, - equalScalar: _pureFunctionsAnyGenerated.equalScalar, - matrix: _pureFunctionsAnyGenerated.matrix, - 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 - }), - sum: (0, _factoriesAny.createSumTransform)({ - add: _pureFunctionsAnyGenerated.add, - config: _configReadonly.config, - numeric: _pureFunctionsAnyGenerated.numeric, - typed: _pureFunctionsAnyGenerated.typed - }), - variance: (0, _factoriesAny.createVarianceTransform)({ - add: _pureFunctionsAnyGenerated.add, - divide: _pureFunctionsAnyGenerated.divide, - isNaN: _pureFunctionsAnyGenerated.isNaN, - mapSlices: _pureFunctionsAnyGenerated.mapSlices, - multiply: _pureFunctionsAnyGenerated.multiply, - subtract: _pureFunctionsAnyGenerated.subtract, - typed: _pureFunctionsAnyGenerated.typed - }), - index: (0, _factoriesAny.createIndexTransform)({ - Index: _pureFunctionsAnyGenerated.Index, - getMatrixDataType: _pureFunctionsAnyGenerated.getMatrixDataType - }), - quantileSeq: (0, _factoriesAny.createQuantileSeqTransform)({ - add: _pureFunctionsAnyGenerated.add, - bignumber: _pureFunctionsAnyGenerated.bignumber, - compare: _pureFunctionsAnyGenerated.compare, - divide: _pureFunctionsAnyGenerated.divide, - isInteger: _pureFunctionsAnyGenerated.isInteger, - larger: _pureFunctionsAnyGenerated.larger, - mapSlices: _pureFunctionsAnyGenerated.mapSlices, - multiply: _pureFunctionsAnyGenerated.multiply, - partitionSelect: _pureFunctionsAnyGenerated.partitionSelect, - smaller: _pureFunctionsAnyGenerated.smaller, - smallerEq: _pureFunctionsAnyGenerated.smallerEq, - subtract: _pureFunctionsAnyGenerated.subtract, - typed: _pureFunctionsAnyGenerated.typed - }), - range: (0, _factoriesAny.createRangeTransform)({ - bignumber: _pureFunctionsAnyGenerated.bignumber, - matrix: _pureFunctionsAnyGenerated.matrix, - add: _pureFunctionsAnyGenerated.add, - config: _configReadonly.config, - equal: _pureFunctionsAnyGenerated.equal, - isPositive: _pureFunctionsAnyGenerated.isPositive, - isZero: _pureFunctionsAnyGenerated.isZero, - larger: _pureFunctionsAnyGenerated.larger, - largerEq: _pureFunctionsAnyGenerated.largerEq, - smaller: _pureFunctionsAnyGenerated.smaller, - smallerEq: _pureFunctionsAnyGenerated.smallerEq, - typed: _pureFunctionsAnyGenerated.typed - }), - column: (0, _factoriesAny.createColumnTransform)({ - Index: _pureFunctionsAnyGenerated.Index, - matrix: _pureFunctionsAnyGenerated.matrix, - range: _pureFunctionsAnyGenerated.range, - typed: _pureFunctionsAnyGenerated.typed - }), - row: (0, _factoriesAny.createRowTransform)({ - 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 - }), - 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, - DenseMatrix: _pureFunctionsAnyGenerated.DenseMatrix, - RangeNode, - Chain, - FunctionAssignmentNode, - SparseMatrix: _pureFunctionsAnyGenerated.SparseMatrix, - ConstantNode, - IndexNode, - FibonacciHeap: _pureFunctionsAnyGenerated.FibonacciHeap, - ImmutableDenseMatrix: _pureFunctionsAnyGenerated.ImmutableDenseMatrix, - Index: _pureFunctionsAnyGenerated.Index, - Spa: _pureFunctionsAnyGenerated.Spa, - AccessorNode, - AssignmentNode, - Unit: _pureFunctionsAnyGenerated.Unit, - SymbolNode, - FunctionNode, - Help, - Parser -}); -Chain.createProxy(math); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/impureFunctionsNumber.generated.js b/node_modules/mathjs/lib/cjs/entry/impureFunctionsNumber.generated.js deleted file mode 100644 index 89ea978..0000000 --- a/node_modules/mathjs/lib/cjs/entry/impureFunctionsNumber.generated.js +++ /dev/null @@ -1,517 +0,0 @@ -"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 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 ArrayNode = exports.ArrayNode = (0, _factoriesNumber.createArrayNode)({ - Node -}); -const FunctionAssignmentNode = exports.FunctionAssignmentNode = (0, _factoriesNumber.createFunctionAssignmentNode)({ - Node, - typed: _pureFunctionsNumberGenerated.typed -}); -const BlockNode = exports.BlockNode = (0, _factoriesNumber.createBlockNode)({ - Node, - ResultSet: _pureFunctionsNumberGenerated.ResultSet -}); -const ConstantNode = exports.ConstantNode = (0, _factoriesNumber.createConstantNode)({ - Node, - isBounded: _pureFunctionsNumberGenerated.isBounded -}); -const simplifyConstant = exports.simplifyConstant = (0, _factoriesNumber.createSimplifyConstant)({ - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - SymbolNode, - config: _configReadonly.config, - isBounded: _pureFunctionsNumberGenerated.isBounded, - mathWithTransform, - matrix: _pureFunctionsNumberGenerated.matrix, - typed: _pureFunctionsNumberGenerated.typed -}); -const ParenthesisNode = exports.ParenthesisNode = (0, _factoriesNumber.createParenthesisNode)({ - Node -}); -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, - parse -}); -const simplify = exports.simplify = (0, _factoriesNumber.createSimplify)({ - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - equal: _pureFunctionsNumberGenerated.equal, - parse, - replacer: _pureFunctionsNumberGenerated.replacer, - resolve, - simplifyConstant, - simplifyCore, - 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 help = exports.help = (0, _factoriesNumber.createHelp)({ - Help, - mathWithTransform, - typed: _pureFunctionsNumberGenerated.typed -}); -const parser = exports.parser = (0, _factoriesNumber.createParser)({ - Parser, - 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 -}); -(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, - isBounded: _pureFunctionsNumberGenerated.isBounded, - 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, - bernoulli: _pureFunctionsNumberGenerated.bernoulli, - bitOr: _pureFunctionsNumberGenerated.bitOr, - chain, - combinationsWithRep: _pureFunctionsNumberGenerated.combinationsWithRep, - cosh: _pureFunctionsNumberGenerated.cosh, - csch: _pureFunctionsNumberGenerated.csch, - divideScalar: _pureFunctionsNumberGenerated.divideScalar, - equalText: _pureFunctionsNumberGenerated.equalText, - expm1: _pureFunctionsNumberGenerated.expm1, - isNaN: _pureFunctionsNumberGenerated.isNaN, - isPrime: _pureFunctionsNumberGenerated.isPrime, - larger: _pureFunctionsNumberGenerated.larger, - lgamma: _pureFunctionsNumberGenerated.lgamma, - log2: _pureFunctionsNumberGenerated.log2, - mapSlices: _pureFunctionsNumberGenerated.mapSlices, - 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, - variance: _pureFunctionsNumberGenerated.variance, - acosh: _pureFunctionsNumberGenerated.acosh, - atan2: _pureFunctionsNumberGenerated.atan2, - bitAnd: _pureFunctionsNumberGenerated.bitAnd, - catalan: _pureFunctionsNumberGenerated.catalan, - clone: _pureFunctionsNumberGenerated.clone, - composition: _pureFunctionsNumberGenerated.composition, - coth: _pureFunctionsNumberGenerated.coth, - equal: _pureFunctionsNumberGenerated.equal, - factorial: _pureFunctionsNumberGenerated.factorial, - isFinite: _pureFunctionsNumberGenerated.isFinite, - LN2: _pureFunctionsNumberGenerated.LN2, - log10: _pureFunctionsNumberGenerated.log10, - multinomial: _pureFunctionsNumberGenerated.multinomial, - numeric: _pureFunctionsNumberGenerated.numeric, - permutations: _pureFunctionsNumberGenerated.permutations, - prod: _pureFunctionsNumberGenerated.prod, - round: _pureFunctionsNumberGenerated.round, - smaller: _pureFunctionsNumberGenerated.smaller, - subtractScalar: _pureFunctionsNumberGenerated.subtractScalar, - 'PI': _pureFunctionsNumberGenerated.pi, - zeta: _pureFunctionsNumberGenerated.zeta, - acsch: _pureFunctionsNumberGenerated.acsch, - compareNatural: _pureFunctionsNumberGenerated.compareNatural, - cumsum: _pureFunctionsNumberGenerated.cumsum, - floor: _pureFunctionsNumberGenerated.floor, - hypot: _pureFunctionsNumberGenerated.hypot, - lcm: _pureFunctionsNumberGenerated.lcm, - max: _pureFunctionsNumberGenerated.max, - min: _pureFunctionsNumberGenerated.min, - norm: _pureFunctionsNumberGenerated.norm, - print: _pureFunctionsNumberGenerated.print, - range: _pureFunctionsNumberGenerated.range, - sign: _pureFunctionsNumberGenerated.sign, - simplifyConstant, - std: _pureFunctionsNumberGenerated.std, - sum: _pureFunctionsNumberGenerated.sum, - asinh: _pureFunctionsNumberGenerated.asinh, - ceil: _pureFunctionsNumberGenerated.ceil, - corr: _pureFunctionsNumberGenerated.corr, - fix: _pureFunctionsNumberGenerated.fix, - isNumeric: _pureFunctionsNumberGenerated.isNumeric, - partitionSelect: _pureFunctionsNumberGenerated.partitionSelect, - stirlingS2: _pureFunctionsNumberGenerated.stirlingS2, - bellNumbers: _pureFunctionsNumberGenerated.bellNumbers, - deepEqual: _pureFunctionsNumberGenerated.deepEqual, - gcd: _pureFunctionsNumberGenerated.gcd, - median: _pureFunctionsNumberGenerated.median, - parse, - quantileSeq: _pureFunctionsNumberGenerated.quantileSeq, - resolve, - simplifyCore, - compile, - evaluate, - mode: _pureFunctionsNumberGenerated.mode, - simplify, - derivative, - help, - parser, - true: _pureFunctionsNumberGenerated._true, - hasNumericValue: _pureFunctionsNumberGenerated.hasNumericValue, - rationalize, - mad: _pureFunctionsNumberGenerated.mad, - config: _configReadonly.config -}); -(0, _extends2.default)(mathWithTransform, math, { - cumsum: (0, _factoriesNumber.createCumSumTransform)({ - add: _pureFunctionsNumberGenerated.add, - typed: _pureFunctionsNumberGenerated.typed, - unaryPlus: _pureFunctionsNumberGenerated.unaryPlus - }), - mapSlices: (0, _factoriesNumber.createMapSlicesTransform)({ - isInteger: _pureFunctionsNumberGenerated.isInteger, - typed: _pureFunctionsNumberGenerated.typed - }), - filter: (0, _factoriesNumber.createFilterTransform)({ - typed: _pureFunctionsNumberGenerated.typed - }), - forEach: (0, _factoriesNumber.createForEachTransform)({ - typed: _pureFunctionsNumberGenerated.typed - }), - mean: (0, _factoriesNumber.createMeanTransform)({ - add: _pureFunctionsNumberGenerated.add, - divide: _pureFunctionsNumberGenerated.divide, - typed: _pureFunctionsNumberGenerated.typed - }), - subset: (0, _factoriesNumber.createSubsetTransform)({}), - map: (0, _factoriesNumber.createMapTransform)({ - 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 - }), - variance: (0, _factoriesNumber.createVarianceTransform)({ - add: _pureFunctionsNumberGenerated.add, - divide: _pureFunctionsNumberGenerated.divide, - isNaN: _pureFunctionsNumberGenerated.isNaN, - mapSlices: _pureFunctionsNumberGenerated.mapSlices, - multiply: _pureFunctionsNumberGenerated.multiply, - subtract: _pureFunctionsNumberGenerated.subtract, - typed: _pureFunctionsNumberGenerated.typed - }), - max: (0, _factoriesNumber.createMaxTransform)({ - config: _configReadonly.config, - isNaN: _pureFunctionsNumberGenerated.isNaN, - larger: _pureFunctionsNumberGenerated.larger, - numeric: _pureFunctionsNumberGenerated.numeric, - typed: _pureFunctionsNumberGenerated.typed - }), - min: (0, _factoriesNumber.createMinTransform)({ - config: _configReadonly.config, - isNaN: _pureFunctionsNumberGenerated.isNaN, - numeric: _pureFunctionsNumberGenerated.numeric, - smaller: _pureFunctionsNumberGenerated.smaller, - typed: _pureFunctionsNumberGenerated.typed - }), - range: (0, _factoriesNumber.createRangeTransform)({ - matrix: _pureFunctionsNumberGenerated.matrix, - add: _pureFunctionsNumberGenerated.add, - config: _configReadonly.config, - equal: _pureFunctionsNumberGenerated.equal, - isPositive: _pureFunctionsNumberGenerated.isPositive, - isZero: _pureFunctionsNumberGenerated.isZero, - larger: _pureFunctionsNumberGenerated.larger, - largerEq: _pureFunctionsNumberGenerated.largerEq, - smaller: _pureFunctionsNumberGenerated.smaller, - smallerEq: _pureFunctionsNumberGenerated.smallerEq, - typed: _pureFunctionsNumberGenerated.typed - }) -}); -(0, _extends2.default)(classes, { - Range: _pureFunctionsNumberGenerated.Range, - ResultSet: _pureFunctionsNumberGenerated.ResultSet, - Chain, - Node, - ObjectNode, - RangeNode, - RelationalNode, - SymbolNode, - AccessorNode, - AssignmentNode, - ConditionalNode, - FunctionNode, - IndexNode, - OperatorNode, - ArrayNode, - FunctionAssignmentNode, - BlockNode, - ConstantNode, - ParenthesisNode, - Help, - Parser -}); -Chain.createProxy(math); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/mainAny.js b/node_modules/mathjs/lib/cjs/entry/mainAny.js deleted file mode 100644 index 2b46e44..0000000 --- a/node_modules/mathjs/lib/cjs/entry/mainAny.js +++ /dev/null @@ -1,115 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/mainNumber.js b/node_modules/mathjs/lib/cjs/entry/mainNumber.js deleted file mode 100644 index 8e1e282..0000000 --- a/node_modules/mathjs/lib/cjs/entry/mainNumber.js +++ /dev/null @@ -1,115 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js b/node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js deleted file mode 100644 index fec0284..0000000 --- a/node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js +++ /dev/null @@ -1,1852 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -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.coulombConstant = 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.bernoulli = 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.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.mapSlices = 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.isFinite = exports.isBounded = 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 = exports.e = exports.dotPow = void 0; -exports.vacuumImpedance = exports.usolveAll = exports.usolve = exports.unit = exports.unequal = exports.unaryPlus = exports.unaryMinus = exports.typed = exports.typeOf = exports.transpose = exports.trace = exports.toBest = 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 = exports.oct = exports.numeric = exports.number = exports.nullish = exports.nuclearMagneton = exports.nthRoots = void 0; -exports.zpk2tf = exports.zeta = exports.zeros = exports.xor = exports.xgcd = exports.wienDisplacement = exports.weakMixingAngle = exports.version = exports.variance = 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, - config: _configReadonly.config -}); -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 isBounded = exports.isBounded = /* #__PURE__ */(0, _factoriesAny.createIsBounded)({ - typed -}); -const isNaN = exports.isNaN = /* #__PURE__ */(0, _factoriesAny.createIsNaN)({ - typed -}); -const isNumeric = exports.isNumeric = /* #__PURE__ */(0, _factoriesAny.createIsNumeric)({ - typed -}); -const isPrime = exports.isPrime = /* #__PURE__ */(0, _factoriesAny.createIsPrime)({ - 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 mode = exports.mode = /* #__PURE__ */(0, _factoriesAny.createMode)({ - isNaN, - isNumeric, - 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 size = exports.size = /* #__PURE__ */(0, _factoriesAny.createSize)({ - 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 toBest = exports.toBest = /* #__PURE__ */(0, _factoriesAny.createToBest)({ - 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 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 dot = exports.dot = /* #__PURE__ */(0, _factoriesAny.createDot)({ - addScalar, - conj, - multiplyScalar, - size, - typed -}); -const hasNumericValue = exports.hasNumericValue = /* #__PURE__ */(0, _factoriesAny.createHasNumericValue)({ - isNumeric, - typed -}); -const isFinite = exports.isFinite = /* #__PURE__ */(0, _factoriesAny.createIsFinite)({ - isBounded, - map, - typed -}); -const isNegative = exports.isNegative = /* #__PURE__ */(0, _factoriesAny.createIsNegative)({ - config: _configReadonly.config, - typed -}); -const isZero = exports.isZero = /* #__PURE__ */(0, _factoriesAny.createIsZero)({ - equalScalar, - 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 multiply = exports.multiply = /* #__PURE__ */(0, _factoriesAny.createMultiply)({ - addScalar, - dot, - equalScalar, - matrix, - multiplyScalar, - typed -}); -const ones = exports.ones = /* #__PURE__ */(0, _factoriesAny.createOnes)({ - BigNumber, - config: _configReadonly.config, - matrix, - typed -}); -const randomInt = exports.randomInt = /* #__PURE__ */(0, _factoriesAny.createRandomInt)({ - config: _configReadonly.config, - log2, - typed -}); -const resize = exports.resize = /* #__PURE__ */(0, _factoriesAny.createResize)({ - config: _configReadonly.config, - matrix -}); -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 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 acoth = exports.acoth = /* #__PURE__ */(0, _factoriesAny.createAcoth)({ - BigNumber, - Complex, - config: _configReadonly.config, - typed -}); -const asin = exports.asin = /* #__PURE__ */(0, _factoriesAny.createAsin)({ - 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 ctranspose = exports.ctranspose = /* #__PURE__ */(0, _factoriesAny.createCtranspose)({ - conj, - transpose, - typed -}); -const diag = exports.diag = /* #__PURE__ */(0, _factoriesAny.createDiag)({ - DenseMatrix, - SparseMatrix, - matrix, - typed -}); -const equal = exports.equal = /* #__PURE__ */(0, _factoriesAny.createEqual)({ - DenseMatrix, - SparseMatrix, - equalScalar, - matrix, - typed -}); -const fraction = exports.fraction = /* #__PURE__ */(0, _factoriesAny.createFraction)({ - Fraction, - typed -}); -const identity = exports.identity = /* #__PURE__ */(0, _factoriesAny.createIdentity)({ - BigNumber, - DenseMatrix, - SparseMatrix, - config: _configReadonly.config, - matrix, - typed -}); -const isInteger = exports.isInteger = /* #__PURE__ */(0, _factoriesAny.createIsInteger)({ - equal, - typed -}); -const kron = exports.kron = /* #__PURE__ */(0, _factoriesAny.createKron)({ - matrix, - multiplyScalar, - typed -}); -const mapSlices = exports.mapSlices = /* #__PURE__ */(0, _factoriesAny.createMapSlices)({ - isInteger, - typed -}); -const apply = exports.apply = mapSlices; -const matrixFromColumns = exports.matrixFromColumns = /* #__PURE__ */(0, _factoriesAny.createMatrixFromColumns)({ - flatten, - matrix, - size, - 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 round = exports.round = /* #__PURE__ */(0, _factoriesAny.createRound)({ - BigNumber, - DenseMatrix, - config: _configReadonly.config, - equalScalar, - matrix, - typed, - zeros -}); -const unaryMinus = exports.unaryMinus = /* #__PURE__ */(0, _factoriesAny.createUnaryMinus)({ - typed -}); -const bernoulli = exports.bernoulli = /* #__PURE__ */(0, _factoriesAny.createBernoulli)({ - BigNumber, - Fraction, - config: _configReadonly.config, - isInteger, - number, - 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 deepEqual = exports.deepEqual = /* #__PURE__ */(0, _factoriesAny.createDeepEqual)({ - equal, - typed -}); -const divideScalar = exports.divideScalar = /* #__PURE__ */(0, _factoriesAny.createDivideScalar)({ - numeric, - typed -}); -const dotMultiply = exports.dotMultiply = /* #__PURE__ */(0, _factoriesAny.createDotMultiply)({ - concat, - equalScalar, - matrix, - multiplyScalar, - 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 isPositive = exports.isPositive = /* #__PURE__ */(0, _factoriesAny.createIsPositive)({ - config: _configReadonly.config, - typed -}); -const larger = exports.larger = /* #__PURE__ */(0, _factoriesAny.createLarger)({ - DenseMatrix, - SparseMatrix, - bignumber, - concat, - config: _configReadonly.config, - matrix, - typed -}); -const lcm = exports.lcm = /* #__PURE__ */(0, _factoriesAny.createLcm)({ - concat, - equalScalar, - 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 max = exports.max = /* #__PURE__ */(0, _factoriesAny.createMax)({ - config: _configReadonly.config, - isNaN, - larger, - numeric, - typed -}); -const mod = exports.mod = /* #__PURE__ */(0, _factoriesAny.createMod)({ - DenseMatrix, - concat, - config: _configReadonly.config, - equalScalar, - matrix, - round, - typed, - zeros -}); -const nthRoot = exports.nthRoot = /* #__PURE__ */(0, _factoriesAny.createNthRoot)({ - BigNumber, - concat, - equalScalar, - matrix, - typed -}); -const nullish = exports.nullish = /* #__PURE__ */(0, _factoriesAny.createNullish)({ - deepEqual, - flatten, - matrix, - size, - typed -}); -const or = exports.or = /* #__PURE__ */(0, _factoriesAny.createOr)({ - DenseMatrix, - concat, - equalScalar, - 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 rightArithShift = exports.rightArithShift = /* #__PURE__ */(0, _factoriesAny.createRightArithShift)({ - DenseMatrix, - concat, - equalScalar, - matrix, - typed, - zeros -}); -const smaller = exports.smaller = /* #__PURE__ */(0, _factoriesAny.createSmaller)({ - DenseMatrix, - SparseMatrix, - bignumber, - 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, - SparseMatrix, - 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, - SparseMatrix, - 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 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 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 dotDivide = exports.dotDivide = /* #__PURE__ */(0, _factoriesAny.createDotDivide)({ - DenseMatrix, - SparseMatrix, - concat, - divideScalar, - equalScalar, - matrix, - typed -}); -const equalText = exports.equalText = /* #__PURE__ */(0, _factoriesAny.createEqualText)({ - compareText, - isZero, - typed -}); -const FibonacciHeap = exports.FibonacciHeap = /* #__PURE__ */(0, _factoriesAny.createFibonacciHeapClass)({ - larger, - smaller -}); -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 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 largerEq = exports.largerEq = /* #__PURE__ */(0, _factoriesAny.createLargerEq)({ - DenseMatrix, - SparseMatrix, - concat, - config: _configReadonly.config, - matrix, - typed -}); -const log = exports.log = /* #__PURE__ */(0, _factoriesAny.createLog)({ - Complex, - config: _configReadonly.config, - divideScalar, - typeOf, - 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, - isNaN, - numeric, - smaller, - typed -}); -const nthRoots = exports.nthRoots = /* #__PURE__ */(0, _factoriesAny.createNthRoots)({ - Complex, - config: _configReadonly.config, - divideScalar, - 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 Spa = exports.Spa = /* #__PURE__ */(0, _factoriesAny.createSpaClass)({ - FibonacciHeap, - addScalar, - equalScalar -}); -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 cumsum = exports.cumsum = /* #__PURE__ */(0, _factoriesAny.createCumSum)({ - add, - typed, - unaryPlus -}); -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 inv = exports.inv = /* #__PURE__ */(0, _factoriesAny.createInv)({ - abs, - addScalar, - det, - divideScalar, - identity, - matrix, - multiply, - typed, - unaryMinus -}); -const log1p = exports.log1p = /* #__PURE__ */(0, _factoriesAny.createLog1p)({ - Complex, - config: _configReadonly.config, - divideScalar, - log, - typed -}); -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 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, - SparseMatrix, - concat, - config: _configReadonly.config, - matrix, - typed -}); -const sort = exports.sort = /* #__PURE__ */(0, _factoriesAny.createSort)({ - compare, - compareNatural, - matrix, - typed -}); -const sqrtm = exports.sqrtm = /* #__PURE__ */(0, _factoriesAny.createSqrtm)({ - abs, - add, - identity, - inv, - map, - max, - multiply, - size, - sqrt, - subtract, - typed -}); -const unequal = exports.unequal = /* #__PURE__ */(0, _factoriesAny.createUnequal)({ - DenseMatrix, - SparseMatrix, - concat, - config: _configReadonly.config, - equalScalar, - matrix, - typed -}); -const and = exports.and = /* #__PURE__ */(0, _factoriesAny.createAnd)({ - concat, - equalScalar, - matrix, - not, - typed, - zeros -}); -const divide = exports.divide = /* #__PURE__ */(0, _factoriesAny.createDivide)({ - divideScalar, - equalScalar, - inv, - matrix, - multiply, - typed -}); -const expm = exports.expm = /* #__PURE__ */(0, _factoriesAny.createExpm)({ - abs, - add, - identity, - inv, - multiply, - typed -}); -const fft = exports.fft = /* #__PURE__ */(0, _factoriesAny.createFft)({ - addScalar, - ceil, - conj, - divideScalar, - dotDivide, - exp, - i, - log2, - matrix, - multiplyScalar, - pow, - tau, - typed -}); -const freqz = exports.freqz = /* #__PURE__ */(0, _factoriesAny.createFreqz)({ - Complex, - add, - divide, - matrix, - multiply, - typed -}); -const gamma = exports.gamma = /* #__PURE__ */(0, _factoriesAny.createGamma)({ - BigNumber, - Complex, - config: _configReadonly.config, - multiplyScalar, - pow, - typed -}); -const ifft = exports.ifft = /* #__PURE__ */(0, _factoriesAny.createIfft)({ - conj, - dotDivide, - fft, - typed -}); -const kldivergence = exports.kldivergence = /* #__PURE__ */(0, _factoriesAny.createKldivergence)({ - divide, - dotDivide, - isNumeric, - log, - map, - matrix, - multiply, - sum, - typed -}); -const lusolve = exports.lusolve = /* #__PURE__ */(0, _factoriesAny.createLusolve)({ - DenseMatrix, - lsolve, - lup, - matrix, - slu, - typed, - usolve -}); -const mean = exports.mean = /* #__PURE__ */(0, _factoriesAny.createMean)({ - add, - divide, - typed -}); -const median = exports.median = /* #__PURE__ */(0, _factoriesAny.createMedian)({ - add, - compare, - divide, - partitionSelect, - typed -}); -const polynomialRoot = exports.polynomialRoot = /* #__PURE__ */(0, _factoriesAny.createPolynomialRoot)({ - add, - cbrt, - divide, - equalScalar, - im, - isZero, - multiply, - re, - sqrt, - subtract, - typeOf, - typed, - unaryMinus -}); -const quantileSeq = exports.quantileSeq = /* #__PURE__ */(0, _factoriesAny.createQuantileSeq)({ - bignumber, - add, - compare, - divide, - isInteger, - larger, - mapSlices, - multiply, - partitionSelect, - smaller, - smallerEq, - subtract, - typed -}); -const range = exports.range = /* #__PURE__ */(0, _factoriesAny.createRange)({ - bignumber, - matrix, - add, - config: _configReadonly.config, - equal, - isPositive, - isZero, - 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 solveODE = exports.solveODE = /* #__PURE__ */(0, _factoriesAny.createSolveODE)({ - abs, - add, - bignumber, - divide, - isNegative, - isPositive, - larger, - map, - matrix, - max, - multiply, - smaller, - subtract, - typed, - unaryMinus -}); -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 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 column = exports.column = /* #__PURE__ */(0, _factoriesAny.createColumn)({ - Index, - matrix, - range, - typed -}); -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 createUnit = exports.createUnit = /* #__PURE__ */(0, _factoriesAny.createCreateUnit)({ - Unit, - typed -}); -const deuteronMass = exports.deuteronMass = /* #__PURE__ */(0, _factoriesAny.createDeuteronMass)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -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 electronMass = exports.electronMass = /* #__PURE__ */(0, _factoriesAny.createElectronMass)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const factorial = exports.factorial = /* #__PURE__ */(0, _factoriesAny.createFactorial)({ - gamma, - typed -}); -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 gravity = exports.gravity = /* #__PURE__ */(0, _factoriesAny.createGravity)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -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 mad = exports.mad = /* #__PURE__ */(0, _factoriesAny.createMad)({ - abs, - map, - median, - subtract, - typed -}); -const magneticFluxQuantum = exports.magneticFluxQuantum = /* #__PURE__ */(0, _factoriesAny.createMagneticFluxQuantum)({ - 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 multinomial = exports.multinomial = /* #__PURE__ */(0, _factoriesAny.createMultinomial)({ - add, - divide, - factorial, - isInteger, - isPositive, - multiply, - typed -}); -const norm = exports.norm = /* #__PURE__ */(0, _factoriesAny.createNorm)({ - abs, - add, - conj, - ctranspose, - eigs, - equalScalar, - larger, - matrix, - multiply, - pow, - smaller, - sqrt, - typed -}); -const permutations = exports.permutations = /* #__PURE__ */(0, _factoriesAny.createPermutations)({ - factorial, - typed -}); -const planckConstant = exports.planckConstant = /* #__PURE__ */(0, _factoriesAny.createPlanckConstant)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const planckMass = exports.planckMass = /* #__PURE__ */(0, _factoriesAny.createPlanckMass)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const planckTime = exports.planckTime = /* #__PURE__ */(0, _factoriesAny.createPlanckTime)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const reducedPlanckConstant = exports.reducedPlanckConstant = /* #__PURE__ */(0, _factoriesAny.createReducedPlanckConstant)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const rotationMatrix = exports.rotationMatrix = /* #__PURE__ */(0, _factoriesAny.createRotationMatrix)({ - BigNumber, - DenseMatrix, - SparseMatrix, - addScalar, - config: _configReadonly.config, - cos, - matrix, - multiplyScalar, - norm, - sin, - typed, - unaryMinus -}); -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 setSize = exports.setSize = /* #__PURE__ */(0, _factoriesAny.createSetSize)({ - compareNatural, - typed -}); -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 variance = exports.variance = /* #__PURE__ */(0, _factoriesAny.createVariance)({ - add, - divide, - isNaN, - mapSlices, - multiply, - subtract, - typed -}); -const zeta = exports.zeta = /* #__PURE__ */(0, _factoriesAny.createZeta)({ - BigNumber, - Complex, - add, - config: _configReadonly.config, - divide, - equal, - factorial, - gamma, - isBounded, - isNegative, - multiply, - pi, - pow, - sin, - smallerEq, - subtract, - typed -}); -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 corr = exports.corr = /* #__PURE__ */(0, _factoriesAny.createCorr)({ - add, - divide, - matrix, - mean, - multiply, - pow, - sqrt, - subtract, - sum, - typed -}); -const dotPow = exports.dotPow = /* #__PURE__ */(0, _factoriesAny.createDotPow)({ - DenseMatrix, - SparseMatrix, - concat, - equalScalar, - matrix, - pow, - typed -}); -const elementaryCharge = exports.elementaryCharge = /* #__PURE__ */(0, _factoriesAny.createElementaryCharge)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const faraday = exports.faraday = /* #__PURE__ */(0, _factoriesAny.createFaraday)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const hartreeEnergy = exports.hartreeEnergy = /* #__PURE__ */(0, _factoriesAny.createHartreeEnergy)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const inverseConductanceQuantum = exports.inverseConductanceQuantum = /* #__PURE__ */(0, _factoriesAny.createInverseConductanceQuantum)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const magneticConstant = exports.magneticConstant = /* #__PURE__ */(0, _factoriesAny.createMagneticConstant)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const molarMassC12 = exports.molarMassC12 = /* #__PURE__ */(0, _factoriesAny.createMolarMassC12)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const neutronMass = exports.neutronMass = /* #__PURE__ */(0, _factoriesAny.createNeutronMass)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const planckCharge = exports.planckCharge = /* #__PURE__ */(0, _factoriesAny.createPlanckCharge)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const planckTemperature = exports.planckTemperature = /* #__PURE__ */(0, _factoriesAny.createPlanckTemperature)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const quantumOfCirculation = exports.quantumOfCirculation = /* #__PURE__ */(0, _factoriesAny.createQuantumOfCirculation)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const setIntersect = exports.setIntersect = /* #__PURE__ */(0, _factoriesAny.createSetIntersect)({ - DenseMatrix, - Index, - compareNatural, - size, - subset, - typed -}); -const std = exports.std = /* #__PURE__ */(0, _factoriesAny.createStd)({ - map, - sqrt, - typed, - variance -}); -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 electricConstant = exports.electricConstant = /* #__PURE__ */(0, _factoriesAny.createElectricConstant)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const firstRadiation = exports.firstRadiation = /* #__PURE__ */(0, _factoriesAny.createFirstRadiation)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const nuclearMagneton = exports.nuclearMagneton = /* #__PURE__ */(0, _factoriesAny.createNuclearMagneton)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const planckLength = exports.planckLength = /* #__PURE__ */(0, _factoriesAny.createPlanckLength)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const rotate = exports.rotate = /* #__PURE__ */(0, _factoriesAny.createRotate)({ - multiply, - rotationMatrix, - typed -}); -const setUnion = exports.setUnion = /* #__PURE__ */(0, _factoriesAny.createSetUnion)({ - Index, - concat, - setIntersect, - setSymDifference, - size, - subset, - typed -}); -const wienDisplacement = exports.wienDisplacement = /* #__PURE__ */(0, _factoriesAny.createWienDisplacement)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const classicalElectronRadius = exports.classicalElectronRadius = /* #__PURE__ */(0, _factoriesAny.createClassicalElectronRadius)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const molarVolume = exports.molarVolume = /* #__PURE__ */(0, _factoriesAny.createMolarVolume)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const schur = exports.schur = /* #__PURE__ */(0, _factoriesAny.createSchur)({ - identity, - matrix, - multiply, - norm, - qr, - subtract, - typed -}); -const coulombConstant = exports.coulombConstant = /* #__PURE__ */(0, _factoriesAny.createCoulombConstant)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const gravitationConstant = exports.gravitationConstant = /* #__PURE__ */(0, _factoriesAny.createGravitationConstant)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -const protonMass = exports.protonMass = /* #__PURE__ */(0, _factoriesAny.createProtonMass)({ - BigNumber, - Unit, - config: _configReadonly.config -}); -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/node_modules/mathjs/lib/cjs/entry/pureFunctionsNumber.generated.js b/node_modules/mathjs/lib/cjs/entry/pureFunctionsNumber.generated.js deleted file mode 100644 index 5a3463f..0000000 --- a/node_modules/mathjs/lib/cjs/entry/pureFunctionsNumber.generated.js +++ /dev/null @@ -1,631 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mapSlices = 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.isFinite = exports.isBounded = 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.bernoulli = 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 = exports.median = exports.mean = exports.max = exports.matrix = 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 isBounded = exports.isBounded = /* #__PURE__ */(0, _factoriesNumber.createIsBounded)({ - 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)({ - 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 bernoulli = exports.bernoulli = /* #__PURE__ */(0, _factoriesNumber.createBernoulli)({ - config: _configReadonly.config, - isInteger, - number, - typed -}); -const bitOr = exports.bitOr = /* #__PURE__ */(0, _factoriesNumber.createBitOr)({ - 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 isNaN = exports.isNaN = /* #__PURE__ */(0, _factoriesNumber.createIsNaN)({ - typed -}); -const isPrime = exports.isPrime = /* #__PURE__ */(0, _factoriesNumber.createIsPrime)({ - typed -}); -const larger = exports.larger = /* #__PURE__ */(0, _factoriesNumber.createLarger)({ - config: _configReadonly.config, - typed -}); -const lgamma = exports.lgamma = /* #__PURE__ */(0, _factoriesNumber.createLgamma)({ - typed -}); -const log2 = exports.log2 = /* #__PURE__ */(0, _factoriesNumber.createLog2)({ - typed -}); -const mapSlices = exports.mapSlices = /* #__PURE__ */(0, _factoriesNumber.createMapSlices)({ - isInteger, - typed -}); -const apply = exports.apply = mapSlices; -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, - log2, - 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 variance = exports.variance = /* #__PURE__ */(0, _factoriesNumber.createVariance)({ - add, - divide, - isNaN, - mapSlices, - multiply, - subtract, - typed -}); -const acosh = exports.acosh = /* #__PURE__ */(0, _factoriesNumber.createAcosh)({ - typed -}); -const atan2 = exports.atan2 = /* #__PURE__ */(0, _factoriesNumber.createAtan2)({ - typed -}); -const bitAnd = exports.bitAnd = /* #__PURE__ */(0, _factoriesNumber.createBitAnd)({ - typed -}); -const catalan = exports.catalan = /* #__PURE__ */(0, _factoriesNumber.createCatalan)({ - addScalar, - combinations, - divideScalar, - isInteger, - isNegative, - multiplyScalar, - typed -}); -const clone = exports.clone = /* #__PURE__ */(0, _factoriesNumber.createClone)({ - typed -}); -const composition = exports.composition = /* #__PURE__ */(0, _factoriesNumber.createComposition)({ - addScalar, - combinations, - isInteger, - isNegative, - isPositive, - larger, - 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 isFinite = exports.isFinite = /* #__PURE__ */(0, _factoriesNumber.createIsFinite)({ - isBounded, - map, - typed -}); -const LN2 = exports.LN2 = /* #__PURE__ */(0, _factoriesNumber.createLN2)({ - config: _configReadonly.config -}); -const log10 = exports.log10 = /* #__PURE__ */(0, _factoriesNumber.createLog10)({ - typed -}); -const multinomial = exports.multinomial = /* #__PURE__ */(0, _factoriesNumber.createMultinomial)({ - add, - divide, - factorial, - isInteger, - isPositive, - multiply, - typed -}); -const numeric = exports.numeric = /* #__PURE__ */(0, _factoriesNumber.createNumeric)({ - number -}); -const permutations = exports.permutations = /* #__PURE__ */(0, _factoriesNumber.createPermutations)({ - factorial, - typed -}); -const prod = exports.prod = /* #__PURE__ */(0, _factoriesNumber.createProd)({ - config: _configReadonly.config, - multiplyScalar, - numeric, - 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 zeta = exports.zeta = /* #__PURE__ */(0, _factoriesNumber.createZeta)({ - add, - config: _configReadonly.config, - divide, - equal, - factorial, - gamma, - isBounded, - isNegative, - multiply, - pi, - pow, - sin, - smallerEq, - subtract, - typed -}); -const acsch = exports.acsch = /* #__PURE__ */(0, _factoriesNumber.createAcsch)({ - typed -}); -const compareNatural = exports.compareNatural = /* #__PURE__ */(0, _factoriesNumber.createCompareNatural)({ - compare, - 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 lcm = exports.lcm = /* #__PURE__ */(0, _factoriesNumber.createLcm)({ - typed -}); -const max = exports.max = /* #__PURE__ */(0, _factoriesNumber.createMax)({ - config: _configReadonly.config, - isNaN, - larger, - numeric, - typed -}); -const min = exports.min = /* #__PURE__ */(0, _factoriesNumber.createMin)({ - config: _configReadonly.config, - isNaN, - numeric, - smaller, - typed -}); -const norm = exports.norm = /* #__PURE__ */(0, _factoriesNumber.createNorm)({ - typed -}); -const print = exports.print = /* #__PURE__ */(0, _factoriesNumber.createPrint)({ - typed -}); -const range = exports.range = /* #__PURE__ */(0, _factoriesNumber.createRange)({ - matrix, - add, - config: _configReadonly.config, - equal, - isPositive, - isZero, - larger, - largerEq, - smaller, - smallerEq, - typed -}); -const sign = exports.sign = /* #__PURE__ */(0, _factoriesNumber.createSign)({ - typed -}); -const std = exports.std = /* #__PURE__ */(0, _factoriesNumber.createStd)({ - map, - sqrt, - typed, - variance -}); -const sum = exports.sum = /* #__PURE__ */(0, _factoriesNumber.createSum)({ - add, - config: _configReadonly.config, - numeric, - typed -}); -const asinh = exports.asinh = /* #__PURE__ */(0, _factoriesNumber.createAsinh)({ - typed -}); -const ceil = exports.ceil = /* #__PURE__ */(0, _factoriesNumber.createCeil)({ - config: _configReadonly.config, - round, - typed -}); -const corr = exports.corr = /* #__PURE__ */(0, _factoriesNumber.createCorr)({ - add, - divide, - matrix, - mean, - multiply, - pow, - sqrt, - subtract, - sum, - typed -}); -const fix = exports.fix = /* #__PURE__ */(0, _factoriesNumber.createFix)({ - ceil, - floor, - typed -}); -const isNumeric = exports.isNumeric = /* #__PURE__ */(0, _factoriesNumber.createIsNumeric)({ - typed -}); -const partitionSelect = exports.partitionSelect = /* #__PURE__ */(0, _factoriesNumber.createPartitionSelect)({ - compare, - isNaN, - isNumeric, - typed -}); -const stirlingS2 = exports.stirlingS2 = /* #__PURE__ */(0, _factoriesNumber.createStirlingS2)({ - addScalar, - combinations, - divideScalar, - factorial, - isInteger, - isNegative, - larger, - multiplyScalar, - number, - pow, - subtractScalar, - typed -}); -const bellNumbers = exports.bellNumbers = /* #__PURE__ */(0, _factoriesNumber.createBellNumbers)({ - addScalar, - isInteger, - isNegative, - stirlingS2, - typed -}); -const deepEqual = exports.deepEqual = /* #__PURE__ */(0, _factoriesNumber.createDeepEqual)({ - equal, - typed -}); -const gcd = exports.gcd = /* #__PURE__ */(0, _factoriesNumber.createGcd)({ - typed -}); -const median = exports.median = /* #__PURE__ */(0, _factoriesNumber.createMedian)({ - add, - compare, - divide, - partitionSelect, - typed -}); -const quantileSeq = exports.quantileSeq = /* #__PURE__ */(0, _factoriesNumber.createQuantileSeq)({ - add, - compare, - divide, - isInteger, - larger, - mapSlices, - multiply, - partitionSelect, - smaller, - smallerEq, - subtract, - typed -}); -const mode = exports.mode = /* #__PURE__ */(0, _factoriesNumber.createMode)({ - isNaN, - isNumeric, - typed -}); -const _true = exports._true = /* #__PURE__ */(0, _factoriesNumber.createTrue)({}); -const hasNumericValue = exports.hasNumericValue = /* #__PURE__ */(0, _factoriesNumber.createHasNumericValue)({ - isNumeric, - typed -}); -const mad = exports.mad = /* #__PURE__ */(0, _factoriesNumber.createMad)({ - abs, - map, - median, - subtract, - typed -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/entry/typeChecks.js b/node_modules/mathjs/lib/cjs/entry/typeChecks.js deleted file mode 100644 index 44c58bf..0000000 --- a/node_modules/mathjs/lib/cjs/entry/typeChecks.js +++ /dev/null @@ -1,264 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/error/ArgumentsError.js b/node_modules/mathjs/lib/cjs/error/ArgumentsError.js deleted file mode 100644 index 78e6de7..0000000 --- a/node_modules/mathjs/lib/cjs/error/ArgumentsError.js +++ /dev/null @@ -1,30 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/error/DimensionError.js b/node_modules/mathjs/lib/cjs/error/DimensionError.js deleted file mode 100644 index 821d407..0000000 --- a/node_modules/mathjs/lib/cjs/error/DimensionError.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/error/IndexError.js b/node_modules/mathjs/lib/cjs/error/IndexError.js deleted file mode 100644 index ec6c794..0000000 --- a/node_modules/mathjs/lib/cjs/error/IndexError.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/Help.js b/node_modules/mathjs/lib/cjs/expression/Help.js deleted file mode 100644 index a5269c8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/Help.js +++ /dev/null @@ -1,138 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/Parser.js b/node_modules/mathjs/lib/cjs/expression/Parser.js deleted file mode 100644 index 80f4312..0000000 --- a/node_modules/mathjs/lib/cjs/expression/Parser.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createParserClass = void 0; -var _factory = require("../utils/factory.js"); -var _is = require("../utils/is.js"); -var _map = require("../utils/map.js"); -const name = 'Parser'; -const dependencies = ['evaluate', 'parse']; -const createParserClass = exports.createParserClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - evaluate, - parse - } = _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; - }; - function isValidVariableName(name) { - if (name.length === 0) { - return false; - } - for (let i = 0; i < name.length; i++) { - const cPrev = name.charAt(i - 1); - const c = name.charAt(i); - const cNext = name.charAt(i + 1); - const valid = parse.isAlpha(c, cPrev, cNext) || i > 0 && parse.isDigit(c); - if (!valid) { - return false; - } - } - return true; - } - - /** - * 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) { - if (!isValidVariableName(name)) { - throw new Error(`Invalid variable name: '${name}'. Variable names must follow the specified rules.`); - } - 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(); - }; - Parser.prototype.toJSON = function () { - const json = { - mathjs: 'Parser', - variables: {}, - functions: {} - }; - for (const [name, value] of this.scope) { - if ((0, _is.isFunction)(value)) { - if (!isExpressionFunction(value)) { - throw new Error(`Cannot serialize external function ${name}`); - } - json.functions[name] = `${value.syntax} = ${value.expr}`; - } else { - json.variables[name] = value; - } - } - return json; - }; - Parser.fromJSON = function (json) { - const parser = new Parser(); - Object.entries(json.variables).forEach(_ref2 => { - let [name, value] = _ref2; - return parser.set(name, value); - }); - Object.entries(json.functions).forEach(_ref3 => { - let [_name, fn] = _ref3; - return parser.evaluate(fn); - }); - return parser; - }; - return Parser; -}, { - isClass: true -}); -function isExpressionFunction(value) { - return typeof value === 'function' && typeof value.syntax === 'string' && typeof value.expr === 'string'; -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js deleted file mode 100644 index 0d196e7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/Infinity.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js deleted file mode 100644 index cb72ec4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN10.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js deleted file mode 100644 index 8e02ef2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LN2.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js deleted file mode 100644 index b8f4e1a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG10E.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js deleted file mode 100644 index 9ed7b87..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/LOG2E.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js deleted file mode 100644 index adab0d3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/NaN.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js deleted file mode 100644 index 76d2977..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT1_2.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js deleted file mode 100644 index c119c71..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/SQRT2.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js deleted file mode 100644 index efd8222..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/e.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js deleted file mode 100644 index 37d4bbb..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/false.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js deleted file mode 100644 index b0c0f4f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/i.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js deleted file mode 100644 index 250eca4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/null.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js deleted file mode 100644 index 46175cb..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/phi.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js deleted file mode 100644 index d7b6bea..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/pi.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js deleted file mode 100644 index da38e95..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/tau.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js deleted file mode 100644 index 5719e8c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/true.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js deleted file mode 100644 index e215e43..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/constants/version.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bigint.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bigint.js deleted file mode 100644 index 35a92c6..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bigint.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js deleted file mode 100644 index e852d27..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/bignumber.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js deleted file mode 100644 index cac2f0a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/boolean.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js deleted file mode 100644 index c73b0de..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/complex.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js deleted file mode 100644 index 13d213a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/createUnit.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js deleted file mode 100644 index b51923b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/fraction.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js deleted file mode 100644 index 53653e6..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js deleted file mode 100644 index 2cd0ecf..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/matrix.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js deleted file mode 100644 index 4374c3f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/number.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js deleted file mode 100644 index 062dd57..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/sparse.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js deleted file mode 100644 index 7c03ce9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/splitUnit.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js deleted file mode 100644 index 6a07f5f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/string.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js deleted file mode 100644 index 95bec70..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/construction/unit.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js deleted file mode 100644 index 97b9fce..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/config.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js deleted file mode 100644 index 38353f0..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/import.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js deleted file mode 100644 index bddba19..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/core/typed.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js deleted file mode 100644 index 74e2eea..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/embeddedDocs.js +++ /dev/null @@ -1,748 +0,0 @@ -"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 _parser = require("./function/expression/parser.js"); -var _parse = require("./function/expression/parse.js"); -var _compile = require("./function/expression/compile.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 _nullish = require("./function/logical/nullish.js"); -var _or = require("./function/logical/or.js"); -var _xor = require("./function/logical/xor.js"); -var _mapSlices = require("./function/matrix/mapSlices.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 _bernoulli = require("./function/probability/bernoulli.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 _toBest = require("./function/units/toBest.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 _isBounded = require("./function/utils/isBounded.js"); -var _isFinite = require("./function/utils/isFinite.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. Deprecated in favor of coulombConstant', - examples: ['coulombConstant'] - }, - coulombConstant: { - description: 'Coulomb\'s constant', - examples: ['coulombConstant'] - }, - 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, - parse: _parse.parseDocs, - parser: _parser.parserDocs, - compile: _compile.compileDocs, - // functions - geometry - distance: _distance.distanceDocs, - intersect: _intersect.intersectDocs, - // functions - logical - and: _and.andDocs, - not: _not.notDocs, - nullish: _nullish.nullishDocs, - or: _or.orDocs, - xor: _xor.xorDocs, - // functions - matrix - mapSlices: _mapSlices.mapSlicesDocs, - 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 - bernoulli: _bernoulli.bernoulliDocs, - 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, - toBest: _toBest.toBestDocs, - // functions - utils - clone: _clone.cloneDocs, - format: _format.formatDocs, - bin: _bin.binDocs, - oct: _oct.octDocs, - hex: _hex.hexDocs, - isNaN: _isNaN.isNaNDocs, - isBounded: _isBounded.isBoundedDocs, - isFinite: _isFinite.isFiniteDocs, - 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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js deleted file mode 100644 index e986679..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/derivative.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/leafCount.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/leafCount.js deleted file mode 100644 index 93447eb..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/leafCount.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js deleted file mode 100644 index 0cf5b71..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolve.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js deleted file mode 100644 index 4472408..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lsolveAll.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js deleted file mode 100644 index 4d7030d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lup.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js deleted file mode 100644 index 7f17520..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lusolve.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lyap.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lyap.js deleted file mode 100644 index 1c894ae..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/lyap.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js deleted file mode 100644 index c329c4b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/polynomialRoot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js deleted file mode 100644 index ea02732..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/qr.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js deleted file mode 100644 index d449ce2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/rationalize.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/resolve.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/resolve.js deleted file mode 100644 index 58eeb4d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/resolve.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/schur.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/schur.js deleted file mode 100644 index 1fd2f34..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/schur.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js deleted file mode 100644 index 385e7e3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplify.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js deleted file mode 100644 index b23cdfc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js deleted file mode 100644 index 01ebc74..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js deleted file mode 100644 index 1403e16..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/slu.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/sylvester.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/sylvester.js deleted file mode 100644 index d124f2a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/sylvester.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/symbolicEqual.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/symbolicEqual.js deleted file mode 100644 index cdd4c49..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/symbolicEqual.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js deleted file mode 100644 index b0bcb2b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolve.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js deleted file mode 100644 index 8c2af3c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/algebra/usolveAll.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js deleted file mode 100644 index d12f229..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/abs.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js deleted file mode 100644 index a35fdec..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/add.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js deleted file mode 100644 index c16f047..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cbrt.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js deleted file mode 100644 index 030e205..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ceilDocs = void 0; -const ceilDocs = exports.ceilDocs = { - name: 'ceil', - category: 'Arithmetic', - syntax: ['ceil(x)', 'ceil(x, n)', 'ceil(unit, valuelessUnit)', 'ceil(unit, n, valuelessUnit)'], - 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)', 'ceil(3.241cm, cm)', 'ceil(3.241cm, 2, cm)'], - seealso: ['floor', 'fix', 'round'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js deleted file mode 100644 index e81dfb8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/cube.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js deleted file mode 100644 index 97699d4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/divide.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js deleted file mode 100644 index 4dd03d0..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotDivide.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js deleted file mode 100644 index efa679e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotMultiply.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js deleted file mode 100644 index cf9310d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/dotPow.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js deleted file mode 100644 index 560d1d9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/exp.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js deleted file mode 100644 index e1d0279..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js deleted file mode 100644 index dc95343..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/expm1.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js deleted file mode 100644 index 5030007..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fixDocs = void 0; -const fixDocs = exports.fixDocs = { - name: 'fix', - category: 'Arithmetic', - syntax: ['fix(x)', 'fix(x, n)', 'fix(unit, valuelessUnit)', 'fix(unit, n, valuelessUnit)'], - 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)', 'fix(3.241cm, cm)', 'fix(3.241cm, 2, cm)'], - seealso: ['ceil', 'floor', 'round'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js deleted file mode 100644 index 3db6b6c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.floorDocs = void 0; -const floorDocs = exports.floorDocs = { - name: 'floor', - category: 'Arithmetic', - syntax: ['floor(x)', 'floor(x, n)', 'floor(unit, valuelessUnit)', 'floor(unit, n, valuelessUnit)'], - 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)', 'floor(3.241cm, cm)', 'floor(3.241cm, 2, cm)'], - seealso: ['ceil', 'fix', 'round'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js deleted file mode 100644 index fd6c007..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/gcd.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js deleted file mode 100644 index b10ec20..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js deleted file mode 100644 index f389aab..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js deleted file mode 100644 index d1621c1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/lcm.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js deleted file mode 100644 index 2a7739c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js deleted file mode 100644 index 513e9a2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log10.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js deleted file mode 100644 index f05ec54..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log1p.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js deleted file mode 100644 index 51c098e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/log2.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js deleted file mode 100644 index 42c116c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/mod.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js deleted file mode 100644 index d0af98c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/multiply.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js deleted file mode 100644 index 80c3935..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/norm.js +++ /dev/null @@ -1,13 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js deleted file mode 100644 index 77de859..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js deleted file mode 100644 index edef828..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/nthRoots.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js deleted file mode 100644 index c62f021..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js deleted file mode 100644 index ff59b28..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/round.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js deleted file mode 100644 index 6ea9fe3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js +++ /dev/null @@ -1,14 +0,0 @@ -"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>0, -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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js deleted file mode 100644 index 78cefc8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrt.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js deleted file mode 100644 index 609612d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/sqrtm.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js deleted file mode 100644 index 1a4ea51..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/square.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js deleted file mode 100644 index 2fd1da7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/subtract.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js deleted file mode 100644 index bc2f335..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryMinus.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js deleted file mode 100644 index 263b8ee..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/unaryPlus.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js deleted file mode 100644 index 1d68e0f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/arithmetic/xgcd.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js deleted file mode 100644 index 954403d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitAnd.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js deleted file mode 100644 index ec91700..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitNot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js deleted file mode 100644 index e252ef4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitOr.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js deleted file mode 100644 index b91aa4e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/bitXor.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js deleted file mode 100644 index ff0368c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/leftShift.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js deleted file mode 100644 index b8da2a9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightArithShift.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js deleted file mode 100644 index 5259600..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/bitwise/rightLogShift.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js deleted file mode 100644 index 209cfad..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/bellNumbers.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js deleted file mode 100644 index b83ff95..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/catalan.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js deleted file mode 100644 index 94672a5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/composition.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js deleted file mode 100644 index d8f50a6..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/combinatorics/stirlingS2.js +++ /dev/null @@ -1,14 +0,0 @@ -"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: '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.', - examples: ['stirlingS2(5, 3)'], - seealso: ['bellNumbers', 'bernoulli'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js deleted file mode 100644 index d128a92..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/arg.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js deleted file mode 100644 index af7e879..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/conj.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js deleted file mode 100644 index fa841cf..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/im.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js deleted file mode 100644 index c79281f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/complex/re.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/compile.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/compile.js deleted file mode 100644 index 2089ec9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/compile.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.compileDocs = void 0; -const compileDocs = exports.compileDocs = { - name: 'compile', - category: 'Expression', - syntax: ['compile(expr) ', 'compile([expr1, expr2, expr3, ...])'], - description: 'Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.', - examples: ['code1 = compile("sqrt(3^2 + 4^2)")', 'code1.evaluate() ', 'code2 = compile("a * b")', 'code2.evaluate({a: 3, b: 4})'], - seealso: ['parser', 'parse', 'evaluate'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js deleted file mode 100644 index 59a6b99..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/evaluate.js +++ /dev/null @@ -1,14 +0,0 @@ -"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: ['parser', 'parse', 'compile'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js deleted file mode 100644 index bd3871a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/help.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/parse.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/parse.js deleted file mode 100644 index d8953f3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/parse.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parseDocs = void 0; -const parseDocs = exports.parseDocs = { - name: 'parse', - category: 'Expression', - syntax: ['parse(expr)', 'parse(expr, options)', 'parse([expr1, expr2, expr3, ...])', 'parse([expr1, expr2, expr3, ...], options)'], - description: 'Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().', - examples: ['node1 = parse("sqrt(3^2 + 4^2)")', 'node1.evaluate()', 'code1 = node1.compile()', 'code1.evaluate()', 'scope = {a: 3, b: 4}', 'node2 = parse("a * b")', 'node2.evaluate(scope)', 'code2 = node2.compile()', 'code2.evaluate(scope)'], - seealso: ['parser', 'evaluate', 'compile'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/parser.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/parser.js deleted file mode 100644 index 34bf0f5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/expression/parser.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parserDocs = void 0; -const parserDocs = exports.parserDocs = { - name: 'parser', - category: 'Expression', - syntax: ['parser()'], - description: 'Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.', - examples: ['myParser = parser()', 'myParser.evaluate("sqrt(3^2 + 4^2)")', 'myParser.set("x", 3)', 'myParser.evaluate("y = x + 3")', 'myParser.evaluate(["y = x + 3", "y = y + 1"])', 'myParser.get("y")'], - seealso: ['evaluate', 'parse', 'compile'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js deleted file mode 100644 index 0e6d3da..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/distance.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js deleted file mode 100644 index 935ba7c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/geometry/intersect.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js deleted file mode 100644 index 248d533..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/and.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js deleted file mode 100644 index 47492b7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/not.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/nullish.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/nullish.js deleted file mode 100644 index 3f322d0..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/nullish.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.nullishDocs = void 0; -const nullishDocs = exports.nullishDocs = { - name: 'nullish', - category: 'Logical', - syntax: ['x ?? y', 'nullish(x, y)'], - description: 'Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.', - examples: ['null ?? 42', 'undefined ?? 42', '0 ?? 42', 'false ?? 42', 'null ?? undefined ?? 42'], - seealso: ['and', 'or', 'not'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js deleted file mode 100644 index ce5abe7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/or.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js deleted file mode 100644 index 3d2189c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/logical/xor.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js deleted file mode 100644 index cbda3dc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/column.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js deleted file mode 100644 index 66ed0a4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/concat.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js deleted file mode 100644 index 49991b4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/count.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js deleted file mode 100644 index 8df9433..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/cross.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js deleted file mode 100644 index 3c5567d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ctranspose.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js deleted file mode 100644 index 8902df4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/det.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js deleted file mode 100644 index 55b4dcd..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diag.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js deleted file mode 100644 index 44e5aa1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/diff.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js deleted file mode 100644 index c3eda6a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/dot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js deleted file mode 100644 index 0b960b1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/eigs.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/fft.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/fft.js deleted file mode 100644 index 487324f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/fft.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js deleted file mode 100644 index 0e0ba28..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/filter.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js deleted file mode 100644 index 971e07f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/flatten.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js deleted file mode 100644 index 7e26ff6..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js deleted file mode 100644 index 6539d57..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/getMatrixDataType.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js deleted file mode 100644 index b1f3704..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/identity.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js deleted file mode 100644 index d86d754..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js deleted file mode 100644 index 07078d5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/inv.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js deleted file mode 100644 index efd5d50..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/kron.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js deleted file mode 100644 index 248a84f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/map.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/mapSlices.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/mapSlices.js deleted file mode 100644 index 3bb3ecb..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/mapSlices.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mapSlicesDocs = void 0; -const mapSlicesDocs = exports.mapSlicesDocs = { - name: 'mapSlices', - category: 'Matrix', - syntax: ['mapSlices(A, dim, callback)'], - description: 'Generate a matrix one dimension less than A by applying callback to ' + 'each slice of A along dimension dim.', - examples: ['A = [[1, 2], [3, 4]]', 'mapSlices(A, 1, sum)', - // returns [4, 6] - 'mapSlices(A, 2, prod)' // returns [2, 12] - ], - seealso: ['map', 'forEach'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js deleted file mode 100644 index 68bba7e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromColumns.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js deleted file mode 100644 index 27ec1c2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromFunction.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js deleted file mode 100644 index 8447fbe..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/matrixFromRows.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js deleted file mode 100644 index 150d59b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/ones.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js deleted file mode 100644 index ddc8fbe..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/partitionSelect.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js deleted file mode 100644 index 84e41db..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js deleted file mode 100644 index f16891a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/range.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js deleted file mode 100644 index d61aa0c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/reshape.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js deleted file mode 100644 index 9a75b32..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/resize.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js deleted file mode 100644 index 73e0b1a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotate.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js deleted file mode 100644 index 262c13d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/rotationMatrix.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js deleted file mode 100644 index 24ea4ae..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/row.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js deleted file mode 100644 index 3649021..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/size.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js deleted file mode 100644 index e949529..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/sort.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js deleted file mode 100644 index 35d2a1a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/squeeze.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js deleted file mode 100644 index c42caa9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/subset.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js deleted file mode 100644 index df95cad..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/trace.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js deleted file mode 100644 index c4ee7ba..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/transpose.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js deleted file mode 100644 index 925571f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/matrix/zeros.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js deleted file mode 100644 index 2c5f636..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/numeric/solveODE.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/bernoulli.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/bernoulli.js deleted file mode 100644 index af8e33c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/bernoulli.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.bernoulliDocs = void 0; -const bernoulliDocs = exports.bernoulliDocs = { - name: 'bernoulli', - category: 'Probability', - syntax: ['bernoulli(n)'], - description: 'The nth Bernoulli number', - examples: ['bernoulli(4)', 'bernoulli(fraction(12))'], - seealso: ['combinations', 'gamma', 'stirlingS2'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js deleted file mode 100644 index ab03458..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinations.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js deleted file mode 100644 index e23ff36..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/combinationsWithRep.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/distribution.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/distribution.js deleted file mode 100644 index 7e807d7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/distribution.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js deleted file mode 100644 index 9e36255..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/factorial.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js deleted file mode 100644 index 8734aa5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/gamma.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js deleted file mode 100644 index 1e73b1d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/kldivergence.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js deleted file mode 100644 index ba562cb..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js deleted file mode 100644 index bdcadfc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/multinomial.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js deleted file mode 100644 index 1e0663c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/permutations.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js deleted file mode 100644 index a1cd990..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/pickRandom.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js deleted file mode 100644 index 2303843..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/random.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js deleted file mode 100644 index 54358ca..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/probability/randomInt.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js deleted file mode 100644 index 931c7a3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compare.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js deleted file mode 100644 index b470f09..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareNatural.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js deleted file mode 100644 index f27f926..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/compareText.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js deleted file mode 100644 index ff2b901..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/deepEqual.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js deleted file mode 100644 index f2977e3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equal.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js deleted file mode 100644 index e94f9cb..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/equalText.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js deleted file mode 100644 index 37757c7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/larger.js +++ /dev/null @@ -1,14 +0,0 @@ -"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. Comparing a value with NaN returns false.', - 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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js deleted file mode 100644 index d93f194..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/largerEq.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js deleted file mode 100644 index d763f94..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smaller.js +++ /dev/null @@ -1,14 +0,0 @@ -"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. Comparing a value with NaN returns false.', - 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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js deleted file mode 100644 index ca9df76..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/smallerEq.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js deleted file mode 100644 index 2b0cafe..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/relational/unequal.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js deleted file mode 100644 index cec3f68..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setCartesian.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js deleted file mode 100644 index 07ebe11..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDifference.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js deleted file mode 100644 index c543acd..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setDistinct.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js deleted file mode 100644 index 2ec82c1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIntersect.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js deleted file mode 100644 index fe4cdef..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setIsSubset.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js deleted file mode 100644 index cb8e5af..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setMultiplicity.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js deleted file mode 100644 index 5792aa3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setPowerset.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js deleted file mode 100644 index a6583cd..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSize.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js deleted file mode 100644 index fc5082d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setSymDifference.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js deleted file mode 100644 index b04e1a9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/set/setUnion.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/freqz.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/freqz.js deleted file mode 100644 index 29ab618..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/freqz.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js deleted file mode 100644 index b2c782f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/signal/zpk2tf.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js deleted file mode 100644 index 1707384..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/erf.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/zeta.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/zeta.js deleted file mode 100644 index 8a729d7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/special/zeta.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/corr.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/corr.js deleted file mode 100644 index 56d061e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/corr.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/cumsum.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/cumsum.js deleted file mode 100644 index 7ccc28f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/cumsum.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js deleted file mode 100644 index f65b29f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mad.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js deleted file mode 100644 index 8130b63..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/max.js +++ /dev/null @@ -1,14 +0,0 @@ -"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. If any NaN values are found, the function yields the last NaN in the input.', - 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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js deleted file mode 100644 index 746490e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mean.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js deleted file mode 100644 index 112d6ff..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/median.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js deleted file mode 100644 index f1beaf8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/min.js +++ /dev/null @@ -1,14 +0,0 @@ -"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. If any NaN values are found, the function yields the last NaN in the input.', - 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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js deleted file mode 100644 index b086010..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/mode.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js deleted file mode 100644 index 3f9a7d1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/prod.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js deleted file mode 100644 index a72e937..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js deleted file mode 100644 index 57ddbdc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/std.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js deleted file mode 100644 index 8d6c3ff..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/sum.js +++ /dev/null @@ -1,14 +0,0 @@ -"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', 'variance'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js deleted file mode 100644 index 379f051..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/statistics/variance.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js deleted file mode 100644 index 05d01c8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acos.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js deleted file mode 100644 index 3ee6f2a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acosh.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js deleted file mode 100644 index 2f35edf..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js deleted file mode 100644 index 13d0eee..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js deleted file mode 100644 index 9446b55..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsc.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js deleted file mode 100644 index a89abd9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js deleted file mode 100644 index 2cdd502..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asec.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js deleted file mode 100644 index 61aad99..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asech.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js deleted file mode 100644 index e2f4a45..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asin.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js deleted file mode 100644 index 33a23df..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/asinh.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js deleted file mode 100644 index ab92912..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js deleted file mode 100644 index 0c77024..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atan2.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js deleted file mode 100644 index 9a40ab9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/atanh.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js deleted file mode 100644 index 1d03c53..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cos.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js deleted file mode 100644 index 8c4974f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cosh.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js deleted file mode 100644 index dc6d236..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/cot.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js deleted file mode 100644 index 9befa09..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/coth.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js deleted file mode 100644 index ef78466..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csc.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js deleted file mode 100644 index 632d002..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/csch.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js deleted file mode 100644 index 5012d7b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sec.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js deleted file mode 100644 index 8eda9d2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sech.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js deleted file mode 100644 index ca704e1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sin.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js deleted file mode 100644 index df0303a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/sinh.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js deleted file mode 100644 index ab89970..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tan.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js deleted file mode 100644 index 6c677d8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/trigonometry/tanh.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js deleted file mode 100644 index c7c20f0..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/to.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/toBest.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/toBest.js deleted file mode 100644 index d50ff54..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/units/toBest.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.toBestDocs = void 0; -const toBestDocs = exports.toBestDocs = { - name: 'toBest', - category: 'Units', - syntax: ['toBest(x)', 'toBest(x, unitList)', 'toBest(x, unitList, options)'], - description: 'Converts to the most appropriate display unit.', - examples: ['toBest(unit(5000, "m"))', 'toBest(unit(3500000, "W"))', 'toBest(unit(0.000000123, "A"))', 'toBest(unit(10, "m"), "cm")', 'toBest(unit(10, "m"), "mm,km", {offset: 1.5})'], - seealso: [] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js deleted file mode 100644 index fe741e2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/bin.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js deleted file mode 100644 index 154ef8b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/clone.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js deleted file mode 100644 index 283dfb5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/format.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js deleted file mode 100644 index 9026b05..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hasNumericValue.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js deleted file mode 100644 index b5733cc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/hex.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isBounded.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isBounded.js deleted file mode 100644 index ef86ccd..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isBounded.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isBoundedDocs = void 0; -const isBoundedDocs = exports.isBoundedDocs = { - name: 'isBounded', - category: 'Utils', - syntax: ['isBounded(x)'], - description: 'Test whether a value or its entries are bounded.', - examples: ['isBounded(Infinity)', 'isBounded(bigint(3))', 'isBounded([3, -Infinity, -3])'], - seealso: ['isFinite', 'isNumeric', 'isNaN', 'isNegative', 'isPositive'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isFinite.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isFinite.js deleted file mode 100644 index 4c8bab6..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isFinite.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isFiniteDocs = void 0; -const isFiniteDocs = exports.isFiniteDocs = { - name: 'isFinite', - category: 'Utils', - syntax: ['isFinite(x)'], - description: 'Test whether a value is finite, elementwise on collections.', - examples: ['isFinite(Infinity)', 'isFinite(bigint(3))', 'isFinite([3, -Infinity, -3])'], - seealso: ['isBounded', 'isNumeric', 'isNaN', 'isNegative', 'isPositive'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js deleted file mode 100644 index 75108bc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isInteger.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js deleted file mode 100644 index 53ada80..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNaN.js +++ /dev/null @@ -1,14 +0,0 @@ -"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', 'isFinite', 'isBounded'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js deleted file mode 100644 index d6ce6be..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNegative.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js deleted file mode 100644 index 10e31f4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isNumeric.js +++ /dev/null @@ -1,14 +0,0 @@ -"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', 'isFinite', 'isBounded'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js deleted file mode 100644 index 5d0903c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPositive.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js deleted file mode 100644 index 06c8bbf..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isPrime.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js deleted file mode 100644 index ecd3ed1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/isZero.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js deleted file mode 100644 index 00ff3b4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/numeric.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js deleted file mode 100644 index f34b41f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/oct.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/print.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/print.js deleted file mode 100644 index cfdcef9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/print.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js b/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js deleted file mode 100644 index a9a8ad4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/embeddedDocs/function/utils/typeOf.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/function/compile.js b/node_modules/mathjs/lib/cjs/expression/function/compile.js deleted file mode 100644 index 14a7e02..0000000 --- a/node_modules/mathjs/lib/cjs/expression/function/compile.js +++ /dev/null @@ -1,60 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/function/evaluate.js b/node_modules/mathjs/lib/cjs/expression/function/evaluate.js deleted file mode 100644 index 17e4b9d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/function/evaluate.js +++ /dev/null @@ -1,74 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/function/help.js b/node_modules/mathjs/lib/cjs/expression/function/help.js deleted file mode 100644 index 1d8948b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/function/help.js +++ /dev/null @@ -1,72 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/function/parser.js b/node_modules/mathjs/lib/cjs/expression/function/parser.js deleted file mode 100644 index 34b6949..0000000 --- a/node_modules/mathjs/lib/cjs/expression/function/parser.js +++ /dev/null @@ -1,63 +0,0 @@ -"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 `math.Parser` object that keeps a context of variables and their values, allowing the evaluation of expressions in that context. - * - * 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/node_modules/mathjs/lib/cjs/expression/keywords.js b/node_modules/mathjs/lib/cjs/expression/keywords.js deleted file mode 100644 index e89262f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/keywords.js +++ /dev/null @@ -1,8 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js b/node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js deleted file mode 100644 index f780910..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/AccessorNode.js +++ /dev/null @@ -1,225 +0,0 @@ -"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 - * @param {boolean} [optionalChaining=false] - * Optional property, if the accessor was written as optional-chaining - * using `a?.b`, or `a?.["b"] with bracket notation. - * Forces evaluate to undefined if the given object is undefined or null. - */ - constructor(object, index) { - let optionalChaining = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - 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; - this.optionalChaining = optionalChaining; - } - - // 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); - const optionalChaining = this.optionalChaining; - const prevOptionalChaining = (0, _is.isAccessorNode)(this.object) && this.object.optionalChaining; - if (this.index.isObjectProperty()) { - const prop = this.index.getObjectProperty(); - return function evalAccessorNode(scope, args, context) { - const ctx = context || {}; - const object = evalObject(scope, args, ctx); - if (optionalChaining && object == null) { - ctx.optionalShortCircuit = true; - return undefined; - } - if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) { - return undefined; - } - - // get a property from an object evaluated using the scope. - return (0, _customs.getSafeProperty)(object, prop); - }; - } else { - return function evalAccessorNode(scope, args, context) { - const ctx = context || {}; - const object = evalObject(scope, args, ctx); - if (optionalChaining && object == null) { - ctx.optionalShortCircuit = true; - return undefined; - } - if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) { - return undefined; - } - - // 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)), this.optionalChaining); - } - - /** - * Create a clone of this node, a shallow copy - * @return {AccessorNode} - */ - clone() { - return new AccessorNode(this.object, this.index, this.optionalChaining); - } - - /** - * Get string representation - * @param {Object} options - * @return {string} - */ - _toString(options) { - let object = this.object.toString(options); - if (needParenthesis(this.object)) { - object = '(' + object + ')'; - } - const optionalChaining = this.optionalChaining ? this.index.dotNotation ? '?' : '?.' : ''; - return object + optionalChaining + 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, - optionalChaining: this.optionalChaining - }; - } - - /** - * 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, json.optionalChaining); - } - } - (0, _defineProperty2.default)(AccessorNode, "name", name); - return AccessorNode; -}, { - isClass: true, - isNode: true -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js b/node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js deleted file mode 100644 index 1392b3e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/ArrayNode.js +++ /dev/null @@ -1,183 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js b/node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js deleted file mode 100644 index ec1a7c2..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/AssignmentNode.js +++ /dev/null @@ -1,313 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/BlockNode.js b/node_modules/mathjs/lib/cjs/expression/node/BlockNode.js deleted file mode 100644 index 38b32e4..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/BlockNode.js +++ /dev/null @@ -1,192 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js b/node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js deleted file mode 100644 index 0839a04..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/ConditionalNode.js +++ /dev/null @@ -1,232 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js b/node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js deleted file mode 100644 index d7ec9b9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/ConstantNode.js +++ /dev/null @@ -1,186 +0,0 @@ -"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', 'isBounded']; -const createConstantNode = exports.createConstantNode = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - Node, - isBounded - } = _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': - { - if (!isBounded(this.value)) { - 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/node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js b/node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js deleted file mode 100644 index 152b562..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/FunctionAssignmentNode.js +++ /dev/null @@ -1,244 +0,0 @@ -"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 expr = this.expr; - const evalExpr = 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; - fn.expr = expr.toString(); - 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/node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js b/node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js deleted file mode 100644 index 017e621..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/FunctionNode.js +++ /dev/null @@ -1,501 +0,0 @@ -"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, optional) { - 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"'); - } - const optionalType = typeof optional; - if (!(optionalType === 'undefined' || optionalType === 'boolean')) { - throw new TypeError('optional flag, if specified, must be boolean'); - } - this.fn = fn; - this.args = args || []; - this.optional = !!optional; - } - - // 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)); - const fromOptionalChaining = this.optional || (0, _is.isAccessorNode)(this.fn) && this.fn.optionalChaining; - 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 if (fromOptionalChaining) value = undefined;else return FunctionNode.onUndefinedFunction(name); - if (typeof value === 'function' || fromOptionalChaining && value === undefined) { - 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); - if (fromOptionalChaining && fn === undefined) return undefined; - return fn(); - }; - case 1: - return function evalFunctionNode(scope, args, context) { - const fn = resolveFn(scope); - if (fromOptionalChaining && fn === undefined) return undefined; - const evalArg0 = evalArgs[0]; - return fn(evalArg0(scope, args, context)); - }; - case 2: - return function evalFunctionNode(scope, args, context) { - const fn = resolveFn(scope); - if (fromOptionalChaining && fn === undefined) return undefined; - 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); - if (fromOptionalChaining && fn === undefined) return undefined; - 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 (fromOptionalChaining && fn === undefined) return undefined; - 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); - - // Optional chaining: if the base object is nullish, short-circuit to undefined - if (fromOptionalChaining && (object == null || object[prop] === undefined)) { - return undefined; - } - 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 (fromOptionalChaining && fn === undefined) return undefined; - 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/node_modules/mathjs/lib/cjs/expression/node/IndexNode.js b/node_modules/mathjs/lib/cjs/expression/node/IndexNode.js deleted file mode 100644 index 3375fe1..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/IndexNode.js +++ /dev/null @@ -1,226 +0,0 @@ -"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); - 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/node_modules/mathjs/lib/cjs/expression/node/Node.js b/node_modules/mathjs/lib/cjs/expression/node/Node.js deleted file mode 100644 index 9274295..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/Node.js +++ /dev/null @@ -1,378 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js b/node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js deleted file mode 100644 index 0efc8aa..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/ObjectNode.js +++ /dev/null @@ -1,200 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js b/node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js deleted file mode 100644 index c1d8bdd..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/OperatorNode.js +++ /dev/null @@ -1,636 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js b/node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js deleted file mode 100644 index f618575..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/ParenthesisNode.js +++ /dev/null @@ -1,159 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/RangeNode.js b/node_modules/mathjs/lib/cjs/expression/node/RangeNode.js deleted file mode 100644 index 8d4c09b..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/RangeNode.js +++ /dev/null @@ -1,257 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js b/node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js deleted file mode 100644 index b458007..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/RelationalNode.js +++ /dev/null @@ -1,205 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js b/node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js deleted file mode 100644 index 90aa5d9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/SymbolNode.js +++ /dev/null @@ -1,199 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/utils/access.js b/node_modules/mathjs/lib/cjs/expression/node/utils/access.js deleted file mode 100644 index 1e7b9a0..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/utils/access.js +++ /dev/null @@ -1,46 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/node/utils/assign.js b/node_modules/mathjs/lib/cjs/expression/node/utils/assign.js deleted file mode 100644 index 1e86dab..0000000 --- a/node_modules/mathjs/lib/cjs/expression/node/utils/assign.js +++ /dev/null @@ -1,57 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/operators.js b/node_modules/mathjs/lib/cjs/expression/operators.js deleted file mode 100644 index df52071..0000000 --- a/node_modules/mathjs/lib/cjs/expression/operators.js +++ /dev/null @@ -1,395 +0,0 @@ -"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: [] - } -}, { - // nullish coalescing - 'OperatorNode:nullish': { - op: '??', - associativity: 'left', - 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/node_modules/mathjs/lib/cjs/expression/parse.js b/node_modules/mathjs/lib/cjs/expression/parse.js deleted file mode 100644 index 0231588..0000000 --- a/node_modules/mathjs/lib/cjs/expression/parse.js +++ /dev/null @@ -1,1700 +0,0 @@ -"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() or transformed into a functional object via node.compile(). - * - * 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') - * node2.evaluate(scope) // 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 - * - * History: - * - * v0.9 Created - * v0.13 Switched to one-based indices - * v0.14 Added `[1,2;3,4]` notation for matrices - * v0.18 Dropped the `function` keyword - * v0.20 Added ternary conditional - * v0.27 Allow multi-line expressions; allow functions that receive - * unevaluated parameters (`rawArgs`) - * v3 Add object notation; allow assignments internal to other - * expressions - * v7.3 Supported binary, octal, and hexadecimal notation - * v9.5 Support for calculations with percentages - * v12.4 Allow trailing commas in matrices - * v14.8 Add nullish coalescing operator - * v15.1 Add optional chaining operator - * - * @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, - '>>': 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 - // Special case: the check for '?.' is to prevent a case like 'a?.3:.7' from being interpreted as optional chaining - // TODO: refactor the tokenization into some better way to deal with cases like 'a?.3:.7', see https://github.com/josdejong/mathjs/pull/3584 - if (c2.length === 2 && DELIMITERS[c2] && (c2 !== '?.' || !parse.isDigit(state.expression.charAt(state.index + 2)))) { - 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.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(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.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(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 (parse.isDecimalMark(nextCharacter(state), state.expression.charAt(state.index + 2))) { - 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 === '\u00A0' || 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'; - }; - - /** - * 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' - if (node.optionalChaining) { - throw createSyntaxError(state, 'Cannot assign to optional chain'); - } - 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' && '])},;'.includes(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 === ':') { - if (state.conditionalLevel === state.nestingLevel) { - // we are in the midst of parsing a conditional operator, so not - // a range, but rather an empty true-expr, which is considered a - // syntax error - throw createSyntaxError(state, 'The true-expression of a conditional operator may not be empty'); - } else { - // implicit start of range = 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 = parseMultiplyDivideModulus(state); - const operators = { - '+': 'add', - '-': 'subtract' - }; - while ((0, _object.hasOwnProperty)(operators, state.token)) { - name = state.token; - fn = operators[name]; - getTokenSkipNewline(state); - const rightNode = parseMultiplyDivideModulus(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, modulus - * @return {Node} node - * @private - */ - function parseMultiplyDivideModulus(state) { - let node, last, name, fn; - node = parseImplicitMultiplication(state); - last = node; - const operators = { - '*': 'multiply', - '.*': 'dotMultiply', - '/': 'divide', - './': 'dotDivide', - '%': 'mod', - mod: 'mod' - }; - 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 = parseUnaryPercentage(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 === '(' || state.token === 'in') { - // 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 = parseUnaryPercentage(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; - } - - /** - * Unary percentage operator (treated as `value / 100`) - * @return {Node} node - * @private - */ - function parseUnaryPercentage(state) { - let node = parseUnary(state); - if (state.token === '%') { - const previousState = (0, _extends2.default)({}, state); - getTokenSkipNewline(state); - // We need to decide if this is a unary percentage % or binary modulo % - // So we attempt to parse a unary expression at this point. - // If it fails, then the only possibility is that this is a unary percentage. - // If it succeeds, then we presume that this must be binary modulo, since the - // only things that parseUnary can handle are _higher_ precedence than unary %. - try { - parseUnary(state); - // Not sure if we could somehow use the result of that parseUnary? Without - // further analysis/testing, safer just to discard and let the parse proceed - (0, _extends2.default)(state, previousState); - } catch (_unused) { - // Not seeing a term at this point, so was a unary % - node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true); - } - } - 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 = parseNullishCoalescing(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; - } - - /** - * nullish coalescing operator - * @return {Node} node - * @private - */ - function parseNullishCoalescing(state) { - let node = parseLeftHandOperators(state); - while (state.token === '??') { - // eslint-disable-line no-unmodified-loop-condition - getTokenSkipNewline(state); - node = new OperatorNode('??', 'nullish', [node, parseLeftHandOperators(state)]); - } - 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) or sqrt?.(2) with optional chaining - * - index enclosed in square brackets [...], for example A[2,3] or A?.[2,3] with optional chaining - * - dot notation for properties, like foo.bar or foo?.bar with optional chaining - * @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; - - // Iterate and handle chained accessors, including repeated optional chaining - while (true) { - // eslint-disable-line no-unmodified-loop-condition - // Track whether an optional chaining operator precedes the next accessor - let optional = false; - - // Consume an optional chaining operator if present - if (state.token === '?.') { - optional = true; - // consume the '?.' token - getToken(state); - } - const hasNextAccessor = (state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token)); - if (!(optional || hasNextAccessor)) { - break; - } - params = []; - if (state.token === '(') { - if (optional || (0, _is.isSymbolNode)(node) || (0, _is.isAccessorNode)(node)) { - // function invocation: fn(2, 3) or obj.fn(2, 3) or (anything)?.(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, optional); - } 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), optional); - } else { - // dot notation like variable.prop - // consume the `.` (if it was ?., already consumed): - if (!optional) getToken(state); - const isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS; - if (!isPropertyName) { - let message = 'Property name expected after '; - message += optional ? 'optional chain' : 'dot'; - throw createSyntaxError(state, message); - } - params.push(new ConstantNode(state.token)); - getToken(state); - const dotNotation = true; - node = new AccessorNode(node, new IndexNode(params, dotNotation), optional); - } - } - 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/node_modules/mathjs/lib/cjs/expression/transform/and.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/and.transform.js deleted file mode 100644 index 494f509..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/and.transform.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/bitAnd.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/bitAnd.transform.js deleted file mode 100644 index bd1cb36..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/bitAnd.transform.js +++ /dev/null @@ -1,46 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/bitOr.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/bitOr.transform.js deleted file mode 100644 index 41c0927..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/bitOr.transform.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/column.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/column.transform.js deleted file mode 100644 index b03d33c..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/column.transform.js +++ /dev/null @@ -1,53 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js deleted file mode 100644 index a715ea5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/concat.transform.js +++ /dev/null @@ -1,51 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/cumsum.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/cumsum.transform.js deleted file mode 100644 index 91a6b40..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/cumsum.transform.js +++ /dev/null @@ -1,51 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js deleted file mode 100644 index dd0015e..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/diff.transform.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js deleted file mode 100644 index 5b816f3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/filter.transform.js +++ /dev/null @@ -1,62 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js deleted file mode 100644 index e84c4c3..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/forEach.transform.js +++ /dev/null @@ -1,61 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/index.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/index.transform.js deleted file mode 100644 index 8eb0f55..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/index.transform.js +++ /dev/null @@ -1,58 +0,0 @@ -"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) || (0, _is.isBigInt)(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, bigint, 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/node_modules/mathjs/lib/cjs/expression/transform/map.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/map.transform.js deleted file mode 100644 index 152eb0d..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/map.transform.js +++ /dev/null @@ -1,59 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/mapSlices.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/mapSlices.transform.js deleted file mode 100644 index 9545fcc..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/mapSlices.transform.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createMapSlicesTransform = void 0; -var _errorTransform = require("./utils/errorTransform.js"); -var _factory = require("../../utils/factory.js"); -var _mapSlices = require("../../function/matrix/mapSlices.js"); -var _is = require("../../utils/is.js"); -const name = 'mapSlices'; -const dependencies = ['typed', 'isInteger']; - -/** - * Attach a transform function to math.mapSlices - * Adds a property transform containing the transform function. - * - * This transform changed the last `dim` parameter of function mapSlices - * from one-based to zero based - */ -const createMapSlicesTransform = exports.createMapSlicesTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - isInteger - } = _ref; - const mapSlices = (0, _mapSlices.createMapSlices)({ - typed, - isInteger - }); - - // @see: comment of concat itself - return typed('mapSlices', { - '...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 mapSlices.apply(null, args); - } catch (err) { - throw (0, _errorTransform.errorTransform)(err); - } - } - }); -}, { - isTransformFunction: true, - ..._mapSlices.createMapSlices.meta -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/transform/max.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/max.transform.js deleted file mode 100644 index 4b48b33..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/max.transform.js +++ /dev/null @@ -1,48 +0,0 @@ -"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', 'isNaN']; -const createMaxTransform = exports.createMaxTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - numeric, - larger, - isNaN: mathIsNaN - } = _ref; - const max = (0, _max.createMax)({ - typed, - config, - numeric, - larger, - isNaN: mathIsNaN - }); - - /** - * 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/node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js deleted file mode 100644 index 3786f73..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/mean.transform.js +++ /dev/null @@ -1,44 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/min.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/min.transform.js deleted file mode 100644 index bfa0a83..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/min.transform.js +++ /dev/null @@ -1,48 +0,0 @@ -"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', 'isNaN']; -const createMinTransform = exports.createMinTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - numeric, - smaller, - isNaN: mathIsNaN - } = _ref; - const min = (0, _min.createMin)({ - typed, - config, - numeric, - smaller, - isNaN: mathIsNaN - }); - - /** - * 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/node_modules/mathjs/lib/cjs/expression/transform/nullish.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/nullish.transform.js deleted file mode 100644 index 4237b37..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/nullish.transform.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createNullishTransform = void 0; -var _nullish = require("../../function/logical/nullish.js"); -var _factory = require("../../utils/factory.js"); -var _is = require("../../utils/is.js"); -const name = 'nullish'; -const dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual']; -const createNullishTransform = exports.createNullishTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - matrix, - size, - flatten, - deepEqual - } = _ref; - const nullish = (0, _nullish.createNullish)({ - typed, - matrix, - size, - flatten, - deepEqual - }); - function nullishTransform(args, math, scope) { - const left = args[0].compile().evaluate(scope); - - // If left is not a collection and not nullish, short-circuit and return it - if (!(0, _is.isCollection)(left) && left != null && left !== undefined) { - return left; - } - - // Otherwise evaluate right and apply full nullish semantics (incl. element-wise) - const right = args[1].compile().evaluate(scope); - return nullish(left, right); - } - nullishTransform.rawArgs = true; - return nullishTransform; -}, { - isTransformFunction: true -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/expression/transform/or.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/or.transform.js deleted file mode 100644 index 08169e7..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/or.transform.js +++ /dev/null @@ -1,39 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/print.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/print.transform.js deleted file mode 100644 index 8872817..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/print.transform.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/quantileSeq.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/quantileSeq.transform.js deleted file mode 100644 index 885cd03..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/quantileSeq.transform.js +++ /dev/null @@ -1,67 +0,0 @@ -"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', 'mapSlices']; - -/** - * 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, - mapSlices - } = _ref; - const quantileSeq = (0, _quantileSeq.createQuantileSeq)({ - typed, - bignumber, - add, - subtract, - divide, - multiply, - partitionSelect, - compare, - isInteger, - smaller, - smallerEq, - larger, - mapSlices - }); - 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/node_modules/mathjs/lib/cjs/expression/transform/range.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/range.transform.js deleted file mode 100644 index 977fa22..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/range.transform.js +++ /dev/null @@ -1,60 +0,0 @@ -"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', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive']; -const createRangeTransform = exports.createRangeTransform = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - matrix, - bignumber, - equal, - smaller, - smallerEq, - larger, - largerEq, - add, - isZero, - isPositive - } = _ref; - const range = (0, _range.createRange)({ - typed, - config, - matrix, - bignumber, - equal, - smaller, - smallerEq, - larger, - largerEq, - add, - isZero, - 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/node_modules/mathjs/lib/cjs/expression/transform/row.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/row.transform.js deleted file mode 100644 index de1844f..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/row.transform.js +++ /dev/null @@ -1,53 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/std.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/std.transform.js deleted file mode 100644 index c8e5138..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/std.transform.js +++ /dev/null @@ -1,46 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js deleted file mode 100644 index f15ec68..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/subset.transform.js +++ /dev/null @@ -1,43 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js deleted file mode 100644 index f6a6bd8..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/sum.transform.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js b/node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js deleted file mode 100644 index 89b07ba..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/utils/compileInlineExpression.js +++ /dev/null @@ -1,35 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/utils/dimToZeroBase.js b/node_modules/mathjs/lib/cjs/expression/transform/utils/dimToZeroBase.js deleted file mode 100644 index cbc2cc5..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/utils/dimToZeroBase.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js b/node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js deleted file mode 100644 index 3e85344..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/utils/errorTransform.js +++ /dev/null @@ -1,18 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js b/node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js deleted file mode 100644 index dc3cdaf..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/utils/lastDimToZeroBase.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/utils/transformCallback.js b/node_modules/mathjs/lib/cjs/expression/transform/utils/transformCallback.js deleted file mode 100644 index 1fdae2a..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/utils/transformCallback.js +++ /dev/null @@ -1,101 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js b/node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js deleted file mode 100644 index 5087be9..0000000 --- a/node_modules/mathjs/lib/cjs/expression/transform/variance.transform.js +++ /dev/null @@ -1,52 +0,0 @@ -"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', 'mapSlices', '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, - mapSlices, - isNaN: mathIsNaN - } = _ref; - const variance = (0, _variance.createVariance)({ - typed, - add, - subtract, - multiply, - divide, - mapSlices, - isNaN: mathIsNaN - }); - 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/node_modules/mathjs/lib/cjs/factoriesAny.js b/node_modules/mathjs/lib/cjs/factoriesAny.js deleted file mode 100644 index e653a84..0000000 --- a/node_modules/mathjs/lib/cjs/factoriesAny.js +++ /dev/null @@ -1,2520 +0,0 @@ -"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, "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, "createBernoulli", { - enumerable: true, - get: function () { - return _bernoulli.createBernoulli; - } -}); -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, "createCoulombConstant", { - enumerable: true, - get: function () { - return _physicalConstants.createCoulombConstant; - } -}); -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, "createIsBounded", { - enumerable: true, - get: function () { - return _isBounded.createIsBounded; - } -}); -Object.defineProperty(exports, "createIsFinite", { - enumerable: true, - get: function () { - return _isFinite.createIsFinite; - } -}); -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, "createMapSlices", { - enumerable: true, - get: function () { - return _mapSlices.createMapSlices; - } -}); -Object.defineProperty(exports, "createMapSlicesTransform", { - enumerable: true, - get: function () { - return _mapSlicesTransform.createMapSlicesTransform; - } -}); -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, "createNullish", { - enumerable: true, - get: function () { - return _nullish.createNullish; - } -}); -Object.defineProperty(exports, "createNullishTransform", { - enumerable: true, - get: function () { - return _nullishTransform.createNullishTransform; - } -}); -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, "createToBest", { - enumerable: true, - get: function () { - return _toBest.createToBest; - } -}); -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 _isBounded = require("./function/utils/isBounded.js"); -var _isFinite = require("./function/utils/isFinite.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 _mapSlices = require("./function/matrix/mapSlices.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 _nullish = require("./function/logical/nullish.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 _toBest = require("./function/unit/toBest.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 _bernoulli = require("./function/probability/bernoulli.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 _mapSlicesTransform = require("./expression/transform/mapSlices.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 _nullishTransform = require("./expression/transform/nullish.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/node_modules/mathjs/lib/cjs/factoriesNumber.js b/node_modules/mathjs/lib/cjs/factoriesNumber.js deleted file mode 100644 index 00dc9bf..0000000 --- a/node_modules/mathjs/lib/cjs/factoriesNumber.js +++ /dev/null @@ -1,1084 +0,0 @@ -"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, "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, "createBernoulli", { - enumerable: true, - get: function () { - return _bernoulli.createBernoulli; - } -}); -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; - } -}); -Object.defineProperty(exports, "createIsBounded", { - enumerable: true, - get: function () { - return _isBounded.createIsBounded; - } -}); -Object.defineProperty(exports, "createIsFinite", { - enumerable: true, - get: function () { - return _isFinite.createIsFinite; - } -}); -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, "createMapSlices", { - enumerable: true, - get: function () { - return _mapSlices.createMapSlices; - } -}); -Object.defineProperty(exports, "createMapSlicesTransform", { - enumerable: true, - get: function () { - return _mapSlicesTransform.createMapSlicesTransform; - } -}); -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 _mapSlices = require("./function/matrix/mapSlices.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 _bernoulli = require("./function/probability/bernoulli.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 _mapSlicesTransform = require("./expression/transform/mapSlices.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 _isBounded = require("./function/utils/isBounded.js"); -var _isFinite = require("./function/utils/isFinite.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/node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js b/node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js deleted file mode 100644 index e3327e4..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/decomposition/lup.js +++ /dev/null @@ -1,382 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js b/node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js deleted file mode 100644 index 09aa2e9..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/decomposition/qr.js +++ /dev/null @@ -1,229 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/decomposition/schur.js b/node_modules/mathjs/lib/cjs/function/algebra/decomposition/schur.js deleted file mode 100644 index a00a947..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/decomposition/schur.js +++ /dev/null @@ -1,76 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js b/node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js deleted file mode 100644 index a471b82..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/decomposition/slu.js +++ /dev/null @@ -1,107 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/derivative.js b/node_modules/mathjs/lib/cjs/function/algebra/derivative.js deleted file mode 100644 index fdc5fe6..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/derivative.js +++ /dev/null @@ -1,512 +0,0 @@ -"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 cache = new Map(); - const variableName = variable.name; - function isConstCached(node) { - const cached = cache.get(node); - if (cached !== undefined) { - return cached; - } - const res = _isConst(isConstCached, node, variableName); - cache.set(node, res); - return res; - } - const res = _derivative(expr, isConstCached); - 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++) { - - res = _derivative(res, isConst) - } - 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]`; - } - }); - - /** - * Checks if a node is constants (e.g. 2 + 2). - * Accepts (usually memoized) version of self as the first parameter for recursive calls. - * 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 {function} isConst Function that tells whether sub-expression is a constant - * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node - * @param {string} varName Variable that we are differentiating - * @return {boolean} if node is constant - */ - const _isConst = typed('_isConst', { - 'function, ConstantNode, string': function () { - return true; - }, - 'function, SymbolNode, string': function (isConst, node, varName) { - // Treat other variables like constants. For reasoning, see: - // https://en.wikipedia.org/wiki/Partial_derivative - return node.name !== varName; - }, - 'function, ParenthesisNode, string': function (isConst, node, varName) { - return isConst(node.content, varName); - }, - 'function, FunctionAssignmentNode, string': function (isConst, node, varName) { - if (!node.params.includes(varName)) { - return true; - } - return isConst(node.expr, varName); - }, - 'function, FunctionNode | OperatorNode, string': function (isConst, node, varName) { - return node.args.every(arg => isConst(arg, varName)); - } - }); - - /** - * Applies differentiation rules. - * - * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node - * @param {function} isConst Function that tells if a node is constant - * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr` - */ - const _derivative = typed('_derivative', { - 'ConstantNode, function': function () { - return createConstantNode(0); - }, - 'SymbolNode, function': function (node, isConst) { - if (isConst(node)) { - return createConstantNode(0); - } - return createConstantNode(1); - }, - 'ParenthesisNode, function': function (node, isConst) { - return new ParenthesisNode(_derivative(node.content, isConst)); - }, - 'FunctionAssignmentNode, function': function (node, isConst) { - if (isConst(node)) { - return createConstantNode(0); - } - return _derivative(node.expr, isConst); - }, - 'FunctionNode, function': function (node, isConst) { - if (isConst(node)) { - 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]]); - return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), isConst); - } - 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 && isConst(node.args[1])) { - // 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]])]), isConst); - } - break; - case 'pow': - if (node.args.length === 2) { - // Pass to pow operator node parser - return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), isConst); - } - 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, isConst); - if (negative) { - chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]); - } - return new OperatorNode(op, func, [chainDerivative, funcDerivative]); - }, - 'OperatorNode, function': function (node, isConst) { - if (isConst(node)) { - 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, isConst); - })); - } - if (node.op === '-') { - // d/dx(+/-f(x)) = +/-f'(x) - if (node.isUnary()) { - return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], isConst)]); - } - - // 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], isConst), _derivative(node.args[1], isConst)]); - } - } - if (node.op === '*') { - // d/dx(c*f(x)) = c*f'(x) - const constantTerms = node.args.filter(function (arg) { - return isConst(arg); - }); - if (constantTerms.length > 0) { - const nonConstantTerms = node.args.filter(function (arg) { - return !isConst(arg); - }); - const nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms); - const newArgs = constantTerms.concat(_derivative(nonConstantNode, isConst)); - 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, isConst) : 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 (isConst(arg1)) { - return new OperatorNode('/', 'divide', [_derivative(arg0, isConst), arg1]); - } - - // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2) - if (isConst(arg0)) { - return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, isConst), 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, isConst), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, isConst)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]); - } - if (node.op === '^' && node.isBinary()) { - const arg0 = node.args[0]; - const arg1 = node.args[1]; - if (isConst(arg0)) { - // 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(), isConst)])]); - } - if (isConst(arg1)) { - 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, isConst); - } - } - - // 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, isConst), 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, isConst), new OperatorNode('/', 'divide', [arg1.clone(), arg0.clone()])]), new OperatorNode('*', 'multiply', [_derivative(arg1, isConst), 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/node_modules/mathjs/lib/cjs/function/algebra/leafCount.js b/node_modules/mathjs/lib/cjs/function/algebra/leafCount.js deleted file mode 100644 index bb6d65a..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/leafCount.js +++ /dev/null @@ -1,60 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/lyap.js b/node_modules/mathjs/lib/cjs/function/algebra/lyap.js deleted file mode 100644 index 1548e7b..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/lyap.js +++ /dev/null @@ -1,58 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/polynomialRoot.js b/node_modules/mathjs/lib/cjs/function/algebra/polynomialRoot.js deleted file mode 100644 index 4907b41..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/polynomialRoot.js +++ /dev/null @@ -1,132 +0,0 @@ -"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 - * - * History: - * - * v11.4 Created - * - * @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/node_modules/mathjs/lib/cjs/function/algebra/rationalize.js b/node_modules/mathjs/lib/cjs/function/algebra/rationalize.js deleted file mode 100644 index 49ea9a8..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/rationalize.js +++ /dev/null @@ -1,825 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/resolve.js b/node_modules/mathjs/lib/cjs/function/algebra/resolve.js deleted file mode 100644 index 9fcbfac..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/resolve.js +++ /dev/null @@ -1,103 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/simplify.js b/node_modules/mathjs/lib/cjs/function/algebra/simplify.js deleted file mode 100644 index 2a0e412..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/simplify.js +++ /dev/null @@ -1,1252 +0,0 @@ -"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 = ['typed', 'parse', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode', 'replacer']; -const createSimplify = exports.createSimplify = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - parse, - equal, - resolve, - simplifyConstant, - simplifyCore, - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - replacer - } = _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) { - 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], replacer); - 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/node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js b/node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js deleted file mode 100644 index 9c445f4..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/simplify/util.js +++ /dev/null @@ -1,269 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/simplify/wildcards.js b/node_modules/mathjs/lib/cjs/function/algebra/simplify/wildcards.js deleted file mode 100644 index b18a248..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/simplify/wildcards.js +++ /dev/null @@ -1,38 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/simplifyConstant.js b/node_modules/mathjs/lib/cjs/function/algebra/simplifyConstant.js deleted file mode 100644 index 46d0d81..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/simplifyConstant.js +++ /dev/null @@ -1,473 +0,0 @@ -"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', 'isBounded', '?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, - isBounded, - 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 && isBounded(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) { - // note: we convert await from bigint values, because bigint values gives issues with divisions: 1n/2n=0n and not 0.5 - const fromBigInt = value => config.number === 'BigNumber' && bignumber ? bignumber(value) : Number(value); - const numeratorValue = f.s * f.n; - const numeratorNode = numeratorValue < 0n ? new OperatorNode('-', 'unaryMinus', [new ConstantNode(-fromBigInt(numeratorValue))]) : new ConstantNode(fromBigInt(numeratorValue)); - return f.d === 1n ? numeratorNode : new OperatorNode('/', 'divide', [numeratorNode, new ConstantNode(fromBigInt(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/node_modules/mathjs/lib/cjs/function/algebra/simplifyCore.js b/node_modules/mathjs/lib/cjs/function/algebra/simplifyCore.js deleted file mode 100644 index 0e21b5d..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/simplifyCore.js +++ /dev/null @@ -1,297 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js b/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js deleted file mode 100644 index fb5d6bb..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolve.js +++ /dev/null @@ -1,163 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js b/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js deleted file mode 100644 index c2e40e6..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/solver/lsolveAll.js +++ /dev/null @@ -1,192 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js b/node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js deleted file mode 100644 index 8227019..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/solver/lusolve.js +++ /dev/null @@ -1,114 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js b/node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js deleted file mode 100644 index e36877d..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/solver/usolve.js +++ /dev/null @@ -1,167 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js b/node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js deleted file mode 100644 index 5b6b5de..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/solver/usolveAll.js +++ /dev/null @@ -1,196 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js b/node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js deleted file mode 100644 index c0defc6..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/solver/utils/solveValidation.js +++ /dev/null @@ -1,121 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js deleted file mode 100644 index 5569cdd..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csAmd.js +++ /dev/null @@ -1,587 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csChol.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csChol.js deleted file mode 100644 index a9c7e1d..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csChol.js +++ /dev/null @@ -1,164 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js deleted file mode 100644 index c131993..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCounts.js +++ /dev/null @@ -1,133 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCumsum.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCumsum.js deleted file mode 100644 index 2035a26..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csCumsum.js +++ /dev/null @@ -1,34 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js deleted file mode 100644 index 437e115..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csDfs.js +++ /dev/null @@ -1,82 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEreach.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEreach.js deleted file mode 100644 index 022fcf5..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEreach.js +++ /dev/null @@ -1,69 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js deleted file mode 100644 index d2b7bda..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csEtree.js +++ /dev/null @@ -1,77 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js deleted file mode 100644 index 6d916d1..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFkeep.js +++ /dev/null @@ -1,64 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js deleted file mode 100644 index bcc13a5..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csFlip.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js deleted file mode 100644 index 0d63ef9..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csIpvec.js +++ /dev/null @@ -1,39 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js deleted file mode 100644 index 4e4d93b..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLeaf.js +++ /dev/null @@ -1,62 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js deleted file mode 100644 index e74ca25..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csLu.js +++ /dev/null @@ -1,188 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js deleted file mode 100644 index 7845048..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMark.js +++ /dev/null @@ -1,21 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js deleted file mode 100644 index 0c61e7a..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csMarked.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js deleted file mode 100644 index abd5e7a..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPermute.js +++ /dev/null @@ -1,67 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js deleted file mode 100644 index 384e72b..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csPost.js +++ /dev/null @@ -1,58 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js deleted file mode 100644 index 2975d6d..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csReach.js +++ /dev/null @@ -1,57 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js deleted file mode 100644 index 3e45875..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSpsolve.js +++ /dev/null @@ -1,91 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js deleted file mode 100644 index a6bbaa1..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSqr.js +++ /dev/null @@ -1,186 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSymperm.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSymperm.js deleted file mode 100644 index 9f435f5..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csSymperm.js +++ /dev/null @@ -1,100 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js deleted file mode 100644 index b1fa1aa..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csTdfs.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js b/node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js deleted file mode 100644 index 31c0304..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sparse/csUnflip.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/algebra/sylvester.js b/node_modules/mathjs/lib/cjs/function/algebra/sylvester.js deleted file mode 100644 index a7b2061..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/sylvester.js +++ /dev/null @@ -1,125 +0,0 @@ -"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, - config - } = _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/node_modules/mathjs/lib/cjs/function/algebra/symbolicEqual.js b/node_modules/mathjs/lib/cjs/function/algebra/symbolicEqual.js deleted file mode 100644 index 30434b3..0000000 --- a/node_modules/mathjs/lib/cjs/function/algebra/symbolicEqual.js +++ /dev/null @@ -1,66 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/abs.js b/node_modules/mathjs/lib/cjs/function/arithmetic/abs.js deleted file mode 100644 index dd1a1f0..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/abs.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/add.js b/node_modules/mathjs/lib/cjs/function/arithmetic/add.js deleted file mode 100644 index b85c07a..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/add.js +++ /dev/null @@ -1,96 +0,0 @@ -"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 5.21 cm - * - * math.add("2.3", "4") // returns number 6.3 - * - * See also: - * - * subtract, sum - * - * History: - * - * v13 Handle bigint arguments - * v11.6 Support matrix broadcasting - * v3.8 Allow more than two arguments - * v0.0.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js b/node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js deleted file mode 100644 index 4bfc050..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/addScalar.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js b/node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js deleted file mode 100644 index 02b0cdf..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/cbrt.js +++ /dev/null @@ -1,138 +0,0 @@ -"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 1.7320508075689 + i ... - * math.cbrt(x, true) - * // Complex Matrix ["1.7320508075689+i", "-1.7320508075689+i", "-2i"] - * - * See also: - * - * square, sqrt, cube - * - * History: - * - * v2.3 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js b/node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js deleted file mode 100644 index 594f4f5..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/ceil.js +++ /dev/null @@ -1,203 +0,0 @@ -"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 bigTen = new _decimal.default(10); -const createCeilNumber = exports.createCeilNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config', 'round'], _ref => { - let { - typed, - config, - round - } = _ref; - function _ceilNumber(x) { - // See ./floor.js _floorNumber for rationale here - const c = Math.ceil(x); - const r = round(x); - if (c === r) return c; - if ((0, _number.nearlyEqual)(x, r, config.relTol, config.absTol) && !(0, _number.nearlyEqual)(x, c, config.relTol, config.absTol)) { - return r; - } - return c; - } - return typed(name, { - number: _ceilNumber, - 'number, number': function (x, n) { - if (!(0, _number.isInteger)(n)) { - throw new RangeError('number of decimals in function ceil must be an integer'); - } - if (n < 0 || n > 15) { - throw new RangeError('number of decimals in ceil number must be in range 0-15'); - } - const shift = 10 ** n; - return _ceilNumber(x * shift) / shift; - } - }); -}); -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 - }); - function _bigCeil(x) { - // see ./floor.js _floorNumber for rationale - const bne = (a, b) => (0, _nearlyEqual.nearlyEqual)(a, b, config.relTol, config.absTol); - const c = x.ceil(); - const r = round(x); - if (c.eq(r)) return c; - if (bne(x, r) && !bne(x, c)) return r; - return c; - } - /** - * 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) - * math.ceil(unit, valuelessUnit) - * math.ceil(unit, n, valuelessUnit) - * - * 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 - * - * const unit = math.unit('3.241 cm') - * const cm = math.unit('cm') - * const mm = math.unit('mm') - * math.ceil(unit, 1, cm) // returns Unit 3.3 cm ... - * math.ceil(unit, 1, mm) // returns Unit 32.5 mm - * - * 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 - * - * History: - * - * v14 Handle Units - * v7.4 Allow second "precision" argument - * v5.7 Support tolerance for round-off errors - * v2 Handle Fractions - * v0.1 Created - * - * @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 | Unit | 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: _bigCeil, - 'BigNumber, BigNumber': function (x, n) { - const shift = bigTen.pow(n); - return _bigCeil(x.mul(shift)).div(shift); - }, - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - 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()); - }, - '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)), - 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => { - // deep map collection, skip zeros since ceil(0) = 0 - return (0, _collection.deepMap)(x, value => self(value, n, unit), true); - }), - 'Array | Matrix | Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), - '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/node_modules/mathjs/lib/cjs/function/arithmetic/cube.js b/node_modules/mathjs/lib/cjs/function/arithmetic/cube.js deleted file mode 100644 index e28c103..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/cube.js +++ /dev/null @@ -1,58 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/divide.js b/node_modules/mathjs/lib/cjs/function/arithmetic/divide.js deleted file mode 100644 index 22829ec..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/divide.js +++ /dev/null @@ -1,85 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js b/node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js deleted file mode 100644 index 49fd13d..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/divideScalar.js +++ /dev/null @@ -1,46 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js b/node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js deleted file mode 100644 index 31a8cd6..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/dotDivide.js +++ /dev/null @@ -1,85 +0,0 @@ -"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', 'SparseMatrix']; -const createDotDivide = exports.createDotDivide = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - matrix, - equalScalar, - divideScalar, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({ - typed, - equalScalar - }); - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js b/node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js deleted file mode 100644 index f98805d..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/dotMultiply.js +++ /dev/null @@ -1,72 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js b/node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js deleted file mode 100644 index ece00a0..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/dotPow.js +++ /dev/null @@ -1,85 +0,0 @@ -"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', 'SparseMatrix']; -const createDotPow = exports.createDotPow = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - equalScalar, - matrix, - pow, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/cjs/function/arithmetic/exp.js b/node_modules/mathjs/lib/cjs/function/arithmetic/exp.js deleted file mode 100644 index 4c69fd7..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/exp.js +++ /dev/null @@ -1,56 +0,0 @@ -"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 [2.718281828459045, 7.3890560989306495, 20.085536923187668] - * - * See also: - * - * expm1, expm, log, pow - * - * History: - * - * v11 Don't apply elementwise, avoid confusion with matrix exponential - * v0.20 Handle BigNumbers - * v0.0.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js b/node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js deleted file mode 100644 index b8e8f90..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/expm1.js +++ /dev/null @@ -1,60 +0,0 @@ -"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 [1.718281828459045, 6.3890560989306495, 19.085536923187668] - * - * See also: - * - * exp, expm, log, pow - * - * History: - * - * v11 Don't apply elementwise, avoids confusion with matrix exponential - * v4.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/fix.js b/node_modules/mathjs/lib/cjs/function/arithmetic/fix.js deleted file mode 100644 index 03369db..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/fix.js +++ /dev/null @@ -1,162 +0,0 @@ -"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) - * math.fix(unit, valuelessUnit) - * math.fix(unit, n, valuelessUnit) - * - * 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 - * - * const unit = math.unit('3.241 cm') - * const cm = math.unit('cm') - * const mm = math.unit('mm') - * math.fix(unit, 1, cm) // returns Unit 3.2 cm ... - * math.fix(unit, 1, mm) // returns Unit 32.4 mm - * - * 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 - * - * History: - * - * v14 Handle Units - * v7.4 Allow second "precision" argument - * v5.7 Support tolerance for round-off errors - * v2 Handle Fractions - * v0.1 Created - * - * @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 | Unit | 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); - }, - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - Fraction: function (x) { - return x.s < 0n ? x.ceil() : x.floor(); - }, - 'Fraction, number | BigNumber': function (x, n) { - return x.s < 0n ? ceil(x, n) : floor(x, n); - }, - '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)), - 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => { - // deep map collection, skip zeros since fix(0) = 0 - return (0, _collection.deepMap)(x, value => self(value, n, unit), true); - }), - 'Array | Matrix | Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), - '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/node_modules/mathjs/lib/cjs/function/arithmetic/floor.js b/node_modules/mathjs/lib/cjs/function/arithmetic/floor.js deleted file mode 100644 index 0e4c103..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/floor.js +++ /dev/null @@ -1,213 +0,0 @@ -"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 bigTen = new _decimal.default(10); -const createFloorNumber = exports.createFloorNumber = /* #__PURE__ */(0, _factory.factory)(name, ['typed', 'config', 'round'], _ref => { - let { - typed, - config, - round - } = _ref; - function _floorNumber(x) { - // First, if the floor and the round are identical we can be - // quite comfortable that is the best answer: - const f = Math.floor(x); - const r = round(x); - if (f === r) return f; - // OK, they are different. If x is truly distinct from f but - // appears indistinguishable from r, presume it really is just - // the integer r with rounding/computation error, and return that - if ((0, _number.nearlyEqual)(x, r, config.relTol, config.absTol) && !(0, _number.nearlyEqual)(x, f, config.relTol, config.absTol)) { - return r; - } - // Otherwise (x distinct from both r and f, or indistinguishable from - // both r and f) may as well just return f, as that's the best - // candidate we can discern: - return f; - } - return typed(name, { - number: _floorNumber, - 'number, number': function (x, n) { - if (!(0, _number.isInteger)(n)) { - throw new RangeError('number of decimals in function floor must be an integer'); - } - if (n < 0 || n > 15) { - throw new RangeError('number of decimals in floor number must be in range 0 - 15'); - } - const shift = 10 ** n; - return _floorNumber(x * shift) / shift; - } - }); -}); -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 - }); - function _bigFloor(x) { - // see _floorNumber above for rationale - const bne = (a, b) => (0, _nearlyEqual.nearlyEqual)(a, b, config.relTol, config.absTol); - const f = x.floor(); - const r = round(x); - if (f.eq(r)) return f; - if (bne(x, r) && !bne(x, f)) return r; - return f; - } - /** - * Round a value towards minus infinity. - * For matrices, the function is evaluated element wise. - * - * Syntax: - * - * math.floor(x) - * math.floor(x, n) - * math.floor(unit, valuelessUnit) - * math.floor(unit, n, valuelessUnit) - * - * 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 - * - * const unit = math.unit('3.241 cm') - * const cm = math.unit('cm') - * const mm = math.unit('mm') - * math.floor(unit, 1, cm) // returns Unit 3.2 cm ... - * math.floor(unit, 1, mm) // returns Unit 32.4 mm - * - * 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 - * - * History: - * - * v14 Handle Units - * v7.4 Allow second "precision" argument - * v5.7 Support tolerance for round-off errors - * v2 Handle Fractions - * v0.1 Created - * - * @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 | Unit | 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: _bigFloor, - 'BigNumber, BigNumber': function (x, n) { - const shift = bigTen.pow(n); - return _bigFloor(x.mul(shift)).div(shift); - }, - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - 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()); - }, - '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)), - 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => { - // deep map collection, skip zeros since floor(0) = 0 - return (0, _collection.deepMap)(x, value => self(value, n, unit), true); - }), - 'Array | Matrix | Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), - '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/node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js b/node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js deleted file mode 100644 index 0f9276d..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/gcd.js +++ /dev/null @@ -1,159 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js b/node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js deleted file mode 100644 index 97b4218..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/hypot.js +++ /dev/null @@ -1,83 +0,0 @@ -"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(), true)) - }); - - /** - * 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/node_modules/mathjs/lib/cjs/function/arithmetic/invmod.js b/node_modules/mathjs/lib/cjs/function/arithmetic/invmod.js deleted file mode 100644 index d6b8ed2..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/invmod.js +++ /dev/null @@ -1,61 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js b/node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js deleted file mode 100644 index a3f30c9..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/lcm.js +++ /dev/null @@ -1,116 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/log.js b/node_modules/mathjs/lib/cjs/function/arithmetic/log.js deleted file mode 100644 index 68b372b..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/log.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createLog = void 0; -var _factory = require("../../utils/factory.js"); -var _bigint = require("../../utils/bigint.js"); -var _index = require("../../plain/number/index.js"); -const name = 'log'; -const dependencies = ['config', 'typed', 'typeOf', 'divideScalar', 'Complex']; -const nlg16 = Math.log(16); -const createLog = exports.createLog = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - typeOf, - 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 - * - * History: - * - * v0.0.2 Created - * v0.2 Add optional base argument - * v0.3 Handle Array input - * v0.5 Handle Matrix input - * v0.16 Handle BigNumber input - * v0.21 Support negative BigNumbers - * v11 Drop Array/Matrix support in favor of explicit map of - * the scalar log function, to avoid confusion with the log - * of a matrix - * v14 Allow value and base to be Fractions, when the log is rational - * - * @param {number | BigNumber | Fraction | Complex} x - * Value for which to calculate the logarithm. - * @param {number | BigNumber | Fraction | Complex} [base=e] - * Optional base for the logarithm. If not provided, the natural - * logarithm of `x` is calculated. - * @return {number | BigNumber | Fraction | Complex} - * Returns the logarithm of `x` - */ - function complexLog(c) { - return c.log(); - } - function complexLogNumber(x) { - return complexLog(new Complex(x, 0)); - } - return typed(name, { - number: function (x) { - if (x >= 0 || config.predictable) { - return (0, _index.logNumber)(x); - } else { - // negative value -> complex value computation - return complexLogNumber(x); - } - }, - bigint: (0, _bigint.promoteLogarithm)(nlg16, _index.logNumber, config, complexLogNumber), - Complex: complexLog, - BigNumber: function (x) { - if (!x.isNegative() || config.predictable) { - return x.ln(); - } else { - // downgrade to number, return Complex valued result - return complexLogNumber(x.toNumber()); - } - }, - 'any, any': typed.referToSelf(self => (x, base) => { - // calculate logarithm for a specified base, log(x, base) - - if (typeOf(x) === 'Fraction' && typeOf(base) === 'Fraction') { - const result = x.log(base); - if (result !== null) { - return result; - } - } - return divideScalar(self(x), self(base)); - }) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/arithmetic/log10.js b/node_modules/mathjs/lib/cjs/function/arithmetic/log10.js deleted file mode 100644 index d2c0a4d..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/log10.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createLog10 = void 0; -var _index = require("../../plain/number/index.js"); -var _bigint = require("../../utils/bigint.js"); -var _collection = require("../../utils/collection.js"); -var _factory = require("../../utils/factory.js"); -const name = 'log10'; -const dependencies = ['typed', 'config', 'Complex']; -const log16 = (0, _index.log10Number)(16); -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` - */ - - function complexLog(c) { - return c.log().div(Math.LN10); - } - function complexLogNumber(x) { - return complexLog(new Complex(x, 0)); - } - return typed(name, { - number: function (x) { - if (x >= 0 || config.predictable) { - return (0, _index.log10Number)(x); - } else { - // negative value -> complex value computation - return complexLogNumber(x); - } - }, - bigint: (0, _bigint.promoteLogarithm)(log16, _index.log10Number, config, complexLogNumber), - Complex: complexLog, - BigNumber: function (x) { - if (!x.isNegative() || config.predictable) { - return x.log(); - } else { - // downgrade to number, return Complex valued result - return complexLogNumber(x.toNumber()); - } - }, - 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js b/node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js deleted file mode 100644 index e68a466..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/log1p.js +++ /dev/null @@ -1,87 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/log2.js b/node_modules/mathjs/lib/cjs/function/arithmetic/log2.js deleted file mode 100644 index f19542f..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/log2.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createLog2 = void 0; -var _index = require("../../plain/number/index.js"); -var _bigint = require("../../utils/bigint.js"); -var _collection = require("../../utils/collection.js"); -var _factory = require("../../utils/factory.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` - */ - function complexLog2Number(x) { - return _log2Complex(new Complex(x, 0)); - } - return typed(name, { - number: function (x) { - if (x >= 0 || config.predictable) { - return (0, _index.log2Number)(x); - } else { - // negative value -> complex value computation - return complexLog2Number(x); - } - }, - bigint: (0, _bigint.promoteLogarithm)(4, _index.log2Number, config, complexLog2Number), - Complex: _log2Complex, - BigNumber: function (x) { - if (!x.isNegative() || config.predictable) { - return x.log(2); - } else { - // downgrade to number, return Complex valued result - return complexLog2Number(x.toNumber()); - } - }, - '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/node_modules/mathjs/lib/cjs/function/arithmetic/mod.js b/node_modules/mathjs/lib/cjs/function/arithmetic/mod.js deleted file mode 100644 index f210a72..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/mod.js +++ /dev/null @@ -1,145 +0,0 @@ -"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 - * - * History: - * - * v13 Handle bigints - * v11.6 Support matrix broadcasting - * v2 Handle Fractions - * v0.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js b/node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js deleted file mode 100644 index fe11843..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/multiply.js +++ /dev/null @@ -1,886 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js b/node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js deleted file mode 100644 index 9a3c10b..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/multiplyScalar.js +++ /dev/null @@ -1,44 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/norm.js b/node_modules/mathjs/lib/cjs/function/arithmetic/norm.js deleted file mode 100644 index 997aa8d..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/norm.js +++ /dev/null @@ -1,293 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js b/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js deleted file mode 100644 index 7242f6b..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoot.js +++ /dev/null @@ -1,178 +0,0 @@ -"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 - * math.sqrt(9) // returns 3 - * math.nthRoot(64, 3) // returns 4 - * - * See also: - * - * sqrt, pow - * - * History: - * - * v11.6 Support matrix broadcasting - * v2 Handle Complex - * v1.1 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js b/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js deleted file mode 100644 index 2532c32..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/nthRoots.js +++ /dev/null @@ -1,118 +0,0 @@ -"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. - * Note that currently the precision of Complex numbers are limited - * to the precision of a 64-bit IEEE floating point, so even if the input - * is a BigNumber with greater precision, rounding to 64 bits will occur - * in computing the nth roots. - * - * 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) - * // Complex [1, "-0.5+0.866025403784439i", "-0.5-0.866025403784439i"] - * - * See also: - * - * nthRoot, pow, sqrt - * - * History: - * - * v1.1 Created - * - * @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/node_modules/mathjs/lib/cjs/function/arithmetic/pow.js b/node_modules/mathjs/lib/cjs/function/arithmetic/pow.js deleted file mode 100644 index 213004c..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/pow.js +++ /dev/null @@ -1,198 +0,0 @@ -"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 % 2n === 1n) { - return (yFrac.n % 2n === 0n ? 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/node_modules/mathjs/lib/cjs/function/arithmetic/round.js b/node_modules/mathjs/lib/cjs/function/arithmetic/round.js deleted file mode 100644 index 38e76be..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/round.js +++ /dev/null @@ -1,210 +0,0 @@ -"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 | Unit | 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()); - }, - // bigints can't be rounded - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - 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)), - 'Array | Matrix, number | BigNumber, 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 | Unit, 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/node_modules/mathjs/lib/cjs/function/arithmetic/sign.js b/node_modules/mathjs/lib/cjs/function/arithmetic/sign.js deleted file mode 100644 index 8ed1ea1..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/sign.js +++ /dev/null @@ -1,72 +0,0 @@ -"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 x.n === 0n ? new Fraction(0) : new Fraction(x.s); - }, - // 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/node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js b/node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js deleted file mode 100644 index d0a159b..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/sqrt.js +++ /dev/null @@ -1,76 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/square.js b/node_modules/mathjs/lib/cjs/function/arithmetic/square.js deleted file mode 100644 index 279334d..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/square.js +++ /dev/null @@ -1,61 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js b/node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js deleted file mode 100644 index ebd04a9..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/subtract.js +++ /dev/null @@ -1,92 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/subtractScalar.js b/node_modules/mathjs/lib/cjs/function/arithmetic/subtractScalar.js deleted file mode 100644 index 6a2da88..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/subtractScalar.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js b/node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js deleted file mode 100644 index 34844db..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/unaryMinus.js +++ /dev/null @@ -1,53 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js b/node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js deleted file mode 100644 index af6da31..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/unaryPlus.js +++ /dev/null @@ -1,69 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js b/node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js deleted file mode 100644 index e79cd9f..0000000 --- a/node_modules/mathjs/lib/cjs/function/arithmetic/xgcd.js +++ /dev/null @@ -1,97 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js b/node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js deleted file mode 100644 index 9d419ff..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/bitAnd.js +++ /dev/null @@ -1,72 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js b/node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js deleted file mode 100644 index 98aa3e6..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/bitNot.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js b/node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js deleted file mode 100644 index f269ec2..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/bitOr.js +++ /dev/null @@ -1,73 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js b/node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js deleted file mode 100644 index 928601f..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/bitXor.js +++ /dev/null @@ -1,72 +0,0 @@ -"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', 'SparseMatrix']; -const createBitXor = exports.createBitXor = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js b/node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js deleted file mode 100644 index e686e6e..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/leftShift.js +++ /dev/null @@ -1,121 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js b/node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js deleted file mode 100644 index 2c2af03..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/rightArithShift.js +++ /dev/null @@ -1,121 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js b/node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js deleted file mode 100644 index e35c2cc..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/rightLogShift.js +++ /dev/null @@ -1,121 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/bitwise/useMatrixForArrayScalar.js b/node_modules/mathjs/lib/cjs/function/bitwise/useMatrixForArrayScalar.js deleted file mode 100644 index 8b1a863..0000000 --- a/node_modules/mathjs/lib/cjs/function/bitwise/useMatrixForArrayScalar.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js b/node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js deleted file mode 100644 index 1dc1b92..0000000 --- a/node_modules/mathjs/lib/cjs/function/combinatorics/bellNumbers.js +++ /dev/null @@ -1,53 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js b/node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js deleted file mode 100644 index 3f4646d..0000000 --- a/node_modules/mathjs/lib/cjs/function/combinatorics/catalan.js +++ /dev/null @@ -1,49 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/combinatorics/composition.js b/node_modules/mathjs/lib/cjs/function/combinatorics/composition.js deleted file mode 100644 index f13ca1e..0000000 --- a/node_modules/mathjs/lib/cjs/function/combinatorics/composition.js +++ /dev/null @@ -1,52 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js b/node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js deleted file mode 100644 index 7e7dfcc..0000000 --- a/node_modules/mathjs/lib/cjs/function/combinatorics/stirlingS2.js +++ /dev/null @@ -1,92 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/complex/arg.js b/node_modules/mathjs/lib/cjs/function/complex/arg.js deleted file mode 100644 index 21c7f90..0000000 --- a/node_modules/mathjs/lib/cjs/function/complex/arg.js +++ /dev/null @@ -1,56 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/complex/conj.js b/node_modules/mathjs/lib/cjs/function/complex/conj.js deleted file mode 100644 index bd6c6da..0000000 --- a/node_modules/mathjs/lib/cjs/function/complex/conj.js +++ /dev/null @@ -1,46 +0,0 @@ -"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 | Unit} x - * A complex number or array with complex numbers - * @return {number | BigNumber | Complex | Array | Matrix | Unit} - * The complex conjugate of x - */ - return typed(name, { - 'number | BigNumber | Fraction': x => x, - Complex: x => x.conjugate(), - Unit: typed.referToSelf(self => x => new x.constructor(self(x.toNumeric()), x.formatUnits())), - 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/complex/im.js b/node_modules/mathjs/lib/cjs/function/complex/im.js deleted file mode 100644 index f082801..0000000 --- a/node_modules/mathjs/lib/cjs/function/complex/im.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/complex/re.js b/node_modules/mathjs/lib/cjs/function/complex/re.js deleted file mode 100644 index 9886d65..0000000 --- a/node_modules/mathjs/lib/cjs/function/complex/re.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/geometry/distance.js b/node_modules/mathjs/lib/cjs/function/geometry/distance.js deleted file mode 100644 index 792453b..0000000 --- a/node_modules/mathjs/lib/cjs/function/geometry/distance.js +++ /dev/null @@ -1,311 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/geometry/intersect.js b/node_modules/mathjs/lib/cjs/function/geometry/intersect.js deleted file mode 100644 index af857e9..0000000 --- a/node_modules/mathjs/lib/cjs/function/geometry/intersect.js +++ /dev/null @@ -1,206 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/logical/and.js b/node_modules/mathjs/lib/cjs/function/logical/and.js deleted file mode 100644 index cb92ff1..0000000 --- a/node_modules/mathjs/lib/cjs/function/logical/and.js +++ /dev/null @@ -1,128 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/logical/not.js b/node_modules/mathjs/lib/cjs/function/logical/not.js deleted file mode 100644 index bc38d42..0000000 --- a/node_modules/mathjs/lib/cjs/function/logical/not.js +++ /dev/null @@ -1,54 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/logical/nullish.js b/node_modules/mathjs/lib/cjs/function/logical/nullish.js deleted file mode 100644 index e09b4c2..0000000 --- a/node_modules/mathjs/lib/cjs/function/logical/nullish.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createNullish = void 0; -var _factory = require("../../utils/factory.js"); -var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); -var _matAlgo14xDs = require("../../type/matrix/utils/matAlgo14xDs.js"); -var _matAlgo13xDD = require("../../type/matrix/utils/matAlgo13xDD.js"); -var _DimensionError = require("../../error/DimensionError.js"); -const name = 'nullish'; -const dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual']; -const createNullish = exports.createNullish = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - matrix, - size, - flatten, - deepEqual - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo14xDs = (0, _matAlgo14xDs.createMatAlgo14xDs)({ - typed - }); - const matAlgo13xDD = (0, _matAlgo13xDD.createMatAlgo13xDD)({ - typed - }); - - /** - * Nullish coalescing operator (??). Returns the right-hand side operand - * when the left-hand side operand is null or undefined, and otherwise - * returns the left-hand side operand. - * - * For matrices, the function is evaluated element wise. - * - * Syntax: - * - * math.nullish(x, y) - * - * Examples: - * - * math.nullish(null, 42) // returns 42 - * math.nullish(undefined, 42) // returns 42 - * math.nullish(0, 42) // returns 0 - * math.nullish(false, 42) // returns false - * math.nullish('', 42) // returns '' - * - * // Object property access with fallback - * const obj = {foo: 7, bar: 3} - * math.nullish(obj.baz, 0) // returns 0 - * - * See also: - * - * and, or, not - * - * @param {*} x First value to check - * @param {*} y Fallback value - * @return {*} Returns y when x is null or undefined, otherwise returns x - */ - - return typed(name, { - // Scalar and SparseMatrix-first short-circuit handlers - 'number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any': (x, _y) => x, - 'null, any': (_x, y) => y, - 'undefined, any': (_x, y) => y, - // SparseMatrix-first with collection RHS: enforce exact shape match - 'SparseMatrix, Array | Matrix': (x, y) => { - const sx = size(x); - const sy = size(y); - if (deepEqual(sx, sy)) return x; - throw new _DimensionError.DimensionError(sx, sy); - }, - // DenseMatrix-first handlers (no broadcasting between collections) - 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => matAlgo13xDD(x, y, self)), - 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => matAlgo03xDSf(x, y, self, false)), - 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => matAlgo13xDD(x, matrix(y), self)), - 'DenseMatrix, any': typed.referToSelf(self => (x, y) => matAlgo14xDs(x, y, self, false)), - // Array-first handlers (bridge via matrix() where needed) - 'Array, Array': typed.referToSelf(self => (x, y) => matAlgo13xDD(matrix(x), matrix(y), self).valueOf()), - 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => matAlgo13xDD(matrix(x), y, self)), - 'Array, SparseMatrix': typed.referToSelf(self => (x, y) => matAlgo03xDSf(matrix(x), y, self, false)), - 'Array, any': typed.referToSelf(self => (x, y) => matAlgo14xDs(matrix(x), y, self, false).valueOf()) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/logical/or.js b/node_modules/mathjs/lib/cjs/function/logical/or.js deleted file mode 100644 index 8680743..0000000 --- a/node_modules/mathjs/lib/cjs/function/logical/or.js +++ /dev/null @@ -1,83 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/logical/xor.js b/node_modules/mathjs/lib/cjs/function/logical/xor.js deleted file mode 100644 index 681b39e..0000000 --- a/node_modules/mathjs/lib/cjs/function/logical/xor.js +++ /dev/null @@ -1,83 +0,0 @@ -"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', 'SparseMatrix']; -const createXor = exports.createXor = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/cjs/function/matrix/column.js b/node_modules/mathjs/lib/cjs/function/matrix/column.js deleted file mode 100644 index c0107ed..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/column.js +++ /dev/null @@ -1,66 +0,0 @@ -"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); - // once config.legacySubset just return result - return (0, _is.isMatrix)(result) ? result : matrix([[result]]); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/concat.js b/node_modules/mathjs/lib/cjs/function/matrix/concat.js deleted file mode 100644 index 785e0e4..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/concat.js +++ /dev/null @@ -1,110 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/count.js b/node_modules/mathjs/lib/cjs/function/matrix/count.js deleted file mode 100644 index 508d2cb..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/count.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/cross.js b/node_modules/mathjs/lib/cjs/function/matrix/cross.js deleted file mode 100644 index 9394464..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/cross.js +++ /dev/null @@ -1,87 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js b/node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js deleted file mode 100644 index b1e7625..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js +++ /dev/null @@ -1,43 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/det.js b/node_modules/mathjs/lib/cjs/function/matrix/det.js deleted file mode 100644 index 81e9eb9..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/det.js +++ /dev/null @@ -1,148 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/diag.js b/node_modules/mathjs/lib/cjs/function/matrix/diag.js deleted file mode 100644 index c87efdd..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/diag.js +++ /dev/null @@ -1,161 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/diff.js b/node_modules/mathjs/lib/cjs/function/matrix/diff.js deleted file mode 100644 index a41ffe8..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/diff.js +++ /dev/null @@ -1,169 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/dot.js b/node_modules/mathjs/lib/cjs/function/matrix/dot.js deleted file mode 100644 index 5304f42..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/dot.js +++ /dev/null @@ -1,157 +0,0 @@ -"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; - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/eigs.js b/node_modules/mathjs/lib/cjs/function/matrix/eigs.js deleted file mode 100644 index 808caf2..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/eigs.js +++ /dev/null @@ -1,335 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js b/node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js deleted file mode 100644 index d9c7e42..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/eigs/complexEigs.js +++ /dev/null @@ -1,701 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymmetric.js b/node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymmetric.js deleted file mode 100644 index 5ed0f0f..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/eigs/realSymmetric.js +++ /dev/null @@ -1,303 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/expm.js b/node_modules/mathjs/lib/cjs/function/matrix/expm.js deleted file mode 100644 index f44e112..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/expm.js +++ /dev/null @@ -1,160 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/fft.js b/node_modules/mathjs/lib/cjs/function/matrix/fft.js deleted file mode 100644 index ddab998..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/fft.js +++ /dev/null @@ -1,134 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/filter.js b/node_modules/mathjs/lib/cjs/function/matrix/filter.js deleted file mode 100644 index 4c2c9bf..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/filter.js +++ /dev/null @@ -1,80 +0,0 @@ -"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. - * - * The callback is invoked with three arguments: the current value, - * the current index, and the matrix operated upon. - * 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.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'); - if (fastCallback.isUnary) { - return (0, _array.filter)(x, fastCallback.fn); - } - return (0, _array.filter)(x, function (value, index, array) { - // invoke the callback function with the right number of arguments - return fastCallback.fn(value, [index], array); - }); -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/flatten.js b/node_modules/mathjs/lib/cjs/function/matrix/flatten.js deleted file mode 100644 index 0238ec2..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/flatten.js +++ /dev/null @@ -1,47 +0,0 @@ -"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 {DenseMatrix | Array} x Matrix to be flattened - * @return {DenseMatrix | Array} Returns the flattened matrix - */ - return typed(name, { - Array: function (x) { - return (0, _array.flatten)(x); - }, - DenseMatrix: 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.valueOf(), true), x.datatype()); - }, - SparseMatrix: function (_x) { - throw new TypeError('SparseMatrix is not supported by function flatten ' + 'because it does not support 1D vectors. ' + 'Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())'); - } - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/forEach.js b/node_modules/mathjs/lib/cjs/function/matrix/forEach.js deleted file mode 100644 index 9ddc042..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/forEach.js +++ /dev/null @@ -1,63 +0,0 @@ -"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. - * - * The callback is invoked with three arguments: the current value, - * the current index, and the matrix operated upon. - * 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.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) { - const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, array, name); - (0, _array.deepForEach)(array, fastCallback.fn, fastCallback.isUnary); -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js b/node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js deleted file mode 100644 index 0c14716..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/getMatrixDataType.js +++ /dev/null @@ -1,58 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/identity.js b/node_modules/mathjs/lib/cjs/function/matrix/identity.js deleted file mode 100644 index c0f3d71..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/identity.js +++ /dev/null @@ -1,142 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/ifft.js b/node_modules/mathjs/lib/cjs/function/matrix/ifft.js deleted file mode 100644 index 22bc6e3..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/ifft.js +++ /dev/null @@ -1,43 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/inv.js b/node_modules/mathjs/lib/cjs/function/matrix/inv.js deleted file mode 100644 index 58947fc..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/inv.js +++ /dev/null @@ -1,190 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/kron.js b/node_modules/mathjs/lib/cjs/function/matrix/kron.js deleted file mode 100644 index 0d2c299..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/kron.js +++ /dev/null @@ -1,92 +0,0 @@ -"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 (1-dimensional) vectors, - * with no dimension checking - * @param {Array} a First vector - * @param {Array} b Second vector - * @returns {Array} the 1-dimensional Kronecker product of a and b - * @private - */ - function _kron1d(a, b) { - // TODO in core overhaul: would be faster to see if we can choose a - // particular implementation of multiplyScalar at the beginning, - // rather than re-dispatch for _every_ ordered pair of entries. - return a.flatMap(x => b.map(y => multiplyScalar(x, y))); - } - - /** - * Calculate the Kronecker product of two possibly multidimensional arrays - * @param {Array} a First array - * @param {Array} b Second array - * @param {number} [d] common dimension; if missing, compute and match args - * @returns {Array} Returns the Kronecker product of x and y - * @private - */ - function _kron(a, b) { - let d = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; - if (d < 0) { - let adim = (0, _array.arraySize)(a).length; - let bdim = (0, _array.arraySize)(b).length; - d = Math.max(adim, bdim); - while (adim++ < d) a = [a]; - while (bdim++ < d) b = [b]; - } - if (d === 1) return _kron1d(a, b); - return a.flatMap(aSlice => b.map(bSlice => _kron(aSlice, bSlice, d - 1))); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/map.js b/node_modules/mathjs/lib/cjs/function/matrix/map.js deleted file mode 100644 index 270dbde..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/map.js +++ /dev/null @@ -1,232 +0,0 @@ -"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) - * - * History: - * - * v0.13 Created - * v1.1 Clone the indices on each callback in case callback mutates - * v13.1 Support multiple inputs to the callback - * - * 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 sizes = Arrays.map(M => M.isMatrix ? M.size() : (0, _array.arraySize)(M)); - const newSize = (0, _array.broadcastSizes)(...sizes); - const numberOfArrays = Arrays.length; - const _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : _array.get; - const firstValues = Arrays.map((collection, i) => { - const firstIndex = sizes[i].map(() => 0); - return collection.isMatrix ? collection.get(firstIndex) : (0, _array.get)(collection, firstIndex); - }); - const callbackArgCount = typed.isTypedFunction(multiCallback) ? _getTypedCallbackArgCount(multiCallback, firstValues, newSize.map(() => 0), Arrays) : _getCallbackArgCount(multiCallback, numberOfArrays); - if (callbackArgCount < 2) { - const callback = _getLimitedCallback(callbackArgCount, multiCallback, null); - return mapMultiple(Arrays, callback); - } - 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)); - const callback = _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays); - 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 mapMultiple(collections, callback) { - // collections can be matrices or arrays - // callback must be a function of the form (collections, [index]) - const firstCollection = collections[0]; - const arrays = collections.map(collection => collection.isMatrix ? collection.valueOf() : collection); - const sizes = collections.map(collection => collection.isMatrix ? collection.size() : (0, _array.arraySize)(collection)); - const finalSize = (0, _array.broadcastSizes)(...sizes); - // the offset means for each initial array, how much smaller is it than the final size - const offsets = sizes.map(size => finalSize.length - size.length); - const maxDepth = finalSize.length - 1; - const callbackUsesIndex = callback.length > 1; - const index = callbackUsesIndex ? [] : null; - const resultsArray = iterate(arrays, 0); - if (firstCollection.isMatrix) { - const resultsMatrix = firstCollection.create(); - resultsMatrix._data = resultsArray; - resultsMatrix._size = finalSize; - return resultsMatrix; - } else { - return resultsArray; - } - function iterate(arrays) { - let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - // each array can have different sizes - const currentDimensionSize = finalSize[depth]; - const result = Array(currentDimensionSize); - if (depth < maxDepth) { - for (let i = 0; i < currentDimensionSize; i++) { - if (index) index[depth] = i; - // if there is an offset greater than the current dimension - // pass the array, if the size of the array is 1 pass the first - // element of the array - result[i] = iterate(arrays.map((array, arrayIndex) => offsets[arrayIndex] > depth ? array : array.length === 1 ? array[0] : array[i]), depth + 1); - } - } else { - for (let i = 0; i < currentDimensionSize; i++) { - if (index) index[depth] = i; - result[i] = callback(arrays.map(a => a.length === 1 ? a[0] : a[i]), index ? index.slice() : undefined); - } - } - return result; - } - } - - /** - * Creates a limited callback based on the argument pattern. - * @param {number} callbackArgCount - The argument pattern (0, 1, or 2) - * @param {Function} multiCallback - The original callback function - * @param {Array} broadcastedArrays - The broadcasted arrays (for case 2) - * @returns {Function} The limited callback function - */ - function _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays) { - switch (callbackArgCount) { - case 0: - return x => multiCallback(...x); - case 1: - return (x, idx) => multiCallback(...x, idx); - case 2: - return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays); - } - } - - /** - * Determines the argument pattern of a regular callback function. - * @param {Function} callback - The callback function to analyze - * @param {number} numberOfArrays - Number of arrays being processed - * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays - */ - function _getCallbackArgCount(callback, numberOfArrays) { - const callbackStr = callback.toString(); - // Check if the callback function uses `arguments` - if (/arguments/.test(callbackStr)) return 2; - - // Extract the parameters of the callback function - const paramsStr = callbackStr.match(/\(.*?\)/); - // Check if the callback function uses rest parameters - if (/\.\.\./.test(paramsStr)) return 2; - if (callback.length > numberOfArrays + 1) { - return 2; - } - if (callback.length === numberOfArrays + 1) { - return 1; - } - return 0; - } - - /** - * Determines the argument pattern of a typed callback function. - * @param {Function} callback - The typed callback function to analyze - * @param {Array} values - Sample values for signature resolution - * @param {Array} idx - Sample index for signature resolution - * @param {Array} arrays - Sample arrays for signature resolution - * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays - */ - - function _getTypedCallbackArgCount(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) { - const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, array, name); - return (0, _array.deepMap)(array, fastCallback.fn, fastCallback.isUnary); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/mapSlices.js b/node_modules/mathjs/lib/cjs/function/matrix/mapSlices.js deleted file mode 100644 index bac5af6..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/mapSlices.js +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createMapSlices = 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 = 'mapSlices'; -const dependencies = ['typed', 'isInteger']; -const createMapSlices = exports.createMapSlices = /* #__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.mapSlices(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.mapSlices(A, 0, sum) // returns [4, 6] - * math.mapSlices(A, 1, sum) // returns [3, 7] - * - * See also: - * - * map, filter, forEach - * - * Note: - * - * `mapSlices()` is also currently available via its deprecated - * synonym `apply()`. - * - * @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 mapped on the slices 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(_mapSlices(mat.valueOf(), dim, callback), mat.datatype()); - } else { - return _mapSlices(mat, dim, callback); - } - } - }); -}, { - formerly: 'apply' -}); - -/** - * Recursively reduce a matrix - * @param {Array} mat - * @param {number} dim - * @param {Function} callback - * @returns {Array} ret - * @private - */ -function _mapSlices(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] = _mapSlices(tran[i], dim - 1, callback); - } - return ret; - } - } else { - ret = []; - for (i = 0; i < mat.length; i++) { - ret[i] = _mapSlices(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/node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js b/node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js deleted file mode 100644 index f0fad5d..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/matrixFromColumns.js +++ /dev/null @@ -1,94 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js b/node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js deleted file mode 100644 index 7ed6d95..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/matrixFromFunction.js +++ /dev/null @@ -1,113 +0,0 @@ -"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) - * - * Where: - * - * - `size: (number[] | Matrix)` - * A vector giving the extent of the array to be created in each - * dimension. If size has one entry, a vector is created; if it - * has two, a rectangular array/Matrix is created; if three, a - * three-dimensional array/Matrix is created; and so on. - * - `fn: (index: number[]) => MathType` - * The callback function that will generate the entries of the - * matrix. It is called in turn with the index of each entry of - * the matrix. The index is always an ordinary array of numbers - * with the same length as _size_. So for vectors, you will get - * indices like `[0]` or `[1]`, whereas for matrices, you will - * get indices like `[2, 0]` or `[1,3]`. The return value may - * be any type that can go in an array or Matrix entry, although - * if you supply the _datatype_ argument, you must yourself ensure - * the type of the return value matches. Note that currently, - * your callback _fn_ will receive 0-based indices for the matrix - * entries, regardless of whether matrixFromFunction is invoked - * directly from JavaScript or via the mathjs expression language. - * - `format: 'dense'|'sparse'` - * Specifies the storage format for the resulting Matrix. Note that - * if this argument is given, the return value will always be a - * Matrix (rather than possibly an Array). - * - `datatype: string` - * Specifies the data type of entries of the new matrix. If given, - * it should be the name of a data type that mathjs supports, as - * returned by the math.typeOf function. It is up to the caller - * to make certain that all values returned by _fn_ are consistent - * with this datatype if specified. - * - * 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, typeOf, 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/node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js b/node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js deleted file mode 100644 index 1b606ea..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/matrixFromRows.js +++ /dev/null @@ -1,82 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/ones.js b/node_modules/mathjs/lib/cjs/function/matrix/ones.js deleted file mode 100644 index 05298dd..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/ones.js +++ /dev/null @@ -1,129 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js b/node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js deleted file mode 100644 index fddc52b..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/partitionSelect.js +++ /dev/null @@ -1,149 +0,0 @@ -"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: mathIsNaN, - 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]) && mathIsNaN(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/node_modules/mathjs/lib/cjs/function/matrix/pinv.js b/node_modules/mathjs/lib/cjs/function/matrix/pinv.js deleted file mode 100644 index 6b03499..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/pinv.js +++ /dev/null @@ -1,185 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/range.js b/node_modules/mathjs/lib/cjs/function/matrix/range.js deleted file mode 100644 index 558fe15..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/range.js +++ /dev/null @@ -1,241 +0,0 @@ -"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', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive']; -const createRange = exports.createRange = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - matrix, - bignumber, - smaller, - smallerEq, - larger, - largerEq, - add, - isZero, - isPositive - } = _ref; - /** - * Create a matrix or array containing a range of values. - * 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 | bigint | BigNumber | Fraction | Unit}` - * Start of the range - * - `end: number | bigint | BigNumber | Fraction | Unit` - * End of the range, excluded by default, included when parameter includeEnd=true - * - `step: number | bigint | BigNumber | Fraction | Unit` - * Step size. Default value is 1. - * - `includeEnd: boolean` - * Option to specify whether to include the end or not. False by default. - * - * The function returns a `DenseMatrix` when the library is configured with - * `config = { matrix: 'Matrix' }, and returns an Array otherwise. - * Note that the type of the returned values is taken from the type of the - * provided start/end value. If only one of these is a built-in `number` type, - * it will be promoted to the type of the other endpoint. However, in the case - * of Unit values, both endpoints must have compatible units, and the return - * value will have compatible units as well. - * - * 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(2, math.fraction(8,3), math.fraction(1,3)) // [fraction(2), fraction(7,3)] - * 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 range's `start`, `end`, and optional `step`. - * @return {Array | Matrix} range - */ - return typed(name, { - // TODO: simplify signatures when typed-function supports default values and optional arguments - - string: _strRange, - 'string, boolean': _strRange, - number: function (oops) { - throw new TypeError(`Too few arguments to function range(): ${oops}`); - }, - boolean: function (oops) { - throw new TypeError(`Unexpected type of argument 1 to function range(): ${oops}, number|bigint|BigNumber|Fraction`); - }, - '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)); - }, - // Handle bigints; if either limit is bigint, range should be too - 'bigint, bigint|number': function (start, end) { - return _out(_range(start, end, 1n, false)); - }, - 'number, bigint': function (start, end) { - return _out(_range(BigInt(start), end, 1n, false)); - }, - 'bigint, bigint|number, bigint|number': function (start, end, step) { - return _out(_range(start, end, BigInt(step), false)); - }, - 'number, bigint, bigint|number': function (start, end, step) { - return _out(_range(BigInt(start), end, BigInt(step), false)); - }, - 'bigint, bigint|number, boolean': function (start, end, includeEnd) { - return _out(_range(start, end, 1n, includeEnd)); - }, - 'number, bigint, boolean': function (start, end, includeEnd) { - return _out(_range(BigInt(start), end, 1n, includeEnd)); - }, - 'bigint, bigint|number, bigint|number, boolean': function (start, end, step, includeEnd) { - return _out(_range(start, end, BigInt(step), includeEnd)); - }, - 'number, bigint, bigint|number, boolean': function (start, end, step, includeEnd) { - return _out(_range(BigInt(start), end, BigInt(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)); - }, - 'Fraction, Fraction': function (start, end) { - return _out(_range(start, end, 1, false)); - }, - 'Fraction, Fraction, Fraction': function (start, end, step) { - return _out(_range(start, end, step, false)); - }, - 'Fraction, Fraction, boolean': function (start, end, includeEnd) { - return _out(_range(start, end, 1, includeEnd)); - }, - 'Fraction, Fraction, Fraction, 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 = []; - if (isZero(step)) throw new Error('Step must be non-zero'); - 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/node_modules/mathjs/lib/cjs/function/matrix/reshape.js b/node_modules/mathjs/lib/cjs/function/matrix/reshape.js deleted file mode 100644 index d8cd4e3..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/reshape.js +++ /dev/null @@ -1,69 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/resize.js b/node_modules/mathjs/lib/cjs/function/matrix/resize.js deleted file mode 100644 index 6b54e85..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/resize.js +++ /dev/null @@ -1,126 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/rotate.js b/node_modules/mathjs/lib/cjs/function/matrix/rotate.js deleted file mode 100644 index 5a65c61..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/rotate.js +++ /dev/null @@ -1,77 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js b/node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js deleted file mode 100644 index 3129f42..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/rotationMatrix.js +++ /dev/null @@ -1,166 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/row.js b/node_modules/mathjs/lib/cjs/function/matrix/row.js deleted file mode 100644 index f4e7b76..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/row.js +++ /dev/null @@ -1,66 +0,0 @@ -"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); - // once config.legacySubset just return result - return (0, _is.isMatrix)(result) ? result : matrix([[result]]); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/size.js b/node_modules/mathjs/lib/cjs/function/matrix/size.js deleted file mode 100644 index 36e8bda..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/size.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createSize = void 0; -var _array = require("../../utils/array.js"); -var _factory = require("../../utils/factory.js"); -const name = 'size'; -const dependencies = ['typed']; -const createSize = exports.createSize = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed - } = _ref; - /** - * Calculate the size of a matrix or scalar. Always returns an Array containing numbers. - * - * Note that in mathjs v14 and older, function size could return a Matrix depending on - * the input type and configuration. - * - * 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} A vector with size of `x`. - */ - return typed(name, { - Matrix: x => x.size(), - Array: _array.arraySize, - string: x => [x.length], - // scalar - 'number | Complex | BigNumber | Unit | boolean | null': _x => [] - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/matrix/sort.js b/node_modules/mathjs/lib/cjs/function/matrix/sort.js deleted file mode 100644 index 6be9626..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/sort.js +++ /dev/null @@ -1,119 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js b/node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js deleted file mode 100644 index 3c8f271..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/sqrtm.js +++ /dev/null @@ -1,105 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/squeeze.js b/node_modules/mathjs/lib/cjs/function/matrix/squeeze.js deleted file mode 100644 index 78ba0f9..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/squeeze.js +++ /dev/null @@ -1,59 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/subset.js b/node_modules/mathjs/lib/cjs/function/matrix/subset.js deleted file mode 100644 index 1434289..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/subset.js +++ /dev/null @@ -1,289 +0,0 @@ -"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 = ''; - function callback(v) { - substr += str.charAt(v); - } - if (Number.isInteger(range)) { - callback(range); - } else { - range.forEach(callback); - } - 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 = Number.isInteger(range) ? 1 : 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); - } - function callback(v, i) { - chars[v] = replacement.charAt(i[0]); - } - if (Number.isInteger(range)) { - callback(range, [0]); - } else { - range.forEach(callback); - } - - // 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/node_modules/mathjs/lib/cjs/function/matrix/trace.js b/node_modules/mathjs/lib/cjs/function/matrix/trace.js deleted file mode 100644 index d947434..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/trace.js +++ /dev/null @@ -1,134 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/transpose.js b/node_modules/mathjs/lib/cjs/function/matrix/transpose.js deleted file mode 100644 index f7e158d..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/transpose.js +++ /dev/null @@ -1,166 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/matrix/zeros.js b/node_modules/mathjs/lib/cjs/function/matrix/zeros.js deleted file mode 100644 index 0d072a9..0000000 --- a/node_modules/mathjs/lib/cjs/function/matrix/zeros.js +++ /dev/null @@ -1,129 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/numeric/solveODE.js b/node_modules/mathjs/lib/cjs/function/numeric/solveODE.js deleted file mode 100644 index f55aaad..0000000 --- a/node_modules/mathjs/lib/cjs/function/numeric/solveODE.js +++ /dev/null @@ -1,289 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/bernoulli.js b/node_modules/mathjs/lib/cjs/function/probability/bernoulli.js deleted file mode 100644 index 6293db7..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/bernoulli.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createBernoulli = void 0; -var _factory = require("../../utils/factory.js"); -var _number = require("../../utils/number.js"); -const name = 'bernoulli'; -const dependencies = ['typed', 'config', 'isInteger', 'number', '?BigNumber', '?Fraction']; -const createBernoulli = exports.createBernoulli = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - number, - BigNumber, - Fraction - } = _ref; - /** - * Return the `n`th Bernoulli number, for positive integers `n` - * - * Syntax: - * - * math.bernoulli(n) - * - * Examples: - * - * math.bernoulli(1) // returns -0.5 - * // All other odd Bernoulli numbers are 0: - * math.bernoulli(7) // returns 0 - * math.bernoulli(math.bignumber(6)) // value bignumber(1).div(42) - * // Produces exact rationals for bigint or fraction input: - * math.bernoulli(8n) // Fraction -1,30 - * math.bernoulli(math.fraction(10)) // Fraction 5,66 - * - * See also: - * - * combinations, gamma, stirlingS2 - * - * @param {number | BigNumber | bigint | Fraction} n - * Index of the Bernoulli number - * @return {number | BigNumber | Fraction} - * nth Bernoulli number, of a type corresponding to the argument n - */ - - const numberCache = [undefined]; - const fractionCache = [undefined]; - let bigCache = [undefined]; - let cachedPrecision = 50; - return typed(name, { - number: index => _bernoulli(index, n => n, numberCache, (a, b) => a + b, (a, b) => a * b, (a, b) => a / b), - 'bigint | Fraction': index => _bernoulli(number(index), n => new Fraction(n), fractionCache, (a, b) => a.add(b), (a, b) => a.mul(b), (a, b) => a.div(b)), - BigNumber: index => { - if (config.precision !== cachedPrecision) { - bigCache = [undefined]; - cachedPrecision = config.precision; - } - return _bernoulli(number(index), n => new BigNumber(n), bigCache, (a, b) => a.add(b), (a, b) => a.mul(b), (a, b) => a.div(b)); - } - }); -}); - -/** - * Underlying implementation, with all operations passed in. - * Parameters: - * 1. index: a (positive integer) number specifying which Bernoulli number - * to compute. - * 2. promote: a function that takes an integer number and returns - * the desired type for the Bernoulli number values. - * 3. A: a cache array of partial computation data that _bernoulli should use. - * Different cache arrays should be provided for different types. - * 4. plus: a function that adds two values of the desired type. - * 5. times: a function that multiplies two values of the desired type. - * 6. divide: a function that divides one value of the desired type by another. - */ -function _bernoulli(index, promote, A, plus, times, divide) { - if (index < 0 || !(0, _number.isInteger)(index)) { - throw new RangeError('Bernoulli index must be nonnegative integer'); - } - if (index === 0) return promote(1); - if (index === 1) return divide(promote(-1), promote(2)); - if (index % 2 === 1) return promote(0); - // We proceed as in https://math.stackexchange.com/a/2844337 - // (by no means the most efficient, but very simple to implement) - // A cache entry consists of a triple - // [cotangent coefficient a_n, prefactor, Bernouilli number B_2n] - const one = promote(1); - if (A.length === 1) { - A.push([divide(one, promote(-3)), divide(one, promote(-2)), divide(one, promote(6))]); - } - const half = index / 2; - const zero = promote(0); - const two = promote(2); - while (A.length <= half) { - const i = A.length; // next cotangent coefficient to compute - const lim = Math.floor((i + 1) / 2); - let a = zero; - for (let m = 1; m < lim; ++m) { - a = plus(a, times(A[m][0], A[i - m][0])); - } - a = times(a, two); - if (i % 2 === 0) a = plus(a, times(A[lim][0], A[lim][0])); - a = divide(a, promote(-(2 * i + 1))); - const prefactor = divide(times(A[i - 1][1], promote(-i * (2 * i - 1))), two); - A.push([a, prefactor, times(prefactor, a)]); - } - return A[half][2]; -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/probability/combinations.js b/node_modules/mathjs/lib/cjs/function/probability/combinations.js deleted file mode 100644 index bab7bcc..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/combinations.js +++ /dev/null @@ -1,75 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js b/node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js deleted file mode 100644 index 1890792..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/combinationsWithRep.js +++ /dev/null @@ -1,90 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/factorial.js b/node_modules/mathjs/lib/cjs/function/probability/factorial.js deleted file mode 100644 index 2932e26..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/factorial.js +++ /dev/null @@ -1,53 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/gamma.js b/node_modules/mathjs/lib/cjs/function/probability/gamma.js deleted file mode 100644 index d9494a6..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/gamma.js +++ /dev/null @@ -1,126 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/kldivergence.js b/node_modules/mathjs/lib/cjs/function/probability/kldivergence.js deleted file mode 100644 index 41cf6d6..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/kldivergence.js +++ /dev/null @@ -1,83 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/lgamma.js b/node_modules/mathjs/lib/cjs/function/probability/lgamma.js deleted file mode 100644 index b0664a1..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/lgamma.js +++ /dev/null @@ -1,143 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/multinomial.js b/node_modules/mathjs/lib/cjs/function/probability/multinomial.js deleted file mode 100644 index 6ef829b..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/multinomial.js +++ /dev/null @@ -1,56 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/permutations.js b/node_modules/mathjs/lib/cjs/function/probability/permutations.js deleted file mode 100644 index f1694dc..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/permutations.js +++ /dev/null @@ -1,84 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/pickRandom.js b/node_modules/mathjs/lib/cjs/function/probability/pickRandom.js deleted file mode 100644 index 2607481..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/pickRandom.js +++ /dev/null @@ -1,156 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/random.js b/node_modules/mathjs/lib/cjs/function/probability/random.js deleted file mode 100644 index e1824a1..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/random.js +++ /dev/null @@ -1,102 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/randomInt.js b/node_modules/mathjs/lib/cjs/function/probability/randomInt.js deleted file mode 100644 index 73feebd..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/randomInt.js +++ /dev/null @@ -1,96 +0,0 @@ -"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', 'log2', '?on']; -const createRandomInt = exports.createRandomInt = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - log2, - 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 either 0 or 1, randomly - * 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, 2), - number: max => _randomInt(0, max), - 'number, number': (min, max) => _randomInt(min, max), - bigint: max => _randomBigint(0n, max), - 'bigint, bigint': _randomBigint, - '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)); - } - function _randomBigint(min, max) { - const simpleCutoff = 2n ** 30n; - const width = max - min; // number of choices - if (width <= simpleCutoff) { - // do it with number type - return min + BigInt(_randomInt(0, Number(width))); - } - // Too big to choose accurately that way. Instead, choose the correct - // number of random bits to cover the width, and repeat until the - // resulting number falls within the width - const bits = log2(width); - let picked = width; - while (picked >= width) { - picked = 0n; - for (let i = 0; i < bits; ++i) { - picked = 2n * picked + (rng() < 0.5 ? 0n : 1n); - } - } - return min + picked; - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js b/node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js deleted file mode 100644 index 76ee766..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/util/randomMatrix.js +++ /dev/null @@ -1,26 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js b/node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js deleted file mode 100644 index 2d6889d..0000000 --- a/node_modules/mathjs/lib/cjs/function/probability/util/seededRNG.js +++ /dev/null @@ -1,26 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/relational/compare.js b/node_modules/mathjs/lib/cjs/function/relational/compare.js deleted file mode 100644 index 5630a41..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/compare.js +++ /dev/null @@ -1,126 +0,0 @@ -"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 - * - * History: - * - * v0.19 Created - * v4 Changed to compare strings by numerical value - * v13 Change to use separate relative and absolute tolerances - * - * @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/node_modules/mathjs/lib/cjs/function/relational/compareNatural.js b/node_modules/mathjs/lib/cjs/function/relational/compareNatural.js deleted file mode 100644 index e1d2075..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/compareNatural.js +++ /dev/null @@ -1,287 +0,0 @@ -"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 - * - * History: - * - * v15.2 Handle bigints - * v3.14 Created - * - * - * @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' || typeX === 'bigint') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction' || typeY === 'bigint')) { - 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/node_modules/mathjs/lib/cjs/function/relational/compareText.js b/node_modules/mathjs/lib/cjs/function/relational/compareText.js deleted file mode 100644 index 588df7e..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/compareText.js +++ /dev/null @@ -1,63 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/relational/compareUnits.js b/node_modules/mathjs/lib/cjs/function/relational/compareUnits.js deleted file mode 100644 index e9d8d57..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/compareUnits.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/relational/deepEqual.js b/node_modules/mathjs/lib/cjs/function/relational/deepEqual.js deleted file mode 100644 index 983372c..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/deepEqual.js +++ /dev/null @@ -1,85 +0,0 @@ -"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 - * - * const a = [2, 5, 1] - * const b = [2, 7, 1] - * - * math.deepEqual(a, b) // returns false... - * math.equal(a, b) // returns [true, false, true] - * - * See also: - * - * equal, unequal - * - * History: - * - * v2 Handle Fractions - * v0.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/relational/equal.js b/node_modules/mathjs/lib/cjs/function/relational/equal.js deleted file mode 100644 index 67985bb..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/equal.js +++ /dev/null @@ -1,129 +0,0 @@ -"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', 'SparseMatrix']; -const createEqual = exports.createEqual = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - matrix, - equalScalar, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - const matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ - typed, - DenseMatrix - }); - const matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ - typed, - matrix - }); - - /** - * 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 false - * - * const a = math.unit('500 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 - * - * History: - * - * v13 Handle bigints - * v11.6 Support matrix broadcasting - * v4 Compare strings by their numerical value - * v0.24 Handle `null` and `undefined` - * v0.23 Compare collections elementwise - * v0.20 Compare floating-point numbers within epsilon, allowing roundoff - * v0.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/relational/equalScalar.js b/node_modules/mathjs/lib/cjs/function/relational/equalScalar.js deleted file mode 100644 index 134f0ee..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/equalScalar.js +++ /dev/null @@ -1,62 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/relational/equalText.js b/node_modules/mathjs/lib/cjs/function/relational/equalText.js deleted file mode 100644 index c7a65d8..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/equalText.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/relational/larger.js b/node_modules/mathjs/lib/cjs/function/relational/larger.js deleted file mode 100644 index 6af9c2e..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/larger.js +++ /dev/null @@ -1,114 +0,0 @@ -"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', 'bignumber', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix']; -const createLarger = exports.createLarger = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - bignumber, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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 - */ - function bignumLarger(x, y) { - return x.gt(y) && !(0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); - } - return typed(name, createLargerNumber({ - typed, - config - }), { - 'boolean, boolean': (x, y) => x > y, - 'BigNumber, BigNumber': bignumLarger, - 'bigint, bigint': (x, y) => x > y, - 'Fraction, Fraction': (x, y) => x.compare(y) === 1, - 'Fraction, BigNumber': function (x, y) { - return bignumLarger(bignumber(x), y); - }, - 'BigNumber, Fraction': function (x, y) { - return bignumLarger(x, bignumber(y)); - }, - '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/node_modules/mathjs/lib/cjs/function/relational/largerEq.js b/node_modules/mathjs/lib/cjs/function/relational/largerEq.js deleted file mode 100644 index 40c021b..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/largerEq.js +++ /dev/null @@ -1,104 +0,0 @@ -"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', 'SparseMatrix']; -const createLargerEq = exports.createLargerEq = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/cjs/function/relational/smaller.js b/node_modules/mathjs/lib/cjs/function/relational/smaller.js deleted file mode 100644 index 569cfe5..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/smaller.js +++ /dev/null @@ -1,114 +0,0 @@ -"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', 'bignumber', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix']; -const createSmaller = exports.createSmaller = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - bignumber, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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 - */ - function bignumSmaller(x, y) { - return x.lt(y) && !(0, _nearlyEqual.nearlyEqual)(x, y, config.relTol, config.absTol); - } - return typed(name, createSmallerNumber({ - typed, - config - }), { - 'boolean, boolean': (x, y) => x < y, - 'BigNumber, BigNumber': bignumSmaller, - 'bigint, bigint': (x, y) => x < y, - 'Fraction, Fraction': (x, y) => x.compare(y) === -1, - 'Fraction, BigNumber': function (x, y) { - return bignumSmaller(bignumber(x), y); - }, - 'BigNumber, Fraction': function (x, y) { - return bignumSmaller(x, bignumber(y)); - }, - '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/node_modules/mathjs/lib/cjs/function/relational/smallerEq.js b/node_modules/mathjs/lib/cjs/function/relational/smallerEq.js deleted file mode 100644 index eb2a32b..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/smallerEq.js +++ /dev/null @@ -1,102 +0,0 @@ -"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', 'SparseMatrix']; -const createSmallerEq = exports.createSmallerEq = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/cjs/function/relational/unequal.js b/node_modules/mathjs/lib/cjs/function/relational/unequal.js deleted file mode 100644 index 2517370..0000000 --- a/node_modules/mathjs/lib/cjs/function/relational/unequal.js +++ /dev/null @@ -1,132 +0,0 @@ -"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', 'SparseMatrix']; -const createUnequal = exports.createUnequal = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - equalScalar, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - const matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ - typed - }); - const matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ - typed, - SparseMatrix - }); - 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 true - * - * const a = math.unit('500 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 - * - * History: - * - * v13 Handle bigints - * v11.6 Support matrix broadcasting - * v4 Compare strings by their numeric values - * v0.24 Handle `null` and `undefined` - * v0.2 Created - * - * @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/node_modules/mathjs/lib/cjs/function/set/setCartesian.js b/node_modules/mathjs/lib/cjs/function/set/setCartesian.js deleted file mode 100644 index 665cfb9..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setCartesian.js +++ /dev/null @@ -1,64 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setDifference.js b/node_modules/mathjs/lib/cjs/function/set/setDifference.js deleted file mode 100644 index e6c609b..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setDifference.js +++ /dev/null @@ -1,77 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setDistinct.js b/node_modules/mathjs/lib/cjs/function/set/setDistinct.js deleted file mode 100644 index 97cc278..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setDistinct.js +++ /dev/null @@ -1,64 +0,0 @@ -"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. - * The items of the returned array will be sorted in natural order. - * - * 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 distinct 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/node_modules/mathjs/lib/cjs/function/set/setIntersect.js b/node_modules/mathjs/lib/cjs/function/set/setIntersect.js deleted file mode 100644 index d85c5ab..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setIntersect.js +++ /dev/null @@ -1,69 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setIsSubset.js b/node_modules/mathjs/lib/cjs/function/set/setIsSubset.js deleted file mode 100644 index b5f9a78..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setIsSubset.js +++ /dev/null @@ -1,68 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js b/node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js deleted file mode 100644 index 34cb1b6..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setMultiplicity.js +++ /dev/null @@ -1,56 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setPowerset.js b/node_modules/mathjs/lib/cjs/function/set/setPowerset.js deleted file mode 100644 index 9edb068..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setPowerset.js +++ /dev/null @@ -1,81 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setSize.js b/node_modules/mathjs/lib/cjs/function/set/setSize.js deleted file mode 100644 index a650f69..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setSize.js +++ /dev/null @@ -1,57 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setSymDifference.js b/node_modules/mathjs/lib/cjs/function/set/setSymDifference.js deleted file mode 100644 index 5f2e994..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setSymDifference.js +++ /dev/null @@ -1,54 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/set/setUnion.js b/node_modules/mathjs/lib/cjs/function/set/setUnion.js deleted file mode 100644 index e573f57..0000000 --- a/node_modules/mathjs/lib/cjs/function/set/setUnion.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/signal/freqz.js b/node_modules/mathjs/lib/cjs/function/signal/freqz.js deleted file mode 100644 index ac8412b..0000000 --- a/node_modules/mathjs/lib/cjs/function/signal/freqz.js +++ /dev/null @@ -1,121 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/signal/zpk2tf.js b/node_modules/mathjs/lib/cjs/function/signal/zpk2tf.js deleted file mode 100644 index 2c0ab88..0000000 --- a/node_modules/mathjs/lib/cjs/function/signal/zpk2tf.js +++ /dev/null @@ -1,88 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/special/erf.js b/node_modules/mathjs/lib/cjs/function/special/erf.js deleted file mode 100644 index ae57167..0000000 --- a/node_modules/mathjs/lib/cjs/function/special/erf.js +++ /dev/null @@ -1,161 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/special/zeta.js b/node_modules/mathjs/lib/cjs/function/special/zeta.js deleted file mode 100644 index 71e5d59..0000000 --- a/node_modules/mathjs/lib/cjs/function/special/zeta.js +++ /dev/null @@ -1,155 +0,0 @@ -"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', 'isBounded', '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, - isBounded, - 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 (!isBounded(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/node_modules/mathjs/lib/cjs/function/statistics/corr.js b/node_modules/mathjs/lib/cjs/function/statistics/corr.js deleted file mode 100644 index aecef66..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/corr.js +++ /dev/null @@ -1,90 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/cumsum.js b/node_modules/mathjs/lib/cjs/function/statistics/cumsum.js deleted file mode 100644 index 70151d5..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/cumsum.js +++ /dev/null @@ -1,129 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/mad.js b/node_modules/mathjs/lib/cjs/function/statistics/mad.js deleted file mode 100644 index 2a7e1b7..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/mad.js +++ /dev/null @@ -1,70 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/max.js b/node_modules/mathjs/lib/cjs/function/statistics/max.js deleted file mode 100644 index ed0d1a8..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/max.js +++ /dev/null @@ -1,112 +0,0 @@ -"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', 'isNaN']; -const createMax = exports.createMax = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - numeric, - larger, - isNaN: mathIsNaN - } = _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 (mathIsNaN(value)) { - res = value; - } 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/node_modules/mathjs/lib/cjs/function/statistics/mean.js b/node_modules/mathjs/lib/cjs/function/statistics/mean.js deleted file mode 100644 index 3bc247f..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/mean.js +++ /dev/null @@ -1,100 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/median.js b/node_modules/mathjs/lib/cjs/function/statistics/median.js deleted file mode 100644 index 6110dd5..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/median.js +++ /dev/null @@ -1,114 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/min.js b/node_modules/mathjs/lib/cjs/function/statistics/min.js deleted file mode 100644 index 30c9c60..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/min.js +++ /dev/null @@ -1,112 +0,0 @@ -"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', 'isNaN']; -const createMin = exports.createMin = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - config, - numeric, - smaller, - isNaN: mathIsNaN - } = _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 (mathIsNaN(value)) { - min = value; - } 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/node_modules/mathjs/lib/cjs/function/statistics/mode.js b/node_modules/mathjs/lib/cjs/function/statistics/mode.js deleted file mode 100644 index e234e1d..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/mode.js +++ /dev/null @@ -1,82 +0,0 @@ -"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: mathIsNaN, - 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) && mathIsNaN(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/node_modules/mathjs/lib/cjs/function/statistics/prod.js b/node_modules/mathjs/lib/cjs/function/statistics/prod.js deleted file mode 100644 index 4506444..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/prod.js +++ /dev/null @@ -1,85 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js b/node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js deleted file mode 100644 index fce9b25..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/quantileSeq.js +++ /dev/null @@ -1,167 +0,0 @@ -"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"); -const name = 'quantileSeq'; -const dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger', 'mapSlices']; -const createQuantileSeq = exports.createQuantileSeq = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - bignumber, - add, - subtract, - divide, - multiply, - partitionSelect, - compare, - isInteger, - smaller, - smallerEq, - larger, - mapSlices - } = _ref; - /** - * 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 mapSlices(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/node_modules/mathjs/lib/cjs/function/statistics/std.js b/node_modules/mathjs/lib/cjs/function/statistics/std.js deleted file mode 100644 index 9cc1bba..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/std.js +++ /dev/null @@ -1,103 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/sum.js b/node_modules/mathjs/lib/cjs/function/statistics/sum.js deleted file mode 100644 index 533593d..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/sum.js +++ /dev/null @@ -1,91 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js b/node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js deleted file mode 100644 index e411eb8..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/utils/improveErrorMessage.js +++ /dev/null @@ -1,30 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/statistics/variance.js b/node_modules/mathjs/lib/cjs/function/statistics/variance.js deleted file mode 100644 index ee1e3e1..0000000 --- a/node_modules/mathjs/lib/cjs/function/statistics/variance.js +++ /dev/null @@ -1,159 +0,0 @@ -"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', 'mapSlices', 'isNaN']; -const createVariance = exports.createVariance = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - add, - subtract, - multiply, - divide, - mapSlices, - isNaN: mathIsNaN - } = _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 (mathIsNaN(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 mapSlices(array, dim, x => _var(x, normalization)); - } catch (err) { - throw (0, _improveErrorMessage.improveErrorMessage)(err, 'variance'); - } - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/string/bin.js b/node_modules/mathjs/lib/cjs/function/string/bin.js deleted file mode 100644 index 15fb683..0000000 --- a/node_modules/mathjs/lib/cjs/function/string/bin.js +++ /dev/null @@ -1,50 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/string/format.js b/node_modules/mathjs/lib/cjs/function/string/format.js deleted file mode 100644 index 87c4dc2..0000000 --- a/node_modules/mathjs/lib/cjs/function/string/format.js +++ /dev/null @@ -1,146 +0,0 @@ -"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 - * - * History: - * - * v0.4 Created - * v0.7 Round to a consistent number of digits (rather than decimals) - * v0.15 Added multiple number notations and configurable precision - * v3 Added support for JSON objects - * v9 Added binary, hexadecimal, and octal notations - * v10.4.2 Add `truncate` option - * - * @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/node_modules/mathjs/lib/cjs/function/string/hex.js b/node_modules/mathjs/lib/cjs/function/string/hex.js deleted file mode 100644 index 8f00345..0000000 --- a/node_modules/mathjs/lib/cjs/function/string/hex.js +++ /dev/null @@ -1,49 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/string/oct.js b/node_modules/mathjs/lib/cjs/function/string/oct.js deleted file mode 100644 index 1330914..0000000 --- a/node_modules/mathjs/lib/cjs/function/string/oct.js +++ /dev/null @@ -1,51 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/string/print.js b/node_modules/mathjs/lib/cjs/function/string/print.js deleted file mode 100644 index 338863d..0000000 --- a/node_modules/mathjs/lib/cjs/function/string/print.js +++ /dev/null @@ -1,96 +0,0 @@ -"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: '2013-03-23' - * }) - * - * // 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/node_modules/mathjs/lib/cjs/function/trigonometry/acos.js b/node_modules/mathjs/lib/cjs/function/trigonometry/acos.js deleted file mode 100644 index 1d028c1..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/acos.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js b/node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js deleted file mode 100644 index 38a2212..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/acosh.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/acot.js b/node_modules/mathjs/lib/cjs/function/trigonometry/acot.js deleted file mode 100644 index 6557853..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/acot.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js b/node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js deleted file mode 100644 index 76eb637..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/acoth.js +++ /dev/null @@ -1,54 +0,0 @@ -"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.5493061443340548 - 1.5707963267948966i - * - * 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/node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js b/node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js deleted file mode 100644 index c2e0f49..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/acsc.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js b/node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js deleted file mode 100644 index e107e5d..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/acsch.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/asec.js b/node_modules/mathjs/lib/cjs/function/trigonometry/asec.js deleted file mode 100644 index 0c12783..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/asec.js +++ /dev/null @@ -1,56 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/asech.js b/node_modules/mathjs/lib/cjs/function/trigonometry/asech.js deleted file mode 100644 index de716ce..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/asech.js +++ /dev/null @@ -1,59 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/asin.js b/node_modules/mathjs/lib/cjs/function/trigonometry/asin.js deleted file mode 100644 index 0ad73c7..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/asin.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js b/node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js deleted file mode 100644 index e0df5cb..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/asinh.js +++ /dev/null @@ -1,46 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/atan.js b/node_modules/mathjs/lib/cjs/function/trigonometry/atan.js deleted file mode 100644 index d1ef90d..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/atan.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js b/node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js deleted file mode 100644 index 08ac2ac..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/atan2.js +++ /dev/null @@ -1,96 +0,0 @@ -"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') - * const x = math.cos(angle) - * const y = math.sin(angle) - * math.atan2(y, x) * 180 / math.pi // returns 60 - * - * 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/node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js b/node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js deleted file mode 100644 index 4f58486..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/atanh.js +++ /dev/null @@ -1,53 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/cos.js b/node_modules/mathjs/lib/cjs/function/trigonometry/cos.js deleted file mode 100644 index f6b525c..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/cos.js +++ /dev/null @@ -1,50 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js b/node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js deleted file mode 100644 index 1185bea..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/cosh.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/cot.js b/node_modules/mathjs/lib/cjs/function/trigonometry/cot.js deleted file mode 100644 index 3db5309..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/cot.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/coth.js b/node_modules/mathjs/lib/cjs/function/trigonometry/coth.js deleted file mode 100644 index 6471792..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/coth.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/csc.js b/node_modules/mathjs/lib/cjs/function/trigonometry/csc.js deleted file mode 100644 index 738de7f..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/csc.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/csch.js b/node_modules/mathjs/lib/cjs/function/trigonometry/csch.js deleted file mode 100644 index e538e34..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/csch.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/sec.js b/node_modules/mathjs/lib/cjs/function/trigonometry/sec.js deleted file mode 100644 index a6a4daa..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/sec.js +++ /dev/null @@ -1,48 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/sech.js b/node_modules/mathjs/lib/cjs/function/trigonometry/sech.js deleted file mode 100644 index 91d464a..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/sech.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/sin.js b/node_modules/mathjs/lib/cjs/function/trigonometry/sin.js deleted file mode 100644 index e8994af..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/sin.js +++ /dev/null @@ -1,50 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js b/node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js deleted file mode 100644 index 871d8f3..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/sinh.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/tan.js b/node_modules/mathjs/lib/cjs/function/trigonometry/tan.js deleted file mode 100644 index f9ae346..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/tan.js +++ /dev/null @@ -1,47 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js b/node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js deleted file mode 100644 index 02e32f6..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/tanh.js +++ /dev/null @@ -1,44 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/trigonometry/trigUnit.js b/node_modules/mathjs/lib/cjs/function/trigonometry/trigUnit.js deleted file mode 100644 index ae62dc5..0000000 --- a/node_modules/mathjs/lib/cjs/function/trigonometry/trigUnit.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/unit/to.js b/node_modules/mathjs/lib/cjs/function/unit/to.js deleted file mode 100644 index d660324..0000000 --- a/node_modules/mathjs/lib/cjs/function/unit/to.js +++ /dev/null @@ -1,52 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/unit/toBest.js b/node_modules/mathjs/lib/cjs/function/unit/toBest.js deleted file mode 100644 index 2b2cf9a..0000000 --- a/node_modules/mathjs/lib/cjs/function/unit/toBest.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createToBest = void 0; -var _factory = require("../../utils/factory.js"); -const name = 'toBest'; -const dependencies = ['typed']; -const createToBest = exports.createToBest = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed - } = _ref; - /** - * Converts a unit to the most appropriate display unit. - * When no preferred units are provided, the function automatically find the best prefix. - * When preferred units are provided, it converts to - * the unit that gives a value closest to 1. - * - * Syntax: - * - * math.toBest(unit) - * math.toBest(unit, unitList) - * math.toBest(unit, unitList, options) - * - * Where: - * - `unitList` is an optional array of preferred target units as string or Unit. - * - `options` is an optional object with options, formed as follows: - * - `offset`: number | BigNumber - * - * Examples: - * - * math.unit(0.05, 'm').toBest(['cm', 'mm']) // returns Unit 5 cm - * math.unit(2 / 3, 'cm').toBest() // returns Unit 0.6666666666666666 cm - * math.unit(10, 'm').toBest(['mm', 'km'], { offset: 1.5 }) // returns Unit 10000 mm - * - * See also: - * - * unit, to, format - * - * @param {Unit} x The unit to be converted - * @param {Array} [unitList=[]] Optional array of preferred target units - * @param {Object} [options] Optional options object - * @return {Unit} Value converted to the best matching unit - */ - return typed(name, { - Unit: x => x.toBest(), - 'Unit, string': (x, unitList) => x.toBest(unitList.split(',')), - 'Unit, string, Object': (x, unitList, options) => x.toBest(unitList.split(','), options), - 'Unit, Array': (x, unitList) => x.toBest(unitList), - 'Unit, Array, Object': (x, unitList, options) => x.toBest(unitList, options) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/utils/clone.js b/node_modules/mathjs/lib/cjs/function/utils/clone.js deleted file mode 100644 index 4bc2548..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/clone.js +++ /dev/null @@ -1,36 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js b/node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js deleted file mode 100644 index 223171a..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/hasNumericValue.js +++ /dev/null @@ -1,56 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/utils/isBounded.js b/node_modules/mathjs/lib/cjs/function/utils/isBounded.js deleted file mode 100644 index 90467a2..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isBounded.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createIsBounded = void 0; -var _factory = require("../../utils/factory.js"); -const name = 'isBounded'; -const dependencies = ['typed']; -const createIsBounded = exports.createIsBounded = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed - } = _ref; - /** - * Test whether a value is bounded. For scalars, this test is equivalent - * to the isFinite finiteness test. On the other hand, a Matrix or Array - * is defined to be bounded if every entry is finite. - * - * Syntax: - * - * math.isBounded(x) - * - * Examples: - * - * math.isBounded(0) // returns true - * math.isBounded(NaN) // returns false - * math.isBounded(math.bignumber(Infinity)) // returns false - * math.isBounded(math.fraction(1,3)) // returns true - * math.isBounded(math.complex('2 - 4i')) // returns true - * math.isBounded(-10000000000000000n) // returns true - * math.isBounded(undefined) // returns false - * math.isBounded(null) // returns false - * math.isBounded([0.001, -3n, 0]) // returns true - * math.isBounded([2, -Infinity, -3]) // returns false - * - * See also: - * - * isFinite, isNumeric, isPositive, isNegative, isNaN - * - * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested - * @return {boolean} Returns true when `x` is bounded. - */ - return typed(name, { - number: n => Number.isFinite(n), - 'BigNumber | Complex': x => x.isFinite(), - 'bigint | Fraction': () => true, - 'null | undefined': () => false, - Unit: typed.referToSelf(self => x => self(x.value)), - 'Array | Matrix': typed.referToSelf(self => A => { - if (!Array.isArray(A)) A = A.valueOf(); - return A.every(entry => self(entry)); - }) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/utils/isFinite.js b/node_modules/mathjs/lib/cjs/function/utils/isFinite.js deleted file mode 100644 index 69c78cb..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isFinite.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createIsFinite = void 0; -var _factory = require("../../utils/factory.js"); -const name = 'isFinite'; -const dependencies = ['typed', 'isBounded', 'map']; -const createIsFinite = exports.createIsFinite = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - isBounded, - map - } = _ref; - /** - * Test whether a value is finite. - * - * Operates elementwise on Array and Matrix values. To test if all entries - * of an Array or Matrix are finite, use isBounded. - * - * Syntax: - * - * math.isFinite(x) - * - * Examples: - * - * math.isFinite(0) // returns true - * math.isFinite(NaN) // returns false - * math.isFinite(math.bignumber(Infinity)) // returns false - * math.isFinite(math.fraction(1,3)) // returns true - * math.isFinite(math.complex('2 - 4i')) // returns true - * math.isFinite(-10000000000000000n) // returns true - * math.isFinite(undefined) // returns false - * math.isFinite(null) // returns false - * math.isFinite([0.001, -3n, 0]) // Array [true, true, true] - * math.isFinite([2, -Infinity, -3]) // Array [true, false, true] - * - * See also: - * - * isBounded isNumeric, isPositive, isNegative, isNaN - * - * History: - * - * v15.1 Created - * - * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x - * Value to be tested - * @return {boolean | Array | Matrix} - * Whether the value, or its entries, are finite, as appropriate - * to its type - */ - return typed(name, { - 'Array | Matrix': A => map(A, isBounded), - any: x => isBounded(x) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/utils/isInteger.js b/node_modules/mathjs/lib/cjs/function/utils/isInteger.js deleted file mode 100644 index 4aa3fd1..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isInteger.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.createIsInteger = void 0; -var _collection = require("../../utils/collection.js"); -var _factory = require("../../utils/factory.js"); -const name = 'isInteger'; -const dependencies = ['typed', 'equal']; -const createIsInteger = exports.createIsInteger = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - equal - } = _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 TypeError - * - * 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: n => Number.isFinite(n) ? equal(n, Math.round(n)) : false, - BigNumber: b => b.isFinite() ? equal(b.round(), b) : false, - bigint: b => true, - Fraction: r => r.d === 1n, - 'Array | Matrix': typed.referToSelf(self => x => (0, _collection.deepMap)(x, self)) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/function/utils/isNaN.js b/node_modules/mathjs/lib/cjs/function/utils/isNaN.js deleted file mode 100644 index 97d3cf3..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isNaN.js +++ /dev/null @@ -1,64 +0,0 @@ -"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, isFinite, isBounded - * - * @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/node_modules/mathjs/lib/cjs/function/utils/isNegative.js b/node_modules/mathjs/lib/cjs/function/utils/isNegative.js deleted file mode 100644 index 97ff589..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isNegative.js +++ /dev/null @@ -1,58 +0,0 @@ -"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 < 0n, - // 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/node_modules/mathjs/lib/cjs/function/utils/isNumeric.js b/node_modules/mathjs/lib/cjs/function/utils/isNumeric.js deleted file mode 100644 index 953881a..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isNumeric.js +++ /dev/null @@ -1,50 +0,0 @@ -"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, isFinite, isBounded - * - * @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/node_modules/mathjs/lib/cjs/function/utils/isPositive.js b/node_modules/mathjs/lib/cjs/function/utils/isPositive.js deleted file mode 100644 index 089d92e..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isPositive.js +++ /dev/null @@ -1,58 +0,0 @@ -"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 > 0n && x.n > 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/node_modules/mathjs/lib/cjs/function/utils/isPrime.js b/node_modules/mathjs/lib/cjs/function/utils/isPrime.js deleted file mode 100644 index 0f48389..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isPrime.js +++ /dev/null @@ -1,136 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/utils/isZero.js b/node_modules/mathjs/lib/cjs/function/utils/isZero.js deleted file mode 100644 index 500b9c9..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/isZero.js +++ /dev/null @@ -1,55 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/function/utils/numeric.js b/node_modules/mathjs/lib/cjs/function/utils/numeric.js deleted file mode 100644 index 3afa48f..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/numeric.js +++ /dev/null @@ -1,88 +0,0 @@ -"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) - * math.numeric(value, outputType) - * - * 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 - * - * History: - * - * v6 Created - * v13 Added `bigint` support - * v14.2.1 Prefer mathjs `bigint()` to built-in `BigInt()` - * - * @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/node_modules/mathjs/lib/cjs/function/utils/typeOf.js b/node_modules/mathjs/lib/cjs/function/utils/typeOf.js deleted file mode 100644 index 701477e..0000000 --- a/node_modules/mathjs/lib/cjs/function/utils/typeOf.js +++ /dev/null @@ -1,71 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/index.js b/node_modules/mathjs/lib/cjs/index.js deleted file mode 100644 index 4b3a856..0000000 --- a/node_modules/mathjs/lib/cjs/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/json/replacer.js b/node_modules/mathjs/lib/cjs/json/replacer.js deleted file mode 100644 index d939b21..0000000 --- a/node_modules/mathjs/lib/cjs/json/replacer.js +++ /dev/null @@ -1,39 +0,0 @@ -"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' && (!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/node_modules/mathjs/lib/cjs/json/reviver.js b/node_modules/mathjs/lib/cjs/json/reviver.js deleted file mode 100644 index 3e49405..0000000 --- a/node_modules/mathjs/lib/cjs/json/reviver.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/number.js b/node_modules/mathjs/lib/cjs/number.js deleted file mode 100644 index 8272a21..0000000 --- a/node_modules/mathjs/lib/cjs/number.js +++ /dev/null @@ -1,16 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/package.json b/node_modules/mathjs/lib/cjs/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/mathjs/lib/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/mathjs/lib/cjs/plain/bignumber/arithmetic.js b/node_modules/mathjs/lib/cjs/plain/bignumber/arithmetic.js deleted file mode 100644 index cd66883..0000000 --- a/node_modules/mathjs/lib/cjs/plain/bignumber/arithmetic.js +++ /dev/null @@ -1,32 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/bignumber/index.js b/node_modules/mathjs/lib/cjs/plain/bignumber/index.js deleted file mode 100644 index 7b60254..0000000 --- a/node_modules/mathjs/lib/cjs/plain/bignumber/index.js +++ /dev/null @@ -1,29 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/arithmetic.js b/node_modules/mathjs/lib/cjs/plain/number/arithmetic.js deleted file mode 100644 index 1322dbf..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/arithmetic.js +++ /dev/null @@ -1,334 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/bitwise.js b/node_modules/mathjs/lib/cjs/plain/number/bitwise.js deleted file mode 100644 index 36e24cc..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/bitwise.js +++ /dev/null @@ -1,64 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/combinations.js b/node_modules/mathjs/lib/cjs/plain/number/combinations.js deleted file mode 100644 index 5a66705..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/combinations.js +++ /dev/null @@ -1,39 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/constants.js b/node_modules/mathjs/lib/cjs/plain/number/constants.js deleted file mode 100644 index e177333..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/constants.js +++ /dev/null @@ -1,10 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/index.js b/node_modules/mathjs/lib/cjs/plain/number/index.js deleted file mode 100644 index 118255a..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/index.js +++ /dev/null @@ -1,104 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/logical.js b/node_modules/mathjs/lib/cjs/plain/number/logical.js deleted file mode 100644 index b1eb72a..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/logical.js +++ /dev/null @@ -1,27 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/plain/number/probability.js b/node_modules/mathjs/lib/cjs/plain/number/probability.js deleted file mode 100644 index d9be831..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/probability.js +++ /dev/null @@ -1,85 +0,0 @@ -"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 Number.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 (!Number.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/node_modules/mathjs/lib/cjs/plain/number/relational.js b/node_modules/mathjs/lib/cjs/plain/number/relational.js deleted file mode 100644 index 9a390c3..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/relational.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/plain/number/trigonometry.js b/node_modules/mathjs/lib/cjs/plain/number/trigonometry.js deleted file mode 100644 index f2c8941..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/trigonometry.js +++ /dev/null @@ -1,142 +0,0 @@ -"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 Number.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/node_modules/mathjs/lib/cjs/plain/number/utils.js b/node_modules/mathjs/lib/cjs/plain/number/utils.js deleted file mode 100644 index 225a74d..0000000 --- a/node_modules/mathjs/lib/cjs/plain/number/utils.js +++ /dev/null @@ -1,32 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/bigint.js b/node_modules/mathjs/lib/cjs/type/bigint.js deleted file mode 100644 index 0a30ac2..0000000 --- a/node_modules/mathjs/lib/cjs/type/bigint.js +++ /dev/null @@ -1,76 +0,0 @@ -"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 - * - * History: - * - * v13 Created - * v14.2.1 Added conversion options - * - * @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/node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js b/node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js deleted file mode 100644 index 2681d08..0000000 --- a/node_modules/mathjs/lib/cjs/type/bignumber/BigNumber.js +++ /dev/null @@ -1,64 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js b/node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js deleted file mode 100644 index c129014..0000000 --- a/node_modules/mathjs/lib/cjs/type/bignumber/function/bignumber.js +++ /dev/null @@ -1,88 +0,0 @@ -"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(String(x.n)).div(String(x.d)).times(String(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/node_modules/mathjs/lib/cjs/type/boolean.js b/node_modules/mathjs/lib/cjs/type/boolean.js deleted file mode 100644 index 46fcf13..0000000 --- a/node_modules/mathjs/lib/cjs/type/boolean.js +++ /dev/null @@ -1,82 +0,0 @@ -"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 - * - * History: - * - * v0.11 Created - * v0.16 Added conversion from BigNumber - * v14.2.1 Added conversion from bigint - * - * @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/node_modules/mathjs/lib/cjs/type/chain/Chain.js b/node_modules/mathjs/lib/cjs/type/chain/Chain.js deleted file mode 100644 index b592898..0000000 --- a/node_modules/mathjs/lib/cjs/type/chain/Chain.js +++ /dev/null @@ -1,216 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/chain/function/chain.js b/node_modules/mathjs/lib/cjs/type/chain/function/chain.js deleted file mode 100644 index 7911b64..0000000 --- a/node_modules/mathjs/lib/cjs/type/chain/function/chain.js +++ /dev/null @@ -1,58 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/complex/Complex.js b/node_modules/mathjs/lib/cjs/type/complex/Complex.js deleted file mode 100644 index d0eecba..0000000 --- a/node_modules/mathjs/lib/cjs/type/complex/Complex.js +++ /dev/null @@ -1,201 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/complex/function/complex.js b/node_modules/mathjs/lib/cjs/type/complex/function/complex.js deleted file mode 100644 index de3b60e..0000000 --- a/node_modules/mathjs/lib/cjs/type/complex/function/complex.js +++ /dev/null @@ -1,97 +0,0 @@ -"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 - * - * History: - * - * v0.5 Created - * v0.16 Added conversion from BigNumber - * v6 Added conversion from Fraction - * - * @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/node_modules/mathjs/lib/cjs/type/fraction/Fraction.js b/node_modules/mathjs/lib/cjs/type/fraction/Fraction.js deleted file mode 100644 index 2bcde78..0000000 --- a/node_modules/mathjs/lib/cjs/type/fraction/Fraction.js +++ /dev/null @@ -1,48 +0,0 @@ -"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: String(this.s * this.n), - d: String(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/node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js b/node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js deleted file mode 100644 index 789b07a..0000000 --- a/node_modules/mathjs/lib/cjs/type/fraction/function/fraction.js +++ /dev/null @@ -1,99 +0,0 @@ -"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 - * - * History: - * - * v2 Created - * v3 Added conversion from BigNumber - * v11.8 Added conversion from Unit - * v13 Added conversion from bigint - * v14 Move to bigint-based fraction.js@5; construct from two bigints - * - * @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 (!Number.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); - }, - 'bigint, bigint': 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/node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js b/node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js deleted file mode 100644 index 57b6f20..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/DenseMatrix.js +++ /dev/null @@ -1,1049 +0,0 @@ -"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', 'config']; -const createDenseMatrixClass = exports.createDenseMatrixClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - Matrix, - config - } = _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 = config.legacySubset ? index.size().every(idx => idx === 1) : 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 - const returnMatrix = new DenseMatrix(); - const submatrix = _getSubmatrix(matrix._data, index); - returnMatrix._size = submatrix.size; - returnMatrix._datatype = matrix._datatype; - returnMatrix._data = submatrix.data; - return config.legacySubset ? returnMatrix.reshape(index.size()) : returnMatrix; - } - } - - /** - * 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 - * @return {Array} submatrix - * @private - */ - function _getSubmatrix(data, index) { - const maxDepth = index.size().length - 1; - const size = Array(maxDepth); - return { - data: getSubmatrixRecursive(data), - size: size.filter(x => x !== null) - }; - function getSubmatrixRecursive(data) { - let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - const dims = index.dimension(depth); - function _mapIndex(dim, callback) { - // applies a callback for when the index is a Number or a Matrix - if ((0, _is.isNumber)(dim)) return callback(dim);else return dim.map(callback).valueOf(); - } - if ((0, _is.isNumber)(dims)) { - size[depth] = null; - } else { - size[depth] = dims.size()[0]; - } - if (depth < maxDepth) { - return _mapIndex(dims, dimIndex => { - (0, _array.validateIndex)(dimIndex, data.length); - return getSubmatrixRecursive(data[dimIndex], depth + 1); - }); - } else { - return _mapIndex(dims, dimIndex => { - (0, _array.validateIndex)(dimIndex, data.length); - return data[dimIndex]; - }); - } - } - } - - /** - * 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 submatrixSize; - if ((0, _is.isMatrix)(submatrix)) { - submatrixSize = submatrix.size(); - submatrix = submatrix.valueOf(); - } else { - submatrixSize = (0, _array.arraySize)(submatrix); - } - if (isScalar) { - // set a scalar - - // check whether submatrix is a scalar - if (submatrixSize.length !== 0) { - throw new TypeError('Scalar expected'); - } - matrix.set(index.min(), submatrix, defaultValue); - } else { - // set a submatrix - - // broadcast submatrix - if (!(0, _object.deepStrictEqual)(submatrixSize, iSize)) { - if (submatrixSize.length === 0) { - submatrix = (0, _array.broadcastTo)([submatrix], iSize); - } else { - try { - submatrix = (0, _array.broadcastTo)(submatrix, iSize); - } catch (error) {} - } - submatrixSize = (0, _array.arraySize)(submatrix); - } - - // validate dimensions - if (iSize.length < matrix._size.length) { - throw new _DimensionError.DimensionError(iSize.length, matrix._size.length, '<'); - } - if (submatrixSize.length < iSize.length) { - // calculate number of missing outer dimensions - let i = 0; - let outer = 0; - while (iSize[i] === 1 && submatrixSize[i] === 1) { - i++; - } - while (iSize[i] === 1) { - outer++; - i++; - } - - // unsqueeze both outer and inner dimensions - submatrix = (0, _array.unsqueeze)(submatrix, iSize.length, outer, submatrixSize); - } - - // check whether the size of the submatrix matches the index size - if (!(0, _object.deepStrictEqual)(iSize, submatrixSize)) { - throw new _DimensionError.DimensionError(iSize, submatrixSize, '>'); - } - - // enlarge matrix when needed - const size = index.max().map(function (i) { - return i + 1; - }); - _fit(matrix, size, defaultValue); - - // insert the sub matrix - _setSubmatrix(matrix._data, index, submatrix); - } - return matrix; - } - - /** - * Replace a submatrix of a multi dimensional matrix. - * @memberof DenseMatrix - * @param {Array} data - * @param {Index} index - * @param {Array} submatrix - * @private - */ - function _setSubmatrix(data, index, submatrix) { - const maxDepth = index.size().length - 1; - setSubmatrixRecursive(data, submatrix); - function setSubmatrixRecursive(data, submatrix) { - let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - const range = index.dimension(depth); - const recursiveCallback = (rangeIndex, i) => { - (0, _array.validateIndex)(rangeIndex, data.length); - setSubmatrixRecursive(data[rangeIndex], submatrix[i[0]], depth + 1); - }; - const finalCallback = (rangeIndex, i) => { - (0, _array.validateIndex)(rangeIndex, data.length); - data[rangeIndex] = submatrix[i[0]]; - }; - if (depth < maxDepth) { - if ((0, _is.isNumber)(range)) recursiveCallback(range, [0]);else range.forEach(recursiveCallback); - } else { - if ((0, _is.isNumber)(range)) finalCallback(range, [0]);else range.forEach(finalCallback); - } - } - } - - /** - * 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 - }; - - /** - * 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. - * @param {boolean} skipZeros If true, the callback function is invoked only for non-zero entries - * @param {boolean} isUnary If true, the callback function is invoked with one parameter - * - * @return {DenseMatrix} matrix - */ - DenseMatrix.prototype.map = function (callback) { - let skipZeros = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - let isUnary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - const me = this; - const maxDepth = me._size.length - 1; - if (maxDepth < 0) return me.clone(); - const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, me, 'map', isUnary); - const fastCallbackFn = fastCallback.fn; - const result = me.create(undefined, me._datatype); - result._size = me._size; - if (isUnary || fastCallback.isUnary) { - result._data = iterateUnary(me._data); - return result; - } - if (maxDepth === 0) { - const inputData = me.valueOf(); - const data = Array(inputData.length); - for (let i = 0; i < inputData.length; i++) { - data[i] = fastCallbackFn(inputData[i], [i], me); - } - result._data = data; - return result; - } - const index = []; - result._data = iterate(me._data); - return result; - function iterate(data) { - let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - const result = Array(data.length); - if (depth < maxDepth) { - for (let i = 0; i < data.length; i++) { - index[depth] = i; - result[i] = iterate(data[i], depth + 1); - } - } else { - for (let i = 0; i < data.length; i++) { - index[depth] = i; - result[i] = fastCallbackFn(data[i], index.slice(), me); - } - } - return result; - } - function iterateUnary(data) { - let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - const result = Array(data.length); - if (depth < maxDepth) { - for (let i = 0; i < data.length; i++) { - result[i] = iterateUnary(data[i], depth + 1); - } - } else { - for (let i = 0; i < data.length; i++) { - result[i] = fastCallbackFn(data[i]); - } - } - 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. - * @param {boolean} skipZeros If true, the callback function is invoked only for non-zero entries - * @param {boolean} isUnary If true, the callback function is invoked with one parameter - */ - DenseMatrix.prototype.forEach = function (callback) { - let skipZeros = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - let isUnary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - const me = this; - const maxDepth = me._size.length - 1; - if (maxDepth < 0) return; - const fastCallback = (0, _optimizeCallback.optimizeCallback)(callback, me, 'map', isUnary); - const fastCallbackFn = fastCallback.fn; - if (isUnary || fastCallback.isUnary) { - iterateUnary(me._data); - return; - } - if (maxDepth === 0) { - for (let i = 0; i < me._data.length; i++) { - fastCallbackFn(me._data[i], [i], me); - } - return; - } - const index = []; - iterate(me._data); - function iterate(data) { - let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - if (depth < maxDepth) { - for (let i = 0; i < data.length; i++) { - index[depth] = i; - iterate(data[i], depth + 1); - } - } else { - for (let i = 0; i < data.length; i++) { - index[depth] = i; - fastCallbackFn(data[i], index.slice(), me); - } - } - } - function iterateUnary(data) { - let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - if (depth < maxDepth) { - for (let i = 0; i < data.length; i++) { - iterateUnary(data[i], depth + 1); - } - } else { - for (let i = 0; i < data.length; i++) { - fastCallbackFn(data[i]); - } - } - } - }; - - /** - * Iterate over the matrix elements - * @return {Iterable<{ value, index: number[] }>} - */ - DenseMatrix.prototype[Symbol.iterator] = function* () { - const maxDepth = this._size.length - 1; - if (maxDepth < 0) { - return; - } - if (maxDepth === 0) { - for (let i = 0; i < this._data.length; i++) { - yield { - value: this._data[i], - index: [i] - }; - } - return; - } - - // Multi-dimensional matrix: iterate over all elements - const index = Array(maxDepth + 1).fill(0); - const totalElements = this._size.reduce((a, b) => a * b, 1); - for (let count = 0; count < totalElements; count++) { - // Traverse to the current element using indices - let current = this._data; - for (let d = 0; d < maxDepth; d++) { - current = current[index[d]]; - } - yield { - value: current[index[maxDepth]], - index: index.slice() - }; - - // Increment indices for next element - for (let d = maxDepth; d >= 0; d--) { - index[d]++; - if (index[d] < this._size[d]) break; - index[d] = 0; - } - } - }; - - /** - * 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/node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js b/node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js deleted file mode 100644 index cd83f22..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/FibonacciHeap.js +++ /dev/null @@ -1,357 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js b/node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js deleted file mode 100644 index 9a43e05..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/ImmutableDenseMatrix.js +++ /dev/null @@ -1,227 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/Matrix.js b/node_modules/mathjs/lib/cjs/type/matrix/Matrix.js deleted file mode 100644 index 2c0344d..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/Matrix.js +++ /dev/null @@ -1,248 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js b/node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js deleted file mode 100644 index 6ab4ddf..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/MatrixIndex.js +++ /dev/null @@ -1,309 +0,0 @@ -"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() { - 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 = i < 0 || arguments.length <= i ? undefined : arguments[i]; - const argIsArray = (0, _is.isArray)(arg); - const argIsMatrix = (0, _is.isMatrix)(arg); - const argType = typeof arg; - let sourceSize = null; - if ((0, _is.isRange)(arg)) { - this._dimensions.push(arg); - this._isScalar = false; - } else if (argIsArray || argIsMatrix) { - // create matrix - let m; - this._isScalar = false; - 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); - } else if (argType === 'number') { - this._dimensions.push(arg); - } else if (argType === 'bigint') { - this._dimensions.push(Number(arg)); - } else if (argType === 'string') { - // object property (arguments.count should be 1) - this._dimensions.push(arg); - } else { - throw new TypeError('Dimension must be an Array, Matrix, number, bigint, 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 (!(0, _is.isNumber)(arg[i]) || !(0, _number.isInteger)(arg[i])) { - throw new TypeError('Index parameters must be positive integer numbers'); - } - } - // create matrix - const matrix = new ImmutableDenseMatrix(); - matrix._data = arg; - matrix._size = [arg.length]; - return matrix; - } - - /** - * 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] = (0, _is.isString)(d) || (0, _is.isNumber)(d) ? 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] = (0, _is.isString)(range) || (0, _is.isNumber)(range) ? 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] = (0, _is.isString)(range) || (0, _is.isNumber)(range) ? 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) { - var _this$_dimensions$dim; - if (!(0, _is.isNumber)(dim)) { - return null; - } - return (_this$_dimensions$dim = this._dimensions[dim]) !== null && _this$_dimensions$dim !== void 0 ? _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 && (0, _is.isString)(this._dimensions[0]); - }; - - /** - * 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((0, _is.isString)(dimension) || (0, _is.isNumber)(dimension) ? 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 ((0, _is.isString)(dimension)) { - 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/node_modules/mathjs/lib/cjs/type/matrix/Range.js b/node_modules/mathjs/lib/cjs/type/matrix/Range.js deleted file mode 100644 index 35659bc..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/Range.js +++ /dev/null @@ -1,320 +0,0 @@ -"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 of numbers. 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) - * - * Note that the endpoints and step may be specified with other numeric - * types such as bigint or BigNumber, but they will be demoted to the - * built-in `number` type and the Range will only contain numbers. The - * rationale for this demotion is that Range objects are primarily used - * for indexing Matrix objects, and Matrix objects may only be indexed - * with `number`s. - * - * 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' && !(0, _is.isBigInt)(start)) { - throw new TypeError('Parameter start must be a number or bigint'); - } - } - if (hasEnd) { - if ((0, _is.isBigNumber)(end)) { - end = end.toNumber(); - } else if (typeof end !== 'number' && !(0, _is.isBigInt)(end)) { - throw new TypeError('Parameter end must be a number or bigint'); - } - } - if (hasStep) { - if ((0, _is.isBigNumber)(step)) { - step = step.toNumber(); - } else if (typeof step !== 'number' && !(0, _is.isBigInt)(step)) { - throw new TypeError('Parameter step must be a number or bigint'); - } - } - this.start = hasStart ? parseFloat(start) : 0; - this.end = hasEnd ? parseFloat(end) : 0; - this.step = hasStep ? parseFloat(step) : 1; - if (hasStep && (0, _number.nearlyEqual)(this.step, 0)) { - throw new Error('Step must not be zero'); - } - } - - /** - * 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/node_modules/mathjs/lib/cjs/type/matrix/Spa.js b/node_modules/mathjs/lib/cjs/type/matrix/Spa.js deleted file mode 100644 index b38bea2..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/Spa.js +++ /dev/null @@ -1,142 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js b/node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js deleted file mode 100644 index 962ee26..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/SparseMatrix.js +++ /dev/null @@ -1,1519 +0,0 @@ -"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 (currently) implements 2D - * matrices only via the format known as - * [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS)). - * - * The structure/invariants of the internal data should be: - * 1. _values is an array of the nonzero values in order from top to bottom - * (of each column), left to right. - * 2. _index is an array of row numbers, of the same length as and - * corresponding positionally to _values. - * 3. _ptr is an array of length one more than the number of columns. For j - * less than the number of columns, the "half-open" span of indices - * _ptr[j] to _ptr[j+1] (i.e. including _ptr[j] if it is less than - * _ptr[j+1], but never including _ptr[j+1]) are the indices in _values - * of the nonzero elements in column j. Note there are no nonzero elements - * in column j exactly when _ptr[j] === _ptr[j+1], and that the final - * entry in _ptr is always exactly the number of nonzero entries in the - * matrix. - * 4. _size is a length-2 array consisting of the number of rows followed by - * the number of columns. - * 5. _datatype, if set, is the mathjs typeOf value of all entries of the - * SparseMatrix. - * @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 - while (matrix._ptr.length <= columns) { - 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 - function rowsCallback(i, r) { - // update permutation vector - pv[i] = r[0]; - // mark i in workspace - w[i] = true; - } - if (Number.isInteger(rows)) rowsCallback(rows, [0]);else rows.forEach(rowsCallback); - - // result matrix arrays - const values = mvalues ? [] : undefined; - const index = []; - const ptr = []; - - // loop columns in result matrix - function columnsCallback(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]); - } - } - } - } - if (Number.isInteger(columns)) columnsCallback(columns);else columns.forEach(columnsCallback); - // 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); - _forEachIndex(range, (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); - _forEachIndex(firstDimensionRange, (firstDataIndex, firstSubIndex) => { - (0, _array.validateIndex)(firstDataIndex); - _forEachIndex(secondDimensionRange, (secondDataIndex, secondSubIndex) => { - (0, _array.validateIndex)(secondDataIndex); - matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue); - }); - }); - } - } - return matrix; - function _forEachIndex(index, callback) { - // iterate cases where index is a Matrix or a Number - if ((0, _is.isNumber)(index)) callback(index, [0]);else index.forEach(callback); - } - } - - /** - * 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.fn(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 - // TODO apply a non indexed version of algorithm in case fastCallback is not optimized - fastCallback.fn(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.fn(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/node_modules/mathjs/lib/cjs/type/matrix/function/index.js b/node_modules/mathjs/lib/cjs/type/matrix/function/index.js deleted file mode 100644 index 3134a1b..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/function/index.js +++ /dev/null @@ -1,78 +0,0 @@ -"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 - * - * History: - * - * v? Created - * v2 Dropped support for `[start, end, step]` arguments in favor - * of lists of arbitrary values; added support for Range - * objects. - * v11.10 Added support for arrays of booleans as indices. - * - * @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/node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js b/node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js deleted file mode 100644 index fb7c8b6..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/function/matrix.js +++ /dev/null @@ -1,94 +0,0 @@ -"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 - * - * History: - * - * v0.5 Created - * v1.5 Support dense or sparse Matrix types; allow construction - * from string, Array, or another Matrix. - * - * @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/node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js b/node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js deleted file mode 100644 index c3fcc06..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/function/sparse.js +++ /dev/null @@ -1,66 +0,0 @@ -"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 - * - * History: - * - * v1.5 Created - * - * @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/node_modules/mathjs/lib/cjs/type/matrix/utils/broadcast.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/broadcast.js deleted file mode 100644 index deb786e..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/broadcast.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo01xDSid.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo01xDSid.js deleted file mode 100644 index 0df668b..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo01xDSid.js +++ /dev/null @@ -1,118 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo02xDS0.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo02xDS0.js deleted file mode 100644 index 9f6657e..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo02xDS0.js +++ /dev/null @@ -1,122 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo03xDSf.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo03xDSf.js deleted file mode 100644 index 03de89f..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo03xDSf.js +++ /dev/null @@ -1,128 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js deleted file mode 100644 index dde74fe..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo04xSidSid.js +++ /dev/null @@ -1,185 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js deleted file mode 100644 index 9b0427c..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo05xSfSf.js +++ /dev/null @@ -1,177 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js deleted file mode 100644 index 664af19..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo06xS0S0.js +++ /dev/null @@ -1,159 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo07xSSf.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo07xSSf.js deleted file mode 100644 index 42b3496..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo07xSSf.js +++ /dev/null @@ -1,121 +0,0 @@ -"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', 'SparseMatrix']; -const createMatAlgo07xSSf = exports.createMatAlgo07xSSf = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => { - let { - typed, - SparseMatrix - } = _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} SparseMatrix (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(); - 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); - } - 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; - let zero = 0; - let cf = callback; - - // process data types - if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { - dt = adt; - zero = typed.convert(0, dt); - cf = typed.find(callback, [dt, dt]); - } - - // result arrays for sparse format - const cvalues = []; - const cindex = []; - const cptr = new Array(columns + 1).fill(0); // Start with column pointer array - - // workspaces - const xa = []; - const xb = []; - const wa = []; - const wb = []; - - // loop columns - for (let j = 0; j < columns; j++) { - const mark = j + 1; - let nonZeroCount = 0; - _scatter(a, j, wa, xa, mark); - _scatter(b, j, wb, xb, mark); - - // loop rows - for (let i = 0; i < rows; i++) { - const va = wa[i] === mark ? xa[i] : zero; - const vb = wb[i] === mark ? xb[i] : zero; - - // invoke callback - const cij = cf(va, vb); - // Store all non zero and true values - if (cij !== 0 && cij !== false) { - cindex.push(i); // row index - cvalues.push(cij); // computed value - nonZeroCount++; - } - } - - // Update column pointer with cumulative count of non-zero values - cptr[j + 1] = cptr[j] + nonZeroCount; - } - - // Return the result as a sparse matrix - return new SparseMatrix({ - values: cvalues, - index: cindex, - ptr: cptr, - 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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js deleted file mode 100644 index 82bfddb..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo08xS0Sid.js +++ /dev/null @@ -1,160 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js deleted file mode 100644 index cc28ebd..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo09xS0Sf.js +++ /dev/null @@ -1,148 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo10xSids.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo10xSids.js deleted file mode 100644 index 24031a7..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo10xSids.js +++ /dev/null @@ -1,111 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo11xS0s.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo11xS0s.js deleted file mode 100644 index 8aae4e8..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo11xS0s.js +++ /dev/null @@ -1,109 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo12xSfs.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo12xSfs.js deleted file mode 100644 index 7090a8c..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo12xSfs.js +++ /dev/null @@ -1,111 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo13xDD.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo13xDD.js deleted file mode 100644 index 3c4ce7a..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo13xDD.js +++ /dev/null @@ -1,100 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo14xDs.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo14xDs.js deleted file mode 100644 index 89033d9..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matAlgo14xDs.js +++ /dev/null @@ -1,82 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js b/node_modules/mathjs/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js deleted file mode 100644 index 70cabe6..0000000 --- a/node_modules/mathjs/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js +++ /dev/null @@ -1,158 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/number.js b/node_modules/mathjs/lib/cjs/type/number.js deleted file mode 100644 index d50d677..0000000 --- a/node_modules/mathjs/lib/cjs/type/number.js +++ /dev/null @@ -1,156 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js b/node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js deleted file mode 100644 index ae837b5..0000000 --- a/node_modules/mathjs/lib/cjs/type/resultset/ResultSet.js +++ /dev/null @@ -1,74 +0,0 @@ -"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.map(String).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/node_modules/mathjs/lib/cjs/type/string.js b/node_modules/mathjs/lib/cjs/type/string.js deleted file mode 100644 index 3ba2db5..0000000 --- a/node_modules/mathjs/lib/cjs/type/string.js +++ /dev/null @@ -1,64 +0,0 @@ -"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 - * - * History: - * - * v0.9 Created - * - * @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/node_modules/mathjs/lib/cjs/type/unit/Unit.js b/node_modules/mathjs/lib/cjs/type/unit/Unit.js deleted file mode 100644 index 4f74013..0000000 --- a/node_modules/mathjs/lib/cjs/type/unit/Unit.js +++ /dev/null @@ -1,3994 +0,0 @@ -"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; - const fixPrefixDefault = false; - const skipAutomaticSimplificationDefault = true; - - /** - * 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 = fixPrefixDefault; // 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 = skipAutomaticSimplificationDefault; - 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(one(other.value)) : this.value; - const valOther = other.value === null ? other._normalize(one(this.value)) : 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(one(other.value)) : this.value; - const valOther = other.value === null ? other._normalize(one(this.value)) : 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; - } - } - - /** - * Create a value one with the numeric type of `typeOfValue`. - * For example, `one(new BigNumber(3))` returns `BigNumber(1)` - * @param {number | Fraction | BigNumber} typeOfValue - * @returns {number | Fraction | BigNumber} - */ - function one(typeOfValue) { - // TODO: this is a workaround to prevent the following BigNumber conversion error from throwing: - // "TypeError: Cannot implicitly convert a number with >15 significant digits to BigNumber" - // see https://github.com/josdejong/mathjs/issues/3450 - // https://github.com/josdejong/mathjs/pull/3375 - const convert = Unit._getNumberConverter((0, _is.typeOf)(typeOfValue)); - return convert(1); - } - - /** - * 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, "skipSimp": true}` - */ - Unit.prototype.toJSON = function () { - return { - mathjs: 'Unit', - value: this._denormalize(this.value), - unit: this.units.length > 0 ? this.formatUnits() : null, - fixPrefix: this.fixPrefix, - skipSimp: this.skipAutomaticSimplification - }; - }; - - /** - * 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, _json$fixPrefix, _json$skipSimp; - const unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined); - unit.fixPrefix = (_json$fixPrefix = json.fixPrefix) !== null && _json$fixPrefix !== void 0 ? _json$fixPrefix : fixPrefixDefault; - unit.skipAutomaticSimplification = (_json$skipSimp = json.skipSimp) !== null && _json$skipSimp !== void 0 ? _json$skipSimp : skipAutomaticSimplificationDefault; - 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 unit, with optional formatting options. - * @memberof Unit - * @param {string[] | Unit[]} [units] Array of units strings or valueLess Unit objects in wich choose the best one - * @param {Object} [options] Options for parsing the unit. See parseUnit for details. - * - * @return {Unit} Returns a new Unit with the given value and unit. - */ - Unit.prototype.toBest = function () { - let unitList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (unitList && !Array.isArray(unitList)) { - throw new Error('Invalid unit type. Expected string or Unit.'); - } - const startPrefixes = this.units[0].unit.prefixes; - if (unitList && unitList.length > 0) { - const unitObjects = unitList.map(u => { - let unit = null; - if (typeof u === 'string') { - unit = Unit.parse(u); - if (!unit) { - throw new Error('Invalid unit type. Expected compatible string or Unit.'); - } - } else if (!(0, _is.isUnit)(u)) { - throw new Error('Invalid unit type. Expected compatible string or Unit.'); - } - if (unit === null) { - unit = u.clone(); - } - try { - this.to(unit.formatUnits()); - return unit; - } catch (e) { - throw new Error('Invalid unit type. Expected compatible string or Unit.'); - } - }); - const prefixes = unitObjects.map(el => el.units[0].prefix); - this.units[0].unit.prefixes = prefixes.reduce((acc, prefix) => { - acc[prefix.name] = prefix; - return acc; - }, {}); - this.units[0].prefix = prefixes[0]; - } - const result = formatBest(this, options).simp; - this.units[0].unit.prefixes = startPrefixes; - result.fixPrefix = true; - return result; - }; - /** - * 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) { - const { - simp, - valueStr, - unitStr - } = formatBest(this, options); - let str = valueStr; - 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; - }; - - /** - * Helper function to normalize a unit for conversion and formatting - * @param {Unit} unit The unit to be normalized - * @return {Object} Object with normalized unit and value - * @private - */ - function formatBest(unit) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - // 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 = unit.skipAutomaticSimplification || unit.value === null ? unit.clone() : unit.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. - handleVAandVARUnits(simp); - // Now apply the best prefix - // Units must have only one unit and not have the fixPrefix flag set - applyBestPrefixIfNeeded(simp, options.offset); - const value = simp._denormalize(simp.value); - const valueStr = simp.value !== null ? format(value, options || {}) : ''; - const unitStr = simp.formatUnits(); - return { - simp, - valueStr, - unitStr - }; - } - - /** - * Helper to handle VA and VAR units - * @param {Unit} simp The unit to be normalized - */ - function handleVAandVARUnits(simp) { - 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; - } - } - } - } - } - - /** - * Helper to apply the best prefix if needed - * @param {Unit} simp The unit to be normalized - */ - function applyBestPrefixIfNeeded(simp, offset) { - 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(offset); - } - } - } - - /** - * Calculate the best prefix using current value. - * @memberof Unit - * @returns {Object} prefix - * @param {number} [offset] Optional offset for the best prefix calculation (default 1.2) - * @private - */ - Unit.prototype._bestPrefix = function () { - let offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.2; - 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 - offset; - 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 - offset); - 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(String(x.n)).div(String(x.d)).times(String(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/node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js b/node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js deleted file mode 100644 index 1038a3b..0000000 --- a/node_modules/mathjs/lib/cjs/type/unit/function/createUnit.js +++ /dev/null @@ -1,85 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js b/node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js deleted file mode 100644 index b2d0226..0000000 --- a/node_modules/mathjs/lib/cjs/type/unit/function/splitUnit.js +++ /dev/null @@ -1,38 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/type/unit/function/unit.js b/node_modules/mathjs/lib/cjs/type/unit/function/unit.js deleted file mode 100644 index a6a77aa..0000000 --- a/node_modules/mathjs/lib/cjs/type/unit/function/unit.js +++ /dev/null @@ -1,74 +0,0 @@ -"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 - * - * History: - * - * v0.5 Created - * v0.16 Support conversion from BigNumber - * v2.5 Support BigNumber and Fraction values in units - * v2.6 Support Complex values in units - * v11.1 Allow the type of unit to be specifed by a unit (not just string) - * - * @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/node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js b/node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js deleted file mode 100644 index 5c1774c..0000000 --- a/node_modules/mathjs/lib/cjs/type/unit/physicalConstants.js +++ /dev/null @@ -1,107 +0,0 @@ -"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.createCoulombConstant = 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'); // Deprecated in favor of coulombConstant -const createCoulombConstant = exports.createCoulombConstant = /* #__PURE__ */unitFactory('coulombConstant', '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/node_modules/mathjs/lib/cjs/utils/array.js b/node_modules/mathjs/lib/cjs/utils/array.js deleted file mode 100644 index f46a5b5..0000000 --- a/node_modules/mathjs/lib/cjs/utils/array.js +++ /dev/null @@ -1,968 +0,0 @@ -"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.deepForEach = deepForEach; -exports.deepMap = deepMap; -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.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 children 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} value 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 an index has empty values - * @param {Index} 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 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 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, true); // since it has rectangular - 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 one 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 dimension 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 - * - * Parameter `size` will be mutated to match the new, unsqueezed 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 unsqueezed 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 - * @param {boolean} isRectangular Optional. If the array is rectangular (not jagged) - * @return {Array} The flattened array (1 dimensional) - */ -function flatten(array) { - let isRectangular = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - if (!Array.isArray(array)) { - // if not an array, return as is - return array; - } - if (typeof isRectangular !== 'boolean') { - throw new TypeError('Boolean expected for second argument of flatten'); - } - const flat = []; - if (isRectangular) { - _flattenRectangular(array); - } else { - _flatten(array); - } - return flat; - function _flatten(array) { - for (let i = 0; i < array.length; i++) { - const item = array[i]; - if (Array.isArray(item)) { - _flatten(item); - } else { - flat.push(item); - } - } - } - function _flattenRectangular(array) { - if (Array.isArray(array[0])) { - for (let i = 0; i < array.length; i++) { - _flattenRectangular(array[i]); - } - } else { - for (let i = 0; i < array.length; i++) { - flat.push(array[i]); - } - } - } -} - -/** - * 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 an array 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} array - * @returns {*} - */ -function last(array) { - return array[array.length - 1]; -} - -/** - * Get all but the last element of array. - * @param {Array} array - * @returns {Array} - */ -function initial(array) { - return array.slice(0, array.length - 1); -} - -/** - * Recursively concatenate two matrices. - * The contents of the matrices are 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 {Array} - */ -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 gets the broadcasted size for both. - * @param {...number[]} sizes Sizes to broadcast together - * @returns {number[]} The broadcasted size - */ -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 mismatch: mismatch 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 {Array} 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 {Array[]} The broadcasted arrays - */ -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('Insufficient number of arguments 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 {Array} The stretched array - */ -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} index - 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(get(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); -} - -/** - * Recursively maps over each element of nested array using a provided callback function. - * - * @param {Array} array - The array to be mapped. - * @param {Function} callback - The function to execute on each element, taking three arguments: - * - `value` (any): The current element being processed in the array. - * - `index` (Array): The index of the current element being processed in the array. - * - `array` (Array): The array `deepMap` was called upon. - * @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value. - * @returns {Array} A new array with each element being the result of the callback function. - */ -function deepMap(array, callback) { - let skipIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (array.length === 0) { - return []; - } - if (skipIndex) { - return recursiveMap(array); - } - const index = []; - return recursiveMapWithIndex(array, 0); - function recursiveMapWithIndex(value, depth) { - if (Array.isArray(value)) { - const N = value.length; - const result = Array(N); - for (let i = 0; i < N; i++) { - index[depth] = i; - result[i] = recursiveMapWithIndex(value[i], depth + 1); - } - return result; - } else { - return callback(value, index.slice(0, depth), array); - } - } - function recursiveMap(value) { - if (Array.isArray(value)) { - const N = value.length; - const result = Array(N); - for (let i = 0; i < N; i++) { - result[i] = recursiveMap(value[i]); - } - return result; - } else { - return callback(value); - } - } -} - -/** - * Recursively iterates over each element in a multi-dimensional array and applies a callback function. - * - * @param {Array} array - The multi-dimensional array to iterate over. - * @param {Function} callback - The function to execute for each element. It receives three arguments: - * - {any} value: The current element being processed in the array. - * - {Array} index: The index of the current element in each dimension. - * - {Array} array: The original array being processed. - * @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value. - */ -function deepForEach(array, callback) { - let skipIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (array.length === 0) { - return; - } - if (skipIndex) { - recursiveForEach(array); - return; - } - const index = []; - recursiveForEachWithIndex(array, 0); - function recursiveForEachWithIndex(value, depth) { - if (Array.isArray(value)) { - const N = value.length; - for (let i = 0; i < N; i++) { - index[depth] = i; - recursiveForEachWithIndex(value[i], depth + 1); - } - } else { - callback(value, index.slice(0, depth), array); - } - } - function recursiveForEach(value) { - if (Array.isArray(value)) { - const N = value.length; - for (let i = 0; i < N; i++) { - recursiveForEach(value[i]); - } - } else { - callback(value); - } - } -} - -/** - * Deep clones a multidimensional array - * @param {Array} array - * @returns {Array} cloned array - */ -function clone(array) { - return (0, _extends2.default)([], array); -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/utils/bigint.js b/node_modules/mathjs/lib/cjs/utils/bigint.js deleted file mode 100644 index 1ad2f10..0000000 --- a/node_modules/mathjs/lib/cjs/utils/bigint.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.promoteLogarithm = promoteLogarithm; -/** - * Build a bigint logarithm function from a number logarithm, - * still returning a number. The idea is that 15 hexadecimal digits - * (60 bits) saturates the mantissa of the log, and each additional hex - * digit effectively just adds the log of 16 to the resulting value. So - * convert the most significant 15 hex digits to a number and take its - * log, and then add the log of 16 for each additional hex digit that - * was in the bigint. - * For negative numbers (complex logarithms), following the bignum - * implementation, it just downgrades to number and uses the complex result. - * @param {number} log16 the log of 16 - * @param {(number) -> number} numberLog the logarithm function for numbers - * @param {ConfigurationObject} config the mathjs configuration - * @param {(number) -> Complex} cplx the associated Complex log - * @returns {(bigint) -> number} the corresponding logarithm for bigints - */ -function promoteLogarithm(log16, numberLog, config, cplx) { - return function (b) { - if (b > 0 || config.predictable) { - if (b <= 0) return NaN; - const s = b.toString(16); - const s15 = s.substring(0, 15); - return log16 * (s.length - s15.length) + numberLog(Number('0x' + s15)); - } - return cplx(b.toNumber()); - }; -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js b/node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js deleted file mode 100644 index 6cd4440..0000000 --- a/node_modules/mathjs/lib/cjs/utils/bignumber/bitwise.js +++ /dev/null @@ -1,411 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/bignumber/constants.js b/node_modules/mathjs/lib/cjs/utils/bignumber/constants.js deleted file mode 100644 index 5a3bccd..0000000 --- a/node_modules/mathjs/lib/cjs/utils/bignumber/constants.js +++ /dev/null @@ -1,62 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js b/node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js deleted file mode 100644 index c72212a..0000000 --- a/node_modules/mathjs/lib/cjs/utils/bignumber/formatter.js +++ /dev/null @@ -1,251 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js b/node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js deleted file mode 100644 index 8872358..0000000 --- a/node_modules/mathjs/lib/cjs/utils/bignumber/nearlyEqual.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/collection.js b/node_modules/mathjs/lib/cjs/utils/collection.js deleted file mode 100644 index 179bc72..0000000 --- a/node_modules/mathjs/lib/cjs/utils/collection.js +++ /dev/null @@ -1,185 +0,0 @@ -"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.forEach(x => callback(x), false, true); - } else { - (0, _array.deepForEach)(array, callback, true); - } -} - -/** - * 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 (!skipZeros) { - if ((0, _is.isMatrix)(array)) { - return array.map(x => callback(x), false, true); - } else { - return (0, _array.deepMap)(array, callback, true); - } - } - const skipZerosCallback = x => x === 0 ? x : callback(x); - if ((0, _is.isMatrix)(array)) { - return array.map(x => skipZerosCallback(x), false, true); - } else { - return (0, _array.deepMap)(array, skipZerosCallback, true); - } -} - -/** - * 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/node_modules/mathjs/lib/cjs/utils/complex.js b/node_modules/mathjs/lib/cjs/utils/complex.js deleted file mode 100644 index 6302cf8..0000000 --- a/node_modules/mathjs/lib/cjs/utils/complex.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/customs.js b/node_modules/mathjs/lib/cjs/utils/customs.js deleted file mode 100644 index 1d03b5e..0000000 --- a/node_modules/mathjs/lib/cjs/utils/customs.js +++ /dev/null @@ -1,151 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/emitter.js b/node_modules/mathjs/lib/cjs/utils/emitter.js deleted file mode 100644 index 17d650d..0000000 --- a/node_modules/mathjs/lib/cjs/utils/emitter.js +++ /dev/null @@ -1,24 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/factory.js b/node_modules/mathjs/lib/cjs/utils/factory.js deleted file mode 100644 index 5e2cefc..0000000 --- a/node_modules/mathjs/lib/cjs/utils/factory.js +++ /dev/null @@ -1,140 +0,0 @@ -"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`. For explanation - * of what meta properties can be specified and what they mean, see - * docs/core/extension.md. - * @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/node_modules/mathjs/lib/cjs/utils/function.js b/node_modules/mathjs/lib/cjs/utils/function.js deleted file mode 100644 index 36e5053..0000000 --- a/node_modules/mathjs/lib/cjs/utils/function.js +++ /dev/null @@ -1,92 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/is.js b/node_modules/mathjs/lib/cjs/utils/is.js deleted file mode 100644 index e23b2b6..0000000 --- a/node_modules/mathjs/lib/cjs/utils/is.js +++ /dev/null @@ -1,245 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/latex.js b/node_modules/mathjs/lib/cjs/utils/latex.js deleted file mode 100644 index 0a5e352..0000000 --- a/node_modules/mathjs/lib/cjs/utils/latex.js +++ /dev/null @@ -1,500 +0,0 @@ -"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' - }, - fraction: { - 2: '\\frac{${args[0]}}{${args[1]}}' - }, - 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/node_modules/mathjs/lib/cjs/utils/log.js b/node_modules/mathjs/lib/cjs/utils/log.js deleted file mode 100644 index 53705bc..0000000 --- a/node_modules/mathjs/lib/cjs/utils/log.js +++ /dev/null @@ -1,22 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/lruQueue.js b/node_modules/mathjs/lib/cjs/utils/lruQueue.js deleted file mode 100644 index 4f8534e..0000000 --- a/node_modules/mathjs/lib/cjs/utils/lruQueue.js +++ /dev/null @@ -1,57 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/map.js b/node_modules/mathjs/lib/cjs/utils/map.js deleted file mode 100644 index b66191c..0000000 --- a/node_modules/mathjs/lib/cjs/utils/map.js +++ /dev/null @@ -1,214 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/noop.js b/node_modules/mathjs/lib/cjs/utils/noop.js deleted file mode 100644 index 48c334e..0000000 --- a/node_modules/mathjs/lib/cjs/utils/noop.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/number.js b/node_modules/mathjs/lib/cjs/utils/number.js deleted file mode 100644 index cf2131a..0000000 --- a/node_modules/mathjs/lib/cjs/utils/number.js +++ /dev/null @@ -1,749 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.cbrt = exports.atanh = exports.asinh = exports.acosh = void 0; -exports.copysign = copysign; -exports.cosh = void 0; -exports.digits = digits; -exports.expm1 = void 0; -exports.format = format; -exports.isInteger = isInteger; -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 Number.isFinite(value) ? value === Math.round(value) : false; -} - -/** - * 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') { - try { - BigInt(numberStr); - } catch (_unused) { - 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 (Number.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) || !Number.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) || !Number.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) || !Number.isFinite(Number(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) || !Number.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; -} - -/** - * 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 (!Number.isFinite(a) || !Number.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/node_modules/mathjs/lib/cjs/utils/object.js b/node_modules/mathjs/lib/cjs/utils/object.js deleted file mode 100644 index f7c8bdf..0000000 --- a/node_modules/mathjs/lib/cjs/utils/object.js +++ /dev/null @@ -1,395 +0,0 @@ -"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); - } - if (type === 'function') { - // we assume that the function is immutable - return x; - } - 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/node_modules/mathjs/lib/cjs/utils/optimizeCallback.js b/node_modules/mathjs/lib/cjs/utils/optimizeCallback.js deleted file mode 100644 index 54de241..0000000 --- a/node_modules/mathjs/lib/cjs/utils/optimizeCallback.js +++ /dev/null @@ -1,170 +0,0 @@ -"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. - * @param {boolean} isUnary If true, the callback function is unary and will be optimized as such. - * @returns {Function} Returns a simplified version of the callback function. - */ -function optimizeCallback(callback, array, name, isUnary) { - if (_typedFunction.default.isTypedFunction(callback)) { - let numberOfArguments; - if (isUnary) { - numberOfArguments = 1; - } else { - const size = array.isMatrix ? array.size() : (0, _array.arraySize)(array); - - // Check the size of the last dimension to see if the array/matrix is empty - const isEmpty = size.length ? size[size.length - 1] === 0 : true; - if (isEmpty) { - // don't optimize callbacks for empty arrays/matrix, as they will never be called - // and in fact will throw an exception when we try to access the first element below - return { - isUnary, - fn: callback - }; - } - const firstIndex = size.map(() => 0); - const firstValue = array.isMatrix ? array.get(firstIndex) : (0, _array.get)(array, firstIndex); - numberOfArguments = _findNumberOfArgumentsTyped(callback, firstValue, firstIndex, array); - } - let fastCallback; - if (array.isMatrix && array.dataType !== 'mixed' && array.dataType !== undefined) { - const singleSignature = _findSingleSignatureWithArity(callback, numberOfArguments); - fastCallback = singleSignature !== undefined ? singleSignature : callback; - } else { - fastCallback = callback; - } - if (numberOfArguments >= 1 && numberOfArguments <= 3) { - return { - isUnary: numberOfArguments === 1, - fn: 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 { - isUnary: false, - fn: 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); - } - }; - } - if (isUnary === undefined) { - return { - isUnary: _findIfCallbackIsUnary(callback), - fn: callback - }; - } else { - return { - isUnary, - fn: callback - }; - } -} -function _findSingleSignatureWithArity(callback, arity) { - const matchingFunctions = []; - Object.entries(callback.signatures).forEach(_ref => { - let [signature, func] = _ref; - if (signature.split(',').length === arity) { - matchingFunctions.push(func); - } - }); - if (matchingFunctions.length === 1) { - return matchingFunctions[0]; - } -} - -/** - * Determines if a given callback function is unary (i.e., takes exactly one argument). - * - * This function checks the following conditions to determine if the callback is unary: - * 1. The callback function should have exactly one parameter. - * 2. The callback function should not use the `arguments` object. - * 3. The callback function should not use rest parameters (`...`). - * If in doubt, this function shall return `false` to be safe - * - * @param {Function} callback - The callback function to be checked. - * @returns {boolean} - Returns `true` if the callback is unary, otherwise `false`. - */ -function _findIfCallbackIsUnary(callback) { - if (callback.length !== 1) return false; - const callbackStr = callback.toString(); - // Check if the callback function uses `arguments` - if (/arguments/.test(callbackStr)) return false; - - // Extract the parameters of the callback function - const paramsStr = callbackStr.match(/\(.*?\)/); - // Check if the callback function uses rest parameters - if (/\.\.\./.test(paramsStr)) return false; - return true; -} -function _findNumberOfArgumentsTyped(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/node_modules/mathjs/lib/cjs/utils/print.js b/node_modules/mathjs/lib/cjs/utils/print.js deleted file mode 100644 index 701f0a9..0000000 --- a/node_modules/mathjs/lib/cjs/utils/print.js +++ /dev/null @@ -1,7 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/product.js b/node_modules/mathjs/lib/cjs/utils/product.js deleted file mode 100644 index 181ea12..0000000 --- a/node_modules/mathjs/lib/cjs/utils/product.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/scope.js b/node_modules/mathjs/lib/cjs/utils/scope.js deleted file mode 100644 index de3b381..0000000 --- a/node_modules/mathjs/lib/cjs/utils/scope.js +++ /dev/null @@ -1,23 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/utils/snapshot.js b/node_modules/mathjs/lib/cjs/utils/snapshot.js deleted file mode 100644 index 46f77b8..0000000 --- a/node_modules/mathjs/lib/cjs/utils/snapshot.js +++ /dev/null @@ -1,254 +0,0 @@ -"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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } -/** - * 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 => { - var _factory$meta$formerl, _factory$meta; - 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'; - const former = (_factory$meta$formerl = (_factory$meta = factory.meta) === null || _factory$meta === void 0 ? void 0 : _factory$meta.formerly) !== null && _factory$meta$formerl !== void 0 ? _factory$meta$formerl : ''; - allFactoryFunctions[factoryName] = 'function'; - allFunctionsConstantsClasses[name] = validateTypeOf(math[name]); - if (former) { - allFunctionsConstantsClasses[former] = allFunctionsConstantsClasses[name]; - } - allDependencyCollections[dependenciesName] = 'Object'; - if (isTransformFunction) { - allTransformFunctions[name] = 'function'; - if (former) allTransformFunctions[former] = 'function'; - } - if (isClass) { - if ((0, _string.endsWith)(name, 'Node')) { - allNodeClasses[name] = 'function'; - } else { - allClasses[name] = 'function'; - } - } else { - allFunctionsConstants[name] = validateTypeOf(math[name]); - if (former) allFunctionsConstants[former] = allFunctionsConstants[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', 'addScalar', 'subtractScalar', 'multiplyScalar', 'print', 'divideScalar', 'parse', 'compile', 'parser', 'chain', 'coulomb', '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/node_modules/mathjs/lib/cjs/utils/string.js b/node_modules/mathjs/lib/cjs/utils/string.js deleted file mode 100644 index 0fa30cf..0000000 --- a/node_modules/mathjs/lib/cjs/utils/string.js +++ /dev/null @@ -1,203 +0,0 @@ -"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 === 'bigint' && typeof value.n === 'bigint' && typeof value.d === 'bigint' || 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/node_modules/mathjs/lib/cjs/utils/switch.js b/node_modules/mathjs/lib/cjs/utils/switch.js deleted file mode 100644 index ad5f8ec..0000000 --- a/node_modules/mathjs/lib/cjs/utils/switch.js +++ /dev/null @@ -1,26 +0,0 @@ -"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/node_modules/mathjs/lib/cjs/version.js b/node_modules/mathjs/lib/cjs/version.js deleted file mode 100644 index ab4bdee..0000000 --- a/node_modules/mathjs/lib/cjs/version.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.version = void 0; -const version = exports.version = '15.1.1'; -// 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/node_modules/mathjs/lib/esm/constants.js b/node_modules/mathjs/lib/esm/constants.js deleted file mode 100644 index 191b47f..0000000 --- a/node_modules/mathjs/lib/esm/constants.js +++ /dev/null @@ -1,124 +0,0 @@ -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'], _ref0 => { - var { - config, - BigNumber - } = _ref0; - 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'], _ref1 => { - var { - config, - BigNumber - } = _ref1; - return config.number === 'BigNumber' ? new BigNumber('0.5').sqrt() : Math.SQRT1_2; -}); -export var createSQRT2 = /* #__PURE__ */recreateFactory('SQRT2', ['config', '?BigNumber'], _ref10 => { - var { - config, - BigNumber - } = _ref10; - return config.number === 'BigNumber' ? new BigNumber(2).sqrt() : Math.SQRT2; -}); -export var createI = /* #__PURE__ */recreateFactory('i', ['Complex'], _ref11 => { - var { - Complex - } = _ref11; - return Complex.I; -}); - -// for backward compatibility with v5 -export var createUppercasePi = /* #__PURE__ */factory('PI', ['pi'], _ref12 => { - var { - pi - } = _ref12; - return pi; -}); -export var createUppercaseE = /* #__PURE__ */factory('E', ['e'], _ref13 => { - var { - e - } = _ref13; - 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/node_modules/mathjs/lib/esm/core/config.js b/node_modules/mathjs/lib/esm/core/config.js deleted file mode 100644 index d936db2..0000000 --- a/node_modules/mathjs/lib/esm/core/config.js +++ /dev/null @@ -1,29 +0,0 @@ -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, - // legacy behavior for matrix subset. When true, the subset function - // returns a matrix or array with the same size as the index (except for scalars). - // When false, it returns a matrix or array with a size depending on the type of index. - legacySubset: false -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/core/create.js b/node_modules/mathjs/lib/esm/core/create.js deleted file mode 100644 index 15baadf..0000000 --- a/node_modules/mathjs/lib/esm/core/create.js +++ /dev/null @@ -1,205 +0,0 @@ -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/node_modules/mathjs/lib/esm/core/function/config.js b/node_modules/mathjs/lib/esm/core/function/config.js deleted file mode 100644 index 0cbca3c..0000000 --- a/node_modules/mathjs/lib/esm/core/function/config.js +++ /dev/null @@ -1,111 +0,0 @@ -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', 'bigint', '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); - } - if (options.legacySubset === true) { - // this if is only for backwards compatibility, it can be removed in the future. - console.warn('Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated in the future.'); - } - 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/node_modules/mathjs/lib/esm/core/function/import.js b/node_modules/mathjs/lib/esm/core/function/import.js deleted file mode 100644 index 10eccf6..0000000 --- a/node_modules/mathjs/lib/esm/core/function/import.js +++ /dev/null @@ -1,348 +0,0 @@ -import { isBigNumber, isComplex, isFraction, isMatrix, isObject, 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 - * - * History: - * - * v0.2 Created - * v0.7 Changed second parameter to an options object - * v2 Dropped support for direct import of a module by name - * v14.2 Add facility for specifying the former name of an import - * - * @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 (isObject(value) || isModule(value)) { - 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) { - var _math$Unit; - // 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; - } - var isDefined = math[name] !== undefined; - var isValuelessUnit = (_math$Unit = math.Unit) === null || _math$Unit === void 0 ? void 0 : _math$Unit.isValuelessUnit(name); - if (!isDefined && !isValuelessUnit || 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 _factory$meta$formerl, _factory$meta; - 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'); - } - }; - var former = (_factory$meta$formerl = (_factory$meta = factory.meta) === null || _factory$meta === void 0 ? void 0 : _factory$meta.formerly) !== null && _factory$meta$formerl !== void 0 ? _factory$meta$formerl : ''; - var needsTransform = isTransformFunctionFactory(factory) || factoryAllowedInExpressions(factory); - var withTransform = math.expression.mathWithTransform; - - // TODO: add unit test with non-lazy factory - if (!factory.meta || factory.meta.lazy !== false) { - lazy(namespace, name, resolver); - if (former) lazy(namespace, former, 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); - if (former) _deleteTransform(former); - } else { - if (needsTransform) { - lazy(withTransform, name, () => namespace[name]); - if (former) lazy(withTransform, former, () => namespace[name]); - } - } - } else { - namespace[name] = resolver(); - if (former) namespace[former] = namespace[name]; - - // 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); - if (former) _deleteTransform(former); - } else { - if (needsTransform) { - lazy(withTransform, name, () => namespace[name]); - if (former) lazy(withTransform, former, () => 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 isModule(object) { - return typeof object === 'object' && object[Symbol.toStringTag] === 'Module'; - } - 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/node_modules/mathjs/lib/esm/core/function/typed.js b/node_modules/mathjs/lib/esm/core/function/typed.js deleted file mode 100644 index 585f884..0000000 --- a/node_modules/mathjs/lib/esm/core/function/typed.js +++ /dev/null @@ -1,455 +0,0 @@ -/** - * 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-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\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\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-\u1C8A\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-\uA7DC\uA7F1-\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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43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\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\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\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]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])(?:[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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1C8A\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-\uA7DC\uA7F1-\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\u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2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\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\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\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]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*$/.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); - } - }, { - 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/node_modules/mathjs/lib/esm/defaultInstance.js b/node_modules/mathjs/lib/esm/defaultInstance.js deleted file mode 100644 index 630e984..0000000 --- a/node_modules/mathjs/lib/esm/defaultInstance.js +++ /dev/null @@ -1,3 +0,0 @@ -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/node_modules/mathjs/lib/esm/entry/allFactoriesAny.js b/node_modules/mathjs/lib/esm/entry/allFactoriesAny.js deleted file mode 100644 index b4e11fb..0000000 --- a/node_modules/mathjs/lib/esm/entry/allFactoriesAny.js +++ /dev/null @@ -1,3 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/entry/allFactoriesNumber.js b/node_modules/mathjs/lib/esm/entry/allFactoriesNumber.js deleted file mode 100644 index e4221a3..0000000 --- a/node_modules/mathjs/lib/esm/entry/allFactoriesNumber.js +++ /dev/null @@ -1,3 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/entry/configReadonly.js b/node_modules/mathjs/lib/esm/entry/configReadonly.js deleted file mode 100644 index c6f5702..0000000 --- a/node_modules/mathjs/lib/esm/entry/configReadonly.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js deleted file mode 100644 index 2ca030e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny.generated.js +++ /dev/null @@ -1,374 +0,0 @@ -/** - * 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 { 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 { bernoulliDependencies } from './dependenciesAny/dependenciesBernoulli.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 { coulombConstantDependencies } from './dependenciesAny/dependenciesCoulombConstant.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 { isBoundedDependencies } from './dependenciesAny/dependenciesIsBounded.generated.js'; -export { isFiniteDependencies } from './dependenciesAny/dependenciesIsFinite.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 { mapSlicesDependencies } from './dependenciesAny/dependenciesMapSlices.generated.js'; -export { mapSlicesTransformDependencies } from './dependenciesAny/dependenciesMapSlicesTransform.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 { nullishDependencies } from './dependenciesAny/dependenciesNullish.generated.js'; -export { nullishTransformDependencies } from './dependenciesAny/dependenciesNullishTransform.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 { toBestDependencies } from './dependenciesAny/dependenciesToBest.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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js deleted file mode 100644 index fd8dd2f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAbs.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js deleted file mode 100644 index 08601f6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAccessorNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js deleted file mode 100644 index a88d60d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcos.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js deleted file mode 100644 index f5ff7aa..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcosh.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js deleted file mode 100644 index 178f6a5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcot.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js deleted file mode 100644 index 0bc9997..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcoth.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js deleted file mode 100644 index cc075d4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsc.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js deleted file mode 100644 index 197e00b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAcsch.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js deleted file mode 100644 index 2806c0f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAdd.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js deleted file mode 100644 index d1cb442..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAddScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js deleted file mode 100644 index acc9883..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAnd.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js deleted file mode 100644 index d22c0cd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAndTransform.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js deleted file mode 100644 index 6181dfe..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArg.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js deleted file mode 100644 index 66403fd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesArrayNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js deleted file mode 100644 index 3173050..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsec.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js deleted file mode 100644 index d061320..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsech.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js deleted file mode 100644 index 1367635..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsin.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js deleted file mode 100644 index bcce057..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAsinh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js deleted file mode 100644 index 28d47d5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAssignmentNode.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js deleted file mode 100644 index b9b5fcc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js deleted file mode 100644 index 9071251..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtan2.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js deleted file mode 100644 index ab877f5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtanh.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js deleted file mode 100644 index 84ad047..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAtomicMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js deleted file mode 100644 index f2339b0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesAvogadro.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js deleted file mode 100644 index 369a7f0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBellNumbers.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBernoulli.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBernoulli.generated.js deleted file mode 100644 index ed35813..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBernoulli.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; -import { FractionDependencies } from './dependenciesFractionClass.generated.js'; -import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; -import { numberDependencies } from './dependenciesNumber.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createBernoulli } from '../../factoriesAny.js'; -export var bernoulliDependencies = { - BigNumberDependencies, - FractionDependencies, - isIntegerDependencies, - numberDependencies, - typedDependencies, - createBernoulli -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js deleted file mode 100644 index fcc8438..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigNumberClass.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigint.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigint.generated.js deleted file mode 100644 index a67aeea..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBigint.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js deleted file mode 100644 index e9aabaf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBignumber.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js deleted file mode 100644 index 37befba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBin.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js deleted file mode 100644 index d248298..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAnd.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js deleted file mode 100644 index a5f0274..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitAndTransform.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js deleted file mode 100644 index f4ecf43..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitNot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js deleted file mode 100644 index d24033d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOr.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOrTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOrTransform.generated.js deleted file mode 100644 index 075aaf6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitOrTransform.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js deleted file mode 100644 index 35fa96a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - matrixDependencies, - typedDependencies, - createBitXor -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js deleted file mode 100644 index d55f841..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBlockNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js deleted file mode 100644 index fd4895f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrMagneton.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js deleted file mode 100644 index aea8671..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBohrRadius.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js deleted file mode 100644 index 3ce13ae..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoltzmann.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js deleted file mode 100644 index 61e5c46..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesBoolean.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js deleted file mode 100644 index 06264f3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCatalan.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js deleted file mode 100644 index 051d9c8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCbrt.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js deleted file mode 100644 index fa6d3b8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCeil.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js deleted file mode 100644 index 8d9e793..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChain.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js deleted file mode 100644 index 19a1f4b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js deleted file mode 100644 index 2de8c67..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClassicalElectronRadius.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js deleted file mode 100644 index 2e9077b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesClone.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js deleted file mode 100644 index 61447d1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumn.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js deleted file mode 100644 index d6bc3ef..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesColumnTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js deleted file mode 100644 index 926c7cd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinations.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js deleted file mode 100644 index 271eeaf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCombinationsWithRep.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js deleted file mode 100644 index f8acf75..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompare.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js deleted file mode 100644 index 8ecb045..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareNatural.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js deleted file mode 100644 index b01987f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompareText.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js deleted file mode 100644 index c4e6841..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCompile.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js deleted file mode 100644 index 42e2055..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplex.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js deleted file mode 100644 index abd54d9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComplexClass.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js deleted file mode 100644 index c585659..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesComposition.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js deleted file mode 100644 index 9a9956c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcat.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js deleted file mode 100644 index 11baf40..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConcatTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js deleted file mode 100644 index 8001ce1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConditionalNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js deleted file mode 100644 index 61ef521..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConductanceQuantum.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js deleted file mode 100644 index 4d698d1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConj.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js deleted file mode 100644 index 3fa1af7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesConstantNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { NodeDependencies } from './dependenciesNode.generated.js'; -import { isBoundedDependencies } from './dependenciesIsBounded.generated.js'; -import { createConstantNode } from '../../factoriesAny.js'; -export var ConstantNodeDependencies = { - NodeDependencies, - isBoundedDependencies, - createConstantNode -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCorr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCorr.generated.js deleted file mode 100644 index ffe2fd1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCorr.generated.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js deleted file mode 100644 index ee553b4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCos.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js deleted file mode 100644 index 4c352e8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCosh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js deleted file mode 100644 index 478e8c7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCot.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js deleted file mode 100644 index 62f4381..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoth.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js deleted file mode 100644 index 59be861..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulomb.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulombConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulombConstant.generated.js deleted file mode 100644 index c7dd4a8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCoulombConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js'; -import { UnitDependencies } from './dependenciesUnitClass.generated.js'; -import { createCoulombConstant } from '../../factoriesAny.js'; -export var coulombConstantDependencies = { - BigNumberDependencies, - UnitDependencies, - createCoulombConstant -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js deleted file mode 100644 index 40d37b5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCount.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js deleted file mode 100644 index cdfe9d8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCreateUnit.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js deleted file mode 100644 index 91b7ad4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCross.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js deleted file mode 100644 index 5cc6190..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsc.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js deleted file mode 100644 index 5ce6e0b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCsch.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js deleted file mode 100644 index 4d0cec5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCtranspose.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js deleted file mode 100644 index f42092f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCube.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSum.generated.js deleted file mode 100644 index 05941ff..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSum.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSumTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSumTransform.generated.js deleted file mode 100644 index fef6c6e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesCumSumTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js deleted file mode 100644 index 94eb7b6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeepEqual.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js deleted file mode 100644 index bad8bd2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDenseMatrixClass.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js deleted file mode 100644 index 3ac3894..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDerivative.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js deleted file mode 100644 index 7a706ab..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js deleted file mode 100644 index 605ff5a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDeuteronMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js deleted file mode 100644 index b852edf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiag.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js deleted file mode 100644 index 433e6b8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiff.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js deleted file mode 100644 index 4781b34..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDiffTransform.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js deleted file mode 100644 index 5e034ee..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDistance.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js deleted file mode 100644 index 4db584f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivide.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js deleted file mode 100644 index 8333cb9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDivideScalar.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js deleted file mode 100644 index 6f5a94a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDot.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js deleted file mode 100644 index 6fd411a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - divideScalarDependencies, - equalScalarDependencies, - matrixDependencies, - typedDependencies, - createDotDivide -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js deleted file mode 100644 index 63b2c77..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotMultiply.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js deleted file mode 100644 index c97e977..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - equalScalarDependencies, - matrixDependencies, - powDependencies, - typedDependencies, - createDotPow -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js deleted file mode 100644 index d4f8086..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesE.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js deleted file mode 100644 index e4a46fa..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEfimovFactor.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js deleted file mode 100644 index 7dacf86..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEigs.generated.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js deleted file mode 100644 index 711df06..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectricConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js deleted file mode 100644 index 75b98ea..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElectronMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js deleted file mode 100644 index 85874ee..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesElementaryCharge.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js deleted file mode 100644 index 4383097..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - equalScalarDependencies, - matrixDependencies, - typedDependencies, - createEqual -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js deleted file mode 100644 index ac93e47..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js deleted file mode 100644 index 7336e81..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEqualText.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js deleted file mode 100644 index ff4636e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesErf.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js deleted file mode 100644 index dc0ce5b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesEvaluate.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js deleted file mode 100644 index 803f469..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExp.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js deleted file mode 100644 index 13c62ae..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js deleted file mode 100644 index 00c7bf4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesExpm1.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js deleted file mode 100644 index fae74be..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFactorial.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js deleted file mode 100644 index 5694706..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFalse.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js deleted file mode 100644 index b97f80b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFaraday.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js deleted file mode 100644 index daab210..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFermiCoupling.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js deleted file mode 100644 index 303aa12..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFft.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js deleted file mode 100644 index 7df71d7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFibonacciHeapClass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js deleted file mode 100644 index d564159..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilter.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js deleted file mode 100644 index 48a768c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFilterTransform.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js deleted file mode 100644 index d30692d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFineStructure.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js deleted file mode 100644 index 571fb9b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFirstRadiation.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js deleted file mode 100644 index 390b0d9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFix.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js deleted file mode 100644 index f53888b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js deleted file mode 100644 index 9d681fb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFloor.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js deleted file mode 100644 index e39b6fe..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEach.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js deleted file mode 100644 index 1d33837..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesForEachTransform.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js deleted file mode 100644 index d7d47cd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFormat.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js deleted file mode 100644 index 502b793..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFraction.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js deleted file mode 100644 index 139d2b8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFractionClass.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js deleted file mode 100644 index f60cfd9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFreqz.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js deleted file mode 100644 index a191dcd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionAssignmentNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js deleted file mode 100644 index 45d4dbd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesFunctionNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js deleted file mode 100644 index 56cabf8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGamma.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js deleted file mode 100644 index ffc3038..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGasConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js deleted file mode 100644 index becb59f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGcd.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js deleted file mode 100644 index 8e7a996..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGetMatrixDataType.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js deleted file mode 100644 index 0f7f12a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravitationConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js deleted file mode 100644 index 1030929..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesGravity.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js deleted file mode 100644 index 76a305d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHartreeEnergy.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js deleted file mode 100644 index 5eb4dfb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHasNumericValue.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js deleted file mode 100644 index 58549f6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelp.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js deleted file mode 100644 index 9ce8fa2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHelpClass.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js deleted file mode 100644 index 480205f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHex.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js deleted file mode 100644 index 8100654..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesHypot.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js deleted file mode 100644 index 045dbf0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesI.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js deleted file mode 100644 index 4e118ff..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIdentity.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js deleted file mode 100644 index e8d8d9c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIfft.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js deleted file mode 100644 index 1e7da81..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIm.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js deleted file mode 100644 index 8f5067d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js deleted file mode 100644 index 900da1e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndex.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js deleted file mode 100644 index 8b160c3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexClass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js deleted file mode 100644 index 8f2bc19..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js deleted file mode 100644 index 3fb64ec..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIndexTransform.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js deleted file mode 100644 index 870e9e1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInfinity.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js deleted file mode 100644 index 46ff3fb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIntersect.generated.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js deleted file mode 100644 index 8a19c5f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInv.generated.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js deleted file mode 100644 index 2cd33b1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInverseConductanceQuantum.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js deleted file mode 100644 index 461ee3f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsBounded.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsBounded.generated.js deleted file mode 100644 index 97fcc99..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsBounded.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createIsBounded } from '../../factoriesAny.js'; -export var isBoundedDependencies = { - typedDependencies, - createIsBounded -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsFinite.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsFinite.generated.js deleted file mode 100644 index 664a4e4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsFinite.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isBoundedDependencies } from './dependenciesIsBounded.generated.js'; -import { mapDependencies } from './dependenciesMap.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createIsFinite } from '../../factoriesAny.js'; -export var isFiniteDependencies = { - isBoundedDependencies, - mapDependencies, - typedDependencies, - createIsFinite -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js deleted file mode 100644 index a2105c1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsInteger.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { equalDependencies } from './dependenciesEqual.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createIsInteger } from '../../factoriesAny.js'; -export var isIntegerDependencies = { - equalDependencies, - typedDependencies, - createIsInteger -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js deleted file mode 100644 index 797b48a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNaN.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js deleted file mode 100644 index f2b83ad..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNegative.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js deleted file mode 100644 index 00cdec9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsNumeric.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js deleted file mode 100644 index 1aa1b12..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPositive.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js deleted file mode 100644 index f714257..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsPrime.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js deleted file mode 100644 index 7e28646..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesIsZero.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js deleted file mode 100644 index 15edb1d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js deleted file mode 100644 index c8439b6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKlitzing.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js deleted file mode 100644 index 38af28c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesKron.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js deleted file mode 100644 index f2d08b7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN10.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js deleted file mode 100644 index 9c5386c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLN2.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js deleted file mode 100644 index ef35cd5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG10E.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js deleted file mode 100644 index c9e71e3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLOG2E.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js deleted file mode 100644 index d91f032..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; -import { bignumberDependencies } from './dependenciesBignumber.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, - SparseMatrixDependencies, - bignumberDependencies, - concatDependencies, - matrixDependencies, - typedDependencies, - createLarger -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js deleted file mode 100644 index 2cc17fe..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - matrixDependencies, - typedDependencies, - createLargerEq -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js deleted file mode 100644 index 191be38..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLcm.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeafCount.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeafCount.generated.js deleted file mode 100644 index 29a4a9f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeafCount.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js deleted file mode 100644 index 66b63b1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLeftShift.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js deleted file mode 100644 index de9a2fb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js deleted file mode 100644 index 3a5a131..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { ComplexDependencies } from './dependenciesComplexClass.generated.js'; -import { divideScalarDependencies } from './dependenciesDivideScalar.generated.js'; -import { typeOfDependencies } from './dependenciesTypeOf.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createLog } from '../../factoriesAny.js'; -export var logDependencies = { - ComplexDependencies, - divideScalarDependencies, - typeOfDependencies, - typedDependencies, - createLog -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js deleted file mode 100644 index e5db01f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog10.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js deleted file mode 100644 index 95cdacf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog1p.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js deleted file mode 100644 index 0f9eb10..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLog2.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js deleted file mode 100644 index e2559c8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLoschmidt.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js deleted file mode 100644 index 5a20446..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolve.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js deleted file mode 100644 index a190c2f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLsolveAll.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js deleted file mode 100644 index 659c798..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLup.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js deleted file mode 100644 index 265740a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLusolve.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLyap.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLyap.generated.js deleted file mode 100644 index 799f98d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesLyap.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js deleted file mode 100644 index 82b4091..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMad.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js deleted file mode 100644 index 3ad2da9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js deleted file mode 100644 index 178fe1a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMagneticFluxQuantum.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js deleted file mode 100644 index a3e60dc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMap.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapSlices.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapSlices.generated.js deleted file mode 100644 index a4cfd19..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapSlices.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createMapSlices } from '../../factoriesAny.js'; -export var mapSlicesDependencies = { - isIntegerDependencies, - typedDependencies, - createMapSlices -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapSlicesTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapSlicesTransform.generated.js deleted file mode 100644 index 4a642b4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapSlicesTransform.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createMapSlicesTransform } from '../../factoriesAny.js'; -export var mapSlicesTransformDependencies = { - isIntegerDependencies, - typedDependencies, - createMapSlicesTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js deleted file mode 100644 index dbc5460..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMapTransform.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js deleted file mode 100644 index ab09ac4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrix.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js deleted file mode 100644 index 12ff246..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixClass.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js deleted file mode 100644 index b63e1b2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromColumns.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js deleted file mode 100644 index a20f85b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromFunction.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js deleted file mode 100644 index adf7c20..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMatrixFromRows.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js deleted file mode 100644 index 046b811..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMax.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - largerDependencies, - numericDependencies, - typedDependencies, - createMax -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js deleted file mode 100644 index b492145..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMaxTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - largerDependencies, - numericDependencies, - typedDependencies, - createMaxTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js deleted file mode 100644 index 1d5b71b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMean.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js deleted file mode 100644 index 478c6d1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMeanTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js deleted file mode 100644 index 6618e5c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMedian.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js deleted file mode 100644 index f2dd559..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMin.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - numericDependencies, - smallerDependencies, - typedDependencies, - createMin -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js deleted file mode 100644 index e809197..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMinTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - numericDependencies, - smallerDependencies, - typedDependencies, - createMinTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js deleted file mode 100644 index 54cad6f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMod.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js deleted file mode 100644 index 1bcd89b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMode.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js deleted file mode 100644 index f1e27ea..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js deleted file mode 100644 index 728a849..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarMassC12.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js deleted file mode 100644 index 288b280..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarPlanckConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js deleted file mode 100644 index f8f7312..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMolarVolume.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js deleted file mode 100644 index f72fb19..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultinomial.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js deleted file mode 100644 index 5b6a14b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiply.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js deleted file mode 100644 index c47ed5d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesMultiplyScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js deleted file mode 100644 index 159644f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNaN.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js deleted file mode 100644 index 4e85f4f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNeutronMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js deleted file mode 100644 index 41e5cf8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNode.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js deleted file mode 100644 index 8acf1ed..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNorm.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js deleted file mode 100644 index 0954db4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js deleted file mode 100644 index f82ca35..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoot.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js deleted file mode 100644 index 830652c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNthRoots.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js deleted file mode 100644 index aff4825..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNuclearMagneton.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js deleted file mode 100644 index 8aa017c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNull.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNullish.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNullish.generated.js deleted file mode 100644 index 719cbc4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNullish.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { deepEqualDependencies } from './dependenciesDeepEqual.generated.js'; -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 { createNullish } from '../../factoriesAny.js'; -export var nullishDependencies = { - deepEqualDependencies, - flattenDependencies, - matrixDependencies, - sizeDependencies, - typedDependencies, - createNullish -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNullishTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNullishTransform.generated.js deleted file mode 100644 index da1448e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNullishTransform.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { deepEqualDependencies } from './dependenciesDeepEqual.generated.js'; -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 { createNullishTransform } from '../../factoriesAny.js'; -export var nullishTransformDependencies = { - deepEqualDependencies, - flattenDependencies, - matrixDependencies, - sizeDependencies, - typedDependencies, - createNullishTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js deleted file mode 100644 index 6bde859..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumber.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js deleted file mode 100644 index cb0b193..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesNumeric.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js deleted file mode 100644 index d0b0d71..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesObjectNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js deleted file mode 100644 index 38c424c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOct.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js deleted file mode 100644 index d486f28..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOnes.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js deleted file mode 100644 index 64ff770..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOperatorNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js deleted file mode 100644 index 9b4a16c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOr.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOrTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOrTransform.generated.js deleted file mode 100644 index 852045c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesOrTransform.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js deleted file mode 100644 index 92d4445..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParenthesisNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js deleted file mode 100644 index 136168d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParse.generated.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js deleted file mode 100644 index f50f56a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParser.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js deleted file mode 100644 index b689be9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesParserClass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { evaluateDependencies } from './dependenciesEvaluate.generated.js'; -import { parseDependencies } from './dependenciesParse.generated.js'; -import { createParserClass } from '../../factoriesAny.js'; -export var ParserDependencies = { - evaluateDependencies, - parseDependencies, - createParserClass -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js deleted file mode 100644 index ecd2205..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPartitionSelect.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js deleted file mode 100644 index 2c5449b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPermutations.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js deleted file mode 100644 index fa8e2c6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPhi.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js deleted file mode 100644 index 2327874..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPi.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js deleted file mode 100644 index a6809db..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPickRandom.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js deleted file mode 100644 index d1dedbc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js deleted file mode 100644 index b3849ae..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckCharge.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js deleted file mode 100644 index d2c4c62..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js deleted file mode 100644 index 221d993..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckLength.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js deleted file mode 100644 index 209989d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js deleted file mode 100644 index 7eac32c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTemperature.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js deleted file mode 100644 index 9d07160..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPlanckTime.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js deleted file mode 100644 index 1879945..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPolynomialRoot.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js deleted file mode 100644 index 3c84571..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js deleted file mode 100644 index 731a3bd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrint.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrintTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrintTransform.generated.js deleted file mode 100644 index d80d6c1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesPrintTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js deleted file mode 100644 index 59fe201..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProd.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js deleted file mode 100644 index 351feae..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesProtonMass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js deleted file mode 100644 index 047a07b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQr.generated.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js deleted file mode 100644 index d6a2e24..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 { mapSlicesDependencies } from './dependenciesMapSlices.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, - mapSlicesDependencies, - multiplyDependencies, - partitionSelectDependencies, - smallerDependencies, - smallerEqDependencies, - subtractDependencies, - typedDependencies, - createQuantileSeq -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js deleted file mode 100644 index 181b847..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 { mapSlicesDependencies } from './dependenciesMapSlices.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, - mapSlicesDependencies, - multiplyDependencies, - partitionSelectDependencies, - smallerDependencies, - smallerEqDependencies, - subtractDependencies, - typedDependencies, - createQuantileSeqTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js deleted file mode 100644 index 5f05d77..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesQuantumOfCirculation.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js deleted file mode 100644 index b11fb5b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandom.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js deleted file mode 100644 index 6086a51..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { log2Dependencies } from './dependenciesLog2.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createRandomInt } from '../../factoriesAny.js'; -export var randomIntDependencies = { - log2Dependencies, - typedDependencies, - createRandomInt -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js deleted file mode 100644 index b295430..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRange.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 { equalDependencies } from './dependenciesEqual.generated.js'; -import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; -import { isZeroDependencies } from './dependenciesIsZero.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, - equalDependencies, - isPositiveDependencies, - isZeroDependencies, - largerDependencies, - largerEqDependencies, - smallerDependencies, - smallerEqDependencies, - typedDependencies, - createRange -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js deleted file mode 100644 index dc28667..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeClass.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js deleted file mode 100644 index 829b356..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js deleted file mode 100644 index 8bed71c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRangeTransform.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 { equalDependencies } from './dependenciesEqual.generated.js'; -import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; -import { isZeroDependencies } from './dependenciesIsZero.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, - equalDependencies, - isPositiveDependencies, - isZeroDependencies, - largerDependencies, - largerEqDependencies, - smallerDependencies, - smallerEqDependencies, - typedDependencies, - createRangeTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js deleted file mode 100644 index b444849..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js deleted file mode 100644 index addd9fc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRe.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js deleted file mode 100644 index 58f1fcd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReducedPlanckConstant.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js deleted file mode 100644 index f76b3f5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRelationalNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js deleted file mode 100644 index 6fcdff6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReplacer.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js deleted file mode 100644 index 1668dd9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReshape.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js deleted file mode 100644 index 3ffb8bf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResize.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js deleted file mode 100644 index 4512fae..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js deleted file mode 100644 index 41f61b6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesResultSet.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js deleted file mode 100644 index 3dd5918..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesReviver.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js deleted file mode 100644 index daf2347..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightArithShift.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js deleted file mode 100644 index 22dade3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRightLogShift.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js deleted file mode 100644 index faf69a1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotate.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js deleted file mode 100644 index 667ce47..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRotationMatrix.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js deleted file mode 100644 index 38f9715..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRound.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js deleted file mode 100644 index 78165be..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRow.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js deleted file mode 100644 index b5d752f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRowTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js deleted file mode 100644 index 7494da9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesRydberg.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js deleted file mode 100644 index 1b52232..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT1_2.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js deleted file mode 100644 index 3ed6f02..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSQRT2.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js deleted file mode 100644 index c5dcbee..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSackurTetrode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSchur.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSchur.generated.js deleted file mode 100644 index d378d60..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSchur.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js deleted file mode 100644 index cadafe2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSec.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js deleted file mode 100644 index 51c336e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSech.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js deleted file mode 100644 index 29a2a14..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSecondRadiation.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js deleted file mode 100644 index 5156f57..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetCartesian.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js deleted file mode 100644 index da3d014..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDifference.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js deleted file mode 100644 index 2fa0712..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetDistinct.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js deleted file mode 100644 index 9af570f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIntersect.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js deleted file mode 100644 index a868e2e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetIsSubset.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js deleted file mode 100644 index 4a9cdeb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetMultiplicity.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js deleted file mode 100644 index 9914a7d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetPowerset.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js deleted file mode 100644 index 7dcdab9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSize.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js deleted file mode 100644 index 3a3cee2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetSymDifference.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js deleted file mode 100644 index c288bf6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSetUnion.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js deleted file mode 100644 index e3f38ba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSign.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js deleted file mode 100644 index 056e865..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 { equalDependencies } from './dependenciesEqual.generated.js'; -import { parseDependencies } from './dependenciesParse.generated.js'; -import { replacerDependencies } from './dependenciesReplacer.generated.js'; -import { resolveDependencies } from './dependenciesResolve.generated.js'; -import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js'; -import { simplifyCoreDependencies } from './dependenciesSimplifyCore.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createSimplify } from '../../factoriesAny.js'; -export var simplifyDependencies = { - AccessorNodeDependencies, - ArrayNodeDependencies, - ConstantNodeDependencies, - FunctionNodeDependencies, - IndexNodeDependencies, - ObjectNodeDependencies, - OperatorNodeDependencies, - ParenthesisNodeDependencies, - SymbolNodeDependencies, - equalDependencies, - parseDependencies, - replacerDependencies, - resolveDependencies, - simplifyConstantDependencies, - simplifyCoreDependencies, - typedDependencies, - createSimplify -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js deleted file mode 100644 index e374a9a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 { isBoundedDependencies } from './dependenciesIsBounded.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, - isBoundedDependencies, - matrixDependencies, - typedDependencies, - createSimplifyConstant -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js deleted file mode 100644 index aea2f14..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js deleted file mode 100644 index 44dc216..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSin.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js deleted file mode 100644 index 6eacc28..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSinh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js deleted file mode 100644 index f12009a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSize.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createSize } from '../../factoriesAny.js'; -export var sizeDependencies = { - typedDependencies, - createSize -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js deleted file mode 100644 index a348ceb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSlu.generated.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js deleted file mode 100644 index fc80104..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.generated.js'; -import { bignumberDependencies } from './dependenciesBignumber.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, - SparseMatrixDependencies, - bignumberDependencies, - concatDependencies, - matrixDependencies, - typedDependencies, - createSmaller -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js deleted file mode 100644 index 2b3a5f5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - matrixDependencies, - typedDependencies, - createSmallerEq -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js deleted file mode 100644 index 622f62c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSolveODE.generated.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js deleted file mode 100644 index 7ce4fa8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSort.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js deleted file mode 100644 index 2a2c95c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpaClass.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js deleted file mode 100644 index 2166043..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparse.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js deleted file mode 100644 index 220d4be..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSparseMatrixClass.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js deleted file mode 100644 index 963a387..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSpeedOfLight.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js deleted file mode 100644 index 67bfa6a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSplitUnit.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js deleted file mode 100644 index f2a68df..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrt.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js deleted file mode 100644 index ad6688f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js deleted file mode 100644 index 8c24c0e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSquare.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js deleted file mode 100644 index 09c4252..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js deleted file mode 100644 index ae94431..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js deleted file mode 100644 index c2ff940..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js deleted file mode 100644 index ee5c4d5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStefanBoltzmann.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js deleted file mode 100644 index de8a193..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesStirlingS2.generated.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js deleted file mode 100644 index e7d173e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesString.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js deleted file mode 100644 index 0b4285d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubset.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js deleted file mode 100644 index 0fb19e5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubsetTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js deleted file mode 100644 index a10379a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtract.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtractScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtractScalar.generated.js deleted file mode 100644 index b339578..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSubtractScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js deleted file mode 100644 index 49fc33d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSum.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js deleted file mode 100644 index a21526f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSumTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSylvester.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSylvester.generated.js deleted file mode 100644 index 371d0c5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSylvester.generated.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js deleted file mode 100644 index dcde6cf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js deleted file mode 100644 index 6f529c3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesSymbolicEqual.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js deleted file mode 100644 index e445666..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTan.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js deleted file mode 100644 index d770f24..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTanh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js deleted file mode 100644 index 8cf5bda..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTau.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js deleted file mode 100644 index 92d52f8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesThomsonCrossSection.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js deleted file mode 100644 index c1f15e7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTo.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesToBest.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesToBest.generated.js deleted file mode 100644 index b74bd1d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesToBest.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createToBest } from '../../factoriesAny.js'; -export var toBestDependencies = { - typedDependencies, - createToBest -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js deleted file mode 100644 index 48b6db0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrace.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js deleted file mode 100644 index d89ace7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTranspose.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js deleted file mode 100644 index c4e92e0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTrue.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js deleted file mode 100644 index d9aa68b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTypeOf.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js deleted file mode 100644 index 61e4723..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesTyped.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js deleted file mode 100644 index 465375d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryMinus.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js deleted file mode 100644 index 5b63a38..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnaryPlus.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js deleted file mode 100644 index 09199fb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - equalScalarDependencies, - matrixDependencies, - typedDependencies, - createUnequal -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js deleted file mode 100644 index dd979b4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitClass.generated.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js deleted file mode 100644 index 2b82164..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUnitFunction.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js deleted file mode 100644 index 2c7a8a5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercaseE.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js deleted file mode 100644 index fe09896..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUppercasePi.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js deleted file mode 100644 index ca89b20..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolve.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js deleted file mode 100644 index 263b99f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesUsolveAll.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js deleted file mode 100644 index 6be2fb9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVacuumImpedance.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js deleted file mode 100644 index 624066f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { addDependencies } from './dependenciesAdd.generated.js'; -import { divideDependencies } from './dependenciesDivide.generated.js'; -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -import { mapSlicesDependencies } from './dependenciesMapSlices.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, - divideDependencies, - isNaNDependencies, - mapSlicesDependencies, - multiplyDependencies, - subtractDependencies, - typedDependencies, - createVariance -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js deleted file mode 100644 index a5e7a1a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { addDependencies } from './dependenciesAdd.generated.js'; -import { divideDependencies } from './dependenciesDivide.generated.js'; -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -import { mapSlicesDependencies } from './dependenciesMapSlices.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, - divideDependencies, - isNaNDependencies, - mapSlicesDependencies, - multiplyDependencies, - subtractDependencies, - typedDependencies, - createVarianceTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js deleted file mode 100644 index 7c895fe..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesVersion.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js deleted file mode 100644 index 716bbf1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWeakMixingAngle.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js deleted file mode 100644 index 221b0b5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesWienDisplacement.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js deleted file mode 100644 index a2e24d9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXgcd.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js deleted file mode 100644 index 8375996..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { DenseMatrixDependencies } from './dependenciesDenseMatrixClass.generated.js'; -import { SparseMatrixDependencies } from './dependenciesSparseMatrixClass.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, - SparseMatrixDependencies, - concatDependencies, - matrixDependencies, - typedDependencies, - createXor -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js deleted file mode 100644 index de21eba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeros.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeta.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeta.generated.js deleted file mode 100644 index 1edbf0a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZeta.generated.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 { isBoundedDependencies } from './dependenciesIsBounded.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, - isBoundedDependencies, - isNegativeDependencies, - multiplyDependencies, - piDependencies, - powDependencies, - sinDependencies, - smallerEqDependencies, - subtractDependencies, - typedDependencies, - createZeta -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js deleted file mode 100644 index bae859a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesAny/dependenciesZpk2tf.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber.generated.js deleted file mode 100644 index ff66559..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber.generated.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * 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 { 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 { bernoulliDependencies } from './dependenciesNumber/dependenciesBernoulli.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 { isBoundedDependencies } from './dependenciesNumber/dependenciesIsBounded.generated.js'; -export { isFiniteDependencies } from './dependenciesNumber/dependenciesIsFinite.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 { mapSlicesDependencies } from './dependenciesNumber/dependenciesMapSlices.generated.js'; -export { mapSlicesTransformDependencies } from './dependenciesNumber/dependenciesMapSlicesTransform.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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAbs.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAbs.generated.js deleted file mode 100644 index 8e76a18..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAbs.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAccessorNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAccessorNode.generated.js deleted file mode 100644 index eb1fee5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAccessorNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcos.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcos.generated.js deleted file mode 100644 index 898a51e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcos.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcosh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcosh.generated.js deleted file mode 100644 index b84cc05..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcosh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcot.generated.js deleted file mode 100644 index f8db302..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcoth.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcoth.generated.js deleted file mode 100644 index a14ff92..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcoth.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsc.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsc.generated.js deleted file mode 100644 index bc87242..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsc.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsch.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsch.generated.js deleted file mode 100644 index 3faae99..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAcsch.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAdd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAdd.generated.js deleted file mode 100644 index a440e5d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAdd.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAddScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAddScalar.generated.js deleted file mode 100644 index 47cb618..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAddScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAnd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAnd.generated.js deleted file mode 100644 index 045289d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAnd.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesArrayNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesArrayNode.generated.js deleted file mode 100644 index 0651558..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesArrayNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsec.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsec.generated.js deleted file mode 100644 index 79fafbe..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsec.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsech.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsech.generated.js deleted file mode 100644 index 607f607..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsech.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsin.generated.js deleted file mode 100644 index 631c616..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsin.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsinh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsinh.generated.js deleted file mode 100644 index d55d45e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAsinh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js deleted file mode 100644 index 7f83cec..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAssignmentNode.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan.generated.js deleted file mode 100644 index ed88d81..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan2.generated.js deleted file mode 100644 index 8aaaafa..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtan2.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtanh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtanh.generated.js deleted file mode 100644 index d5b8076..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesAtanh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBellNumbers.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBellNumbers.generated.js deleted file mode 100644 index 5464e7a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBellNumbers.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBernoulli.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBernoulli.generated.js deleted file mode 100644 index d67c306..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBernoulli.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; -import { numberDependencies } from './dependenciesNumber.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createBernoulli } from '../../factoriesNumber.js'; -export var bernoulliDependencies = { - isIntegerDependencies, - numberDependencies, - typedDependencies, - createBernoulli -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBigint.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBigint.generated.js deleted file mode 100644 index 77f9760..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBigint.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitAnd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitAnd.generated.js deleted file mode 100644 index 68268db..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitAnd.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitNot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitNot.generated.js deleted file mode 100644 index a8c3bdc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitNot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitOr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitOr.generated.js deleted file mode 100644 index 4aeaeda..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitOr.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitXor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitXor.generated.js deleted file mode 100644 index 81badcb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBitXor.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBlockNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBlockNode.generated.js deleted file mode 100644 index 0043939..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBlockNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBoolean.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBoolean.generated.js deleted file mode 100644 index f25ec83..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesBoolean.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js deleted file mode 100644 index 1933851..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCatalan.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCbrt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCbrt.generated.js deleted file mode 100644 index 48c4f97..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCbrt.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js deleted file mode 100644 index 8563817..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCeil.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChain.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChain.generated.js deleted file mode 100644 index 71e7b15..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChain.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js deleted file mode 100644 index 6a1b57f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesClone.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesClone.generated.js deleted file mode 100644 index 8041edc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesClone.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinations.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinations.generated.js deleted file mode 100644 index 9cda3b5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinations.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js deleted file mode 100644 index e1e4790..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCombinationsWithRep.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompare.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompare.generated.js deleted file mode 100644 index c884350..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompare.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareNatural.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareNatural.generated.js deleted file mode 100644 index 9755e62..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareNatural.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareText.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareText.generated.js deleted file mode 100644 index ea978ce..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompareText.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompile.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompile.generated.js deleted file mode 100644 index 542a1f6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCompile.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesComposition.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesComposition.generated.js deleted file mode 100644 index f330d8e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesComposition.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConditionalNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConditionalNode.generated.js deleted file mode 100644 index 4c34e6a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConditionalNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConstantNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConstantNode.generated.js deleted file mode 100644 index 35b9b96..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesConstantNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { NodeDependencies } from './dependenciesNode.generated.js'; -import { isBoundedDependencies } from './dependenciesIsBounded.generated.js'; -import { createConstantNode } from '../../factoriesNumber.js'; -export var ConstantNodeDependencies = { - NodeDependencies, - isBoundedDependencies, - createConstantNode -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCorr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCorr.generated.js deleted file mode 100644 index d5c9449..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCorr.generated.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCos.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCos.generated.js deleted file mode 100644 index 3e5005c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCos.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCosh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCosh.generated.js deleted file mode 100644 index 2baafcc..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCosh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCot.generated.js deleted file mode 100644 index 674ee60..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCoth.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCoth.generated.js deleted file mode 100644 index 7a0499a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCoth.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsc.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsc.generated.js deleted file mode 100644 index 9f657c9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsc.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsch.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsch.generated.js deleted file mode 100644 index 1744426..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCsch.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCube.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCube.generated.js deleted file mode 100644 index c4ae1d5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCube.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSum.generated.js deleted file mode 100644 index fb98496..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSum.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js deleted file mode 100644 index 4bc32c8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesCumSumTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDeepEqual.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDeepEqual.generated.js deleted file mode 100644 index 994ed63..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDeepEqual.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDerivative.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDerivative.generated.js deleted file mode 100644 index 388309d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDerivative.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivide.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivide.generated.js deleted file mode 100644 index cc18b98..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivide.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivideScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivideScalar.generated.js deleted file mode 100644 index 7471996..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesDivideScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesE.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesE.generated.js deleted file mode 100644 index 734a86c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesE.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqual.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqual.generated.js deleted file mode 100644 index f6efd58..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqual.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualScalar.generated.js deleted file mode 100644 index e8985ab..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualText.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualText.generated.js deleted file mode 100644 index cfcbd90..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEqualText.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesErf.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesErf.generated.js deleted file mode 100644 index ccc3714..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesErf.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEvaluate.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEvaluate.generated.js deleted file mode 100644 index b843c1c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesEvaluate.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExp.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExp.generated.js deleted file mode 100644 index f1af13b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExp.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExpm1.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExpm1.generated.js deleted file mode 100644 index 5379c46..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesExpm1.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFactorial.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFactorial.generated.js deleted file mode 100644 index 9fe7608..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFactorial.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFalse.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFalse.generated.js deleted file mode 100644 index ba9c2d5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFalse.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilter.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilter.generated.js deleted file mode 100644 index 365fbe3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilter.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilterTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilterTransform.generated.js deleted file mode 100644 index 9195d5d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFilterTransform.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js deleted file mode 100644 index b0599c1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFix.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js deleted file mode 100644 index d0a65ab..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFloor.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEach.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEach.generated.js deleted file mode 100644 index 7bbdc94..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEach.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEachTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEachTransform.generated.js deleted file mode 100644 index f300f41..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesForEachTransform.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFormat.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFormat.generated.js deleted file mode 100644 index 7be7c47..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFormat.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js deleted file mode 100644 index fd579c7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionAssignmentNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionNode.generated.js deleted file mode 100644 index 24ec5d6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesFunctionNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGamma.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGamma.generated.js deleted file mode 100644 index c380fe5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGamma.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGcd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGcd.generated.js deleted file mode 100644 index 47feec3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesGcd.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js deleted file mode 100644 index d742528..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHasNumericValue.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelp.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelp.generated.js deleted file mode 100644 index 6afd037..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelp.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelpClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelpClass.generated.js deleted file mode 100644 index 79b6fa0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHelpClass.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHypot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHypot.generated.js deleted file mode 100644 index fc777ba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesHypot.generated.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndex.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndex.generated.js deleted file mode 100644 index 52f74db..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndex.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js deleted file mode 100644 index 2d83eb2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIndexNode.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesInfinity.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesInfinity.generated.js deleted file mode 100644 index 9e44daf..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesInfinity.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsBounded.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsBounded.generated.js deleted file mode 100644 index 330682c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsBounded.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createIsBounded } from '../../factoriesNumber.js'; -export var isBoundedDependencies = { - typedDependencies, - createIsBounded -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsFinite.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsFinite.generated.js deleted file mode 100644 index ddce8a1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsFinite.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isBoundedDependencies } from './dependenciesIsBounded.generated.js'; -import { mapDependencies } from './dependenciesMap.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createIsFinite } from '../../factoriesNumber.js'; -export var isFiniteDependencies = { - isBoundedDependencies, - mapDependencies, - typedDependencies, - createIsFinite -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsInteger.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsInteger.generated.js deleted file mode 100644 index e00294f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsInteger.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNaN.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNaN.generated.js deleted file mode 100644 index abb7251..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNaN.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNegative.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNegative.generated.js deleted file mode 100644 index 853c1cb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNegative.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNumeric.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNumeric.generated.js deleted file mode 100644 index 92559b6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsNumeric.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPositive.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPositive.generated.js deleted file mode 100644 index f0364ca..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPositive.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPrime.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPrime.generated.js deleted file mode 100644 index 6640f72..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsPrime.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsZero.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsZero.generated.js deleted file mode 100644 index 5421b80..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesIsZero.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN10.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN10.generated.js deleted file mode 100644 index 1400488..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN10.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN2.generated.js deleted file mode 100644 index c2d6f69..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLN2.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG10E.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG10E.generated.js deleted file mode 100644 index c2b3459..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG10E.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG2E.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG2E.generated.js deleted file mode 100644 index f3160ad..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLOG2E.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLarger.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLarger.generated.js deleted file mode 100644 index 2f61473..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLarger.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLargerEq.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLargerEq.generated.js deleted file mode 100644 index a4bb0d5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLargerEq.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLcm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLcm.generated.js deleted file mode 100644 index e4bd1f6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLcm.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLeftShift.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLeftShift.generated.js deleted file mode 100644 index 73200ac..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLeftShift.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js deleted file mode 100644 index 6efa8be..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog.generated.js deleted file mode 100644 index cb01c2e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog10.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog10.generated.js deleted file mode 100644 index 1fe8881..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog10.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog1p.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog1p.generated.js deleted file mode 100644 index ca3d2c6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog1p.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog2.generated.js deleted file mode 100644 index b05a6f3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesLog2.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMad.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMad.generated.js deleted file mode 100644 index b0f4b23..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMad.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMap.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMap.generated.js deleted file mode 100644 index 471b19e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMap.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapSlices.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapSlices.generated.js deleted file mode 100644 index b3e8325..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapSlices.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createMapSlices } from '../../factoriesNumber.js'; -export var mapSlicesDependencies = { - isIntegerDependencies, - typedDependencies, - createMapSlices -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapSlicesTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapSlicesTransform.generated.js deleted file mode 100644 index 68e46db..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapSlicesTransform.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isIntegerDependencies } from './dependenciesIsInteger.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createMapSlicesTransform } from '../../factoriesNumber.js'; -export var mapSlicesTransformDependencies = { - isIntegerDependencies, - typedDependencies, - createMapSlicesTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapTransform.generated.js deleted file mode 100644 index 5164952..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMapTransform.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMatrix.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMatrix.generated.js deleted file mode 100644 index 243ce4d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMatrix.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMax.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMax.generated.js deleted file mode 100644 index 4dde0b0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMax.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - largerDependencies, - numericDependencies, - typedDependencies, - createMax -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMaxTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMaxTransform.generated.js deleted file mode 100644 index 98653ba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMaxTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - largerDependencies, - numericDependencies, - typedDependencies, - createMaxTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMean.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMean.generated.js deleted file mode 100644 index b98f47c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMean.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMeanTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMeanTransform.generated.js deleted file mode 100644 index 303d649..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMeanTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js deleted file mode 100644 index 901be99..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMedian.generated.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMin.generated.js deleted file mode 100644 index 84f41b6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMin.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - numericDependencies, - smallerDependencies, - typedDependencies, - createMin -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMinTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMinTransform.generated.js deleted file mode 100644 index 5739c5b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMinTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -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 = { - isNaNDependencies, - numericDependencies, - smallerDependencies, - typedDependencies, - createMinTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMod.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMod.generated.js deleted file mode 100644 index 05a3684..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMod.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMode.generated.js deleted file mode 100644 index 536d896..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMode.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js deleted file mode 100644 index 58da7ec..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultinomial.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiply.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiply.generated.js deleted file mode 100644 index 85e70b2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiply.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js deleted file mode 100644 index 9227ace..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesMultiplyScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNaN.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNaN.generated.js deleted file mode 100644 index f1d9672..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNaN.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNode.generated.js deleted file mode 100644 index 65103e1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNode.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNorm.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNorm.generated.js deleted file mode 100644 index c717d33..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNorm.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNot.generated.js deleted file mode 100644 index 7dd2bfb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNthRoot.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNthRoot.generated.js deleted file mode 100644 index 7ec9c5d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNthRoot.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNull.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNull.generated.js deleted file mode 100644 index 4fa0bcb..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNull.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumber.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumber.generated.js deleted file mode 100644 index c694992..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumber.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumeric.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumeric.generated.js deleted file mode 100644 index 525b859..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesNumeric.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesObjectNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesObjectNode.generated.js deleted file mode 100644 index 4575c9e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesObjectNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOperatorNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOperatorNode.generated.js deleted file mode 100644 index a694cce..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOperatorNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOr.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOr.generated.js deleted file mode 100644 index 6c4cd33..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesOr.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js deleted file mode 100644 index e21611e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParenthesisNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParse.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParse.generated.js deleted file mode 100644 index 63c742e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParse.generated.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParser.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParser.generated.js deleted file mode 100644 index b7c3dba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParser.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParserClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParserClass.generated.js deleted file mode 100644 index d6810ba..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesParserClass.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { evaluateDependencies } from './dependenciesEvaluate.generated.js'; -import { parseDependencies } from './dependenciesParse.generated.js'; -import { createParserClass } from '../../factoriesNumber.js'; -export var ParserDependencies = { - evaluateDependencies, - parseDependencies, - createParserClass -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js deleted file mode 100644 index 87a18c2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPartitionSelect.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPermutations.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPermutations.generated.js deleted file mode 100644 index 319d5b7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPermutations.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPhi.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPhi.generated.js deleted file mode 100644 index 085d93e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPhi.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPi.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPi.generated.js deleted file mode 100644 index 76ba1ef..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPi.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPickRandom.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPickRandom.generated.js deleted file mode 100644 index 9d030e5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPickRandom.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPow.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPow.generated.js deleted file mode 100644 index afa55f3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPow.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPrint.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPrint.generated.js deleted file mode 100644 index 2c84688..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesPrint.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesProd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesProd.generated.js deleted file mode 100644 index c510314..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesProd.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js deleted file mode 100644 index 2a7eb95..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 { mapSlicesDependencies } from './dependenciesMapSlices.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, - mapSlicesDependencies, - multiplyDependencies, - partitionSelectDependencies, - smallerDependencies, - smallerEqDependencies, - subtractDependencies, - typedDependencies, - createQuantileSeq -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandom.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandom.generated.js deleted file mode 100644 index 604e834..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandom.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js deleted file mode 100644 index bd431ac..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { log2Dependencies } from './dependenciesLog2.generated.js'; -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createRandomInt } from '../../factoriesNumber.js'; -export var randomIntDependencies = { - log2Dependencies, - typedDependencies, - createRandomInt -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js deleted file mode 100644 index 2378802..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRange.generated.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { matrixDependencies } from './dependenciesMatrix.generated.js'; -import { addDependencies } from './dependenciesAdd.generated.js'; -import { equalDependencies } from './dependenciesEqual.generated.js'; -import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; -import { isZeroDependencies } from './dependenciesIsZero.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, - equalDependencies, - isPositiveDependencies, - isZeroDependencies, - largerDependencies, - largerEqDependencies, - smallerDependencies, - smallerEqDependencies, - typedDependencies, - createRange -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeClass.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeClass.generated.js deleted file mode 100644 index 51eb295..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeClass.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeNode.generated.js deleted file mode 100644 index 78457e1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js deleted file mode 100644 index 47ba0f4..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRangeTransform.generated.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { matrixDependencies } from './dependenciesMatrix.generated.js'; -import { addDependencies } from './dependenciesAdd.generated.js'; -import { equalDependencies } from './dependenciesEqual.generated.js'; -import { isPositiveDependencies } from './dependenciesIsPositive.generated.js'; -import { isZeroDependencies } from './dependenciesIsZero.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, - equalDependencies, - isPositiveDependencies, - isZeroDependencies, - largerDependencies, - largerEqDependencies, - smallerDependencies, - smallerEqDependencies, - typedDependencies, - createRangeTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js deleted file mode 100644 index 1d0831a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRelationalNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRelationalNode.generated.js deleted file mode 100644 index b833c77..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRelationalNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReplacer.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReplacer.generated.js deleted file mode 100644 index 93af6ff..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReplacer.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js deleted file mode 100644 index 420973d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResultSet.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResultSet.generated.js deleted file mode 100644 index 859c522..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesResultSet.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReviver.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReviver.generated.js deleted file mode 100644 index 00bc722..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesReviver.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightArithShift.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightArithShift.generated.js deleted file mode 100644 index 335469c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightArithShift.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightLogShift.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightLogShift.generated.js deleted file mode 100644 index e07b745..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRightLogShift.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRound.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRound.generated.js deleted file mode 100644 index 6a77140..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesRound.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js deleted file mode 100644 index 38a4da2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT1_2.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT2.generated.js deleted file mode 100644 index 5898c96..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSQRT2.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSec.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSec.generated.js deleted file mode 100644 index 037c4d9..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSec.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSech.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSech.generated.js deleted file mode 100644 index b37d296..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSech.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSign.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSign.generated.js deleted file mode 100644 index 27bf617..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSign.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js deleted file mode 100644 index 4ee4498..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 { equalDependencies } from './dependenciesEqual.generated.js'; -import { parseDependencies } from './dependenciesParse.generated.js'; -import { replacerDependencies } from './dependenciesReplacer.generated.js'; -import { resolveDependencies } from './dependenciesResolve.generated.js'; -import { simplifyConstantDependencies } from './dependenciesSimplifyConstant.generated.js'; -import { simplifyCoreDependencies } from './dependenciesSimplifyCore.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, - equalDependencies, - parseDependencies, - replacerDependencies, - resolveDependencies, - simplifyConstantDependencies, - simplifyCoreDependencies, - typedDependencies, - createSimplify -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js deleted file mode 100644 index 83f078e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 { isBoundedDependencies } from './dependenciesIsBounded.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, - isBoundedDependencies, - matrixDependencies, - typedDependencies, - createSimplifyConstant -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js deleted file mode 100644 index 19208d1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSin.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSin.generated.js deleted file mode 100644 index 36e19f1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSin.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSinh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSinh.generated.js deleted file mode 100644 index 526371a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSinh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSize.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSize.generated.js deleted file mode 100644 index 723d3d0..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSize.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { typedDependencies } from './dependenciesTyped.generated.js'; -import { createSize } from '../../factoriesNumber.js'; -export var sizeDependencies = { - typedDependencies, - createSize -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmaller.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmaller.generated.js deleted file mode 100644 index c1a70ec..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmaller.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmallerEq.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmallerEq.generated.js deleted file mode 100644 index 8cea526..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSmallerEq.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSqrt.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSqrt.generated.js deleted file mode 100644 index 4da7267..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSqrt.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSquare.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSquare.generated.js deleted file mode 100644 index 71799ed..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSquare.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js deleted file mode 100644 index b279cf6..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js deleted file mode 100644 index 4d7be6c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js deleted file mode 100644 index 0c958b2..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesStirlingS2.generated.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesString.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesString.generated.js deleted file mode 100644 index 57db84e..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesString.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubset.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubset.generated.js deleted file mode 100644 index 668726f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubset.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js deleted file mode 100644 index 6a3251a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubsetTransform.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtract.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtract.generated.js deleted file mode 100644 index 3f3e157..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtract.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js deleted file mode 100644 index 7f69b07..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSubtractScalar.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSum.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSum.generated.js deleted file mode 100644 index 9aa4cf5..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSum.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSumTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSumTransform.generated.js deleted file mode 100644 index 19b997f..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSumTransform.generated.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSymbolNode.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSymbolNode.generated.js deleted file mode 100644 index aca084a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesSymbolNode.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTan.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTan.generated.js deleted file mode 100644 index cf31167..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTan.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTanh.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTanh.generated.js deleted file mode 100644 index 701f718..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTanh.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTau.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTau.generated.js deleted file mode 100644 index ca81ba7..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTau.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTrue.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTrue.generated.js deleted file mode 100644 index c29345a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTrue.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTypeOf.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTypeOf.generated.js deleted file mode 100644 index dd137bd..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTypeOf.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTyped.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTyped.generated.js deleted file mode 100644 index 2daf5ea..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesTyped.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js deleted file mode 100644 index a7a3254..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryMinus.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js deleted file mode 100644 index dd0851d..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnaryPlus.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnequal.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnequal.generated.js deleted file mode 100644 index cff54df..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUnequal.generated.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercaseE.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercaseE.generated.js deleted file mode 100644 index 152876b..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercaseE.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercasePi.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercasePi.generated.js deleted file mode 100644 index 02189a3..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesUppercasePi.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js deleted file mode 100644 index 0820e1a..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { addDependencies } from './dependenciesAdd.generated.js'; -import { divideDependencies } from './dependenciesDivide.generated.js'; -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -import { mapSlicesDependencies } from './dependenciesMapSlices.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, - divideDependencies, - isNaNDependencies, - mapSlicesDependencies, - multiplyDependencies, - subtractDependencies, - typedDependencies, - createVariance -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js deleted file mode 100644 index dbfe7a1..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * THIS FILE IS AUTO-GENERATED - * DON'T MAKE CHANGES HERE - */ -import { addDependencies } from './dependenciesAdd.generated.js'; -import { divideDependencies } from './dependenciesDivide.generated.js'; -import { isNaNDependencies } from './dependenciesIsNaN.generated.js'; -import { mapSlicesDependencies } from './dependenciesMapSlices.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, - divideDependencies, - isNaNDependencies, - mapSlicesDependencies, - multiplyDependencies, - subtractDependencies, - typedDependencies, - createVarianceTransform -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVersion.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVersion.generated.js deleted file mode 100644 index c16c379..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesVersion.generated.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXgcd.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXgcd.generated.js deleted file mode 100644 index 749e8e8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXgcd.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXor.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXor.generated.js deleted file mode 100644 index 192daf8..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesXor.generated.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesZeta.generated.js b/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesZeta.generated.js deleted file mode 100644 index 89a0e6c..0000000 --- a/node_modules/mathjs/lib/esm/entry/dependenciesNumber/dependenciesZeta.generated.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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 { isBoundedDependencies } from './dependenciesIsBounded.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, - isBoundedDependencies, - isNegativeDependencies, - multiplyDependencies, - piDependencies, - powDependencies, - sinDependencies, - smallerEqDependencies, - subtractDependencies, - typedDependencies, - createZeta -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js b/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js deleted file mode 100644 index a10d047..0000000 --- a/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js +++ /dev/null @@ -1,762 +0,0 @@ -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, createRangeNode, createReviver, createChainClass, createFunctionAssignmentNode, createChain, createConstantNode, createIndexNode, createAccessorNode, createAssignmentNode, createSymbolNode, createFunctionNode, createParse, createResolve, createSimplifyConstant, createCompile, createLeafCount, createSimplifyCore, createEvaluate, createHelpClass, createParserClass, createParser, createSimplify, createSymbolicEqual, createDerivative, createHelp, createRationalize, createMapTransform, createFilterTransform, createForEachTransform, createMapSlicesTransform, createAndTransform, createCumSumTransform, createNullishTransform, createPrintTransform, createBitAndTransform, createConcatTransform, createDiffTransform, createMaxTransform, createMinTransform, createOrTransform, createSubsetTransform, createBitOrTransform, createSumTransform, createVarianceTransform, createIndexTransform, createQuantileSeqTransform, createRangeTransform, createColumnTransform, createRowTransform, createMeanTransform, 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, isBounded, isNaN, isNumeric, isPrime, LOG2E, lgamma, log10, log2, map, mode, multiplyScalar, not, number, oct, pickRandom, print, random, re, sec, sign, sin, size, SparseMatrix, splitUnit, square, string, subtractScalar, tan, toBest, typeOf, acosh, acsch, asec, bignumber, combinationsWithRep, cosh, csch, dot, hasNumericValue, isFinite, isNegative, isZero, matrix, matrixFromFunction, multiply, ones, randomInt, resize, sech, sinh, sparse, sqrt, squeeze, tanh, transpose, xgcd, zeros, acoth, asin, bin, coth, ctranspose, diag, equal, fraction, identity, isInteger, kron, mapSlices, matrixFromColumns, numeric, prod, reshape, round, unaryMinus, bernoulli, cbrt, concat, count, deepEqual, divideScalar, dotMultiply, floor, gcd, isPositive, larger, lcm, leftShift, lsolve, max, mod, nthRoot, nullish, or, qr, rightArithShift, smaller, subtract, to, unaryPlus, usolve, xor, add, atan2, bitAnd, bitOr, bitXor, catalan, compare, compareText, composition, cross, det, diff, distance, dotDivide, equalText, FibonacciHeap, hypot, ImmutableDenseMatrix, Index, intersect, invmod, largerEq, log, lsolveAll, matrixFromRows, min, nthRoots, partitionSelect, rightLogShift, slu, Spa, subset, sum, trace, usolveAll, zpk2tf, ceil, compareNatural, cumsum, fix, index, inv, log1p, lup, pinv, pow, setCartesian, setDistinct, setIsSubset, setPowerset, smallerEq, sort, sqrtm, unequal, and, divide, expm, fft, freqz, gamma, ifft, kldivergence, lusolve, mean, median, polynomialRoot, quantileSeq, range, row, setDifference, setMultiplicity, setSymDifference, solveODE, Unit, vacuumImpedance, atomicMass, bohrMagneton, boltzmann, column, conductanceQuantum, coulomb, createUnit, deuteronMass, eigs, electronMass, factorial, fermiCoupling, gasConstant, gravity, klitzing, loschmidt, mad, magneticFluxQuantum, molarMass, molarPlanckConstant, multinomial, norm, permutations, planckConstant, planckMass, planckTime, reducedPlanckConstant, rotationMatrix, rydberg, secondRadiation, setSize, speedOfLight, stefanBoltzmann, thomsonCrossSection, variance, zeta, avogadro, bohrRadius, corr, dotPow, elementaryCharge, faraday, hartreeEnergy, inverseConductanceQuantum, magneticConstant, molarMassC12, neutronMass, planckCharge, planckTemperature, quantumOfCirculation, setIntersect, std, stirlingS2, unit, bellNumbers, electricConstant, firstRadiation, nuclearMagneton, planckLength, rotate, setUnion, wienDisplacement, classicalElectronRadius, molarVolume, schur, coulombConstant, gravitationConstant, protonMass, 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 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 ConstantNode = createConstantNode({ - Node, - isBounded -}); -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, - isBounded, - mathWithTransform, - matrix, - typed -}); -export var compile = createCompile({ - parse, - typed -}); -export var leafCount = createLeafCount({ - 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, - parse -}); -export var parser = createParser({ - Parser, - typed -}); -export var simplify = createSimplify({ - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - equal, - parse, - replacer, - resolve, - simplifyConstant, - simplifyCore, - typed -}); -export var symbolicEqual = createSymbolicEqual({ - OperatorNode, - parse, - simplify, - typed -}); -export var derivative = createDerivative({ - ConstantNode, - FunctionNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - config, - equal, - isZero, - numeric, - parse, - simplify, - typed -}); -export var help = createHelp({ - Help, - mathWithTransform, - 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 -}); -_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, - isBounded, - isNaN, - isNumeric, - isPrime, - LOG2E, - lgamma, - log10, - log2, - map, - mode, - multiplyScalar, - not, - number, - oct, - pickRandom, - print, - random, - re, - sec, - sign, - sin, - size, - splitUnit, - square, - string, - subtractScalar, - tan, - toBest, - typeOf, - acosh, - acsch, - asec, - bignumber, - chain, - combinationsWithRep, - cosh, - csch, - dot, - hasNumericValue, - isFinite, - isNegative, - isZero, - matrix, - matrixFromFunction, - multiply, - ones, - randomInt, - resize, - sech, - sinh, - sparse, - sqrt, - squeeze, - tanh, - transpose, - xgcd, - zeros, - acoth, - asin, - bin, - coth, - ctranspose, - diag, - equal, - fraction, - identity, - isInteger, - kron, - mapSlices, - matrixFromColumns, - numeric, - prod, - reshape, - round, - unaryMinus, - bernoulli, - cbrt, - concat, - count, - deepEqual, - divideScalar, - dotMultiply, - floor, - gcd, - isPositive, - larger, - lcm, - leftShift, - lsolve, - max, - mod, - nthRoot, - nullish, - or, - qr, - rightArithShift, - smaller, - subtract, - to, - unaryPlus, - usolve, - xor, - add, - atan2, - bitAnd, - bitOr, - bitXor, - catalan, - compare, - compareText, - composition, - cross, - det, - diff, - distance, - dotDivide, - equalText, - hypot, - intersect, - invmod, - largerEq, - log, - lsolveAll, - matrixFromRows, - min, - nthRoots, - partitionSelect, - rightLogShift, - slu, - subset, - sum, - trace, - usolveAll, - zpk2tf, - ceil, - compareNatural, - cumsum, - fix, - index, - inv, - log1p, - lup, - pinv, - pow, - setCartesian, - setDistinct, - setIsSubset, - setPowerset, - smallerEq, - sort, - sqrtm, - unequal, - and, - divide, - expm, - fft, - freqz, - gamma, - ifft, - kldivergence, - lusolve, - mean, - median, - polynomialRoot, - quantileSeq, - range, - row, - setDifference, - setMultiplicity, - setSymDifference, - solveODE, - vacuumImpedance, - atomicMass, - bohrMagneton, - boltzmann, - column, - conductanceQuantum, - coulomb, - createUnit, - deuteronMass, - eigs, - electronMass, - factorial, - fermiCoupling, - gasConstant, - gravity, - klitzing, - loschmidt, - mad, - magneticFluxQuantum, - molarMass, - molarPlanckConstant, - multinomial, - norm, - permutations, - planckConstant, - planckMass, - planckTime, - reducedPlanckConstant, - rotationMatrix, - rydberg, - secondRadiation, - setSize, - speedOfLight, - stefanBoltzmann, - thomsonCrossSection, - variance, - zeta, - avogadro, - bohrRadius, - corr, - dotPow, - elementaryCharge, - faraday, - hartreeEnergy, - inverseConductanceQuantum, - magneticConstant, - molarMassC12, - neutronMass, - parse, - planckCharge, - planckTemperature, - quantumOfCirculation, - resolve, - setIntersect, - simplifyConstant, - std, - stirlingS2, - unit, - bellNumbers, - compile, - electricConstant, - firstRadiation, - leafCount, - nuclearMagneton, - planckLength, - rotate, - setUnion, - simplifyCore, - wienDisplacement, - classicalElectronRadius, - evaluate, - molarVolume, - schur, - coulombConstant, - gravitationConstant, - parser, - simplify, - symbolicEqual, - derivative, - protonMass, - sylvester, - help, - rationalize, - lyap, - config -}); -_extends(mathWithTransform, math, { - map: createMapTransform({ - typed - }), - filter: createFilterTransform({ - typed - }), - forEach: createForEachTransform({ - typed - }), - mapSlices: createMapSlicesTransform({ - isInteger, - typed - }), - and: createAndTransform({ - add, - concat, - equalScalar, - matrix, - not, - typed, - zeros - }), - cumsum: createCumSumTransform({ - add, - typed, - unaryPlus - }), - nullish: createNullishTransform({ - deepEqual, - flatten, - matrix, - size, - typed - }), - print: createPrintTransform({ - add, - matrix, - typed, - zeros - }), - bitAnd: createBitAndTransform({ - add, - concat, - equalScalar, - matrix, - not, - typed, - zeros - }), - concat: createConcatTransform({ - isInteger, - matrix, - typed - }), - diff: createDiffTransform({ - bignumber, - matrix, - number, - subtract, - typed - }), - max: createMaxTransform({ - config, - isNaN, - larger, - numeric, - typed - }), - min: createMinTransform({ - config, - isNaN, - numeric, - smaller, - typed - }), - or: createOrTransform({ - DenseMatrix, - concat, - equalScalar, - matrix, - typed - }), - subset: createSubsetTransform({ - add, - matrix, - typed, - zeros - }), - bitOr: createBitOrTransform({ - DenseMatrix, - concat, - equalScalar, - matrix, - typed - }), - sum: createSumTransform({ - add, - config, - numeric, - typed - }), - variance: createVarianceTransform({ - add, - divide, - isNaN, - mapSlices, - multiply, - subtract, - typed - }), - index: createIndexTransform({ - Index, - getMatrixDataType - }), - quantileSeq: createQuantileSeqTransform({ - add, - bignumber, - compare, - divide, - isInteger, - larger, - mapSlices, - multiply, - partitionSelect, - smaller, - smallerEq, - subtract, - typed - }), - range: createRangeTransform({ - bignumber, - matrix, - add, - config, - equal, - isPositive, - isZero, - larger, - largerEq, - smaller, - smallerEq, - typed - }), - column: createColumnTransform({ - Index, - matrix, - range, - typed - }), - row: createRowTransform({ - Index, - matrix, - range, - typed - }), - mean: createMeanTransform({ - add, - divide, - typed - }), - std: createStdTransform({ - map, - sqrt, - typed, - variance - }) -}); -_extends(classes, { - BigNumber, - Complex, - Fraction, - Matrix, - Node, - ObjectNode, - OperatorNode, - ParenthesisNode, - Range, - RelationalNode, - ResultSet, - ArrayNode, - BlockNode, - ConditionalNode, - DenseMatrix, - RangeNode, - Chain, - FunctionAssignmentNode, - SparseMatrix, - ConstantNode, - IndexNode, - FibonacciHeap, - ImmutableDenseMatrix, - Index, - Spa, - AccessorNode, - AssignmentNode, - 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/node_modules/mathjs/lib/esm/entry/impureFunctionsNumber.generated.js b/node_modules/mathjs/lib/esm/entry/impureFunctionsNumber.generated.js deleted file mode 100644 index 3956559..0000000 --- a/node_modules/mathjs/lib/esm/entry/impureFunctionsNumber.generated.js +++ /dev/null @@ -1,504 +0,0 @@ -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, createChain, createConditionalNode, createFunctionNode, createIndexNode, createOperatorNode, createArrayNode, createFunctionAssignmentNode, createBlockNode, createConstantNode, createSimplifyConstant, createParenthesisNode, createParse, createResolve, createSimplifyCore, createCompile, createEvaluate, createHelpClass, createParserClass, createSimplify, createDerivative, createHelp, createParser, createRationalize, createCumSumTransform, createMapSlicesTransform, createFilterTransform, createForEachTransform, createMeanTransform, createSubsetTransform, createMapTransform, createStdTransform, createSumTransform, createVarianceTransform, createMaxTransform, createMinTransform, createRangeTransform } 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, isBounded, 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, bernoulli, bitOr, combinationsWithRep, cosh, csch, divideScalar, equalText, expm1, isNaN, isPrime, larger, lgamma, log2, mapSlices, multiplyScalar, nthRoot, pickRandom, randomInt, rightArithShift, sec, sinh, sqrt, tan, unaryMinus, variance, acosh, atan2, bitAnd, catalan, clone, composition, coth, equal, factorial, isFinite, LN2, log10, multinomial, numeric, permutations, prod, round, smaller, subtractScalar, zeta, acsch, compareNatural, cumsum, floor, hypot, lcm, max, min, norm, print, range, sign, std, sum, asinh, ceil, corr, fix, isNumeric, partitionSelect, stirlingS2, bellNumbers, deepEqual, gcd, median, quantileSeq, mode, _true, hasNumericValue, mad } 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 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 ArrayNode = createArrayNode({ - Node -}); -export var FunctionAssignmentNode = createFunctionAssignmentNode({ - Node, - typed -}); -export var BlockNode = createBlockNode({ - Node, - ResultSet -}); -export var ConstantNode = createConstantNode({ - Node, - isBounded -}); -export var simplifyConstant = createSimplifyConstant({ - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - SymbolNode, - config, - isBounded, - mathWithTransform, - matrix, - typed -}); -export var ParenthesisNode = createParenthesisNode({ - Node -}); -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, - parse -}); -export var simplify = createSimplify({ - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - equal, - parse, - replacer, - resolve, - simplifyConstant, - simplifyCore, - typed -}); -export var derivative = createDerivative({ - ConstantNode, - FunctionNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - config, - equal, - isZero, - numeric, - parse, - simplify, - typed -}); -export var help = createHelp({ - Help, - mathWithTransform, - typed -}); -export var parser = createParser({ - Parser, - 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 -}); -_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, - isBounded, - 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, - bernoulli, - bitOr, - chain, - combinationsWithRep, - cosh, - csch, - divideScalar, - equalText, - expm1, - isNaN, - isPrime, - larger, - lgamma, - log2, - mapSlices, - multiplyScalar, - nthRoot, - pickRandom, - randomInt, - rightArithShift, - sec, - sinh, - sqrt, - tan, - unaryMinus, - variance, - acosh, - atan2, - bitAnd, - catalan, - clone, - composition, - coth, - equal, - factorial, - isFinite, - LN2, - log10, - multinomial, - numeric, - permutations, - prod, - round, - smaller, - subtractScalar, - 'PI': pi, - zeta, - acsch, - compareNatural, - cumsum, - floor, - hypot, - lcm, - max, - min, - norm, - print, - range, - sign, - simplifyConstant, - std, - sum, - asinh, - ceil, - corr, - fix, - isNumeric, - partitionSelect, - stirlingS2, - bellNumbers, - deepEqual, - gcd, - median, - parse, - quantileSeq, - resolve, - simplifyCore, - compile, - evaluate, - mode, - simplify, - derivative, - help, - parser, - true: _true, - hasNumericValue, - rationalize, - mad, - config -}); -_extends(mathWithTransform, math, { - cumsum: createCumSumTransform({ - add, - typed, - unaryPlus - }), - mapSlices: createMapSlicesTransform({ - isInteger, - typed - }), - filter: createFilterTransform({ - typed - }), - forEach: createForEachTransform({ - typed - }), - mean: createMeanTransform({ - add, - divide, - typed - }), - subset: createSubsetTransform({}), - map: createMapTransform({ - typed - }), - std: createStdTransform({ - map, - sqrt, - typed, - variance - }), - sum: createSumTransform({ - add, - config, - numeric, - typed - }), - variance: createVarianceTransform({ - add, - divide, - isNaN, - mapSlices, - multiply, - subtract, - typed - }), - max: createMaxTransform({ - config, - isNaN, - larger, - numeric, - typed - }), - min: createMinTransform({ - config, - isNaN, - numeric, - smaller, - typed - }), - range: createRangeTransform({ - matrix, - add, - config, - equal, - isPositive, - isZero, - larger, - largerEq, - smaller, - smallerEq, - typed - }) -}); -_extends(classes, { - Range, - ResultSet, - Chain, - Node, - ObjectNode, - RangeNode, - RelationalNode, - SymbolNode, - AccessorNode, - AssignmentNode, - ConditionalNode, - FunctionNode, - IndexNode, - OperatorNode, - ArrayNode, - FunctionAssignmentNode, - BlockNode, - ConstantNode, - ParenthesisNode, - Help, - Parser -}); -Chain.createProxy(math); -export { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs.js'; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/mainAny.js b/node_modules/mathjs/lib/esm/entry/mainAny.js deleted file mode 100644 index c45eb98..0000000 --- a/node_modules/mathjs/lib/esm/entry/mainAny.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/entry/mainNumber.js b/node_modules/mathjs/lib/esm/entry/mainNumber.js deleted file mode 100644 index e9e3ee0..0000000 --- a/node_modules/mathjs/lib/esm/entry/mainNumber.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js b/node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js deleted file mode 100644 index 1f89149..0000000 --- a/node_modules/mathjs/lib/esm/entry/pureFunctionsAny.generated.js +++ /dev/null @@ -1,1844 +0,0 @@ -/** - * 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, createIsBounded, createIsNaN, createIsNumeric, createIsPrime, createLOG2E, createLgamma, createLog10, createLog2, createMap, createMode, createMultiplyScalar, createNot, createNumber, createOct, createPickRandom, createPrint, createRandom, createRe, createSec, createSign, createSin, createSize, createSparseMatrixClass, createSplitUnit, createSquare, createString, createSubtractScalar, createTan, createToBest, createTypeOf, createAcosh, createAcsch, createAsec, createBignumber, createCombinationsWithRep, createCosh, createCsch, createDot, createHasNumericValue, createIsFinite, createIsNegative, createIsZero, createMatrix, createMatrixFromFunction, createMultiply, createOnes, createRandomInt, createResize, createSech, createSinh, createSparse, createSqrt, createSqueeze, createTanh, createTranspose, createXgcd, createZeros, createAcoth, createAsin, createBin, createCoth, createCtranspose, createDiag, createEqual, createFraction, createIdentity, createIsInteger, createKron, createMapSlices, createMatrixFromColumns, createNumeric, createProd, createReshape, createRound, createUnaryMinus, createBernoulli, createCbrt, createConcat, createCount, createDeepEqual, createDivideScalar, createDotMultiply, createFloor, createGcd, createIsPositive, createLarger, createLcm, createLeftShift, createLsolve, createMax, createMod, createNthRoot, createNullish, createOr, createQr, createRightArithShift, createSmaller, createSubtract, createTo, createUnaryPlus, createUsolve, createXor, createAdd, createAtan2, createBitAnd, createBitOr, createBitXor, createCatalan, createCompare, createCompareText, createComposition, createCross, createDet, createDiff, createDistance, createDotDivide, createEqualText, createFibonacciHeapClass, createHypot, createImmutableDenseMatrixClass, createIndexClass, createIntersect, createInvmod, createLargerEq, createLog, createLsolveAll, createMatrixFromRows, createMin, createNthRoots, createPartitionSelect, createRightLogShift, createSlu, createSpaClass, createSubset, createSum, createTrace, createUsolveAll, createZpk2tf, createCeil, createCompareNatural, createCumSum, createFix, createIndex, createInv, createLog1p, createLup, createPinv, createPow, createSetCartesian, createSetDistinct, createSetIsSubset, createSetPowerset, createSmallerEq, createSort, createSqrtm, createUnequal, createAnd, createDivide, createExpm, createFft, createFreqz, createGamma, createIfft, createKldivergence, createLusolve, createMean, createMedian, createPolynomialRoot, createQuantileSeq, createRange, createRow, createSetDifference, createSetMultiplicity, createSetSymDifference, createSolveODE, createUnitClass, createVacuumImpedance, createAtomicMass, createBohrMagneton, createBoltzmann, createColumn, createConductanceQuantum, createCoulomb, createCreateUnit, createDeuteronMass, createEigs, createElectronMass, createFactorial, createFermiCoupling, createGasConstant, createGravity, createKlitzing, createLoschmidt, createMad, createMagneticFluxQuantum, createMolarMass, createMolarPlanckConstant, createMultinomial, createNorm, createPermutations, createPlanckConstant, createPlanckMass, createPlanckTime, createReducedPlanckConstant, createRotationMatrix, createRydberg, createSecondRadiation, createSetSize, createSpeedOfLight, createStefanBoltzmann, createThomsonCrossSection, createVariance, createZeta, createAvogadro, createBohrRadius, createCorr, createDotPow, createElementaryCharge, createFaraday, createHartreeEnergy, createInverseConductanceQuantum, createMagneticConstant, createMolarMassC12, createNeutronMass, createPlanckCharge, createPlanckTemperature, createQuantumOfCirculation, createSetIntersect, createStd, createStirlingS2, createUnitFunction, createBellNumbers, createElectricConstant, createFirstRadiation, createNuclearMagneton, createPlanckLength, createRotate, createSetUnion, createWienDisplacement, createClassicalElectronRadius, createMolarVolume, createSchur, createCoulombConstant, createGravitationConstant, createProtonMass, 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, - config -}); -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 isBounded = /* #__PURE__ */createIsBounded({ - typed -}); -export var isNaN = /* #__PURE__ */createIsNaN({ - typed -}); -export var isNumeric = /* #__PURE__ */createIsNumeric({ - typed -}); -export var isPrime = /* #__PURE__ */createIsPrime({ - 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 mode = /* #__PURE__ */createMode({ - isNaN, - isNumeric, - 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 size = /* #__PURE__ */createSize({ - 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 toBest = /* #__PURE__ */createToBest({ - typed -}); -export var typeOf = /* #__PURE__ */createTypeOf({ - typed -}); -export var acosh = /* #__PURE__ */createAcosh({ - Complex, - config, - typed -}); -export var acsch = /* #__PURE__ */createAcsch({ - BigNumber, - 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 dot = /* #__PURE__ */createDot({ - addScalar, - conj, - multiplyScalar, - size, - typed -}); -export var hasNumericValue = /* #__PURE__ */createHasNumericValue({ - isNumeric, - typed -}); -export var isFinite = /* #__PURE__ */createIsFinite({ - isBounded, - map, - typed -}); -export var isNegative = /* #__PURE__ */createIsNegative({ - config, - typed -}); -export var isZero = /* #__PURE__ */createIsZero({ - equalScalar, - typed -}); -export var matrix = /* #__PURE__ */createMatrix({ - DenseMatrix, - Matrix, - SparseMatrix, - typed -}); -export var matrixFromFunction = /* #__PURE__ */createMatrixFromFunction({ - isZero, - matrix, - typed -}); -export var multiply = /* #__PURE__ */createMultiply({ - addScalar, - dot, - equalScalar, - matrix, - multiplyScalar, - typed -}); -export var ones = /* #__PURE__ */createOnes({ - BigNumber, - config, - matrix, - typed -}); -export var randomInt = /* #__PURE__ */createRandomInt({ - config, - log2, - typed -}); -export var resize = /* #__PURE__ */createResize({ - config, - matrix -}); -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 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 acoth = /* #__PURE__ */createAcoth({ - BigNumber, - Complex, - config, - typed -}); -export var asin = /* #__PURE__ */createAsin({ - Complex, - config, - typed -}); -export var bin = /* #__PURE__ */createBin({ - format, - typed -}); -export var coth = /* #__PURE__ */createCoth({ - BigNumber, - typed -}); -export var ctranspose = /* #__PURE__ */createCtranspose({ - conj, - transpose, - typed -}); -export var diag = /* #__PURE__ */createDiag({ - DenseMatrix, - SparseMatrix, - matrix, - typed -}); -export var equal = /* #__PURE__ */createEqual({ - DenseMatrix, - SparseMatrix, - equalScalar, - matrix, - typed -}); -export var fraction = /* #__PURE__ */createFraction({ - Fraction, - typed -}); -export var identity = /* #__PURE__ */createIdentity({ - BigNumber, - DenseMatrix, - SparseMatrix, - config, - matrix, - typed -}); -export var isInteger = /* #__PURE__ */createIsInteger({ - equal, - typed -}); -export var kron = /* #__PURE__ */createKron({ - matrix, - multiplyScalar, - typed -}); -export var mapSlices = /* #__PURE__ */createMapSlices({ - isInteger, - typed -}); -export var apply = mapSlices; -export var matrixFromColumns = /* #__PURE__ */createMatrixFromColumns({ - flatten, - matrix, - size, - 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 round = /* #__PURE__ */createRound({ - BigNumber, - DenseMatrix, - config, - equalScalar, - matrix, - typed, - zeros -}); -export var unaryMinus = /* #__PURE__ */createUnaryMinus({ - typed -}); -export var bernoulli = /* #__PURE__ */createBernoulli({ - BigNumber, - Fraction, - config, - isInteger, - number, - 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 deepEqual = /* #__PURE__ */createDeepEqual({ - equal, - typed -}); -export var divideScalar = /* #__PURE__ */createDivideScalar({ - numeric, - typed -}); -export var dotMultiply = /* #__PURE__ */createDotMultiply({ - concat, - equalScalar, - matrix, - multiplyScalar, - 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 isPositive = /* #__PURE__ */createIsPositive({ - config, - typed -}); -export var larger = /* #__PURE__ */createLarger({ - DenseMatrix, - SparseMatrix, - bignumber, - concat, - config, - matrix, - typed -}); -export var lcm = /* #__PURE__ */createLcm({ - concat, - equalScalar, - 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 max = /* #__PURE__ */createMax({ - config, - isNaN, - larger, - numeric, - typed -}); -export var mod = /* #__PURE__ */createMod({ - DenseMatrix, - concat, - config, - equalScalar, - matrix, - round, - typed, - zeros -}); -export var nthRoot = /* #__PURE__ */createNthRoot({ - BigNumber, - concat, - equalScalar, - matrix, - typed -}); -export var nullish = /* #__PURE__ */createNullish({ - deepEqual, - flatten, - matrix, - size, - typed -}); -export var or = /* #__PURE__ */createOr({ - DenseMatrix, - concat, - equalScalar, - matrix, - typed -}); -export var qr = /* #__PURE__ */createQr({ - addScalar, - complex, - conj, - divideScalar, - equal, - identity, - isZero, - matrix, - multiplyScalar, - sign, - sqrt, - subtractScalar, - typed, - unaryMinus, - zeros -}); -export var rightArithShift = /* #__PURE__ */createRightArithShift({ - DenseMatrix, - concat, - equalScalar, - matrix, - typed, - zeros -}); -export var smaller = /* #__PURE__ */createSmaller({ - DenseMatrix, - SparseMatrix, - bignumber, - 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, - SparseMatrix, - 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, - SparseMatrix, - 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 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 diff = /* #__PURE__ */createDiff({ - matrix, - number, - subtract, - typed -}); -export var distance = /* #__PURE__ */createDistance({ - abs, - addScalar, - deepEqual, - divideScalar, - multiplyScalar, - sqrt, - subtractScalar, - typed -}); -export var dotDivide = /* #__PURE__ */createDotDivide({ - DenseMatrix, - SparseMatrix, - concat, - divideScalar, - equalScalar, - matrix, - typed -}); -export var equalText = /* #__PURE__ */createEqualText({ - compareText, - isZero, - typed -}); -export var FibonacciHeap = /* #__PURE__ */createFibonacciHeapClass({ - larger, - smaller -}); -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 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 largerEq = /* #__PURE__ */createLargerEq({ - DenseMatrix, - SparseMatrix, - concat, - config, - matrix, - typed -}); -export var log = /* #__PURE__ */createLog({ - Complex, - config, - divideScalar, - typeOf, - 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, - isNaN, - numeric, - smaller, - typed -}); -export var nthRoots = /* #__PURE__ */createNthRoots({ - Complex, - config, - divideScalar, - 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 Spa = /* #__PURE__ */createSpaClass({ - FibonacciHeap, - addScalar, - equalScalar -}); -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 cumsum = /* #__PURE__ */createCumSum({ - add, - typed, - unaryPlus -}); -export var fix = /* #__PURE__ */createFix({ - Complex, - DenseMatrix, - ceil, - equalScalar, - floor, - matrix, - typed, - zeros -}); -export var index = /* #__PURE__ */createIndex({ - Index, - typed -}); -export var inv = /* #__PURE__ */createInv({ - abs, - addScalar, - det, - divideScalar, - identity, - matrix, - multiply, - typed, - unaryMinus -}); -export var log1p = /* #__PURE__ */createLog1p({ - Complex, - config, - divideScalar, - log, - typed -}); -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 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, - SparseMatrix, - concat, - config, - matrix, - typed -}); -export var sort = /* #__PURE__ */createSort({ - compare, - compareNatural, - matrix, - typed -}); -export var sqrtm = /* #__PURE__ */createSqrtm({ - abs, - add, - identity, - inv, - map, - max, - multiply, - size, - sqrt, - subtract, - typed -}); -export var unequal = /* #__PURE__ */createUnequal({ - DenseMatrix, - SparseMatrix, - concat, - config, - equalScalar, - matrix, - typed -}); -export var and = /* #__PURE__ */createAnd({ - concat, - equalScalar, - matrix, - not, - typed, - zeros -}); -export var divide = /* #__PURE__ */createDivide({ - divideScalar, - equalScalar, - inv, - matrix, - multiply, - typed -}); -export var expm = /* #__PURE__ */createExpm({ - abs, - add, - identity, - inv, - multiply, - typed -}); -export var fft = /* #__PURE__ */createFft({ - addScalar, - ceil, - conj, - divideScalar, - dotDivide, - exp, - i, - log2, - matrix, - multiplyScalar, - pow, - tau, - typed -}); -export var freqz = /* #__PURE__ */createFreqz({ - Complex, - add, - divide, - matrix, - multiply, - typed -}); -export var gamma = /* #__PURE__ */createGamma({ - BigNumber, - Complex, - config, - multiplyScalar, - pow, - typed -}); -export var ifft = /* #__PURE__ */createIfft({ - conj, - dotDivide, - fft, - typed -}); -export var kldivergence = /* #__PURE__ */createKldivergence({ - divide, - dotDivide, - isNumeric, - log, - map, - matrix, - multiply, - sum, - typed -}); -export var lusolve = /* #__PURE__ */createLusolve({ - DenseMatrix, - lsolve, - lup, - matrix, - slu, - typed, - usolve -}); -export var mean = /* #__PURE__ */createMean({ - add, - divide, - typed -}); -export var median = /* #__PURE__ */createMedian({ - add, - compare, - divide, - partitionSelect, - typed -}); -export var polynomialRoot = /* #__PURE__ */createPolynomialRoot({ - add, - cbrt, - divide, - equalScalar, - im, - isZero, - multiply, - re, - sqrt, - subtract, - typeOf, - typed, - unaryMinus -}); -export var quantileSeq = /* #__PURE__ */createQuantileSeq({ - bignumber, - add, - compare, - divide, - isInteger, - larger, - mapSlices, - multiply, - partitionSelect, - smaller, - smallerEq, - subtract, - typed -}); -export var range = /* #__PURE__ */createRange({ - bignumber, - matrix, - add, - config, - equal, - isPositive, - isZero, - 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 solveODE = /* #__PURE__ */createSolveODE({ - abs, - add, - bignumber, - divide, - isNegative, - isPositive, - larger, - map, - matrix, - max, - multiply, - smaller, - subtract, - typed, - unaryMinus -}); -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 atomicMass = /* #__PURE__ */createAtomicMass({ - BigNumber, - Unit, - config -}); -export var bohrMagneton = /* #__PURE__ */createBohrMagneton({ - BigNumber, - Unit, - config -}); -export var boltzmann = /* #__PURE__ */createBoltzmann({ - BigNumber, - Unit, - config -}); -export var column = /* #__PURE__ */createColumn({ - Index, - matrix, - range, - typed -}); -export var conductanceQuantum = /* #__PURE__ */createConductanceQuantum({ - BigNumber, - Unit, - config -}); -export var coulomb = /* #__PURE__ */createCoulomb({ - BigNumber, - Unit, - config -}); -export var createUnit = /* #__PURE__ */createCreateUnit({ - Unit, - typed -}); -export var deuteronMass = /* #__PURE__ */createDeuteronMass({ - BigNumber, - Unit, - config -}); -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 electronMass = /* #__PURE__ */createElectronMass({ - BigNumber, - Unit, - config -}); -export var factorial = /* #__PURE__ */createFactorial({ - gamma, - typed -}); -export var fermiCoupling = /* #__PURE__ */createFermiCoupling({ - BigNumber, - Unit, - config -}); -export var gasConstant = /* #__PURE__ */createGasConstant({ - BigNumber, - Unit, - config -}); -export var gravity = /* #__PURE__ */createGravity({ - BigNumber, - Unit, - config -}); -export var klitzing = /* #__PURE__ */createKlitzing({ - BigNumber, - Unit, - config -}); -export var loschmidt = /* #__PURE__ */createLoschmidt({ - BigNumber, - Unit, - config -}); -export var mad = /* #__PURE__ */createMad({ - abs, - map, - median, - subtract, - typed -}); -export var magneticFluxQuantum = /* #__PURE__ */createMagneticFluxQuantum({ - BigNumber, - Unit, - config -}); -export var molarMass = /* #__PURE__ */createMolarMass({ - BigNumber, - Unit, - config -}); -export var molarPlanckConstant = /* #__PURE__ */createMolarPlanckConstant({ - BigNumber, - Unit, - config -}); -export var multinomial = /* #__PURE__ */createMultinomial({ - add, - divide, - factorial, - isInteger, - isPositive, - multiply, - typed -}); -export var norm = /* #__PURE__ */createNorm({ - abs, - add, - conj, - ctranspose, - eigs, - equalScalar, - larger, - matrix, - multiply, - pow, - smaller, - sqrt, - typed -}); -export var permutations = /* #__PURE__ */createPermutations({ - factorial, - typed -}); -export var planckConstant = /* #__PURE__ */createPlanckConstant({ - BigNumber, - Unit, - config -}); -export var planckMass = /* #__PURE__ */createPlanckMass({ - BigNumber, - Unit, - config -}); -export var planckTime = /* #__PURE__ */createPlanckTime({ - BigNumber, - Unit, - config -}); -export var reducedPlanckConstant = /* #__PURE__ */createReducedPlanckConstant({ - BigNumber, - Unit, - config -}); -export var rotationMatrix = /* #__PURE__ */createRotationMatrix({ - BigNumber, - DenseMatrix, - SparseMatrix, - addScalar, - config, - cos, - matrix, - multiplyScalar, - norm, - sin, - typed, - unaryMinus -}); -export var rydberg = /* #__PURE__ */createRydberg({ - BigNumber, - Unit, - config -}); -export var secondRadiation = /* #__PURE__ */createSecondRadiation({ - BigNumber, - Unit, - config -}); -export var setSize = /* #__PURE__ */createSetSize({ - compareNatural, - typed -}); -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 variance = /* #__PURE__ */createVariance({ - add, - divide, - isNaN, - mapSlices, - multiply, - subtract, - typed -}); -export var zeta = /* #__PURE__ */createZeta({ - BigNumber, - Complex, - add, - config, - divide, - equal, - factorial, - gamma, - isBounded, - isNegative, - multiply, - pi, - pow, - sin, - smallerEq, - subtract, - typed -}); -export var avogadro = /* #__PURE__ */createAvogadro({ - BigNumber, - Unit, - config -}); -export var bohrRadius = /* #__PURE__ */createBohrRadius({ - BigNumber, - Unit, - config -}); -export var corr = /* #__PURE__ */createCorr({ - add, - divide, - matrix, - mean, - multiply, - pow, - sqrt, - subtract, - sum, - typed -}); -export var dotPow = /* #__PURE__ */createDotPow({ - DenseMatrix, - SparseMatrix, - concat, - equalScalar, - matrix, - pow, - typed -}); -export var elementaryCharge = /* #__PURE__ */createElementaryCharge({ - BigNumber, - Unit, - config -}); -export var faraday = /* #__PURE__ */createFaraday({ - BigNumber, - Unit, - config -}); -export var hartreeEnergy = /* #__PURE__ */createHartreeEnergy({ - BigNumber, - Unit, - config -}); -export var inverseConductanceQuantum = /* #__PURE__ */createInverseConductanceQuantum({ - BigNumber, - Unit, - config -}); -export var magneticConstant = /* #__PURE__ */createMagneticConstant({ - BigNumber, - Unit, - config -}); -export var molarMassC12 = /* #__PURE__ */createMolarMassC12({ - BigNumber, - Unit, - config -}); -export var neutronMass = /* #__PURE__ */createNeutronMass({ - BigNumber, - Unit, - config -}); -export var planckCharge = /* #__PURE__ */createPlanckCharge({ - BigNumber, - Unit, - config -}); -export var planckTemperature = /* #__PURE__ */createPlanckTemperature({ - BigNumber, - Unit, - config -}); -export var quantumOfCirculation = /* #__PURE__ */createQuantumOfCirculation({ - BigNumber, - Unit, - config -}); -export var setIntersect = /* #__PURE__ */createSetIntersect({ - DenseMatrix, - Index, - compareNatural, - size, - subset, - typed -}); -export var std = /* #__PURE__ */createStd({ - map, - sqrt, - typed, - variance -}); -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 electricConstant = /* #__PURE__ */createElectricConstant({ - BigNumber, - Unit, - config -}); -export var firstRadiation = /* #__PURE__ */createFirstRadiation({ - BigNumber, - Unit, - config -}); -export var nuclearMagneton = /* #__PURE__ */createNuclearMagneton({ - BigNumber, - Unit, - config -}); -export var planckLength = /* #__PURE__ */createPlanckLength({ - BigNumber, - Unit, - config -}); -export var rotate = /* #__PURE__ */createRotate({ - multiply, - rotationMatrix, - typed -}); -export var setUnion = /* #__PURE__ */createSetUnion({ - Index, - concat, - setIntersect, - setSymDifference, - size, - subset, - typed -}); -export var wienDisplacement = /* #__PURE__ */createWienDisplacement({ - BigNumber, - Unit, - config -}); -export var classicalElectronRadius = /* #__PURE__ */createClassicalElectronRadius({ - BigNumber, - Unit, - config -}); -export var molarVolume = /* #__PURE__ */createMolarVolume({ - BigNumber, - Unit, - config -}); -export var schur = /* #__PURE__ */createSchur({ - identity, - matrix, - multiply, - norm, - qr, - subtract, - typed -}); -export var coulombConstant = /* #__PURE__ */createCoulombConstant({ - BigNumber, - Unit, - config -}); -export var gravitationConstant = /* #__PURE__ */createGravitationConstant({ - BigNumber, - Unit, - config -}); -export var protonMass = /* #__PURE__ */createProtonMass({ - BigNumber, - Unit, - config -}); -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/node_modules/mathjs/lib/esm/entry/pureFunctionsNumber.generated.js b/node_modules/mathjs/lib/esm/entry/pureFunctionsNumber.generated.js deleted file mode 100644 index 65ba0d4..0000000 --- a/node_modules/mathjs/lib/esm/entry/pureFunctionsNumber.generated.js +++ /dev/null @@ -1,625 +0,0 @@ -/** - * 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, createIsBounded, 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, createBernoulli, createBitOr, createCombinationsWithRep, createCosh, createCsch, createDivideScalar, createEqualText, createExpm1, createIsNaN, createIsPrime, createLarger, createLgamma, createLog2, createMapSlices, createMultiplyScalar, createNthRoot, createPickRandom, createRandomInt, createRightArithShift, createSec, createSinh, createSqrt, createTan, createUnaryMinus, createVariance, createAcosh, createAtan2, createBitAnd, createCatalan, createClone, createComposition, createCoth, createEqual, createFactorial, createIsFinite, createLN2, createLog10, createMultinomial, createNumeric, createPermutations, createProd, createRound, createSmaller, createSubtractScalar, createZeta, createAcsch, createCompareNatural, createCumSum, createFloor, createHypot, createLcm, createMax, createMin, createNorm, createPrint, createRange, createSign, createStd, createSum, createAsinh, createCeil, createCorr, createFix, createIsNumeric, createPartitionSelect, createStirlingS2, createBellNumbers, createDeepEqual, createGcd, createMedian, createQuantileSeq, createMode, createTrue, createHasNumericValue, createMad } 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 isBounded = /* #__PURE__ */createIsBounded({ - 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({ - 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 bernoulli = /* #__PURE__ */createBernoulli({ - config, - isInteger, - number, - typed -}); -export var bitOr = /* #__PURE__ */createBitOr({ - 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 isNaN = /* #__PURE__ */createIsNaN({ - typed -}); -export var isPrime = /* #__PURE__ */createIsPrime({ - typed -}); -export var larger = /* #__PURE__ */createLarger({ - config, - typed -}); -export var lgamma = /* #__PURE__ */createLgamma({ - typed -}); -export var log2 = /* #__PURE__ */createLog2({ - typed -}); -export var mapSlices = /* #__PURE__ */createMapSlices({ - isInteger, - typed -}); -export var apply = mapSlices; -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, - log2, - 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 variance = /* #__PURE__ */createVariance({ - add, - divide, - isNaN, - mapSlices, - multiply, - subtract, - typed -}); -export var acosh = /* #__PURE__ */createAcosh({ - typed -}); -export var atan2 = /* #__PURE__ */createAtan2({ - typed -}); -export var bitAnd = /* #__PURE__ */createBitAnd({ - typed -}); -export var catalan = /* #__PURE__ */createCatalan({ - addScalar, - combinations, - divideScalar, - isInteger, - isNegative, - multiplyScalar, - typed -}); -export var clone = /* #__PURE__ */createClone({ - typed -}); -export var composition = /* #__PURE__ */createComposition({ - addScalar, - combinations, - isInteger, - isNegative, - isPositive, - larger, - typed -}); -export var coth = /* #__PURE__ */createCoth({ - typed -}); -export var equal = /* #__PURE__ */createEqual({ - equalScalar, - typed -}); -export var factorial = /* #__PURE__ */createFactorial({ - gamma, - typed -}); -export var isFinite = /* #__PURE__ */createIsFinite({ - isBounded, - map, - typed -}); -export var LN2 = /* #__PURE__ */createLN2({ - config -}); -export var log10 = /* #__PURE__ */createLog10({ - typed -}); -export var multinomial = /* #__PURE__ */createMultinomial({ - add, - divide, - factorial, - isInteger, - isPositive, - multiply, - typed -}); -export var numeric = /* #__PURE__ */createNumeric({ - number -}); -export var permutations = /* #__PURE__ */createPermutations({ - factorial, - typed -}); -export var prod = /* #__PURE__ */createProd({ - config, - multiplyScalar, - numeric, - typed -}); -export var round = /* #__PURE__ */createRound({ - typed -}); -export var smaller = /* #__PURE__ */createSmaller({ - config, - typed -}); -export var subtractScalar = /* #__PURE__ */createSubtractScalar({ - typed -}); -export var zeta = /* #__PURE__ */createZeta({ - add, - config, - divide, - equal, - factorial, - gamma, - isBounded, - isNegative, - multiply, - pi, - pow, - sin, - smallerEq, - subtract, - typed -}); -export var acsch = /* #__PURE__ */createAcsch({ - typed -}); -export var compareNatural = /* #__PURE__ */createCompareNatural({ - compare, - 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 lcm = /* #__PURE__ */createLcm({ - typed -}); -export var max = /* #__PURE__ */createMax({ - config, - isNaN, - larger, - numeric, - typed -}); -export var min = /* #__PURE__ */createMin({ - config, - isNaN, - numeric, - smaller, - typed -}); -export var norm = /* #__PURE__ */createNorm({ - typed -}); -export var print = /* #__PURE__ */createPrint({ - typed -}); -export var range = /* #__PURE__ */createRange({ - matrix, - add, - config, - equal, - isPositive, - isZero, - larger, - largerEq, - smaller, - smallerEq, - typed -}); -export var sign = /* #__PURE__ */createSign({ - typed -}); -export var std = /* #__PURE__ */createStd({ - map, - sqrt, - typed, - variance -}); -export var sum = /* #__PURE__ */createSum({ - add, - config, - numeric, - typed -}); -export var asinh = /* #__PURE__ */createAsinh({ - typed -}); -export var ceil = /* #__PURE__ */createCeil({ - config, - round, - typed -}); -export var corr = /* #__PURE__ */createCorr({ - add, - divide, - matrix, - mean, - multiply, - pow, - sqrt, - subtract, - sum, - typed -}); -export var fix = /* #__PURE__ */createFix({ - ceil, - floor, - typed -}); -export var isNumeric = /* #__PURE__ */createIsNumeric({ - typed -}); -export var partitionSelect = /* #__PURE__ */createPartitionSelect({ - compare, - isNaN, - isNumeric, - typed -}); -export var stirlingS2 = /* #__PURE__ */createStirlingS2({ - addScalar, - combinations, - divideScalar, - factorial, - isInteger, - isNegative, - larger, - multiplyScalar, - number, - pow, - subtractScalar, - typed -}); -export var bellNumbers = /* #__PURE__ */createBellNumbers({ - addScalar, - isInteger, - isNegative, - stirlingS2, - typed -}); -export var deepEqual = /* #__PURE__ */createDeepEqual({ - equal, - typed -}); -export var gcd = /* #__PURE__ */createGcd({ - typed -}); -export var median = /* #__PURE__ */createMedian({ - add, - compare, - divide, - partitionSelect, - typed -}); -export var quantileSeq = /* #__PURE__ */createQuantileSeq({ - add, - compare, - divide, - isInteger, - larger, - mapSlices, - multiply, - partitionSelect, - smaller, - smallerEq, - subtract, - typed -}); -export var mode = /* #__PURE__ */createMode({ - isNaN, - isNumeric, - typed -}); -export var _true = /* #__PURE__ */createTrue({}); -export var hasNumericValue = /* #__PURE__ */createHasNumericValue({ - isNumeric, - typed -}); -export var mad = /* #__PURE__ */createMad({ - abs, - map, - median, - subtract, - typed -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/entry/typeChecks.js b/node_modules/mathjs/lib/esm/entry/typeChecks.js deleted file mode 100644 index 3071835..0000000 --- a/node_modules/mathjs/lib/esm/entry/typeChecks.js +++ /dev/null @@ -1,2 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/error/ArgumentsError.js b/node_modules/mathjs/lib/esm/error/ArgumentsError.js deleted file mode 100644 index 82da95e..0000000 --- a/node_modules/mathjs/lib/esm/error/ArgumentsError.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/error/DimensionError.js b/node_modules/mathjs/lib/esm/error/DimensionError.js deleted file mode 100644 index f488487..0000000 --- a/node_modules/mathjs/lib/esm/error/DimensionError.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/error/IndexError.js b/node_modules/mathjs/lib/esm/error/IndexError.js deleted file mode 100644 index 9755958..0000000 --- a/node_modules/mathjs/lib/esm/error/IndexError.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/expression/Help.js b/node_modules/mathjs/lib/esm/expression/Help.js deleted file mode 100644 index 5f18914..0000000 --- a/node_modules/mathjs/lib/esm/expression/Help.js +++ /dev/null @@ -1,132 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/Parser.js b/node_modules/mathjs/lib/esm/expression/Parser.js deleted file mode 100644 index 290c5cc..0000000 --- a/node_modules/mathjs/lib/esm/expression/Parser.js +++ /dev/null @@ -1,194 +0,0 @@ -import { factory } from '../utils/factory.js'; -import { isFunction } from '../utils/is.js'; -import { createEmptyMap, toObject } from '../utils/map.js'; -var name = 'Parser'; -var dependencies = ['evaluate', 'parse']; -export var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - evaluate, - parse - } = _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; - }; - function isValidVariableName(name) { - if (name.length === 0) { - return false; - } - for (var i = 0; i < name.length; i++) { - var cPrev = name.charAt(i - 1); - var c = name.charAt(i); - var cNext = name.charAt(i + 1); - var valid = parse.isAlpha(c, cPrev, cNext) || i > 0 && parse.isDigit(c); - if (!valid) { - return false; - } - } - return true; - } - - /** - * 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) { - if (!isValidVariableName(name)) { - throw new Error("Invalid variable name: '".concat(name, "'. Variable names must follow the specified rules.")); - } - 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(); - }; - Parser.prototype.toJSON = function () { - var json = { - mathjs: 'Parser', - variables: {}, - functions: {} - }; - for (var [_name2, value] of this.scope) { - if (isFunction(value)) { - if (!isExpressionFunction(value)) { - throw new Error("Cannot serialize external function ".concat(_name2)); - } - json.functions[_name2] = "".concat(value.syntax, " = ").concat(value.expr); - } else { - json.variables[_name2] = value; - } - } - return json; - }; - Parser.fromJSON = function (json) { - var parser = new Parser(); - Object.entries(json.variables).forEach(_ref2 => { - var [name, value] = _ref2; - return parser.set(name, value); - }); - Object.entries(json.functions).forEach(_ref3 => { - var [_name, fn] = _ref3; - return parser.evaluate(fn); - }); - return parser; - }; - return Parser; -}, { - isClass: true -}); -function isExpressionFunction(value) { - return typeof value === 'function' && typeof value.syntax === 'string' && typeof value.expr === 'string'; -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js deleted file mode 100644 index 665c06c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js deleted file mode 100644 index 14cee58..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js deleted file mode 100644 index 4cdd420..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js deleted file mode 100644 index 2bc29fa..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js deleted file mode 100644 index 91352dd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js deleted file mode 100644 index f44bd42..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js deleted file mode 100644 index c08a377..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js deleted file mode 100644 index 638c4b2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js deleted file mode 100644 index e82480a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js deleted file mode 100644 index 78c1791..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js deleted file mode 100644 index 69d62ff..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js deleted file mode 100644 index 1d6a721..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js deleted file mode 100644 index bb48c9a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js deleted file mode 100644 index c34ae2e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js deleted file mode 100644 index 0256449..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js deleted file mode 100644 index 52c8f1f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js deleted file mode 100644 index c58c20a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js deleted file mode 100644 index 8d965b5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js deleted file mode 100644 index e2e58e8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js deleted file mode 100644 index 38f2053..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js deleted file mode 100644 index abbc0f8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js deleted file mode 100644 index 444836d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js deleted file mode 100644 index 922eb1a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js deleted file mode 100644 index f0f9389..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js deleted file mode 100644 index bb51892..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js deleted file mode 100644 index 4219ce5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js deleted file mode 100644 index b6a776c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js deleted file mode 100644 index 2b1354b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js deleted file mode 100644 index deb8406..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js deleted file mode 100644 index 197f655..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js deleted file mode 100644 index 3864bfd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js deleted file mode 100644 index 35df7c9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js deleted file mode 100644 index 1e73879..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js deleted file mode 100644 index 08aadbe..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js +++ /dev/null @@ -1,742 +0,0 @@ -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 { parserDocs } from './function/expression/parser.js'; -import { parseDocs } from './function/expression/parse.js'; -import { compileDocs } from './function/expression/compile.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 { nullishDocs } from './function/logical/nullish.js'; -import { orDocs } from './function/logical/or.js'; -import { xorDocs } from './function/logical/xor.js'; -import { mapSlicesDocs } from './function/matrix/mapSlices.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 { bernoulliDocs } from './function/probability/bernoulli.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 { toBestDocs } from './function/units/toBest.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 { isBoundedDocs } from './function/utils/isBounded.js'; -import { isFiniteDocs } from './function/utils/isFinite.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. Deprecated in favor of coulombConstant', - examples: ['coulombConstant'] - }, - coulombConstant: { - description: 'Coulomb\'s constant', - examples: ['coulombConstant'] - }, - 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, - parse: parseDocs, - parser: parserDocs, - compile: compileDocs, - // functions - geometry - distance: distanceDocs, - intersect: intersectDocs, - // functions - logical - and: andDocs, - not: notDocs, - nullish: nullishDocs, - or: orDocs, - xor: xorDocs, - // functions - matrix - mapSlices: mapSlicesDocs, - 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 - bernoulli: bernoulliDocs, - 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, - toBest: toBestDocs, - // functions - utils - clone: cloneDocs, - format: formatDocs, - bin: binDocs, - oct: octDocs, - hex: hexDocs, - isNaN: isNaNDocs, - isBounded: isBoundedDocs, - isFinite: isFiniteDocs, - 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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js deleted file mode 100644 index 755c5db..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js deleted file mode 100644 index 5b7acd8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js deleted file mode 100644 index e45f544..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js deleted file mode 100644 index 2bdf1d1..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js deleted file mode 100644 index 4b3af50..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js deleted file mode 100644 index 25a4709..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js deleted file mode 100644 index 5d92c34..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js deleted file mode 100644 index 015c69b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js deleted file mode 100644 index f6e2433..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js deleted file mode 100644 index 0e93662..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js deleted file mode 100644 index 05cf54d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js deleted file mode 100644 index 45de73d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js deleted file mode 100644 index a777a97..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js deleted file mode 100644 index 8881281..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js deleted file mode 100644 index 4eed2a1..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js deleted file mode 100644 index f1527e2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js deleted file mode 100644 index 6b42976..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js deleted file mode 100644 index 87b25fc..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js deleted file mode 100644 index 4020054..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js deleted file mode 100644 index b05833a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js deleted file mode 100644 index 27c8f89..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js deleted file mode 100644 index 50c902b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js deleted file mode 100644 index 225cd12..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js deleted file mode 100644 index 02c57a7..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js +++ /dev/null @@ -1,8 +0,0 @@ -export var ceilDocs = { - name: 'ceil', - category: 'Arithmetic', - syntax: ['ceil(x)', 'ceil(x, n)', 'ceil(unit, valuelessUnit)', 'ceil(unit, n, valuelessUnit)'], - 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)', 'ceil(3.241cm, cm)', 'ceil(3.241cm, 2, cm)'], - seealso: ['floor', 'fix', 'round'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js deleted file mode 100644 index db2ea35..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js deleted file mode 100644 index 350eaa2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js deleted file mode 100644 index d0124ef..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js deleted file mode 100644 index f66bba9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js deleted file mode 100644 index a977c1d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js deleted file mode 100644 index 0067c84..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js deleted file mode 100644 index 8fc045c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js deleted file mode 100644 index 28098a1..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js deleted file mode 100644 index 3859cb5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js +++ /dev/null @@ -1,8 +0,0 @@ -export var fixDocs = { - name: 'fix', - category: 'Arithmetic', - syntax: ['fix(x)', 'fix(x, n)', 'fix(unit, valuelessUnit)', 'fix(unit, n, valuelessUnit)'], - 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)', 'fix(3.241cm, cm)', 'fix(3.241cm, 2, cm)'], - seealso: ['ceil', 'floor', 'round'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js deleted file mode 100644 index e2f0963..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js +++ /dev/null @@ -1,8 +0,0 @@ -export var floorDocs = { - name: 'floor', - category: 'Arithmetic', - syntax: ['floor(x)', 'floor(x, n)', 'floor(unit, valuelessUnit)', 'floor(unit, n, valuelessUnit)'], - 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)', 'floor(3.241cm, cm)', 'floor(3.241cm, 2, cm)'], - seealso: ['ceil', 'fix', 'round'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js deleted file mode 100644 index 3944fc2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js deleted file mode 100644 index fa65019..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js deleted file mode 100644 index 3ad8e2a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js deleted file mode 100644 index 3b6309f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js deleted file mode 100644 index af228dc..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js deleted file mode 100644 index 4687c87..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js deleted file mode 100644 index 4c0a5cd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js deleted file mode 100644 index faf07cd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js deleted file mode 100644 index f8eda30..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js deleted file mode 100644 index 1f28098..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js deleted file mode 100644 index 129579e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js +++ /dev/null @@ -1,7 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js deleted file mode 100644 index 9cf2442..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js deleted file mode 100644 index 2b5de3c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js deleted file mode 100644 index 3924b92..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js deleted file mode 100644 index aefd523..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js deleted file mode 100644 index c34fae4..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js +++ /dev/null @@ -1,8 +0,0 @@ -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>0, -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js deleted file mode 100644 index 9fc19ac..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js deleted file mode 100644 index 859deb3..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js deleted file mode 100644 index 5c858f3..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js deleted file mode 100644 index c6a2084..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js deleted file mode 100644 index e4dcbaf..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js deleted file mode 100644 index 783efc4..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js deleted file mode 100644 index a0ec1de..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js deleted file mode 100644 index 5e4af2a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js deleted file mode 100644 index 905841f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js deleted file mode 100644 index 2e98ee5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js deleted file mode 100644 index 4be877e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js deleted file mode 100644 index a693a22..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js deleted file mode 100644 index 107a877..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js deleted file mode 100644 index fed62da..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js deleted file mode 100644 index 2a24de3..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js deleted file mode 100644 index e68903b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js deleted file mode 100644 index 17ddea5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js deleted file mode 100644 index dacd550..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js +++ /dev/null @@ -1,8 +0,0 @@ -export var stirlingS2Docs = { - name: 'stirlingS2', - category: 'Combinatorics', - syntax: ['stirlingS2(n, k)'], - description: '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.', - examples: ['stirlingS2(5, 3)'], - seealso: ['bellNumbers', 'bernoulli'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js deleted file mode 100644 index 365d159..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js deleted file mode 100644 index 95d6966..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js deleted file mode 100644 index 1ef8686..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js deleted file mode 100644 index 5ba0074..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/compile.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/compile.js deleted file mode 100644 index 3cd29fe..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/compile.js +++ /dev/null @@ -1,8 +0,0 @@ -export var compileDocs = { - name: 'compile', - category: 'Expression', - syntax: ['compile(expr) ', 'compile([expr1, expr2, expr3, ...])'], - description: 'Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.', - examples: ['code1 = compile("sqrt(3^2 + 4^2)")', 'code1.evaluate() ', 'code2 = compile("a * b")', 'code2.evaluate({a: 3, b: 4})'], - seealso: ['parser', 'parse', 'evaluate'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js deleted file mode 100644 index 742e721..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js +++ /dev/null @@ -1,8 +0,0 @@ -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: ['parser', 'parse', 'compile'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js deleted file mode 100644 index 51d9401..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parse.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parse.js deleted file mode 100644 index 8e72d0c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parse.js +++ /dev/null @@ -1,8 +0,0 @@ -export var parseDocs = { - name: 'parse', - category: 'Expression', - syntax: ['parse(expr)', 'parse(expr, options)', 'parse([expr1, expr2, expr3, ...])', 'parse([expr1, expr2, expr3, ...], options)'], - description: 'Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().', - examples: ['node1 = parse("sqrt(3^2 + 4^2)")', 'node1.evaluate()', 'code1 = node1.compile()', 'code1.evaluate()', 'scope = {a: 3, b: 4}', 'node2 = parse("a * b")', 'node2.evaluate(scope)', 'code2 = node2.compile()', 'code2.evaluate(scope)'], - seealso: ['parser', 'evaluate', 'compile'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parser.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parser.js deleted file mode 100644 index 6cd59fa..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parser.js +++ /dev/null @@ -1,8 +0,0 @@ -export var parserDocs = { - name: 'parser', - category: 'Expression', - syntax: ['parser()'], - description: 'Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.', - examples: ['myParser = parser()', 'myParser.evaluate("sqrt(3^2 + 4^2)")', 'myParser.set("x", 3)', 'myParser.evaluate("y = x + 3")', 'myParser.evaluate(["y = x + 3", "y = y + 1"])', 'myParser.get("y")'], - seealso: ['evaluate', 'parse', 'compile'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js deleted file mode 100644 index f372020..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js deleted file mode 100644 index ebf61d7..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js deleted file mode 100644 index 88112d0..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js deleted file mode 100644 index e5a7c58..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/nullish.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/nullish.js deleted file mode 100644 index 764e000..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/nullish.js +++ /dev/null @@ -1,8 +0,0 @@ -export var nullishDocs = { - name: 'nullish', - category: 'Logical', - syntax: ['x ?? y', 'nullish(x, y)'], - description: 'Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.', - examples: ['null ?? 42', 'undefined ?? 42', '0 ?? 42', 'false ?? 42', 'null ?? undefined ?? 42'], - seealso: ['and', 'or', 'not'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js deleted file mode 100644 index dbcd620..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js deleted file mode 100644 index c362d93..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js deleted file mode 100644 index 2a2ee86..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js deleted file mode 100644 index b865da7..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js deleted file mode 100644 index 6237021..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js deleted file mode 100644 index c9eed54..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js deleted file mode 100644 index 730680e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js deleted file mode 100644 index 79e0c92..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js deleted file mode 100644 index b6f65c8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js deleted file mode 100644 index 518aa59..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js deleted file mode 100644 index 05d137d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js deleted file mode 100644 index 56bfea9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js deleted file mode 100644 index 6a372a2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js deleted file mode 100644 index 01658cd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js deleted file mode 100644 index 02660a9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js deleted file mode 100644 index 11f11dc..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js deleted file mode 100644 index cc1daa2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js deleted file mode 100644 index c3d717e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js deleted file mode 100644 index 99b6ce8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js deleted file mode 100644 index db48c64..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js deleted file mode 100644 index 9d655ea..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js deleted file mode 100644 index 711294e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/mapSlices.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/mapSlices.js deleted file mode 100644 index 04196fc..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/mapSlices.js +++ /dev/null @@ -1,11 +0,0 @@ -export var mapSlicesDocs = { - name: 'mapSlices', - category: 'Matrix', - syntax: ['mapSlices(A, dim, callback)'], - description: 'Generate a matrix one dimension less than A by applying callback to ' + 'each slice of A along dimension dim.', - examples: ['A = [[1, 2], [3, 4]]', 'mapSlices(A, 1, sum)', - // returns [4, 6] - 'mapSlices(A, 2, prod)' // returns [2, 12] - ], - seealso: ['map', 'forEach'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js deleted file mode 100644 index 7d9a8e4..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js deleted file mode 100644 index b872299..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js deleted file mode 100644 index 2ffdb7c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js deleted file mode 100644 index 793db0e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js deleted file mode 100644 index b896b3f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js deleted file mode 100644 index 93a7a43..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js deleted file mode 100644 index d059efc..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js deleted file mode 100644 index 4a7e1da..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js deleted file mode 100644 index 8ff141a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js deleted file mode 100644 index 8d45123..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js deleted file mode 100644 index 52c553d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js deleted file mode 100644 index ca6626b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js deleted file mode 100644 index a93282e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js deleted file mode 100644 index 5f21063..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js deleted file mode 100644 index bd699fe..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js deleted file mode 100644 index 9c3907e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js deleted file mode 100644 index 863f7f8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js deleted file mode 100644 index a565ec5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js deleted file mode 100644 index c6bbeb9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js deleted file mode 100644 index 412cac9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/bernoulli.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/bernoulli.js deleted file mode 100644 index cc97263..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/bernoulli.js +++ /dev/null @@ -1,8 +0,0 @@ -export var bernoulliDocs = { - name: 'bernoulli', - category: 'Probability', - syntax: ['bernoulli(n)'], - description: 'The nth Bernoulli number', - examples: ['bernoulli(4)', 'bernoulli(fraction(12))'], - seealso: ['combinations', 'gamma', 'stirlingS2'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js deleted file mode 100644 index e9d3396..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js deleted file mode 100644 index 1938bf8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/distribution.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/distribution.js deleted file mode 100644 index fce3ffb..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/distribution.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js deleted file mode 100644 index a3086a2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js deleted file mode 100644 index a5101a2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js deleted file mode 100644 index f9e967a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js deleted file mode 100644 index 0c9c7ca..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js deleted file mode 100644 index d32e1f8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js deleted file mode 100644 index f955d24..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js deleted file mode 100644 index 4acf5dd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js deleted file mode 100644 index 69d6711..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js deleted file mode 100644 index 6518fc3..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js deleted file mode 100644 index 17361a5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js deleted file mode 100644 index c4202df..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js deleted file mode 100644 index 7225760..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js deleted file mode 100644 index 7332e8a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js deleted file mode 100644 index e0c956d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js deleted file mode 100644 index f02230e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js deleted file mode 100644 index c5b28ad..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js +++ /dev/null @@ -1,8 +0,0 @@ -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. Comparing a value with NaN returns false.', - 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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js deleted file mode 100644 index 22fc8e2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js deleted file mode 100644 index 31f616f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js +++ /dev/null @@ -1,8 +0,0 @@ -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. Comparing a value with NaN returns false.', - 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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js deleted file mode 100644 index c0a7b0a..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js deleted file mode 100644 index df7b95b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js deleted file mode 100644 index 2c80f7b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js deleted file mode 100644 index 844f47b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js deleted file mode 100644 index 50d839e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js deleted file mode 100644 index b8dd9eb..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js deleted file mode 100644 index 095c83f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js deleted file mode 100644 index 8ad1670..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js deleted file mode 100644 index b868e6e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js deleted file mode 100644 index dbeff60..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js deleted file mode 100644 index f3bdcd6..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js deleted file mode 100644 index fadee5b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js deleted file mode 100644 index f175874..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js deleted file mode 100644 index 7d39325..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js deleted file mode 100644 index 2a2f63b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js deleted file mode 100644 index fd0d020..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js deleted file mode 100644 index 9509463..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js deleted file mode 100644 index 18c3556..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js deleted file mode 100644 index 3ad0341..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js deleted file mode 100644 index 6ae2428..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js +++ /dev/null @@ -1,8 +0,0 @@ -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. If any NaN values are found, the function yields the last NaN in the input.', - 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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js deleted file mode 100644 index 3ae39f4..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js deleted file mode 100644 index 7461756..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js deleted file mode 100644 index af4fc92..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js +++ /dev/null @@ -1,8 +0,0 @@ -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. If any NaN values are found, the function yields the last NaN in the input.', - 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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js deleted file mode 100644 index e61e57c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js deleted file mode 100644 index 7f86d23..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js deleted file mode 100644 index e95eaac..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js deleted file mode 100644 index 8149980..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js deleted file mode 100644 index 93d0723..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js +++ /dev/null @@ -1,8 +0,0 @@ -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', 'variance'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js deleted file mode 100644 index 1158062..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js deleted file mode 100644 index f2aafc9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js deleted file mode 100644 index e8be448..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js deleted file mode 100644 index 96dc7df..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js deleted file mode 100644 index 85d3955..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js deleted file mode 100644 index 9d93a03..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js deleted file mode 100644 index 492b548..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js deleted file mode 100644 index 2b3a0c1..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js deleted file mode 100644 index ed223d8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js deleted file mode 100644 index 4d956e9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js deleted file mode 100644 index ae60da9..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js deleted file mode 100644 index 3b94dc6..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js deleted file mode 100644 index 2489919..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js deleted file mode 100644 index 3065fd7..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js deleted file mode 100644 index 6fecbbc..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js deleted file mode 100644 index b9b6a81..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js deleted file mode 100644 index 3b48e1f..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js deleted file mode 100644 index 605e125..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js deleted file mode 100644 index 0ab3e1d..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js deleted file mode 100644 index 7c1e0f6..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js deleted file mode 100644 index 68e37dd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js deleted file mode 100644 index 3a51e19..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js deleted file mode 100644 index 79de9f1..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js deleted file mode 100644 index 4656c82..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js deleted file mode 100644 index 0a96d8e..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js deleted file mode 100644 index 61cf2dd..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js deleted file mode 100644 index 090ebee..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/toBest.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/toBest.js deleted file mode 100644 index 86000b8..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/toBest.js +++ /dev/null @@ -1,8 +0,0 @@ -export var toBestDocs = { - name: 'toBest', - category: 'Units', - syntax: ['toBest(x)', 'toBest(x, unitList)', 'toBest(x, unitList, options)'], - description: 'Converts to the most appropriate display unit.', - examples: ['toBest(unit(5000, "m"))', 'toBest(unit(3500000, "W"))', 'toBest(unit(0.000000123, "A"))', 'toBest(unit(10, "m"), "cm")', 'toBest(unit(10, "m"), "mm,km", {offset: 1.5})'], - seealso: [] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js deleted file mode 100644 index e7f1ac2..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js deleted file mode 100644 index 17685b5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js deleted file mode 100644 index a2d5544..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js deleted file mode 100644 index fdc397c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js deleted file mode 100644 index 9764dc4..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isBounded.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isBounded.js deleted file mode 100644 index 40b58cb..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isBounded.js +++ /dev/null @@ -1,8 +0,0 @@ -export var isBoundedDocs = { - name: 'isBounded', - category: 'Utils', - syntax: ['isBounded(x)'], - description: 'Test whether a value or its entries are bounded.', - examples: ['isBounded(Infinity)', 'isBounded(bigint(3))', 'isBounded([3, -Infinity, -3])'], - seealso: ['isFinite', 'isNumeric', 'isNaN', 'isNegative', 'isPositive'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isFinite.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isFinite.js deleted file mode 100644 index d420672..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isFinite.js +++ /dev/null @@ -1,8 +0,0 @@ -export var isFiniteDocs = { - name: 'isFinite', - category: 'Utils', - syntax: ['isFinite(x)'], - description: 'Test whether a value is finite, elementwise on collections.', - examples: ['isFinite(Infinity)', 'isFinite(bigint(3))', 'isFinite([3, -Infinity, -3])'], - seealso: ['isBounded', 'isNumeric', 'isNaN', 'isNegative', 'isPositive'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js deleted file mode 100644 index 5b87586..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js deleted file mode 100644 index 8662936..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js +++ /dev/null @@ -1,8 +0,0 @@ -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', 'isFinite', 'isBounded'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js deleted file mode 100644 index a0f90c5..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js deleted file mode 100644 index 1448955..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js +++ /dev/null @@ -1,8 +0,0 @@ -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', 'isFinite', 'isBounded'] -}; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js deleted file mode 100644 index 3af6886..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js deleted file mode 100644 index a46ed17..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js deleted file mode 100644 index 3e08770..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js deleted file mode 100644 index 382f6c1..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js deleted file mode 100644 index 535a28b..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js deleted file mode 100644 index 6671b0c..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js b/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js deleted file mode 100644 index 91629c6..0000000 --- a/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/function/compile.js b/node_modules/mathjs/lib/esm/expression/function/compile.js deleted file mode 100644 index b9441a7..0000000 --- a/node_modules/mathjs/lib/esm/expression/function/compile.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/function/evaluate.js b/node_modules/mathjs/lib/esm/expression/function/evaluate.js deleted file mode 100644 index a4a68d0..0000000 --- a/node_modules/mathjs/lib/esm/expression/function/evaluate.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/function/help.js b/node_modules/mathjs/lib/esm/expression/function/help.js deleted file mode 100644 index 8252aba..0000000 --- a/node_modules/mathjs/lib/esm/expression/function/help.js +++ /dev/null @@ -1,66 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/function/parser.js b/node_modules/mathjs/lib/esm/expression/function/parser.js deleted file mode 100644 index efb4df0..0000000 --- a/node_modules/mathjs/lib/esm/expression/function/parser.js +++ /dev/null @@ -1,57 +0,0 @@ -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 `math.Parser` object that keeps a context of variables and their values, allowing the evaluation of expressions in that context. - * - * 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/node_modules/mathjs/lib/esm/expression/keywords.js b/node_modules/mathjs/lib/esm/expression/keywords.js deleted file mode 100644 index 4ab02b1..0000000 --- a/node_modules/mathjs/lib/esm/expression/keywords.js +++ /dev/null @@ -1,2 +0,0 @@ -// Reserved keywords not allowed to use in the parser -export var keywords = new Set(['end']); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js b/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js deleted file mode 100644 index 2cff8af..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js +++ /dev/null @@ -1,218 +0,0 @@ -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 - * @param {boolean} [optionalChaining=false] - * Optional property, if the accessor was written as optional-chaining - * using `a?.b`, or `a?.["b"] with bracket notation. - * Forces evaluate to undefined if the given object is undefined or null. - */ - constructor(object, index) { - var optionalChaining = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - 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; - this.optionalChaining = optionalChaining; - } - - // 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); - var optionalChaining = this.optionalChaining; - var prevOptionalChaining = isAccessorNode(this.object) && this.object.optionalChaining; - if (this.index.isObjectProperty()) { - var prop = this.index.getObjectProperty(); - return function evalAccessorNode(scope, args, context) { - var ctx = context || {}; - var object = evalObject(scope, args, ctx); - if (optionalChaining && object == null) { - ctx.optionalShortCircuit = true; - return undefined; - } - if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) { - return undefined; - } - - // get a property from an object evaluated using the scope. - return getSafeProperty(object, prop); - }; - } else { - return function evalAccessorNode(scope, args, context) { - var ctx = context || {}; - var object = evalObject(scope, args, ctx); - if (optionalChaining && object == null) { - ctx.optionalShortCircuit = true; - return undefined; - } - if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) { - return undefined; - } - - // 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)), this.optionalChaining); - } - - /** - * Create a clone of this node, a shallow copy - * @return {AccessorNode} - */ - clone() { - return new AccessorNode(this.object, this.index, this.optionalChaining); - } - - /** - * Get string representation - * @param {Object} options - * @return {string} - */ - _toString(options) { - var object = this.object.toString(options); - if (needParenthesis(this.object)) { - object = '(' + object + ')'; - } - var optionalChaining = this.optionalChaining ? this.index.dotNotation ? '?' : '?.' : ''; - return object + optionalChaining + 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, - optionalChaining: this.optionalChaining - }; - } - - /** - * 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, json.optionalChaining); - } - } - _defineProperty(AccessorNode, "name", name); - return AccessorNode; -}, { - isClass: true, - isNode: true -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js b/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js deleted file mode 100644 index 9382a2c..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js +++ /dev/null @@ -1,176 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js b/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js deleted file mode 100644 index dacaadb..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js +++ /dev/null @@ -1,306 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/BlockNode.js b/node_modules/mathjs/lib/esm/expression/node/BlockNode.js deleted file mode 100644 index e32f428..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/BlockNode.js +++ /dev/null @@ -1,185 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js b/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js deleted file mode 100644 index 3dfb8c8..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js +++ /dev/null @@ -1,225 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js b/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js deleted file mode 100644 index 5160b57..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js +++ /dev/null @@ -1,179 +0,0 @@ -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', 'isBounded']; -export var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - Node, - isBounded - } = _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': - { - if (!isBounded(this.value)) { - 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/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js b/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js deleted file mode 100644 index 632744d..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js +++ /dev/null @@ -1,237 +0,0 @@ -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 expr = this.expr; - var evalExpr = 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; - fn.expr = expr.toString(); - 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/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js b/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js deleted file mode 100644 index 7d21e10..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js +++ /dev/null @@ -1,494 +0,0 @@ -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, optional) { - 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"'); - } - var optionalType = typeof optional; - if (!(optionalType === 'undefined' || optionalType === 'boolean')) { - throw new TypeError('optional flag, if specified, must be boolean'); - } - this.fn = fn; - this.args = args || []; - this.optional = !!optional; - } - - // 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)); - var fromOptionalChaining = this.optional || isAccessorNode(this.fn) && this.fn.optionalChaining; - 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 if (fromOptionalChaining) value = undefined;else return FunctionNode.onUndefinedFunction(_name); - if (typeof value === 'function' || fromOptionalChaining && value === undefined) { - 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); - if (fromOptionalChaining && fn === undefined) return undefined; - return fn(); - }; - case 1: - return function evalFunctionNode(scope, args, context) { - var fn = resolveFn(scope); - if (fromOptionalChaining && fn === undefined) return undefined; - var evalArg0 = evalArgs[0]; - return fn(evalArg0(scope, args, context)); - }; - case 2: - return function evalFunctionNode(scope, args, context) { - var fn = resolveFn(scope); - if (fromOptionalChaining && fn === undefined) return undefined; - 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); - if (fromOptionalChaining && fn === undefined) return undefined; - 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 (fromOptionalChaining && fn === undefined) return undefined; - 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); - - // Optional chaining: if the base object is nullish, short-circuit to undefined - if (fromOptionalChaining && (object == null || object[prop] === undefined)) { - return undefined; - } - 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 (fromOptionalChaining && fn === undefined) return undefined; - 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/node_modules/mathjs/lib/esm/expression/node/IndexNode.js b/node_modules/mathjs/lib/esm/expression/node/IndexNode.js deleted file mode 100644 index 82f5b42..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/IndexNode.js +++ /dev/null @@ -1,219 +0,0 @@ -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); - 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/node_modules/mathjs/lib/esm/expression/node/Node.js b/node_modules/mathjs/lib/esm/expression/node/Node.js deleted file mode 100644 index 17a7671..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/Node.js +++ /dev/null @@ -1,372 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js b/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js deleted file mode 100644 index c5156ef..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js +++ /dev/null @@ -1,193 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js b/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js deleted file mode 100644 index 61a8339..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js +++ /dev/null @@ -1,629 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js b/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js deleted file mode 100644 index 630f44b..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js +++ /dev/null @@ -1,152 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/RangeNode.js b/node_modules/mathjs/lib/esm/expression/node/RangeNode.js deleted file mode 100644 index e30edf7..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/RangeNode.js +++ /dev/null @@ -1,250 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js b/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js deleted file mode 100644 index dd654c7..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js +++ /dev/null @@ -1,198 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js b/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js deleted file mode 100644 index 1f46062..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js +++ /dev/null @@ -1,193 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/utils/access.js b/node_modules/mathjs/lib/esm/expression/node/utils/access.js deleted file mode 100644 index 4da61c2..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/utils/access.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/node/utils/assign.js b/node_modules/mathjs/lib/esm/expression/node/utils/assign.js deleted file mode 100644 index 84fd91c..0000000 --- a/node_modules/mathjs/lib/esm/expression/node/utils/assign.js +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/operators.js b/node_modules/mathjs/lib/esm/expression/operators.js deleted file mode 100644 index 8623058..0000000 --- a/node_modules/mathjs/lib/esm/expression/operators.js +++ /dev/null @@ -1,384 +0,0 @@ -// 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: [] - } -}, { - // nullish coalescing - 'OperatorNode:nullish': { - op: '??', - associativity: 'left', - 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/node_modules/mathjs/lib/esm/expression/parse.js b/node_modules/mathjs/lib/esm/expression/parse.js deleted file mode 100644 index f2b1972..0000000 --- a/node_modules/mathjs/lib/esm/expression/parse.js +++ /dev/null @@ -1,1693 +0,0 @@ -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() or transformed into a functional object via node.compile(). - * - * 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') - * node2.evaluate(scope) // 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 - * - * History: - * - * v0.9 Created - * v0.13 Switched to one-based indices - * v0.14 Added `[1,2;3,4]` notation for matrices - * v0.18 Dropped the `function` keyword - * v0.20 Added ternary conditional - * v0.27 Allow multi-line expressions; allow functions that receive - * unevaluated parameters (`rawArgs`) - * v3 Add object notation; allow assignments internal to other - * expressions - * v7.3 Supported binary, octal, and hexadecimal notation - * v9.5 Support for calculations with percentages - * v12.4 Allow trailing commas in matrices - * v14.8 Add nullish coalescing operator - * v15.1 Add optional chaining operator - * - * @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, - '>>': 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 - // Special case: the check for '?.' is to prevent a case like 'a?.3:.7' from being interpreted as optional chaining - // TODO: refactor the tokenization into some better way to deal with cases like 'a?.3:.7', see https://github.com/josdejong/mathjs/pull/3584 - if (c2.length === 2 && DELIMITERS[c2] && (c2 !== '?.' || !parse.isDigit(state.expression.charAt(state.index + 2)))) { - 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.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(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.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(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 (parse.isDecimalMark(nextCharacter(state), state.expression.charAt(state.index + 2))) { - 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 === '\u00A0' || 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'; - }; - - /** - * 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' - if (node.optionalChaining) { - throw createSyntaxError(state, 'Cannot assign to optional chain'); - } - 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' && '])},;'.includes(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 === ':') { - if (state.conditionalLevel === state.nestingLevel) { - // we are in the midst of parsing a conditional operator, so not - // a range, but rather an empty true-expr, which is considered a - // syntax error - throw createSyntaxError(state, 'The true-expression of a conditional operator may not be empty'); - } else { - // implicit start of range = 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 = parseMultiplyDivideModulus(state); - var operators = { - '+': 'add', - '-': 'subtract' - }; - while (hasOwnProperty(operators, state.token)) { - name = state.token; - fn = operators[name]; - getTokenSkipNewline(state); - var rightNode = parseMultiplyDivideModulus(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, modulus - * @return {Node} node - * @private - */ - function parseMultiplyDivideModulus(state) { - var node, last, name, fn; - node = parseImplicitMultiplication(state); - last = node; - var operators = { - '*': 'multiply', - '.*': 'dotMultiply', - '/': 'divide', - './': 'dotDivide', - '%': 'mod', - mod: 'mod' - }; - 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 = parseUnaryPercentage(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 === '(' || state.token === 'in') { - // 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 = parseUnaryPercentage(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; - } - - /** - * Unary percentage operator (treated as `value / 100`) - * @return {Node} node - * @private - */ - function parseUnaryPercentage(state) { - var node = parseUnary(state); - if (state.token === '%') { - var previousState = _extends({}, state); - getTokenSkipNewline(state); - // We need to decide if this is a unary percentage % or binary modulo % - // So we attempt to parse a unary expression at this point. - // If it fails, then the only possibility is that this is a unary percentage. - // If it succeeds, then we presume that this must be binary modulo, since the - // only things that parseUnary can handle are _higher_ precedence than unary %. - try { - parseUnary(state); - // Not sure if we could somehow use the result of that parseUnary? Without - // further analysis/testing, safer just to discard and let the parse proceed - _extends(state, previousState); - } catch (_unused) { - // Not seeing a term at this point, so was a unary % - node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true); - } - } - 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 = parseNullishCoalescing(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; - } - - /** - * nullish coalescing operator - * @return {Node} node - * @private - */ - function parseNullishCoalescing(state) { - var node = parseLeftHandOperators(state); - while (state.token === '??') { - // eslint-disable-line no-unmodified-loop-condition - getTokenSkipNewline(state); - node = new OperatorNode('??', 'nullish', [node, parseLeftHandOperators(state)]); - } - 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) or sqrt?.(2) with optional chaining - * - index enclosed in square brackets [...], for example A[2,3] or A?.[2,3] with optional chaining - * - dot notation for properties, like foo.bar or foo?.bar with optional chaining - * @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; - - // Iterate and handle chained accessors, including repeated optional chaining - while (true) { - // eslint-disable-line no-unmodified-loop-condition - // Track whether an optional chaining operator precedes the next accessor - var optional = false; - - // Consume an optional chaining operator if present - if (state.token === '?.') { - optional = true; - // consume the '?.' token - getToken(state); - } - var hasNextAccessor = (state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token)); - if (!(optional || hasNextAccessor)) { - break; - } - params = []; - if (state.token === '(') { - if (optional || isSymbolNode(node) || isAccessorNode(node)) { - // function invocation: fn(2, 3) or obj.fn(2, 3) or (anything)?.(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, optional); - } 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), optional); - } else { - // dot notation like variable.prop - // consume the `.` (if it was ?., already consumed): - if (!optional) getToken(state); - var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS; - if (!isPropertyName) { - var message = 'Property name expected after '; - message += optional ? 'optional chain' : 'dot'; - throw createSyntaxError(state, message); - } - params.push(new ConstantNode(state.token)); - getToken(state); - var dotNotation = true; - node = new AccessorNode(node, new IndexNode(params, dotNotation), optional); - } - } - 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/node_modules/mathjs/lib/esm/expression/transform/and.transform.js b/node_modules/mathjs/lib/esm/expression/transform/and.transform.js deleted file mode 100644 index 9c80960..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/and.transform.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js b/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js deleted file mode 100644 index 0985a33..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js b/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js deleted file mode 100644 index 9f154f1..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/column.transform.js b/node_modules/mathjs/lib/esm/expression/transform/column.transform.js deleted file mode 100644 index ccfb0a3..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/column.transform.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js b/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js deleted file mode 100644 index 737876d..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js b/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js deleted file mode 100644 index 049dc14..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js b/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js deleted file mode 100644 index 970cf80..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js b/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js deleted file mode 100644 index 33e383f..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js +++ /dev/null @@ -1,56 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js b/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js deleted file mode 100644 index 4934561..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/index.transform.js b/node_modules/mathjs/lib/esm/expression/transform/index.transform.js deleted file mode 100644 index 4a4e6a1..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/index.transform.js +++ /dev/null @@ -1,52 +0,0 @@ -import { isArray, isBigInt, 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) || isBigInt(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, bigint, 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/node_modules/mathjs/lib/esm/expression/transform/map.transform.js b/node_modules/mathjs/lib/esm/expression/transform/map.transform.js deleted file mode 100644 index 252a862..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/map.transform.js +++ /dev/null @@ -1,53 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/mapSlices.transform.js b/node_modules/mathjs/lib/esm/expression/transform/mapSlices.transform.js deleted file mode 100644 index acd41dc..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/mapSlices.transform.js +++ /dev/null @@ -1,47 +0,0 @@ -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 { errorTransform } from './utils/errorTransform.js'; -import { factory } from '../../utils/factory.js'; -import { createMapSlices } from '../../function/matrix/mapSlices.js'; -import { isBigNumber, isNumber } from '../../utils/is.js'; -var name = 'mapSlices'; -var dependencies = ['typed', 'isInteger']; - -/** - * Attach a transform function to math.mapSlices - * Adds a property transform containing the transform function. - * - * This transform changed the last `dim` parameter of function mapSlices - * from one-based to zero based - */ -export var createMapSlicesTransform = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - isInteger - } = _ref; - var mapSlices = createMapSlices({ - typed, - isInteger - }); - - // @see: comment of concat itself - return typed('mapSlices', { - '...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 mapSlices.apply(null, args); - } catch (err) { - throw errorTransform(err); - } - } - }); -}, _objectSpread({ - isTransformFunction: true -}, createMapSlices.meta)); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/transform/max.transform.js b/node_modules/mathjs/lib/esm/expression/transform/max.transform.js deleted file mode 100644 index a3c66f3..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/max.transform.js +++ /dev/null @@ -1,42 +0,0 @@ -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', 'isNaN']; -export var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - numeric, - larger, - isNaN: mathIsNaN - } = _ref; - var max = createMax({ - typed, - config, - numeric, - larger, - isNaN: mathIsNaN - }); - - /** - * 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/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js b/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js deleted file mode 100644 index 8d080f7..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/min.transform.js b/node_modules/mathjs/lib/esm/expression/transform/min.transform.js deleted file mode 100644 index 67f85d6..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/min.transform.js +++ /dev/null @@ -1,42 +0,0 @@ -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', 'isNaN']; -export var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - numeric, - smaller, - isNaN: mathIsNaN - } = _ref; - var min = createMin({ - typed, - config, - numeric, - smaller, - isNaN: mathIsNaN - }); - - /** - * 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/node_modules/mathjs/lib/esm/expression/transform/nullish.transform.js b/node_modules/mathjs/lib/esm/expression/transform/nullish.transform.js deleted file mode 100644 index 70f91ca..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/nullish.transform.js +++ /dev/null @@ -1,37 +0,0 @@ -import { createNullish } from '../../function/logical/nullish.js'; -import { factory } from '../../utils/factory.js'; -import { isCollection } from '../../utils/is.js'; -var name = 'nullish'; -var dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual']; -export var createNullishTransform = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - matrix, - size, - flatten, - deepEqual - } = _ref; - var nullish = createNullish({ - typed, - matrix, - size, - flatten, - deepEqual - }); - function nullishTransform(args, math, scope) { - var left = args[0].compile().evaluate(scope); - - // If left is not a collection and not nullish, short-circuit and return it - if (!isCollection(left) && left != null && left !== undefined) { - return left; - } - - // Otherwise evaluate right and apply full nullish semantics (incl. element-wise) - var right = args[1].compile().evaluate(scope); - return nullish(left, right); - } - nullishTransform.rawArgs = true; - return nullishTransform; -}, { - isTransformFunction: true -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/expression/transform/or.transform.js b/node_modules/mathjs/lib/esm/expression/transform/or.transform.js deleted file mode 100644 index 1b1920e..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/or.transform.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/print.transform.js b/node_modules/mathjs/lib/esm/expression/transform/print.transform.js deleted file mode 100644 index 645000d..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/print.transform.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js b/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js deleted file mode 100644 index 8e5c0b9..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js +++ /dev/null @@ -1,61 +0,0 @@ -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', 'mapSlices']; - -/** - * 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, - mapSlices - } = _ref; - var quantileSeq = createQuantileSeq({ - typed, - bignumber, - add, - subtract, - divide, - multiply, - partitionSelect, - compare, - isInteger, - smaller, - smallerEq, - larger, - mapSlices - }); - 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/node_modules/mathjs/lib/esm/expression/transform/range.transform.js b/node_modules/mathjs/lib/esm/expression/transform/range.transform.js deleted file mode 100644 index b7f3f78..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/range.transform.js +++ /dev/null @@ -1,54 +0,0 @@ -import { factory } from '../../utils/factory.js'; -import { createRange } from '../../function/matrix/range.js'; -var name = 'range'; -var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive']; -export var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - matrix, - bignumber, - equal, - smaller, - smallerEq, - larger, - largerEq, - add, - isZero, - isPositive - } = _ref; - var range = createRange({ - typed, - config, - matrix, - bignumber, - equal, - smaller, - smallerEq, - larger, - largerEq, - add, - isZero, - 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/node_modules/mathjs/lib/esm/expression/transform/row.transform.js b/node_modules/mathjs/lib/esm/expression/transform/row.transform.js deleted file mode 100644 index 2bb7084..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/row.transform.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/std.transform.js b/node_modules/mathjs/lib/esm/expression/transform/std.transform.js deleted file mode 100644 index 5e83737..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/std.transform.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js b/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js deleted file mode 100644 index 23f29cf..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js b/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js deleted file mode 100644 index d5a27f8..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js b/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js deleted file mode 100644 index 96f7c32..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js b/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js deleted file mode 100644 index 6c17d76..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js b/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js deleted file mode 100644 index b64f7ff..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js b/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js deleted file mode 100644 index d2d939c..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js b/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js deleted file mode 100644 index 090a0c2..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js +++ /dev/null @@ -1,95 +0,0 @@ -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/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js b/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js deleted file mode 100644 index c53c553..0000000 --- a/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js +++ /dev/null @@ -1,46 +0,0 @@ -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', 'mapSlices', '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, - mapSlices, - isNaN: mathIsNaN - } = _ref; - var variance = createVariance({ - typed, - add, - subtract, - multiply, - divide, - mapSlices, - isNaN: mathIsNaN - }); - 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/node_modules/mathjs/lib/esm/factoriesAny.js b/node_modules/mathjs/lib/esm/factoriesAny.js deleted file mode 100644 index 3426dfe..0000000 --- a/node_modules/mathjs/lib/esm/factoriesAny.js +++ /dev/null @@ -1,303 +0,0 @@ -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 { createIsBounded } from './function/utils/isBounded.js'; -export { createIsFinite } from './function/utils/isFinite.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 { createMapSlices } from './function/matrix/mapSlices.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 { createNullish } from './function/logical/nullish.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 { createToBest } from './function/unit/toBest.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 { createBernoulli } from './function/probability/bernoulli.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, createCoulombConstant, 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 { createMapSlicesTransform } from './expression/transform/mapSlices.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 { createNullishTransform } from './expression/transform/nullish.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/node_modules/mathjs/lib/esm/factoriesNumber.js b/node_modules/mathjs/lib/esm/factoriesNumber.js deleted file mode 100644 index 0334208..0000000 --- a/node_modules/mathjs/lib/esm/factoriesNumber.js +++ /dev/null @@ -1,269 +0,0 @@ -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 { createMapSlices } from './function/matrix/mapSlices.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 { createBernoulli } from './function/probability/bernoulli.js'; -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 { createMapSlicesTransform } from './expression/transform/mapSlices.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 { createIsBounded } from './function/utils/isBounded.js'; -export { createIsFinite } from './function/utils/isFinite.js'; -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/node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js b/node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js deleted file mode 100644 index aa4c6b6..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/decomposition/lup.js +++ /dev/null @@ -1,379 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js b/node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js deleted file mode 100644 index ad79a33..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/decomposition/qr.js +++ /dev/null @@ -1,222 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js b/node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js deleted file mode 100644 index a3ee46f..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/decomposition/schur.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js b/node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js deleted file mode 100644 index 13f07f9..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/decomposition/slu.js +++ /dev/null @@ -1,101 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/derivative.js b/node_modules/mathjs/lib/esm/function/algebra/derivative.js deleted file mode 100644 index 276bbd6..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/derivative.js +++ /dev/null @@ -1,506 +0,0 @@ -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 cache = new Map(); - var variableName = variable.name; - function isConstCached(node) { - var cached = cache.get(node); - if (cached !== undefined) { - return cached; - } - var res = _isConst(isConstCached, node, variableName); - cache.set(node, res); - return res; - } - var res = _derivative(expr, isConstCached); - 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++) { - - res = _derivative(res, isConst) - } - 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]"); - } - }); - - /** - * Checks if a node is constants (e.g. 2 + 2). - * Accepts (usually memoized) version of self as the first parameter for recursive calls. - * 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 {function} isConst Function that tells whether sub-expression is a constant - * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node - * @param {string} varName Variable that we are differentiating - * @return {boolean} if node is constant - */ - var _isConst = typed('_isConst', { - 'function, ConstantNode, string': function function_ConstantNode_string() { - return true; - }, - 'function, SymbolNode, string': function function_SymbolNode_string(isConst, node, varName) { - // Treat other variables like constants. For reasoning, see: - // https://en.wikipedia.org/wiki/Partial_derivative - return node.name !== varName; - }, - 'function, ParenthesisNode, string': function function_ParenthesisNode_string(isConst, node, varName) { - return isConst(node.content, varName); - }, - 'function, FunctionAssignmentNode, string': function function_FunctionAssignmentNode_string(isConst, node, varName) { - if (!node.params.includes(varName)) { - return true; - } - return isConst(node.expr, varName); - }, - 'function, FunctionNode | OperatorNode, string': function function_FunctionNode__OperatorNode_string(isConst, node, varName) { - return node.args.every(arg => isConst(arg, varName)); - } - }); - - /** - * Applies differentiation rules. - * - * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node - * @param {function} isConst Function that tells if a node is constant - * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr` - */ - var _derivative = typed('_derivative', { - 'ConstantNode, function': function ConstantNode_function() { - return createConstantNode(0); - }, - 'SymbolNode, function': function SymbolNode_function(node, isConst) { - if (isConst(node)) { - return createConstantNode(0); - } - return createConstantNode(1); - }, - 'ParenthesisNode, function': function ParenthesisNode_function(node, isConst) { - return new ParenthesisNode(_derivative(node.content, isConst)); - }, - 'FunctionAssignmentNode, function': function FunctionAssignmentNode_function(node, isConst) { - if (isConst(node)) { - return createConstantNode(0); - } - return _derivative(node.expr, isConst); - }, - 'FunctionNode, function': function FunctionNode_function(node, isConst) { - if (isConst(node)) { - 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]]); - return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), isConst); - } - 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 && isConst(node.args[1])) { - // 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]])]), isConst); - } - break; - case 'pow': - if (node.args.length === 2) { - // Pass to pow operator node parser - return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), isConst); - } - 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, isConst); - if (negative) { - chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]); - } - return new OperatorNode(op, func, [chainDerivative, funcDerivative]); - }, - 'OperatorNode, function': function OperatorNode_function(node, isConst) { - if (isConst(node)) { - 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, isConst); - })); - } - if (node.op === '-') { - // d/dx(+/-f(x)) = +/-f'(x) - if (node.isUnary()) { - return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], isConst)]); - } - - // 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], isConst), _derivative(node.args[1], isConst)]); - } - } - if (node.op === '*') { - // d/dx(c*f(x)) = c*f'(x) - var constantTerms = node.args.filter(function (arg) { - return isConst(arg); - }); - if (constantTerms.length > 0) { - var nonConstantTerms = node.args.filter(function (arg) { - return !isConst(arg); - }); - var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms); - var newArgs = constantTerms.concat(_derivative(nonConstantNode, isConst)); - 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, isConst) : 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 (isConst(arg1)) { - return new OperatorNode('/', 'divide', [_derivative(arg0, isConst), arg1]); - } - - // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2) - if (isConst(arg0)) { - return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, isConst), 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, isConst), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, isConst)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]); - } - if (node.op === '^' && node.isBinary()) { - var _arg = node.args[0]; - var _arg2 = node.args[1]; - if (isConst(_arg)) { - // 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(), isConst)])]); - } - if (isConst(_arg2)) { - 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, isConst); - } - } - - // 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, isConst), 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, isConst), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, isConst), 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/node_modules/mathjs/lib/esm/function/algebra/leafCount.js b/node_modules/mathjs/lib/esm/function/algebra/leafCount.js deleted file mode 100644 index b8ea7d9..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/leafCount.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/lyap.js b/node_modules/mathjs/lib/esm/function/algebra/lyap.js deleted file mode 100644 index 007a006..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/lyap.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js b/node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js deleted file mode 100644 index 70602d3..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/polynomialRoot.js +++ /dev/null @@ -1,126 +0,0 @@ -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 - * - * History: - * - * v11.4 Created - * - * @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/node_modules/mathjs/lib/esm/function/algebra/rationalize.js b/node_modules/mathjs/lib/esm/function/algebra/rationalize.js deleted file mode 100644 index ef702ff..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/rationalize.js +++ /dev/null @@ -1,819 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/resolve.js b/node_modules/mathjs/lib/esm/function/algebra/resolve.js deleted file mode 100644 index 925cdb5..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/resolve.js +++ /dev/null @@ -1,97 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/simplify.js b/node_modules/mathjs/lib/esm/function/algebra/simplify.js deleted file mode 100644 index 849503a..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/simplify.js +++ /dev/null @@ -1,1246 +0,0 @@ -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 = ['typed', 'parse', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode', 'replacer']; -export var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - parse, - equal, - resolve, - simplifyConstant, - simplifyCore, - AccessorNode, - ArrayNode, - ConstantNode, - FunctionNode, - IndexNode, - ObjectNode, - OperatorNode, - ParenthesisNode, - SymbolNode, - replacer - } = _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) { - 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], replacer); - 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/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js b/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js deleted file mode 100644 index 5d63949..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js +++ /dev/null @@ -1,261 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js b/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js deleted file mode 100644 index 557ac1c..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js b/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js deleted file mode 100644 index e0f1082..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js +++ /dev/null @@ -1,467 +0,0 @@ -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', 'isBounded', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode']; -export var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - mathWithTransform, - matrix, - isBounded, - 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 && isBounded(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) { - // note: we convert await from bigint values, because bigint values gives issues with divisions: 1n/2n=0n and not 0.5 - var fromBigInt = value => config.number === 'BigNumber' && bignumber ? bignumber(value) : Number(value); - var numeratorValue = f.s * f.n; - var numeratorNode = numeratorValue < 0n ? new OperatorNode('-', 'unaryMinus', [new ConstantNode(-fromBigInt(numeratorValue))]) : new ConstantNode(fromBigInt(numeratorValue)); - return f.d === 1n ? numeratorNode : new OperatorNode('/', 'divide', [numeratorNode, new ConstantNode(fromBigInt(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/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js b/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js deleted file mode 100644 index 07139bc..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js +++ /dev/null @@ -1,291 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js b/node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js deleted file mode 100644 index ed0bc60..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/solver/lsolve.js +++ /dev/null @@ -1,157 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js b/node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js deleted file mode 100644 index a6f2d8c..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/solver/lsolveAll.js +++ /dev/null @@ -1,186 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js b/node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js deleted file mode 100644 index a0109e6..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/solver/lusolve.js +++ /dev/null @@ -1,108 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js b/node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js deleted file mode 100644 index 5ca5d9d..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/solver/usolve.js +++ /dev/null @@ -1,161 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js b/node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js deleted file mode 100644 index 39366c6..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/solver/usolveAll.js +++ /dev/null @@ -1,190 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js b/node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js deleted file mode 100644 index 42239a1..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/solver/utils/solveValidation.js +++ /dev/null @@ -1,115 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js deleted file mode 100644 index c83299c..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csAmd.js +++ /dev/null @@ -1,580 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csChol.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csChol.js deleted file mode 100644 index 3ea2422..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csChol.js +++ /dev/null @@ -1,157 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js deleted file mode 100644 index 9eaa2bd..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csCounts.js +++ /dev/null @@ -1,126 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csCumsum.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csCumsum.js deleted file mode 100644 index 1c89ada..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csCumsum.js +++ /dev/null @@ -1,28 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js deleted file mode 100644 index 79e3f96..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csDfs.js +++ /dev/null @@ -1,76 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csEreach.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csEreach.js deleted file mode 100644 index 3d16615..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csEreach.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js deleted file mode 100644 index 0b0b29c..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csEtree.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js deleted file mode 100644 index cd1e003..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csFkeep.js +++ /dev/null @@ -1,58 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js deleted file mode 100644 index f375c03..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csFlip.js +++ /dev/null @@ -1,13 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js deleted file mode 100644 index 8a4eb24..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csIpvec.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js deleted file mode 100644 index 9b23e52..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csLeaf.js +++ /dev/null @@ -1,56 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js deleted file mode 100644 index 544f4fc..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csLu.js +++ /dev/null @@ -1,182 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js deleted file mode 100644 index ace68c6..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csMark.js +++ /dev/null @@ -1,16 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js deleted file mode 100644 index 0d0e5b5..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csMarked.js +++ /dev/null @@ -1,14 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js deleted file mode 100644 index 044b656..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csPermute.js +++ /dev/null @@ -1,61 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js deleted file mode 100644 index 6ff7c3f..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csPost.js +++ /dev/null @@ -1,52 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js deleted file mode 100644 index 2f49fb9..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csReach.js +++ /dev/null @@ -1,52 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js deleted file mode 100644 index 82f6f6a..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csSpsolve.js +++ /dev/null @@ -1,84 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js deleted file mode 100644 index a26579a..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csSqr.js +++ /dev/null @@ -1,179 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csSymperm.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csSymperm.js deleted file mode 100644 index f1b0321..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csSymperm.js +++ /dev/null @@ -1,93 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js deleted file mode 100644 index d4b851c..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csTdfs.js +++ /dev/null @@ -1,42 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js b/node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js deleted file mode 100644 index 923dc28..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sparse/csUnflip.js +++ /dev/null @@ -1,14 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/function/algebra/sylvester.js b/node_modules/mathjs/lib/esm/function/algebra/sylvester.js deleted file mode 100644 index d0979d0..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/sylvester.js +++ /dev/null @@ -1,119 +0,0 @@ -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, - config - } = _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/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js b/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js deleted file mode 100644 index ad92304..0000000 --- a/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js +++ /dev/null @@ -1,60 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/abs.js b/node_modules/mathjs/lib/esm/function/arithmetic/abs.js deleted file mode 100644 index 8a89a06..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/abs.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/add.js b/node_modules/mathjs/lib/esm/function/arithmetic/add.js deleted file mode 100644 index d03c855..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/add.js +++ /dev/null @@ -1,90 +0,0 @@ -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 5.21 cm - * - * math.add("2.3", "4") // returns number 6.3 - * - * See also: - * - * subtract, sum - * - * History: - * - * v13 Handle bigint arguments - * v11.6 Support matrix broadcasting - * v3.8 Allow more than two arguments - * v0.0.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js b/node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js deleted file mode 100644 index 490e90b..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/addScalar.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js b/node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js deleted file mode 100644 index bb1c54f..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/cbrt.js +++ /dev/null @@ -1,132 +0,0 @@ -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 1.7320508075689 + i ... - * math.cbrt(x, true) - * // Complex Matrix ["1.7320508075689+i", "-1.7320508075689+i", "-2i"] - * - * See also: - * - * square, sqrt, cube - * - * History: - * - * v2.3 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/ceil.js b/node_modules/mathjs/lib/esm/function/arithmetic/ceil.js deleted file mode 100644 index a8e179f..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/ceil.js +++ /dev/null @@ -1,196 +0,0 @@ -import Decimal from 'decimal.js'; -import { factory } from '../../utils/factory.js'; -import { deepMap } from '../../utils/collection.js'; -import { isInteger, 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']; -var bigTen = new Decimal(10); -export var createCeilNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => { - var { - typed, - config, - round - } = _ref; - function _ceilNumber(x) { - // See ./floor.js _floorNumber for rationale here - var c = Math.ceil(x); - var r = round(x); - if (c === r) return c; - if (nearlyEqual(x, r, config.relTol, config.absTol) && !nearlyEqual(x, c, config.relTol, config.absTol)) { - return r; - } - return c; - } - return typed(name, { - number: _ceilNumber, - 'number, number': function number_number(x, n) { - if (!isInteger(n)) { - throw new RangeError('number of decimals in function ceil must be an integer'); - } - if (n < 0 || n > 15) { - throw new RangeError('number of decimals in ceil number must be in range 0-15'); - } - var shift = 10 ** n; - return _ceilNumber(x * shift) / shift; - } - }); -}); -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 - }); - function _bigCeil(x) { - // see ./floor.js _floorNumber for rationale - var bne = (a, b) => bigNearlyEqual(a, b, config.relTol, config.absTol); - var c = x.ceil(); - var r = round(x); - if (c.eq(r)) return c; - if (bne(x, r) && !bne(x, c)) return r; - return c; - } - /** - * 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) - * math.ceil(unit, valuelessUnit) - * math.ceil(unit, n, valuelessUnit) - * - * 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 - * - * const unit = math.unit('3.241 cm') - * const cm = math.unit('cm') - * const mm = math.unit('mm') - * math.ceil(unit, 1, cm) // returns Unit 3.3 cm ... - * math.ceil(unit, 1, mm) // returns Unit 32.5 mm - * - * 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 - * - * History: - * - * v14 Handle Units - * v7.4 Allow second "precision" argument - * v5.7 Support tolerance for round-off errors - * v2 Handle Fractions - * v0.1 Created - * - * @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 | Unit | 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: _bigCeil, - 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) { - var shift = bigTen.pow(n); - return _bigCeil(x.mul(shift)).div(shift); - }, - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - 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()); - }, - '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)), - 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => { - // deep map collection, skip zeros since ceil(0) = 0 - return deepMap(x, value => self(value, n, unit), true); - }), - 'Array | Matrix | Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), - '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/node_modules/mathjs/lib/esm/function/arithmetic/cube.js b/node_modules/mathjs/lib/esm/function/arithmetic/cube.js deleted file mode 100644 index 71aad9e..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/cube.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/divide.js b/node_modules/mathjs/lib/esm/function/arithmetic/divide.js deleted file mode 100644 index 9c2001e..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/divide.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js b/node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js deleted file mode 100644 index bec7bac..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/divideScalar.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js b/node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js deleted file mode 100644 index ce7472f..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/dotDivide.js +++ /dev/null @@ -1,79 +0,0 @@ -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', 'SparseMatrix']; -export var createDotDivide = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - matrix, - equalScalar, - divideScalar, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo02xDS0 = createMatAlgo02xDS0({ - typed, - equalScalar - }); - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js b/node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js deleted file mode 100644 index 8e60c9a..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/dotMultiply.js +++ /dev/null @@ -1,66 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js b/node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js deleted file mode 100644 index 56765fd..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/dotPow.js +++ /dev/null @@ -1,79 +0,0 @@ -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', 'SparseMatrix']; -export var createDotPow = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - equalScalar, - matrix, - pow, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/esm/function/arithmetic/exp.js b/node_modules/mathjs/lib/esm/function/arithmetic/exp.js deleted file mode 100644 index fab332a..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/exp.js +++ /dev/null @@ -1,50 +0,0 @@ -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 [2.718281828459045, 7.3890560989306495, 20.085536923187668] - * - * See also: - * - * expm1, expm, log, pow - * - * History: - * - * v11 Don't apply elementwise, avoid confusion with matrix exponential - * v0.20 Handle BigNumbers - * v0.0.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/expm1.js b/node_modules/mathjs/lib/esm/function/arithmetic/expm1.js deleted file mode 100644 index 741f00a..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/expm1.js +++ /dev/null @@ -1,54 +0,0 @@ -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 [1.718281828459045, 6.3890560989306495, 19.085536923187668] - * - * See also: - * - * exp, expm, log, pow - * - * History: - * - * v11 Don't apply elementwise, avoids confusion with matrix exponential - * v4.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/fix.js b/node_modules/mathjs/lib/esm/function/arithmetic/fix.js deleted file mode 100644 index 83b0188..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/fix.js +++ /dev/null @@ -1,156 +0,0 @@ -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) - * math.fix(unit, valuelessUnit) - * math.fix(unit, n, valuelessUnit) - * - * 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 - * - * const unit = math.unit('3.241 cm') - * const cm = math.unit('cm') - * const mm = math.unit('mm') - * math.fix(unit, 1, cm) // returns Unit 3.2 cm ... - * math.fix(unit, 1, mm) // returns Unit 32.4 mm - * - * 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 - * - * History: - * - * v14 Handle Units - * v7.4 Allow second "precision" argument - * v5.7 Support tolerance for round-off errors - * v2 Handle Fractions - * v0.1 Created - * - * @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 | Unit | 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); - }, - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - Fraction: function Fraction(x) { - return x.s < 0n ? x.ceil() : x.floor(); - }, - 'Fraction, number | BigNumber': function Fraction_number__BigNumber(x, n) { - return x.s < 0n ? ceil(x, n) : floor(x, n); - }, - '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)), - 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => { - // deep map collection, skip zeros since fix(0) = 0 - return deepMap(x, value => self(value, n, unit), true); - }), - 'Array | Matrix | Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), - '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/node_modules/mathjs/lib/esm/function/arithmetic/floor.js b/node_modules/mathjs/lib/esm/function/arithmetic/floor.js deleted file mode 100644 index 4f42dfb..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/floor.js +++ /dev/null @@ -1,206 +0,0 @@ -import Decimal from 'decimal.js'; -import { factory } from '../../utils/factory.js'; -import { deepMap } from '../../utils/collection.js'; -import { isInteger, 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']; -var bigTen = new Decimal(10); -export var createFloorNumber = /* #__PURE__ */factory(name, ['typed', 'config', 'round'], _ref => { - var { - typed, - config, - round - } = _ref; - function _floorNumber(x) { - // First, if the floor and the round are identical we can be - // quite comfortable that is the best answer: - var f = Math.floor(x); - var r = round(x); - if (f === r) return f; - // OK, they are different. If x is truly distinct from f but - // appears indistinguishable from r, presume it really is just - // the integer r with rounding/computation error, and return that - if (nearlyEqual(x, r, config.relTol, config.absTol) && !nearlyEqual(x, f, config.relTol, config.absTol)) { - return r; - } - // Otherwise (x distinct from both r and f, or indistinguishable from - // both r and f) may as well just return f, as that's the best - // candidate we can discern: - return f; - } - return typed(name, { - number: _floorNumber, - 'number, number': function number_number(x, n) { - if (!isInteger(n)) { - throw new RangeError('number of decimals in function floor must be an integer'); - } - if (n < 0 || n > 15) { - throw new RangeError('number of decimals in floor number must be in range 0 - 15'); - } - var shift = 10 ** n; - return _floorNumber(x * shift) / shift; - } - }); -}); -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 - }); - function _bigFloor(x) { - // see _floorNumber above for rationale - var bne = (a, b) => bigNearlyEqual(a, b, config.relTol, config.absTol); - var f = x.floor(); - var r = round(x); - if (f.eq(r)) return f; - if (bne(x, r) && !bne(x, f)) return r; - return f; - } - /** - * Round a value towards minus infinity. - * For matrices, the function is evaluated element wise. - * - * Syntax: - * - * math.floor(x) - * math.floor(x, n) - * math.floor(unit, valuelessUnit) - * math.floor(unit, n, valuelessUnit) - * - * 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 - * - * const unit = math.unit('3.241 cm') - * const cm = math.unit('cm') - * const mm = math.unit('mm') - * math.floor(unit, 1, cm) // returns Unit 3.2 cm ... - * math.floor(unit, 1, mm) // returns Unit 32.4 mm - * - * 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 - * - * History: - * - * v14 Handle Units - * v7.4 Allow second "precision" argument - * v5.7 Support tolerance for round-off errors - * v2 Handle Fractions - * v0.1 Created - * - * @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 | Unit | 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: _bigFloor, - 'BigNumber, BigNumber': function BigNumber_BigNumber(x, n) { - var shift = bigTen.pow(n); - return _bigFloor(x.mul(shift)).div(shift); - }, - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - 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()); - }, - '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)), - 'Array | Matrix, number | BigNumber, Unit': typed.referToSelf(self => (x, n, unit) => { - // deep map collection, skip zeros since floor(0) = 0 - return deepMap(x, value => self(value, n, unit), true); - }), - 'Array | Matrix | Unit, Unit': typed.referToSelf(self => (x, unit) => self(x, 0, unit)), - '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/node_modules/mathjs/lib/esm/function/arithmetic/gcd.js b/node_modules/mathjs/lib/esm/function/arithmetic/gcd.js deleted file mode 100644 index 6214af1..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/gcd.js +++ /dev/null @@ -1,153 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/hypot.js b/node_modules/mathjs/lib/esm/function/arithmetic/hypot.js deleted file mode 100644 index 54513db..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/hypot.js +++ /dev/null @@ -1,77 +0,0 @@ -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(), true)) - }); - - /** - * 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/node_modules/mathjs/lib/esm/function/arithmetic/invmod.js b/node_modules/mathjs/lib/esm/function/arithmetic/invmod.js deleted file mode 100644 index 18ba0c6..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/invmod.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/lcm.js b/node_modules/mathjs/lib/esm/function/arithmetic/lcm.js deleted file mode 100644 index b82301a..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/lcm.js +++ /dev/null @@ -1,110 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/log.js b/node_modules/mathjs/lib/esm/function/arithmetic/log.js deleted file mode 100644 index af818d5..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/log.js +++ /dev/null @@ -1,100 +0,0 @@ -import { factory } from '../../utils/factory.js'; -import { promoteLogarithm } from '../../utils/bigint.js'; -import { logNumber } from '../../plain/number/index.js'; -var name = 'log'; -var dependencies = ['config', 'typed', 'typeOf', 'divideScalar', 'Complex']; -var nlg16 = Math.log(16); -export var createLog = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - typeOf, - 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 - * - * History: - * - * v0.0.2 Created - * v0.2 Add optional base argument - * v0.3 Handle Array input - * v0.5 Handle Matrix input - * v0.16 Handle BigNumber input - * v0.21 Support negative BigNumbers - * v11 Drop Array/Matrix support in favor of explicit map of - * the scalar log function, to avoid confusion with the log - * of a matrix - * v14 Allow value and base to be Fractions, when the log is rational - * - * @param {number | BigNumber | Fraction | Complex} x - * Value for which to calculate the logarithm. - * @param {number | BigNumber | Fraction | Complex} [base=e] - * Optional base for the logarithm. If not provided, the natural - * logarithm of `x` is calculated. - * @return {number | BigNumber | Fraction | Complex} - * Returns the logarithm of `x` - */ - function complexLog(c) { - return c.log(); - } - function complexLogNumber(x) { - return complexLog(new Complex(x, 0)); - } - return typed(name, { - number: function number(x) { - if (x >= 0 || config.predictable) { - return logNumber(x); - } else { - // negative value -> complex value computation - return complexLogNumber(x); - } - }, - bigint: promoteLogarithm(nlg16, logNumber, config, complexLogNumber), - Complex: complexLog, - BigNumber: function BigNumber(x) { - if (!x.isNegative() || config.predictable) { - return x.ln(); - } else { - // downgrade to number, return Complex valued result - return complexLogNumber(x.toNumber()); - } - }, - 'any, any': typed.referToSelf(self => (x, base) => { - // calculate logarithm for a specified base, log(x, base) - - if (typeOf(x) === 'Fraction' && typeOf(base) === 'Fraction') { - var result = x.log(base); - if (result !== null) { - return result; - } - } - return divideScalar(self(x), self(base)); - }) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/arithmetic/log10.js b/node_modules/mathjs/lib/esm/function/arithmetic/log10.js deleted file mode 100644 index 72b3342..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/log10.js +++ /dev/null @@ -1,67 +0,0 @@ -import { log10Number } from '../../plain/number/index.js'; -import { promoteLogarithm } from '../../utils/bigint.js'; -import { deepMap } from '../../utils/collection.js'; -import { factory } from '../../utils/factory.js'; -var name = 'log10'; -var dependencies = ['typed', 'config', 'Complex']; -var log16 = log10Number(16); -export var createLog10 = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - 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` - */ - - function complexLog(c) { - return c.log().div(Math.LN10); - } - function complexLogNumber(x) { - return complexLog(new Complex(x, 0)); - } - return typed(name, { - number: function number(x) { - if (x >= 0 || config.predictable) { - return log10Number(x); - } else { - // negative value -> complex value computation - return complexLogNumber(x); - } - }, - bigint: promoteLogarithm(log16, log10Number, config, complexLogNumber), - Complex: complexLog, - BigNumber: function BigNumber(x) { - if (!x.isNegative() || config.predictable) { - return x.log(); - } else { - // downgrade to number, return Complex valued result - return complexLogNumber(x.toNumber()); - } - }, - 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/arithmetic/log1p.js b/node_modules/mathjs/lib/esm/function/arithmetic/log1p.js deleted file mode 100644 index 284d7f1..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/log1p.js +++ /dev/null @@ -1,81 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/log2.js b/node_modules/mathjs/lib/esm/function/arithmetic/log2.js deleted file mode 100644 index 9d808a1..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/log2.js +++ /dev/null @@ -1,73 +0,0 @@ -import { log2Number } from '../../plain/number/index.js'; -import { promoteLogarithm } from '../../utils/bigint.js'; -import { deepMap } from '../../utils/collection.js'; -import { factory } from '../../utils/factory.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` - */ - function complexLog2Number(x) { - return _log2Complex(new Complex(x, 0)); - } - return typed(name, { - number: function number(x) { - if (x >= 0 || config.predictable) { - return log2Number(x); - } else { - // negative value -> complex value computation - return complexLog2Number(x); - } - }, - bigint: promoteLogarithm(4, log2Number, config, complexLog2Number), - Complex: _log2Complex, - BigNumber: function BigNumber(x) { - if (!x.isNegative() || config.predictable) { - return x.log(2); - } else { - // downgrade to number, return Complex valued result - return complexLog2Number(x.toNumber()); - } - }, - '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/node_modules/mathjs/lib/esm/function/arithmetic/mod.js b/node_modules/mathjs/lib/esm/function/arithmetic/mod.js deleted file mode 100644 index 79f04f5..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/mod.js +++ /dev/null @@ -1,139 +0,0 @@ -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 - * - * History: - * - * v13 Handle bigints - * v11.6 Support matrix broadcasting - * v2 Handle Fractions - * v0.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/multiply.js b/node_modules/mathjs/lib/esm/function/arithmetic/multiply.js deleted file mode 100644 index ddcafc3..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/multiply.js +++ /dev/null @@ -1,880 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js b/node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js deleted file mode 100644 index f46b18f..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/multiplyScalar.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/norm.js b/node_modules/mathjs/lib/esm/function/arithmetic/norm.js deleted file mode 100644 index c307ca3..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/norm.js +++ /dev/null @@ -1,287 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js b/node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js deleted file mode 100644 index cde0a99..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/nthRoot.js +++ /dev/null @@ -1,172 +0,0 @@ -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 - * math.sqrt(9) // returns 3 - * math.nthRoot(64, 3) // returns 4 - * - * See also: - * - * sqrt, pow - * - * History: - * - * v11.6 Support matrix broadcasting - * v2 Handle Complex - * v1.1 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js b/node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js deleted file mode 100644 index cbc66b9..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/nthRoots.js +++ /dev/null @@ -1,112 +0,0 @@ -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. - * Note that currently the precision of Complex numbers are limited - * to the precision of a 64-bit IEEE floating point, so even if the input - * is a BigNumber with greater precision, rounding to 64 bits will occur - * in computing the nth roots. - * - * 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) - * // Complex [1, "-0.5+0.866025403784439i", "-0.5-0.866025403784439i"] - * - * See also: - * - * nthRoot, pow, sqrt - * - * History: - * - * v1.1 Created - * - * @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/node_modules/mathjs/lib/esm/function/arithmetic/pow.js b/node_modules/mathjs/lib/esm/function/arithmetic/pow.js deleted file mode 100644 index 0a93a56..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/pow.js +++ /dev/null @@ -1,192 +0,0 @@ -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 % 2n === 1n) { - return (yFrac.n % 2n === 0n ? 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/node_modules/mathjs/lib/esm/function/arithmetic/round.js b/node_modules/mathjs/lib/esm/function/arithmetic/round.js deleted file mode 100644 index 0863891..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/round.js +++ /dev/null @@ -1,204 +0,0 @@ -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 | Unit | 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()); - }, - // bigints can't be rounded - bigint: b => b, - 'bigint, number': (b, _dummy) => b, - 'bigint, BigNumber': (b, _dummy) => b, - 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)), - 'Array | Matrix, number | BigNumber, 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 | Unit, 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/node_modules/mathjs/lib/esm/function/arithmetic/sign.js b/node_modules/mathjs/lib/esm/function/arithmetic/sign.js deleted file mode 100644 index 93ce057..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/sign.js +++ /dev/null @@ -1,66 +0,0 @@ -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 x.n === 0n ? new _Fraction(0) : new _Fraction(x.s); - }, - // 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/node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js b/node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js deleted file mode 100644 index af7a1c1..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/sqrt.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/square.js b/node_modules/mathjs/lib/esm/function/arithmetic/square.js deleted file mode 100644 index 373b11f..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/square.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/subtract.js b/node_modules/mathjs/lib/esm/function/arithmetic/subtract.js deleted file mode 100644 index e5cee04..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/subtract.js +++ /dev/null @@ -1,86 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js b/node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js deleted file mode 100644 index 44b07c6..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/subtractScalar.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js b/node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js deleted file mode 100644 index 696c665..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/unaryMinus.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js b/node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js deleted file mode 100644 index 411b331..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/unaryPlus.js +++ /dev/null @@ -1,63 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js b/node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js deleted file mode 100644 index 5cabe42..0000000 --- a/node_modules/mathjs/lib/esm/function/arithmetic/xgcd.js +++ /dev/null @@ -1,91 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js b/node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js deleted file mode 100644 index e96ab8a..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/bitAnd.js +++ /dev/null @@ -1,66 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/bitNot.js b/node_modules/mathjs/lib/esm/function/bitwise/bitNot.js deleted file mode 100644 index 98b3bcd..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/bitNot.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/bitOr.js b/node_modules/mathjs/lib/esm/function/bitwise/bitOr.js deleted file mode 100644 index 2b43619..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/bitOr.js +++ /dev/null @@ -1,67 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/bitXor.js b/node_modules/mathjs/lib/esm/function/bitwise/bitXor.js deleted file mode 100644 index 1e87a92..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/bitXor.js +++ /dev/null @@ -1,66 +0,0 @@ -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', 'SparseMatrix']; -export var createBitXor = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/esm/function/bitwise/leftShift.js b/node_modules/mathjs/lib/esm/function/bitwise/leftShift.js deleted file mode 100644 index bbcc6e0..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/leftShift.js +++ /dev/null @@ -1,115 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js b/node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js deleted file mode 100644 index 03eaacf..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/rightArithShift.js +++ /dev/null @@ -1,115 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js b/node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js deleted file mode 100644 index b849509..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/rightLogShift.js +++ /dev/null @@ -1,115 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js b/node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js deleted file mode 100644 index 5cd79ec..0000000 --- a/node_modules/mathjs/lib/esm/function/bitwise/useMatrixForArrayScalar.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js b/node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js deleted file mode 100644 index 8b0b07d..0000000 --- a/node_modules/mathjs/lib/esm/function/combinatorics/bellNumbers.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/combinatorics/catalan.js b/node_modules/mathjs/lib/esm/function/combinatorics/catalan.js deleted file mode 100644 index 986d076..0000000 --- a/node_modules/mathjs/lib/esm/function/combinatorics/catalan.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/combinatorics/composition.js b/node_modules/mathjs/lib/esm/function/combinatorics/composition.js deleted file mode 100644 index a7ff05c..0000000 --- a/node_modules/mathjs/lib/esm/function/combinatorics/composition.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js b/node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js deleted file mode 100644 index 539bcac..0000000 --- a/node_modules/mathjs/lib/esm/function/combinatorics/stirlingS2.js +++ /dev/null @@ -1,86 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/complex/arg.js b/node_modules/mathjs/lib/esm/function/complex/arg.js deleted file mode 100644 index d3d10c8..0000000 --- a/node_modules/mathjs/lib/esm/function/complex/arg.js +++ /dev/null @@ -1,50 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/complex/conj.js b/node_modules/mathjs/lib/esm/function/complex/conj.js deleted file mode 100644 index bef1b28..0000000 --- a/node_modules/mathjs/lib/esm/function/complex/conj.js +++ /dev/null @@ -1,40 +0,0 @@ -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 | Unit} x - * A complex number or array with complex numbers - * @return {number | BigNumber | Complex | Array | Matrix | Unit} - * The complex conjugate of x - */ - return typed(name, { - 'number | BigNumber | Fraction': x => x, - Complex: x => x.conjugate(), - Unit: typed.referToSelf(self => x => new x.constructor(self(x.toNumeric()), x.formatUnits())), - 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/complex/im.js b/node_modules/mathjs/lib/esm/function/complex/im.js deleted file mode 100644 index 8501b57..0000000 --- a/node_modules/mathjs/lib/esm/function/complex/im.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/complex/re.js b/node_modules/mathjs/lib/esm/function/complex/re.js deleted file mode 100644 index 148f0c3..0000000 --- a/node_modules/mathjs/lib/esm/function/complex/re.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/geometry/distance.js b/node_modules/mathjs/lib/esm/function/geometry/distance.js deleted file mode 100644 index dc7d83c..0000000 --- a/node_modules/mathjs/lib/esm/function/geometry/distance.js +++ /dev/null @@ -1,305 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/geometry/intersect.js b/node_modules/mathjs/lib/esm/function/geometry/intersect.js deleted file mode 100644 index 6d6a772..0000000 --- a/node_modules/mathjs/lib/esm/function/geometry/intersect.js +++ /dev/null @@ -1,200 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/logical/and.js b/node_modules/mathjs/lib/esm/function/logical/and.js deleted file mode 100644 index 33c7f5a..0000000 --- a/node_modules/mathjs/lib/esm/function/logical/and.js +++ /dev/null @@ -1,122 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/logical/not.js b/node_modules/mathjs/lib/esm/function/logical/not.js deleted file mode 100644 index 5e0ae17..0000000 --- a/node_modules/mathjs/lib/esm/function/logical/not.js +++ /dev/null @@ -1,48 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/logical/nullish.js b/node_modules/mathjs/lib/esm/function/logical/nullish.js deleted file mode 100644 index b76fbc1..0000000 --- a/node_modules/mathjs/lib/esm/function/logical/nullish.js +++ /dev/null @@ -1,81 +0,0 @@ -import { factory } from '../../utils/factory.js'; -import { createMatAlgo03xDSf } from '../../type/matrix/utils/matAlgo03xDSf.js'; -import { createMatAlgo14xDs } from '../../type/matrix/utils/matAlgo14xDs.js'; -import { createMatAlgo13xDD } from '../../type/matrix/utils/matAlgo13xDD.js'; -import { DimensionError } from '../../error/DimensionError.js'; -var name = 'nullish'; -var dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual']; -export var createNullish = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - matrix, - size, - flatten, - deepEqual - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo14xDs = createMatAlgo14xDs({ - typed - }); - var matAlgo13xDD = createMatAlgo13xDD({ - typed - }); - - /** - * Nullish coalescing operator (??). Returns the right-hand side operand - * when the left-hand side operand is null or undefined, and otherwise - * returns the left-hand side operand. - * - * For matrices, the function is evaluated element wise. - * - * Syntax: - * - * math.nullish(x, y) - * - * Examples: - * - * math.nullish(null, 42) // returns 42 - * math.nullish(undefined, 42) // returns 42 - * math.nullish(0, 42) // returns 0 - * math.nullish(false, 42) // returns false - * math.nullish('', 42) // returns '' - * - * // Object property access with fallback - * const obj = {foo: 7, bar: 3} - * math.nullish(obj.baz, 0) // returns 0 - * - * See also: - * - * and, or, not - * - * @param {*} x First value to check - * @param {*} y Fallback value - * @return {*} Returns y when x is null or undefined, otherwise returns x - */ - - return typed(name, { - // Scalar and SparseMatrix-first short-circuit handlers - 'number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any': (x, _y) => x, - 'null, any': (_x, y) => y, - 'undefined, any': (_x, y) => y, - // SparseMatrix-first with collection RHS: enforce exact shape match - 'SparseMatrix, Array | Matrix': (x, y) => { - var sx = size(x); - var sy = size(y); - if (deepEqual(sx, sy)) return x; - throw new DimensionError(sx, sy); - }, - // DenseMatrix-first handlers (no broadcasting between collections) - 'DenseMatrix, DenseMatrix': typed.referToSelf(self => (x, y) => matAlgo13xDD(x, y, self)), - 'DenseMatrix, SparseMatrix': typed.referToSelf(self => (x, y) => matAlgo03xDSf(x, y, self, false)), - 'DenseMatrix, Array': typed.referToSelf(self => (x, y) => matAlgo13xDD(x, matrix(y), self)), - 'DenseMatrix, any': typed.referToSelf(self => (x, y) => matAlgo14xDs(x, y, self, false)), - // Array-first handlers (bridge via matrix() where needed) - 'Array, Array': typed.referToSelf(self => (x, y) => matAlgo13xDD(matrix(x), matrix(y), self).valueOf()), - 'Array, DenseMatrix': typed.referToSelf(self => (x, y) => matAlgo13xDD(matrix(x), y, self)), - 'Array, SparseMatrix': typed.referToSelf(self => (x, y) => matAlgo03xDSf(matrix(x), y, self, false)), - 'Array, any': typed.referToSelf(self => (x, y) => matAlgo14xDs(matrix(x), y, self, false).valueOf()) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/logical/or.js b/node_modules/mathjs/lib/esm/function/logical/or.js deleted file mode 100644 index 94fef72..0000000 --- a/node_modules/mathjs/lib/esm/function/logical/or.js +++ /dev/null @@ -1,77 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/logical/xor.js b/node_modules/mathjs/lib/esm/function/logical/xor.js deleted file mode 100644 index 8c46cc3..0000000 --- a/node_modules/mathjs/lib/esm/function/logical/xor.js +++ /dev/null @@ -1,77 +0,0 @@ -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', 'SparseMatrix']; -export var createXor = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/esm/function/matrix/column.js b/node_modules/mathjs/lib/esm/function/matrix/column.js deleted file mode 100644 index 0a63d22..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/column.js +++ /dev/null @@ -1,60 +0,0 @@ -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); - // once config.legacySubset just return result - return isMatrix(result) ? result : matrix([[result]]); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/concat.js b/node_modules/mathjs/lib/esm/function/matrix/concat.js deleted file mode 100644 index 4c8d793..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/concat.js +++ /dev/null @@ -1,104 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/count.js b/node_modules/mathjs/lib/esm/function/matrix/count.js deleted file mode 100644 index c611970..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/count.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/cross.js b/node_modules/mathjs/lib/esm/function/matrix/cross.js deleted file mode 100644 index 43647f3..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/cross.js +++ /dev/null @@ -1,81 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/ctranspose.js b/node_modules/mathjs/lib/esm/function/matrix/ctranspose.js deleted file mode 100644 index d4a3654..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/ctranspose.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/det.js b/node_modules/mathjs/lib/esm/function/matrix/det.js deleted file mode 100644 index a90df04..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/det.js +++ /dev/null @@ -1,142 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/diag.js b/node_modules/mathjs/lib/esm/function/matrix/diag.js deleted file mode 100644 index af27a95..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/diag.js +++ /dev/null @@ -1,155 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/diff.js b/node_modules/mathjs/lib/esm/function/matrix/diff.js deleted file mode 100644 index ca211d9..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/diff.js +++ /dev/null @@ -1,163 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/dot.js b/node_modules/mathjs/lib/esm/function/matrix/dot.js deleted file mode 100644 index dc539c0..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/dot.js +++ /dev/null @@ -1,151 +0,0 @@ -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; - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/eigs.js b/node_modules/mathjs/lib/esm/function/matrix/eigs.js deleted file mode 100644 index fdde565..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/eigs.js +++ /dev/null @@ -1,328 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js b/node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js deleted file mode 100644 index 2463c42..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/eigs/complexEigs.js +++ /dev/null @@ -1,698 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js b/node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js deleted file mode 100644 index 0b38087..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/eigs/realSymmetric.js +++ /dev/null @@ -1,297 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/expm.js b/node_modules/mathjs/lib/esm/function/matrix/expm.js deleted file mode 100644 index 23a2ce9..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/expm.js +++ /dev/null @@ -1,154 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/fft.js b/node_modules/mathjs/lib/esm/function/matrix/fft.js deleted file mode 100644 index 3036178..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/fft.js +++ /dev/null @@ -1,128 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/filter.js b/node_modules/mathjs/lib/esm/function/matrix/filter.js deleted file mode 100644 index 50850f5..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/filter.js +++ /dev/null @@ -1,74 +0,0 @@ -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. - * - * The callback is invoked with three arguments: the current value, - * the current index, and the matrix operated upon. - * 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.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'); - if (fastCallback.isUnary) { - return filter(x, fastCallback.fn); - } - return filter(x, function (value, index, array) { - // invoke the callback function with the right number of arguments - return fastCallback.fn(value, [index], array); - }); -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/flatten.js b/node_modules/mathjs/lib/esm/function/matrix/flatten.js deleted file mode 100644 index e6295da..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/flatten.js +++ /dev/null @@ -1,41 +0,0 @@ -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 {DenseMatrix | Array} x Matrix to be flattened - * @return {DenseMatrix | Array} Returns the flattened matrix - */ - return typed(name, { - Array: function Array(x) { - return flattenArray(x); - }, - DenseMatrix: function DenseMatrix(x) { - // Return the same matrix type as x (Dense or Sparse Matrix) - // Return the same data type as x - return x.create(flattenArray(x.valueOf(), true), x.datatype()); - }, - SparseMatrix: function SparseMatrix(_x) { - throw new TypeError('SparseMatrix is not supported by function flatten ' + 'because it does not support 1D vectors. ' + 'Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())'); - } - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/forEach.js b/node_modules/mathjs/lib/esm/function/matrix/forEach.js deleted file mode 100644 index 881a590..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/forEach.js +++ /dev/null @@ -1,57 +0,0 @@ -import { optimizeCallback } from '../../utils/optimizeCallback.js'; -import { factory } from '../../utils/factory.js'; -import { deepForEach } 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. - * - * The callback is invoked with three arguments: the current value, - * the current index, and the matrix operated upon. - * 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.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) { - var fastCallback = optimizeCallback(callback, array, name); - deepForEach(array, fastCallback.fn, fastCallback.isUnary); -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js b/node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js deleted file mode 100644 index 5bc7862..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/getMatrixDataType.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/identity.js b/node_modules/mathjs/lib/esm/function/matrix/identity.js deleted file mode 100644 index 8211793..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/identity.js +++ /dev/null @@ -1,136 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/ifft.js b/node_modules/mathjs/lib/esm/function/matrix/ifft.js deleted file mode 100644 index b5c8101..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/ifft.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/inv.js b/node_modules/mathjs/lib/esm/function/matrix/inv.js deleted file mode 100644 index 9aab431..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/inv.js +++ /dev/null @@ -1,184 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/kron.js b/node_modules/mathjs/lib/esm/function/matrix/kron.js deleted file mode 100644 index ba60d56..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/kron.js +++ /dev/null @@ -1,86 +0,0 @@ -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 (1-dimensional) vectors, - * with no dimension checking - * @param {Array} a First vector - * @param {Array} b Second vector - * @returns {Array} the 1-dimensional Kronecker product of a and b - * @private - */ - function _kron1d(a, b) { - // TODO in core overhaul: would be faster to see if we can choose a - // particular implementation of multiplyScalar at the beginning, - // rather than re-dispatch for _every_ ordered pair of entries. - return a.flatMap(x => b.map(y => multiplyScalar(x, y))); - } - - /** - * Calculate the Kronecker product of two possibly multidimensional arrays - * @param {Array} a First array - * @param {Array} b Second array - * @param {number} [d] common dimension; if missing, compute and match args - * @returns {Array} Returns the Kronecker product of x and y - * @private - */ - function _kron(a, b) { - var d = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; - if (d < 0) { - var adim = size(a).length; - var bdim = size(b).length; - d = Math.max(adim, bdim); - while (adim++ < d) a = [a]; - while (bdim++ < d) b = [b]; - } - if (d === 1) return _kron1d(a, b); - return a.flatMap(aSlice => b.map(bSlice => _kron(aSlice, bSlice, d - 1))); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/map.js b/node_modules/mathjs/lib/esm/function/matrix/map.js deleted file mode 100644 index f206109..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/map.js +++ /dev/null @@ -1,232 +0,0 @@ -import { optimizeCallback } from '../../utils/optimizeCallback.js'; -import { arraySize, broadcastSizes, broadcastTo, get, deepMap } 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) - * - * History: - * - * v0.13 Created - * v1.1 Clone the indices on each callback in case callback mutates - * v13.1 Support multiple inputs to the callback - * - * 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 sizes = Arrays.map(M => M.isMatrix ? M.size() : arraySize(M)); - var newSize = broadcastSizes(...sizes); - var numberOfArrays = Arrays.length; - var _get = firstArrayIsMatrix ? (matrix, idx) => matrix.get(idx) : get; - var firstValues = Arrays.map((collection, i) => { - var firstIndex = sizes[i].map(() => 0); - return collection.isMatrix ? collection.get(firstIndex) : get(collection, firstIndex); - }); - var callbackArgCount = typed.isTypedFunction(multiCallback) ? _getTypedCallbackArgCount(multiCallback, firstValues, newSize.map(() => 0), Arrays) : _getCallbackArgCount(multiCallback, numberOfArrays); - if (callbackArgCount < 2) { - var _callback = _getLimitedCallback(callbackArgCount, multiCallback, null); - return mapMultiple(Arrays, _callback); - } - 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 = _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays); - 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 mapMultiple(collections, callback) { - // collections can be matrices or arrays - // callback must be a function of the form (collections, [index]) - var firstCollection = collections[0]; - var arrays = collections.map(collection => collection.isMatrix ? collection.valueOf() : collection); - var sizes = collections.map(collection => collection.isMatrix ? collection.size() : arraySize(collection)); - var finalSize = broadcastSizes(...sizes); - // the offset means for each initial array, how much smaller is it than the final size - var offsets = sizes.map(size => finalSize.length - size.length); - var maxDepth = finalSize.length - 1; - var callbackUsesIndex = callback.length > 1; - var index = callbackUsesIndex ? [] : null; - var resultsArray = iterate(arrays, 0); - if (firstCollection.isMatrix) { - var resultsMatrix = firstCollection.create(); - resultsMatrix._data = resultsArray; - resultsMatrix._size = finalSize; - return resultsMatrix; - } else { - return resultsArray; - } - function iterate(arrays) { - var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - // each array can have different sizes - var currentDimensionSize = finalSize[depth]; - var result = Array(currentDimensionSize); - if (depth < maxDepth) { - var _loop = function _loop(i) { - if (index) index[depth] = i; - // if there is an offset greater than the current dimension - // pass the array, if the size of the array is 1 pass the first - // element of the array - result[i] = iterate(arrays.map((array, arrayIndex) => offsets[arrayIndex] > depth ? array : array.length === 1 ? array[0] : array[i]), depth + 1); - }; - for (var i = 0; i < currentDimensionSize; i++) { - _loop(i); - } - } else { - var _loop2 = function _loop2(_i) { - if (index) index[depth] = _i; - result[_i] = callback(arrays.map(a => a.length === 1 ? a[0] : a[_i]), index ? index.slice() : undefined); - }; - for (var _i = 0; _i < currentDimensionSize; _i++) { - _loop2(_i); - } - } - return result; - } - } - - /** - * Creates a limited callback based on the argument pattern. - * @param {number} callbackArgCount - The argument pattern (0, 1, or 2) - * @param {Function} multiCallback - The original callback function - * @param {Array} broadcastedArrays - The broadcasted arrays (for case 2) - * @returns {Function} The limited callback function - */ - function _getLimitedCallback(callbackArgCount, multiCallback, broadcastedArrays) { - switch (callbackArgCount) { - case 0: - return x => multiCallback(...x); - case 1: - return (x, idx) => multiCallback(...x, idx); - case 2: - return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays); - } - } - - /** - * Determines the argument pattern of a regular callback function. - * @param {Function} callback - The callback function to analyze - * @param {number} numberOfArrays - Number of arrays being processed - * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays - */ - function _getCallbackArgCount(callback, numberOfArrays) { - var callbackStr = callback.toString(); - // Check if the callback function uses `arguments` - if (/arguments/.test(callbackStr)) return 2; - - // Extract the parameters of the callback function - var paramsStr = callbackStr.match(/\(.*?\)/); - // Check if the callback function uses rest parameters - if (/\.\.\./.test(paramsStr)) return 2; - if (callback.length > numberOfArrays + 1) { - return 2; - } - if (callback.length === numberOfArrays + 1) { - return 1; - } - return 0; - } - - /** - * Determines the argument pattern of a typed callback function. - * @param {Function} callback - The typed callback function to analyze - * @param {Array} values - Sample values for signature resolution - * @param {Array} idx - Sample index for signature resolution - * @param {Array} arrays - Sample arrays for signature resolution - * @returns {number} 0 = values only, 1 = values + index, 2 = values + index + arrays - */ - - function _getTypedCallbackArgCount(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) { - var fastCallback = optimizeCallback(callback, array, name); - return deepMap(array, fastCallback.fn, fastCallback.isUnary); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/mapSlices.js b/node_modules/mathjs/lib/esm/function/matrix/mapSlices.js deleted file mode 100644 index e3566de..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/mapSlices.js +++ /dev/null @@ -1,118 +0,0 @@ -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 = 'mapSlices'; -var dependencies = ['typed', 'isInteger']; -export var createMapSlices = /* #__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.mapSlices(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.mapSlices(A, 0, sum) // returns [4, 6] - * math.mapSlices(A, 1, sum) // returns [3, 7] - * - * See also: - * - * map, filter, forEach - * - * Note: - * - * `mapSlices()` is also currently available via its deprecated - * synonym `apply()`. - * - * @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 mapped on the slices 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(_mapSlices(mat.valueOf(), dim, callback), mat.datatype()); - } else { - return _mapSlices(mat, dim, callback); - } - } - }); -}, { - formerly: 'apply' -}); - -/** - * Recursively reduce a matrix - * @param {Array} mat - * @param {number} dim - * @param {Function} callback - * @returns {Array} ret - * @private - */ -function _mapSlices(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] = _mapSlices(tran[i], dim - 1, callback); - } - return ret; - } - } else { - ret = []; - for (i = 0; i < mat.length; i++) { - ret[i] = _mapSlices(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/node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js b/node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js deleted file mode 100644 index 8a0e9ea..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/matrixFromColumns.js +++ /dev/null @@ -1,88 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js b/node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js deleted file mode 100644 index f20ec59..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/matrixFromFunction.js +++ /dev/null @@ -1,107 +0,0 @@ -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) - * - * Where: - * - * - `size: (number[] | Matrix)` - * A vector giving the extent of the array to be created in each - * dimension. If size has one entry, a vector is created; if it - * has two, a rectangular array/Matrix is created; if three, a - * three-dimensional array/Matrix is created; and so on. - * - `fn: (index: number[]) => MathType` - * The callback function that will generate the entries of the - * matrix. It is called in turn with the index of each entry of - * the matrix. The index is always an ordinary array of numbers - * with the same length as _size_. So for vectors, you will get - * indices like `[0]` or `[1]`, whereas for matrices, you will - * get indices like `[2, 0]` or `[1,3]`. The return value may - * be any type that can go in an array or Matrix entry, although - * if you supply the _datatype_ argument, you must yourself ensure - * the type of the return value matches. Note that currently, - * your callback _fn_ will receive 0-based indices for the matrix - * entries, regardless of whether matrixFromFunction is invoked - * directly from JavaScript or via the mathjs expression language. - * - `format: 'dense'|'sparse'` - * Specifies the storage format for the resulting Matrix. Note that - * if this argument is given, the return value will always be a - * Matrix (rather than possibly an Array). - * - `datatype: string` - * Specifies the data type of entries of the new matrix. If given, - * it should be the name of a data type that mathjs supports, as - * returned by the math.typeOf function. It is up to the caller - * to make certain that all values returned by _fn_ are consistent - * with this datatype if specified. - * - * 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, typeOf, 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/node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js b/node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js deleted file mode 100644 index 33e9b97..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/matrixFromRows.js +++ /dev/null @@ -1,76 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/ones.js b/node_modules/mathjs/lib/esm/function/matrix/ones.js deleted file mode 100644 index c836440..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/ones.js +++ /dev/null @@ -1,123 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js b/node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js deleted file mode 100644 index 17ae6ae..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/partitionSelect.js +++ /dev/null @@ -1,143 +0,0 @@ -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: mathIsNaN, - 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]) && mathIsNaN(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/node_modules/mathjs/lib/esm/function/matrix/pinv.js b/node_modules/mathjs/lib/esm/function/matrix/pinv.js deleted file mode 100644 index de4b3b1..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/pinv.js +++ /dev/null @@ -1,179 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/range.js b/node_modules/mathjs/lib/esm/function/matrix/range.js deleted file mode 100644 index 7d3de9f..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/range.js +++ /dev/null @@ -1,235 +0,0 @@ -import { factory } from '../../utils/factory.js'; -import { noBignumber, noMatrix } from '../../utils/noop.js'; -var name = 'range'; -var dependencies = ['typed', 'config', '?matrix', '?bignumber', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive']; -export var createRange = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - matrix, - bignumber, - smaller, - smallerEq, - larger, - largerEq, - add, - isZero, - isPositive - } = _ref; - /** - * Create a matrix or array containing a range of values. - * 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 | bigint | BigNumber | Fraction | Unit}` - * Start of the range - * - `end: number | bigint | BigNumber | Fraction | Unit` - * End of the range, excluded by default, included when parameter includeEnd=true - * - `step: number | bigint | BigNumber | Fraction | Unit` - * Step size. Default value is 1. - * - `includeEnd: boolean` - * Option to specify whether to include the end or not. False by default. - * - * The function returns a `DenseMatrix` when the library is configured with - * `config = { matrix: 'Matrix' }, and returns an Array otherwise. - * Note that the type of the returned values is taken from the type of the - * provided start/end value. If only one of these is a built-in `number` type, - * it will be promoted to the type of the other endpoint. However, in the case - * of Unit values, both endpoints must have compatible units, and the return - * value will have compatible units as well. - * - * 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(2, math.fraction(8,3), math.fraction(1,3)) // [fraction(2), fraction(7,3)] - * 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 range's `start`, `end`, and optional `step`. - * @return {Array | Matrix} range - */ - return typed(name, { - // TODO: simplify signatures when typed-function supports default values and optional arguments - - string: _strRange, - 'string, boolean': _strRange, - number: function number(oops) { - throw new TypeError("Too few arguments to function range(): ".concat(oops)); - }, - boolean: function boolean(oops) { - throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(oops, ", number|bigint|BigNumber|Fraction")); - }, - '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)); - }, - // Handle bigints; if either limit is bigint, range should be too - 'bigint, bigint|number': function bigint_bigintNumber(start, end) { - return _out(_range(start, end, 1n, false)); - }, - 'number, bigint': function number_bigint(start, end) { - return _out(_range(BigInt(start), end, 1n, false)); - }, - 'bigint, bigint|number, bigint|number': function bigint_bigintNumber_bigintNumber(start, end, step) { - return _out(_range(start, end, BigInt(step), false)); - }, - 'number, bigint, bigint|number': function number_bigint_bigintNumber(start, end, step) { - return _out(_range(BigInt(start), end, BigInt(step), false)); - }, - 'bigint, bigint|number, boolean': function bigint_bigintNumber_boolean(start, end, includeEnd) { - return _out(_range(start, end, 1n, includeEnd)); - }, - 'number, bigint, boolean': function number_bigint_boolean(start, end, includeEnd) { - return _out(_range(BigInt(start), end, 1n, includeEnd)); - }, - 'bigint, bigint|number, bigint|number, boolean': function bigint_bigintNumber_bigintNumber_boolean(start, end, step, includeEnd) { - return _out(_range(start, end, BigInt(step), includeEnd)); - }, - 'number, bigint, bigint|number, boolean': function number_bigint_bigintNumber_boolean(start, end, step, includeEnd) { - return _out(_range(BigInt(start), end, BigInt(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)); - }, - 'Fraction, Fraction': function Fraction_Fraction(start, end) { - return _out(_range(start, end, 1, false)); - }, - 'Fraction, Fraction, Fraction': function Fraction_Fraction_Fraction(start, end, step) { - return _out(_range(start, end, step, false)); - }, - 'Fraction, Fraction, boolean': function Fraction_Fraction_boolean(start, end, includeEnd) { - return _out(_range(start, end, 1, includeEnd)); - }, - 'Fraction, Fraction, Fraction, boolean': function Fraction_Fraction_Fraction_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 = []; - if (isZero(step)) throw new Error('Step must be non-zero'); - 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/node_modules/mathjs/lib/esm/function/matrix/reshape.js b/node_modules/mathjs/lib/esm/function/matrix/reshape.js deleted file mode 100644 index 5ffb0fa..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/reshape.js +++ /dev/null @@ -1,63 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/resize.js b/node_modules/mathjs/lib/esm/function/matrix/resize.js deleted file mode 100644 index 754da28..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/resize.js +++ /dev/null @@ -1,120 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/rotate.js b/node_modules/mathjs/lib/esm/function/matrix/rotate.js deleted file mode 100644 index 72f0ef8..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/rotate.js +++ /dev/null @@ -1,71 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js b/node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js deleted file mode 100644 index 1d91610..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/rotationMatrix.js +++ /dev/null @@ -1,160 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/row.js b/node_modules/mathjs/lib/esm/function/matrix/row.js deleted file mode 100644 index 0d01b7d..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/row.js +++ /dev/null @@ -1,60 +0,0 @@ -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); - // once config.legacySubset just return result - return isMatrix(result) ? result : matrix([[result]]); - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/size.js b/node_modules/mathjs/lib/esm/function/matrix/size.js deleted file mode 100644 index 9789b77..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/size.js +++ /dev/null @@ -1,42 +0,0 @@ -import { arraySize } from '../../utils/array.js'; -import { factory } from '../../utils/factory.js'; -var name = 'size'; -var dependencies = ['typed']; -export var createSize = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed - } = _ref; - /** - * Calculate the size of a matrix or scalar. Always returns an Array containing numbers. - * - * Note that in mathjs v14 and older, function size could return a Matrix depending on - * the input type and configuration. - * - * 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} A vector with size of `x`. - */ - return typed(name, { - Matrix: x => x.size(), - Array: arraySize, - string: x => [x.length], - // scalar - 'number | Complex | BigNumber | Unit | boolean | null': _x => [] - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/matrix/sort.js b/node_modules/mathjs/lib/esm/function/matrix/sort.js deleted file mode 100644 index 48c7f29..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/sort.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/sqrtm.js b/node_modules/mathjs/lib/esm/function/matrix/sqrtm.js deleted file mode 100644 index 8c5aa94..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/sqrtm.js +++ /dev/null @@ -1,99 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/squeeze.js b/node_modules/mathjs/lib/esm/function/matrix/squeeze.js deleted file mode 100644 index c40e713..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/squeeze.js +++ /dev/null @@ -1,53 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/subset.js b/node_modules/mathjs/lib/esm/function/matrix/subset.js deleted file mode 100644 index 638effa..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/subset.js +++ /dev/null @@ -1,283 +0,0 @@ -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 = ''; - function callback(v) { - substr += str.charAt(v); - } - if (Number.isInteger(range)) { - callback(range); - } else { - range.forEach(callback); - } - 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 = Number.isInteger(range) ? 1 : 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); - } - function callback(v, i) { - chars[v] = replacement.charAt(i[0]); - } - if (Number.isInteger(range)) { - callback(range, [0]); - } else { - range.forEach(callback); - } - - // 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/node_modules/mathjs/lib/esm/function/matrix/trace.js b/node_modules/mathjs/lib/esm/function/matrix/trace.js deleted file mode 100644 index 1d94b48..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/trace.js +++ /dev/null @@ -1,128 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/transpose.js b/node_modules/mathjs/lib/esm/function/matrix/transpose.js deleted file mode 100644 index c786b67..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/transpose.js +++ /dev/null @@ -1,160 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/matrix/zeros.js b/node_modules/mathjs/lib/esm/function/matrix/zeros.js deleted file mode 100644 index 5c19506..0000000 --- a/node_modules/mathjs/lib/esm/function/matrix/zeros.js +++ /dev/null @@ -1,123 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/numeric/solveODE.js b/node_modules/mathjs/lib/esm/function/numeric/solveODE.js deleted file mode 100644 index 367c42e..0000000 --- a/node_modules/mathjs/lib/esm/function/numeric/solveODE.js +++ /dev/null @@ -1,284 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/bernoulli.js b/node_modules/mathjs/lib/esm/function/probability/bernoulli.js deleted file mode 100644 index 5fa34a8..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/bernoulli.js +++ /dev/null @@ -1,102 +0,0 @@ -import { factory } from '../../utils/factory.js'; -import { isInteger } from '../../utils/number.js'; -var name = 'bernoulli'; -var dependencies = ['typed', 'config', 'isInteger', 'number', '?BigNumber', '?Fraction']; -export var createBernoulli = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - number, - BigNumber: _BigNumber, - Fraction - } = _ref; - /** - * Return the `n`th Bernoulli number, for positive integers `n` - * - * Syntax: - * - * math.bernoulli(n) - * - * Examples: - * - * math.bernoulli(1) // returns -0.5 - * // All other odd Bernoulli numbers are 0: - * math.bernoulli(7) // returns 0 - * math.bernoulli(math.bignumber(6)) // value bignumber(1).div(42) - * // Produces exact rationals for bigint or fraction input: - * math.bernoulli(8n) // Fraction -1,30 - * math.bernoulli(math.fraction(10)) // Fraction 5,66 - * - * See also: - * - * combinations, gamma, stirlingS2 - * - * @param {number | BigNumber | bigint | Fraction} n - * Index of the Bernoulli number - * @return {number | BigNumber | Fraction} - * nth Bernoulli number, of a type corresponding to the argument n - */ - - var numberCache = [undefined]; - var fractionCache = [undefined]; - var bigCache = [undefined]; - var cachedPrecision = 50; - return typed(name, { - number: index => _bernoulli(index, n => n, numberCache, (a, b) => a + b, (a, b) => a * b, (a, b) => a / b), - 'bigint | Fraction': index => _bernoulli(number(index), n => new Fraction(n), fractionCache, (a, b) => a.add(b), (a, b) => a.mul(b), (a, b) => a.div(b)), - BigNumber: index => { - if (config.precision !== cachedPrecision) { - bigCache = [undefined]; - cachedPrecision = config.precision; - } - return _bernoulli(number(index), n => new _BigNumber(n), bigCache, (a, b) => a.add(b), (a, b) => a.mul(b), (a, b) => a.div(b)); - } - }); -}); - -/** - * Underlying implementation, with all operations passed in. - * Parameters: - * 1. index: a (positive integer) number specifying which Bernoulli number - * to compute. - * 2. promote: a function that takes an integer number and returns - * the desired type for the Bernoulli number values. - * 3. A: a cache array of partial computation data that _bernoulli should use. - * Different cache arrays should be provided for different types. - * 4. plus: a function that adds two values of the desired type. - * 5. times: a function that multiplies two values of the desired type. - * 6. divide: a function that divides one value of the desired type by another. - */ -function _bernoulli(index, promote, A, plus, times, divide) { - if (index < 0 || !isInteger(index)) { - throw new RangeError('Bernoulli index must be nonnegative integer'); - } - if (index === 0) return promote(1); - if (index === 1) return divide(promote(-1), promote(2)); - if (index % 2 === 1) return promote(0); - // We proceed as in https://math.stackexchange.com/a/2844337 - // (by no means the most efficient, but very simple to implement) - // A cache entry consists of a triple - // [cotangent coefficient a_n, prefactor, Bernouilli number B_2n] - var one = promote(1); - if (A.length === 1) { - A.push([divide(one, promote(-3)), divide(one, promote(-2)), divide(one, promote(6))]); - } - var half = index / 2; - var zero = promote(0); - var two = promote(2); - while (A.length <= half) { - var i = A.length; // next cotangent coefficient to compute - var lim = Math.floor((i + 1) / 2); - var a = zero; - for (var m = 1; m < lim; ++m) { - a = plus(a, times(A[m][0], A[i - m][0])); - } - a = times(a, two); - if (i % 2 === 0) a = plus(a, times(A[lim][0], A[lim][0])); - a = divide(a, promote(-(2 * i + 1))); - var prefactor = divide(times(A[i - 1][1], promote(-i * (2 * i - 1))), two); - A.push([a, prefactor, times(prefactor, a)]); - } - return A[half][2]; -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/probability/combinations.js b/node_modules/mathjs/lib/esm/function/probability/combinations.js deleted file mode 100644 index cb3ac43..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/combinations.js +++ /dev/null @@ -1,69 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js b/node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js deleted file mode 100644 index e6ab046..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/combinationsWithRep.js +++ /dev/null @@ -1,84 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/factorial.js b/node_modules/mathjs/lib/esm/function/probability/factorial.js deleted file mode 100644 index 3cfd21d..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/factorial.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/gamma.js b/node_modules/mathjs/lib/esm/function/probability/gamma.js deleted file mode 100644 index dce043b..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/gamma.js +++ /dev/null @@ -1,120 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/kldivergence.js b/node_modules/mathjs/lib/esm/function/probability/kldivergence.js deleted file mode 100644 index ed4c4de..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/kldivergence.js +++ /dev/null @@ -1,77 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/lgamma.js b/node_modules/mathjs/lib/esm/function/probability/lgamma.js deleted file mode 100644 index 4d45914..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/lgamma.js +++ /dev/null @@ -1,137 +0,0 @@ -/* 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/node_modules/mathjs/lib/esm/function/probability/multinomial.js b/node_modules/mathjs/lib/esm/function/probability/multinomial.js deleted file mode 100644 index 76f2ae5..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/multinomial.js +++ /dev/null @@ -1,50 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/permutations.js b/node_modules/mathjs/lib/esm/function/probability/permutations.js deleted file mode 100644 index 8373396..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/permutations.js +++ /dev/null @@ -1,78 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/pickRandom.js b/node_modules/mathjs/lib/esm/function/probability/pickRandom.js deleted file mode 100644 index b11c95c..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/pickRandom.js +++ /dev/null @@ -1,150 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/random.js b/node_modules/mathjs/lib/esm/function/probability/random.js deleted file mode 100644 index dc2b5ff..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/random.js +++ /dev/null @@ -1,96 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/probability/randomInt.js b/node_modules/mathjs/lib/esm/function/probability/randomInt.js deleted file mode 100644 index f396b83..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/randomInt.js +++ /dev/null @@ -1,90 +0,0 @@ -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', 'log2', '?on']; -export var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - log2, - 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 either 0 or 1, randomly - * 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, 2), - number: max => _randomInt(0, max), - 'number, number': (min, max) => _randomInt(min, max), - bigint: max => _randomBigint(0n, max), - 'bigint, bigint': _randomBigint, - '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)); - } - function _randomBigint(min, max) { - var simpleCutoff = 2n ** 30n; - var width = max - min; // number of choices - if (width <= simpleCutoff) { - // do it with number type - return min + BigInt(_randomInt(0, Number(width))); - } - // Too big to choose accurately that way. Instead, choose the correct - // number of random bits to cover the width, and repeat until the - // resulting number falls within the width - var bits = log2(width); - var picked = width; - while (picked >= width) { - picked = 0n; - for (var i = 0; i < bits; ++i) { - picked = 2n * picked + (rng() < 0.5 ? 0n : 1n); - } - } - return min + picked; - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js b/node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js deleted file mode 100644 index 385f991..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/util/randomMatrix.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js b/node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js deleted file mode 100644 index 9da3f78..0000000 --- a/node_modules/mathjs/lib/esm/function/probability/util/seededRNG.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/relational/compare.js b/node_modules/mathjs/lib/esm/function/relational/compare.js deleted file mode 100644 index d629ce6..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/compare.js +++ /dev/null @@ -1,120 +0,0 @@ -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 - * - * History: - * - * v0.19 Created - * v4 Changed to compare strings by numerical value - * v13 Change to use separate relative and absolute tolerances - * - * @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/node_modules/mathjs/lib/esm/function/relational/compareNatural.js b/node_modules/mathjs/lib/esm/function/relational/compareNatural.js deleted file mode 100644 index 99c76a7..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/compareNatural.js +++ /dev/null @@ -1,280 +0,0 @@ -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 - * - * History: - * - * v15.2 Handle bigints - * v3.14 Created - * - * - * @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' || typeX === 'bigint') && (typeY === 'number' || typeY === 'BigNumber' || typeY === 'Fraction' || typeY === 'bigint')) { - 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/node_modules/mathjs/lib/esm/function/relational/compareText.js b/node_modules/mathjs/lib/esm/function/relational/compareText.js deleted file mode 100644 index 4f25378..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/compareText.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/relational/compareUnits.js b/node_modules/mathjs/lib/esm/function/relational/compareUnits.js deleted file mode 100644 index b3f2dda..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/compareUnits.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/relational/deepEqual.js b/node_modules/mathjs/lib/esm/function/relational/deepEqual.js deleted file mode 100644 index 032adb3..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/deepEqual.js +++ /dev/null @@ -1,79 +0,0 @@ -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 - * - * const a = [2, 5, 1] - * const b = [2, 7, 1] - * - * math.deepEqual(a, b) // returns false... - * math.equal(a, b) // returns [true, false, true] - * - * See also: - * - * equal, unequal - * - * History: - * - * v2 Handle Fractions - * v0.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/relational/equal.js b/node_modules/mathjs/lib/esm/function/relational/equal.js deleted file mode 100644 index 56432f0..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/equal.js +++ /dev/null @@ -1,123 +0,0 @@ -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', 'SparseMatrix']; -export var createEqual = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - matrix, - equalScalar, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - var matAlgo12xSfs = createMatAlgo12xSfs({ - typed, - DenseMatrix - }); - var matrixAlgorithmSuite = createMatrixAlgorithmSuite({ - typed, - matrix - }); - - /** - * 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 false - * - * const a = math.unit('500 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 - * - * History: - * - * v13 Handle bigints - * v11.6 Support matrix broadcasting - * v4 Compare strings by their numerical value - * v0.24 Handle `null` and `undefined` - * v0.23 Compare collections elementwise - * v0.20 Compare floating-point numbers within epsilon, allowing roundoff - * v0.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/relational/equalScalar.js b/node_modules/mathjs/lib/esm/function/relational/equalScalar.js deleted file mode 100644 index 4d545d3..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/equalScalar.js +++ /dev/null @@ -1,56 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/relational/equalText.js b/node_modules/mathjs/lib/esm/function/relational/equalText.js deleted file mode 100644 index 56f8206..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/equalText.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/relational/larger.js b/node_modules/mathjs/lib/esm/function/relational/larger.js deleted file mode 100644 index 5137a94..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/larger.js +++ /dev/null @@ -1,108 +0,0 @@ -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', 'bignumber', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix']; -export var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - bignumber, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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 - */ - function bignumLarger(x, y) { - return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol); - } - return typed(name, createLargerNumber({ - typed, - config - }), { - 'boolean, boolean': (x, y) => x > y, - 'BigNumber, BigNumber': bignumLarger, - 'bigint, bigint': (x, y) => x > y, - 'Fraction, Fraction': (x, y) => x.compare(y) === 1, - 'Fraction, BigNumber': function Fraction_BigNumber(x, y) { - return bignumLarger(bignumber(x), y); - }, - 'BigNumber, Fraction': function BigNumber_Fraction(x, y) { - return bignumLarger(x, bignumber(y)); - }, - '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/node_modules/mathjs/lib/esm/function/relational/largerEq.js b/node_modules/mathjs/lib/esm/function/relational/largerEq.js deleted file mode 100644 index bcdb399..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/largerEq.js +++ /dev/null @@ -1,98 +0,0 @@ -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', 'SparseMatrix']; -export var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/esm/function/relational/smaller.js b/node_modules/mathjs/lib/esm/function/relational/smaller.js deleted file mode 100644 index cbf7701..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/smaller.js +++ /dev/null @@ -1,108 +0,0 @@ -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', 'bignumber', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix']; -export var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - bignumber, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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 - */ - function bignumSmaller(x, y) { - return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol); - } - return typed(name, createSmallerNumber({ - typed, - config - }), { - 'boolean, boolean': (x, y) => x < y, - 'BigNumber, BigNumber': bignumSmaller, - 'bigint, bigint': (x, y) => x < y, - 'Fraction, Fraction': (x, y) => x.compare(y) === -1, - 'Fraction, BigNumber': function Fraction_BigNumber(x, y) { - return bignumSmaller(bignumber(x), y); - }, - 'BigNumber, Fraction': function BigNumber_Fraction(x, y) { - return bignumSmaller(x, bignumber(y)); - }, - '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/node_modules/mathjs/lib/esm/function/relational/smallerEq.js b/node_modules/mathjs/lib/esm/function/relational/smallerEq.js deleted file mode 100644 index f92886f..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/smallerEq.js +++ /dev/null @@ -1,96 +0,0 @@ -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', 'SparseMatrix']; -export var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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/node_modules/mathjs/lib/esm/function/relational/unequal.js b/node_modules/mathjs/lib/esm/function/relational/unequal.js deleted file mode 100644 index b0f8f89..0000000 --- a/node_modules/mathjs/lib/esm/function/relational/unequal.js +++ /dev/null @@ -1,126 +0,0 @@ -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', 'SparseMatrix']; -export var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - equalScalar, - matrix, - DenseMatrix, - concat, - SparseMatrix - } = _ref; - var matAlgo03xDSf = createMatAlgo03xDSf({ - typed - }); - var matAlgo07xSSf = createMatAlgo07xSSf({ - typed, - SparseMatrix - }); - 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 true - * - * const a = math.unit('500 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 - * - * History: - * - * v13 Handle bigints - * v11.6 Support matrix broadcasting - * v4 Compare strings by their numeric values - * v0.24 Handle `null` and `undefined` - * v0.2 Created - * - * @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/node_modules/mathjs/lib/esm/function/set/setCartesian.js b/node_modules/mathjs/lib/esm/function/set/setCartesian.js deleted file mode 100644 index 275d0d7..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setCartesian.js +++ /dev/null @@ -1,58 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setDifference.js b/node_modules/mathjs/lib/esm/function/set/setDifference.js deleted file mode 100644 index 94688d7..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setDifference.js +++ /dev/null @@ -1,71 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setDistinct.js b/node_modules/mathjs/lib/esm/function/set/setDistinct.js deleted file mode 100644 index 8b7b7af..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setDistinct.js +++ /dev/null @@ -1,58 +0,0 @@ -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. - * The items of the returned array will be sorted in natural order. - * - * 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 distinct 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/node_modules/mathjs/lib/esm/function/set/setIntersect.js b/node_modules/mathjs/lib/esm/function/set/setIntersect.js deleted file mode 100644 index f88e1a5..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setIntersect.js +++ /dev/null @@ -1,63 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setIsSubset.js b/node_modules/mathjs/lib/esm/function/set/setIsSubset.js deleted file mode 100644 index a1b353e..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setIsSubset.js +++ /dev/null @@ -1,62 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setMultiplicity.js b/node_modules/mathjs/lib/esm/function/set/setMultiplicity.js deleted file mode 100644 index 57dc237..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setMultiplicity.js +++ /dev/null @@ -1,50 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setPowerset.js b/node_modules/mathjs/lib/esm/function/set/setPowerset.js deleted file mode 100644 index 0cdfd83..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setPowerset.js +++ /dev/null @@ -1,75 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setSize.js b/node_modules/mathjs/lib/esm/function/set/setSize.js deleted file mode 100644 index 3d374eb..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setSize.js +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setSymDifference.js b/node_modules/mathjs/lib/esm/function/set/setSymDifference.js deleted file mode 100644 index 4c8fa96..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setSymDifference.js +++ /dev/null @@ -1,48 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/set/setUnion.js b/node_modules/mathjs/lib/esm/function/set/setUnion.js deleted file mode 100644 index d069770..0000000 --- a/node_modules/mathjs/lib/esm/function/set/setUnion.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/signal/freqz.js b/node_modules/mathjs/lib/esm/function/signal/freqz.js deleted file mode 100644 index 0e58161..0000000 --- a/node_modules/mathjs/lib/esm/function/signal/freqz.js +++ /dev/null @@ -1,115 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/signal/zpk2tf.js b/node_modules/mathjs/lib/esm/function/signal/zpk2tf.js deleted file mode 100644 index e378c83..0000000 --- a/node_modules/mathjs/lib/esm/function/signal/zpk2tf.js +++ /dev/null @@ -1,82 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/special/erf.js b/node_modules/mathjs/lib/esm/function/special/erf.js deleted file mode 100644 index 194a879..0000000 --- a/node_modules/mathjs/lib/esm/function/special/erf.js +++ /dev/null @@ -1,155 +0,0 @@ -/* 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/node_modules/mathjs/lib/esm/function/special/zeta.js b/node_modules/mathjs/lib/esm/function/special/zeta.js deleted file mode 100644 index ffa756e..0000000 --- a/node_modules/mathjs/lib/esm/function/special/zeta.js +++ /dev/null @@ -1,149 +0,0 @@ -import { factory } from '../../utils/factory.js'; -var name = 'zeta'; -var dependencies = ['typed', 'config', 'multiply', 'pow', 'divide', 'factorial', 'equal', 'smallerEq', 'isBounded', '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, - isBounded, - 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 (!isBounded(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/node_modules/mathjs/lib/esm/function/statistics/corr.js b/node_modules/mathjs/lib/esm/function/statistics/corr.js deleted file mode 100644 index 0d03357..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/corr.js +++ /dev/null @@ -1,84 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/cumsum.js b/node_modules/mathjs/lib/esm/function/statistics/cumsum.js deleted file mode 100644 index 1e7cc36..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/cumsum.js +++ /dev/null @@ -1,123 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/mad.js b/node_modules/mathjs/lib/esm/function/statistics/mad.js deleted file mode 100644 index 96e096a..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/mad.js +++ /dev/null @@ -1,64 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/max.js b/node_modules/mathjs/lib/esm/function/statistics/max.js deleted file mode 100644 index 26bf3e7..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/max.js +++ /dev/null @@ -1,106 +0,0 @@ -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', 'isNaN']; -export var createMax = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - numeric, - larger, - isNaN: mathIsNaN - } = _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 (mathIsNaN(value)) { - res = value; - } 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/node_modules/mathjs/lib/esm/function/statistics/mean.js b/node_modules/mathjs/lib/esm/function/statistics/mean.js deleted file mode 100644 index 62d910f..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/mean.js +++ /dev/null @@ -1,94 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/median.js b/node_modules/mathjs/lib/esm/function/statistics/median.js deleted file mode 100644 index 12e65a5..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/median.js +++ /dev/null @@ -1,108 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/min.js b/node_modules/mathjs/lib/esm/function/statistics/min.js deleted file mode 100644 index 8331f7d..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/min.js +++ /dev/null @@ -1,106 +0,0 @@ -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', 'isNaN']; -export var createMin = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - config, - numeric, - smaller, - isNaN: mathIsNaN - } = _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 (mathIsNaN(value)) { - min = value; - } 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/node_modules/mathjs/lib/esm/function/statistics/mode.js b/node_modules/mathjs/lib/esm/function/statistics/mode.js deleted file mode 100644 index 267d112..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/mode.js +++ /dev/null @@ -1,76 +0,0 @@ -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: mathIsNaN, - 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) && mathIsNaN(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/node_modules/mathjs/lib/esm/function/statistics/prod.js b/node_modules/mathjs/lib/esm/function/statistics/prod.js deleted file mode 100644 index 208357f..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/prod.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js b/node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js deleted file mode 100644 index ca3299e..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/quantileSeq.js +++ /dev/null @@ -1,161 +0,0 @@ -import { isNumber } from '../../utils/is.js'; -import { flatten } from '../../utils/array.js'; -import { factory } from '../../utils/factory.js'; -var name = 'quantileSeq'; -var dependencies = ['typed', '?bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger', 'mapSlices']; -export var createQuantileSeq = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - bignumber, - add, - subtract, - divide, - multiply, - partitionSelect, - compare, - isInteger, - smaller, - smallerEq, - larger, - mapSlices - } = _ref; - /** - * 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 mapSlices(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/node_modules/mathjs/lib/esm/function/statistics/std.js b/node_modules/mathjs/lib/esm/function/statistics/std.js deleted file mode 100644 index 25c6536..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/std.js +++ /dev/null @@ -1,97 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/sum.js b/node_modules/mathjs/lib/esm/function/statistics/sum.js deleted file mode 100644 index 661e373..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/sum.js +++ /dev/null @@ -1,85 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js b/node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js deleted file mode 100644 index 9ef8737..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/utils/improveErrorMessage.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/statistics/variance.js b/node_modules/mathjs/lib/esm/function/statistics/variance.js deleted file mode 100644 index d639a17..0000000 --- a/node_modules/mathjs/lib/esm/function/statistics/variance.js +++ /dev/null @@ -1,153 +0,0 @@ -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', 'mapSlices', 'isNaN']; -export var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - add, - subtract, - multiply, - divide, - mapSlices, - isNaN: mathIsNaN - } = _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 (mathIsNaN(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 mapSlices(array, dim, x => _var(x, normalization)); - } catch (err) { - throw improveErrorMessage(err, 'variance'); - } - } -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/string/bin.js b/node_modules/mathjs/lib/esm/function/string/bin.js deleted file mode 100644 index 3a7ced1..0000000 --- a/node_modules/mathjs/lib/esm/function/string/bin.js +++ /dev/null @@ -1,44 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/string/format.js b/node_modules/mathjs/lib/esm/function/string/format.js deleted file mode 100644 index 456011d..0000000 --- a/node_modules/mathjs/lib/esm/function/string/format.js +++ /dev/null @@ -1,140 +0,0 @@ -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 - * - * History: - * - * v0.4 Created - * v0.7 Round to a consistent number of digits (rather than decimals) - * v0.15 Added multiple number notations and configurable precision - * v3 Added support for JSON objects - * v9 Added binary, hexadecimal, and octal notations - * v10.4.2 Add `truncate` option - * - * @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/node_modules/mathjs/lib/esm/function/string/hex.js b/node_modules/mathjs/lib/esm/function/string/hex.js deleted file mode 100644 index 7004a5d..0000000 --- a/node_modules/mathjs/lib/esm/function/string/hex.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/string/oct.js b/node_modules/mathjs/lib/esm/function/string/oct.js deleted file mode 100644 index 673fd50..0000000 --- a/node_modules/mathjs/lib/esm/function/string/oct.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/string/print.js b/node_modules/mathjs/lib/esm/function/string/print.js deleted file mode 100644 index 3ee3761..0000000 --- a/node_modules/mathjs/lib/esm/function/string/print.js +++ /dev/null @@ -1,90 +0,0 @@ -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: '2013-03-23' - * }) - * - * // 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/node_modules/mathjs/lib/esm/function/trigonometry/acos.js b/node_modules/mathjs/lib/esm/function/trigonometry/acos.js deleted file mode 100644 index e54c0ae..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/acos.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/acosh.js b/node_modules/mathjs/lib/esm/function/trigonometry/acosh.js deleted file mode 100644 index 11887a0..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/acosh.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/acot.js b/node_modules/mathjs/lib/esm/function/trigonometry/acot.js deleted file mode 100644 index 7f1a03b..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/acot.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/acoth.js b/node_modules/mathjs/lib/esm/function/trigonometry/acoth.js deleted file mode 100644 index 0cad4b3..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/acoth.js +++ /dev/null @@ -1,48 +0,0 @@ -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.5493061443340548 - 1.5707963267948966i - * - * 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/node_modules/mathjs/lib/esm/function/trigonometry/acsc.js b/node_modules/mathjs/lib/esm/function/trigonometry/acsc.js deleted file mode 100644 index 50f47b2..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/acsc.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/acsch.js b/node_modules/mathjs/lib/esm/function/trigonometry/acsch.js deleted file mode 100644 index 8e97e4a..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/acsch.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/asec.js b/node_modules/mathjs/lib/esm/function/trigonometry/asec.js deleted file mode 100644 index 09c0857..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/asec.js +++ /dev/null @@ -1,50 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/asech.js b/node_modules/mathjs/lib/esm/function/trigonometry/asech.js deleted file mode 100644 index 0141b7f..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/asech.js +++ /dev/null @@ -1,53 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/asin.js b/node_modules/mathjs/lib/esm/function/trigonometry/asin.js deleted file mode 100644 index d8d10f5..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/asin.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/asinh.js b/node_modules/mathjs/lib/esm/function/trigonometry/asinh.js deleted file mode 100644 index 0f88069..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/asinh.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/atan.js b/node_modules/mathjs/lib/esm/function/trigonometry/atan.js deleted file mode 100644 index bf11823..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/atan.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/atan2.js b/node_modules/mathjs/lib/esm/function/trigonometry/atan2.js deleted file mode 100644 index 02286d4..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/atan2.js +++ /dev/null @@ -1,90 +0,0 @@ -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') - * const x = math.cos(angle) - * const y = math.sin(angle) - * math.atan2(y, x) * 180 / math.pi // returns 60 - * - * 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/node_modules/mathjs/lib/esm/function/trigonometry/atanh.js b/node_modules/mathjs/lib/esm/function/trigonometry/atanh.js deleted file mode 100644 index ce7624a..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/atanh.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/cos.js b/node_modules/mathjs/lib/esm/function/trigonometry/cos.js deleted file mode 100644 index 1d80fa1..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/cos.js +++ /dev/null @@ -1,44 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/cosh.js b/node_modules/mathjs/lib/esm/function/trigonometry/cosh.js deleted file mode 100644 index 831409f..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/cosh.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/cot.js b/node_modules/mathjs/lib/esm/function/trigonometry/cot.js deleted file mode 100644 index c597776..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/cot.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/coth.js b/node_modules/mathjs/lib/esm/function/trigonometry/coth.js deleted file mode 100644 index 0ec6b42..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/coth.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/csc.js b/node_modules/mathjs/lib/esm/function/trigonometry/csc.js deleted file mode 100644 index 295f377..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/csc.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/csch.js b/node_modules/mathjs/lib/esm/function/trigonometry/csch.js deleted file mode 100644 index 869a32e..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/csch.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/sec.js b/node_modules/mathjs/lib/esm/function/trigonometry/sec.js deleted file mode 100644 index e8f5376..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/sec.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/sech.js b/node_modules/mathjs/lib/esm/function/trigonometry/sech.js deleted file mode 100644 index 8caa808..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/sech.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/sin.js b/node_modules/mathjs/lib/esm/function/trigonometry/sin.js deleted file mode 100644 index a460fd5..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/sin.js +++ /dev/null @@ -1,44 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/sinh.js b/node_modules/mathjs/lib/esm/function/trigonometry/sinh.js deleted file mode 100644 index 8b2c08c..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/sinh.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/tan.js b/node_modules/mathjs/lib/esm/function/trigonometry/tan.js deleted file mode 100644 index 7419e95..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/tan.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/tanh.js b/node_modules/mathjs/lib/esm/function/trigonometry/tanh.js deleted file mode 100644 index d73aa80..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/tanh.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js b/node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js deleted file mode 100644 index ebb5411..0000000 --- a/node_modules/mathjs/lib/esm/function/trigonometry/trigUnit.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/unit/to.js b/node_modules/mathjs/lib/esm/function/unit/to.js deleted file mode 100644 index f11a865..0000000 --- a/node_modules/mathjs/lib/esm/function/unit/to.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/unit/toBest.js b/node_modules/mathjs/lib/esm/function/unit/toBest.js deleted file mode 100644 index f29f423..0000000 --- a/node_modules/mathjs/lib/esm/function/unit/toBest.js +++ /dev/null @@ -1,47 +0,0 @@ -import { factory } from '../../utils/factory.js'; -var name = 'toBest'; -var dependencies = ['typed']; -export var createToBest = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed - } = _ref; - /** - * Converts a unit to the most appropriate display unit. - * When no preferred units are provided, the function automatically find the best prefix. - * When preferred units are provided, it converts to - * the unit that gives a value closest to 1. - * - * Syntax: - * - * math.toBest(unit) - * math.toBest(unit, unitList) - * math.toBest(unit, unitList, options) - * - * Where: - * - `unitList` is an optional array of preferred target units as string or Unit. - * - `options` is an optional object with options, formed as follows: - * - `offset`: number | BigNumber - * - * Examples: - * - * math.unit(0.05, 'm').toBest(['cm', 'mm']) // returns Unit 5 cm - * math.unit(2 / 3, 'cm').toBest() // returns Unit 0.6666666666666666 cm - * math.unit(10, 'm').toBest(['mm', 'km'], { offset: 1.5 }) // returns Unit 10000 mm - * - * See also: - * - * unit, to, format - * - * @param {Unit} x The unit to be converted - * @param {Array} [unitList=[]] Optional array of preferred target units - * @param {Object} [options] Optional options object - * @return {Unit} Value converted to the best matching unit - */ - return typed(name, { - Unit: x => x.toBest(), - 'Unit, string': (x, unitList) => x.toBest(unitList.split(',')), - 'Unit, string, Object': (x, unitList, options) => x.toBest(unitList.split(','), options), - 'Unit, Array': (x, unitList) => x.toBest(unitList), - 'Unit, Array, Object': (x, unitList, options) => x.toBest(unitList, options) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/utils/clone.js b/node_modules/mathjs/lib/esm/function/utils/clone.js deleted file mode 100644 index db81566..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/clone.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js b/node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js deleted file mode 100644 index 99d7fb7..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/hasNumericValue.js +++ /dev/null @@ -1,50 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/utils/isBounded.js b/node_modules/mathjs/lib/esm/function/utils/isBounded.js deleted file mode 100644 index 3c7bd6f..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isBounded.js +++ /dev/null @@ -1,48 +0,0 @@ -import { factory } from '../../utils/factory.js'; -var name = 'isBounded'; -var dependencies = ['typed']; -export var createIsBounded = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed - } = _ref; - /** - * Test whether a value is bounded. For scalars, this test is equivalent - * to the isFinite finiteness test. On the other hand, a Matrix or Array - * is defined to be bounded if every entry is finite. - * - * Syntax: - * - * math.isBounded(x) - * - * Examples: - * - * math.isBounded(0) // returns true - * math.isBounded(NaN) // returns false - * math.isBounded(math.bignumber(Infinity)) // returns false - * math.isBounded(math.fraction(1,3)) // returns true - * math.isBounded(math.complex('2 - 4i')) // returns true - * math.isBounded(-10000000000000000n) // returns true - * math.isBounded(undefined) // returns false - * math.isBounded(null) // returns false - * math.isBounded([0.001, -3n, 0]) // returns true - * math.isBounded([2, -Infinity, -3]) // returns false - * - * See also: - * - * isFinite, isNumeric, isPositive, isNegative, isNaN - * - * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x Value to be tested - * @return {boolean} Returns true when `x` is bounded. - */ - return typed(name, { - number: n => Number.isFinite(n), - 'BigNumber | Complex': x => x.isFinite(), - 'bigint | Fraction': () => true, - 'null | undefined': () => false, - Unit: typed.referToSelf(self => x => self(x.value)), - 'Array | Matrix': typed.referToSelf(self => A => { - if (!Array.isArray(A)) A = A.valueOf(); - return A.every(entry => self(entry)); - }) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/utils/isFinite.js b/node_modules/mathjs/lib/esm/function/utils/isFinite.js deleted file mode 100644 index b5c4811..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isFinite.js +++ /dev/null @@ -1,51 +0,0 @@ -import { factory } from '../../utils/factory.js'; -var name = 'isFinite'; -var dependencies = ['typed', 'isBounded', 'map']; -export var createIsFinite = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - isBounded, - map - } = _ref; - /** - * Test whether a value is finite. - * - * Operates elementwise on Array and Matrix values. To test if all entries - * of an Array or Matrix are finite, use isBounded. - * - * Syntax: - * - * math.isFinite(x) - * - * Examples: - * - * math.isFinite(0) // returns true - * math.isFinite(NaN) // returns false - * math.isFinite(math.bignumber(Infinity)) // returns false - * math.isFinite(math.fraction(1,3)) // returns true - * math.isFinite(math.complex('2 - 4i')) // returns true - * math.isFinite(-10000000000000000n) // returns true - * math.isFinite(undefined) // returns false - * math.isFinite(null) // returns false - * math.isFinite([0.001, -3n, 0]) // Array [true, true, true] - * math.isFinite([2, -Infinity, -3]) // Array [true, false, true] - * - * See also: - * - * isBounded isNumeric, isPositive, isNegative, isNaN - * - * History: - * - * v15.1 Created - * - * @param {number | BigNumber | bigint | Complex | Fraction | Unit | Array | Matrix} x - * Value to be tested - * @return {boolean | Array | Matrix} - * Whether the value, or its entries, are finite, as appropriate - * to its type - */ - return typed(name, { - 'Array | Matrix': A => map(A, isBounded), - any: x => isBounded(x) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/utils/isInteger.js b/node_modules/mathjs/lib/esm/function/utils/isInteger.js deleted file mode 100644 index 350ddd8..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isInteger.js +++ /dev/null @@ -1,46 +0,0 @@ -import { deepMap } from '../../utils/collection.js'; -import { factory } from '../../utils/factory.js'; -var name = 'isInteger'; -var dependencies = ['typed', 'equal']; -export var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - equal - } = _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 TypeError - * - * 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: n => Number.isFinite(n) ? equal(n, Math.round(n)) : false, - BigNumber: b => b.isFinite() ? equal(b.round(), b) : false, - bigint: b => true, - Fraction: r => r.d === 1n, - 'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self)) - }); -}); \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/function/utils/isNaN.js b/node_modules/mathjs/lib/esm/function/utils/isNaN.js deleted file mode 100644 index a01cc04..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isNaN.js +++ /dev/null @@ -1,58 +0,0 @@ -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, isFinite, isBounded - * - * @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/node_modules/mathjs/lib/esm/function/utils/isNegative.js b/node_modules/mathjs/lib/esm/function/utils/isNegative.js deleted file mode 100644 index 8cbd460..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isNegative.js +++ /dev/null @@ -1,52 +0,0 @@ -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 < 0n, - // 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/node_modules/mathjs/lib/esm/function/utils/isNumeric.js b/node_modules/mathjs/lib/esm/function/utils/isNumeric.js deleted file mode 100644 index 2e1b7f8..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isNumeric.js +++ /dev/null @@ -1,44 +0,0 @@ -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, isFinite, isBounded - * - * @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/node_modules/mathjs/lib/esm/function/utils/isPositive.js b/node_modules/mathjs/lib/esm/function/utils/isPositive.js deleted file mode 100644 index 8b4ba3b..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isPositive.js +++ /dev/null @@ -1,52 +0,0 @@ -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 > 0n && x.n > 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/node_modules/mathjs/lib/esm/function/utils/isPrime.js b/node_modules/mathjs/lib/esm/function/utils/isPrime.js deleted file mode 100644 index 04b92f1..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isPrime.js +++ /dev/null @@ -1,130 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/utils/isZero.js b/node_modules/mathjs/lib/esm/function/utils/isZero.js deleted file mode 100644 index 726ea7c..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/isZero.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/mathjs/lib/esm/function/utils/numeric.js b/node_modules/mathjs/lib/esm/function/utils/numeric.js deleted file mode 100644 index bdae6c0..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/numeric.js +++ /dev/null @@ -1,82 +0,0 @@ -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) - * math.numeric(value, outputType) - * - * 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 - * - * History: - * - * v6 Created - * v13 Added `bigint` support - * v14.2.1 Prefer mathjs `bigint()` to built-in `BigInt()` - * - * @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/node_modules/mathjs/lib/esm/function/utils/typeOf.js b/node_modules/mathjs/lib/esm/function/utils/typeOf.js deleted file mode 100644 index c20d278..0000000 --- a/node_modules/mathjs/lib/esm/function/utils/typeOf.js +++ /dev/null @@ -1,65 +0,0 @@ -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/node_modules/mathjs/lib/esm/index.js b/node_modules/mathjs/lib/esm/index.js deleted file mode 100644 index 7e74c6c..0000000 --- a/node_modules/mathjs/lib/esm/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './entry/mainAny.js'; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/json/replacer.js b/node_modules/mathjs/lib/esm/json/replacer.js deleted file mode 100644 index 76a48cc..0000000 --- a/node_modules/mathjs/lib/esm/json/replacer.js +++ /dev/null @@ -1,33 +0,0 @@ -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' && (!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/node_modules/mathjs/lib/esm/json/reviver.js b/node_modules/mathjs/lib/esm/json/reviver.js deleted file mode 100644 index 982218a..0000000 --- a/node_modules/mathjs/lib/esm/json/reviver.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/mathjs/lib/esm/number.js b/node_modules/mathjs/lib/esm/number.js deleted file mode 100644 index 5181f6c..0000000 --- a/node_modules/mathjs/lib/esm/number.js +++ /dev/null @@ -1 +0,0 @@ -export * from './entry/mainNumber.js'; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/plain/bignumber/arithmetic.js b/node_modules/mathjs/lib/esm/plain/bignumber/arithmetic.js deleted file mode 100644 index 2cf9080..0000000 --- a/node_modules/mathjs/lib/esm/plain/bignumber/arithmetic.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/bignumber/index.js b/node_modules/mathjs/lib/esm/plain/bignumber/index.js deleted file mode 100644 index a60ccf4..0000000 --- a/node_modules/mathjs/lib/esm/plain/bignumber/index.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/arithmetic.js b/node_modules/mathjs/lib/esm/plain/number/arithmetic.js deleted file mode 100644 index d47fd95..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/arithmetic.js +++ /dev/null @@ -1,303 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/bitwise.js b/node_modules/mathjs/lib/esm/plain/number/bitwise.js deleted file mode 100644 index 0d21693..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/bitwise.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/combinations.js b/node_modules/mathjs/lib/esm/plain/number/combinations.js deleted file mode 100644 index a102eed..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/combinations.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/constants.js b/node_modules/mathjs/lib/esm/plain/number/constants.js deleted file mode 100644 index a544965..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/index.js b/node_modules/mathjs/lib/esm/plain/number/index.js deleted file mode 100644 index 769d9fc..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/index.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/logical.js b/node_modules/mathjs/lib/esm/plain/number/logical.js deleted file mode 100644 index 61f2d60..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/logical.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/mathjs/lib/esm/plain/number/probability.js b/node_modules/mathjs/lib/esm/plain/number/probability.js deleted file mode 100644 index 877e50c..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/probability.js +++ /dev/null @@ -1,75 +0,0 @@ -/* 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 Number.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 (!Number.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/node_modules/mathjs/lib/esm/plain/number/trigonometry.js b/node_modules/mathjs/lib/esm/plain/number/trigonometry.js deleted file mode 100644 index a3c1d9c..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/trigonometry.js +++ /dev/null @@ -1,112 +0,0 @@ -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 Number.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/node_modules/mathjs/lib/esm/plain/number/utils.js b/node_modules/mathjs/lib/esm/plain/number/utils.js deleted file mode 100644 index fec97d5..0000000 --- a/node_modules/mathjs/lib/esm/plain/number/utils.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/bigint.js b/node_modules/mathjs/lib/esm/type/bigint.js deleted file mode 100644 index e62de71..0000000 --- a/node_modules/mathjs/lib/esm/type/bigint.js +++ /dev/null @@ -1,70 +0,0 @@ -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 - * - * History: - * - * v13 Created - * v14.2.1 Added conversion options - * - * @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/node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js b/node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js deleted file mode 100644 index 4465c8a..0000000 --- a/node_modules/mathjs/lib/esm/type/bignumber/BigNumber.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js b/node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js deleted file mode 100644 index d7b4f35..0000000 --- a/node_modules/mathjs/lib/esm/type/bignumber/function/bignumber.js +++ /dev/null @@ -1,82 +0,0 @@ -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(String(x.n)).div(String(x.d)).times(String(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/node_modules/mathjs/lib/esm/type/boolean.js b/node_modules/mathjs/lib/esm/type/boolean.js deleted file mode 100644 index edd8724..0000000 --- a/node_modules/mathjs/lib/esm/type/boolean.js +++ /dev/null @@ -1,76 +0,0 @@ -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 - * - * History: - * - * v0.11 Created - * v0.16 Added conversion from BigNumber - * v14.2.1 Added conversion from bigint - * - * @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/node_modules/mathjs/lib/esm/type/chain/Chain.js b/node_modules/mathjs/lib/esm/type/chain/Chain.js deleted file mode 100644 index 1f27638..0000000 --- a/node_modules/mathjs/lib/esm/type/chain/Chain.js +++ /dev/null @@ -1,213 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/chain/function/chain.js b/node_modules/mathjs/lib/esm/type/chain/function/chain.js deleted file mode 100644 index 50e5e2f..0000000 --- a/node_modules/mathjs/lib/esm/type/chain/function/chain.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/complex/Complex.js b/node_modules/mathjs/lib/esm/type/complex/Complex.js deleted file mode 100644 index 4346872..0000000 --- a/node_modules/mathjs/lib/esm/type/complex/Complex.js +++ /dev/null @@ -1,194 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/complex/function/complex.js b/node_modules/mathjs/lib/esm/type/complex/function/complex.js deleted file mode 100644 index f9dac02..0000000 --- a/node_modules/mathjs/lib/esm/type/complex/function/complex.js +++ /dev/null @@ -1,91 +0,0 @@ -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 - * - * History: - * - * v0.5 Created - * v0.16 Added conversion from BigNumber - * v6 Added conversion from Fraction - * - * @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/node_modules/mathjs/lib/esm/type/fraction/Fraction.js b/node_modules/mathjs/lib/esm/type/fraction/Fraction.js deleted file mode 100644 index 3ac4045..0000000 --- a/node_modules/mathjs/lib/esm/type/fraction/Fraction.js +++ /dev/null @@ -1,41 +0,0 @@ -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: String(this.s * this.n), - d: String(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/node_modules/mathjs/lib/esm/type/fraction/function/fraction.js b/node_modules/mathjs/lib/esm/type/fraction/function/fraction.js deleted file mode 100644 index a99456a..0000000 --- a/node_modules/mathjs/lib/esm/type/fraction/function/fraction.js +++ /dev/null @@ -1,93 +0,0 @@ -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 - * - * History: - * - * v2 Created - * v3 Added conversion from BigNumber - * v11.8 Added conversion from Unit - * v13 Added conversion from bigint - * v14 Move to bigint-based fraction.js@5; construct from two bigints - * - * @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 (!Number.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); - }, - 'bigint, bigint': function bigint_bigint(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/node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js b/node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js deleted file mode 100644 index dcddd4d..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/DenseMatrix.js +++ /dev/null @@ -1,1046 +0,0 @@ -// 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', 'config']; -export var createDenseMatrixClass = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - Matrix, - config - } = _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 = config.legacySubset ? index.size().every(idx => idx === 1) : 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 - var returnMatrix = new DenseMatrix(); - var submatrix = _getSubmatrix(matrix._data, index); - returnMatrix._size = submatrix.size; - returnMatrix._datatype = matrix._datatype; - returnMatrix._data = submatrix.data; - return config.legacySubset ? returnMatrix.reshape(index.size()) : returnMatrix; - } - } - - /** - * 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 - * @return {Array} submatrix - * @private - */ - function _getSubmatrix(data, index) { - var maxDepth = index.size().length - 1; - var size = Array(maxDepth); - return { - data: getSubmatrixRecursive(data), - size: size.filter(x => x !== null) - }; - function getSubmatrixRecursive(data) { - var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var dims = index.dimension(depth); - function _mapIndex(dim, callback) { - // applies a callback for when the index is a Number or a Matrix - if (isNumber(dim)) return callback(dim);else return dim.map(callback).valueOf(); - } - if (isNumber(dims)) { - size[depth] = null; - } else { - size[depth] = dims.size()[0]; - } - if (depth < maxDepth) { - return _mapIndex(dims, dimIndex => { - validateIndex(dimIndex, data.length); - return getSubmatrixRecursive(data[dimIndex], depth + 1); - }); - } else { - return _mapIndex(dims, dimIndex => { - validateIndex(dimIndex, data.length); - return data[dimIndex]; - }); - } - } - } - - /** - * 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 submatrixSize; - if (isMatrix(submatrix)) { - submatrixSize = submatrix.size(); - submatrix = submatrix.valueOf(); - } else { - submatrixSize = arraySize(submatrix); - } - if (isScalar) { - // set a scalar - - // check whether submatrix is a scalar - if (submatrixSize.length !== 0) { - throw new TypeError('Scalar expected'); - } - matrix.set(index.min(), submatrix, defaultValue); - } else { - // set a submatrix - - // broadcast submatrix - if (!deepStrictEqual(submatrixSize, iSize)) { - if (submatrixSize.length === 0) { - submatrix = broadcastTo([submatrix], iSize); - } else { - try { - submatrix = broadcastTo(submatrix, iSize); - } catch (error) {} - } - submatrixSize = arraySize(submatrix); - } - - // validate dimensions - if (iSize.length < matrix._size.length) { - throw new DimensionError(iSize.length, matrix._size.length, '<'); - } - if (submatrixSize.length < iSize.length) { - // calculate number of missing outer dimensions - var i = 0; - var outer = 0; - while (iSize[i] === 1 && submatrixSize[i] === 1) { - i++; - } - while (iSize[i] === 1) { - outer++; - i++; - } - - // unsqueeze both outer and inner dimensions - submatrix = unsqueeze(submatrix, iSize.length, outer, submatrixSize); - } - - // check whether the size of the submatrix matches the index size - if (!deepStrictEqual(iSize, submatrixSize)) { - throw new DimensionError(iSize, submatrixSize, '>'); - } - - // enlarge matrix when needed - var size = index.max().map(function (i) { - return i + 1; - }); - _fit(matrix, size, defaultValue); - - // insert the sub matrix - _setSubmatrix(matrix._data, index, submatrix); - } - return matrix; - } - - /** - * Replace a submatrix of a multi dimensional matrix. - * @memberof DenseMatrix - * @param {Array} data - * @param {Index} index - * @param {Array} submatrix - * @private - */ - function _setSubmatrix(data, index, submatrix) { - var maxDepth = index.size().length - 1; - setSubmatrixRecursive(data, submatrix); - function setSubmatrixRecursive(data, submatrix) { - var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var range = index.dimension(depth); - var recursiveCallback = (rangeIndex, i) => { - validateIndex(rangeIndex, data.length); - setSubmatrixRecursive(data[rangeIndex], submatrix[i[0]], depth + 1); - }; - var finalCallback = (rangeIndex, i) => { - validateIndex(rangeIndex, data.length); - data[rangeIndex] = submatrix[i[0]]; - }; - if (depth < maxDepth) { - if (isNumber(range)) recursiveCallback(range, [0]);else range.forEach(recursiveCallback); - } else { - if (isNumber(range)) finalCallback(range, [0]);else range.forEach(finalCallback); - } - } - } - - /** - * 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 - }; - - /** - * 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. - * @param {boolean} skipZeros If true, the callback function is invoked only for non-zero entries - * @param {boolean} isUnary If true, the callback function is invoked with one parameter - * - * @return {DenseMatrix} matrix - */ - DenseMatrix.prototype.map = function (callback) { - var skipZeros = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var isUnary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var me = this; - var maxDepth = me._size.length - 1; - if (maxDepth < 0) return me.clone(); - var fastCallback = optimizeCallback(callback, me, 'map', isUnary); - var fastCallbackFn = fastCallback.fn; - var result = me.create(undefined, me._datatype); - result._size = me._size; - if (isUnary || fastCallback.isUnary) { - result._data = iterateUnary(me._data); - return result; - } - if (maxDepth === 0) { - var inputData = me.valueOf(); - var data = Array(inputData.length); - for (var i = 0; i < inputData.length; i++) { - data[i] = fastCallbackFn(inputData[i], [i], me); - } - result._data = data; - return result; - } - var index = []; - result._data = iterate(me._data); - return result; - function iterate(data) { - var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var result = Array(data.length); - if (depth < maxDepth) { - for (var _i = 0; _i < data.length; _i++) { - index[depth] = _i; - result[_i] = iterate(data[_i], depth + 1); - } - } else { - for (var _i2 = 0; _i2 < data.length; _i2++) { - index[depth] = _i2; - result[_i2] = fastCallbackFn(data[_i2], index.slice(), me); - } - } - return result; - } - function iterateUnary(data) { - var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var result = Array(data.length); - if (depth < maxDepth) { - for (var _i3 = 0; _i3 < data.length; _i3++) { - result[_i3] = iterateUnary(data[_i3], depth + 1); - } - } else { - for (var _i4 = 0; _i4 < data.length; _i4++) { - result[_i4] = fastCallbackFn(data[_i4]); - } - } - 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. - * @param {boolean} skipZeros If true, the callback function is invoked only for non-zero entries - * @param {boolean} isUnary If true, the callback function is invoked with one parameter - */ - DenseMatrix.prototype.forEach = function (callback) { - var skipZeros = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var isUnary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var me = this; - var maxDepth = me._size.length - 1; - if (maxDepth < 0) return; - var fastCallback = optimizeCallback(callback, me, 'map', isUnary); - var fastCallbackFn = fastCallback.fn; - if (isUnary || fastCallback.isUnary) { - iterateUnary(me._data); - return; - } - if (maxDepth === 0) { - for (var i = 0; i < me._data.length; i++) { - fastCallbackFn(me._data[i], [i], me); - } - return; - } - var index = []; - iterate(me._data); - function iterate(data) { - var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - if (depth < maxDepth) { - for (var _i5 = 0; _i5 < data.length; _i5++) { - index[depth] = _i5; - iterate(data[_i5], depth + 1); - } - } else { - for (var _i6 = 0; _i6 < data.length; _i6++) { - index[depth] = _i6; - fastCallbackFn(data[_i6], index.slice(), me); - } - } - } - function iterateUnary(data) { - var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - if (depth < maxDepth) { - for (var _i7 = 0; _i7 < data.length; _i7++) { - iterateUnary(data[_i7], depth + 1); - } - } else { - for (var _i8 = 0; _i8 < data.length; _i8++) { - fastCallbackFn(data[_i8]); - } - } - } - }; - - /** - * Iterate over the matrix elements - * @return {Iterable<{ value, index: number[] }>} - */ - DenseMatrix.prototype[Symbol.iterator] = function* () { - var maxDepth = this._size.length - 1; - if (maxDepth < 0) { - return; - } - if (maxDepth === 0) { - for (var i = 0; i < this._data.length; i++) { - yield { - value: this._data[i], - index: [i] - }; - } - return; - } - - // Multi-dimensional matrix: iterate over all elements - var index = Array(maxDepth + 1).fill(0); - var totalElements = this._size.reduce((a, b) => a * b, 1); - for (var count = 0; count < totalElements; count++) { - // Traverse to the current element using indices - var current = this._data; - for (var d = 0; d < maxDepth; d++) { - current = current[index[d]]; - } - yield { - value: current[index[maxDepth]], - index: index.slice() - }; - - // Increment indices for next element - for (var _d = maxDepth; _d >= 0; _d--) { - index[_d]++; - if (index[_d] < this._size[_d]) break; - index[_d] = 0; - } - } - }; - - /** - * 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/node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js b/node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js deleted file mode 100644 index b1c2f71..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/FibonacciHeap.js +++ /dev/null @@ -1,351 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js b/node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js deleted file mode 100644 index d12b9bf..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/ImmutableDenseMatrix.js +++ /dev/null @@ -1,221 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/Matrix.js b/node_modules/mathjs/lib/esm/type/matrix/Matrix.js deleted file mode 100644 index 055b4c9..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/Matrix.js +++ /dev/null @@ -1,242 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js b/node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js deleted file mode 100644 index 0c49070..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/MatrixIndex.js +++ /dev/null @@ -1,303 +0,0 @@ -import { isArray, isMatrix, isRange, isNumber, isString } 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() { - 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 = i < 0 || arguments.length <= i ? undefined : arguments[i]; - var argIsArray = isArray(arg); - var argIsMatrix = isMatrix(arg); - var argType = typeof arg; - var sourceSize = null; - if (isRange(arg)) { - this._dimensions.push(arg); - this._isScalar = false; - } else if (argIsArray || argIsMatrix) { - // create matrix - var m = void 0; - this._isScalar = false; - 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); - } else if (argType === 'number') { - this._dimensions.push(arg); - } else if (argType === 'bigint') { - this._dimensions.push(Number(arg)); - } else if (argType === 'string') { - // object property (arguments.count should be 1) - this._dimensions.push(arg); - } else { - throw new TypeError('Dimension must be an Array, Matrix, number, bigint, 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 (!isNumber(arg[i]) || !isInteger(arg[i])) { - throw new TypeError('Index parameters must be positive integer numbers'); - } - } - // create matrix - var matrix = new ImmutableDenseMatrix(); - matrix._data = arg; - matrix._size = [arg.length]; - return matrix; - } - - /** - * 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] = isString(d) || isNumber(d) ? 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] = isString(range) || isNumber(range) ? 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] = isString(range) || isNumber(range) ? 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) { - var _this$_dimensions$dim; - if (!isNumber(dim)) { - return null; - } - return (_this$_dimensions$dim = this._dimensions[dim]) !== null && _this$_dimensions$dim !== void 0 ? _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 && isString(this._dimensions[0]); - }; - - /** - * 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(isString(dimension) || isNumber(dimension) ? 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 (isString(dimension)) { - 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/node_modules/mathjs/lib/esm/type/matrix/Range.js b/node_modules/mathjs/lib/esm/type/matrix/Range.js deleted file mode 100644 index 1d12447..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/Range.js +++ /dev/null @@ -1,314 +0,0 @@ -import { isBigInt, isBigNumber } from '../../utils/is.js'; -import { format, sign, nearlyEqual } 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 of numbers. 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) - * - * Note that the endpoints and step may be specified with other numeric - * types such as bigint or BigNumber, but they will be demoted to the - * built-in `number` type and the Range will only contain numbers. The - * rationale for this demotion is that Range objects are primarily used - * for indexing Matrix objects, and Matrix objects may only be indexed - * with `number`s. - * - * 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' && !isBigInt(start)) { - throw new TypeError('Parameter start must be a number or bigint'); - } - } - if (hasEnd) { - if (isBigNumber(end)) { - end = end.toNumber(); - } else if (typeof end !== 'number' && !isBigInt(end)) { - throw new TypeError('Parameter end must be a number or bigint'); - } - } - if (hasStep) { - if (isBigNumber(step)) { - step = step.toNumber(); - } else if (typeof step !== 'number' && !isBigInt(step)) { - throw new TypeError('Parameter step must be a number or bigint'); - } - } - this.start = hasStart ? parseFloat(start) : 0; - this.end = hasEnd ? parseFloat(end) : 0; - this.step = hasStep ? parseFloat(step) : 1; - if (hasStep && nearlyEqual(this.step, 0)) { - throw new Error('Step must not be zero'); - } - } - - /** - * 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/node_modules/mathjs/lib/esm/type/matrix/Spa.js b/node_modules/mathjs/lib/esm/type/matrix/Spa.js deleted file mode 100644 index 20f2750..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/Spa.js +++ /dev/null @@ -1,136 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js b/node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js deleted file mode 100644 index f9b7f28..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/SparseMatrix.js +++ /dev/null @@ -1,1513 +0,0 @@ -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 (currently) implements 2D - * matrices only via the format known as - * [Compressed Column Storage](https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_(CSC_or_CCS)). - * - * The structure/invariants of the internal data should be: - * 1. _values is an array of the nonzero values in order from top to bottom - * (of each column), left to right. - * 2. _index is an array of row numbers, of the same length as and - * corresponding positionally to _values. - * 3. _ptr is an array of length one more than the number of columns. For j - * less than the number of columns, the "half-open" span of indices - * _ptr[j] to _ptr[j+1] (i.e. including _ptr[j] if it is less than - * _ptr[j+1], but never including _ptr[j+1]) are the indices in _values - * of the nonzero elements in column j. Note there are no nonzero elements - * in column j exactly when _ptr[j] === _ptr[j+1], and that the final - * entry in _ptr is always exactly the number of nonzero entries in the - * matrix. - * 4. _size is a length-2 array consisting of the number of rows followed by - * the number of columns. - * 5. _datatype, if set, is the mathjs typeOf value of all entries of the - * SparseMatrix. - * @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 - while (matrix._ptr.length <= columns) { - 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 - function rowsCallback(i, r) { - // update permutation vector - pv[i] = r[0]; - // mark i in workspace - w[i] = true; - } - if (Number.isInteger(rows)) rowsCallback(rows, [0]);else rows.forEach(rowsCallback); - - // result matrix arrays - var values = mvalues ? [] : undefined; - var index = []; - var ptr = []; - - // loop columns in result matrix - function columnsCallback(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]); - } - } - } - } - if (Number.isInteger(columns)) columnsCallback(columns);else columns.forEach(columnsCallback); - // 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); - _forEachIndex(range, (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); - _forEachIndex(firstDimensionRange, (firstDataIndex, firstSubIndex) => { - validateIndex(firstDataIndex); - _forEachIndex(secondDimensionRange, (secondDataIndex, secondSubIndex) => { - validateIndex(secondDataIndex); - matrix.set([firstDataIndex, secondDataIndex], submatrix[firstSubIndex[0]][secondSubIndex[0]], defaultValue); - }); - }); - } - } - return matrix; - function _forEachIndex(index, callback) { - // iterate cases where index is a Matrix or a Number - if (isNumber(index)) callback(index, [0]);else index.forEach(callback); - } - } - - /** - * 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.fn(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 - // TODO apply a non indexed version of algorithm in case fastCallback is not optimized - fastCallback.fn(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.fn(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/node_modules/mathjs/lib/esm/type/matrix/function/index.js b/node_modules/mathjs/lib/esm/type/matrix/function/index.js deleted file mode 100644 index 98309f6..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/function/index.js +++ /dev/null @@ -1,72 +0,0 @@ -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 - * - * History: - * - * v? Created - * v2 Dropped support for `[start, end, step]` arguments in favor - * of lists of arbitrary values; added support for Range - * objects. - * v11.10 Added support for arrays of booleans as indices. - * - * @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/node_modules/mathjs/lib/esm/type/matrix/function/matrix.js b/node_modules/mathjs/lib/esm/type/matrix/function/matrix.js deleted file mode 100644 index dc449cf..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/function/matrix.js +++ /dev/null @@ -1,88 +0,0 @@ -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 - * - * History: - * - * v0.5 Created - * v1.5 Support dense or sparse Matrix types; allow construction - * from string, Array, or another Matrix. - * - * @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/node_modules/mathjs/lib/esm/type/matrix/function/sparse.js b/node_modules/mathjs/lib/esm/type/matrix/function/sparse.js deleted file mode 100644 index 4b72de8..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/function/sparse.js +++ /dev/null @@ -1,60 +0,0 @@ -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 - * - * History: - * - * v1.5 Created - * - * @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/node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js b/node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js deleted file mode 100644 index 4afb20e..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/broadcast.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js deleted file mode 100644 index 327948c..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo01xDSid.js +++ /dev/null @@ -1,112 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js deleted file mode 100644 index 82e4042..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo02xDS0.js +++ /dev/null @@ -1,116 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js deleted file mode 100644 index b06d8b7..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo03xDSf.js +++ /dev/null @@ -1,122 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js deleted file mode 100644 index ee1ce13..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo04xSidSid.js +++ /dev/null @@ -1,179 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js deleted file mode 100644 index e28e182..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo05xSfSf.js +++ /dev/null @@ -1,171 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js deleted file mode 100644 index 974ec52..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo06xS0S0.js +++ /dev/null @@ -1,153 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js deleted file mode 100644 index 5399560..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo07xSSf.js +++ /dev/null @@ -1,115 +0,0 @@ -import { factory } from '../../../utils/factory.js'; -import { DimensionError } from '../../../error/DimensionError.js'; -var name = 'matAlgo07xSSf'; -var dependencies = ['typed', 'SparseMatrix']; -export var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => { - var { - typed, - SparseMatrix - } = _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} SparseMatrix (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(); - 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); - } - 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; - var zero = 0; - var cf = callback; - - // process data types - if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') { - dt = adt; - zero = typed.convert(0, dt); - cf = typed.find(callback, [dt, dt]); - } - - // result arrays for sparse format - var cvalues = []; - var cindex = []; - var cptr = new Array(columns + 1).fill(0); // Start with column pointer array - - // workspaces - var xa = []; - var xb = []; - var wa = []; - var wb = []; - - // loop columns - for (var j = 0; j < columns; j++) { - var mark = j + 1; - var nonZeroCount = 0; - _scatter(a, j, wa, xa, mark); - _scatter(b, j, wb, xb, mark); - - // loop rows - for (var i = 0; i < rows; i++) { - var va = wa[i] === mark ? xa[i] : zero; - var vb = wb[i] === mark ? xb[i] : zero; - - // invoke callback - var cij = cf(va, vb); - // Store all non zero and true values - if (cij !== 0 && cij !== false) { - cindex.push(i); // row index - cvalues.push(cij); // computed value - nonZeroCount++; - } - } - - // Update column pointer with cumulative count of non-zero values - cptr[j + 1] = cptr[j] + nonZeroCount; - } - - // Return the result as a sparse matrix - return new SparseMatrix({ - values: cvalues, - index: cindex, - ptr: cptr, - 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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js deleted file mode 100644 index 4fb4909..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo08xS0Sid.js +++ /dev/null @@ -1,154 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js deleted file mode 100644 index 0677453..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo09xS0Sf.js +++ /dev/null @@ -1,142 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js deleted file mode 100644 index 0c6a632..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo10xSids.js +++ /dev/null @@ -1,105 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js deleted file mode 100644 index 08b0997..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo11xS0s.js +++ /dev/null @@ -1,103 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js deleted file mode 100644 index d702faa..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo12xSfs.js +++ /dev/null @@ -1,105 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js deleted file mode 100644 index afd55fa..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo13xDD.js +++ /dev/null @@ -1,94 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js deleted file mode 100644 index 7c54e55..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matAlgo14xDs.js +++ /dev/null @@ -1,76 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js b/node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js deleted file mode 100644 index 1814a79..0000000 --- a/node_modules/mathjs/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js +++ /dev/null @@ -1,152 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/number.js b/node_modules/mathjs/lib/esm/type/number.js deleted file mode 100644 index b45212f..0000000 --- a/node_modules/mathjs/lib/esm/type/number.js +++ /dev/null @@ -1,150 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/resultset/ResultSet.js b/node_modules/mathjs/lib/esm/type/resultset/ResultSet.js deleted file mode 100644 index 60f2f69..0000000 --- a/node_modules/mathjs/lib/esm/type/resultset/ResultSet.js +++ /dev/null @@ -1,68 +0,0 @@ -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.map(String).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/node_modules/mathjs/lib/esm/type/string.js b/node_modules/mathjs/lib/esm/type/string.js deleted file mode 100644 index 91a5d6e..0000000 --- a/node_modules/mathjs/lib/esm/type/string.js +++ /dev/null @@ -1,58 +0,0 @@ -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 - * - * History: - * - * v0.9 Created - * - * @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/node_modules/mathjs/lib/esm/type/unit/Unit.js b/node_modules/mathjs/lib/esm/type/unit/Unit.js deleted file mode 100644 index af540eb..0000000 --- a/node_modules/mathjs/lib/esm/type/unit/Unit.js +++ /dev/null @@ -1,3987 +0,0 @@ -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; - var fixPrefixDefault = false; - var skipAutomaticSimplificationDefault = true; - - /** - * 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 = fixPrefixDefault; // 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 = skipAutomaticSimplificationDefault; - 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(one(other.value)) : this.value; - var valOther = other.value === null ? other._normalize(one(this.value)) : 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(one(other.value)) : this.value; - var valOther = other.value === null ? other._normalize(one(this.value)) : 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; - } - } - - /** - * Create a value one with the numeric type of `typeOfValue`. - * For example, `one(new BigNumber(3))` returns `BigNumber(1)` - * @param {number | Fraction | BigNumber} typeOfValue - * @returns {number | Fraction | BigNumber} - */ - function one(typeOfValue) { - // TODO: this is a workaround to prevent the following BigNumber conversion error from throwing: - // "TypeError: Cannot implicitly convert a number with >15 significant digits to BigNumber" - // see https://github.com/josdejong/mathjs/issues/3450 - // https://github.com/josdejong/mathjs/pull/3375 - var convert = Unit._getNumberConverter(typeOf(typeOfValue)); - return convert(1); - } - - /** - * 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, "skipSimp": true}` - */ - Unit.prototype.toJSON = function () { - return { - mathjs: 'Unit', - value: this._denormalize(this.value), - unit: this.units.length > 0 ? this.formatUnits() : null, - fixPrefix: this.fixPrefix, - skipSimp: this.skipAutomaticSimplification - }; - }; - - /** - * 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, _json$fixPrefix, _json$skipSimp; - var unit = new Unit(json.value, (_json$unit = json.unit) !== null && _json$unit !== void 0 ? _json$unit : undefined); - unit.fixPrefix = (_json$fixPrefix = json.fixPrefix) !== null && _json$fixPrefix !== void 0 ? _json$fixPrefix : fixPrefixDefault; - unit.skipAutomaticSimplification = (_json$skipSimp = json.skipSimp) !== null && _json$skipSimp !== void 0 ? _json$skipSimp : skipAutomaticSimplificationDefault; - 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 unit, with optional formatting options. - * @memberof Unit - * @param {string[] | Unit[]} [units] Array of units strings or valueLess Unit objects in wich choose the best one - * @param {Object} [options] Options for parsing the unit. See parseUnit for details. - * - * @return {Unit} Returns a new Unit with the given value and unit. - */ - Unit.prototype.toBest = function () { - var unitList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (unitList && !Array.isArray(unitList)) { - throw new Error('Invalid unit type. Expected string or Unit.'); - } - var startPrefixes = this.units[0].unit.prefixes; - if (unitList && unitList.length > 0) { - var unitObjects = unitList.map(u => { - var unit = null; - if (typeof u === 'string') { - unit = Unit.parse(u); - if (!unit) { - throw new Error('Invalid unit type. Expected compatible string or Unit.'); - } - } else if (!isUnit(u)) { - throw new Error('Invalid unit type. Expected compatible string or Unit.'); - } - if (unit === null) { - unit = u.clone(); - } - try { - this.to(unit.formatUnits()); - return unit; - } catch (e) { - throw new Error('Invalid unit type. Expected compatible string or Unit.'); - } - }); - var prefixes = unitObjects.map(el => el.units[0].prefix); - this.units[0].unit.prefixes = prefixes.reduce((acc, prefix) => { - acc[prefix.name] = prefix; - return acc; - }, {}); - this.units[0].prefix = prefixes[0]; - } - var result = formatBest(this, options).simp; - this.units[0].unit.prefixes = startPrefixes; - result.fixPrefix = true; - return result; - }; - /** - * 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) { - var { - simp, - valueStr, - unitStr - } = formatBest(this, options); - var str = valueStr; - 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; - }; - - /** - * Helper function to normalize a unit for conversion and formatting - * @param {Unit} unit The unit to be normalized - * @return {Object} Object with normalized unit and value - * @private - */ - function formatBest(unit) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - // 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 = unit.skipAutomaticSimplification || unit.value === null ? unit.clone() : unit.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. - handleVAandVARUnits(simp); - // Now apply the best prefix - // Units must have only one unit and not have the fixPrefix flag set - applyBestPrefixIfNeeded(simp, options.offset); - var value = simp._denormalize(simp.value); - var valueStr = simp.value !== null ? format(value, options || {}) : ''; - var unitStr = simp.formatUnits(); - return { - simp, - valueStr, - unitStr - }; - } - - /** - * Helper to handle VA and VAR units - * @param {Unit} simp The unit to be normalized - */ - function handleVAandVARUnits(simp) { - 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; - } - } - } - } - } - - /** - * Helper to apply the best prefix if needed - * @param {Unit} simp The unit to be normalized - */ - function applyBestPrefixIfNeeded(simp, offset) { - 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(offset); - } - } - } - - /** - * Calculate the best prefix using current value. - * @memberof Unit - * @returns {Object} prefix - * @param {number} [offset] Optional offset for the best prefix calculation (default 1.2) - * @private - */ - Unit.prototype._bestPrefix = function () { - var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.2; - 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 - offset; - 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 - offset); - 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(String(x.n)).div(String(x.d)).times(String(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/node_modules/mathjs/lib/esm/type/unit/function/createUnit.js b/node_modules/mathjs/lib/esm/type/unit/function/createUnit.js deleted file mode 100644 index 5c4624f..0000000 --- a/node_modules/mathjs/lib/esm/type/unit/function/createUnit.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js b/node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js deleted file mode 100644 index f89e59e..0000000 --- a/node_modules/mathjs/lib/esm/type/unit/function/splitUnit.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/mathjs/lib/esm/type/unit/function/unit.js b/node_modules/mathjs/lib/esm/type/unit/function/unit.js deleted file mode 100644 index f42ff4b..0000000 --- a/node_modules/mathjs/lib/esm/type/unit/function/unit.js +++ /dev/null @@ -1,68 +0,0 @@ -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 - * - * History: - * - * v0.5 Created - * v0.16 Support conversion from BigNumber - * v2.5 Support BigNumber and Fraction values in units - * v2.6 Support Complex values in units - * v11.1 Allow the type of unit to be specifed by a unit (not just string) - * - * @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/node_modules/mathjs/lib/esm/type/unit/physicalConstants.js b/node_modules/mathjs/lib/esm/type/unit/physicalConstants.js deleted file mode 100644 index 4697de8..0000000 --- a/node_modules/mathjs/lib/esm/type/unit/physicalConstants.js +++ /dev/null @@ -1,102 +0,0 @@ -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'); // Deprecated in favor of coulombConstant -export var createCoulombConstant = /* #__PURE__ */unitFactory('coulombConstant', '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/node_modules/mathjs/lib/esm/utils/array.js b/node_modules/mathjs/lib/esm/utils/array.js deleted file mode 100644 index 2d759ed..0000000 --- a/node_modules/mathjs/lib/esm/utils/array.js +++ /dev/null @@ -1,932 +0,0 @@ -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 children 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} value 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 an index has empty values - * @param {Index} 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 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 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, true); // since it has rectangular - 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 one 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 dimension 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 - * - * Parameter `size` will be mutated to match the new, unsqueezed 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 unsqueezed 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 - * @param {boolean} isRectangular Optional. If the array is rectangular (not jagged) - * @return {Array} The flattened array (1 dimensional) - */ -export function flatten(array) { - var isRectangular = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - if (!Array.isArray(array)) { - // if not an array, return as is - return array; - } - if (typeof isRectangular !== 'boolean') { - throw new TypeError('Boolean expected for second argument of flatten'); - } - var flat = []; - if (isRectangular) { - _flattenRectangular(array); - } else { - _flatten(array); - } - return flat; - function _flatten(array) { - for (var i = 0; i < array.length; i++) { - var item = array[i]; - if (Array.isArray(item)) { - _flatten(item); - } else { - flat.push(item); - } - } - } - function _flattenRectangular(array) { - if (Array.isArray(array[0])) { - for (var i = 0; i < array.length; i++) { - _flattenRectangular(array[i]); - } - } else { - for (var _i = 0; _i < array.length; _i++) { - flat.push(array[_i]); - } - } - } -} - -/** - * 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 an array 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} array - * @returns {*} - */ -export function last(array) { - return array[array.length - 1]; -} - -/** - * Get all but the last element of array. - * @param {Array} array - * @returns {Array} - */ -export function initial(array) { - return array.slice(0, array.length - 1); -} - -/** - * Recursively concatenate two matrices. - * The contents of the matrices are 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 {Array} - */ -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 gets the broadcasted size for both. - * @param {...number[]} sizes Sizes to broadcast together - * @returns {number[]} The broadcasted size - */ -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 _i2 = 0; _i2 < sizes.length; _i2++) { - checkBroadcastingRules(sizes[_i2], 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 mismatch: mismatch 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 {Array} 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 {Array[]} The broadcasted arrays - */ -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('Insufficient number of arguments 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 {Array} The stretched array - */ -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} index - 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(get(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); -} - -/** - * Recursively maps over each element of nested array using a provided callback function. - * - * @param {Array} array - The array to be mapped. - * @param {Function} callback - The function to execute on each element, taking three arguments: - * - `value` (any): The current element being processed in the array. - * - `index` (Array): The index of the current element being processed in the array. - * - `array` (Array): The array `deepMap` was called upon. - * @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value. - * @returns {Array} A new array with each element being the result of the callback function. - */ -export function deepMap(array, callback) { - var skipIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (array.length === 0) { - return []; - } - if (skipIndex) { - return recursiveMap(array); - } - var index = []; - return recursiveMapWithIndex(array, 0); - function recursiveMapWithIndex(value, depth) { - if (Array.isArray(value)) { - var N = value.length; - var result = Array(N); - for (var i = 0; i < N; i++) { - index[depth] = i; - result[i] = recursiveMapWithIndex(value[i], depth + 1); - } - return result; - } else { - return callback(value, index.slice(0, depth), array); - } - } - function recursiveMap(value) { - if (Array.isArray(value)) { - var N = value.length; - var result = Array(N); - for (var i = 0; i < N; i++) { - result[i] = recursiveMap(value[i]); - } - return result; - } else { - return callback(value); - } - } -} - -/** - * Recursively iterates over each element in a multi-dimensional array and applies a callback function. - * - * @param {Array} array - The multi-dimensional array to iterate over. - * @param {Function} callback - The function to execute for each element. It receives three arguments: - * - {any} value: The current element being processed in the array. - * - {Array} index: The index of the current element in each dimension. - * - {Array} array: The original array being processed. - * @param {boolean} [skipIndex=false] - If true, the callback function is called with only the value. - */ -export function deepForEach(array, callback) { - var skipIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - if (array.length === 0) { - return; - } - if (skipIndex) { - recursiveForEach(array); - return; - } - var index = []; - recursiveForEachWithIndex(array, 0); - function recursiveForEachWithIndex(value, depth) { - if (Array.isArray(value)) { - var N = value.length; - for (var i = 0; i < N; i++) { - index[depth] = i; - recursiveForEachWithIndex(value[i], depth + 1); - } - } else { - callback(value, index.slice(0, depth), array); - } - } - function recursiveForEach(value) { - if (Array.isArray(value)) { - var N = value.length; - for (var i = 0; i < N; i++) { - recursiveForEach(value[i]); - } - } else { - callback(value); - } - } -} - -/** - * Deep clones a multidimensional array - * @param {Array} array - * @returns {Array} cloned array - */ -export function clone(array) { - return _extends([], array); -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/utils/bigint.js b/node_modules/mathjs/lib/esm/utils/bigint.js deleted file mode 100644 index 9e7f844..0000000 --- a/node_modules/mathjs/lib/esm/utils/bigint.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Build a bigint logarithm function from a number logarithm, - * still returning a number. The idea is that 15 hexadecimal digits - * (60 bits) saturates the mantissa of the log, and each additional hex - * digit effectively just adds the log of 16 to the resulting value. So - * convert the most significant 15 hex digits to a number and take its - * log, and then add the log of 16 for each additional hex digit that - * was in the bigint. - * For negative numbers (complex logarithms), following the bignum - * implementation, it just downgrades to number and uses the complex result. - * @param {number} log16 the log of 16 - * @param {(number) -> number} numberLog the logarithm function for numbers - * @param {ConfigurationObject} config the mathjs configuration - * @param {(number) -> Complex} cplx the associated Complex log - * @returns {(bigint) -> number} the corresponding logarithm for bigints - */ -export function promoteLogarithm(log16, numberLog, config, cplx) { - return function (b) { - if (b > 0 || config.predictable) { - if (b <= 0) return NaN; - var s = b.toString(16); - var s15 = s.substring(0, 15); - return log16 * (s.length - s15.length) + numberLog(Number('0x' + s15)); - } - return cplx(b.toNumber()); - }; -} \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js b/node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js deleted file mode 100644 index dbcc60c..0000000 --- a/node_modules/mathjs/lib/esm/utils/bignumber/bitwise.js +++ /dev/null @@ -1,399 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/utils/bignumber/constants.js b/node_modules/mathjs/lib/esm/utils/bignumber/constants.js deleted file mode 100644 index aa69b29..0000000 --- a/node_modules/mathjs/lib/esm/utils/bignumber/constants.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/bignumber/formatter.js b/node_modules/mathjs/lib/esm/utils/bignumber/formatter.js deleted file mode 100644 index d7d3adf..0000000 --- a/node_modules/mathjs/lib/esm/utils/bignumber/formatter.js +++ /dev/null @@ -1,243 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js b/node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js deleted file mode 100644 index 8e4a455..0000000 --- a/node_modules/mathjs/lib/esm/utils/bignumber/nearlyEqual.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/utils/collection.js b/node_modules/mathjs/lib/esm/utils/collection.js deleted file mode 100644 index fab1d28..0000000 --- a/node_modules/mathjs/lib/esm/utils/collection.js +++ /dev/null @@ -1,176 +0,0 @@ -import { isCollection, isMatrix } from './is.js'; -import { IndexError } from '../error/IndexError.js'; -import { arraySize, deepMap as arrayDeepMap, deepForEach as arrayDeepForEach } 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.forEach(x => callback(x), false, true); - } else { - arrayDeepForEach(array, callback, true); - } -} - -/** - * 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 (!skipZeros) { - if (isMatrix(array)) { - return array.map(x => callback(x), false, true); - } else { - return arrayDeepMap(array, callback, true); - } - } - var skipZerosCallback = x => x === 0 ? x : callback(x); - if (isMatrix(array)) { - return array.map(x => skipZerosCallback(x), false, true); - } else { - return arrayDeepMap(array, skipZerosCallback, true); - } -} - -/** - * 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/node_modules/mathjs/lib/esm/utils/complex.js b/node_modules/mathjs/lib/esm/utils/complex.js deleted file mode 100644 index 301c521..0000000 --- a/node_modules/mathjs/lib/esm/utils/complex.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/customs.js b/node_modules/mathjs/lib/esm/utils/customs.js deleted file mode 100644 index 40d18c6..0000000 --- a/node_modules/mathjs/lib/esm/utils/customs.js +++ /dev/null @@ -1,147 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/emitter.js b/node_modules/mathjs/lib/esm/utils/emitter.js deleted file mode 100644 index d9c1fca..0000000 --- a/node_modules/mathjs/lib/esm/utils/emitter.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/factory.js b/node_modules/mathjs/lib/esm/utils/factory.js deleted file mode 100644 index e8babd1..0000000 --- a/node_modules/mathjs/lib/esm/utils/factory.js +++ /dev/null @@ -1,129 +0,0 @@ -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`. For explanation - * of what meta properties can be specified and what they mean, see - * docs/core/extension.md. - * @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/node_modules/mathjs/lib/esm/utils/function.js b/node_modules/mathjs/lib/esm/utils/function.js deleted file mode 100644 index c217b49..0000000 --- a/node_modules/mathjs/lib/esm/utils/function.js +++ /dev/null @@ -1,86 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/utils/is.js b/node_modules/mathjs/lib/esm/utils/is.js deleted file mode 100644 index b0ac39b..0000000 --- a/node_modules/mathjs/lib/esm/utils/is.js +++ /dev/null @@ -1,195 +0,0 @@ -// 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/node_modules/mathjs/lib/esm/utils/latex.js b/node_modules/mathjs/lib/esm/utils/latex.js deleted file mode 100644 index d526078..0000000 --- a/node_modules/mathjs/lib/esm/utils/latex.js +++ /dev/null @@ -1,490 +0,0 @@ -/* 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' - }, - fraction: { - 2: '\\frac{${args[0]}}{${args[1]}}' - }, - 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/node_modules/mathjs/lib/esm/utils/log.js b/node_modules/mathjs/lib/esm/utils/log.js deleted file mode 100644 index 4d265f1..0000000 --- a/node_modules/mathjs/lib/esm/utils/log.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/utils/lruQueue.js b/node_modules/mathjs/lib/esm/utils/lruQueue.js deleted file mode 100644 index 9498439..0000000 --- a/node_modules/mathjs/lib/esm/utils/lruQueue.js +++ /dev/null @@ -1,51 +0,0 @@ -// (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/node_modules/mathjs/lib/esm/utils/map.js b/node_modules/mathjs/lib/esm/utils/map.js deleted file mode 100644 index f44fbba..0000000 --- a/node_modules/mathjs/lib/esm/utils/map.js +++ /dev/null @@ -1,203 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/noop.js b/node_modules/mathjs/lib/esm/utils/noop.js deleted file mode 100644 index dd6e5d9..0000000 --- a/node_modules/mathjs/lib/esm/utils/noop.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/number.js b/node_modules/mathjs/lib/esm/utils/number.js deleted file mode 100644 index 7ddd724..0000000 --- a/node_modules/mathjs/lib/esm/utils/number.js +++ /dev/null @@ -1,726 +0,0 @@ -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 Number.isFinite(value) ? value === Math.round(value) : false; -} - -/** - * 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') { - try { - BigInt(numberStr); - } catch (_unused) { - 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 (Number.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) || !Number.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) || !Number.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) || !Number.isFinite(Number(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) || !Number.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; -} - -/** - * 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 (!Number.isFinite(a) || !Number.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/node_modules/mathjs/lib/esm/utils/object.js b/node_modules/mathjs/lib/esm/utils/object.js deleted file mode 100644 index 8ead1b6..0000000 --- a/node_modules/mathjs/lib/esm/utils/object.js +++ /dev/null @@ -1,376 +0,0 @@ -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); - } - if (type === 'function') { - // we assume that the function is immutable - return x; - } - 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/node_modules/mathjs/lib/esm/utils/optimizeCallback.js b/node_modules/mathjs/lib/esm/utils/optimizeCallback.js deleted file mode 100644 index 0e3ba03..0000000 --- a/node_modules/mathjs/lib/esm/utils/optimizeCallback.js +++ /dev/null @@ -1,164 +0,0 @@ -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. - * @param {boolean} isUnary If true, the callback function is unary and will be optimized as such. - * @returns {Function} Returns a simplified version of the callback function. - */ -export function optimizeCallback(callback, array, name, isUnary) { - if (typed.isTypedFunction(callback)) { - var numberOfArguments; - if (isUnary) { - numberOfArguments = 1; - } else { - var size = array.isMatrix ? array.size() : arraySize(array); - - // Check the size of the last dimension to see if the array/matrix is empty - var isEmpty = size.length ? size[size.length - 1] === 0 : true; - if (isEmpty) { - // don't optimize callbacks for empty arrays/matrix, as they will never be called - // and in fact will throw an exception when we try to access the first element below - return { - isUnary, - fn: callback - }; - } - var firstIndex = size.map(() => 0); - var firstValue = array.isMatrix ? array.get(firstIndex) : get(array, firstIndex); - numberOfArguments = _findNumberOfArgumentsTyped(callback, firstValue, firstIndex, array); - } - var fastCallback; - if (array.isMatrix && array.dataType !== 'mixed' && array.dataType !== undefined) { - var singleSignature = _findSingleSignatureWithArity(callback, numberOfArguments); - fastCallback = singleSignature !== undefined ? singleSignature : callback; - } else { - fastCallback = callback; - } - if (numberOfArguments >= 1 && numberOfArguments <= 3) { - return { - isUnary: numberOfArguments === 1, - fn: function fn() { - 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 { - isUnary: false, - fn: function fn() { - 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); - } - }; - } - if (isUnary === undefined) { - return { - isUnary: _findIfCallbackIsUnary(callback), - fn: callback - }; - } else { - return { - isUnary, - fn: callback - }; - } -} -function _findSingleSignatureWithArity(callback, arity) { - var matchingFunctions = []; - Object.entries(callback.signatures).forEach(_ref => { - var [signature, func] = _ref; - if (signature.split(',').length === arity) { - matchingFunctions.push(func); - } - }); - if (matchingFunctions.length === 1) { - return matchingFunctions[0]; - } -} - -/** - * Determines if a given callback function is unary (i.e., takes exactly one argument). - * - * This function checks the following conditions to determine if the callback is unary: - * 1. The callback function should have exactly one parameter. - * 2. The callback function should not use the `arguments` object. - * 3. The callback function should not use rest parameters (`...`). - * If in doubt, this function shall return `false` to be safe - * - * @param {Function} callback - The callback function to be checked. - * @returns {boolean} - Returns `true` if the callback is unary, otherwise `false`. - */ -function _findIfCallbackIsUnary(callback) { - if (callback.length !== 1) return false; - var callbackStr = callback.toString(); - // Check if the callback function uses `arguments` - if (/arguments/.test(callbackStr)) return false; - - // Extract the parameters of the callback function - var paramsStr = callbackStr.match(/\(.*?\)/); - // Check if the callback function uses rest parameters - if (/\.\.\./.test(paramsStr)) return false; - return true; -} -function _findNumberOfArgumentsTyped(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/node_modules/mathjs/lib/esm/utils/print.js b/node_modules/mathjs/lib/esm/utils/print.js deleted file mode 100644 index 05e9b8d..0000000 --- a/node_modules/mathjs/lib/esm/utils/print.js +++ /dev/null @@ -1 +0,0 @@ -export var printTemplate = /\$([\w.]+)/g; \ No newline at end of file diff --git a/node_modules/mathjs/lib/esm/utils/product.js b/node_modules/mathjs/lib/esm/utils/product.js deleted file mode 100644 index 6986783..0000000 --- a/node_modules/mathjs/lib/esm/utils/product.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @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/node_modules/mathjs/lib/esm/utils/scope.js b/node_modules/mathjs/lib/esm/utils/scope.js deleted file mode 100644 index 5b306d9..0000000 --- a/node_modules/mathjs/lib/esm/utils/scope.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/mathjs/lib/esm/utils/snapshot.js b/node_modules/mathjs/lib/esm/utils/snapshot.js deleted file mode 100644 index 48c09b2..0000000 --- a/node_modules/mathjs/lib/esm/utils/snapshot.js +++ /dev/null @@ -1,234 +0,0 @@ -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$meta$formerl, _factory$meta; - 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'; - var former = (_factory$meta$formerl = (_factory$meta = factory.meta) === null || _factory$meta === void 0 ? void 0 : _factory$meta.formerly) !== null && _factory$meta$formerl !== void 0 ? _factory$meta$formerl : ''; - allFactoryFunctions[factoryName] = 'function'; - allFunctionsConstantsClasses[name] = validateTypeOf(math[name]); - if (former) { - allFunctionsConstantsClasses[former] = allFunctionsConstantsClasses[name]; - } - allDependencyCollections[dependenciesName] = 'Object'; - if (isTransformFunction) { - allTransformFunctions[name] = 'function'; - if (former) allTransformFunctions[former] = 'function'; - } - if (isClass) { - if (endsWith(name, 'Node')) { - allNodeClasses[name] = 'function'; - } else { - allClasses[name] = 'function'; - } - } else { - allFunctionsConstants[name] = validateTypeOf(math[name]); - if (former) allFunctionsConstants[former] = allFunctionsConstants[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', 'addScalar', 'subtractScalar', 'multiplyScalar', 'print', 'divideScalar', 'parse', 'compile', 'parser', 'chain', 'coulomb', '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/node_modules/mathjs/lib/esm/utils/string.js b/node_modules/mathjs/lib/esm/utils/string.js deleted file mode 100644 index 19c68f3..0000000 --- a/node_modules/mathjs/lib/esm/utils/string.js +++ /dev/null @@ -1,194 +0,0 @@ -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 "".concat(value.s * value.n, "/").concat(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 === 'bigint' && typeof value.n === 'bigint' && typeof value.d === 'bigint' || 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/node_modules/mathjs/lib/esm/utils/switch.js b/node_modules/mathjs/lib/esm/utils/switch.js deleted file mode 100644 index 3d70271..0000000 --- a/node_modules/mathjs/lib/esm/utils/switch.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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/node_modules/mathjs/lib/esm/version.js b/node_modules/mathjs/lib/esm/version.js deleted file mode 100644 index fa12e39..0000000 --- a/node_modules/mathjs/lib/esm/version.js +++ /dev/null @@ -1,3 +0,0 @@ -export var version = '15.1.1'; -// 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/node_modules/mathjs/package.json b/node_modules/mathjs/package.json deleted file mode 100644 index 07653a8..0000000 --- a/node_modules/mathjs/package.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "name": "mathjs", - "version": "15.1.1", - "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.26.10", - "complex.js": "^2.2.5", - "decimal.js": "^10.4.3", - "escape-latex": "^1.2.0", - "fraction.js": "^5.2.1", - "javascript-natural-sort": "^0.7.1", - "seedrandom": "^3.0.5", - "tiny-emitter": "^2.1.0", - "typed-function": "^4.2.1" - }, - "devDependencies": { - "@babel/core": "7.29.0", - "@babel/plugin-transform-object-assign": "7.27.1", - "@babel/plugin-transform-optional-catch-binding": "7.28.6", - "@babel/plugin-transform-runtime": "7.29.0", - "@babel/preset-env": "7.29.0", - "@babel/register": "7.28.6", - "@types/assert": "1.5.11", - "@types/mocha": "10.0.10", - "@typescript-eslint/eslint-plugin": "8.55.0", - "@typescript-eslint/parser": "8.55.0", - "assert": "2.1.0", - "babel-loader": "10.0.0", - "c8": "10.1.3", - "codecov": "3.8.3", - "del": "8.0.1", - "eigen": "0.2.2", - "es-check": "9.5.4", - "eslint": "8.57.1", - "eslint-config-prettier": "9.1.0", - "eslint-config-standard": "17.1.0", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-mocha": "10.5.0", - "eslint-plugin-n": "16.6.2", - "eslint-plugin-prettier": "5.5.4", - "eslint-plugin-promise": "6.6.0", - "expect-type": "1.3.0", - "expr-eval": "2.0.2", - "fancy-log": "2.0.0", - "glob": "11.0.3", - "gulp": "5.0.1", - "gulp-babel": "8.0.0", - "handlebars": "4.7.8", - "jsep": "1.4.0", - "karma": "6.4.4", - "karma-firefox-launcher": "2.1.3", - "karma-mocha": "2.0.1", - "karma-mocha-reporter": "2.2.5", - "karma-spec-reporter": "0.0.36", - "karma-webdriver-launcher": "1.0.8", - "karma-webpack": "5.0.1", - "mkdirp": "3.0.1", - "mocha": "11.7.5", - "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", - "prettier": "3.8.1", - "process": "0.11.10", - "sinon": "21.0.1", - "sylvester": "0.0.21", - "tinybench": "6.0.0", - "ts-node": "10.9.2", - "typescript": "5.9.3", - "webpack": "5.105.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,cjs,mjs} test/node-tests/**/*.test.{js,cjs,mjs}", - "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:lambdatest": "karma start test/browser-test-config/lambdatest-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/node_modules/mathjs/types/EXPLANATION.md b/node_modules/mathjs/types/EXPLANATION.md deleted file mode 100644 index c58edb2..0000000 --- a/node_modules/mathjs/types/EXPLANATION.md +++ /dev/null @@ -1,66 +0,0 @@ -# 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 example 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/node_modules/mathjs/types/index.d.ts b/node_modules/mathjs/types/index.d.ts deleted file mode 100644 index 7900d3b..0000000 --- a/node_modules/mathjs/types/index.d.ts +++ /dev/null @@ -1,7844 +0,0 @@ -import { Decimal } from 'decimal.js' -import { Fraction } from 'fraction.js' - -export { Fraction } - -export as namespace math - -export type NoLiteralType = T extends number - ? number - : T extends string - ? string - : T extends boolean - ? boolean - : T - -export type MathNumericType = number | BigNumber | bigint | Fraction | Complex -export type MathScalarType = MathNumericType | Unit -export type MathGeneric = T -export type MathArray = T[] | Array> -export type MathCollection = MathArray | Matrix -export type MathType = MathScalarType | MathCollection -export type MathExpression = string | string[] | MathCollection - -// add type for Matrix Callback Function and Matrix Storage Format -export type MatrixStorageFormat = 'dense' | 'sparse' -export type MatrixFromFunctionCallback = ( - index: number[] -) => T - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type FactoryFunction = (scope: MathScope) => T - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type MathScope = - | Record - | MapLike - -// 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< - TObject extends MathNode = MathNode -> extends MathNode { - type: 'AccessorNode' - isAccessorNode: true - object: TObject - index: IndexNode - name: string - optionalChaining: boolean -} -export interface AccessorNodeCtor { - new ( - object: TObject, - index: IndexNode, - optionalChaining?: boolean - ): AccessorNode -} - -export interface ArrayNode< - TItems extends MathNode[] = MathNode[] -> extends MathNode { - type: 'ArrayNode' - isArrayNode: true - items: [...TItems] -} -export interface ArrayNodeCtor { - new ( - items: [...TItems] - ): ArrayNode -} - -export interface AssignmentNode< - TValue extends MathNode = MathNode -> 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< - TExpr extends MathNode = MathNode -> 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< - TDims extends MathNode[] = MathNode[] -> 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< - TContent extends MathNode = MathNode -> 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< - TParams extends MathNode[] = MathNode[] -> 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 - - // Physical constants - atomicMass: Unit - avogadro: Unit - bohrMagneton: Unit - bohrRadius: Unit - boltzmann: Unit - classicalElectronRadius: Unit - conductanceQuantum: Unit - coulomb: Unit - deuteronMass: Unit - efimovFactor: Unit - electricConstant: Unit - electronMass: Unit - elementaryCharge: Unit - faraday: Unit - fermiCoupling: Unit - fineStructure: Unit - firstRadiation: Unit - gasConstant: Unit - gravitationConstant: Unit - gravity: Unit - hartreeEnergy: Unit - inverseConductanceQuantum: Unit - klitzing: Unit - loschmidt: Unit - magneticConstant: Unit - magneticFluxQuantum: Unit - molarMass: Unit - molarMassC12: Unit - molarPlanckConstant: Unit - molarVolume: Unit - neutronMass: Unit - nuclearMagneton: Unit - planckCharge: Unit - planckConstant: Unit - planckLength: Unit - planckMass: Unit - planckTemperature: Unit - planckTime: Unit - protonMass: Unit - quantumOfCirculation: Unit - reducedPlanckConstant: Unit - rydberg: Unit - sackurTetrode: Unit - secondRadiation: Unit - speedOfLight: Unit - stefanBoltzmann: Unit - thomsonCrossSection: Unit - vacuumImpedance: Unit - weakMixingAngle: Unit - wienDisplacement: Unit - - // 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: bigint, denominator: bigint): 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?: MatrixStorageFormat): 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?: MatrixStorageFormat, - dataType?: string - ): Matrix - matrix( - data: MathCollection, - format?: MatrixStorageFormat, - 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[] - - /************************************************************************* - * 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?: MathScope - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ): any - evaluate( - expr: MathExpression[], - scope?: MathScope - // 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?: MathScope): MathNode - resolve( - node: (MathNode | string)[], - // eslint-disable-next-line @typescript-eslint/no-explicit-any - scope?: MathScope - ): MathNode[] - // eslint-disable-next-line @typescript-eslint/no-explicit-any - resolve(node: Matrix, scope?: MathScope): 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 analysis 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: Complex): number - 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(x: T, y: T, ...values: T[]): T - add(x: MathType, y: MathType): MathType - add(x: MathType, y: MathType, ...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 - ceil>(x: U, unit: Unit): U - ceil(x: Unit, unit: Unit): Unit - ceil(x: Unit, n: number | BigNumber, unit: Unit): Unit - ceil>( - x: U, - n: number | BigNumber, - unit: Unit - ): 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 - fix>(x: U, unit: Unit): U - fix(x: Unit, unit: Unit): Unit - fix(x: Unit, n: number | BigNumber, unit: Unit): Unit - fix>( - x: U, - n: number | BigNumber, - unit: Unit - ): 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 - floor>(x: U, unit: Unit): U - floor(x: Unit, unit: Unit): Unit - floor(x: Unit, n: number | BigNumber, unit: Unit): Unit - floor>( - x: U, - n: number | BigNumber, - unit: Unit - ): 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 hypotenuse of the input values. - */ - hypot(...args: T[]): T - hypot(args: T[]): T - - /** - * Create a dense matrix from vectors as individual rows. If you pass column vectors, they will be transposed (but not conjugated!) - * @param rows - a multi-dimensional number array or matrix - */ - matrixFromRows(...rows: Matrix[]): Matrix - matrixFromRows( - ...rows: (T[] | [T][] | Matrix)[] - ): T[][] - - /** - * Create a dense matrix from vectors as individual columns. If you pass row vectors, they will be transposed (but not conjugated!) - * @param cols - a multi-dimensional number array or matrix - */ - matrixFromColumns(...cols: Matrix[]): Matrix - matrixFromColumns( - ...cols: (T[] | [T][] | Matrix)[] - ): T[][] - /** - * 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. - * @param size - the size of the matrix to be created - * @param fn - Callback function invoked for every entry in the matrix - * @param format - The Matrix storage format, either 'dense' or 'sparse' - * @param datatype - Type of the values - */ - matrixFromFunction( - size: [number], - fn: MatrixFromFunctionCallback - ): T[] - matrixFromFunction( - size: [number, number], - fn: MatrixFromFunctionCallback - ): T[][] - matrixFromFunction( - size: number[], - fn: MatrixFromFunctionCallback - ): MathArray - matrixFromFunction( - size: Matrix, - fn: MatrixFromFunctionCallback - ): Matrix - matrixFromFunction( - size: number[] | Matrix, - fn: MatrixFromFunctionCallback, - format: MatrixStorageFormat, - datatype?: string - ): Matrix - matrixFromFunction( - size: number[] | Matrix, - format: MatrixStorageFormat, - fn: MatrixFromFunctionCallback, - datatype?: string - ): Matrix - /** - * 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: T, y: T): MathScalarType - multiply(x: Unit, y: Unit): Unit - multiply(x: number, y: number): number - multiply(x: MathType, y: MathType, ...values: MathType[]): MathType - multiply(x: T, y: T, ...values: T[]): T - - /** - * 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 | Complex, - root?: number | BigNumber - ): number | Complex - nthRoot(M: MathCollection, root?: number | BigNumber): MathCollection - - /** - * Calculate all nth roots of a value. - * @param a Value for which to calculate the nth roots - * @param n Which roots. Default value: 2. - * @return An array of Complex numbers giving the n nth roots of a - */ - nthRoots(a: number | BigNumber | Complex, n?: number): Array - - /** - * 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 Returns 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 Euclidean 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 - - /** - * Nullish coalescing operator (??). Returns the right-hand side operand - * when the left-hand side operand is null or undefined, and otherwise - * returns the left-hand side operand. For matrices, the function is - * evaluated element wise. - * @param x First value to check - * @param y Fallback value - * @returns Returns y when x is null or undefined, otherwise returns x - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - nullish(x: any, y: any): any - - /** - * 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. - */ - mapSlices( - array: T, - dim: number, - callback: (array: MathCollection) => number - ): T - /** - * @deprecated backwards-compatibility old name of mapSlices - */ - apply: MathJsInstance['mapSlices'] - - /** - * 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 - - /** - * 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. - * @param x Matrix to be ctransposed - */ - ctranspose(x: MathCollection): MathCollection - - /** - * Calculate the determinant of a matrix. - * @param x A Matrix - * @returns the determinant of x - */ - det(x: MathCollection): number - - /** - * Calculate the difference between adjacent elements of a matrix or array. - * @param x A matrix or array - * @param dim The dimension to apply the difference on. - * @returns A matrix or array containing the differences - */ - diff(x: T, dim?: number | BigNumber): T - - /** - * 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, - index: number[], - 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: number[], matrix: T) => void - ): void - - /** - * Return the (name of the) data type of the elements of matrix, or 'mixed'. - * @param m the matrix - * @returns A string specifying the data type of the elements of m - */ - getMatrixDataType(m: MathCollection): string - - /** - * Calculate the inverse of a square matrix. - * @param x Matrix to be inverted - * @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 inverted - * @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 nth Bernoulli number - * @param n index - * @returns nth Bernoulli number - */ - bernoulli(n: T): NoLiteralType - bernoulli(n: bigint): Fraction - - /** - * 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 distance 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 coefficient - */ - 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 matrix 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 compare - * @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 compare - * @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 compare - * @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 compare - * @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 compare - * @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 - - /** - * Converts a unit to the most appropriate display unit. - * When no preferred units are provided, the function automatically find the best prefix. - * When preferred units are provided, it converts to - * the unit that gives a value closest to 1. - * @param preferredUnits - Optional preferred target units - * @param options - Optional options object - * @returns Unit with optimized prefix/unit - */ - toBest(): Unit - toBest(units: string[] | Unit[], options: object): Unit - - /************************************************************************* - * 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): x is ResultSet - - 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 bounded - * @param x Value to be tested - * @returns Boolean true when x represents a bounded mathematical entity - */ - isBounded(x: MathType): boolean - - /** - * Test whether a value is finite, elementwise on collections - * @param x Value to be tested - * @returns Boolean | MathCollection - */ - isFinite(x: MathScalarType): boolean - isFinite(A: MathCollection): MathCollection - - /** - * 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 { - // system dependencies - all, - ResultSetDependencies, - FibonacciHeapDependencies, - SpaDependencies, - BigNumberDependencies, - ComplexDependencies, - FractionDependencies, - RangeDependencies, - DenseMatrixDependencies, - ImmutableDenseMatrixDependencies, - SparseMatrixDependencies, - IndexDependencies, - ParserDependencies, - HelpDependencies, - ChainDependencies, - reviverDependencies, - versionDependencies, - - // core function dependencies - typedDependencies, - // create and factory do not have dependencies - - // constant dependencies - eDependencies, - piDependencies, - iDependencies, - InfinityDependencies, - LN2Dependencies, - LN10Dependencies, - LOG2EDependencies, - LOG10EDependencies, - phiDependencies, - SQRT1_2Dependencies, - SQRT2Dependencies, - tauDependencies, - - // physical constant dependencies - 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, - - // constructor dependencies - NodeDependencies, - AccessorNodeDependencies, - ArrayNodeDependencies, - AssignmentNodeDependencies, - BlockNodeDependencies, - ConditionalNodeDependencies, - ConstantNodeDependencies, - FunctionAssignmentNodeDependencies, - FunctionNodeDependencies, - IndexNodeDependencies, - ObjectNodeDependencies, - OperatorNodeDependencies, - ParenthesisNodeDependencies, - RangeNodeDependencies, - RelationalNodeDependencies, - SymbolNodeDependencies, - MatrixDependencies, - UnitDependencies, - - // construction function dependencies - bignumberDependencies, - bigintDependencies, - booleanDependencies, - chainDependencies, - complexDependencies, - createUnitDependencies, - fractionDependencies, - indexDependencies, - matrixDependencies, - numberDependencies, - numericDependencies, - sparseDependencies, - splitUnitDependencies, - stringDependencies, - unitDependencies, - - // expression function dependencies - compileDependencies, - evaluateDependencies, - helpDependencies, - parseDependencies, - parserDependencies, - - // algebra dependencies - derivativeDependencies, - lsolveDependencies, - lupDependencies, - lusolveDependencies, - polynomialRootDependencies, - qrDependencies, - rationalizeDependencies, - simplifyDependencies, - simplifyConstantDependencies, - simplifyCoreDependencies, - symbolicEqualDependencies, - leafCountDependencies, - resolveDependencies, - sluDependencies, - usolveDependencies, - - // arithmetic function dependencies - absDependencies, - addDependencies, - addScalarDependencies, - cbrtDependencies, - ceilDependencies, - cubeDependencies, - divideDependencies, - divideScalarDependencies, - dotDivideDependencies, - dotMultiplyDependencies, - dotPowDependencies, - expDependencies, - expm1Dependencies, - fixDependencies, - floorDependencies, - gcdDependencies, - hypotDependencies, - lcmDependencies, - logDependencies, - log10Dependencies, - log1pDependencies, - log2Dependencies, - matrixFromRowsDependencies, - matrixFromColumnsDependencies, - matrixFromFunctionDependencies, - modDependencies, - multiplyDependencies, - multiplyScalarDependencies, - normDependencies, - nthRootDependencies, - nthRootsDependencies, - powDependencies, - roundDependencies, - signDependencies, - sqrtDependencies, - squareDependencies, - subtractDependencies, - unaryMinusDependencies, - unaryPlusDependencies, - xgcdDependencies, - - // bitwise dependencies - bitAndDependencies, - bitNotDependencies, - bitOrDependencies, - bitXorDependencies, - leftShiftDependencies, - rightArithShiftDependencies, - rightLogShiftDependencies, - - // combinatorics dependencies - bellNumbersDependencies, - catalanDependencies, - compositionDependencies, - stirlingS2Dependencies, - - // complex dependencies - argDependencies, - conjDependencies, - imDependencies, - reDependencies, - - // geometry dependencies - distanceDependencies, - intersectDependencies, - - // logical dependencies - andDependencies, - notDependencies, - nullishDependencies, - orDependencies, - xorDependencies, - - // matrix function dependencies - mapSlicesDependencies, - // array is deprecated - concatDependencies, - crossDependencies, - ctransposeDependencies, - detDependencies, - diffDependencies, - diagDependencies, - dotDependencies, - eigsDependencies, - expmDependencies, - sylvesterDependencies, - schurDependencies, - lyapDependencies, - identityDependencies, - filterDependencies, - flattenDependencies, - forEachDependencies, - getMatrixDataTypeDependencies, - invDependencies, - kronDependencies, - mapDependencies, - onesDependencies, - partitionSelectDependencies, - pinvDependencies, - rangeDependencies, - reshapeDependencies, - resizeDependencies, - rotationMatrixDependencies, - rowDependencies, - columnDependencies, - rotateDependencies, - sizeDependencies, - sortDependencies, - sqrtmDependencies, - squeezeDependencies, - subsetDependencies, - traceDependencies, - transposeDependencies, - zerosDependencies, - fftDependencies, - ifftDependencies, - - // probability dependencies - bernoulliDependencies, - combinationsDependencies, - factorialDependencies, - gammaDependencies, - kldivergenceDependencies, - lgammaDependencies, - multinomialDependencies, - permutationsDependencies, - pickRandomDependencies, - randomDependencies, - randomIntDependencies, - - // relational function dependencies - compareDependencies, - compareNaturalDependencies, - compareTextDependencies, - deepEqualDependencies, - equalDependencies, - equalScalarDependencies, - equalTextDependencies, - largerDependencies, - largerEqDependencies, - smallerDependencies, - smallerEqDependencies, - unequalDependencies, - - // set function dependencies - setCartesianDependencies, - setDifferenceDependencies, - setDistinctDependencies, - setIntersectDependencies, - setIsSubsetDependencies, - setMultiplicityDependencies, - setPowersetDependencies, - setSizeDependencies, - setSymDifferenceDependencies, - setUnionDependencies, - - // signal function dependencies - zpk2tfDependencies, - freqzDependencies, - - // special function dependencies - erfDependencies, - zetaDependencies, - - // statistics function dependencies - madDependencies, - maxDependencies, - meanDependencies, - medianDependencies, - minDependencies, - modeDependencies, - prodDependencies, - quantileSeqDependencies, - stdDependencies, - sumDependencies, - countDependencies, - cumsumDependencies, - varianceDependencies, - corrDependencies, - - // string function dependencies - formatDependencies, - printDependencies, - - // trigonometry function dependencies - 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, - - // unit function dependencies - toDependencies, - toBestDependencies, - - // util function dependencies - isNumberDependencies, - isBigNumberDependencies, - isBigIntDependencies, - isComplexDependencies, - isFractionDependencies, - isUnitDependencies, - isStringDependencies, - isArrayDependencies, - isMatrixDependencies, - isCollectionDependencies, - isDenseMatrixDependencies, - isSparseMatrixDependencies, - isRangeDependencies, - isIndexDependencies, - isBooleanDependencies, - isResultSetDependencies, - isHelpDependencies, - isFunctionDependencies, - isDateDependencies, - isRegExpDependencies, - isObjectDependencies, - isMapDependencies, - isPartitionedMapDependencies, - isObjectWrappingMapDependencies, - isNullDependencies, - isUndefinedDependencies, - isAccessorNodeDependencies, - isArrayNodeDependencies, - isAssignmentNodeDependencies, - isBlockNodeDependencies, - isConditionalNodeDependencies, - isConstantNodeDependencies, - isFunctionAssignmentNodeDependencies, - isFunctionNodeDependencies, - isIndexNodeDependencies, - isNodeDependencies, - isObjectNodeDependencies, - isOperatorNodeDependencies, - isParenthesisNodeDependencies, - isRangeNodeDependencies, - isRelationalNodeDependencies, - isSymbolNodeDependencies, - isChainDependencies, - cloneDependencies, - hasNumericValueDependencies, - isBoundedDependencies, - isFiniteDependencies, - isIntegerDependencies, - isNaNDependencies, - isNegativeDependencies, - isNumericDependencies, - isPositiveDependencies, - isPrimeDependencies, - isZeroDependencies, - typeOfDependencies, - - // Transform dependencies - mapSlicesTransformDependencies, - columnTransformDependencies, - filterTransformDependencies, - forEachTransformDependencies, - indexTransformDependencies, - mapTransformDependencies, - maxTransformDependencies, - meanTransformDependencies, - minTransformDependencies, - rangeTransformDependencies, - rowTransformDependencies, - subsetTransformDependencies, - concatTransformDependencies, - stdTransformDependencies, - sumTransformDependencies, - varianceTransformDependencies, - printTransformDependencies -}: 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 - // 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-object-type -export interface BigNumber extends Decimal {} - -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): Unit - toBest(): Unit - toBest(units?: string[] | Unit[], options?: object): 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?: MathScope, - options?: SimplifyOptions - ): MathNode - ( - expr: MathNode | string, - scope: MathScope, - 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-object-type -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?: MathScope): any -} - -// ResultSet type and helper -export interface ResultSet { - entries: unknown[] - valueOf(): unknown[] - toString(): string - toJSON(): MathJSON -} - -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(scope?: MathScope): 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): 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?: MathScope - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ): MathJsChain - evaluate( - this: MathJsChain, - scope?: MathScope - // 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?: MathScope - ): MathJsChain - resolve( - this: MathJsChain, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - scope?: MathScope - ): 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 - 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. - */ - mapSlices( - this: MathJsChain, - dim: number, - callback: (array: Array | Matrix) => number - ): MathJsChain - /** - * @deprecated backwards-compatibility old name of mapSlices - **/ - apply: MathJsChain['mapSlices'] - - /** - * 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 - ceil( - this: MathJsChain, - n: U - ): MathJsChain - ceil(this: MathJsChain, unit: Unit): MathJsChain - ceil>( - this: MathJsChain, - unit: Unit - ): MathJsChain - ceil( - this: MathJsChain, - n: number | BigNumber, - unit: Unit - ): MathJsChain - ceil>( - this: MathJsChain, - n: number | BigNumber, - unit: Unit - ): 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 - fix( - this: MathJsChain, - n: U - ): MathJsChain - fix(this: MathJsChain, unit: Unit): MathJsChain - fix>( - this: MathJsChain, - unit: Unit - ): MathJsChain - fix( - this: MathJsChain, - n: number | BigNumber, - unit: Unit - ): MathJsChain - fix>( - this: MathJsChain, - n: number | BigNumber, - unit: Unit - ): 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 - floor( - this: MathJsChain, - n: U - ): MathJsChain - floor(this: MathJsChain, unit: Unit): MathJsChain - floor>( - this: MathJsChain, - unit: Unit - ): MathJsChain - floor( - this: MathJsChain, - n: number | BigNumber, - unit: Unit - ): MathJsChain - floor>( - this: MathJsChain, - n: number | BigNumber, - unit: Unit - ): 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 - nthRoot( - this: MathCollection, - root?: number | BigNumber - ): MathJsChain - - /** - * Calculate all nth roots of a value. - * @param n Which root to take. Default value: 2. - */ - nthRoots( - this: MathJsChain, - n?: number - ): 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 - - /** - * Nullish coalescing operator (??). Returns the right-hand side operand - * when the left-hand side operand is null or undefined, and otherwise - * returns the left-hand side operand. For matrices, the function is - * evaluated element wise. - * @param y Fallback value - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - nullish(this: MathJsChain, y: any): 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 - - /** - * 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. - */ - ctranspose(this: MathJsChain): MathJsChain - - /** - * Calculate the difference between adjacent elements of the chained matrix or array. - * @param dim The dimension to apply the difference on. - */ - diff( - this: MathJsChain, - dim?: number | BigNumber - ): 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, - index: number[], - 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: number[], matrix: T) => void - ): void - - /** - * Get the data type in a collection - */ - getMatrixDataType(this: MathJsChain): MathJsChain - - /** - * 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: number[], 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 - ************************************************************************/ - - /** - * Bernoulli number at this index - */ - bernoulli( - this: MathJsChain - ): MathJsChain> - bernoulli(this: MathJsChain): MathJsChain - - /** - * 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 - - /** - * Converts a unit to the most appropriate display unit. - * When no preferred units are provided, the function automatically find the best prefix. - * When preferred units are provided, it converts to - * the unit that gives a value closest to 1. - * @param preferredUnits - Optional preferred target units - * @param options - Optional options object - */ - toBest(this: MathJsChain): MathJsChain - toBest( - this: MathJsChain, - units: string[] | Unit[], - options: object - ): 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 bounded, works on entire collection at once - */ - isBounded(this: MathJsChain): MathJsChain - - /** - * Test whether a value is finite, works elementwise on collections - */ - isFinite(this: MathJsChain): MathJsChain - isFinite(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 interface MapLike { - get(key: TKey): TValue - set(key: TKey, value: TValue): MapLike - has(key: TKey): boolean - keys(): IterableIterator | TKey[] -} - -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, - - // Physical constants - atomicMass, - avogadro, - bohrMagneton, - bohrRadius, - boltzmann, - classicalElectronRadius, - conductanceQuantum, - coulomb, - deuteronMass, - efimovFactor, - electricConstant, - electronMass, - elementaryCharge, - faraday, - fermiCoupling, - fineStructure, - firstRadiation, - gasConstant, - gravitationConstant, - gravity, - hartreeEnergy, - inverseConductanceQuantum, - klitzing, - loschmidt, - magneticConstant, - magneticFluxQuantum, - molarMass, - molarMassC12, - molarPlanckConstant, - molarVolume, - neutronMass, - nuclearMagneton, - planckCharge, - planckConstant, - planckLength, - planckMass, - planckTemperature, - planckTime, - protonMass, - quantumOfCirculation, - reducedPlanckConstant, - rydberg, - sackurTetrode, - secondRadiation, - speedOfLight, - stefanBoltzmann, - thomsonCrossSection, - vacuumImpedance, - weakMixingAngle, - wienDisplacement, - - // 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, - - // Construction functions - bignumber, - bigint, - boolean, - chain, - complex, - createUnit, - fraction, - index, - matrix, - number, - numeric, - sparse, - splitUnit, - string, - unit, - - // Expression functions - 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, - cube, - divide, - dotDivide, - dotMultiply, - dotPow, - exp, - expm1, - fix, - floor, - gcd, - hypot, - lcm, - log, - log10, - log1p, - log2, - matrixFromRows, - matrixFromColumns, - matrixFromFunction, - mod, - multiply, - norm, - nthRoot, - nthRoots, - pow, - round, - 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, - nullish, - or, - xor, - - // matrix functions - mapSlices, - apply, // @deprecated prior name of mapSlices - concat, - cross, - ctranspose, - det, - diff, - diag, - dot, - eigs, - expm, - sylvester, - schur, - lyap, - identity, - filter, - flatten, - forEach, - getMatrixDataType, - inv, - kron, - map, - ones, - partitionSelect, - pinv, - range, - reshape, - resize, - rotationMatrix, - row, - column, - rotate, - size, - sort, - sqrtm, - squeeze, - subset, - trace, - transpose, - zeros, - fft, - ifft, - - // probability - bernoulli, - 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, - - // signal functions - zpk2tf, - freqz, - - // special functions - 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, - toBest, - - // util functions - isNumber, - isBigNumber, - isBigInt, - isComplex, - 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, - clone, - hasNumericValue, - isBounded, - isFinite, - isInteger, - isNaN, - isNegative, - isNumeric, - isPositive, - isPrime, - isZero, - typeOf -}: MathJsInstance diff --git a/node_modules/media-typer/HISTORY.md b/node_modules/media-typer/HISTORY.md index 538ade1..62c2003 100644 --- a/node_modules/media-typer/HISTORY.md +++ b/node_modules/media-typer/HISTORY.md @@ -1,31 +1,3 @@ -1.1.0 / 2019-04-24 -================== - - * Add `test(string)` function - -1.0.2 / 2019-04-19 -================== - - * Fix JSDoc comment for `parse` function - -1.0.1 / 2018-10-20 -================== - - * Remove left over `parameters` property from class - -1.0.0 / 2018-10-20 -================== - -This major release brings the module back to it's RFC 6838 roots. If you want -a module to parse the `Content-Type` or similar HTTP headers, use the -`content-type` module instead. - - * Drop support for Node.js below 0.8 - * Remove parameter handling, which is outside RFC 6838 scope - * Remove `parse(req)` and `parse(res)` signatures - * perf: enable strict mode - * perf: use a class for object creation - 0.3.0 / 2014-09-07 ================== diff --git a/node_modules/media-typer/LICENSE b/node_modules/media-typer/LICENSE index 84441fb..b7dce6c 100644 --- a/node_modules/media-typer/LICENSE +++ b/node_modules/media-typer/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2017 Douglas Christopher Wilson +Copyright (c) 2014 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/node_modules/media-typer/README.md b/node_modules/media-typer/README.md index 37edad1..d8df623 100644 --- a/node_modules/media-typer/README.md +++ b/node_modules/media-typer/README.md @@ -1,45 +1,29 @@ # media-typer -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] -Simple RFC 6838 media type parser. - -This module will parse a given media type into it's component parts, like type, -subtype, and suffix. A formatter is also provided to put them back together and -the two can be combined to normalize media types into a canonical form. - -If you are looking to parse the string that represents a media type and it's -parameters in HTTP (for example, the `Content-Type` header), use the -[content-type module](https://www.npmjs.com/package/content-type). +Simple RFC 6838 media type parser ## Installation -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - ```sh $ npm install media-typer ``` ## API - - ```js var typer = require('media-typer') ``` ### typer.parse(string) - - ```js -var obj = typer.parse('image/svg+xml') +var obj = typer.parse('image/svg+xml; charset=utf-8') ``` Parse a media type string. This will return an object with the following @@ -51,43 +35,47 @@ properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`): - `suffix`: The suffix of the media type (always lower case). Example: `'xml'` -If the given type string is invalid, then a `TypeError` is thrown. + - `parameters`: An object of the parameters in the media type (name of parameter always lower case). Example: `{charset: 'utf-8'}` + +### typer.parse(req) + +```js +var obj = typer.parse(req) +``` + +Parse the `content-type` header from the given `req`. Short-cut for +`typer.parse(req.headers['content-type'])`. + +### typer.parse(res) + +```js +var obj = typer.parse(res) +``` + +Parse the `content-type` header set on the given `res`. Short-cut for +`typer.parse(res.getHeader('content-type'))`. ### typer.format(obj) - - ```js -var obj = typer.format({ type: 'image', subtype: 'svg', suffix: 'xml' }) +var obj = typer.format({type: 'image', subtype: 'svg', suffix: 'xml'}) ``` Format an object into a media type string. This will return a string of the mime type for the given object. For the properties of the object, see the documentation for `typer.parse(string)`. -If any of the given object values are invalid, then a `TypeError` is thrown. - -### typer.test(string) - - - -```js -var valid = typer.test('image/svg+xml') -``` - -Validate a media type string. This will return `true` is the string is a well- -formatted media type, or `false` otherwise. - ## License [MIT](LICENSE) -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/media-typer/master -[coveralls-url]: https://coveralls.io/r/jshttp/media-typer?branch=master -[node-version-image]: https://badgen.net/npm/node/media-typer -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/media-typer +[npm-image]: https://img.shields.io/npm/v/media-typer.svg?style=flat [npm-url]: https://npmjs.org/package/media-typer -[npm-version-image]: https://badgen.net/npm/v/media-typer -[travis-image]: https://badgen.net/travis/jshttp/media-typer/master +[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/media-typer.svg?style=flat [travis-url]: https://travis-ci.org/jshttp/media-typer +[coveralls-image]: https://img.shields.io/coveralls/jshttp/media-typer.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/media-typer +[downloads-image]: https://img.shields.io/npm/dm/media-typer.svg?style=flat +[downloads-url]: https://npmjs.org/package/media-typer diff --git a/node_modules/media-typer/index.js b/node_modules/media-typer/index.js index 897cae1..07f7295 100644 --- a/node_modules/media-typer/index.js +++ b/node_modules/media-typer/index.js @@ -1,10 +1,48 @@ /*! * media-typer - * Copyright(c) 2014-2017 Douglas Christopher Wilson + * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ -'use strict' +/** + * RegExp to match *( ";" parameter ) in RFC 2616 sec 3.7 + * + * parameter = token "=" ( token | quoted-string ) + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) + * qdtext = > + * quoted-pair = "\" CHAR + * CHAR = + * TEXT = + * LWS = [CRLF] 1*( SP | HT ) + * CRLF = CR LF + * CR = + * LF = + * SP = + * SHT = + * CTL = + * OCTET = + */ +var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g; +var textRegExp = /^[\u0020-\u007e\u0080-\u00ff]+$/ +var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/ + +/** + * RegExp to match quoted-pair in RFC 2616 + * + * quoted-pair = "\" CHAR + * CHAR = + */ +var qescRegExp = /\\([\u0000-\u007f])/g; + +/** + * RegExp to match chars that must be quoted-pair in RFC 2616 + */ +var quoteRegExp = /([\\"])/g; /** * RegExp to match type in RFC 6838 @@ -22,9 +60,9 @@ * ALPHA = %x41-5A / %x61-7A ; A-Z / a-z * DIGIT = %x30-39 ; 0-9 */ -var SUBTYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ -var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ -var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/ +var subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/ +var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/ +var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/; /** * Module exports. @@ -32,30 +70,30 @@ var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za- exports.format = format exports.parse = parse -exports.test = test /** * Format object to media type. * * @param {object} obj * @return {string} - * @public + * @api public */ -function format (obj) { +function format(obj) { if (!obj || typeof obj !== 'object') { throw new TypeError('argument obj is required') } + var parameters = obj.parameters var subtype = obj.subtype var suffix = obj.suffix var type = obj.type - if (!type || !TYPE_NAME_REGEXP.test(type)) { + if (!type || !typeNameRegExp.test(type)) { throw new TypeError('invalid type') } - if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) { + if (!subtype || !subtypeNameRegExp.test(subtype)) { throw new TypeError('invalid subtype') } @@ -64,54 +102,148 @@ function format (obj) { // append +suffix if (suffix) { - if (!TYPE_NAME_REGEXP.test(suffix)) { + if (!typeNameRegExp.test(suffix)) { throw new TypeError('invalid suffix') } string += '+' + suffix } + // append parameters + if (parameters && typeof parameters === 'object') { + var param + var params = Object.keys(parameters).sort() + + for (var i = 0; i < params.length; i++) { + param = params[i] + + if (!tokenRegExp.test(param)) { + throw new TypeError('invalid parameter name') + } + + string += '; ' + param + '=' + qstring(parameters[param]) + } + } + return string } -/** - * Test media type. - * - * @param {string} string - * @return {object} - * @public - */ - -function test (string) { - if (!string) { - throw new TypeError('argument string is required') - } - - if (typeof string !== 'string') { - throw new TypeError('argument string is required to be a string') - } - - return TYPE_REGEXP.test(string.toLowerCase()) -} - /** * Parse media type to object. * - * @param {string} string - * @return {object} - * @public + * @param {string|object} string + * @return {Object} + * @api public */ -function parse (string) { +function parse(string) { if (!string) { throw new TypeError('argument string is required') } + // support req/res-like objects as argument + if (typeof string === 'object') { + string = getcontenttype(string) + } + if (typeof string !== 'string') { throw new TypeError('argument string is required to be a string') } - var match = TYPE_REGEXP.exec(string.toLowerCase()) + var index = string.indexOf(';') + var type = index !== -1 + ? string.substr(0, index) + : string + + var key + var match + var obj = splitType(type) + var params = {} + var value + + paramRegExp.lastIndex = index + + while (match = paramRegExp.exec(string)) { + if (match.index !== index) { + throw new TypeError('invalid parameter format') + } + + index += match[0].length + key = match[1].toLowerCase() + value = match[2] + + if (value[0] === '"') { + // remove quotes and escapes + value = value + .substr(1, value.length - 2) + .replace(qescRegExp, '$1') + } + + params[key] = value + } + + if (index !== -1 && index !== string.length) { + throw new TypeError('invalid parameter format') + } + + obj.parameters = params + + return obj +} + +/** + * Get content-type from req/res objects. + * + * @param {object} + * @return {Object} + * @api private + */ + +function getcontenttype(obj) { + if (typeof obj.getHeader === 'function') { + // res-like + return obj.getHeader('content-type') + } + + if (typeof obj.headers === 'object') { + // req-like + return obj.headers && obj.headers['content-type'] + } +} + +/** + * Quote a string if necessary. + * + * @param {string} val + * @return {string} + * @api private + */ + +function qstring(val) { + var str = String(val) + + // no need to quote tokens + if (tokenRegExp.test(str)) { + return str + } + + if (str.length > 0 && !textRegExp.test(str)) { + throw new TypeError('invalid parameter value') + } + + return '"' + str.replace(quoteRegExp, '\\$1') + '"' +} + +/** + * Simply "type/subtype+siffx" into parts. + * + * @param {string} string + * @return {Object} + * @api private + */ + +function splitType(string) { + var match = typeRegExp.exec(string.toLowerCase()) if (!match) { throw new TypeError('invalid media type') @@ -128,16 +260,11 @@ function parse (string) { subtype = subtype.substr(0, index) } - return new MediaType(type, subtype, suffix) -} + var obj = { + type: type, + subtype: subtype, + suffix: suffix + } -/** - * Class for MediaType object. - * @public - */ - -function MediaType (type, subtype, suffix) { - this.type = type - this.subtype = subtype - this.suffix = suffix + return obj } diff --git a/node_modules/media-typer/package.json b/node_modules/media-typer/package.json index 1dca712..8cf3ebc 100644 --- a/node_modules/media-typer/package.json +++ b/node_modules/media-typer/package.json @@ -1,20 +1,14 @@ { "name": "media-typer", "description": "Simple RFC 6838 media type parser and formatter", - "version": "1.1.0", + "version": "0.3.0", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "jshttp/media-typer", "devDependencies": { - "eslint": "5.16.0", - "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.17.2", - "eslint-plugin-markdown": "1.0.0", - "eslint-plugin-node": "8.0.1", - "eslint-plugin-promise": "4.1.1", - "eslint-plugin-standard": "4.0.0", - "mocha": "6.1.4", - "nyc": "14.0.0" + "istanbul": "0.3.2", + "mocha": "~1.21.4", + "should": "~4.0.4" }, "files": [ "LICENSE", @@ -22,12 +16,11 @@ "index.js" ], "engines": { - "node": ">= 0.8" + "node": ">= 0.6" }, "scripts": { - "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "test-travis": "nyc --reporter=text npm test" + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" } } diff --git a/node_modules/merge-descriptors/HISTORY.md b/node_modules/merge-descriptors/HISTORY.md new file mode 100644 index 0000000..486771f --- /dev/null +++ b/node_modules/merge-descriptors/HISTORY.md @@ -0,0 +1,21 @@ +1.0.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.0.0 / 2015-03-01 +================== + + * Add option to only add new descriptors + * Add simple argument validation + * Add jsdoc to source file + +0.0.2 / 2013-12-14 +================== + + * Move repository to `component` organization + +0.0.1 / 2013-10-29 +================== + + * Initial release diff --git a/node_modules/merge-descriptors/index.d.ts b/node_modules/merge-descriptors/index.d.ts deleted file mode 100644 index df8f91f..0000000 --- a/node_modules/merge-descriptors/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** -Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. - -@param destination - The object to receive properties. -@param source - The object providing properties. -@param overwrite - Optional boolean to control overwriting of existing properties. Defaults to true. -@returns The modified destination object. -*/ -declare function mergeDescriptors(destination: T, source: U, overwrite?: boolean): T & U; - -export = mergeDescriptors; diff --git a/node_modules/merge-descriptors/index.js b/node_modules/merge-descriptors/index.js index 51228e5..f22ebab 100644 --- a/node_modules/merge-descriptors/index.js +++ b/node_modules/merge-descriptors/index.js @@ -1,26 +1,60 @@ -'use strict'; +/*! + * merge-descriptors + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ -function mergeDescriptors(destination, source, overwrite = true) { - if (!destination) { - throw new TypeError('The `destination` argument is required.'); - } +'use strict' - if (!source) { - throw new TypeError('The `source` argument is required.'); - } +/** + * Module exports. + * @public + */ - for (const name of Object.getOwnPropertyNames(source)) { - if (!overwrite && Object.hasOwn(destination, name)) { - // Skip descriptor - continue; - } +module.exports = merge - // Copy descriptor - const descriptor = Object.getOwnPropertyDescriptor(source, name); - Object.defineProperty(destination, name, descriptor); - } +/** + * Module variables. + * @private + */ - return destination; +var hasOwnProperty = Object.prototype.hasOwnProperty + +/** + * Merge the property descriptors of `src` into `dest` + * + * @param {object} dest Object to add descriptors to + * @param {object} src Object to clone descriptors from + * @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties + * @returns {object} Reference to dest + * @public + */ + +function merge (dest, src, redefine) { + if (!dest) { + throw new TypeError('argument dest is required') + } + + if (!src) { + throw new TypeError('argument src is required') + } + + if (redefine === undefined) { + // Default to true + redefine = true + } + + Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) { + if (!redefine && hasOwnProperty.call(dest, name)) { + // Skip descriptor + return + } + + // Copy descriptor + var descriptor = Object.getOwnPropertyDescriptor(src, name) + Object.defineProperty(dest, name, descriptor) + }) + + return dest } - -module.exports = mergeDescriptors; diff --git a/node_modules/merge-descriptors/license b/node_modules/merge-descriptors/license index c509d45..274bfd8 100644 --- a/node_modules/merge-descriptors/license +++ b/node_modules/merge-descriptors/license @@ -1,11 +1,23 @@ -MIT License +(The MIT License) -Copyright (c) Jonathan Ong -Copyright (c) Douglas Christopher Wilson -Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson -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: +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 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. +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/node_modules/merge-descriptors/package.json b/node_modules/merge-descriptors/package.json index 9bedb25..aa9af0a 100644 --- a/node_modules/merge-descriptors/package.json +++ b/node_modules/merge-descriptors/package.json @@ -1,50 +1,39 @@ { - "name": "merge-descriptors", - "version": "2.0.0", - "description": "Merge objects using their property descriptors", - "license": "MIT", - "repository": "sindresorhus/merge-descriptors", - "funding": "https://github.com/sponsors/sindresorhus", - "contributors": [ - "Jonathan Ong ", - "Douglas Christopher Wilson ", - "Mike Grabowski ", - "Sindre Sorhus " - ], - "exports": { - "types": "./index.d.ts", - "default": "./index.js" - }, - "main": "./index.js", - "types": "./index.d.ts", - "sideEffects": false, - "engines": { - "node": ">=18" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "merge", - "descriptors", - "object", - "property", - "properties", - "merging", - "getter", - "setter" - ], - "devDependencies": { - "ava": "^5.3.1", - "xo": "^0.56.0" - }, - "xo": { - "rules": { - "unicorn/prefer-module": "off" - } - } + "name": "merge-descriptors", + "description": "Merge objects using descriptors", + "version": "1.0.3", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "contributors": [ + "Douglas Christopher Wilson ", + "Mike Grabowski " + ], + "license": "MIT", + "repository": "sindresorhus/merge-descriptors", + "funding": "https://github.com/sponsors/sindresorhus", + "devDependencies": { + "eslint": "5.9.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "5.2.0", + "nyc": "13.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha test/", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } } diff --git a/node_modules/merge-descriptors/readme.md b/node_modules/merge-descriptors/readme.md index 1dee67d..3403f4a 100644 --- a/node_modules/merge-descriptors/readme.md +++ b/node_modules/merge-descriptors/readme.md @@ -1,55 +1,49 @@ # merge-descriptors -> Merge objects using their property descriptors +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] -## Install - -```sh -npm install merge-descriptors -``` - -## Usage +Merge objects using descriptors. ```js -import mergeDescriptors from 'merge-descriptors'; - -const thing = { - get name() { - return 'John' - } +var thing = { + get name() { + return 'jon' + } } -const animal = {}; +var animal = { -mergeDescriptors(animal, thing); +} -console.log(animal.name); -//=> 'John' +merge(animal, thing) + +animal.name === 'jon' ``` ## API -### merge(destination, source, overwrite?) +### merge(destination, source) -Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. +Redefines `destination`'s descriptors with `source`'s. The return value is the +`destination` object. -Returns the modified destination object. +### merge(destination, source, false) -#### destination +Defines `source`'s descriptors on `destination` if `destination` does not have +a descriptor by the same name. The return value is the `destination` object. -Type: `object` +## License -The object to receive properties. +[MIT](LICENSE) -#### source - -Type: `object` - -The object providing properties. - -#### overwrite - -Type: `boolean`\ -Default: `true` - -A boolean to control overwriting of existing properties. +[npm-image]: https://img.shields.io/npm/v/merge-descriptors.svg +[npm-url]: https://npmjs.org/package/merge-descriptors +[travis-image]: https://img.shields.io/travis/component/merge-descriptors/master.svg +[travis-url]: https://travis-ci.org/component/merge-descriptors +[coveralls-image]: https://img.shields.io/coveralls/component/merge-descriptors/master.svg +[coveralls-url]: https://coveralls.io/r/component/merge-descriptors?branch=master +[downloads-image]: https://img.shields.io/npm/dm/merge-descriptors.svg +[downloads-url]: https://npmjs.org/package/merge-descriptors diff --git a/node_modules/methods/HISTORY.md b/node_modules/methods/HISTORY.md new file mode 100644 index 0000000..c0ecf07 --- /dev/null +++ b/node_modules/methods/HISTORY.md @@ -0,0 +1,29 @@ +1.1.2 / 2016-01-17 +================== + + * perf: enable strict mode + +1.1.1 / 2014-12-30 +================== + + * Improve `browserify` support + +1.1.0 / 2014-07-05 +================== + + * Add `CONNECT` method + +1.0.1 / 2014-06-02 +================== + + * Fix module to work with harmony transform + +1.0.0 / 2014-05-08 +================== + + * Add `PURGE` method + +0.1.0 / 2013-10-28 +================== + + * Add `http.METHODS` support diff --git a/node_modules/methods/LICENSE b/node_modules/methods/LICENSE new file mode 100644 index 0000000..220dc1a --- /dev/null +++ b/node_modules/methods/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2013-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson + +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/node_modules/methods/README.md b/node_modules/methods/README.md new file mode 100644 index 0000000..672a32b --- /dev/null +++ b/node_modules/methods/README.md @@ -0,0 +1,51 @@ +# Methods + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +HTTP verbs that Node.js core's HTTP parser supports. + +This module provides an export that is just like `http.METHODS` from Node.js core, +with the following differences: + + * All method names are lower-cased. + * Contains a fallback list of methods for Node.js versions that do not have a + `http.METHODS` export (0.10 and lower). + * Provides the fallback list when using tools like `browserify` without pulling + in the `http` shim module. + +## Install + +```bash +$ npm install methods +``` + +## API + +```js +var methods = require('methods') +``` + +### methods + +This is an array of lower-cased method names that Node.js supports. If Node.js +provides the `http.METHODS` export, then this is the same array lower-cased, +otherwise it is a snapshot of the verbs from Node.js 0.10. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/methods.svg?style=flat +[npm-url]: https://npmjs.org/package/methods +[node-version-image]: https://img.shields.io/node/v/methods.svg?style=flat +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/methods.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/methods +[coveralls-image]: https://img.shields.io/coveralls/jshttp/methods.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/methods?branch=master +[downloads-image]: https://img.shields.io/npm/dm/methods.svg?style=flat +[downloads-url]: https://npmjs.org/package/methods diff --git a/node_modules/methods/index.js b/node_modules/methods/index.js new file mode 100644 index 0000000..667a50b --- /dev/null +++ b/node_modules/methods/index.js @@ -0,0 +1,69 @@ +/*! + * methods + * Copyright(c) 2013-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var http = require('http'); + +/** + * Module exports. + * @public + */ + +module.exports = getCurrentNodeMethods() || getBasicNodeMethods(); + +/** + * Get the current Node.js methods. + * @private + */ + +function getCurrentNodeMethods() { + return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) { + return method.toLowerCase(); + }); +} + +/** + * Get the "basic" Node.js methods, a snapshot from Node.js 0.10. + * @private + */ + +function getBasicNodeMethods() { + return [ + 'get', + 'post', + 'put', + 'head', + 'delete', + 'options', + 'trace', + 'copy', + 'lock', + 'mkcol', + 'move', + 'purge', + 'propfind', + 'proppatch', + 'unlock', + 'report', + 'mkactivity', + 'checkout', + 'merge', + 'm-search', + 'notify', + 'subscribe', + 'unsubscribe', + 'patch', + 'search', + 'connect' + ]; +} diff --git a/node_modules/methods/package.json b/node_modules/methods/package.json new file mode 100644 index 0000000..c4ce6f0 --- /dev/null +++ b/node_modules/methods/package.json @@ -0,0 +1,36 @@ +{ + "name": "methods", + "description": "HTTP methods that node supports", + "version": "1.1.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "TJ Holowaychuk (http://tjholowaychuk.com)" + ], + "license": "MIT", + "repository": "jshttp/methods", + "devDependencies": { + "istanbul": "0.4.1", + "mocha": "1.21.5" + }, + "files": [ + "index.js", + "HISTORY.md", + "LICENSE" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "browser": { + "http": false + }, + "keywords": [ + "http", + "methods" + ] +} diff --git a/node_modules/mime-db/HISTORY.md b/node_modules/mime-db/HISTORY.md index fb35bec..7436f64 100644 --- a/node_modules/mime-db/HISTORY.md +++ b/node_modules/mime-db/HISTORY.md @@ -1,37 +1,3 @@ -1.54.0 / 2025-03-17 -=================== - - * Update mime type for DCM format (#362) - * mark application/octet-stream as compressible (#163) - * Fix typo in application/x-zip-compressed mimetype (#359) - * Add mime-type for Jupyter notebooks (#282) - * Add Google Drive MIME types (#311) - * Add .blend file type (#338) - * Add support for the FBX file extension (#342) - * Add Adobe DNG file (#340) - * Add Procreate Brush and Brush Set file Types (#339) - * Add support for Procreate Dreams (#341) - * replace got with undici (#352) - * Added extensions list for model/step (#293) - * Add m4b as a type of audio/mp4 (#357) - * windows 11 application/x-zip-compressed (#346) - * add dotLottie mime type (#351) - * Add some MS-related extensions and types (#336) - -1.53.0 / 2024-07-12 -=================== - - * Add extension `.sql` to `application/sql` - * Add extensions `.aac` and `.adts` to `audio/aac` - * Add extensions `.js` and `.mjs` to `text/javascript` - * Add extensions for `application/mp4` from IANA - * Add extensions from IANA for more MIME types - * Add Microsoft app installer types and extensions - * Add new upstream MIME types - * Fix extensions for `text/markdown` to match IANA - * Remove extension `.mjs` from `application/javascript` - * Remove obsolete MIME types from IANA data - 1.52.0 / 2022-02-21 =================== @@ -70,7 +36,7 @@ =================== * Add new upstream MIME types - * Remove ambiguous extensions from IANA for `application/*+xml` types + * Remove ambigious extensions from IANA for `application/*+xml` types * Update primary extension to `.es` for `application/ecmascript` 1.46.0 / 2021-02-13 diff --git a/node_modules/mime-db/README.md b/node_modules/mime-db/README.md index ee93fa0..5a8fcfe 100644 --- a/node_modules/mime-db/README.md +++ b/node_modules/mime-db/README.md @@ -11,9 +11,9 @@ It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources: -- https://www.iana.org/assignments/media-types/media-types.xhtml -- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -- https://hg.nginx.org/nginx/raw-file/default/conf/mime.types +- http://www.iana.org/assignments/media-types/media-types.xhtml +- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types ## Installation @@ -23,7 +23,10 @@ npm install mime-db ### Database Download -If you intend to use this in a web browser, you can conveniently access the JSON file via [jsDelivr](https://www.jsdelivr.com/), a popular CDN (Content Delivery Network). To ensure stability and compatibility, it is advisable to specify [a release tag](https://github.com/jshttp/mime-db/tags) instead of using the 'master' branch. This is because the JSON file's format might change in future updates, and relying on a specific release tag will prevent potential issues arising from these changes. +If you're crazy enough to use this in the browser, you can just grab the +JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to +replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) +as the JSON format may change in the future. ``` https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json @@ -45,42 +48,17 @@ Each mime type has the following properties: - `.source` - where the mime type is defined. If not set, it's probably a custom media type. - - `apache` - [Apache common media types](https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](https://www.iana.org/assignments/media-types/media-types.xhtml) - - `nginx` - [nginx media types](https://hg.nginx.org/nginx/raw-file/default/conf/mime.types) + - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) + - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) - `.extensions[]` - known extensions associated with this mime type. - `.compressible` - whether a file of this type can be gzipped. - `.charset` - the default charset associated with this type, if any. If unknown, every property could be `undefined`. -## Note on MIME Type Data and Semver - -This package considers the programmatic api as the semver compatibility. This means the MIME type resolution is *not* considered -in the semver bumps. This means that if you want to pin your `mime-db` data you will need to do it in your application. While -this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is a breaking change. - ## Contributing -The primary way to contribute to this database is by updating the data in -one of the upstream sources. The database is updated from the upstreams -periodically and will pull in any changes. - -### Registering Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](https://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -### Direct Inclusion - -If that is not possible / feasible, they can be added directly here as a -"custom" type. To do this, it is required to have a primary source that -definitively lists the media type. If an extension is going to be listed as -associated with this media type, the source must definitively link the -media type and extension as well. - To edit the database, only make PRs against `src/custom-types.json` or `src/custom-suffix.json`. @@ -98,8 +76,21 @@ keys and the values being an object with the following keys: To update the build, run `npm run build`. +### Adding Custom Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +If that is not possible / feasible, they can be added directly here as a +"custom" type. To do this, it is required to have a primary source that +definitively lists the media type. If an extension is going to be listed as +associateed with this media type, the source must definitively link the +media type and extension as well. + [ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci -[ci-url]: https://github.com/jshttp/mime-db/actions/workflows/ci.yml +[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master [coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master [node-image]: https://badgen.net/npm/node/mime-db diff --git a/node_modules/mime-db/db.json b/node_modules/mime-db/db.json index 7e74733..eb9c42c 100644 --- a/node_modules/mime-db/db.json +++ b/node_modules/mime-db/db.json @@ -25,16 +25,6 @@ "application/ace+cbor": { "source": "iana" }, - "application/ace+json": { - "source": "iana", - "compressible": true - }, - "application/ace-groupcomm+cbor": { - "source": "iana" - }, - "application/ace-trl+cbor": { - "source": "iana" - }, "application/activemessage": { "source": "iana" }, @@ -42,21 +32,6 @@ "source": "iana", "compressible": true }, - "application/aif+cbor": { - "source": "iana" - }, - "application/aif+json": { - "source": "iana", - "compressible": true - }, - "application/alto-cdni+json": { - "source": "iana", - "compressible": true - }, - "application/alto-cdnifilter+json": { - "source": "iana", - "compressible": true - }, "application/alto-costmap+json": { "source": "iana", "compressible": true @@ -97,22 +72,6 @@ "source": "iana", "compressible": true }, - "application/alto-propmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-propmapparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-tips+json": { - "source": "iana", - "compressible": true - }, - "application/alto-tipsparams+json": { - "source": "iana", - "compressible": true - }, "application/alto-updatestreamcontrol+json": { "source": "iana", "compressible": true @@ -128,10 +87,6 @@ "source": "iana", "extensions": ["ez"] }, - "application/appinstaller": { - "compressible": false, - "extensions": ["appinstaller"] - }, "application/applefile": { "source": "iana" }, @@ -139,14 +94,6 @@ "source": "apache", "extensions": ["aw"] }, - "application/appx": { - "compressible": false, - "extensions": ["appx"] - }, - "application/appxbundle": { - "compressible": false, - "extensions": ["appxbundle"] - }, "application/at+jwt": { "source": "iana" }, @@ -208,16 +155,6 @@ "source": "iana", "compressible": true }, - "application/automationml-aml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["aml"] - }, - "application/automationml-amlx+zip": { - "source": "iana", - "compressible": false, - "extensions": ["amlx"] - }, "application/bacnet-xdd+zip": { "source": "iana", "compressible": false @@ -234,12 +171,6 @@ "charset": "UTF-8", "compressible": true }, - "application/bufr": { - "source": "iana" - }, - "application/c2pa": { - "source": "iana" - }, "application/calendar+json": { "source": "iana", "compressible": true @@ -277,11 +208,6 @@ "compressible": true, "extensions": ["ccxml"] }, - "application/cda+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, "application/cdfx+xml": { "source": "iana", "compressible": true, @@ -310,9 +236,6 @@ "application/cdni": { "source": "iana" }, - "application/ce+cbor": { - "source": "iana" - }, "application/cea": { "source": "iana" }, @@ -327,16 +250,10 @@ "application/cfw": { "source": "iana" }, - "application/cid-edhoc+cbor-seq": { - "source": "iana" - }, "application/city+json": { "source": "iana", "compressible": true }, - "application/city+json-seq": { - "source": "iana" - }, "application/clr": { "source": "iana" }, @@ -355,9 +272,6 @@ "source": "iana", "compressible": true }, - "application/coap-eap": { - "source": "iana" - }, "application/coap-group+json": { "source": "iana", "compressible": true @@ -368,9 +282,6 @@ "application/commonground": { "source": "iana" }, - "application/concise-problem-details+cbor": { - "source": "iana" - }, "application/conference-info+xml": { "source": "iana", "compressible": true @@ -384,9 +295,6 @@ "application/cose-key-set": { "source": "iana" }, - "application/cose-x509": { - "source": "iana" - }, "application/cpl+xml": { "source": "iana", "compressible": true, @@ -411,17 +319,6 @@ "source": "apache", "extensions": ["cu"] }, - "application/cwl": { - "source": "iana", - "extensions": ["cwl"] - }, - "application/cwl+json": { - "source": "iana", - "compressible": true - }, - "application/cwl+yaml": { - "source": "iana" - }, "application/cwt": { "source": "iana" }, @@ -463,8 +360,7 @@ "compressible": true }, "application/dicom": { - "source": "iana", - "extensions": ["dcm"] + "source": "iana" }, "application/dicom+json": { "source": "iana", @@ -498,9 +394,6 @@ "application/dots+cbor": { "source": "iana" }, - "application/dpop+jwt": { - "source": "iana" - }, "application/dskpp+xml": { "source": "iana", "compressible": true @@ -517,33 +410,10 @@ "application/dvcs": { "source": "iana" }, - "application/eat+cwt": { - "source": "iana" - }, - "application/eat+jwt": { - "source": "iana" - }, - "application/eat-bun+cbor": { - "source": "iana" - }, - "application/eat-bun+json": { - "source": "iana", - "compressible": true - }, - "application/eat-ucs+cbor": { - "source": "iana" - }, - "application/eat-ucs+json": { - "source": "iana", - "compressible": true - }, "application/ecmascript": { - "source": "apache", + "source": "iana", "compressible": true, - "extensions": ["ecma"] - }, - "application/edhoc+cbor-seq": { - "source": "iana" + "extensions": ["es","ecma"] }, "application/edi-consent": { "source": "iana" @@ -588,10 +458,6 @@ "application/emergencycalldata.ecall.msd": { "source": "iana" }, - "application/emergencycalldata.legacyesn+json": { - "source": "iana", - "compressible": true - }, "application/emergencycalldata.providerinfo+xml": { "source": "iana", "compressible": true @@ -621,9 +487,6 @@ "application/encaprtp": { "source": "iana" }, - "application/entity-statement+jwt": { - "source": "iana" - }, "application/epp+xml": { "source": "iana", "compressible": true @@ -654,10 +517,6 @@ "application/fastsoap": { "source": "iana" }, - "application/fdf": { - "source": "iana", - "extensions": ["fdf"] - }, "application/fdt+xml": { "source": "iana", "compressible": true, @@ -708,14 +567,6 @@ "application/geopackage+sqlite3": { "source": "iana" }, - "application/geopose+json": { - "source": "iana", - "compressible": true - }, - "application/geoxacml+json": { - "source": "iana", - "compressible": true - }, "application/geoxacml+xml": { "source": "iana", "compressible": true @@ -728,26 +579,11 @@ "compressible": true, "extensions": ["gml"] }, - "application/gnap-binding-jws": { - "source": "iana" - }, - "application/gnap-binding-jwsd": { - "source": "iana" - }, - "application/gnap-binding-rotation-jws": { - "source": "iana" - }, - "application/gnap-binding-rotation-jwsd": { - "source": "iana" - }, "application/gpx+xml": { "source": "apache", "compressible": true, "extensions": ["gpx"] }, - "application/grib": { - "source": "iana" - }, "application/gxf": { "source": "apache", "extensions": ["gxf"] @@ -767,11 +603,6 @@ "application/hjson": { "extensions": ["hjson"] }, - "application/hl7v2+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, "application/http": { "source": "iana" }, @@ -837,7 +668,7 @@ "extensions": ["its"] }, "application/java-archive": { - "source": "iana", + "source": "apache", "compressible": false, "extensions": ["jar","war","ear"] }, @@ -852,10 +683,10 @@ "extensions": ["class"] }, "application/javascript": { - "source": "apache", + "source": "iana", "charset": "UTF-8", "compressible": true, - "extensions": ["js"] + "extensions": ["js","mjs"] }, "application/jf2feed+json": { "source": "iana", @@ -876,10 +707,6 @@ "source": "iana", "compressible": true }, - "application/jscontact+json": { - "source": "iana", - "compressible": true - }, "application/json": { "source": "iana", "charset": "UTF-8", @@ -901,9 +728,6 @@ "compressible": true, "extensions": ["jsonml"] }, - "application/jsonpath": { - "source": "iana" - }, "application/jwk+json": { "source": "iana", "compressible": true @@ -912,9 +736,6 @@ "source": "iana", "compressible": true }, - "application/jwk-set+jwt": { - "source": "iana" - }, "application/jwt": { "source": "iana" }, @@ -939,20 +760,10 @@ "application/link-format": { "source": "iana" }, - "application/linkset": { - "source": "iana" - }, - "application/linkset+json": { - "source": "iana", - "compressible": true - }, "application/load-control+xml": { "source": "iana", "compressible": true }, - "application/logout+jwt": { - "source": "iana" - }, "application/lost+xml": { "source": "iana", "compressible": true, @@ -1143,7 +954,7 @@ }, "application/mp4": { "source": "iana", - "extensions": ["mp4","mpg4","mp4s","m4p"] + "extensions": ["mp4s","m4p"] }, "application/mpeg4-generic": { "source": "iana" @@ -1172,14 +983,6 @@ "charset": "UTF-8", "compressible": true }, - "application/msix": { - "compressible": false, - "extensions": ["msix"] - }, - "application/msixbundle": { - "compressible": false, - "extensions": ["msixbundle"] - }, "application/msword": { "source": "iana", "compressible": false, @@ -1243,7 +1046,7 @@ }, "application/octet-stream": { "source": "iana", - "compressible": true, + "compressible": false, "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] }, "application/oda": { @@ -1267,9 +1070,6 @@ "compressible": false, "extensions": ["ogx"] }, - "application/ohttp-keys": { - "source": "iana" - }, "application/omdoc+xml": { "source": "apache", "compressible": true, @@ -1277,7 +1077,7 @@ }, "application/onenote": { "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg","one","onea"] + "extensions": ["onetoc","onetoc2","onetmp","onepkg"] }, "application/opc-nodeset+xml": { "source": "iana", @@ -1335,7 +1135,7 @@ }, "application/pgp-signature": { "source": "iana", - "extensions": ["sig","asc"] + "extensions": ["asc","sig"] }, "application/pics-rules": { "source": "apache", @@ -1412,15 +1212,6 @@ "source": "iana", "compressible": true }, - "application/private-token-issuer-directory": { - "source": "iana" - }, - "application/private-token-request": { - "source": "iana" - }, - "application/private-token-response": { - "source": "iana" - }, "application/problem+json": { "source": "iana", "compressible": true @@ -1434,9 +1225,6 @@ "compressible": true, "extensions": ["provx"] }, - "application/provided-claims+jwt": { - "source": "iana" - }, "application/prs.alvestrand.titrax-sheet": { "source": "iana" }, @@ -1452,29 +1240,6 @@ "source": "iana", "compressible": false }, - "application/prs.implied-document+xml": { - "source": "iana", - "compressible": true - }, - "application/prs.implied-executable": { - "source": "iana" - }, - "application/prs.implied-object+json": { - "source": "iana", - "compressible": true - }, - "application/prs.implied-object+json-seq": { - "source": "iana" - }, - "application/prs.implied-object+yaml": { - "source": "iana" - }, - "application/prs.implied-structure": { - "source": "iana" - }, - "application/prs.mayfile": { - "source": "iana" - }, "application/prs.nprend": { "source": "iana" }, @@ -1484,13 +1249,9 @@ "application/prs.rdf-xml-crypt": { "source": "iana" }, - "application/prs.vcfbzip2": { - "source": "iana" - }, "application/prs.xsf+xml": { "source": "iana", - "compressible": true, - "extensions": ["xsf"] + "compressible": true }, "application/pskc+xml": { "source": "iana", @@ -1530,15 +1291,12 @@ "extensions": ["rnc"] }, "application/remote-printing": { - "source": "apache" + "source": "iana" }, "application/reputon+json": { "source": "iana", "compressible": true }, - "application/resolve-response+jwt": { - "source": "iana" - }, "application/resource-lists+xml": { "source": "iana", "compressible": true, @@ -1580,9 +1338,6 @@ "compressible": true, "extensions": ["rusd"] }, - "application/rpki-checklist": { - "source": "iana" - }, "application/rpki-ghostbusters": { "source": "iana", "extensions": ["gbr"] @@ -1598,9 +1353,6 @@ "source": "iana", "extensions": ["roa"] }, - "application/rpki-signed-tal": { - "source": "iana" - }, "application/rpki-updown": { "source": "iana" }, @@ -1773,7 +1525,7 @@ "source": "iana" }, "application/smil": { - "source": "apache" + "source": "iana" }, "application/smil+xml": { "source": "iana", @@ -1808,8 +1560,7 @@ "compressible": true }, "application/sql": { - "source": "iana", - "extensions": ["sql"] + "source": "iana" }, "application/srgs": { "source": "iana", @@ -1830,27 +1581,15 @@ "compressible": true, "extensions": ["ssdl"] }, - "application/sslkeylogfile": { - "source": "iana" - }, "application/ssml+xml": { "source": "iana", "compressible": true, "extensions": ["ssml"] }, - "application/st2110-41": { - "source": "iana" - }, "application/stix+json": { "source": "iana", "compressible": true }, - "application/stratum": { - "source": "iana" - }, - "application/swid+cbor": { - "source": "iana" - }, "application/swid+xml": { "source": "iana", "compressible": true, @@ -1930,21 +1669,13 @@ "source": "iana", "compressible": true }, - "application/tm+json": { - "source": "iana", - "compressible": true - }, "application/tnauthlist": { "source": "iana" }, - "application/toc+cbor": { - "source": "iana" - }, "application/token-introspection+jwt": { "source": "iana" }, "application/toml": { - "source": "iana", "compressible": true, "extensions": ["toml"] }, @@ -1955,16 +1686,6 @@ "source": "iana", "extensions": ["trig"] }, - "application/trust-chain+json": { - "source": "iana", - "compressible": true - }, - "application/trust-mark+jwt": { - "source": "iana" - }, - "application/trust-mark-delegation+jwt": { - "source": "iana" - }, "application/ttml+xml": { "source": "iana", "compressible": true, @@ -1983,13 +1704,6 @@ "compressible": false, "extensions": ["ubj"] }, - "application/uccs+cbor": { - "source": "iana" - }, - "application/ujcs+json": { - "source": "iana", - "compressible": true - }, "application/ulpfec": { "source": "iana" }, @@ -2011,15 +1725,6 @@ "source": "iana", "compressible": true }, - "application/vc": { - "source": "iana" - }, - "application/vc+cose": { - "source": "iana" - }, - "application/vc+jwt": { - "source": "iana" - }, "application/vcard+json": { "source": "iana", "compressible": true @@ -2039,47 +1744,20 @@ "compressible": true, "extensions": ["1km"] }, - "application/vnd.1ob": { - "source": "iana" - }, "application/vnd.3gpp-prose+xml": { "source": "iana", "compressible": true }, - "application/vnd.3gpp-prose-pc3a+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ach+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp-prose-pc3ch+xml": { "source": "iana", "compressible": true }, - "application/vnd.3gpp-prose-pc8+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp-v2x-local-service-information": { "source": "iana" }, "application/vnd.3gpp.5gnas": { "source": "iana" }, - "application/vnd.3gpp.5gsa2x": { - "source": "iana" - }, - "application/vnd.3gpp.5gsa2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.5gsv2x": { - "source": "iana" - }, - "application/vnd.3gpp.5gsv2x-local-service-information": { - "source": "iana" - }, "application/vnd.3gpp.access-transfer-events+xml": { "source": "iana", "compressible": true @@ -2088,14 +1766,6 @@ "source": "iana", "compressible": true }, - "application/vnd.3gpp.crs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.current-location-discovery+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.gmop+xml": { "source": "iana", "compressible": true @@ -2120,17 +1790,9 @@ "source": "iana", "compressible": true }, - "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.mcdata-payload": { "source": "iana" }, - "application/vnd.3gpp.mcdata-regroup+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.mcdata-service-config+xml": { "source": "iana", "compressible": true @@ -2166,10 +1828,6 @@ "source": "iana", "compressible": true }, - "application/vnd.3gpp.mcptt-regroup+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.mcptt-service-config+xml": { "source": "iana", "compressible": true @@ -2194,6 +1852,10 @@ "source": "iana", "compressible": true }, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.3gpp.mcvideo-info+xml": { "source": "iana", "compressible": true @@ -2206,10 +1868,6 @@ "source": "iana", "compressible": true }, - "application/vnd.3gpp.mcvideo-regroup+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.mcvideo-service-config+xml": { "source": "iana", "compressible": true @@ -2248,45 +1906,9 @@ "source": "iana", "extensions": ["pvb"] }, - "application/vnd.3gpp.pinapp-info+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.s1ap": { "source": "iana" }, - "application/vnd.3gpp.seal-group-doc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-network-qos-management-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-ue-config-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-unicast-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.seal-user-profile-info+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp.sms": { "source": "iana" }, @@ -2310,13 +1932,6 @@ "source": "iana", "compressible": true }, - "application/vnd.3gpp.v2x": { - "source": "iana" - }, - "application/vnd.3gpp.vae-info+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.3gpp2.bcmcsinfo+xml": { "source": "iana", "compressible": true @@ -2343,14 +1958,6 @@ "source": "iana", "extensions": ["imp"] }, - "application/vnd.acm.addressxfer+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.acm.chatbot+json": { - "source": "iana", - "compressible": true - }, "application/vnd.acucobol": { "source": "iana", "extensions": ["acu"] @@ -2384,7 +1991,7 @@ "extensions": ["xdp"] }, "application/vnd.adobe.xfdf": { - "source": "apache", + "source": "iana", "extensions": ["xfdf"] }, "application/vnd.aether.imp": { @@ -2434,7 +2041,7 @@ "extensions": ["age"] }, "application/vnd.ah-barcode": { - "source": "apache" + "source": "iana" }, "application/vnd.ahead.space": { "source": "iana", @@ -2500,9 +2107,6 @@ "application/vnd.apache.arrow.stream": { "source": "iana" }, - "application/vnd.apache.parquet": { - "source": "iana" - }, "application/vnd.apache.thrift.binary": { "source": "iana" }, @@ -2512,9 +2116,6 @@ "application/vnd.apache.thrift.json": { "source": "iana" }, - "application/vnd.apexlang": { - "source": "iana" - }, "application/vnd.api+json": { "source": "iana", "compressible": true @@ -2553,7 +2154,7 @@ "extensions": ["pkpass"] }, "application/vnd.arastra.swi": { - "source": "apache" + "source": "iana" }, "application/vnd.aristanetworks.swi": { "source": "iana", @@ -2574,9 +2175,6 @@ "source": "iana", "extensions": ["aep"] }, - "application/vnd.autodesk.fbx": { - "extensions": ["fbx"] - }, "application/vnd.autopackage": { "source": "iana" }, @@ -2613,14 +2211,6 @@ "source": "iana", "compressible": true }, - "application/vnd.belightsoft.lhzd+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.belightsoft.lhzl+zip": { - "source": "iana", - "compressible": false - }, "application/vnd.bint.med-content": { "source": "iana" }, @@ -2659,13 +2249,6 @@ "source": "iana", "compressible": true }, - "application/vnd.bzip3": { - "source": "iana" - }, - "application/vnd.c3voc.schedule+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.cab-jscript": { "source": "iana" }, @@ -2732,16 +2315,6 @@ "source": "iana", "extensions": ["c11amz"] }, - "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { - "source": "iana" - }, - "application/vnd.cncf.helm.chart.provenance.v1.prov": { - "source": "iana" - }, - "application/vnd.cncf.helm.config.v1+json": { - "source": "iana", - "compressible": true - }, "application/vnd.coffeescript": { "source": "iana" }, @@ -2908,9 +2481,6 @@ "source": "iana", "extensions": ["rdz"] }, - "application/vnd.datalog": { - "source": "iana" - }, "application/vnd.datapackage+json": { "source": "iana", "compressible": true @@ -2923,11 +2493,6 @@ "source": "iana", "extensions": ["dbf"] }, - "application/vnd.dcmp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dcmp"] - }, "application/vnd.debian.binary-package": { "source": "iana" }, @@ -3126,10 +2691,6 @@ "application/vnd.efi.iso": { "source": "iana" }, - "application/vnd.eln+zip": { - "source": "iana", - "compressible": false - }, "application/vnd.emclient.accessrequest+xml": { "source": "iana", "compressible": true @@ -3168,9 +2729,6 @@ "application/vnd.ericsson.quickcall": { "source": "iana" }, - "application/vnd.erofs": { - "source": "iana" - }, "application/vnd.espass-espass+zip": { "source": "iana", "compressible": false @@ -3307,7 +2865,7 @@ "source": "iana" }, "application/vnd.fdf": { - "source": "apache", + "source": "iana", "extensions": ["fdf"] }, "application/vnd.fdsn.mseed": { @@ -3318,11 +2876,6 @@ "source": "iana", "extensions": ["seed","dataless"] }, - "application/vnd.fdsn.stationxml+xml": { - "source": "iana", - "charset": "XML-BASED", - "compressible": true - }, "application/vnd.ffsns": { "source": "iana" }, @@ -3354,15 +2907,12 @@ "source": "iana", "extensions": ["fm","frame","maker","book"] }, - "application/vnd.freelog.comic": { - "source": "iana" - }, "application/vnd.frogans.fnc": { - "source": "apache", + "source": "iana", "extensions": ["fnc"] }, "application/vnd.frogans.ltf": { - "source": "apache", + "source": "iana", "extensions": ["ltf"] }, "application/vnd.fsc.weblaunch": { @@ -3440,61 +2990,28 @@ "source": "iana", "extensions": ["fzs"] }, - "application/vnd.ga4gh.passport+jwt": { - "source": "iana" - }, "application/vnd.genomatix.tuxedo": { "source": "iana", "extensions": ["txd"] }, - "application/vnd.genozip": { - "source": "iana" - }, "application/vnd.gentics.grd+json": { "source": "iana", "compressible": true }, - "application/vnd.gentoo.catmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gentoo.ebuild": { - "source": "iana" - }, - "application/vnd.gentoo.eclass": { - "source": "iana" - }, - "application/vnd.gentoo.gpkg": { - "source": "iana" - }, - "application/vnd.gentoo.manifest": { - "source": "iana" - }, - "application/vnd.gentoo.pkgmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gentoo.xpak": { - "source": "iana" - }, "application/vnd.geo+json": { - "source": "apache", + "source": "iana", "compressible": true }, "application/vnd.geocube+xml": { - "source": "apache", + "source": "iana", "compressible": true }, "application/vnd.geogebra.file": { "source": "iana", "extensions": ["ggb"] }, - "application/vnd.geogebra.pinboard": { - "source": "iana" - }, "application/vnd.geogebra.slides": { - "source": "iana", - "extensions": ["ggs"] + "source": "iana" }, "application/vnd.geogebra.tool": { "source": "iana", @@ -3529,64 +3046,18 @@ "source": "iana", "extensions": ["gmx"] }, - "application/vnd.gnu.taler.exchange+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.gnu.taler.merchant+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.google-apps.audio": {}, "application/vnd.google-apps.document": { "compressible": false, "extensions": ["gdoc"] }, - "application/vnd.google-apps.drawing": { - "compressible": false, - "extensions": ["gdraw"] - }, - "application/vnd.google-apps.drive-sdk": { - "compressible": false - }, - "application/vnd.google-apps.file": {}, - "application/vnd.google-apps.folder": { - "compressible": false - }, - "application/vnd.google-apps.form": { - "compressible": false, - "extensions": ["gform"] - }, - "application/vnd.google-apps.fusiontable": {}, - "application/vnd.google-apps.jam": { - "compressible": false, - "extensions": ["gjam"] - }, - "application/vnd.google-apps.mail-layout": {}, - "application/vnd.google-apps.map": { - "compressible": false, - "extensions": ["gmap"] - }, - "application/vnd.google-apps.photo": {}, "application/vnd.google-apps.presentation": { "compressible": false, "extensions": ["gslides"] }, - "application/vnd.google-apps.script": { - "compressible": false, - "extensions": ["gscript"] - }, - "application/vnd.google-apps.shortcut": {}, - "application/vnd.google-apps.site": { - "compressible": false, - "extensions": ["gsite"] - }, "application/vnd.google-apps.spreadsheet": { "compressible": false, "extensions": ["gsheet"] }, - "application/vnd.google-apps.unknown": {}, - "application/vnd.google-apps.video": {}, "application/vnd.google-earth.kml+xml": { "source": "iana", "compressible": true, @@ -3598,7 +3069,7 @@ "extensions": ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { - "source": "apache", + "source": "iana", "compressible": true }, "application/vnd.gov.sk.e-form+zip": { @@ -3606,11 +3077,6 @@ "compressible": false }, "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdcf"] - }, - "application/vnd.gpxsee.map+xml": { "source": "iana", "compressible": true }, @@ -3685,6 +3151,16 @@ "source": "iana", "extensions": ["les"] }, + "application/vnd.hl7cda+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.hl7v2+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, "application/vnd.hp-hpgl": { "source": "iana", "extensions": ["hpgl"] @@ -3709,9 +3185,6 @@ "source": "iana", "extensions": ["pclxl"] }, - "application/vnd.hsl": { - "source": "iana" - }, "application/vnd.httphone": { "source": "iana" }, @@ -3735,7 +3208,7 @@ "source": "iana" }, "application/vnd.ibm.afplinedata": { - "source": "apache" + "source": "iana" }, "application/vnd.ibm.electronic-media": { "source": "iana" @@ -3745,7 +3218,7 @@ "extensions": ["mpy"] }, "application/vnd.ibm.modcap": { - "source": "apache", + "source": "iana", "extensions": ["afp","listafp","list3820"] }, "application/vnd.ibm.rights-management": { @@ -3821,7 +3294,7 @@ "compressible": true }, "application/vnd.informix-visionary": { - "source": "apache" + "source": "iana" }, "application/vnd.infotech.project": { "source": "iana" @@ -3859,21 +3332,6 @@ "source": "iana", "extensions": ["qfx"] }, - "application/vnd.ipfs.ipns-record": { - "source": "iana" - }, - "application/vnd.ipld.car": { - "source": "iana" - }, - "application/vnd.ipld.dag-cbor": { - "source": "iana" - }, - "application/vnd.ipld.dag-json": { - "source": "iana" - }, - "application/vnd.ipld.raw": { - "source": "iana" - }, "application/vnd.iptc.g2.catalogitem+xml": { "source": "iana", "compressible": true @@ -4002,20 +3460,10 @@ "source": "iana", "extensions": ["kwd","kwt"] }, - "application/vnd.kdl": { - "source": "iana" - }, "application/vnd.kenameaapp": { "source": "iana", "extensions": ["htke"] }, - "application/vnd.keyman.kmp+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.keyman.kmx": { - "source": "iana" - }, "application/vnd.kidspiration": { "source": "iana", "extensions": ["kia"] @@ -4047,9 +3495,6 @@ "application/vnd.laszip": { "source": "iana" }, - "application/vnd.ldev.productlicensing": { - "source": "iana" - }, "application/vnd.leap+json": { "source": "iana", "compressible": true @@ -4140,12 +3585,6 @@ "source": "iana", "extensions": ["mcd"] }, - "application/vnd.mdl": { - "source": "iana" - }, - "application/vnd.mdl-mbsdf": { - "source": "iana" - }, "application/vnd.medcalcdata": { "source": "iana", "extensions": ["mc1"] @@ -4154,15 +3593,9 @@ "source": "iana", "extensions": ["cdkey"] }, - "application/vnd.medicalholodeck.recordxr": { - "source": "iana" - }, "application/vnd.meridian-slingshot": { "source": "iana" }, - "application/vnd.mermaid": { - "source": "iana" - }, "application/vnd.mfer": { "source": "iana", "extensions": ["mwf"] @@ -4231,9 +3664,6 @@ "source": "iana", "extensions": ["txf"] }, - "application/vnd.modl": { - "source": "iana" - }, "application/vnd.mophun.application": { "source": "iana", "extensions": ["mpn"] @@ -4401,9 +3831,6 @@ "application/vnd.ms-tnef": { "source": "iana" }, - "application/vnd.ms-visio.viewer": { - "extensions": ["vdx"] - }, "application/vnd.ms-windows.devicepairing": { "source": "iana" }, @@ -4456,9 +3883,6 @@ "source": "iana", "extensions": ["mseq"] }, - "application/vnd.msgpack": { - "source": "iana" - }, "application/vnd.msign": { "source": "iana" }, @@ -4487,22 +3911,6 @@ "source": "iana", "compressible": true }, - "application/vnd.nato.bindingdataobject+cbor": { - "source": "iana" - }, - "application/vnd.nato.bindingdataobject+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nato.bindingdataobject+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bdo"] - }, - "application/vnd.nato.openxmlformats-package.iepd+zip": { - "source": "iana", - "compressible": false - }, "application/vnd.ncd.control": { "source": "iana" }, @@ -4589,7 +3997,7 @@ "extensions": ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { - "source": "apache", + "source": "iana", "extensions": ["n-gage"] }, "application/vnd.nokia.ncd": { @@ -4637,19 +4045,6 @@ "application/vnd.ntt-local.sip-ta_tcp_stream": { "source": "iana" }, - "application/vnd.oai.workflows": { - "source": "iana" - }, - "application/vnd.oai.workflows+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oai.workflows+yaml": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.base": { - "source": "iana" - }, "application/vnd.oasis.opendocument.chart": { "source": "iana", "extensions": ["odc"] @@ -4659,7 +4054,7 @@ "extensions": ["otc"] }, "application/vnd.oasis.opendocument.database": { - "source": "apache", + "source": "iana", "extensions": ["odb"] }, "application/vnd.oasis.opendocument.formula": { @@ -4714,9 +4109,6 @@ "source": "iana", "extensions": ["odm"] }, - "application/vnd.oasis.opendocument.text-master-template": { - "source": "iana" - }, "application/vnd.oasis.opendocument.text-template": { "source": "iana", "extensions": ["ott"] @@ -4799,7 +4191,7 @@ "compressible": true }, "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "apache", + "source": "iana", "compressible": true }, "application/vnd.oma.bcast.imd+xml": { @@ -4830,7 +4222,7 @@ "source": "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "apache", + "source": "iana", "compressible": true }, "application/vnd.oma.bcast.sprov+xml": { @@ -4960,9 +4352,6 @@ "application/vnd.onepagertatx": { "source": "iana" }, - "application/vnd.onvif.metadata": { - "source": "iana" - }, "application/vnd.openblox.game+xml": { "source": "iana", "compressible": true, @@ -4986,10 +4375,6 @@ "application/vnd.opentimestamps.ots": { "source": "iana" }, - "application/vnd.openvpi.dspx+json": { - "source": "iana", - "compressible": true - }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { "source": "iana", "compressible": true @@ -5400,15 +4785,6 @@ "source": "iana", "extensions": ["box"] }, - "application/vnd.procrate.brushset": { - "extensions": ["brushset"] - }, - "application/vnd.procreate.brush": { - "extensions": ["brush"] - }, - "application/vnd.procreate.dream": { - "extensions": ["drm"] - }, "application/vnd.proteus.magazine": { "source": "iana", "extensions": ["mgz"] @@ -5416,9 +4792,6 @@ "application/vnd.psfs": { "source": "iana" }, - "application/vnd.pt.mundusmundi": { - "source": "iana" - }, "application/vnd.publishare-delta-tree": { "source": "iana", "extensions": ["qps"] @@ -5432,8 +4805,7 @@ }, "application/vnd.pwg-xhtml-print+xml": { "source": "iana", - "compressible": true, - "extensions": ["xhtm"] + "compressible": true }, "application/vnd.qualcomm.brew-app-res": { "source": "iana" @@ -5531,9 +4903,6 @@ "compressible": true, "extensions": ["musicxml"] }, - "application/vnd.relpipe": { - "source": "iana" - }, "application/vnd.renlearn.rlprint": { "source": "iana" }, @@ -5687,9 +5056,6 @@ "source": "iana", "compressible": true }, - "application/vnd.sketchometry": { - "source": "iana" - }, "application/vnd.smaf": { "source": "iana", "extensions": ["mmf"] @@ -5701,9 +5067,6 @@ "source": "iana", "extensions": ["teacher"] }, - "application/vnd.smintio.portals.archive": { - "source": "iana" - }, "application/vnd.snesdev-page-table": { "source": "iana" }, @@ -5831,9 +5194,6 @@ "application/vnd.swiftview-ics": { "source": "iana" }, - "application/vnd.sybyl.mol2": { - "source": "iana" - }, "application/vnd.sycle+xml": { "source": "iana", "compressible": true @@ -5938,10 +5298,6 @@ "source": "iana", "extensions": ["ufd","ufdl"] }, - "application/vnd.uic.osdm+json": { - "source": "iana", - "compressible": true - }, "application/vnd.uiq.theme": { "source": "iana", "extensions": ["utz"] @@ -5957,7 +5313,7 @@ "application/vnd.uoml+xml": { "source": "iana", "compressible": true, - "extensions": ["uoml","uo"] + "extensions": ["uoml"] }, "application/vnd.uplanet.alert": { "source": "iana" @@ -6018,13 +5374,6 @@ "source": "iana", "compressible": true }, - "application/vnd.veraison.tsm-report+cbor": { - "source": "iana" - }, - "application/vnd.veraison.tsm-report+json": { - "source": "iana", - "compressible": true - }, "application/vnd.verimatrix.vcas": { "source": "iana" }, @@ -6043,7 +5392,7 @@ }, "application/vnd.visio": { "source": "iana", - "extensions": ["vsd","vst","vss","vsw","vsdx","vtx"] + "extensions": ["vsd","vst","vss","vsw"] }, "application/vnd.visionary": { "source": "iana", @@ -6052,9 +5401,6 @@ "application/vnd.vividence.scriptfile": { "source": "iana" }, - "application/vnd.vocalshaper.vsp4": { - "source": "iana" - }, "application/vnd.vsf": { "source": "iana", "extensions": ["vsf"] @@ -6078,9 +5424,6 @@ "source": "iana", "extensions": ["wmlsc"] }, - "application/vnd.wasmflow.wafl": { - "source": "iana" - }, "application/vnd.webturbo": { "source": "iana", "extensions": ["wtb"] @@ -6113,9 +5456,6 @@ "source": "iana", "extensions": ["nbp"] }, - "application/vnd.wordlift": { - "source": "iana" - }, "application/vnd.wordperfect": { "source": "iana", "extensions": ["wpd"] @@ -6150,12 +5490,6 @@ "source": "iana", "extensions": ["xar"] }, - "application/vnd.xarin.cpj": { - "source": "iana" - }, - "application/vnd.xecrets-encrypted": { - "source": "iana" - }, "application/vnd.xfdl": { "source": "iana", "extensions": ["xfdl"] @@ -6227,6 +5561,9 @@ "source": "iana", "extensions": ["cmp"] }, + "application/vnd.youtube.yt": { + "source": "iana" + }, "application/vnd.zul": { "source": "iana", "extensions": ["zir","zirz"] @@ -6245,19 +5582,6 @@ "source": "iana", "compressible": true }, - "application/voucher-jws+json": { - "source": "iana", - "compressible": true - }, - "application/vp": { - "source": "iana" - }, - "application/vp+cose": { - "source": "iana" - }, - "application/vp+jwt": { - "source": "iana" - }, "application/vq-rtcpxr": { "source": "iana" }, @@ -6353,9 +5677,6 @@ "source": "apache", "extensions": ["torrent"] }, - "application/x-blender": { - "extensions": ["blend"] - }, "application/x-blorb": { "source": "apache", "extensions": ["blb","blorb"] @@ -6400,9 +5721,6 @@ "application/x-compress": { "source": "apache" }, - "application/x-compressed": { - "extensions": ["rar"] - }, "application/x-conference": { "source": "apache", "extensions": ["nsc"] @@ -6547,10 +5865,6 @@ "source": "apache", "extensions": ["install"] }, - "application/x-ipynb+json": { - "compressible": true, - "extensions": ["ipynb"] - }, "application/x-iso9660-image": { "source": "apache", "extensions": ["iso"] @@ -6882,9 +6196,6 @@ "source": "apache", "extensions": ["xz"] }, - "application/x-zip-compressed": { - "extensions": ["zip"] - }, "application/x-zmachine": { "source": "apache", "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] @@ -6943,10 +6254,6 @@ "compressible": true, "extensions": ["xenc"] }, - "application/xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, "application/xhtml+xml": { "source": "iana", "compressible": true, @@ -7007,16 +6314,10 @@ "compressible": true, "extensions": ["mxml","xhvml","xvml","xvm"] }, - "application/yaml": { - "source": "iana" - }, "application/yang": { "source": "iana", "extensions": ["yang"] }, - "application/yang-data+cbor": { - "source": "iana" - }, "application/yang-data+json": { "source": "iana", "compressible": true @@ -7033,10 +6334,6 @@ "source": "iana", "compressible": true }, - "application/yang-sid+json": { - "source": "iana", - "compressible": true - }, "application/yin+xml": { "source": "iana", "compressible": true, @@ -7047,9 +6344,6 @@ "compressible": false, "extensions": ["zip"] }, - "application/zip+dotlottie": { - "extensions": ["lottie"] - }, "application/zlib": { "source": "iana" }, @@ -7071,8 +6365,7 @@ "source": "iana" }, "audio/aac": { - "source": "iana", - "extensions": ["adts","aac"] + "source": "iana" }, "audio/ac3": { "source": "iana" @@ -7195,9 +6488,6 @@ "audio/evs": { "source": "iana" }, - "audio/flac": { - "source": "iana" - }, "audio/flexfec": { "source": "iana" }, @@ -7280,9 +6570,6 @@ "audio/lpc": { "source": "iana" }, - "audio/matroska": { - "source": "iana" - }, "audio/melp": { "source": "iana" }, @@ -7302,9 +6589,6 @@ "source": "apache", "extensions": ["mid","midi","kar","rmi"] }, - "audio/midi-clip": { - "source": "iana" - }, "audio/mobile-xmf": { "source": "iana", "extensions": ["mxmf"] @@ -7316,7 +6600,7 @@ "audio/mp4": { "source": "iana", "compressible": false, - "extensions": ["m4a","mp4a","m4b"] + "extensions": ["m4a","mp4a"] }, "audio/mp4a-latm": { "source": "iana" @@ -7566,7 +6850,7 @@ "source": "iana" }, "audio/vnd.qcelp": { - "source": "apache" + "source": "iana" }, "audio/vnd.rhetorex.32kadpcm": { "source": "iana" @@ -7725,7 +7009,6 @@ "extensions": ["exr"] }, "image/apng": { - "source": "iana", "compressible": false, "extensions": ["apng"] }, @@ -7745,7 +7028,7 @@ "image/bmp": { "source": "iana", "compressible": true, - "extensions": ["bmp","dib"] + "extensions": ["bmp"] }, "image/cgm": { "source": "iana", @@ -7755,10 +7038,6 @@ "source": "iana", "extensions": ["drle"] }, - "image/dpx": { - "source": "iana", - "extensions": ["dpx"] - }, "image/emf": { "source": "iana", "extensions": ["emf"] @@ -7796,21 +7075,14 @@ "source": "iana", "extensions": ["hej2"] }, + "image/hsj2": { + "source": "iana", + "extensions": ["hsj2"] + }, "image/ief": { "source": "iana", "extensions": ["ief"] }, - "image/j2c": { - "source": "iana" - }, - "image/jaii": { - "source": "iana", - "extensions": ["jaii"] - }, - "image/jais": { - "source": "iana", - "extensions": ["jais"] - }, "image/jls": { "source": "iana", "extensions": ["jls"] @@ -7823,7 +7095,7 @@ "image/jpeg": { "source": "iana", "compressible": false, - "extensions": ["jpg","jpeg","jpe"] + "extensions": ["jpeg","jpg","jpe"] }, "image/jph": { "source": "iana", @@ -7836,17 +7108,13 @@ "image/jpm": { "source": "iana", "compressible": false, - "extensions": ["jpm","jpgm"] + "extensions": ["jpm"] }, "image/jpx": { "source": "iana", "compressible": false, "extensions": ["jpx","jpf"] }, - "image/jxl": { - "source": "iana", - "extensions": ["jxl"] - }, "image/jxr": { "source": "iana", "extensions": ["jxr"] @@ -7887,8 +7155,7 @@ "source": "iana" }, "image/pjpeg": { - "compressible": false, - "extensions": ["jfif"] + "compressible": false }, "image/png": { "source": "iana", @@ -7897,7 +7164,7 @@ }, "image/prs.btif": { "source": "iana", - "extensions": ["btif","btf"] + "extensions": ["btif"] }, "image/prs.pti": { "source": "iana", @@ -7937,9 +7204,6 @@ "source": "iana", "extensions": ["azv"] }, - "image/vnd.clip": { - "source": "iana" - }, "image/vnd.cns.inf2": { "source": "iana" }, @@ -8053,7 +7317,7 @@ "extensions": ["pcx"] }, "image/webp": { - "source": "iana", + "source": "apache", "extensions": ["webp"] }, "image/wmf": { @@ -8064,9 +7328,6 @@ "source": "apache", "extensions": ["3ds"] }, - "image/x-adobe-dng": { - "extensions": ["dng"] - }, "image/x-cmu-raster": { "source": "apache", "extensions": ["ras"] @@ -8075,9 +7336,6 @@ "source": "apache", "extensions": ["cmx"] }, - "image/x-emf": { - "source": "iana" - }, "image/x-freehand": { "source": "apache", "extensions": ["fh","fhc","fh4","fh5","fh7"] @@ -8132,9 +7390,6 @@ "source": "apache", "extensions": ["tga"] }, - "image/x-wmf": { - "source": "iana" - }, "image/x-xbitmap": { "source": "apache", "extensions": ["xbm"] @@ -8150,9 +7405,6 @@ "source": "apache", "extensions": ["xwd"] }, - "message/bhttp": { - "source": "iana" - }, "message/cpim": { "source": "iana" }, @@ -8195,16 +7447,7 @@ "source": "iana", "compressible": true }, - "message/mls": { - "source": "iana" - }, "message/news": { - "source": "apache" - }, - "message/ohttp-req": { - "source": "iana" - }, - "message/ohttp-res": { "source": "iana" }, "message/partial": { @@ -8214,10 +7457,10 @@ "message/rfc822": { "source": "iana", "compressible": true, - "extensions": ["eml","mime","mht","mhtml"] + "extensions": ["eml","mime"] }, "message/s-http": { - "source": "apache" + "source": "iana" }, "message/sip": { "source": "iana" @@ -8229,7 +7472,7 @@ "source": "iana" }, "message/vnd.si.simp": { - "source": "apache" + "source": "iana" }, "message/vnd.wfa.wsc": { "source": "iana", @@ -8257,10 +7500,6 @@ "compressible": false, "extensions": ["igs","iges"] }, - "model/jt": { - "source": "iana", - "extensions": ["jt"] - }, "model/mesh": { "source": "iana", "compressible": false, @@ -8274,13 +7513,8 @@ "source": "iana", "extensions": ["obj"] }, - "model/prc": { - "source": "iana", - "extensions": ["prc"] - }, "model/step": { - "source": "iana", - "extensions": ["step","stp","stpnc","p21","210"] + "source": "iana" }, "model/step+xml": { "source": "iana", @@ -8301,18 +7535,6 @@ "source": "iana", "extensions": ["stl"] }, - "model/u3d": { - "source": "iana", - "extensions": ["u3d"] - }, - "model/vnd.bary": { - "source": "iana", - "extensions": ["bary"] - }, - "model/vnd.cld": { - "source": "iana", - "extensions": ["cld"] - }, "model/vnd.collada+xml": { "source": "iana", "compressible": true, @@ -8360,8 +7582,7 @@ "extensions": ["x_t"] }, "model/vnd.pytha.pyox": { - "source": "iana", - "extensions": ["pyo","pyox"] + "source": "iana" }, "model/vnd.rosette.annotated-data-model": { "source": "iana" @@ -8370,10 +7591,6 @@ "source": "iana", "extensions": ["vds"] }, - "model/vnd.usda": { - "source": "iana", - "extensions": ["usda"] - }, "model/vnd.usdz+zip": { "source": "iana", "compressible": false, @@ -8519,7 +7736,7 @@ "source": "iana" }, "text/ecmascript": { - "source": "apache" + "source": "iana" }, "text/encaprtp": { "source": "iana" @@ -8542,9 +7759,6 @@ "text/grammar-ref-list": { "source": "iana" }, - "text/hl7v2": { - "source": "iana" - }, "text/html": { "source": "iana", "compressible": true, @@ -8555,9 +7769,7 @@ }, "text/javascript": { "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js","mjs"] + "compressible": true }, "text/jcr-cnd": { "source": "iana" @@ -8573,7 +7785,7 @@ "text/markdown": { "source": "iana", "compressible": true, - "extensions": ["md","markdown"] + "extensions": ["markdown","md"] }, "text/mathml": { "source": "nginx", @@ -8618,9 +7830,6 @@ "text/prs.prop.logic": { "source": "iana" }, - "text/prs.texi": { - "source": "iana" - }, "text/raptorfec": { "source": "iana" }, @@ -8743,9 +7952,6 @@ "source": "iana", "charset": "UTF-8" }, - "text/vnd.exchangeable": { - "source": "iana" - }, "text/vnd.familysearch.gedcom": { "source": "iana", "extensions": ["ged"] @@ -8807,7 +8013,7 @@ "source": "iana" }, "text/vnd.si.uricatalogue": { - "source": "apache" + "source": "iana" }, "text/vnd.sosi": { "source": "iana" @@ -8821,9 +8027,6 @@ "source": "iana", "charset": "UTF-8" }, - "text/vnd.vcf": { - "source": "iana" - }, "text/vnd.wap.si": { "source": "iana" }, @@ -8838,19 +8041,12 @@ "source": "iana", "extensions": ["wmls"] }, - "text/vnd.zoo.kcl": { - "source": "iana" - }, "text/vtt": { "source": "iana", "charset": "UTF-8", "compressible": true, "extensions": ["vtt"] }, - "text/wgsl": { - "source": "iana", - "extensions": ["wgsl"] - }, "text/x-asm": { "source": "apache", "extensions": ["s","asm"] @@ -8981,9 +8177,6 @@ "video/encaprtp": { "source": "iana" }, - "video/evc": { - "source": "iana" - }, "video/ffv1": { "source": "iana" }, @@ -9017,9 +8210,6 @@ "video/h265": { "source": "iana" }, - "video/h266": { - "source": "iana" - }, "video/iso.segment": { "source": "iana", "extensions": ["m4s"] @@ -9038,16 +8228,6 @@ "video/jxsv": { "source": "iana" }, - "video/lottie+json": { - "source": "iana", - "compressible": true - }, - "video/matroska": { - "source": "iana" - }, - "video/matroska-3d": { - "source": "iana" - }, "video/mj2": { "source": "iana", "extensions": ["mj2","mjp2"] @@ -9060,7 +8240,7 @@ }, "video/mp2t": { "source": "iana", - "extensions": ["ts","m2t","m2ts","mts"] + "extensions": ["ts"] }, "video/mp4": { "source": "iana", @@ -9223,14 +8403,11 @@ "video/vnd.objectvideo": { "source": "iana" }, - "video/vnd.planar": { - "source": "iana" - }, "video/vnd.radgamettools.bink": { "source": "iana" }, "video/vnd.radgamettools.smacker": { - "source": "apache" + "source": "iana" }, "video/vnd.sealed.mpeg1": { "source": "iana" diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json index 289a370..32c14b8 100644 --- a/node_modules/mime-db/package.json +++ b/node_modules/mime-db/package.json @@ -1,7 +1,7 @@ { "name": "mime-db", "description": "Media Type Database", - "version": "1.54.0", + "version": "1.52.0", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)", @@ -19,19 +19,23 @@ ], "repository": "jshttp/mime-db", "devDependencies": { + "bluebird": "3.7.2", + "co": "4.6.0", + "cogent": "1.0.1", "csv-parse": "4.16.3", - "eslint": "8.32.0", + "eslint": "7.32.0", "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.1.1", + "eslint-plugin-promise": "5.1.1", "eslint-plugin-standard": "4.1.0", + "gnode": "0.1.2", "media-typer": "1.1.0", - "mocha": "10.2.0", + "mocha": "9.2.1", "nyc": "15.1.0", - "stream-to-array": "2.3.0", - "undici": "7.1.0" + "raw-body": "2.5.0", + "stream-to-array": "2.3.0" }, "files": [ "HISTORY.md", @@ -45,10 +49,10 @@ }, "scripts": { "build": "node scripts/build", - "fetch": "node scripts/fetch-apache && node scripts/fetch-iana && node scripts/fetch-nginx", + "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks test/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test", "update": "npm run fetch && npm run build", "version": "node scripts/version-history.js && git add HISTORY.md" diff --git a/node_modules/mime-types/HISTORY.md b/node_modules/mime-types/HISTORY.md index 9ba2dc0..c5043b7 100644 --- a/node_modules/mime-types/HISTORY.md +++ b/node_modules/mime-types/HISTORY.md @@ -1,34 +1,3 @@ -3.0.2 / 2025-11-20 -=================== - -* Fix: update JSDoc to reflect that functions return only `false` or `string`, not `boolean|string`. -* Fix: refined mime-score logic so `.mp4` resolves correctly -* Fix:reflect the current Node.js version supported to ≥ 18 (See 3.0.0 for more details). - -3.0.1 / 2025-03-26 -=================== - -* deps: mime-db@1.54.0 - -3.0.0 / 2024-08-31 -=================== - -* Drop support for node <18 -* deps: mime-db@1.53.0 -* resolve extension conflicts with mime-score (#119) - * asc -> application/pgp-signature is now application/pgp-keys - * mpp -> application/vnd.ms-project is now application/dash-patch+xml - * ac -> application/vnd.nokia.n-gage.ac+xml is now application/pkix-attr-cert - * bdoc -> application/x-bdoc is now application/bdoc - * wmz -> application/x-msmetafile is now application/x-ms-wmz - * xsl -> application/xslt+xml is now application/xml - * wav -> audio/wave is now audio/wav - * rtf -> text/rtf is now application/rtf - * xml -> text/xml is now application/xml - * mp4 -> video/mp4 is now application/mp4 - * mpg4 -> video/mp4 is now application/mp4 - - 2.1.35 / 2022-03-12 =================== diff --git a/node_modules/mime-types/README.md b/node_modules/mime-types/README.md index 222d2b5..48d2fb4 100644 --- a/node_modules/mime-types/README.md +++ b/node_modules/mime-types/README.md @@ -29,19 +29,6 @@ This is a [Node.js](https://nodejs.org/en/) module available through the $ npm install mime-types ``` -## Note on MIME Type Data and Semver - -This package considers the programmatic api as the semver compatibility. Additionally, the package which provides the MIME data -for this package (`mime-db`) *also* considers it's programmatic api as the semver contract. This means the MIME type resolution is *not* considered -in the semver bumps. - -In the past the version of `mime-db` was pinned to give two decision points when adopting MIME data changes. This is no longer true. We still update the -`mime-db` package here as a `minor` release when necessary, but will use a `^` range going forward. This means that if you want to pin your `mime-db` data -you will need to do it in your application. While this expectation was not set in docs until now, it is how the pacakge operated, so we do not feel this is -a breaking change. - -If you wish to pin your `mime-db` version you can do that with overrides via your package manager of choice. See their documentation for how to correctly configure that. - ## Adding Types All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), diff --git a/node_modules/mime-types/index.js b/node_modules/mime-types/index.js index 9725ddf..b9f34d5 100644 --- a/node_modules/mime-types/index.js +++ b/node_modules/mime-types/index.js @@ -14,7 +14,6 @@ var db = require('mime-db') var extname = require('path').extname -var mimeScore = require('./mimeScore') /** * Module variables. @@ -36,7 +35,6 @@ exports.extension = extension exports.extensions = Object.create(null) exports.lookup = lookup exports.types = Object.create(null) -exports._extensionConflicts = [] // Populate the extensions/types maps populateMaps(exports.extensions, exports.types) @@ -45,7 +43,7 @@ populateMaps(exports.extensions, exports.types) * Get the default charset for a MIME type. * * @param {string} type - * @return {false|string} + * @return {boolean|string} */ function charset (type) { @@ -73,7 +71,7 @@ function charset (type) { * Create a full Content-Type header given a MIME type or extension. * * @param {string} str - * @return {false|string} + * @return {boolean|string} */ function contentType (str) { @@ -82,7 +80,9 @@ function contentType (str) { return false } - var mime = str.indexOf('/') === -1 ? exports.lookup(str) : str + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str if (!mime) { return false @@ -101,7 +101,7 @@ function contentType (str) { * Get the default extension for a MIME type. * * @param {string} type - * @return {false|string} + * @return {boolean|string} */ function extension (type) { @@ -126,7 +126,7 @@ function extension (type) { * Lookup the MIME type for a file path/extension. * * @param {string} path - * @return {false|string} + * @return {boolean|string} */ function lookup (path) { @@ -137,7 +137,7 @@ function lookup (path) { // get the extension ("ext" or ".ext" or full path) var extension = extname('x.' + path) .toLowerCase() - .slice(1) + .substr(1) if (!extension) { return false @@ -152,6 +152,9 @@ function lookup (path) { */ function populateMaps (extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana'] + Object.keys(db).forEach(function forEachMimeType (type) { var mime = db[type] var exts = mime.extensions @@ -166,46 +169,20 @@ function populateMaps (extensions, types) { // extension -> mime for (var i = 0; i < exts.length; i++) { var extension = exts[i] - types[extension] = _preferredType(extension, types[extension], type) - // DELETE (eventually): Capture extension->type maps that change as a - // result of switching to mime-score. This is just to help make reviewing - // PR #119 easier, and can be removed once that PR is approved. - const legacyType = _preferredTypeLegacy( - extension, - types[extension], - type - ) - if (legacyType !== types[extension]) { - exports._extensionConflicts.push([extension, legacyType, types[extension]]) + if (types[extension]) { + var from = preference.indexOf(db[types[extension]].source) + var to = preference.indexOf(mime.source) + + if (types[extension] !== 'application/octet-stream' && + (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { + // skip the remapping + continue + } } + + // set the extension -> mime + types[extension] = type } }) } - -// Resolve type conflict using mime-score -function _preferredType (ext, type0, type1) { - var score0 = type0 ? mimeScore(type0, db[type0].source) : 0 - var score1 = type1 ? mimeScore(type1, db[type1].source) : 0 - - return score0 > score1 ? type0 : type1 -} - -// Resolve type conflict using pre-mime-score logic -function _preferredTypeLegacy (ext, type0, type1) { - var SOURCE_RANK = ['nginx', 'apache', undefined, 'iana'] - - var score0 = type0 ? SOURCE_RANK.indexOf(db[type0].source) : 0 - var score1 = type1 ? SOURCE_RANK.indexOf(db[type1].source) : 0 - - if ( - exports.types[extension] !== 'application/octet-stream' && - (score0 > score1 || - (score0 === score1 && - exports.types[extension]?.slice(0, 12) === 'application/')) - ) { - return type0 - } - - return score0 > score1 ? type0 : type1 -} diff --git a/node_modules/mime-types/mimeScore.js b/node_modules/mime-types/mimeScore.js deleted file mode 100644 index fc2e665..0000000 --- a/node_modules/mime-types/mimeScore.js +++ /dev/null @@ -1,57 +0,0 @@ -// 'mime-score' back-ported to CommonJS - -// Score RFC facets (see https://tools.ietf.org/html/rfc6838#section-3) -var FACET_SCORES = { - 'prs.': 100, - 'x-': 200, - 'x.': 300, - 'vnd.': 400, - default: 900 -} - -// Score mime source (Logic originally from `jshttp/mime-types` module) -var SOURCE_SCORES = { - nginx: 10, - apache: 20, - iana: 40, - default: 30 // definitions added by `jshttp/mime-db` project? -} - -var TYPE_SCORES = { - // prefer application/xml over text/xml - // prefer application/rtf over text/rtf - application: 1, - - // prefer font/woff over application/font-woff - font: 2, - - // prefer video/mp4 over audio/mp4 over application/mp4 - // See https://www.rfc-editor.org/rfc/rfc4337.html#section-2 - audio: 2, - video: 3, - - default: 0 -} - -/** - * Get each component of the score for a mime type. The sum of these is the - * total score. The higher the score, the more "official" the type. - */ -module.exports = function mimeScore (mimeType, source = 'default') { - if (mimeType === 'application/octet-stream') { - return 0 - } - - const [type, subtype] = mimeType.split('/') - - const facet = subtype.replace(/(\.|x-).*/, '$1') - - const facetScore = FACET_SCORES[facet] || FACET_SCORES.default - const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default - const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default - - // All else being equal prefer shorter types - const lengthScore = 1 - mimeType.length / 100 - - return facetScore + sourceScore + typeScore + lengthScore -} diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json index 6c58c27..bbef696 100644 --- a/node_modules/mime-types/package.json +++ b/node_modules/mime-types/package.json @@ -1,7 +1,7 @@ { "name": "mime-types", "description": "The ultimate javascript content-type utility.", - "version": "3.0.2", + "version": "2.1.35", "contributors": [ "Douglas Christopher Wilson ", "Jeremiah Senkpiel (https://searchbeam.jit.su)", @@ -13,32 +13,27 @@ "types" ], "repository": "jshttp/mime-types", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, "dependencies": { - "mime-db": "^1.54.0" + "mime-db": "1.52.0" }, "devDependencies": { - "eslint": "8.33.0", + "eslint": "7.32.0", "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-markdown": "3.0.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.6.0", + "eslint-plugin-promise": "5.2.0", "eslint-plugin-standard": "4.1.0", - "mocha": "10.8.2", + "mocha": "9.2.2", "nyc": "15.1.0" }, "files": [ "HISTORY.md", "LICENSE", - "index.js", - "mimeScore.js" + "index.js" ], "engines": { - "node": ">=18" + "node": ">= 0.6" }, "scripts": { "lint": "eslint .", diff --git a/node_modules/mathjs/lib/esm/plain/number/relational.js b/node_modules/mime/.npmignore similarity index 100% rename from node_modules/mathjs/lib/esm/plain/number/relational.js rename to node_modules/mime/.npmignore diff --git a/node_modules/mime/CHANGELOG.md b/node_modules/mime/CHANGELOG.md new file mode 100644 index 0000000..f127535 --- /dev/null +++ b/node_modules/mime/CHANGELOG.md @@ -0,0 +1,164 @@ +# Changelog + +## v1.6.0 (24/11/2017) +*No changelog for this release.* + +--- + +## v2.0.4 (24/11/2017) +- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182) +- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181) + +--- + +## v1.5.0 (22/11/2017) +- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179) +- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178) +- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176) +- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175) +- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167) + +--- + +## v2.0.3 (25/09/2017) +*No changelog for this release.* + +--- + +## v1.4.1 (25/09/2017) +- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172) + +--- + +## v2.0.2 (15/09/2017) +- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165) +- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164) +- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163) +- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162) +- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161) +- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160) +- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152) +- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139) +- [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124) +- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113) + +--- + +## v2.0.1 (14/09/2017) +- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171) +- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170) + +--- + +## v2.0.0 (12/09/2017) +- [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168) + +--- + +## v1.4.0 (28/08/2017) +- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159) +- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158) +- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157) +- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147) +- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135) +- [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131) +- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129) +- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120) +- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118) +- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108) +- [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78) +- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74) + +--- + +## v1.3.6 (11/05/2017) +- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154) +- [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153) +- [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149) +- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141) +- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140) +- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130) +- [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126) +- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123) +- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121) +- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117) + +--- + +## v1.3.4 (06/02/2015) +*No changelog for this release.* + +--- + +## v1.3.3 (06/02/2015) +*No changelog for this release.* + +--- + +## v1.3.1 (05/02/2015) +- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111) +- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110) +- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94) +- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77) + +--- + +## v1.3.0 (05/02/2015) +- [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114) +- [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104) +- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102) +- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99) +- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98) +- [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88) +- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87) +- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86) +- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81) +- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68) + +--- + +## v1.2.11 (15/08/2013) +- [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65) +- [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63) +- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55) +- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52) + +--- + +## v1.2.10 (25/07/2013) +- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62) +- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51) + +--- + +## v1.2.9 (17/01/2013) +- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49) +- [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46) +- [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43) + +--- + +## v1.2.8 (10/01/2013) +- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47) +- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45) + +--- + +## v1.2.7 (19/10/2012) +- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41) +- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36) +- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30) +- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27) + +--- + +## v1.2.5 (16/02/2012) +- [**closed**] When looking up a types, check hasOwnProperty [#23](https://github.com/broofa/node-mime/issues/23) +- [**closed**] Bump version to 1.2.2 [#18](https://github.com/broofa/node-mime/issues/18) +- [**closed**] No license [#16](https://github.com/broofa/node-mime/issues/16) +- [**closed**] Some types missing that are used by html5/css3 [#13](https://github.com/broofa/node-mime/issues/13) +- [**closed**] npm install fails for 1.2.1 [#12](https://github.com/broofa/node-mime/issues/12) +- [**closed**] image/pjpeg + image/x-png [#10](https://github.com/broofa/node-mime/issues/10) +- [**closed**] symlink [#8](https://github.com/broofa/node-mime/issues/8) +- [**closed**] gzip [#2](https://github.com/broofa/node-mime/issues/2) +- [**closed**] ALL CAPS filenames return incorrect mime type [#1](https://github.com/broofa/node-mime/issues/1) diff --git a/node_modules/mime/LICENSE b/node_modules/mime/LICENSE new file mode 100644 index 0000000..d3f46f7 --- /dev/null +++ b/node_modules/mime/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +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/node_modules/mime/README.md b/node_modules/mime/README.md new file mode 100644 index 0000000..506fbe5 --- /dev/null +++ b/node_modules/mime/README.md @@ -0,0 +1,90 @@ +# mime + +Comprehensive MIME type mapping API based on mime-db module. + +## Install + +Install with [npm](http://github.com/isaacs/npm): + + npm install mime + +## Contributing / Testing + + npm run test + +## Command Line + + mime [path_string] + +E.g. + + > mime scripts/jquery.js + application/javascript + +## API - Queries + +### mime.lookup(path) +Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. + +```js +var mime = require('mime'); + +mime.lookup('/path/to/file.txt'); // => 'text/plain' +mime.lookup('file.txt'); // => 'text/plain' +mime.lookup('.TXT'); // => 'text/plain' +mime.lookup('htm'); // => 'text/html' +``` + +### mime.default_type +Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) + +### mime.extension(type) +Get the default extension for `type` + +```js +mime.extension('text/html'); // => 'html' +mime.extension('application/octet-stream'); // => 'bin' +``` + +### mime.charsets.lookup() + +Map mime-type to charset + +```js +mime.charsets.lookup('text/plain'); // => 'UTF-8' +``` + +(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) + +## API - Defining Custom Types + +Custom type mappings can be added on a per-project basis via the following APIs. + +### mime.define() + +Add custom mime/extension mappings + +```js +mime.define({ + 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], + 'application/x-my-type': ['x-mt', 'x-mtt'], + // etc ... +}); + +mime.lookup('x-sft'); // => 'text/x-some-format' +``` + +The first entry in the extensions array is returned by `mime.extension()`. E.g. + +```js +mime.extension('text/x-some-format'); // => 'x-sf' +``` + +### mime.load(filepath) + +Load mappings from an Apache ".types" format file + +```js +mime.load('./my_project.types'); +``` +The .types file format is simple - See the `types` dir for examples. diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js new file mode 100644 index 0000000..20b1ffe --- /dev/null +++ b/node_modules/mime/cli.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var mime = require('./mime.js'); +var file = process.argv[2]; +var type = mime.lookup(file); + +process.stdout.write(type + '\n'); + diff --git a/node_modules/mime/mime.js b/node_modules/mime/mime.js new file mode 100644 index 0000000..d7efbde --- /dev/null +++ b/node_modules/mime/mime.js @@ -0,0 +1,108 @@ +var path = require('path'); +var fs = require('fs'); + +function Mime() { + // Map of extension -> mime type + this.types = Object.create(null); + + // Map of mime type -> extension + this.extensions = Object.create(null); +} + +/** + * Define mimetype -> extension mappings. Each key is a mime-type that maps + * to an array of extensions associated with the type. The first extension is + * used as the default extension for the type. + * + * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); + * + * @param map (Object) type definitions + */ +Mime.prototype.define = function (map) { + for (var type in map) { + var exts = map[type]; + for (var i = 0; i < exts.length; i++) { + if (process.env.DEBUG_MIME && this.types[exts[i]]) { + console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + + this.types[exts[i]] + ' to ' + type); + } + + this.types[exts[i]] = type; + } + + // Default extension is the first one we encounter + if (!this.extensions[type]) { + this.extensions[type] = exts[0]; + } + } +}; + +/** + * Load an Apache2-style ".types" file + * + * This may be called multiple times (it's expected). Where files declare + * overlapping types/extensions, the last file wins. + * + * @param file (String) path of file to load. + */ +Mime.prototype.load = function(file) { + this._loading = file; + // Read file and split into lines + var map = {}, + content = fs.readFileSync(file, 'ascii'), + lines = content.split(/[\r\n]+/); + + lines.forEach(function(line) { + // Clean up whitespace/comments, and split into fields + var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); + map[fields.shift()] = fields; + }); + + this.define(map); + + this._loading = null; +}; + +/** + * Lookup a mime type based on extension + */ +Mime.prototype.lookup = function(path, fallback) { + var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase(); + + return this.types[ext] || fallback || this.default_type; +}; + +/** + * Return file extension associated with a mime type + */ +Mime.prototype.extension = function(mimeType) { + var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); + return this.extensions[type]; +}; + +// Default instance +var mime = new Mime(); + +// Define built-in types +mime.define(require('./types.json')); + +// Default type +mime.default_type = mime.lookup('bin'); + +// +// Additional API specific to the default instance +// + +mime.Mime = Mime; + +/** + * Lookup a charset based on mime type. + */ +mime.charsets = { + lookup: function(mimeType, fallback) { + // Assume text types are utf8 + return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback; + } +}; + +module.exports = mime; diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json new file mode 100644 index 0000000..6bd24bc --- /dev/null +++ b/node_modules/mime/package.json @@ -0,0 +1,44 @@ +{ + "author": { + "name": "Robert Kieffer", + "url": "http://github.com/broofa", + "email": "robert@broofa.com" + }, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + }, + "contributors": [ + { + "name": "Benjamin Thomas", + "url": "http://github.com/bentomas", + "email": "benjamin@benjaminthomas.org" + } + ], + "description": "A comprehensive library for mime-type mapping", + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "github-release-notes": "0.13.1", + "mime-db": "1.31.0", + "mime-score": "1.1.0" + }, + "scripts": { + "prepare": "node src/build.js", + "changelog": "gren changelog --tags=all --generate --override", + "test": "node src/test.js" + }, + "keywords": [ + "util", + "mime" + ], + "main": "mime.js", + "name": "mime", + "repository": { + "url": "https://github.com/broofa/node-mime", + "type": "git" + }, + "version": "1.6.0" +} diff --git a/node_modules/mime/src/build.js b/node_modules/mime/src/build.js new file mode 100644 index 0000000..4928e48 --- /dev/null +++ b/node_modules/mime/src/build.js @@ -0,0 +1,53 @@ +#!/usr/bin/env node + +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const mimeScore = require('mime-score'); + +let db = require('mime-db'); +let chalk = require('chalk'); + +const STANDARD_FACET_SCORE = 900; + +const byExtension = {}; + +// Clear out any conflict extensions in mime-db +for (let type in db) { + let entry = db[type]; + entry.type = type; + + if (!entry.extensions) continue; + + entry.extensions.forEach(ext => { + if (ext in byExtension) { + const e0 = entry; + const e1 = byExtension[ext]; + e0.pri = mimeScore(e0.type, e0.source); + e1.pri = mimeScore(e1.type, e1.source); + + let drop = e0.pri < e1.pri ? e0 : e1; + let keep = e0.pri >= e1.pri ? e0 : e1; + drop.extensions = drop.extensions.filter(e => e !== ext); + + console.log(`${ext}: Keeping ${chalk.green(keep.type)} (${keep.pri}), dropping ${chalk.red(drop.type)} (${drop.pri})`); + } + byExtension[ext] = entry; + }); +} + +function writeTypesFile(types, path) { + fs.writeFileSync(path, JSON.stringify(types)); +} + +// Segregate into standard and non-standard types based on facet per +// https://tools.ietf.org/html/rfc6838#section-3.1 +const types = {}; + +Object.keys(db).sort().forEach(k => { + const entry = db[k]; + types[entry.type] = entry.extensions; +}); + +writeTypesFile(types, path.join(__dirname, '..', 'types.json')); diff --git a/node_modules/mime/src/test.js b/node_modules/mime/src/test.js new file mode 100644 index 0000000..42958a2 --- /dev/null +++ b/node_modules/mime/src/test.js @@ -0,0 +1,60 @@ +/** + * Usage: node test.js + */ + +var mime = require('../mime'); +var assert = require('assert'); +var path = require('path'); + +// +// Test mime lookups +// + +assert.equal('text/plain', mime.lookup('text.txt')); // normal file +assert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercase +assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file +assert.equal('text/plain', mime.lookup('.text.txt')); // hidden file +assert.equal('text/plain', mime.lookup('.txt')); // nameless +assert.equal('text/plain', mime.lookup('txt')); // extension-only +assert.equal('text/plain', mime.lookup('/txt')); // extension-less () +assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-less +assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized +assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default + +// +// Test extensions +// + +assert.equal('txt', mime.extension(mime.types.text)); +assert.equal('html', mime.extension(mime.types.htm)); +assert.equal('bin', mime.extension('application/octet-stream')); +assert.equal('bin', mime.extension('application/octet-stream ')); +assert.equal('html', mime.extension(' text/html; charset=UTF-8')); +assert.equal('html', mime.extension('text/html; charset=UTF-8 ')); +assert.equal('html', mime.extension('text/html; charset=UTF-8')); +assert.equal('html', mime.extension('text/html ; charset=UTF-8')); +assert.equal('html', mime.extension('text/html;charset=UTF-8')); +assert.equal('html', mime.extension('text/Html;charset=UTF-8')); +assert.equal(undefined, mime.extension('unrecognized')); + +// +// Test node.types lookups +// + +assert.equal('font/woff', mime.lookup('file.woff')); +assert.equal('application/octet-stream', mime.lookup('file.buffer')); +// TODO: Uncomment once #157 is resolved +// assert.equal('audio/mp4', mime.lookup('file.m4a')); +assert.equal('font/otf', mime.lookup('file.otf')); + +// +// Test charsets +// + +assert.equal('UTF-8', mime.charsets.lookup('text/plain')); +assert.equal('UTF-8', mime.charsets.lookup(mime.types.js)); +assert.equal('UTF-8', mime.charsets.lookup(mime.types.json)); +assert.equal(undefined, mime.charsets.lookup(mime.types.bin)); +assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); + +console.log('\nAll tests passed'); diff --git a/node_modules/mime/types.json b/node_modules/mime/types.json new file mode 100644 index 0000000..bec78ab --- /dev/null +++ b/node_modules/mime/types.json @@ -0,0 +1 @@ +{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} \ No newline at end of file diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js index ea734fb..6a522b1 100644 --- a/node_modules/ms/index.js +++ b/node_modules/ms/index.js @@ -6,7 +6,6 @@ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; -var w = d * 7; var y = d * 365.25; /** @@ -23,12 +22,12 @@ var y = d * 365.25; * @api public */ -module.exports = function (val, options) { +module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); - } else if (type === 'number' && isFinite(val)) { + } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( @@ -50,7 +49,7 @@ function parse(str) { if (str.length > 100) { return; } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { @@ -65,10 +64,6 @@ function parse(str) { case 'yr': case 'y': return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; case 'days': case 'day': case 'd': @@ -111,17 +106,16 @@ function parse(str) { */ function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { + if (ms >= d) { return Math.round(ms / d) + 'd'; } - if (msAbs >= h) { + if (ms >= h) { return Math.round(ms / h) + 'h'; } - if (msAbs >= m) { + if (ms >= m) { return Math.round(ms / m) + 'm'; } - if (msAbs >= s) { + if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; @@ -136,27 +130,23 @@ function fmtShort(ms) { */ function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; } /** * Pluralization helper. */ -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; } diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md index fa5d39b..69b6125 100644 --- a/node_modules/ms/license.md +++ b/node_modules/ms/license.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Vercel, Inc. +Copyright (c) 2016 Zeit, 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 diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json index 4997189..6a31c81 100644 --- a/node_modules/ms/package.json +++ b/node_modules/ms/package.json @@ -1,8 +1,8 @@ { "name": "ms", - "version": "2.1.3", - "description": "Tiny millisecond conversion utility", - "repository": "vercel/ms", + "version": "2.0.0", + "description": "Tiny milisecond conversion utility", + "repository": "zeit/ms", "main": "./index", "files": [ "index.js" @@ -28,11 +28,10 @@ }, "license": "MIT", "devDependencies": { - "eslint": "4.18.2", + "eslint": "3.19.0", "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1", - "prettier": "2.0.5" + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" } } diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md index 0fc1abb..84a9974 100644 --- a/node_modules/ms/readme.md +++ b/node_modules/ms/readme.md @@ -1,6 +1,7 @@ # ms -![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. @@ -16,44 +17,35 @@ ms('1m') // 60000 ms('5s') // 5000 ms('1y') // 31557600000 ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 ``` -### Convert from Milliseconds +### Convert from milliseconds ```js ms(60000) // "1m" ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" ms(ms('10 hours')) // "10h" ``` -### Time Format Written-Out +### Time format written-out ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" ms(ms('10 hours'), { long: true }) // "10 hours" ``` ## Features -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned +- Works both in [node](https://nodejs.org) and in the browser. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? +## Caught a bug? 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! As always, you can run the tests using: `npm test` diff --git a/node_modules/negotiator/HISTORY.md b/node_modules/negotiator/HISTORY.md index 63d537d..a9a5449 100644 --- a/node_modules/negotiator/HISTORY.md +++ b/node_modules/negotiator/HISTORY.md @@ -1,9 +1,3 @@ -1.0.0 / 2024-08-31 -================== - - * Drop support for node <18 - * Added an option preferred encodings array #59 - 0.6.3 / 2022-01-22 ================== diff --git a/node_modules/negotiator/README.md b/node_modules/negotiator/README.md index 6fb7f2d..82915e5 100644 --- a/node_modules/negotiator/README.md +++ b/node_modules/negotiator/README.md @@ -172,10 +172,6 @@ Returns the most preferred encoding from the client. Returns the most preferred encoding from a list of available encodings. -##### encoding(availableEncodings, { preferred }) - -Returns the most preferred encoding from a list of available encodings, while prioritizing based on `preferred` array between same-quality encodings. - ##### encodings() Returns an array of preferred encodings ordered by the client preference. @@ -185,11 +181,6 @@ Returns an array of preferred encodings ordered by the client preference. Returns an array of preferred encodings ordered by priority from a list of available encodings. -##### encodings(availableEncodings, { preferred }) - -Returns an array of preferred encodings ordered by priority from a list of -available encodings, while prioritizing based on `preferred` array between same-quality encodings. - ## See Also The [accepts](https://npmjs.org/package/accepts#readme) module builds on diff --git a/node_modules/negotiator/index.js b/node_modules/negotiator/index.js index 4f51315..4788264 100644 --- a/node_modules/negotiator/index.js +++ b/node_modules/negotiator/index.js @@ -44,14 +44,13 @@ Negotiator.prototype.charsets = function charsets(available) { return preferredCharsets(this.request.headers['accept-charset'], available); }; -Negotiator.prototype.encoding = function encoding(available, opts) { - var set = this.encodings(available, opts); +Negotiator.prototype.encoding = function encoding(available) { + var set = this.encodings(available); return set && set[0]; }; -Negotiator.prototype.encodings = function encodings(available, options) { - var opts = options || {}; - return preferredEncodings(this.request.headers['accept-encoding'], available, opts.preferred); +Negotiator.prototype.encodings = function encodings(available) { + return preferredEncodings(this.request.headers['accept-encoding'], available); }; Negotiator.prototype.language = function language(available) { diff --git a/node_modules/negotiator/lib/encoding.js b/node_modules/negotiator/lib/encoding.js index 9ebb633..8432cd7 100644 --- a/node_modules/negotiator/lib/encoding.js +++ b/node_modules/negotiator/lib/encoding.js @@ -96,7 +96,7 @@ function parseEncoding(str, i) { */ function getEncodingPriority(encoding, accepted, index) { - var priority = {encoding: encoding, o: -1, q: 0, s: 0}; + var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(encoding, accepted[i], index); @@ -123,7 +123,6 @@ function specify(encoding, spec, index) { } return { - encoding: encoding, i: index, o: spec.i, q: spec.q, @@ -136,34 +135,14 @@ function specify(encoding, spec, index) { * @public */ -function preferredEncodings(accept, provided, preferred) { +function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); - var comparator = preferred ? function comparator (a, b) { - if (a.q !== b.q) { - return b.q - a.q // higher quality first - } - - var aPreferred = preferred.indexOf(a.encoding) - var bPreferred = preferred.indexOf(b.encoding) - - if (aPreferred === -1 && bPreferred === -1) { - // consider the original specifity/order - return (b.s - a.s) || (a.o - b.o) || (a.i - b.i) - } - - if (aPreferred !== -1 && bPreferred !== -1) { - return aPreferred - bPreferred // consider the preferred order - } - - return aPreferred === -1 ? 1 : -1 // preferred first - } : compareSpecs; - if (!provided) { // sorted list of all encodings return accepts .filter(isQuality) - .sort(comparator) + .sort(compareSpecs) .map(getFullEncoding); } @@ -172,7 +151,7 @@ function preferredEncodings(accept, provided, preferred) { }); // sorted list of accepted encodings - return priorities.filter(isQuality).sort(comparator).map(function getEncoding(priority) { + return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { return provided[priorities.indexOf(priority)]; }); } @@ -183,7 +162,7 @@ function preferredEncodings(accept, provided, preferred) { */ function compareSpecs(a, b) { - return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i); + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** diff --git a/node_modules/negotiator/lib/mediaType.js b/node_modules/negotiator/lib/mediaType.js index 8e402ea..67309dd 100644 --- a/node_modules/negotiator/lib/mediaType.js +++ b/node_modules/negotiator/lib/mediaType.js @@ -69,7 +69,7 @@ function parseMediaType(str, i) { // get the value, unwrapping quotes var value = val && val[0] === '"' && val[val.length - 1] === '"' - ? val.slice(1, -1) + ? val.substr(1, val.length - 2) : val; if (key === 'q') { @@ -238,8 +238,8 @@ function splitKeyValuePair(str) { if (index === -1) { key = str; } else { - key = str.slice(0, index); - val = str.slice(index + 1); + key = str.substr(0, index); + val = str.substr(index + 1); } return [key, val]; diff --git a/node_modules/negotiator/package.json b/node_modules/negotiator/package.json index e4bdc1e..297635f 100644 --- a/node_modules/negotiator/package.json +++ b/node_modules/negotiator/package.json @@ -1,7 +1,7 @@ { "name": "negotiator", "description": "HTTP content negotiation", - "version": "1.0.0", + "version": "0.6.3", "contributors": [ "Douglas Christopher Wilson ", "Federico Romero ", @@ -36,7 +36,6 @@ "scripts": { "lint": "eslint .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", "test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test" } diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf8..0000000 --- a/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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/node_modules/object-assign/package.json b/node_modules/object-assign/package.json deleted file mode 100644 index 503eb1e..0000000 --- a/node_modules/object-assign/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "object-assign", - "version": "4.1.1", - "description": "ES2015 `Object.assign()` ponyfill", - "license": "MIT", - "repository": "sindresorhus/object-assign", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava", - "bench": "matcha bench.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - } -} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d3..0000000 --- a/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md deleted file mode 100644 index 1f1ffca..0000000 --- a/node_modules/once/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` - -## `once.strict(func)` - -Throw an error if the function is called twice. - -Some functions are expected to be called only once. Using `once` for them would -potentially hide logical errors. - -In the example below, the `greet` function has to call the callback only once: - -```javascript -function greet (name, cb) { - // return is missing from the if statement - // when no name is passed, the callback is called twice - if (!name) cb('Hello anonymous') - cb('Hello ' + name) -} - -function log (msg) { - console.log(msg) -} - -// this will print 'Hello anonymous' but the logical error will be missed -greet(null, once(msg)) - -// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time -greet(null, once.strict(msg)) -``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js deleted file mode 100644 index 2354067..0000000 --- a/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/node_modules/once/package.json b/node_modules/once/package.json deleted file mode 100644 index 16815b2..0000000 --- a/node_modules/once/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "once", - "version": "1.4.0", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "^7.0.1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "files": [ - "once.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC" -} diff --git a/node_modules/path-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md index f33e392..95452a6 100644 --- a/node_modules/path-to-regexp/Readme.md +++ b/node_modules/path-to-regexp/Readme.md @@ -1,224 +1,35 @@ # Path-to-RegExp -> Turn a path string such as `/user/:name` into a regular expression. +Turn an Express-style path string such as `/user/:name` into a regular expression. -[![NPM version][npm-image]][npm-url] -[![NPM downloads][downloads-image]][downloads-url] -[![Build status][build-image]][build-url] -[![Build coverage][coverage-image]][coverage-url] -[![License][license-image]][license-url] - -## Installation - -``` -npm install path-to-regexp --save -``` +**Note:** This is a legacy branch. You should upgrade to `1.x`. ## Usage -```js -const { - match, - pathToRegexp, - compile, - parse, - stringify, -} = require("path-to-regexp"); +```javascript +var pathToRegexp = require('path-to-regexp'); ``` -### Parameters +### pathToRegexp(path, keys, options) -Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`). + - **path** A string in the express format, an array of such strings, or a regular expression + - **keys** An array to be populated with the keys present in the url. Once the function completes, this will be an array of strings. + - **options** + - **options.sensitive** Defaults to false, set this to true to make routes case sensitive + - **options.strict** Defaults to false, set this to true to make the trailing slash matter. + - **options.end** Defaults to true, set this to false to only match the prefix of the URL. -```js -const fn = match("/:foo/:bar"); - -fn("/test/route"); -//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } } +```javascript +var keys = []; +var exp = pathToRegexp('/foo/:bar', keys); +//keys = ['bar'] +//exp = /^\/foo\/(?:([^\/]+?))\/?$/i ``` -### Wildcard +## Live Demo -Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`). - -```js -const fn = match("/*splat"); - -fn("/bar/baz"); -//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } } -``` - -### Optional - -Braces can be used to define parts of the path that are optional. - -```js -const fn = match("/users{/:id}/delete"); - -fn("/users/delete"); -//=> { path: '/users/delete', params: {} } - -fn("/users/123/delete"); -//=> { path: '/users/123/delete', params: { id: '123' } } -``` - -## Match - -The `match` function returns a function for matching strings against a path: - -- **path** String, `TokenData` object, or array of strings and `TokenData` objects. -- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options) - - **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`) - -```js -const fn = match("/foo/:bar"); -``` - -**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc). - -## PathToRegexp - -The `pathToRegexp` function returns the `regexp` for matching strings against paths, and an array of `keys` for understanding the `RegExp#exec` matches. - -- **path** String, `TokenData` object, or array of strings and `TokenData` objects. -- **options** _(optional)_ (See [parse](#parse) for more options) - - **sensitive** Regexp will be case sensitive. (default: `false`) - - **end** Validate the match reaches the end of the string. (default: `true`) - - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) - - **trailing** Allows optional trailing delimiter to match. (default: `true`) - -```js -const { regexp, keys } = pathToRegexp("/foo/:bar"); - -regexp.exec("/foo/123"); //=> ["/foo/123", "123"] -``` - -## Compile ("Reverse" Path-To-RegExp) - -The `compile` function will return a function for transforming parameters into a valid path: - -- **path** A string or `TokenData` object. -- **options** (See [parse](#parse) for more options) - - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) - - **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) - -```js -const toPath = compile("/user/:id"); - -toPath({ id: "name" }); //=> "/user/name" -toPath({ id: "café" }); //=> "/user/caf%C3%A9" - -const toPathRepeated = compile("/*segment"); - -toPathRepeated({ segment: ["foo"] }); //=> "/foo" -toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c" - -// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted. -const toPathRaw = compile("/user/:id", { encode: false }); - -toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F" -``` - -## Stringify - -Transform a `TokenData` object to a Path-to-RegExp string. - -- **data** A `TokenData` object. - -```js -const data = { - tokens: [ - { type: "text", value: "/" }, - { type: "param", name: "foo" }, - ], -}; - -const path = stringify(data); //=> "/:foo" -``` - -## Developers - -- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around. -- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`. - -### Parse - -The `parse` function accepts a string and returns `TokenData`, which can be used with `match` and `compile`. - -- **path** A string. -- **options** _(optional)_ - - **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl)) - -### Tokens - -`TokenData` has two properties: - -- **tokens** A sequence of tokens, currently of types `text`, `param`, `wildcard`, or `group`. -- **originalPath** The original path used with `parse`, shown in error messages to assist debugging. - -### Custom path - -In some applications you may not be able to use the `path-to-regexp` syntax, but you still want to use this library for `match` and `compile`. For example: - -```js -import { match } from "path-to-regexp"; - -const tokens = [ - { type: "text", value: "/" }, - { type: "param", name: "foo" }, -]; -const originalPath = "/[foo]"; // To help debug error messages. -const path = { tokens, originalPath }; -const fn = match(path); - -fn("/test"); //=> { path: '/test', params: { foo: 'test' } } -``` - -## Errors - -An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before. - -### Missing parameter name - -Parameter names must be provided after `:` or `*`, for example `/*path`. They can be valid JavaScript identifiers (e.g. `:myName`) or JSON strings (`:"my-name"`). - -### Unexpected `?` or `+` - -In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these: - -- For optional (`?`), use braces: `/file{.:ext}`. -- For one or more (`+`), use a wildcard: `/*path`. -- For zero or more (`*`), use both: `/files{/*path}`. - -### Unexpected `(`, `)`, `[`, `]`, etc. - -Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. `"\\("`. - -### Unterminated quote - -Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, `:"foo`. - -### Express <= 4.x - -Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways: - -- The wildcard `*` must have a name and matches the behavior of parameters `:`. -- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`. -- Regexp characters are not supported. -- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`). -- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`. +You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/). ## License -MIT - -[npm-image]: https://img.shields.io/npm/v/path-to-regexp -[npm-url]: https://npmjs.org/package/path-to-regexp -[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp -[downloads-url]: https://npmjs.org/package/path-to-regexp -[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master -[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster -[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp -[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp -[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat -[license-url]: LICENSE.md + MIT diff --git a/node_modules/path-to-regexp/dist/index.d.ts b/node_modules/path-to-regexp/dist/index.d.ts deleted file mode 100644 index c173a44..0000000 --- a/node_modules/path-to-regexp/dist/index.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -/** - * Encode a string into another string. - */ -export type Encode = (value: string) => string; -/** - * Decode a string into another string. - */ -export type Decode = (value: string) => string; -export interface ParseOptions { - /** - * A function for encoding input strings. - */ - encodePath?: Encode; -} -export interface PathToRegexpOptions { - /** - * Matches the path completely without trailing characters. (default: `true`) - */ - end?: boolean; - /** - * Allows optional trailing delimiter to match. (default: `true`) - */ - trailing?: boolean; - /** - * Match will be case sensitive. (default: `false`) - */ - sensitive?: boolean; - /** - * The default delimiter for segments. (default: `'/'`) - */ - delimiter?: string; -} -export interface MatchOptions extends PathToRegexpOptions { - /** - * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`) - */ - decode?: Decode | false; -} -export interface CompileOptions { - /** - * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) - */ - encode?: Encode | false; - /** - * The default delimiter for segments. (default: `'/'`) - */ - delimiter?: string; -} -/** - * Plain text. - */ -export interface Text { - type: "text"; - value: string; -} -/** - * A parameter designed to match arbitrary text within a segment. - */ -export interface Parameter { - type: "param"; - name: string; -} -/** - * A wildcard parameter designed to match multiple segments. - */ -export interface Wildcard { - type: "wildcard"; - name: string; -} -/** - * A set of possible tokens to expand when matching. - */ -export interface Group { - type: "group"; - tokens: Token[]; -} -/** - * A token that corresponds with a regexp capture. - */ -export type Key = Parameter | Wildcard; -/** - * A sequence of `path-to-regexp` keys that match capturing groups. - */ -export type Keys = Array; -/** - * A sequence of path match characters. - */ -export type Token = Text | Parameter | Wildcard | Group; -/** - * Tokenized path instance. - */ -export declare class TokenData { - readonly tokens: Token[]; - readonly originalPath?: string | undefined; - constructor(tokens: Token[], originalPath?: string | undefined); -} -/** - * ParseError is thrown when there is an error processing the path. - */ -export declare class PathError extends TypeError { - readonly originalPath: string | undefined; - constructor(message: string, originalPath: string | undefined); -} -/** - * Parse a string for the raw tokens. - */ -export declare function parse(str: string, options?: ParseOptions): TokenData; -/** - * Compile a string to a template function for the path. - */ -export declare function compile

    (path: Path, options?: CompileOptions & ParseOptions): (params?: P) => string; -export type ParamData = Partial>; -export type PathFunction

    = (data?: P) => string; -/** - * A match result contains data about the path match. - */ -export interface MatchResult

    { - path: string; - params: P; -} -/** - * A match is either `false` (no match) or a match result. - */ -export type Match

    = false | MatchResult

    ; -/** - * The match function takes a string and returns whether it matched the path. - */ -export type MatchFunction

    = (path: string) => Match

    ; -/** - * Supported path types. - */ -export type Path = string | TokenData; -/** - * Transform a path into a match function. - */ -export declare function match

    (path: Path | Path[], options?: MatchOptions & ParseOptions): MatchFunction

    ; -/** - * Transform a path into a regular expression and capture keys. - */ -export declare function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): { - regexp: RegExp; - keys: Keys; -}; -/** - * Stringify token data into a path string. - */ -export declare function stringify(data: TokenData): string; diff --git a/node_modules/path-to-regexp/dist/index.js b/node_modules/path-to-regexp/dist/index.js deleted file mode 100644 index 20cc46a..0000000 --- a/node_modules/path-to-regexp/dist/index.js +++ /dev/null @@ -1,426 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PathError = exports.TokenData = void 0; -exports.parse = parse; -exports.compile = compile; -exports.match = match; -exports.pathToRegexp = pathToRegexp; -exports.stringify = stringify; -const DEFAULT_DELIMITER = "/"; -const NOOP_VALUE = (value) => value; -const ID_START = /^[$_\p{ID_Start}]$/u; -const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u; -const ID = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u; -const SIMPLE_TOKENS = "{}()[]+?!"; -/** - * Escape text for stringify to path. - */ -function escapeText(str) { - return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&"); -} -/** - * Escape a regular expression string. - */ -function escape(str) { - return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&"); -} -/** - * Tokenized path instance. - */ -class TokenData { - constructor(tokens, originalPath) { - this.tokens = tokens; - this.originalPath = originalPath; - } -} -exports.TokenData = TokenData; -/** - * ParseError is thrown when there is an error processing the path. - */ -class PathError extends TypeError { - constructor(message, originalPath) { - let text = message; - if (originalPath) - text += `: ${originalPath}`; - text += `; visit https://git.new/pathToRegexpError for info`; - super(text); - this.originalPath = originalPath; - } -} -exports.PathError = PathError; -/** - * Parse a string for the raw tokens. - */ -function parse(str, options = {}) { - const { encodePath = NOOP_VALUE } = options; - const chars = [...str]; - const tokens = []; - let index = 0; - let pos = 0; - function name() { - let value = ""; - if (ID_START.test(chars[index])) { - do { - value += chars[index++]; - } while (ID_CONTINUE.test(chars[index])); - } - else if (chars[index] === '"') { - let quoteStart = index; - while (index < chars.length) { - if (chars[++index] === '"') { - index++; - quoteStart = 0; - break; - } - // Increment over escape characters. - if (chars[index] === "\\") - index++; - value += chars[index]; - } - if (quoteStart) { - throw new PathError(`Unterminated quote at index ${quoteStart}`, str); - } - } - if (!value) { - throw new PathError(`Missing parameter name at index ${index}`, str); - } - return value; - } - while (index < chars.length) { - const value = chars[index++]; - if (SIMPLE_TOKENS.includes(value)) { - tokens.push({ type: value, index, value }); - } - else if (value === "\\") { - tokens.push({ type: "escape", index, value: chars[index++] }); - } - else if (value === ":") { - tokens.push({ type: "param", index, value: name() }); - } - else if (value === "*") { - tokens.push({ type: "wildcard", index, value: name() }); - } - else { - tokens.push({ type: "char", index, value }); - } - } - tokens.push({ type: "end", index, value: "" }); - function consumeUntil(endType) { - const output = []; - while (true) { - const token = tokens[pos++]; - if (token.type === endType) - break; - if (token.type === "char" || token.type === "escape") { - let path = token.value; - let cur = tokens[pos]; - while (cur.type === "char" || cur.type === "escape") { - path += cur.value; - cur = tokens[++pos]; - } - output.push({ - type: "text", - value: encodePath(path), - }); - continue; - } - if (token.type === "param" || token.type === "wildcard") { - output.push({ - type: token.type, - name: token.value, - }); - continue; - } - if (token.type === "{") { - output.push({ - type: "group", - tokens: consumeUntil("}"), - }); - continue; - } - throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str); - } - return output; - } - return new TokenData(consumeUntil("end"), str); -} -/** - * Compile a string to a template function for the path. - */ -function compile(path, options = {}) { - const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; - const data = typeof path === "object" ? path : parse(path, options); - const fn = tokensToFunction(data.tokens, delimiter, encode); - return function path(params = {}) { - const [path, ...missing] = fn(params); - if (missing.length) { - throw new TypeError(`Missing parameters: ${missing.join(", ")}`); - } - return path; - }; -} -function tokensToFunction(tokens, delimiter, encode) { - const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode)); - return (data) => { - const result = [""]; - for (const encoder of encoders) { - const [value, ...extras] = encoder(data); - result[0] += value; - result.push(...extras); - } - return result; - }; -} -/** - * Convert a single token into a path building function. - */ -function tokenToFunction(token, delimiter, encode) { - if (token.type === "text") - return () => [token.value]; - if (token.type === "group") { - const fn = tokensToFunction(token.tokens, delimiter, encode); - return (data) => { - const [value, ...missing] = fn(data); - if (!missing.length) - return [value]; - return [""]; - }; - } - const encodeValue = encode || NOOP_VALUE; - if (token.type === "wildcard" && encode !== false) { - return (data) => { - const value = data[token.name]; - if (value == null) - return ["", token.name]; - if (!Array.isArray(value) || value.length === 0) { - throw new TypeError(`Expected "${token.name}" to be a non-empty array`); - } - return [ - value - .map((value, index) => { - if (typeof value !== "string") { - throw new TypeError(`Expected "${token.name}/${index}" to be a string`); - } - return encodeValue(value); - }) - .join(delimiter), - ]; - }; - } - return (data) => { - const value = data[token.name]; - if (value == null) - return ["", token.name]; - if (typeof value !== "string") { - throw new TypeError(`Expected "${token.name}" to be a string`); - } - return [encodeValue(value)]; - }; -} -/** - * Transform a path into a match function. - */ -function match(path, options = {}) { - const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; - const { regexp, keys } = pathToRegexp(path, options); - const decoders = keys.map((key) => { - if (decode === false) - return NOOP_VALUE; - if (key.type === "param") - return decode; - return (value) => value.split(delimiter).map(decode); - }); - return function match(input) { - const m = regexp.exec(input); - if (!m) - return false; - const path = m[0]; - const params = Object.create(null); - for (let i = 1; i < m.length; i++) { - if (m[i] === undefined) - continue; - const key = keys[i - 1]; - const decoder = decoders[i - 1]; - params[key.name] = decoder(m[i]); - } - return { path, params }; - }; -} -/** - * Transform a path into a regular expression and capture keys. - */ -function pathToRegexp(path, options = {}) { - const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options; - const keys = []; - const sources = []; - const paths = [path]; - let combinations = 0; - while (paths.length) { - const path = paths.shift(); - if (Array.isArray(path)) { - paths.push(...path); - continue; - } - const data = typeof path === "object" ? path : parse(path, options); - flatten(data.tokens, 0, [], (tokens) => { - if (combinations++ >= 256) { - throw new PathError("Too many path combinations", data.originalPath); - } - sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath)); - }); - } - let pattern = `^(?:${sources.join("|")})`; - if (trailing) - pattern += "(?:" + escape(delimiter) + "$)?"; - pattern += end ? "$" : "(?=" + escape(delimiter) + "|$)"; - return { regexp: new RegExp(pattern, sensitive ? "" : "i"), keys }; -} -/** - * Generate a flat list of sequence tokens from the given tokens. - */ -function flatten(tokens, index, result, callback) { - while (index < tokens.length) { - const token = tokens[index++]; - if (token.type === "group") { - flatten(token.tokens, 0, result.slice(), (seq) => flatten(tokens, index, seq, callback)); - continue; - } - result.push(token); - } - callback(result); -} -/** - * Transform a flat sequence of tokens into a regular expression. - */ -function toRegExpSource(tokens, delimiter, keys, originalPath) { - let result = ""; - let backtrack = ""; - let wildcardBacktrack = ""; - let prevCaptureType = 0; - let hasSegmentCapture = 0; - let index = 0; - function hasInSegment(index, type) { - while (index < tokens.length) { - const token = tokens[index++]; - if (token.type === type) - return true; - if (token.type === "text") { - if (token.value.includes(delimiter)) - break; - } - } - return false; - } - function peekText(index) { - let result = ""; - while (index < tokens.length) { - const token = tokens[index++]; - if (token.type !== "text") - break; - result += token.value; - } - return result; - } - while (index < tokens.length) { - const token = tokens[index++]; - if (token.type === "text") { - result += escape(token.value); - backtrack += token.value; - if (prevCaptureType === 2) - wildcardBacktrack += token.value; - if (token.value.includes(delimiter)) - hasSegmentCapture = 0; - continue; - } - if (token.type === "param" || token.type === "wildcard") { - if (prevCaptureType && !backtrack) { - throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath); - } - if (token.type === "param") { - result += - hasSegmentCapture & 2 // Seen wildcard in segment. - ? `(${negate(delimiter, backtrack)}+)` - : hasInSegment(index, "wildcard") // See wildcard later in segment. - ? `(${negate(delimiter, peekText(index))}+)` - : hasSegmentCapture & 1 // Seen parameter in segment. - ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})` - : `(${negate(delimiter, "")}+)`; - hasSegmentCapture |= prevCaptureType = 1; - } - else { - result += - hasSegmentCapture & 2 // Seen wildcard in segment. - ? `(${negate(backtrack, "")}+)` - : wildcardBacktrack // No capture in segment, seen wildcard in path. - ? `(${negate(wildcardBacktrack, "")}+|${negate(delimiter, "")}+)` - : `([^]+)`; - wildcardBacktrack = ""; - hasSegmentCapture |= prevCaptureType = 2; - } - keys.push(token); - backtrack = ""; - continue; - } - throw new TypeError(`Unknown token type: ${token.type}`); - } - return result; -} -/** - * Block backtracking on previous text/delimiter. - */ -function negate(a, b) { - if (b.length > a.length) - return negate(b, a); // Longest string first. - if (a === b) - b = ""; // Cleaner regex strings, no duplication. - if (b.length > 1) - return `(?:(?!${escape(a)}|${escape(b)})[^])`; - if (a.length > 1) - return `(?:(?!${escape(a)})[^${escape(b)}])`; - return `[^${escape(a + b)}]`; -} -/** - * Stringify an array of tokens into a path string. - */ -function stringifyTokens(tokens, index) { - let value = ""; - while (index < tokens.length) { - const token = tokens[index++]; - if (token.type === "text") { - value += escapeText(token.value); - continue; - } - if (token.type === "group") { - value += "{" + stringifyTokens(token.tokens, 0) + "}"; - continue; - } - if (token.type === "param") { - value += ":" + stringifyName(token.name, tokens[index]); - continue; - } - if (token.type === "wildcard") { - value += "*" + stringifyName(token.name, tokens[index]); - continue; - } - throw new TypeError(`Unknown token type: ${token.type}`); - } - return value; -} -/** - * Stringify token data into a path string. - */ -function stringify(data) { - return stringifyTokens(data.tokens, 0); -} -/** - * Stringify a parameter name, escaping when it cannot be emitted directly. - */ -function stringifyName(name, next) { - if (!ID.test(name)) - return JSON.stringify(name); - if ((next === null || next === void 0 ? void 0 : next.type) === "text" && ID_CONTINUE.test(next.value[0])) { - return JSON.stringify(name); - } - return name; -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-to-regexp/dist/index.js.map b/node_modules/path-to-regexp/dist/index.js.map deleted file mode 100644 index 1395704..0000000 --- a/node_modules/path-to-regexp/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAiLA,sBA6GC;AAKD,0BAgBC;AAgHD,sBA+BC;AAKD,oCAsCC;AAuKD,8BAEC;AAtpBD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AACxD,MAAM,EAAE,GAAG,oDAAo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AAI,CAAC;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhD,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["const DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value: string) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst ID = /^[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*$/u;\n\n/**\n * Encode a string into another string.\n */\nexport type Encode = (value: string) => string;\n\n/**\n * Decode a string into another string.\n */\nexport type Decode = (value: string) => string;\n\nexport interface ParseOptions {\n /**\n * A function for encoding input strings.\n */\n encodePath?: Encode;\n}\n\nexport interface PathToRegexpOptions {\n /**\n * Matches the path completely without trailing characters. (default: `true`)\n */\n end?: boolean;\n /**\n * Allows optional trailing delimiter to match. (default: `true`)\n */\n trailing?: boolean;\n /**\n * Match will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\nexport interface MatchOptions extends PathToRegexpOptions {\n /**\n * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`)\n */\n decode?: Decode | false;\n}\n\nexport interface CompileOptions {\n /**\n * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)\n */\n encode?: Encode | false;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\ntype TokenType =\n | \"{\"\n | \"}\"\n | \"wildcard\"\n | \"param\"\n | \"char\"\n | \"escape\"\n | \"end\"\n // Reserved for use or ambiguous due to past use.\n | \"(\"\n | \")\"\n | \"[\"\n | \"]\"\n | \"+\"\n | \"?\"\n | \"!\";\n\n/**\n * Tokenizer results.\n */\ninterface LexToken {\n type: TokenType;\n index: number;\n value: string;\n}\n\nconst SIMPLE_TOKENS = \"{}()[]+?!\";\n\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str: string) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escape(str: string) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Plain text.\n */\nexport interface Text {\n type: \"text\";\n value: string;\n}\n\n/**\n * A parameter designed to match arbitrary text within a segment.\n */\nexport interface Parameter {\n type: \"param\";\n name: string;\n}\n\n/**\n * A wildcard parameter designed to match multiple segments.\n */\nexport interface Wildcard {\n type: \"wildcard\";\n name: string;\n}\n\n/**\n * A set of possible tokens to expand when matching.\n */\nexport interface Group {\n type: \"group\";\n tokens: Token[];\n}\n\n/**\n * A token that corresponds with a regexp capture.\n */\nexport type Key = Parameter | Wildcard;\n\n/**\n * A sequence of `path-to-regexp` keys that match capturing groups.\n */\nexport type Keys = Array;\n\n/**\n * A sequence of path match characters.\n */\nexport type Token = Text | Parameter | Wildcard | Group;\n\n/**\n * Tokenized path instance.\n */\nexport class TokenData {\n constructor(\n public readonly tokens: Token[],\n public readonly originalPath?: string,\n ) {}\n}\n\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nexport class PathError extends TypeError {\n constructor(\n message: string,\n public readonly originalPath: string | undefined,\n ) {\n let text = message;\n if (originalPath) text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n }\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): TokenData {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens: Array = [];\n let index = 0;\n let pos = 0;\n\n function name() {\n let value = \"\";\n\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n } else if (chars[index] === '\"') {\n let quoteStart = index;\n\n while (index < chars.length) {\n if (chars[++index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n\n // Increment over escape characters.\n if (chars[index] === \"\\\\\") index++;\n\n value += chars[index];\n }\n\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n\n return value;\n }\n\n while (index < chars.length) {\n const value = chars[index++];\n\n if (SIMPLE_TOKENS.includes(value)) {\n tokens.push({ type: value as TokenType, index, value });\n } else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index, value: chars[index++] });\n } else if (value === \":\") {\n tokens.push({ type: \"param\", index, value: name() });\n } else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index, value: name() });\n } else {\n tokens.push({ type: \"char\", index, value });\n }\n }\n\n tokens.push({ type: \"end\", index, value: \"\" });\n\n function consumeUntil(endType: TokenType): Token[] {\n const output: Token[] = [];\n\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType) break;\n\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n\n throw new PathError(\n `Unexpected ${token.type} at index ${token.index}, expected ${endType}`,\n str,\n );\n }\n\n return output;\n }\n\n return new TokenData(consumeUntil(\"end\"), str);\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

    (\n path: Path,\n options: CompileOptions & ParseOptions = {},\n) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n\n return function path(params: P = {} as P) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\n\nexport type ParamData = Partial>;\nexport type PathFunction

    = (data?: P) => string;\n\nfunction tokensToFunction(\n tokens: Token[],\n delimiter: string,\n encode: Encode | false,\n) {\n const encoders = tokens.map((token) =>\n tokenToFunction(token, delimiter, encode),\n );\n\n return (data: ParamData) => {\n const result: string[] = [\"\"];\n\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n\n return result;\n };\n}\n\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(\n token: Token,\n delimiter: string,\n encode: Encode | false,\n): (data: ParamData) => string[] {\n if (token.type === \"text\") return () => [token.value];\n\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length) return [value];\n return [\"\"];\n };\n }\n\n const encodeValue = encode || NOOP_VALUE;\n\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected \"${token.name}/${index}\" to be a string`,\n );\n }\n\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n\n return [encodeValue(value)];\n };\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

    {\n path: string;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

    = false | MatchResult

    ;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

    = (path: string) => Match

    ;\n\n/**\n * Supported path types.\n */\nexport type Path = string | TokenData;\n\n/**\n * Transform a path into a match function.\n */\nexport function match

    (\n path: Path | Path[],\n options: MatchOptions & ParseOptions = {},\n): MatchFunction

    {\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const { regexp, keys } = pathToRegexp(path, options);\n\n const decoders = keys.map((key) => {\n if (decode === false) return NOOP_VALUE;\n if (key.type === \"param\") return decode;\n return (value: string) => value.split(delimiter).map(decode);\n });\n\n return function match(input: string) {\n const m = regexp.exec(input);\n if (!m) return false;\n\n const path = m[0];\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n\n return { path, params };\n };\n}\n\n/**\n * Transform a path into a regular expression and capture keys.\n */\nexport function pathToRegexp(\n path: Path | Path[],\n options: PathToRegexpOptions & ParseOptions = {},\n) {\n const {\n delimiter = DEFAULT_DELIMITER,\n end = true,\n sensitive = false,\n trailing = true,\n } = options;\n const keys: Keys = [];\n const sources: string[] = [];\n const paths: Array = [path];\n let combinations = 0;\n\n while (paths.length) {\n const path = paths.shift()!;\n\n if (Array.isArray(path)) {\n paths.push(...path);\n continue;\n }\n\n const data = typeof path === \"object\" ? path : parse(path, options);\n flatten(data.tokens, 0, [], (tokens) => {\n if (combinations++ >= 256) {\n throw new PathError(\"Too many path combinations\", data.originalPath);\n }\n\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n });\n }\n\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing) pattern += \"(?:\" + escape(delimiter) + \"$)?\";\n pattern += end ? \"$\" : \"(?=\" + escape(delimiter) + \"|$)\";\n\n return { regexp: new RegExp(pattern, sensitive ? \"\" : \"i\"), keys };\n}\n\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction flatten(\n tokens: Token[],\n index: number,\n result: Exclude[],\n callback: (result: Exclude[]) => void,\n): void {\n while (index < tokens.length) {\n const token = tokens[index++];\n\n if (token.type === \"group\") {\n flatten(token.tokens, 0, result.slice(), (seq) =>\n flatten(tokens, index, seq, callback),\n );\n continue;\n }\n\n result.push(token);\n }\n\n callback(result);\n}\n\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(\n tokens: Exclude[],\n delimiter: string,\n keys: Keys,\n originalPath: string | undefined,\n): string {\n let result = \"\";\n let backtrack = \"\";\n let wildcardBacktrack = \"\";\n let prevCaptureType: 0 | 1 | 2 = 0;\n let hasSegmentCapture = 0;\n let index = 0;\n\n function hasInSegment(index: number, type: TokenType) {\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type === type) return true;\n if (token.type === \"text\") {\n if (token.value.includes(delimiter)) break;\n }\n }\n return false;\n }\n\n function peekText(index: number) {\n let result = \"\";\n while (index < tokens.length) {\n const token = tokens[index++];\n if (token.type !== \"text\") break;\n result += token.value;\n }\n return result;\n }\n\n while (index < tokens.length) {\n const token = tokens[index++];\n\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n if (prevCaptureType === 2) wildcardBacktrack += token.value;\n if (token.value.includes(delimiter)) hasSegmentCapture = 0;\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (prevCaptureType && !backtrack) {\n throw new PathError(\n `Missing text before \"${token.name}\" ${token.type}`,\n originalPath,\n );\n }\n\n if (token.type === \"param\") {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(delimiter, backtrack)}+)`\n : hasInSegment(index, \"wildcard\") // See wildcard later in segment.\n ? `(${negate(delimiter, peekText(index))}+)`\n : hasSegmentCapture & 1 // Seen parameter in segment.\n ? `(${negate(delimiter, backtrack)}+|${escape(backtrack)})`\n : `(${negate(delimiter, \"\")}+)`;\n\n hasSegmentCapture |= prevCaptureType = 1;\n } else {\n result +=\n hasSegmentCapture & 2 // Seen wildcard in segment.\n ? `(${negate(backtrack, \"\")}+)`\n : wildcardBacktrack // No capture in segment, seen wildcard in path.\n ? `(${negate(wildcardBacktrack, \"\")}+|${negate(delimiter, \"\")}+)`\n : `([^]+)`;\n\n wildcardBacktrack = \"\";\n hasSegmentCapture |= prevCaptureType = 2;\n }\n\n keys.push(token);\n backtrack = \"\";\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return result;\n}\n\n/**\n * Block backtracking on previous text/delimiter.\n */\nfunction negate(a: string, b: string): string {\n if (b.length > a.length) return negate(b, a); // Longest string first.\n\n if (a === b) b = \"\"; // Cleaner regex strings, no duplication.\n if (b.length > 1) return `(?:(?!${escape(a)}|${escape(b)})[^])`;\n if (a.length > 1) return `(?:(?!${escape(a)})[^${escape(b)}])`;\n return `[^${escape(a + b)}]`;\n}\n\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens: Token[], index: number): string {\n let value = \"\";\n\n while (index < tokens.length) {\n const token = tokens[index++];\n\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n\n if (token.type === \"group\") {\n value += \"{\" + stringifyTokens(token.tokens, 0) + \"}\";\n continue;\n }\n\n if (token.type === \"param\") {\n value += \":\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n\n if (token.type === \"wildcard\") {\n value += \"*\" + stringifyName(token.name, tokens[index]);\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return value;\n}\n\n/**\n * Stringify token data into a path string.\n */\nexport function stringify(data: TokenData): string {\n return stringifyTokens(data.tokens, 0);\n}\n\n/**\n * Stringify a parameter name, escaping when it cannot be emitted directly.\n */\nfunction stringifyName(name: string, next: Token | undefined): string {\n if (!ID.test(name)) return JSON.stringify(name);\n\n if (next?.type === \"text\" && ID_CONTINUE.test(next.value[0])) {\n return JSON.stringify(name);\n }\n\n return name;\n}\n"]} \ No newline at end of file diff --git a/node_modules/path-to-regexp/index.js b/node_modules/path-to-regexp/index.js new file mode 100644 index 0000000..a3d4924 --- /dev/null +++ b/node_modules/path-to-regexp/index.js @@ -0,0 +1,158 @@ +/** + * Expose `pathToRegexp`. + */ + +module.exports = pathToRegexp; + +/** + * Match matching groups in a regular expression. + */ +var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g; + +/** + * Normalize the given path string, + * returning a regular expression. + * + * An empty array should be passed, + * which will contain the placeholder + * key names. For example "/user/:id" will + * then contain ["id"]. + * + * @param {String|RegExp|Array} path + * @param {Array} keys + * @param {Object} options + * @return {RegExp} + * @api private + */ + +function pathToRegexp(path, keys, options) { + options = options || {}; + keys = keys || []; + var strict = options.strict; + var end = options.end !== false; + var flags = options.sensitive ? '' : 'i'; + var lookahead = options.lookahead !== false; + var extraOffset = 0; + var keysOffset = keys.length; + var i = 0; + var name = 0; + var pos = 0; + var backtrack = ''; + var m; + + if (path instanceof RegExp) { + while (m = MATCHING_GROUP_REGEXP.exec(path.source)) { + if (m[0][0] === '\\') continue; + + keys.push({ + name: m[1] || name++, + optional: false, + offset: m.index + }); + } + + return path; + } + + if (Array.isArray(path)) { + // Map array parts into regexps and return their source. We also pass + // the same keys and options instance into every generation to get + // consistent matching groups before we join the sources together. + path = path.map(function (value) { + return pathToRegexp(value, keys, options).source; + }); + + return new RegExp(path.join('|'), flags); + } + + if (typeof path !== 'string') { + throw new TypeError('path must be a string, array of strings, or regular expression'); + } + + path = path.replace( + /\\.|(\/)?(\.)?:(\w+)(\(.*?\))?(\*)?(\?)?|[.*]|\/\(/g, + function (match, slash, format, key, capture, star, optional, offset) { + if (match[0] === '\\') { + backtrack += match; + pos += 2; + return match; + } + + if (match === '.') { + backtrack += '\\.'; + extraOffset += 1; + pos += 1; + return '\\.'; + } + + if (slash || format) { + backtrack = ''; + } else { + backtrack += path.slice(pos, offset); + } + + pos = offset + match.length; + + if (match === '*') { + backtrack = ''; + extraOffset += 3; + return '(.*)'; + } + + if (match === '/(') { + backtrack += '/'; + extraOffset += 2; + return '/(?:'; + } + + slash = slash || ''; + format = format ? '\\.' : ''; + optional = optional || ''; + capture = capture ? + capture.replace(/\\.|\*/, function (m) { return m === '*' ? '(.*)' : m; }) : + (backtrack ? '((?:(?!/|' + backtrack + ').)+?)' : '([^/' + format + ']+?)'); + + keys.push({ + name: key, + optional: !!optional, + offset: offset + extraOffset + }); + + var result = '(?:' + + format + slash + capture + + (star ? '((?:[/' + format + '].+?)?)' : '') + + ')' + + optional; + + backtrack = ''; + extraOffset += result.length - match.length; + + return result; + }); + + // This is a workaround for handling unnamed matching groups. + while (m = MATCHING_GROUP_REGEXP.exec(path)) { + if (m[0][0] === '\\') continue; + + if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) { + keys.splice(keysOffset + i, 0, { + name: name++, // Unnamed matching groups must be consistently linear. + optional: false, + offset: m.index + }); + } + + i++; + } + + path += strict ? '' : path[path.length - 1] === '/' ? '?' : '/?'; + + // If the path is non-ending, match until the end or a slash. + if (end) { + path += '$'; + } else if (path[path.length - 1] !== '/') { + path += lookahead ? '(?=/|$)' : '(?:/|$)'; + } + + return new RegExp('^' + path, flags); +}; diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json index 128f1fc..456a45d 100644 --- a/node_modules/path-to-regexp/package.json +++ b/node_modules/path-to-regexp/package.json @@ -1,64 +1,30 @@ { "name": "path-to-regexp", - "version": "8.4.1", "description": "Express style path to RegExp utility", + "version": "0.1.13", + "files": [ + "index.js", + "LICENSE" + ], + "scripts": { + "test": "istanbul cover _mocha -- -R spec" + }, "keywords": [ "express", - "regexp", - "route", - "routing" + "regexp" ], + "component": { + "scripts": { + "path-to-regexp": "index.js" + } + }, + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/pillarjs/path-to-regexp.git" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, - "license": "MIT", - "exports": "./dist/index.js", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist/" - ], - "scripts": { - "bench": "vitest bench", - "build": "ts-scripts build", - "format": "ts-scripts format", - "lint": "ts-scripts lint", - "prepare": "ts-scripts install && npm run build", - "size": "size-limit", - "specs": "ts-scripts specs", - "test": "ts-scripts test && npm run size" - }, "devDependencies": { - "@borderless/ts-scripts": "^0.15.0", - "@size-limit/preset-small-lib": "^11.1.2", - "@types/node": "^22.7.2", - "@types/semver": "^7.3.1", - "@vitest/coverage-v8": "^3.0.5", - "recheck": "^4.5.0", - "size-limit": "^11.1.2", - "typescript": "^5.7.3", - "vitest": "^3.0.5" - }, - "publishConfig": { - "access": "public" - }, - "size-limit": [ - { - "path": "dist/index.js", - "limit": "2 kB" - } - ], - "ts-scripts": { - "dist": [ - "dist" - ], - "project": [ - "tsconfig.build.json" - ] + "mocha": "^1.17.1", + "istanbul": "^0.2.6" } } diff --git a/node_modules/qs/CHANGELOG.md b/node_modules/qs/CHANGELOG.md index 66f3179..0d304ea 100644 --- a/node_modules/qs/CHANGELOG.md +++ b/node_modules/qs/CHANGELOG.md @@ -1,7 +1,3 @@ -## **6.15.0** -- [New] `parse`: add `strictMerge` option to wrap object/primitive conflicts in an array (#425, #122) -- [Fix] `duplicates` option should not apply to bracket notation keys (#514) - ## **6.14.2** - [Fix] `parse`: mark overflow objects for indexed notation exceeding `arrayLimit` (#546) - [Fix] `arrayLimit` means max count, not max index, in `combine`/`merge`/`parseArrayValue` @@ -34,17 +30,6 @@ - [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols` - [Tests] increase coverage -## **6.13.3** -[Fix] fix regressions from robustness refactor -[actions] update reusable workflows - -## **6.13.2** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.13.1** - [Fix] `stringify`: avoid a crash when a `filter` key is `null` - [Fix] `utils.merge`: functions should not be stringified into keys @@ -61,17 +46,6 @@ - [New] `parse`: add `strictDepth` option (#511) - [Tests] use `npm audit` instead of `aud` -## **6.12.5** -- [Fix] fix regressions from robustness refactor -- [actions] update reusable workflows - -## **6.12.4** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.12.3** - [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` - [meta] fix changelog indentation @@ -109,17 +83,6 @@ - [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` - [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 -## **6.11.4** -- [Fix] fix regressions from robustness refactor -- [actions] update reusable workflows - -## **6.11.3** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.11.2** - [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) - [Tests] add passing test cases with empty keys (#473) @@ -137,17 +100,6 @@ - [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) - [readme] fix version badge -## **6.10.7** -- [Fix] fix regressions from robustness refactor -- [actions] update reusable workflows - -## **6.10.6** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.10.5** - [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) @@ -185,18 +137,6 @@ - [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` - [Tests] Revert "[meta] ignore eclint transitive audit warning" -## **6.9.9** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.9.8** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.9.7** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) @@ -257,18 +197,6 @@ - [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` - [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -## **6.8.5** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.8.4** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.8.3** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Robustness] `stringify`: avoid relying on a global `undefined` (#427) @@ -313,18 +241,6 @@ - [meta] add FUNDING.yml - [meta] Clean up license text so it’s properly detected as BSD-3-Clause -## **6.7.5** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.7.4** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.7.3** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) @@ -376,18 +292,6 @@ - [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 - [Tests] temporarily allow coverage to fail -## **6.6.3** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.6.2** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.6.1** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] fix for an impossible situation: when the formatter is called with a non-string value @@ -430,18 +334,6 @@ - [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` - [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS -## **6.5.5** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.5.4** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.5.3** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source @@ -492,18 +384,6 @@ - [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 - [Tests] add `editorconfig-tools` -## **6.4.3** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.4.2** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] replace runkit CI badge with shields.io check-runs badge -- [readme] replace travis CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.4.1** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] fix for an impossible situation: when the formatter is called with a non-string value @@ -534,17 +414,6 @@ - [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - [eslint] reduce warnings -## **6.3.5** -- [Fix] fix regressions from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.3.4** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] replace travis CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.3.3** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] fix for an impossible situation: when the formatter is called with a non-string value @@ -598,17 +467,6 @@ - [Tests] skip Object.create tests when null objects are not available - [Tests] Turn on eslint for test files (#175) -## **6.2.6** -- [Fix] fix regression from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.2.5** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] replace travis CI badge with shields.io check-runs badge -- [actions] fix rebase workflow permissions - ## **6.2.4** - [Fix] `parse`: ignore `__proto__` keys (#428) - [Fix] `utils.merge`: avoid a crash with a null target and an array source @@ -647,16 +505,6 @@ - [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) - [Fix] fix compacting of nested sparse arrays (#150) -## **6.1.4** -- [Fix] fix regression from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.1.3** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] replace travis CI badge with shields.io check-runs badge - ## **6.1.2** - [Fix] follow `allowPrototypes` option during merge (#201, #200) - [Fix] chmod a-x @@ -671,16 +519,6 @@ - [Fix] "sort" option should work at a depth of 3 or more (#151) - [Fix] Restore `dist` directory; will be removed in v7 (#148) -## **6.0.6** -- [Fix] fix regression from robustness refactor -- [meta] add `npmignore` to autogenerate an npmignore file -- [actions] update reusable workflows - -## **6.0.5** -- [Robustness] avoid `.push`, use `void` -- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543) -- [readme] replace travis CI badge with shields.io check-runs badge - ## **6.0.4** - [Fix] follow `allowPrototypes` option during merge (#201, #200) - [Fix] chmod a-x diff --git a/node_modules/qs/README.md b/node_modules/qs/README.md index 0980c9a..5c37739 100644 --- a/node_modules/qs/README.md +++ b/node_modules/qs/README.md @@ -197,11 +197,6 @@ assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'b assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); ``` -Note that keys with bracket notation (`[]`) always combine into arrays, regardless of the `duplicates` setting: -```javascript -assert.deepEqual(qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), { a: '2', b: ['1', '2'] }); -``` - If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: ```javascript @@ -330,19 +325,6 @@ var mixedNotation = qs.parse('a[0]=b&a[b]=c'); assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); ``` -When a key appears as both a plain value and an object, **qs** will by default wrap the conflicting values in an array (`strictMerge` defaults to `true`): - -```javascript -assert.deepEqual(qs.parse('a[b]=c&a=d'), { a: [{ b: 'c' }, 'd'] }); -assert.deepEqual(qs.parse('a=d&a[b]=c'), { a: ['d', { b: 'c' }] }); -``` - -To restore the legacy behavior (where the primitive is used as a key with value `true`), set `strictMerge` to `false`: - -```javascript -assert.deepEqual(qs.parse('a[b]=c&a=d', { strictMerge: false }), { a: { b: 'c', d: true } }); -``` - You can also create arrays of objects: ```javascript diff --git a/node_modules/qs/dist/qs.js b/node_modules/qs/dist/qs.js index 9cc9e70..d5eb519 100644 --- a/node_modules/qs/dist/qs.js +++ b/node_modules/qs/dist/qs.js @@ -5,13 +5,13 @@ "use strict";var stringify=require(4),parse=require(3),formats=require(1);module.exports={formats:formats,parse:parse,stringify:stringify}; },{"1":1,"3":3,"4":4}],3:[function(require,module,exports){ -"use strict";var utils=require(5),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},parseArrayValue=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(c=isArray(c)?[c]:c),t.comma&&isArray(c)&&c.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");c=utils.combine([],c,t.arrayLimit,t.plainObjects)}if(null!==d){var f=has.call(r,d);f&&("combine"===t.duplicates||p.indexOf("[]=")>-1)?r[d]=utils.combine(r[d],c,t.arrayLimit,t.plainObjects):f&&"last"!==t.duplicates||(r[d]=c)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects);else{s=r.plainObjects?{__proto__:null}:{};var c="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,p=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(p,10),y=!isNaN(u)&&d!==p&&String(u)===p&&u>=0&&r.parseArrays;if(r.parseArrays||""!==p)if(y&&u-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(p=isArray(p)?[p]:p),t.comma&&isArray(p)&&p.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");p=utils.combine([],p,t.arrayLimit,t.plainObjects)}if(null!==d){var f=has.call(r,d);f&&"combine"===t.duplicates?r[d]=utils.combine(r[d],p,t.arrayLimit,t.plainObjects):f&&"last"!==t.duplicates||(r[d]=p)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects);else{s=r.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,c=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,u=parseInt(c,10),y=!isNaN(u)&&d!==c&&String(u)===c&&u>=0&&r.parseArrays;if(r.parseArrays||""!==c)if(y&&u0?g.join(",")||null:void 0}];else if(isArray(f))S=f;else{var N=Object.keys(g);S=u?N.sort(u):N}var T=l?String(r).replace(/\./g,"%2E"):String(r),O=o&&isArray(g)&&1===g.length?T+"[]":T;if(a&&isArray(g)&&0===g.length)return O+"[]";for(var k=0;k0?c+y:""}; },{"1":1,"46":46,"5":5}],5:[function(require,module,exports){ -"use strict";var formats=require(1),getSideChannel=require(46),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,overflowChannel=getSideChannel(),markOverflow=function markOverflow(e,r){return overflowChannel.set(e,r),e},isOverflow=function isOverflow(e){return overflowChannel.has(e)},getMaxIndex=function getMaxIndex(e){return overflowChannel.get(e)},setMaxIndex=function setMaxIndex(e,r){overflowChannel.set(e,r)},hexTable=function(){for(var e=[],r=0;r<256;++r)e[e.length]="%"+((r<16?"0":"")+r.toString(16)).toUpperCase();return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var n=[],o=0;ot.arrayLimit)return markOverflow(arrayToObject(e.concat(r),t),n);e[n]=r}else{if(!e||"object"!=typeof e)return[e,r];if(isOverflow(e)){var o=getMaxIndex(e)+1;e[o]=r,setMaxIndex(e,o)}else{if(t&&t.strictMerge)return[e,r];(t&&(t.plainObjects||t.allowPrototypes)||!has.call(Object.prototype,r))&&(e[r]=!0)}}return e}if(!e||"object"!=typeof e){if(isOverflow(r)){for(var a=Object.keys(r),i=t&&t.plainObjects?{__proto__:null,0:e}:{0:e},c=0;ct.arrayLimit?markOverflow(arrayToObject(l,t),l.length-1):l}var f=e;return isArray(e)&&!isArray(r)&&(f=arrayToObject(e,t)),isArray(e)&&isArray(r)?(r.forEach(function(r,n){if(has.call(e,n)){var o=e[n];o&&"object"==typeof o&&r&&"object"==typeof r?e[n]=merge(o,r,t):e[e.length]=r}else e[n]=r}),e):Object.keys(r).reduce(function(e,n){var o=r[n];if(has.call(e,n)?e[n]=merge(e[n],o,t):e[n]=o,isOverflow(r)&&!isOverflow(e)&&markOverflow(e,getMaxIndex(r)),isOverflow(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>getMaxIndex(e)&&setMaxIndex(e,a)}return e},f)},assign=function assignSingleSource(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},decode=function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},limit=1024,encode=function encode(e,r,t,n,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===t)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",c=0;c=limit?a.slice(c,c+limit):a,f=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===formats.RFC1738&&(40===u||41===u)?f[f.length]=l.charAt(s):u<128?f[f.length]=hexTable[u]:u<2048?f[f.length]=hexTable[192|u>>6]+hexTable[128|63&u]:u<55296||u>=57344?f[f.length]=hexTable[224|u>>12]+hexTable[128|u>>6&63]+hexTable[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),f[f.length]=hexTable[240|u>>18]+hexTable[128|u>>12&63]+hexTable[128|u>>6&63]+hexTable[128|63&u])}i+=f.join("")}return i},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;nt?markOverflow(arrayToObject(a,{plainObjects:n}),a.length-1):a},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],n=0;n1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var n=[],o=0;ot.arrayLimit)return markOverflow(arrayToObject(e.concat(r),t),n);e[n]=r}else{if(!e||"object"!=typeof e)return[e,r];if(isOverflow(e)){var o=getMaxIndex(e)+1;e[o]=r,setMaxIndex(e,o)}else(t&&(t.plainObjects||t.allowPrototypes)||!has.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e){if(isOverflow(r)){for(var a=Object.keys(r),i=t&&t.plainObjects?{__proto__:null,0:e}:{0:e},c=0;ct.arrayLimit?markOverflow(arrayToObject(l,t),l.length-1):l}var f=e;return isArray(e)&&!isArray(r)&&(f=arrayToObject(e,t)),isArray(e)&&isArray(r)?(r.forEach(function(r,n){if(has.call(e,n)){var o=e[n];o&&"object"==typeof o&&r&&"object"==typeof r?e[n]=merge(o,r,t):e[e.length]=r}else e[n]=r}),e):Object.keys(r).reduce(function(e,n){var o=r[n];if(has.call(e,n)?e[n]=merge(e[n],o,t):e[n]=o,isOverflow(r)&&!isOverflow(e)&&markOverflow(e,getMaxIndex(r)),isOverflow(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>getMaxIndex(e)&&setMaxIndex(e,a)}return e},f)},assign=function assignSingleSource(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},decode=function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},limit=1024,encode=function encode(e,r,t,n,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===t)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",c=0;c=limit?a.slice(c,c+limit):a,f=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===formats.RFC1738&&(40===u||41===u)?f[f.length]=l.charAt(s):u<128?f[f.length]=hexTable[u]:u<2048?f[f.length]=hexTable[192|u>>6]+hexTable[128|63&u]:u<55296||u>=57344?f[f.length]=hexTable[224|u>>12]+hexTable[128|u>>6&63]+hexTable[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),f[f.length]=hexTable[240|u>>18]+hexTable[128|u>>12&63]+hexTable[128|u>>6&63]+hexTable[128|63&u])}i+=f.join("")}return i},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;nt?markOverflow(arrayToObject(a,{plainObjects:n}),a.length-1):a},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],n=0;n void ): void; declare function getRawBody( - stream: NodeJS.ReadableStream, + stream: Readable, options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding, callback: (err: getRawBody.RawBodyError, body: string) => void ): void; declare function getRawBody( - stream: NodeJS.ReadableStream, + stream: Readable, options: getRawBody.Options, callback: (err: getRawBody.RawBodyError, body: Buffer) => void ): void; declare function getRawBody( - stream: NodeJS.ReadableStream, + stream: Readable, options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding ): Promise; declare function getRawBody( - stream: NodeJS.ReadableStream, + stream: Readable, options?: getRawBody.Options ): Promise; diff --git a/node_modules/raw-body/package.json b/node_modules/raw-body/package.json index eab819f..d8120af 100644 --- a/node_modules/raw-body/package.json +++ b/node_modules/raw-body/package.json @@ -1,7 +1,7 @@ { "name": "raw-body", "description": "Get and validate the raw body of a readable stream.", - "version": "3.0.2", + "version": "2.5.3", "author": "Jonathan Ong (http://jongleberry.com)", "contributors": [ "Douglas Christopher Wilson ", @@ -12,22 +12,25 @@ "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", - "iconv-lite": "~0.7.0", + "iconv-lite": "~0.4.24", "unpipe": "~1.0.0" }, "devDependencies": { - "@stylistic/eslint-plugin": "^5.1.0", - "@stylistic/eslint-plugin-js": "^4.1.0", "bluebird": "3.7.2", - "eslint": "^9.0.0", - "mocha": "10.7.0", - "neostandard": "^0.12.0", - "nyc": "17.0.0", + "eslint": "8.34.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.1.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", "readable-stream": "2.3.7", "safe-buffer": "5.2.1" }, "engines": { - "node": ">= 0.10" + "node": ">= 0.8" }, "files": [ "LICENSE", @@ -36,11 +39,9 @@ "index.js" ], "scripts": { - "lint": "eslint", - "lint:fix": "eslint --fix", - "test": "mocha --trace-deprecation --reporter spec --check-leaks test/", - "test:ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test:cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" + "lint": "eslint .", + "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/router/HISTORY.md b/node_modules/router/HISTORY.md deleted file mode 100644 index b292257..0000000 --- a/node_modules/router/HISTORY.md +++ /dev/null @@ -1,228 +0,0 @@ -2.2.0 / 2025-03-26 -================== - -* Remove `setImmediate` support check -* Restore `debug` dependency - -2.1.0 / 2025-02-10 -================== - -* Updated `engines` field to Node@18 or higher -* Remove `Object.setPrototypeOf` polyfill -* Use `Array.flat` instead of `array-flatten` package -* Replace `methods` dependency with standard library -* deps: parseurl@^1.3.3 -* deps: is-promise@^4.0.0 -* Replace `utils-merge` dependency with `Object.assign` -* deps: Remove unused dep `after` - -2.0.0 / 2024-09-09 -================== - -* Drop support for node <18 -* deps: path-to-regexp@^8.0.0 - - Drop support for partial capture group `router.route('/user(s?)/:user/:op')` but still have optional non-capture `/user{s}/:user/:op` - - `:name?` becomes `{:name}` - - `:name*` becomes `*name`. - - The splat change also changes splat from strings to an array of strings - - Optional splats become `{*name}` - - `:name+` becomes `*name` and thus equivalent to `*name` so I dropped those tests - - Strings as regular expressions are fully removed, need to be converted to native regular expressions - -2.0.0-beta.2 / 2024-03-20 -========================= - -This incorporates all changes after 1.3.5 up to 1.3.8. - - * Add support for returned, rejected Promises to `router.param` - -2.0.0-beta.1 / 2020-03-29 -========================= - -This incorporates all changes after 1.3.3 up to 1.3.5. - - * Internalize private `router.process_params` method - * Remove `debug` dependency - * deps: array-flatten@3.0.0 - * deps: parseurl@~1.3.3 - * deps: path-to-regexp@3.2.0 - - Add new `?`, `*`, and `+` parameter modifiers. - - Matching group expressions are only RegExp syntax. - `(*)` is no longer valid and must be written as `(.*)`, for example. - - Named matching groups no longer available by position in `req.params`. - `/:foo(.*)` only captures as `req.params.foo` and not available as - `req.params[0]`. - - Regular expressions can only be used in a matching group. - `/\\d+` is no longer valid and must be written as `/(\\d+)`. - - Matching groups are now literal regular expressions. - `:foo` named captures can no longer be included inside a capture group. - - Special `*` path segment behavior removed. - `/foo/*/bar` will match a literal `*` as the middle segment. - * deps: setprototypeof@1.2.0 - -2.0.0-alpha.1 / 2018-07-27 -========================== - - * Add basic support for returned, rejected Promises - - Rejected Promises from middleware functions `next(error)` - * Drop support for Node.js below 0.10 - * deps: debug@3.1.0 - - Add `DEBUG_HIDE_DATE` environment variable - - Change timer to per-namespace instead of global - - Change non-TTY date format - - Remove `DEBUG_FD` environment variable support - - Support 256 namespace colors - -1.3.8 / 2023-02-24 -================== - - * Fix routing requests without method - -1.3.7 / 2022-04-28 -================== - - * Fix hanging on large stack of sync routes - -1.3.6 / 2021-11-15 -================== - - * Fix handling very large stacks of sync middleware - * deps: safe-buffer@5.2.1 - -1.3.5 / 2020-03-24 -================== - - * Fix incorrect middleware execution with unanchored `RegExp`s - * perf: use plain object for internal method map - -1.3.4 / 2020-01-24 -================== - - * deps: array-flatten@3.0.0 - * deps: parseurl@~1.3.3 - * deps: setprototypeof@1.2.0 - -1.3.3 / 2018-07-06 -================== - - * Fix JSDoc for `Router` constructor - -1.3.2 / 2017-09-24 -================== - - * deps: debug@2.6.9 - * deps: parseurl@~1.3.2 - - perf: reduce overhead for full URLs - - perf: unroll the "fast-path" `RegExp` - * deps: setprototypeof@1.1.0 - * deps: utils-merge@1.0.1 - -1.3.1 / 2017-05-19 -================== - - * deps: debug@2.6.8 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@2.0.0 - -1.3.0 / 2017-02-25 -================== - - * Add `next("router")` to exit from router - * Fix case where `router.use` skipped requests routes did not - * Use `%o` in path debug to tell types apart - * deps: setprototypeof@1.0.3 - * perf: add fast match path for `*` route - -1.2.0 / 2017-02-17 -================== - - * Skip routing when `req.url` is not set - * deps: debug@2.6.1 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable set to `3` or higher - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - -1.1.5 / 2017-01-28 -================== - - * deps: array-flatten@2.1.1 - * deps: setprototypeof@1.0.2 - - Fix using fallback even when native method exists - -1.1.4 / 2016-01-21 -================== - - * deps: array-flatten@2.0.0 - * deps: methods@~1.1.2 - - perf: enable strict mode - * deps: parseurl@~1.3.1 - - perf: enable strict mode - -1.1.3 / 2015-08-02 -================== - - * Fix infinite loop condition using `mergeParams: true` - * Fix inner numeric indices incorrectly altering parent `req.params` - * deps: array-flatten@1.1.1 - - perf: enable strict mode - * deps: path-to-regexp@0.1.7 - - Fix regression with escaped round brackets and matching groups - -1.1.2 / 2015-07-06 -================== - - * Fix hiding platform issues with `decodeURIComponent` - - Only `URIError`s are a 400 - * Fix using `*` before params in routes - * Fix using capture groups before params in routes - * deps: path-to-regexp@0.1.6 - * perf: enable strict mode - * perf: remove argument reassignments in routing - * perf: skip attempting to decode zero length string - * perf: use plain for loops - -1.1.1 / 2015-05-25 -================== - - * Fix issue where `next('route')` in `router.param` would incorrectly skip values - * deps: array-flatten@1.1.0 - * deps: debug@~2.2.0 - - deps: ms@0.7.1 - -1.1.0 / 2015-04-22 -================== - - * Use `setprototypeof` instead of `__proto__` - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - -1.0.0 / 2015-01-13 -================== - - * Fix crash from error within `OPTIONS` response handler - * deps: array-flatten@1.0.2 - - Remove redundant code path - -1.0.0-beta.3 / 2015-01-11 -========================= - - * Fix duplicate methods appearing in OPTIONS responses - * Fix OPTIONS responses to include the HEAD method properly - * Remove support for leading colon in `router.param(name, fn)` - * Use `array-flatten` for flattening arrays - * deps: debug@~2.1.1 - * deps: methods@~1.1.1 - -1.0.0-beta.2 / 2014-11-19 -========================= - - * Match routes iteratively to prevent stack overflows - -1.0.0-beta.1 / 2014-11-16 -========================= - - * Initial release ported from Express 4.x - - Altered to work without Express diff --git a/node_modules/router/LICENSE b/node_modules/router/LICENSE deleted file mode 100644 index 237e1b6..0000000 --- a/node_modules/router/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Roman Shtylman -Copyright (c) 2014-2022 Douglas Christopher Wilson - -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/node_modules/router/README.md b/node_modules/router/README.md deleted file mode 100644 index 218fd57..0000000 --- a/node_modules/router/README.md +++ /dev/null @@ -1,416 +0,0 @@ -# router - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Simple middleware-style router - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install router -``` - -## API - -```js -var finalhandler = require('finalhandler') -var http = require('http') -var Router = require('router') - -var router = Router() -router.get('/', function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) - -var server = http.createServer(function (req, res) { - router(req, res, finalhandler(req, res)) -}) - -server.listen(3000) -``` - -This module is currently an extracted version from the Express project, -but with the main change being it can be used with a plain `http.createServer` -object or other web frameworks by removing Express-specific API calls. - -## Router(options) - -Options - -- `strict` - When `false` trailing slashes are optional (default: `false`) -- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`) -- `mergeParams` - When `true` any `req.params` passed to the router will be - merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams)) - -Returns a function with the signature `router(req, res, callback)` where -`callback([err])` must be provided to handle errors and fall-through from -not handling requests. - -### router.use([path], ...middleware) - -Use the given [middleware function](#middleware) for all http methods on the -given `path`, defaulting to the root path. - -`router` does not automatically see `use` as a handler. As such, it will not -consider it one for handling `OPTIONS` requests. - -* Note: If a `path` is specified, that `path` is stripped from the start of - `req.url`. - - - -```js -router.use(function (req, res, next) { - // do your things - - // continue to the next middleware - // the request will stall if this is not called - next() - - // note: you should NOT call `next` if you have begun writing to the response -}) -``` - -[Middleware](#middleware) can themselves use `next('router')` at any time to -exit the current router instance completely, invoking the top-level callback. - -### router\[method](path, ...[middleware], handler) - -The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide -the routing functionality in `router`. - -Method middleware and handlers follow usual [middleware](#middleware) behavior, -except they will only be called when the method and path match the request. - - - -```js -// handle a `GET` request -router.get('/', function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') -}) -``` - -[Middleware](#middleware) given before the handler have one additional trick, -they may invoke `next('route')`. Calling `next('route')` bypasses the remaining -middleware and the handler mounted for this route, passing the request to the -next route suitable for handling this request. - -Route handlers and middleware can themselves use `next('router')` at any time -to exit the current router instance completely, invoking the top-level callback. - -### router.param(name, param_middleware) - -Maps the specified path parameter `name` to a specialized param-capturing middleware. - -This function positions the middleware in the same stack as `.use`. - -The function can optionally return a `Promise` object. If a `Promise` object -is returned from the function, the router will attach an `onRejected` callback -using `.then`. If the promise is rejected, `next` will be called with the -rejected value, or an error if the value is falsy. - -Parameter mapping is used to provide pre-conditions to routes -which use normalized placeholders. For example a _:user_id_ parameter -could automatically load a user's information from the database without -any additional code: - - - -```js -router.param('user_id', function (req, res, next, id) { - User.find(id, function (err, user) { - if (err) { - return next(err) - } else if (!user) { - return next(new Error('failed to load user')) - } - req.user = user - - // continue processing the request - next() - }) -}) -``` - -### router.route(path) - -Creates an instance of a single `Route` for the given `path`. -(See `Router.Route` below) - -Routes can be used to handle http `methods` with their own, optional middleware. - -Using `router.route(path)` is a recommended approach to avoiding duplicate -route naming and thus typo errors. - - - -```js -var api = router.route('/api/') -``` - -## Router.Route(path) - -Represents a single route as an instance that can be used to handle http -`methods` with it's own, optional middleware. - -### route\[method](handler) - -These are functions which you can directly call on a route to register a new -`handler` for the `method` on the route. - - - -```js -// handle a `GET` request -var status = router.route('/status') - -status.get(function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('All Systems Green!') -}) -``` - -### route.all(handler) - -Adds a handler for all HTTP methods to this route. - -The handler can behave like middleware and call `next` to continue processing -rather than responding. - - - -```js -router.route('/') - .all(function (req, res, next) { - next() - }) - .all(checkSomething) - .get(function (req, res) { - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Hello World!') - }) -``` - -## Middleware - -Middleware (and method handlers) are functions that follow specific function -parameters and have defined behavior when used with `router`. The most common -format is with three parameters - "req", "res" and "next". - -- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance. -- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance. -- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument. - -The function can optionally return a `Promise` object. If a `Promise` object -is returned from the function, the router will attach an `onRejected` callback -using `.then`. If the promise is rejected, `next` will be called with the -rejected value, or an error if the value is falsy. - -Middleware and method handlers can also be defined with four arguments. When -the function has four parameters defined, the first argument is an error and -subsequent arguments remain, becoming - "err", "req", "res", "next". These -functions are "error handling middleware", and can be used for handling -errors that occurred in previous handlers (E.g. from calling `next(err)`). -This is most used when you want to define arbitrary rendering of errors. - - - -```js -router.get('/error_route', function (req, res, next) { - return next(new Error('Bad Request')) -}) - -router.use(function (err, req, res, next) { - res.end(err.message) //= > "Bad Request" -}) -``` - -Error handling middleware will **only** be invoked when an error was given. As -long as the error is in the pipeline, normal middleware and handlers will be -bypassed - only error handling middleware will be invoked with an error. - -## Examples - -```js -// import our modules -var http = require('http') -var Router = require('router') -var finalhandler = require('finalhandler') -var compression = require('compression') -var bodyParser = require('body-parser') - -// store our message to display -var message = 'Hello World!' - -// initialize the router & server and add a final callback. -var router = Router() -var server = http.createServer(function onRequest (req, res) { - router(req, res, finalhandler(req, res)) -}) - -// use some middleware and compress all outgoing responses -router.use(compression()) - -// handle `GET` requests to `/message` -router.get('/message', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end(message + '\n') -}) - -// create and mount a new router for our API -var api = Router() -router.use('/api/', api) - -// add a body parsing middleware to our API -api.use(bodyParser.json()) - -// handle `PATCH` requests to `/api/set-message` -api.patch('/set-message', function (req, res) { - if (req.body.value) { - message = req.body.value - - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end(message + '\n') - } else { - res.statusCode = 400 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - res.end('Invalid API Syntax\n') - } -}) - -// make our http server listen to connections -server.listen(8080) -``` - -You can get the message by running this command in your terminal, - or navigating to `127.0.0.1:8080` in a web browser. -```bash -curl http://127.0.0.1:8080 -``` - -You can set the message by sending it a `PATCH` request via this command: -```bash -curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}' -``` - -### Example using mergeParams - -```js -var http = require('http') -var Router = require('router') -var finalhandler = require('finalhandler') - -// this example is about the mergeParams option -var opts = { mergeParams: true } - -// make a router with out special options -var router = Router(opts) -var server = http.createServer(function onRequest (req, res) { - // set something to be passed into the router - req.params = { type: 'kitten' } - - router(req, res, finalhandler(req, res)) -}) - -router.get('/', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - - // with respond with the the params that were passed in - res.end(req.params.type + '\n') -}) - -// make another router with our options -var handler = Router(opts) - -// mount our new router to a route that accepts a param -router.use('/:path', handler) - -handler.get('/', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Type', 'text/plain; charset=utf-8') - - // will respond with the param of the router's parent route - res.end(req.params.path + '\n') -}) - -// make our http server listen to connections -server.listen(8080) -``` - -Now you can get the type, or what path you are requesting: -```bash -curl http://127.0.0.1:8080 -> kitten -curl http://127.0.0.1:8080/such_path -> such_path -``` - -### Example of advanced `.route()` usage - -This example shows how to implement routes where there is a custom -handler to execute when the path matched, but no methods matched. -Without any special handling, this would be treated as just a -generic non-match by `router` (which typically results in a 404), -but with a custom handler, a `405 Method Not Allowed` can be sent. - -```js -var http = require('http') -var finalhandler = require('finalhandler') -var Router = require('router') - -// create the router and server -var router = new Router() -var server = http.createServer(function onRequest (req, res) { - router(req, res, finalhandler(req, res)) -}) - -// register a route and add all methods -router.route('/pet/:id') - .get(function (req, res) { - // this is GET /pet/:id - res.setHeader('Content-Type', 'application/json') - res.end(JSON.stringify({ name: 'tobi' })) - }) - .delete(function (req, res) { - // this is DELETE /pet/:id - res.end() - }) - .all(function (req, res) { - // this is called for all other methods not - // defined above for /pet/:id - res.statusCode = 405 - res.end() - }) - -// make our http server listen to connections -server.listen(8080) -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci -[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml -[npm-image]: https://img.shields.io/npm/v/router.svg -[npm-url]: https://npmjs.org/package/router -[node-version-image]: https://img.shields.io/node/v/router.svg -[node-version-url]: http://nodejs.org/download/ -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master -[downloads-image]: https://img.shields.io/npm/dm/router.svg -[downloads-url]: https://npmjs.org/package/router diff --git a/node_modules/router/index.js b/node_modules/router/index.js deleted file mode 100644 index 4358aeb..0000000 --- a/node_modules/router/index.js +++ /dev/null @@ -1,748 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -const isPromise = require('is-promise') -const Layer = require('./lib/layer') -const { METHODS } = require('node:http') -const parseUrl = require('parseurl') -const Route = require('./lib/route') -const debug = require('debug')('router') -const deprecate = require('depd')('router') - -/** - * Module variables. - * @private - */ - -const slice = Array.prototype.slice -const flatten = Array.prototype.flat -const methods = METHODS.map((method) => method.toLowerCase()) - -/** - * Expose `Router`. - */ - -module.exports = Router - -/** - * Expose `Route`. - */ - -module.exports.Route = Route - -/** - * Initialize a new `Router` with the given `options`. - * - * @param {object} [options] - * @return {Router} which is a callable function - * @public - */ - -function Router (options) { - if (!(this instanceof Router)) { - return new Router(options) - } - - const opts = options || {} - - function router (req, res, next) { - router.handle(req, res, next) - } - - // inherit from the correct prototype - Object.setPrototypeOf(router, this) - - router.caseSensitive = opts.caseSensitive - router.mergeParams = opts.mergeParams - router.params = {} - router.strict = opts.strict - router.stack = [] - - return router -} - -/** - * Router prototype inherits from a Function. - */ - -/* istanbul ignore next */ -Router.prototype = function () {} - -/** - * Map the given param placeholder `name`(s) to the given callback. - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code. - * - * The callback uses the same signature as middleware, the only difference - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * Just like in middleware, you must either respond to the request or call next - * to avoid stalling the request. - * - * router.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * return next(err) - * } else if (!user) { - * return next(new Error('failed to load user')) - * } - * req.user = user - * next() - * }) - * }) - * - * @param {string} name - * @param {function} fn - * @public - */ - -Router.prototype.param = function param (name, fn) { - if (!name) { - throw new TypeError('argument name is required') - } - - if (typeof name !== 'string') { - throw new TypeError('argument name must be a string') - } - - if (!fn) { - throw new TypeError('argument fn is required') - } - - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - let params = this.params[name] - - if (!params) { - params = this.params[name] = [] - } - - params.push(fn) - - return this -} - -/** - * Dispatch a req, res into the router. - * - * @private - */ - -Router.prototype.handle = function handle (req, res, callback) { - if (!callback) { - throw new TypeError('argument callback is required') - } - - debug('dispatching %s %s', req.method, req.url) - - let idx = 0 - let methods - const protohost = getProtohost(req.url) || '' - let removed = '' - const self = this - let slashAdded = false - let sync = 0 - const paramcalled = {} - - // middleware and routes - const stack = this.stack - - // manage inter-router variables - const parentParams = req.params - const parentUrl = req.baseUrl || '' - let done = restore(callback, req, 'baseUrl', 'next', 'params') - - // setup next layer - req.next = next - - // for options requests, respond with a default if nothing else responds - if (req.method === 'OPTIONS') { - methods = [] - done = wrap(done, generateOptionsResponder(res, methods)) - } - - // setup basic req values - req.baseUrl = parentUrl - req.originalUrl = req.originalUrl || req.url - - next() - - function next (err) { - let layerError = err === 'route' - ? null - : err - - // remove added slash - if (slashAdded) { - req.url = req.url.slice(1) - slashAdded = false - } - - // restore altered req.url - if (removed.length !== 0) { - req.baseUrl = parentUrl - req.url = protohost + removed + req.url.slice(protohost.length) - removed = '' - } - - // signal to exit router - if (layerError === 'router') { - setImmediate(done, null) - return - } - - // no more matching layers - if (idx >= stack.length) { - setImmediate(done, layerError) - return - } - - // max sync stack - if (++sync > 100) { - return setImmediate(next, err) - } - - // get pathname of request - const path = getPathname(req) - - if (path == null) { - return done(layerError) - } - - // find next matching layer - let layer - let match - let route - - while (match !== true && idx < stack.length) { - layer = stack[idx++] - match = matchLayer(layer, path) - route = layer.route - - if (typeof match !== 'boolean') { - // hold on to layerError - layerError = layerError || match - } - - if (match !== true) { - continue - } - - if (!route) { - // process non-route handlers normally - continue - } - - if (layerError) { - // routes do not match with a pending error - match = false - continue - } - - const method = req.method - const hasMethod = route._handlesMethod(method) - - // build up automatic options response - if (!hasMethod && method === 'OPTIONS' && methods) { - methods.push.apply(methods, route._methods()) - } - - // don't even bother matching route - if (!hasMethod && method !== 'HEAD') { - match = false - } - } - - // no match - if (match !== true) { - return done(layerError) - } - - // store route for dispatch on change - if (route) { - req.route = route - } - - // Capture one-time layer values - req.params = self.mergeParams - ? mergeParams(layer.params, parentParams) - : layer.params - const layerPath = layer.path - - // this should be done for the layer - processParams(self.params, layer, paramcalled, req, res, function (err) { - if (err) { - next(layerError || err) - } else if (route) { - layer.handleRequest(req, res, next) - } else { - trimPrefix(layer, layerError, layerPath, path) - } - - sync = 0 - }) - } - - function trimPrefix (layer, layerError, layerPath, path) { - if (layerPath.length !== 0) { - // Validate path is a prefix match - if (layerPath !== path.substring(0, layerPath.length)) { - next(layerError) - return - } - - // Validate path breaks on a path separator - const c = path[layerPath.length] - if (c && c !== '/') { - next(layerError) - return - } - - // Trim off the part of the url that matches the route - // middleware (.use stuff) needs to have the path stripped - debug('trim prefix (%s) from url %s', layerPath, req.url) - removed = layerPath - req.url = protohost + req.url.slice(protohost.length + removed.length) - - // Ensure leading slash - if (!protohost && req.url[0] !== '/') { - req.url = '/' + req.url - slashAdded = true - } - - // Setup base URL (no trailing slash) - req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' - ? removed.substring(0, removed.length - 1) - : removed) - } - - debug('%s %s : %s', layer.name, layerPath, req.originalUrl) - - if (layerError) { - layer.handleError(layerError, req, res, next) - } else { - layer.handleRequest(req, res, next) - } - } -} - -/** - * Use the given middleware function, with optional path, defaulting to "/". - * - * Use (like `.all`) will run for any http METHOD, but it will not add - * handlers for those methods so OPTIONS requests will not consider `.use` - * functions even if they could respond. - * - * The other difference is that _route_ path is stripped and not visible - * to the handler function. The main effect of this feature is that mounted - * handlers can operate without any code changes regardless of the "prefix" - * pathname. - * - * @public - */ - -Router.prototype.use = function use (handler) { - let offset = 0 - let path = '/' - - // default path to '/' - // disambiguate router.use([handler]) - if (typeof handler !== 'function') { - let arg = handler - - while (Array.isArray(arg) && arg.length !== 0) { - arg = arg[0] - } - - // first arg is the path - if (typeof arg !== 'function') { - offset = 1 - path = handler - } - } - - const callbacks = flatten.call(slice.call(arguments, offset), Infinity) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (let i = 0; i < callbacks.length; i++) { - const fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - // add the middleware - debug('use %o %s', path, fn.name || '') - - const layer = new Layer(path, { - sensitive: this.caseSensitive, - strict: false, - end: false - }, fn) - - layer.route = undefined - - this.stack.push(layer) - } - - return this -} - -/** - * Create a new Route for the given path. - * - * Each route contains a separate middleware stack and VERB handlers. - * - * See the Route api documentation for details on adding handlers - * and middleware to routes. - * - * @param {string} path - * @return {Route} - * @public - */ - -Router.prototype.route = function route (path) { - const route = new Route(path) - - const layer = new Layer(path, { - sensitive: this.caseSensitive, - strict: this.strict, - end: true - }, handle) - - function handle (req, res, next) { - route.dispatch(req, res, next) - } - - layer.route = route - - this.stack.push(layer) - return route -} - -// create Router#VERB functions -methods.concat('all').forEach(function (method) { - Router.prototype[method] = function (path) { - const route = this.route(path) - route[method].apply(route, slice.call(arguments, 1)) - return this - } -}) - -/** - * Generate a callback that will make an OPTIONS response. - * - * @param {OutgoingMessage} res - * @param {array} methods - * @private - */ - -function generateOptionsResponder (res, methods) { - return function onDone (fn, err) { - if (err || methods.length === 0) { - return fn(err) - } - - trySendOptionsResponse(res, methods, fn) - } -} - -/** - * Get pathname of request. - * - * @param {IncomingMessage} req - * @private - */ - -function getPathname (req) { - try { - return parseUrl(req).pathname - } catch (err) { - return undefined - } -} - -/** - * Get get protocol + host for a URL. - * - * @param {string} url - * @private - */ - -function getProtohost (url) { - if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { - return undefined - } - - const searchIndex = url.indexOf('?') - const pathLength = searchIndex !== -1 - ? searchIndex - : url.length - const fqdnIndex = url.substring(0, pathLength).indexOf('://') - - return fqdnIndex !== -1 - ? url.substring(0, url.indexOf('/', 3 + fqdnIndex)) - : undefined -} - -/** - * Match path to a layer. - * - * @param {Layer} layer - * @param {string} path - * @private - */ - -function matchLayer (layer, path) { - try { - return layer.match(path) - } catch (err) { - return err - } -} - -/** - * Merge params with parent params - * - * @private - */ - -function mergeParams (params, parent) { - if (typeof parent !== 'object' || !parent) { - return params - } - - // make copy of parent for base - const obj = Object.assign({}, parent) - - // simple non-numeric merging - if (!(0 in params) || !(0 in parent)) { - return Object.assign(obj, params) - } - - let i = 0 - let o = 0 - - // determine numeric gap in params - while (i in params) { - i++ - } - - // determine numeric gap in parent - while (o in parent) { - o++ - } - - // offset numeric indices in params before merge - for (i--; i >= 0; i--) { - params[i + o] = params[i] - - // create holes for the merge when necessary - if (i < o) { - delete params[i] - } - } - - return Object.assign(obj, params) -} - -/** - * Process any parameters for the layer. - * - * @private - */ - -function processParams (params, layer, called, req, res, done) { - // captured parameters from the layer, keys and values - const keys = layer.keys - - // fast track - if (!keys || keys.length === 0) { - return done() - } - - let i = 0 - let paramIndex = 0 - let key - let paramVal - let paramCallbacks - let paramCalled - - // process params in order - // param callbacks can be async - function param (err) { - if (err) { - return done(err) - } - - if (i >= keys.length) { - return done() - } - - paramIndex = 0 - key = keys[i++] - paramVal = req.params[key] - paramCallbacks = params[key] - paramCalled = called[key] - - if (paramVal === undefined || !paramCallbacks) { - return param() - } - - // param previously called with same value or error occurred - if (paramCalled && (paramCalled.match === paramVal || - (paramCalled.error && paramCalled.error !== 'route'))) { - // restore value - req.params[key] = paramCalled.value - - // next param - return param(paramCalled.error) - } - - called[key] = paramCalled = { - error: null, - match: paramVal, - value: paramVal - } - - paramCallback() - } - - // single param callbacks - function paramCallback (err) { - const fn = paramCallbacks[paramIndex++] - - // store updated value - paramCalled.value = req.params[key] - - if (err) { - // store error - paramCalled.error = err - param(err) - return - } - - if (!fn) return param() - - try { - const ret = fn(req, res, paramCallback, paramVal, key) - if (isPromise(ret)) { - if (!(ret instanceof Promise)) { - deprecate('parameters that are Promise-like are deprecated, use a native Promise instead') - } - - ret.then(null, function (error) { - paramCallback(error || new Error('Rejected promise')) - }) - } - } catch (e) { - paramCallback(e) - } - } - - param() -} - -/** - * Restore obj props after function - * - * @private - */ - -function restore (fn, obj) { - const props = new Array(arguments.length - 2) - const vals = new Array(arguments.length - 2) - - for (let i = 0; i < props.length; i++) { - props[i] = arguments[i + 2] - vals[i] = obj[props[i]] - } - - return function () { - // restore vals - for (let i = 0; i < props.length; i++) { - obj[props[i]] = vals[i] - } - - return fn.apply(this, arguments) - } -} - -/** - * Send an OPTIONS response. - * - * @private - */ - -function sendOptionsResponse (res, methods) { - const options = Object.create(null) - - // build unique method map - for (let i = 0; i < methods.length; i++) { - options[methods[i]] = true - } - - // construct the allow list - const allow = Object.keys(options).sort().join(', ') - - // send response - res.setHeader('Allow', allow) - res.setHeader('Content-Length', Buffer.byteLength(allow)) - res.setHeader('Content-Type', 'text/plain') - res.setHeader('X-Content-Type-Options', 'nosniff') - res.end(allow) -} - -/** - * Try to send an OPTIONS response. - * - * @private - */ - -function trySendOptionsResponse (res, methods, next) { - try { - sendOptionsResponse(res, methods) - } catch (err) { - next(err) - } -} - -/** - * Wrap a function - * - * @private - */ - -function wrap (old, fn) { - return function proxy () { - const args = new Array(arguments.length + 1) - - args[0] = old - for (let i = 0, len = arguments.length; i < len; i++) { - args[i + 1] = arguments[i] - } - - fn.apply(this, args) - } -} diff --git a/node_modules/router/lib/layer.js b/node_modules/router/lib/layer.js deleted file mode 100644 index 6a4408f..0000000 --- a/node_modules/router/lib/layer.js +++ /dev/null @@ -1,247 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -const isPromise = require('is-promise') -const pathRegexp = require('path-to-regexp') -const debug = require('debug')('router:layer') -const deprecate = require('depd')('router') - -/** - * Module variables. - * @private - */ - -const TRAILING_SLASH_REGEXP = /\/+$/ -const MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g - -/** - * Expose `Layer`. - */ - -module.exports = Layer - -function Layer (path, options, fn) { - if (!(this instanceof Layer)) { - return new Layer(path, options, fn) - } - - debug('new %o', path) - const opts = options || {} - - this.handle = fn - this.keys = [] - this.name = fn.name || '' - this.params = undefined - this.path = undefined - this.slash = path === '/' && opts.end === false - - function matcher (_path) { - if (_path instanceof RegExp) { - const keys = [] - let name = 0 - let m - // eslint-disable-next-line no-cond-assign - while (m = MATCHING_GROUP_REGEXP.exec(_path.source)) { - keys.push({ - name: m[1] || name++, - offset: m.index - }) - } - - return function regexpMatcher (p) { - const match = _path.exec(p) - if (!match) { - return false - } - - const params = {} - for (let i = 1; i < match.length; i++) { - const key = keys[i - 1] - const prop = key.name - const val = decodeParam(match[i]) - - if (val !== undefined) { - params[prop] = val - } - } - - return { - params, - path: match[0] - } - } - } - - return pathRegexp.match((opts.strict ? _path : loosen(_path)), { - sensitive: opts.sensitive, - end: opts.end, - trailing: !opts.strict, - decode: decodeParam - }) - } - this.matchers = Array.isArray(path) ? path.map(matcher) : [matcher(path)] -} - -/** - * Handle the error for the layer. - * - * @param {Error} error - * @param {Request} req - * @param {Response} res - * @param {function} next - * @api private - */ - -Layer.prototype.handleError = function handleError (error, req, res, next) { - const fn = this.handle - - if (fn.length !== 4) { - // not a standard error handler - return next(error) - } - - try { - // invoke function - const ret = fn(error, req, res, next) - - // wait for returned promise - if (isPromise(ret)) { - if (!(ret instanceof Promise)) { - deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') - } - - ret.then(null, function (error) { - next(error || new Error('Rejected promise')) - }) - } - } catch (err) { - next(err) - } -} - -/** - * Handle the request for the layer. - * - * @param {Request} req - * @param {Response} res - * @param {function} next - * @api private - */ - -Layer.prototype.handleRequest = function handleRequest (req, res, next) { - const fn = this.handle - - if (fn.length > 3) { - // not a standard request handler - return next() - } - - try { - // invoke function - const ret = fn(req, res, next) - - // wait for returned promise - if (isPromise(ret)) { - if (!(ret instanceof Promise)) { - deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') - } - - ret.then(null, function (error) { - next(error || new Error('Rejected promise')) - }) - } - } catch (err) { - next(err) - } -} - -/** - * Check if this route matches `path`, if so - * populate `.params`. - * - * @param {String} path - * @return {Boolean} - * @api private - */ - -Layer.prototype.match = function match (path) { - let match - - if (path != null) { - // fast path non-ending match for / (any path matches) - if (this.slash) { - this.params = {} - this.path = '' - return true - } - - let i = 0 - while (!match && i < this.matchers.length) { - // match the path - match = this.matchers[i](path) - i++ - } - } - - if (!match) { - this.params = undefined - this.path = undefined - return false - } - - // store values - this.params = match.params - this.path = match.path - this.keys = Object.keys(match.params) - - return true -} - -/** - * Decode param value. - * - * @param {string} val - * @return {string} - * @private - */ - -function decodeParam (val) { - if (typeof val !== 'string' || val.length === 0) { - return val - } - - try { - return decodeURIComponent(val) - } catch (err) { - if (err instanceof URIError) { - err.message = 'Failed to decode param \'' + val + '\'' - err.status = 400 - } - - throw err - } -} - -/** - * Loosens the given path for path-to-regexp matching. - */ -function loosen (path) { - if (path instanceof RegExp || path === '/') { - return path - } - - return Array.isArray(path) - ? path.map(function (p) { return loosen(p) }) - : String(path).replace(TRAILING_SLASH_REGEXP, '') -} diff --git a/node_modules/router/lib/route.js b/node_modules/router/lib/route.js deleted file mode 100644 index 1887d78..0000000 --- a/node_modules/router/lib/route.js +++ /dev/null @@ -1,242 +0,0 @@ -/*! - * router - * Copyright(c) 2013 Roman Shtylman - * Copyright(c) 2014-2022 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -const debug = require('debug')('router:route') -const Layer = require('./layer') -const { METHODS } = require('node:http') - -/** - * Module variables. - * @private - */ - -const slice = Array.prototype.slice -const flatten = Array.prototype.flat -const methods = METHODS.map((method) => method.toLowerCase()) - -/** - * Expose `Route`. - */ - -module.exports = Route - -/** - * Initialize `Route` with the given `path`, - * - * @param {String} path - * @api private - */ - -function Route (path) { - debug('new %o', path) - this.path = path - this.stack = [] - - // route handlers for various http methods - this.methods = Object.create(null) -} - -/** - * @private - */ - -Route.prototype._handlesMethod = function _handlesMethod (method) { - if (this.methods._all) { - return true - } - - // normalize name - let name = typeof method === 'string' - ? method.toLowerCase() - : method - - if (name === 'head' && !this.methods.head) { - name = 'get' - } - - return Boolean(this.methods[name]) -} - -/** - * @return {array} supported HTTP methods - * @private - */ - -Route.prototype._methods = function _methods () { - const methods = Object.keys(this.methods) - - // append automatic head - if (this.methods.get && !this.methods.head) { - methods.push('head') - } - - for (let i = 0; i < methods.length; i++) { - // make upper case - methods[i] = methods[i].toUpperCase() - } - - return methods -} - -/** - * dispatch req, res into this route - * - * @private - */ - -Route.prototype.dispatch = function dispatch (req, res, done) { - let idx = 0 - const stack = this.stack - let sync = 0 - - if (stack.length === 0) { - return done() - } - - let method = typeof req.method === 'string' - ? req.method.toLowerCase() - : req.method - - if (method === 'head' && !this.methods.head) { - method = 'get' - } - - req.route = this - - next() - - function next (err) { - // signal to exit route - if (err && err === 'route') { - return done() - } - - // signal to exit router - if (err && err === 'router') { - return done(err) - } - - // no more matching layers - if (idx >= stack.length) { - return done(err) - } - - // max sync stack - if (++sync > 100) { - return setImmediate(next, err) - } - - let layer - let match - - // find next matching layer - while (match !== true && idx < stack.length) { - layer = stack[idx++] - match = !layer.method || layer.method === method - } - - // no match - if (match !== true) { - return done(err) - } - - if (err) { - layer.handleError(err, req, res, next) - } else { - layer.handleRequest(req, res, next) - } - - sync = 0 - } -} - -/** - * Add a handler for all HTTP verbs to this route. - * - * Behaves just like middleware and can respond or call `next` - * to continue processing. - * - * You can use multiple `.all` call to add multiple handlers. - * - * function check_something(req, res, next){ - * next() - * } - * - * function validate_user(req, res, next){ - * next() - * } - * - * route - * .all(validate_user) - * .all(check_something) - * .get(function(req, res, next){ - * res.send('hello world') - * }) - * - * @param {array|function} handler - * @return {Route} for chaining - * @api public - */ - -Route.prototype.all = function all (handler) { - const callbacks = flatten.call(slice.call(arguments), Infinity) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (let i = 0; i < callbacks.length; i++) { - const fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - const layer = Layer('/', {}, fn) - layer.method = undefined - - this.methods._all = true - this.stack.push(layer) - } - - return this -} - -methods.forEach(function (method) { - Route.prototype[method] = function (handler) { - const callbacks = flatten.call(slice.call(arguments), Infinity) - - if (callbacks.length === 0) { - throw new TypeError('argument handler is required') - } - - for (let i = 0; i < callbacks.length; i++) { - const fn = callbacks[i] - - if (typeof fn !== 'function') { - throw new TypeError('argument handler must be a function') - } - - debug('%s %s', method, this.path) - - const layer = Layer('/', {}, fn) - layer.method = method - - this.methods[method] = true - this.stack.push(layer) - } - - return this - } -}) diff --git a/node_modules/router/package.json b/node_modules/router/package.json deleted file mode 100644 index 123eca2..0000000 --- a/node_modules/router/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "router", - "description": "Simple middleware-style router", - "version": "2.2.0", - "author": "Douglas Christopher Wilson ", - "contributors": [ - "Blake Embrey " - ], - "license": "MIT", - "repository": "pillarjs/router", - "dependencies": { - "debug": "^4.4.0", - "depd": "^2.0.0", - "is-promise": "^4.0.0", - "parseurl": "^1.3.3", - "path-to-regexp": "^8.0.0" - }, - "devDependencies": { - "finalhandler": "^2.1.0", - "mocha": "10.2.0", - "nyc": "15.1.0", - "run-series": "^1.1.9", - "standard": "^17.1.0", - "supertest": "6.3.3" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "engines": { - "node": ">= 18" - }, - "scripts": { - "lint": "standard", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test:debug": "mocha --reporter spec --bail --check-leaks test/ --inspect --inspect-brk", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/safe-buffer/LICENSE b/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +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/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/safe-buffer/index.d.ts b/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..f8d3ec9 --- /dev/null +++ b/node_modules/safe-buffer/index.js @@ -0,0 +1,65 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..f2869e2 --- /dev/null +++ b/node_modules/safe-buffer/package.json @@ -0,0 +1,51 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.2.1", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/seedrandom/.coveralls.yml b/node_modules/seedrandom/.coveralls.yml deleted file mode 100644 index 9160059..0000000 --- a/node_modules/seedrandom/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -service_name: travis-ci diff --git a/node_modules/seedrandom/.nvmrc b/node_modules/seedrandom/.nvmrc deleted file mode 100644 index 1e8b314..0000000 --- a/node_modules/seedrandom/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json b/node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json deleted file mode 100644 index 63d7513..0000000 --- a/node_modules/seedrandom/.nyc_output/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json +++ /dev/null @@ -1 +0,0 @@ -{"/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/node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json b/node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json deleted file mode 100644 index d596d96..0000000 --- a/node_modules/seedrandom/.nyc_output/processinfo/f02e18a9-b1c7-4946-836e-c3dbfb9635a3.json +++ /dev/null @@ -1 +0,0 @@ -{"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/node_modules/seedrandom/.nyc_output/processinfo/index.json b/node_modules/seedrandom/.nyc_output/processinfo/index.json deleted file mode 100644 index f67865c..0000000 --- a/node_modules/seedrandom/.nyc_output/processinfo/index.json +++ /dev/null @@ -1 +0,0 @@ -{"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/node_modules/seedrandom/.travis.yml b/node_modules/seedrandom/.travis.yml deleted file mode 100644 index 6852ab1..0000000 --- a/node_modules/seedrandom/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -sudo: false -node_js: -- '7' -- '8' -- '9' -- '10' -- '11' diff --git a/node_modules/seedrandom/Gruntfile.js b/node_modules/seedrandom/Gruntfile.js deleted file mode 100644 index 41585ec..0000000 --- a/node_modules/seedrandom/Gruntfile.js +++ /dev/null @@ -1,97 +0,0 @@ -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/node_modules/seedrandom/README.md b/node_modules/seedrandom/README.md deleted file mode 100644 index 9518915..0000000 --- a/node_modules/seedrandom/README.md +++ /dev/null @@ -1,322 +0,0 @@ -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/node_modules/seedrandom/bower.json b/node_modules/seedrandom/bower.json deleted file mode 100644 index 8e62b3a..0000000 --- a/node_modules/seedrandom/bower.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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/node_modules/seedrandom/component.json b/node_modules/seedrandom/component.json deleted file mode 100644 index 43fea29..0000000 --- a/node_modules/seedrandom/component.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "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/node_modules/seedrandom/coverage/coverage.json b/node_modules/seedrandom/coverage/coverage.json deleted file mode 100644 index 9e9657b..0000000 --- a/node_modules/seedrandom/coverage/coverage.json +++ /dev/null @@ -1 +0,0 @@ -{"/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/node_modules/seedrandom/coverage/lcov-report/base.css b/node_modules/seedrandom/coverage/lcov-report/base.css deleted file mode 100644 index f418035..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/base.css +++ /dev/null @@ -1,224 +0,0 @@ -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/node_modules/seedrandom/coverage/lcov-report/block-navigation.js b/node_modules/seedrandom/coverage/lcov-report/block-navigation.js deleted file mode 100644 index c7ff5a5..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/block-navigation.js +++ /dev/null @@ -1,79 +0,0 @@ -/* 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/node_modules/seedrandom/coverage/lcov-report/index.html b/node_modules/seedrandom/coverage/lcov-report/index.html deleted file mode 100644 index 6109d95..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/prettify.css b/node_modules/seedrandom/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.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/node_modules/seedrandom/coverage/lcov-report/prettify.js b/node_modules/seedrandom/coverage/lcov-report/prettify.js deleted file mode 100644 index b322523..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html deleted file mode 100644 index 7c99c88..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/index.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html deleted file mode 100644 index 584d7c2..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/alea.js.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html deleted file mode 100644 index 4986a5b..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/index.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html deleted file mode 100644 index 29c3483..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/tychei.js.html +++ /dev/null @@ -1,378 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html deleted file mode 100644 index 77ec76f..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor128.js.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html deleted file mode 100644 index a9b085b..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xor4096.js.html +++ /dev/null @@ -1,507 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html deleted file mode 100644 index e50230c..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorshift7.js.html +++ /dev/null @@ -1,360 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html deleted file mode 100644 index 3c8d5a7..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/lib/xorwow.js.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html b/node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html deleted file mode 100644 index ca72564..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/seedrandom/seedrandom.js.html +++ /dev/null @@ -1,828 +0,0 @@ - - - - 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/node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png b/node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a..0000000 Binary files a/node_modules/seedrandom/coverage/lcov-report/sort-arrow-sprite.png and /dev/null differ diff --git a/node_modules/seedrandom/coverage/lcov-report/sorter.js b/node_modules/seedrandom/coverage/lcov-report/sorter.js deleted file mode 100644 index 16de10c..0000000 --- a/node_modules/seedrandom/coverage/lcov-report/sorter.js +++ /dev/null @@ -1,170 +0,0 @@ -/* 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/node_modules/seedrandom/coverage/lcov.info b/node_modules/seedrandom/coverage/lcov.info deleted file mode 100644 index bf8175d..0000000 --- a/node_modules/seedrandom/coverage/lcov.info +++ /dev/null @@ -1,799 +0,0 @@ -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/node_modules/seedrandom/index.js b/node_modules/seedrandom/index.js deleted file mode 100644 index 513669a..0000000 --- a/node_modules/seedrandom/index.js +++ /dev/null @@ -1,60 +0,0 @@ -// 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/node_modules/seedrandom/lib/alea.js b/node_modules/seedrandom/lib/alea.js deleted file mode 100644 index 478b956..0000000 --- a/node_modules/seedrandom/lib/alea.js +++ /dev/null @@ -1,114 +0,0 @@ -// 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/node_modules/seedrandom/lib/alea.min.js b/node_modules/seedrandom/lib/alea.min.js deleted file mode 100644 index be30a46..0000000 --- a/node_modules/seedrandom/lib/alea.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/seedrandom/lib/crypto.js b/node_modules/seedrandom/lib/crypto.js deleted file mode 100644 index 18ee91f..0000000 --- a/node_modules/seedrandom/lib/crypto.js +++ /dev/null @@ -1,11 +0,0 @@ -// 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/node_modules/seedrandom/lib/tychei.js b/node_modules/seedrandom/lib/tychei.js deleted file mode 100644 index 3d0ddd4..0000000 --- a/node_modules/seedrandom/lib/tychei.js +++ /dev/null @@ -1,103 +0,0 @@ -// 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/node_modules/seedrandom/lib/tychei.min.js b/node_modules/seedrandom/lib/tychei.min.js deleted file mode 100644 index fa24abb..0000000 --- a/node_modules/seedrandom/lib/tychei.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/seedrandom/lib/xor128.js b/node_modules/seedrandom/lib/xor128.js deleted file mode 100644 index c461934..0000000 --- a/node_modules/seedrandom/lib/xor128.js +++ /dev/null @@ -1,81 +0,0 @@ -// 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/node_modules/seedrandom/lib/xor128.min.js b/node_modules/seedrandom/lib/xor128.min.js deleted file mode 100644 index bd60553..0000000 --- a/node_modules/seedrandom/lib/xor128.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/seedrandom/lib/xor4096.js b/node_modules/seedrandom/lib/xor4096.js deleted file mode 100644 index 6adf19f..0000000 --- a/node_modules/seedrandom/lib/xor4096.js +++ /dev/null @@ -1,146 +0,0 @@ -// 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/node_modules/seedrandom/lib/xor4096.min.js b/node_modules/seedrandom/lib/xor4096.min.js deleted file mode 100644 index fee9f8a..0000000 --- a/node_modules/seedrandom/lib/xor4096.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/seedrandom/lib/xorshift7.js b/node_modules/seedrandom/lib/xorshift7.js deleted file mode 100644 index b7e5151..0000000 --- a/node_modules/seedrandom/lib/xorshift7.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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/node_modules/seedrandom/lib/xorshift7.min.js b/node_modules/seedrandom/lib/xorshift7.min.js deleted file mode 100644 index c6db5f6..0000000 --- a/node_modules/seedrandom/lib/xorshift7.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/seedrandom/lib/xorwow.js b/node_modules/seedrandom/lib/xorwow.js deleted file mode 100644 index 79d5e44..0000000 --- a/node_modules/seedrandom/lib/xorwow.js +++ /dev/null @@ -1,86 +0,0 @@ -// 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/node_modules/seedrandom/lib/xorwow.min.js b/node_modules/seedrandom/lib/xorwow.min.js deleted file mode 100644 index be1c626..0000000 --- a/node_modules/seedrandom/lib/xorwow.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/seedrandom/package.json b/node_modules/seedrandom/package.json deleted file mode 100644 index 86aad13..0000000 --- a/node_modules/seedrandom/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "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/node_modules/seedrandom/seedrandom.js b/node_modules/seedrandom/seedrandom.js deleted file mode 100644 index 12d7ee1..0000000 --- a/node_modules/seedrandom/seedrandom.js +++ /dev/null @@ -1,253 +0,0 @@ -/* -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/node_modules/seedrandom/seedrandom.min.js b/node_modules/seedrandom/seedrandom.min.js deleted file mode 100644 index 56e1afc..0000000 --- a/node_modules/seedrandom/seedrandom.min.js +++ /dev/null @@ -1 +0,0 @@ -!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= 1.5.0 < 2' + * deps: mime@1.6.0 + - Add extensions for JPEG-2000 images + - Add new `font/*` types from IANA + - Add WASM mapping + - Update `.bdoc` to `application/bdoc` + - Update `.bmp` to `image/bmp` + - Update `.m4a` to `audio/mp4` + - Update `.rtf` to `application/rtf` + - Update `.wav` to `audio/wav` + - Update `.xml` to `application/xml` + - Update generic extensions to `application/octet-stream`: + `.deb`, `.dll`, `.dmg`, `.exe`, `.iso`, `.msi` + - Use mime-score module to resolve extension conflicts + * deps: ms@2.1.1 + - Add `week`/`w` support + - Fix negative number handling + * deps: statuses@~1.5.0 + * perf: remove redundant `path.normalize` call + +0.16.2 / 2018-02-07 +=================== + + * Fix incorrect end tag in default error & redirects + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +0.16.1 / 2017-09-29 +=================== + + * Fix regression in edge-case behavior for empty `path` + +0.16.0 / 2017-09-27 +=================== + + * Add `immutable` option + * Fix missing `` in default error & redirects + * Use instance methods on steam to check for listeners + * deps: mime@1.4.1 + - Add 70 new types for file extensions + - Set charset as "UTF-8" for .js and .json + * perf: improve path validation speed + +0.15.6 / 2017-09-22 +=================== + + * deps: debug@2.6.9 + * perf: improve `If-Match` token parsing + +0.15.5 / 2017-09-20 +=================== + + * deps: etag@~1.8.1 + - perf: replace regular expression with substring + * deps: fresh@0.5.2 + - Fix handling of modified headers with invalid dates + - perf: improve ETag match loop + - perf: improve `If-None-Match` token parsing + +0.15.4 / 2017-08-05 +=================== + + * deps: debug@2.6.8 + * deps: depd@~1.1.1 + - Remove unnecessary `Buffer` loading + * deps: http-errors@~1.6.2 + - deps: depd@1.1.1 + +0.15.3 / 2017-05-16 +=================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + * deps: ms@2.0.0 + +0.15.2 / 2017-04-26 +=================== + + * deps: debug@2.6.4 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@0.7.3 + * deps: ms@1.0.0 + +0.15.1 / 2017-03-04 +=================== + + * Fix issue when `Date.parse` does not return `NaN` on invalid date + * Fix strict violation in broken environments + +0.15.0 / 2017-02-25 +=================== + + * Support `If-Match` and `If-Unmodified-Since` headers + * Add `res` and `path` arguments to `directory` event + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Send complete HTML document in redirect & error responses + * Set default CSP header in redirect & error responses + * Use `res.getHeaderNames()` when available + * Use `res.headersSent` when available + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: http-errors@~1.6.1 + - Make `message` property enumerable for `HttpError`s + - deps: setprototypeof@1.0.3 + +0.14.2 / 2017-01-23 +=================== + + * deps: http-errors@~1.5.1 + - deps: inherits@2.0.3 + - deps: setprototypeof@1.0.2 + - deps: statuses@'>= 1.3.1 < 2' + * deps: ms@0.7.2 + * deps: statuses@~1.3.1 + +0.14.1 / 2016-06-09 +=================== + + * Fix redirect error when `path` contains raw non-URL characters + * Fix redirect when `path` starts with multiple forward slashes + +0.14.0 / 2016-06-06 +=================== + + * Add `acceptRanges` option + * Add `cacheControl` option + * Attempt to combine multiple ranges into single range + * Correctly inherit from `Stream` class + * Fix `Content-Range` header in 416 responses when using `start`/`end` options + * Fix `Content-Range` header missing from default 416 responses + * Ignore non-byte `Range` headers + * deps: http-errors@~1.5.0 + - Add `HttpError` export, for `err instanceof createError.HttpError` + - Support new code `421 Misdirected Request` + - Use `setprototypeof` module to replace `__proto__` setting + - deps: inherits@2.0.1 + - deps: statuses@'>= 1.3.0 < 2' + - perf: enable strict mode + * deps: range-parser@~1.2.0 + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: statuses@~1.3.0 + - Add `421 Misdirected Request` + - perf: enable strict mode + * perf: remove argument reassignment + +0.13.2 / 2016-03-05 +=================== + + * Fix invalid `Content-Type` header when `send.mime.default_type` unset + +0.13.1 / 2016-01-16 +=================== + + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: destroy@~1.0.4 + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: range-parser@~1.0.3 + - perf: enable strict mode + +0.13.0 / 2015-06-16 +=================== + + * Allow Node.js HTTP server to set `Date` response header + * Fix incorrectly removing `Content-Location` on 304 response + * Improve the default redirect response headers + * Send appropriate headers on default error response + * Use `http-errors` for standard emitted errors + * Use `statuses` instead of `http` module for status messages + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Improve stat performance by removing hashing + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove unnecessary array allocations + +0.12.3 / 2015-05-13 +=================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: etag@~1.6.0 + - Improve support for JXcore + - Support "fake" stats objects in environments without `fs` + * deps: ms@0.7.1 + - Prevent extraordinarily long inputs + * deps: on-finished@~2.2.1 + +0.12.2 / 2015-03-13 +=================== + + * Throw errors early for invalid `extensions` or `index` options + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.12.1 / 2015-02-17 +=================== + + * Fix regression sending zero-length files + +0.12.0 / 2015-02-16 +=================== + + * Always read the stat size from the file + * Fix mutating passed-in `options` + * deps: mime@1.3.4 + +0.11.1 / 2015-01-20 +=================== + + * Fix `root` path disclosure + +0.11.0 / 2015-01-05 +=================== + + * deps: debug@~2.1.1 + * deps: etag@~1.5.1 + - deps: crc@3.2.1 + * deps: ms@0.7.0 + - Add `milliseconds` + - Add `msecs` + - Add `secs` + - Add `mins` + - Add `hrs` + - Add `yrs` + * deps: on-finished@~2.2.0 + +0.10.1 / 2014-10-22 +=================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.10.0 / 2014-10-15 +=================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: etag@~1.5.0 + - Improve string performance + - Slightly improve speed for weak ETags over 1KB + +0.9.3 / 2014-09-24 +================== + + * deps: etag@~1.4.0 + - Support "fake" stats objects + +0.9.2 / 2014-09-15 +================== + + * deps: depd@0.4.5 + * deps: etag@~1.3.1 + * deps: range-parser@~1.0.2 + +0.9.1 / 2014-09-07 +================== + + * deps: fresh@0.2.4 + +0.9.0 / 2014-09-07 +================== + + * Add `lastModified` option + * Use `etag` to generate `ETag` header + * deps: debug@~2.0.0 + +0.8.5 / 2014-09-04 +================== + + * Fix malicious path detection for empty string path + +0.8.4 / 2014-09-04 +================== + + * Fix a path traversal issue when using `root` + +0.8.3 / 2014-08-16 +================== + + * deps: destroy@1.0.3 + - renamed from dethroy + * deps: on-finished@2.1.0 + +0.8.2 / 2014-08-14 +================== + + * Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + * deps: dethroy@1.0.2 + +0.8.1 / 2014-08-05 +================== + + * Fix `extensions` behavior when file already has extension + +0.8.0 / 2014-08-05 +================== + + * Add `extensions` option + +0.7.4 / 2014-08-04 +================== + + * Fix serving index files without root dir + +0.7.3 / 2014-07-29 +================== + + * Fix incorrect 403 on Windows and Node.js 0.11 + +0.7.2 / 2014-07-27 +================== + + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + +0.7.1 / 2014-07-26 +================== + + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + +0.7.0 / 2014-07-20 +================== + + * Deprecate `hidden` option; use `dotfiles` option + * Add `dotfiles` option + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + +0.6.0 / 2014-07-11 +================== + + * Deprecate `from` option; use `root` option + * Deprecate `send.etag()` -- use `etag` in `options` + * Deprecate `send.hidden()` -- use `hidden` in `options` + * Deprecate `send.index()` -- use `index` in `options` + * Deprecate `send.maxage()` -- use `maxAge` in `options` + * Deprecate `send.root()` -- use `root` in `options` + * Cap `maxAge` value to 1 year + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.5.0 / 2014-06-28 +================== + + * Accept string for `maxAge` (converted by `ms`) + * Add `headers` event + * Include link in default redirect response + * Use `EventEmitter.listenerCount` to count listeners + +0.4.3 / 2014-06-11 +================== + + * Do not throw un-catchable error on file open race condition + * Use `escape-html` for HTML escaping + * deps: debug@1.0.2 + - fix some debugging output colors on node.js 0.8 + * deps: finished@1.2.2 + * deps: fresh@0.2.2 + +0.4.2 / 2014-06-09 +================== + + * fix "event emitter leak" warnings + * deps: debug@1.0.1 + * deps: finished@1.2.1 + +0.4.1 / 2014-06-02 +================== + + * Send `max-age` in `Cache-Control` in correct format + +0.4.0 / 2014-05-27 +================== + + * Calculate ETag with md5 for reduced collisions + * Fix wrong behavior when index file matches directory + * Ignore stream errors after request ends + - Goodbye `EBADF, read` + * Skip directories in index file search + * deps: debug@0.8.1 + +0.3.0 / 2014-04-24 +================== + + * Fix sending files with dots without root set + * Coerce option types + * Accept API options in options object + * Set etags to "weak" + * Include file path in etag + * Make "Can't set headers after they are sent." catchable + * Send full entity-body for multi range requests + * Default directory access to 403 when index disabled + * Support multiple index paths + * Support "If-Range" header + * Control whether to generate etags + * deps: mime@1.2.11 + +0.2.0 / 2014-01-29 +================== + + * update range-parser and fresh + +0.1.4 / 2013-08-11 +================== + + * update fresh + +0.1.3 / 2013-07-08 +================== + + * Revert "Fix fd leak" + +0.1.2 / 2013-07-03 +================== + + * Fix fd leak + +0.1.0 / 2012-08-25 +================== + + * add options parameter to send() that is passed to fs.createReadStream() [kanongil] + +0.0.4 / 2012-08-16 +================== + + * allow custom "Accept-Ranges" definition + +0.0.3 / 2012-07-16 +================== + + * fix normalization of the root directory. Closes #3 + +0.0.2 / 2012-07-09 +================== + + * add passing of req explicitly for now (YUCK) + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/send/README.md b/node_modules/send/README.md index 350fccd..fadf838 100644 --- a/node_modules/send/README.md +++ b/node_modules/send/README.md @@ -2,7 +2,8 @@ [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] -[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Linux Build][github-actions-ci-image]][github-actions-ci-url] +[![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url] Send is a library for streaming files from the file system as a http response @@ -54,7 +55,7 @@ Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot ("."). Note this check is done on the path itself without checking if the path actually exists on the disk. If `root` is specified, only the dotfiles above the root are -checked (i.e. the root itself can be within a dotfile when set +checked (i.e. the root itself can be within a dotfile when when set to "deny"). - `'allow'` No special treatment for dotfiles. @@ -132,6 +133,15 @@ The `SendStream` is an event emitter and will emit the following events: The `pipe` method is used to pipe the response into the Node.js HTTP response object, typically `send(req, path, options).pipe(res)`. +### .mime + +The `mime` export is the global instance of of the +[`mime` npm module](https://www.npmjs.com/package/mime). + +This is used to configure the MIME types that are associated with file extensions +as well as other options for how to resolve the MIME type of a file (like the +default type to use for an unknown file extension). + ## Error-handling By default when no `error` listeners are present an automatic response will be @@ -200,22 +210,20 @@ server.listen(3000) ### Custom file types ```js -var extname = require('path').extname var http = require('http') var parseUrl = require('parseurl') var send = require('send') +// Default unknown types to text/plain +send.mime.default_type = 'text/plain' + +// Add a custom type +send.mime.define({ + 'application/x-my-type': ['x-mt', 'x-mtt'] +}) + var server = http.createServer(function onRequest (req, res) { send(req, parseUrl(req).pathname, { root: '/www/public' }) - .on('headers', function (res, path) { - switch (extname(path)) { - case '.x-mt': - case '.x-mtt': - // custom type for these extensions - res.setHeader('Content-Type', 'application/x-my-type') - break - } - }) .pipe(res) }) @@ -224,7 +232,7 @@ server.listen(3000) ### Custom directory index view -This is an example of serving up a structure of directories with a +This is a example of serving up a structure of directories with a custom function to render a listing of a directory. ```js @@ -306,6 +314,8 @@ server.listen(3000) [MIT](LICENSE) +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/send/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send [coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master [coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master [github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux diff --git a/node_modules/send/SECURITY.md b/node_modules/send/SECURITY.md new file mode 100644 index 0000000..46b48f7 --- /dev/null +++ b/node_modules/send/SECURITY.md @@ -0,0 +1,24 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `send` team and community take all security bugs seriously. Thank you +for improving the security of Express. We appreciate your efforts and +responsible disclosure and will make every effort to acknowledge your +contributions. + +Report security bugs by emailing the current owner(s) of `send`. This information +can be found in the npm registry using the command `npm owner ls send`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/pillarjs/send/issues) +asking for the current contact information. + +To ensure the timely response to your report, please ensure that the entirety +of the report is contained within the email body and not solely behind a web +link or an attachment. + +At least one owner will acknowledge your email within 48 hours, and will send a +more detailed response within 48 hours indicating the next steps in handling +your report. After the initial reply to your report, the owners will +endeavor to keep you informed of the progress towards a fix and full +announcement, and may ask for additional information or guidance. diff --git a/node_modules/send/index.js b/node_modules/send/index.js index 1655053..768f8ca 100644 --- a/node_modules/send/index.js +++ b/node_modules/send/index.js @@ -14,12 +14,14 @@ var createError = require('http-errors') var debug = require('debug')('send') +var deprecate = require('depd')('send') +var destroy = require('destroy') var encodeUrl = require('encodeurl') var escapeHtml = require('escape-html') var etag = require('etag') var fresh = require('fresh') var fs = require('fs') -var mime = require('mime-types') +var mime = require('mime') var ms = require('ms') var onFinished = require('on-finished') var parseRange = require('range-parser') @@ -66,6 +68,7 @@ var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/ */ module.exports = send +module.exports.mime = mime /** * Return a `SendStream` for `req` and `path`. @@ -119,6 +122,17 @@ function SendStream (req, path, options) { throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"') } + this._hidden = Boolean(opts.hidden) + + if (opts.hidden !== undefined) { + deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead') + } + + // legacy support + if (opts.dotfiles === undefined) { + this._dotfiles = undefined + } + this._extensions = opts.extensions !== undefined ? normalizeList(opts.extensions, 'extensions option') : [] @@ -146,6 +160,10 @@ function SendStream (req, path, options) { this._root = opts.root ? resolve(opts.root) : null + + if (!this._root && opts.from) { + this.from(opts.from) + } } /** @@ -154,6 +172,90 @@ function SendStream (req, path, options) { util.inherits(SendStream, Stream) +/** + * Enable or disable etag generation. + * + * @param {Boolean} val + * @return {SendStream} + * @api public + */ + +SendStream.prototype.etag = deprecate.function(function etag (val) { + this._etag = Boolean(val) + debug('etag %s', this._etag) + return this +}, 'send.etag: pass etag as option') + +/** + * Enable or disable "hidden" (dot) files. + * + * @param {Boolean} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.hidden = deprecate.function(function hidden (val) { + this._hidden = Boolean(val) + this._dotfiles = undefined + debug('hidden %s', this._hidden) + return this +}, 'send.hidden: use dotfiles option') + +/** + * Set index `paths`, set to a falsy + * value to disable index support. + * + * @param {String|Boolean|Array} paths + * @return {SendStream} + * @api public + */ + +SendStream.prototype.index = deprecate.function(function index (paths) { + var index = !paths ? [] : normalizeList(paths, 'paths argument') + debug('index %o', paths) + this._index = index + return this +}, 'send.index: pass index as option') + +/** + * Set root `path`. + * + * @param {String} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.root = function root (path) { + this._root = resolve(String(path)) + debug('root %s', this._root) + return this +} + +SendStream.prototype.from = deprecate.function(SendStream.prototype.root, + 'send.from: pass root as option') + +SendStream.prototype.root = deprecate.function(SendStream.prototype.root, + 'send.root: pass root as option') + +/** + * Set max-age to `maxAge`. + * + * @param {Number} maxAge + * @return {SendStream} + * @api public + */ + +SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) { + this._maxage = typeof maxAge === 'string' + ? ms(maxAge) + : Number(maxAge) + this._maxage = !isNaN(this._maxage) + ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) + : 0 + debug('max-age %d', this._maxage) + return this +}, 'send.maxage: pass maxAge as option') + /** * Emit error with `status`. * @@ -456,8 +558,17 @@ SendStream.prototype.pipe = function pipe (res) { // dotfile handling if (containsDotFile(parts)) { - debug('%s dotfile "%s"', this._dotfiles, path) - switch (this._dotfiles) { + var access = this._dotfiles + + // legacy support + if (access === undefined) { + access = parts[parts.length - 1][0] === '.' + ? (this._hidden ? 'allow' : 'ignore') + : 'allow' + } + + debug('%s dotfile "%s"', access, path) + switch (access) { case 'allow': break case 'deny': @@ -496,7 +607,7 @@ SendStream.prototype.send = function send (path, stat) { var ranges = req.headers.range var offset = options.start || 0 - if (res.headersSent) { + if (headersSent(res)) { // impossible to send now this.headersAlreadySent() return @@ -603,14 +714,12 @@ SendStream.prototype.sendFile = function sendFile (path) { debug('stat "%s"', path) fs.stat(path, function onstat (err, stat) { - var pathEndsWithSep = path[path.length - 1] === sep - if (err && err.code === 'ENOENT' && !extname(path) && !pathEndsWithSep) { + if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) { // not found, check extensions return next(err) } if (err) return self.onStatError(err) if (stat.isDirectory()) return self.redirect(path) - if (pathEndsWithSep) return self.error(404) self.emit('file', path, stat) self.send(path, stat) }) @@ -683,7 +792,7 @@ SendStream.prototype.stream = function stream (path, options) { // cleanup function cleanup () { - stream.destroy() + destroy(stream, true) } // response finished, cleanup @@ -717,11 +826,17 @@ SendStream.prototype.type = function type (path) { if (res.getHeader('Content-Type')) return - var ext = extname(path) - var type = mime.contentType(ext) || 'application/octet-stream' + var type = mime.lookup(path) + + if (!type) { + debug('no content-type') + return + } + + var charset = mime.charsets.lookup(type) debug('content-type %s', type) - res.setHeader('Content-Type', type) + res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')) } /** @@ -775,8 +890,10 @@ SendStream.prototype.setHeader = function setHeader (path, stat) { */ function clearHeaders (res) { - for (const header of res.getHeaderNames()) { - res.removeHeader(header) + var headers = getHeaderNames(res) + + for (var i = 0; i < headers.length; i++) { + res.removeHeader(headers[i]) } } @@ -884,10 +1001,24 @@ function decode (path) { } } +/** + * Get the header names on a respnse. + * + * @param {object} res + * @returns {array[string]} + * @private + */ + +function getHeaderNames (res) { + return typeof res.getHeaderNames !== 'function' + ? Object.keys(res._headers || {}) + : res.getHeaderNames() +} + /** * Determine if emitter has listeners of a given type. * - * The way to do this check is done three different ways in Node.js >= 0.10 + * The way to do this check is done three different ways in Node.js >= 0.8 * so this consolidates them into a minimal set using instance methods. * * @param {EventEmitter} emitter @@ -904,6 +1035,20 @@ function hasListeners (emitter, type) { return count > 0 } +/** + * Determine if the response headers have been sent. + * + * @param {object} res + * @returns {boolean} + * @private + */ + +function headersSent (res) { + return typeof res.headersSent !== 'boolean' + ? Boolean(res._header) + : res.headersSent +} + /** * Normalize the index option into an array. * diff --git a/node_modules/send/node_modules/ms/index.js b/node_modules/send/node_modules/ms/index.js new file mode 100644 index 0000000..ea734fb --- /dev/null +++ b/node_modules/send/node_modules/ms/index.js @@ -0,0 +1,162 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function (val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} diff --git a/node_modules/send/node_modules/ms/license.md b/node_modules/send/node_modules/ms/license.md new file mode 100644 index 0000000..fa5d39b --- /dev/null +++ b/node_modules/send/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, 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/node_modules/send/node_modules/ms/package.json b/node_modules/send/node_modules/ms/package.json new file mode 100644 index 0000000..4997189 --- /dev/null +++ b/node_modules/send/node_modules/ms/package.json @@ -0,0 +1,38 @@ +{ + "name": "ms", + "version": "2.1.3", + "description": "Tiny millisecond conversion utility", + "repository": "vercel/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "license": "MIT", + "devDependencies": { + "eslint": "4.18.2", + "expect.js": "0.3.1", + "husky": "0.14.3", + "lint-staged": "5.0.0", + "mocha": "4.0.1", + "prettier": "2.0.5" + } +} diff --git a/node_modules/send/node_modules/ms/readme.md b/node_modules/send/node_modules/ms/readme.md new file mode 100644 index 0000000..0fc1abb --- /dev/null +++ b/node_modules/send/node_modules/ms/readme.md @@ -0,0 +1,59 @@ +# ms + +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +ms('-3 days') // -259200000 +ms('-1h') // -3600000 +ms('-200') // -200 +``` + +### Convert from Milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(-3 * 60000) // "-3m" +ms(ms('10 hours')) // "10h" +``` + +### Time Format Written-Out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(-3 * 60000, { long: true }) // "-3 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [Node.js](https://nodejs.org) and in the browser +- If a number is supplied to `ms`, a string with a unit is returned +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) +- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned + +## Related Packages + +- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. + +## Caught a Bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/send/package.json b/node_modules/send/package.json index e9d3cc2..2d2b805 100644 --- a/node_modules/send/package.json +++ b/node_modules/send/package.json @@ -1,7 +1,7 @@ { "name": "send", "description": "Better streaming static file server with Range and conditional-GET support", - "version": "1.2.1", + "version": "0.19.2", "author": "TJ Holowaychuk ", "contributors": [ "Douglas Christopher Wilson ", @@ -10,54 +10,53 @@ ], "license": "MIT", "repository": "pillarjs/send", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, "keywords": [ "static", "file", "server" ], "dependencies": { - "debug": "^4.4.3", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "fresh": "^2.0.0", - "http-errors": "^2.0.1", - "mime-types": "^3.0.2", - "ms": "^2.1.3", - "on-finished": "^2.4.1", - "range-parser": "^1.2.1", - "statuses": "^2.0.2" + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" }, "devDependencies": { - "after": "^0.8.2", + "after": "0.8.2", "eslint": "7.32.0", "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", + "eslint-plugin-import": "2.25.4", "eslint-plugin-markdown": "2.2.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "5.2.0", "eslint-plugin-standard": "4.1.0", - "mocha": "^10.7.0", - "nyc": "^17.0.0", - "supertest": "6.3.4" + "mocha": "9.2.2", + "nyc": "15.1.0", + "supertest": "6.2.2" }, "files": [ + "HISTORY.md", "LICENSE", "README.md", + "SECURITY.md", "index.js" ], "engines": { - "node": ">= 18" + "node": ">= 0.8.0" }, "scripts": { "lint": "eslint .", - "test": "mocha --check-leaks --reporter spec", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" + "test": "mocha --check-leaks --reporter spec --bail", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" } } diff --git a/node_modules/serve-static/HISTORY.md b/node_modules/serve-static/HISTORY.md new file mode 100644 index 0000000..9919669 --- /dev/null +++ b/node_modules/serve-static/HISTORY.md @@ -0,0 +1,493 @@ +1.16.3 / 2024-12-15 +=================== + +* deps: send@~0.19.1 + - deps: encodeurl@~2.0.0 + +1.16.2 / 2024-09-11 +=================== + +* deps: encodeurl@~2.0.0 + +1.16.1 / 2024-09-11 +=================== + +* deps: send@0.19.0 + +1.16.0 / 2024-09-10 +=================== + +* Remove link renderization in html while redirecting + + +1.15.0 / 2022-03-24 +=================== + + * deps: send@0.18.0 + - Fix emitted 416 error missing headers property + - Limit the headers removed for 304 response + - deps: depd@2.0.0 + - deps: destroy@1.2.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + +1.14.2 / 2021-12-15 +=================== + + * deps: send@0.17.2 + - deps: http-errors@1.8.1 + - deps: ms@2.1.3 + - pref: ignore empty http tokens + +1.14.1 / 2019-05-10 +=================== + + * Set stricter CSP header in redirect response + * deps: send@0.17.1 + - deps: range-parser@~1.2.1 + +1.14.0 / 2019-05-07 +=================== + + * deps: parseurl@~1.3.3 + * deps: send@0.17.0 + - deps: http-errors@~1.7.2 + - deps: mime@1.6.0 + - deps: ms@2.1.1 + - deps: statuses@~1.5.0 + - perf: remove redundant `path.normalize` call + +1.13.2 / 2018-02-07 +=================== + + * Fix incorrect end tag in redirects + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: send@0.16.2 + - deps: depd@~1.1.2 + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + +1.13.1 / 2017-09-29 +=================== + + * Fix regression when `root` is incorrectly set to a file + * deps: send@0.16.1 + +1.13.0 / 2017-09-27 +=================== + + * deps: send@0.16.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Fix missing `` in default error & redirects + - Set charset as "UTF-8" for .js and .json + - Use instance methods on steam to check for listeners + - deps: mime@1.4.1 + - perf: improve path validation speed + +1.12.6 / 2017-09-22 +=================== + + * deps: send@0.15.6 + - deps: debug@2.6.9 + - perf: improve `If-Match` token parsing + * perf: improve slash collapsing + +1.12.5 / 2017-09-21 +=================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: send@0.15.5 + - Fix handling of modified headers with invalid dates + - deps: etag@~1.8.1 + - deps: fresh@0.5.2 + +1.12.4 / 2017-08-05 +=================== + + * deps: send@0.15.4 + - deps: debug@2.6.8 + - deps: depd@~1.1.1 + - deps: http-errors@~1.6.2 + +1.12.3 / 2017-05-16 +=================== + + * deps: send@0.15.3 + - deps: debug@2.6.7 + +1.12.2 / 2017-04-26 +=================== + + * deps: send@0.15.2 + - deps: debug@2.6.4 + +1.12.1 / 2017-03-04 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + +1.12.0 / 2017-02-25 +=================== + + * Send complete HTML document in redirect response + * Set default CSP header in redirect response + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + +1.11.2 / 2017-01-23 +=================== + + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + +1.11.1 / 2016-06-10 +=================== + + * Fix redirect error when `req.url` contains raw non-URL characters + * deps: send@0.14.1 + +1.11.0 / 2016-06-07 +=================== + + * Use status code 301 for redirects + * deps: send@0.14.0 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + +1.10.3 / 2016-05-30 +=================== + + * deps: send@0.13.2 + - Fix invalid `Content-Type` header when `send.mime.default_type` unset + +1.10.2 / 2016-01-19 +=================== + + * deps: parseurl@~1.3.1 + - perf: enable strict mode + +1.10.1 / 2016-01-16 +=================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: send@0.13.1 + - deps: depd@~1.1.0 + - deps: destroy@~1.0.4 + - deps: escape-html@~1.0.3 + - deps: range-parser@~1.0.3 + +1.10.0 / 2015-06-17 +=================== + + * Add `fallthrough` option + - Allows declaring this middleware is the final destination + - Provides better integration with Express patterns + * Fix reading options from options prototype + * Improve the default redirect response headers + * deps: escape-html@1.0.2 + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + * perf: enable strict mode + * perf: remove argument reassignment + +1.9.3 / 2015-05-14 +================== + + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + +1.9.2 / 2015-03-14 +================== + + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + +1.9.1 / 2015-02-17 +================== + + * deps: send@0.12.1 + - Fix regression sending zero-length files + +1.9.0 / 2015-02-16 +================== + + * deps: send@0.12.0 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + +1.8.1 / 2015-01-20 +================== + + * Fix redirect loop in Node.js 0.11.14 + * deps: send@0.11.1 + - Fix root path disclosure + +1.8.0 / 2015-01-05 +================== + + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + +1.7.2 / 2015-01-02 +================== + + * Fix potential open redirect when mounted at root + +1.7.1 / 2014-10-22 +================== + + * deps: send@0.10.1 + - deps: on-finished@~2.1.1 + +1.7.0 / 2014-10-15 +================== + + * deps: send@0.10.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + +1.6.5 / 2015-02-04 +================== + + * Fix potential open redirect when mounted at root + - Back-ported from v1.7.2 + +1.6.4 / 2014-10-08 +================== + + * Fix redirect loop when index file serving disabled + +1.6.3 / 2014-09-24 +================== + + * deps: send@0.9.3 + - deps: etag@~1.4.0 + +1.6.2 / 2014-09-15 +================== + + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + +1.6.1 / 2014-09-07 +================== + + * deps: send@0.9.1 + - deps: fresh@0.2.4 + +1.6.0 / 2014-09-07 +================== + + * deps: send@0.9.0 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + +1.5.4 / 2014-09-04 +================== + + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + +1.5.3 / 2014-08-17 +================== + + * deps: send@0.8.3 + +1.5.2 / 2014-08-14 +================== + + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + +1.5.1 / 2014-08-09 +================== + + * Fix parsing of weird `req.originalUrl` values + * deps: parseurl@~1.3.0 + * deps: utils-merge@1.0.0 + +1.5.0 / 2014-08-05 +================== + + * deps: send@0.8.1 + - Add `extensions` option + +1.4.4 / 2014-08-04 +================== + + * deps: send@0.7.4 + - Fix serving index files without root dir + +1.4.3 / 2014-07-29 +================== + + * deps: send@0.7.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + +1.4.2 / 2014-07-27 +================== + + * deps: send@0.7.2 + - deps: depd@0.4.4 + +1.4.1 / 2014-07-26 +================== + + * deps: send@0.7.1 + - deps: depd@0.4.3 + +1.4.0 / 2014-07-21 +================== + + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - deps: debug@1.0.4 + - deps: depd@0.4.2 + +1.3.2 / 2014-07-11 +================== + + * deps: send@0.6.0 + - Cap `maxAge` value to 1 year + - deps: debug@1.0.3 + +1.3.1 / 2014-07-09 +================== + + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + +1.3.0 / 2014-06-28 +================== + + * Add `setHeaders` option + * Include HTML link in redirect response + * deps: send@0.5.0 + - Accept string for `maxAge` (converted by `ms`) + +1.2.3 / 2014-06-11 +================== + + * deps: send@0.4.3 + - Do not throw un-catchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + +1.2.2 / 2014-06-09 +================== + + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: debug@1.0.1 + - deps: finished@1.2.1 + +1.2.1 / 2014-06-02 +================== + + * use `escape-html` for escaping + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + +1.2.0 / 2014-05-29 +================== + + * deps: send@0.4.0 + - Calculate ETag with md5 for reduced collisions + - Fix wrong behavior when index file matches directory + - Ignore stream errors after request ends + - Skip directories in index file search + - deps: debug@0.8.1 + +1.1.0 / 2014-04-24 +================== + + * Accept options directly to `send` module + * deps: send@0.3.0 + +1.0.4 / 2014-04-07 +================== + + * Resolve relative paths at middleware setup + * Use parseurl to parse the URL from request + +1.0.3 / 2014-03-20 +================== + + * Do not rely on connect-like environments + +1.0.2 / 2014-03-06 +================== + + * deps: send@0.2.0 + +1.0.1 / 2014-03-05 +================== + + * Add mime export for back-compat + +1.0.0 / 2014-03-05 +================== + + * Genesis from `connect` diff --git a/node_modules/serve-static/README.md b/node_modules/serve-static/README.md index 3ff1f1f..262d944 100644 --- a/node_modules/serve-static/README.md +++ b/node_modules/serve-static/README.md @@ -2,7 +2,8 @@ [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] -[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Linux Build][github-actions-ci-image]][github-actions-ci-url] +[![Windows Build][appveyor-image]][appveyor-url] [![Test Coverage][coveralls-image]][coveralls-url] ## Install @@ -18,7 +19,7 @@ $ npm install serve-static ## API ```js -const serveStatic = require('serve-static') +var serveStatic = require('serve-static') ``` ### serveStatic(root, options) @@ -44,7 +45,7 @@ true. Disabling this will ignore the `immutable` and `maxAge` options. ##### dotfiles -Set how "dotfiles" are treated when encountered. A dotfile is a file + Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot ("."). Note this check is done on the path itself without checking if the path actually exists on the disk. If `root` is specified, only the dotfiles above the root are @@ -55,7 +56,8 @@ to "deny"). - `'deny'` Deny a request for a dotfile and 403/`next()`. - `'ignore'` Pretend like the dotfile does not exist and 404/`next()`. -The default value is `'ignore'`. +The default value is similar to `'ignore'`, with the exception that this +default will not ignore the files within a directory that begins with a dot. ##### etag @@ -132,15 +134,15 @@ the arguments are: ### Serve files with vanilla node.js http server ```js -const finalhandler = require('finalhandler') -const http = require('http') -const serveStatic = require('serve-static') +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') // Serve up public/ftp folder -const serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) +var serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) // Create server -const server = http.createServer((req, res) => { +var server = http.createServer(function onRequest (req, res) { serve(req, res, finalhandler(req, res)) }) @@ -151,13 +153,13 @@ server.listen(3000) ### Serve all files as downloads ```js -const contentDisposition = require('content-disposition') -const finalhandler = require('finalhandler') -const http = require('http') -const serveStatic = require('serve-static') +var contentDisposition = require('content-disposition') +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') // Serve up public/ftp folder -const serve = serveStatic('public/ftp', { +var serve = serveStatic('public/ftp', { index: false, setHeaders: setHeaders }) @@ -168,7 +170,7 @@ function setHeaders (res, path) { } // Create server -const server = http.createServer((req, res) => { +var server = http.createServer(function onRequest (req, res) { serve(req, res, finalhandler(req, res)) }) @@ -183,10 +185,10 @@ server.listen(3000) This is a simple example of using Express. ```js -const express = require('express') -const serveStatic = require('serve-static') +var express = require('express') +var serveStatic = require('serve-static') -const app = express() +var app = express() app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) app.listen(3000) @@ -199,11 +201,11 @@ Files are searched for in `public-optimized/` first, then `public/` second as a fallback. ```js -const express = require('express') -const path = require('path') -const serveStatic = require('serve-static') +var express = require('express') +var path = require('path') +var serveStatic = require('serve-static') -const app = express() +var app = express() app.use(serveStatic(path.join(__dirname, 'public-optimized'))) app.use(serveStatic(path.join(__dirname, 'public'))) @@ -213,15 +215,15 @@ app.listen(3000) #### Different settings for paths This example shows how to set a different max age depending on the served -file. In this example, HTML files are not cached, while everything else +file type. In this example, HTML files are not cached, while everything else is for 1 day. ```js -const express = require('express') -const path = require('path') -const serveStatic = require('serve-static') +var express = require('express') +var path = require('path') +var serveStatic = require('serve-static') -const app = express() +var app = express() app.use(serveStatic(path.join(__dirname, 'public'), { maxAge: '1d', @@ -230,8 +232,8 @@ app.use(serveStatic(path.join(__dirname, 'public'), { app.listen(3000) -function setCustomCacheControl (res, file) { - if (path.extname(file) === '.html') { +function setCustomCacheControl (res, path) { + if (serveStatic.mime.lookup(path) === 'text/html') { // Custom Cache-Control for HTML files res.setHeader('Cache-Control', 'public, max-age=0') } @@ -242,6 +244,8 @@ function setCustomCacheControl (res, file) { [MIT](LICENSE) +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static [coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master [coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master [github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux diff --git a/node_modules/serve-static/index.js b/node_modules/serve-static/index.js index 1bee463..3f3e64e 100644 --- a/node_modules/serve-static/index.js +++ b/node_modules/serve-static/index.js @@ -26,6 +26,7 @@ var url = require('url') */ module.exports = serveStatic +module.exports.mime = send.mime /** * @param {string} root diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json index 5fb5b02..b268e48 100644 --- a/node_modules/serve-static/package.json +++ b/node_modules/serve-static/package.json @@ -1,38 +1,36 @@ { "name": "serve-static", "description": "Serve static files", - "version": "2.2.1", + "version": "1.16.3", "author": "Douglas Christopher Wilson ", "license": "MIT", "repository": "expressjs/serve-static", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - }, "dependencies": { - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "parseurl": "^1.3.3", - "send": "^1.2.0" + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" }, "devDependencies": { "eslint": "7.32.0", "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.32.0", + "eslint-plugin-import": "2.25.4", "eslint-plugin-markdown": "2.2.1", "eslint-plugin-node": "11.1.0", "eslint-plugin-promise": "5.2.0", "eslint-plugin-standard": "4.1.0", - "mocha": "^10.7.0", - "nyc": "^17.0.0", - "supertest": "^6.3.4" + "mocha": "9.2.2", + "nyc": "15.1.0", + "safe-buffer": "5.2.1", + "supertest": "6.2.2" }, "files": [ "LICENSE", + "HISTORY.md", "index.js" ], "engines": { - "node": ">= 18" + "node": ">= 0.8.0" }, "scripts": { "lint": "eslint .", diff --git a/node_modules/tiny-emitter/LICENSE b/node_modules/tiny-emitter/LICENSE deleted file mode 100644 index 24f1024..0000000 --- a/node_modules/tiny-emitter/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Scott Corgan - -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/node_modules/tiny-emitter/README.md b/node_modules/tiny-emitter/README.md deleted file mode 100644 index cd474cd..0000000 --- a/node_modules/tiny-emitter/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# tiny-emitter - -A tiny (less than 1k) event emitter library. - -## Install - -### npm - -``` -npm install tiny-emitter --save -``` - -## Usage - -```js -var Emitter = require('tiny-emitter'); -var emitter = new Emitter(); - -emitter.on('some-event', function (arg1, arg2, arg3) { - // -}); - -emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value'); -``` - -Alternatively, you can skip the initialization step by requiring `tiny-emitter/instance` instead. This pulls in an already initialized emitter. - -```js -var emitter = require('tiny-emitter/instance'); - -emitter.on('some-event', function (arg1, arg2, arg3) { - // -}); - -emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value'); -``` - -## Instance Methods - -### on(event, callback[, context]) - -Subscribe to an event - -* `event` - the name of the event to subscribe to -* `callback` - the function to call when event is emitted -* `context` - (OPTIONAL) - the context to bind the event callback to - -### once(event, callback[, context]) - -Subscribe to an event only **once** - -* `event` - the name of the event to subscribe to -* `callback` - the function to call when event is emitted -* `context` - (OPTIONAL) - the context to bind the event callback to - -### off(event[, callback]) - -Unsubscribe from an event or all events. If no callback is provided, it unsubscribes you from all events. - -* `event` - the name of the event to unsubscribe from -* `callback` - the function used when binding to the event - -### emit(event[, arguments...]) - -Trigger a named event - -* `event` - the event name to emit -* `arguments...` - any number of arguments to pass to the event subscribers - -## Test and Build - -Build (Tests, Browserifies, and minifies) - -``` -npm install -npm run build -``` - -Test - -``` -npm install -npm test -``` - -## License - -[MIT](https://github.com/scottcorgan/tiny-emitter/blob/master/LICENSE) diff --git a/node_modules/tiny-emitter/dist/tinyemitter.js b/node_modules/tiny-emitter/dist/tinyemitter.js deleted file mode 100644 index 6e25e05..0000000 --- a/node_modules/tiny-emitter/dist/tinyemitter.js +++ /dev/null @@ -1,71 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.TinyEmitter = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 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/node_modules/tiny-emitter/test/index.js b/node_modules/tiny-emitter/test/index.js deleted file mode 100644 index 7f95f62..0000000 --- a/node_modules/tiny-emitter/test/index.js +++ /dev/null @@ -1,217 +0,0 @@ -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/node_modules/tiny-emitter/yarn.lock b/node_modules/tiny-emitter/yarn.lock deleted file mode 100644 index 730a024..0000000 --- a/node_modules/tiny-emitter/yarn.lock +++ /dev/null @@ -1,1857 +0,0 @@ -# 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/node_modules/type-is/HISTORY.md b/node_modules/type-is/HISTORY.md index 6812655..8de21f7 100644 --- a/node_modules/type-is/HISTORY.md +++ b/node_modules/type-is/HISTORY.md @@ -1,36 +1,3 @@ -2.0.1 / 2025-03-27 -========== - -2.0.0 / 2024-08-31 -========== - - * Drop node <18 - * Use `content-type@^1.0.5` and `media-typer@^1.0.0` for type validation - - No behavior changes, upgrades `media-typer` - * deps: mime-types@^3.0.0 - - Add `application/toml` with extension `.toml` - - Add `application/ubjson` with extension `.ubj` - - Add `application/x-keepass2` with extension `.kdbx` - - Add deprecated iWorks mime types and extensions - - Add extension `.amr` to `audio/amr` - - Add extension `.cjs` to `application/node` - - Add extension `.dbf` to `application/vnd.dbf` - - Add extension `.m4s` to `video/iso.segment` - - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` - - Add extension `.mxmf` to `audio/mobile-xmf` - - Add extension `.opus` to `audio/ogg` - - Add extension `.rar` to `application/vnd.rar` - - Add extension `.td` to `application/urc-targetdesc+xml` - - Add extension `.trig` to `application/trig` - - Add extensions from IANA for `application/*+xml` types - - Add `image/avif` with extension `.avif` - - Add `image/ktx2` with extension `.ktx2` - - Add `image/vnd.ms-dds` with extension `.dds` - - Add new upstream MIME types - - Fix extension of `application/vnd.apple.keynote` to be `.key` - - Remove ambigious extensions from IANA for `application/*+xml` types - - Update primary extension to `.es` for `application/ecmascript` - 1.6.18 / 2019-04-26 =================== diff --git a/node_modules/type-is/README.md b/node_modules/type-is/README.md index d23946e..b85ef8f 100644 --- a/node_modules/type-is/README.md +++ b/node_modules/type-is/README.md @@ -3,12 +3,12 @@ [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-version-image]][node-version-url] -[![Build Status][ci-image]][ci-url] +[![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] Infer the content-type of a request. -## Install +### Install This is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/). Installation is done using the @@ -52,6 +52,8 @@ Each type in the `types` array can be one of the following: Some examples to illustrate the inputs and returned value: + + ```js // req.headers.content-type = 'application/json' @@ -72,6 +74,8 @@ Having a body has no relation to how large the body is (it may be 0 bytes). This is similar to how file existence works. If a body does exist, then this indicates that there is data to read from the Node.js request stream. + + ```js if (typeis.hasBody(req)) { // read the body, since there is one @@ -104,6 +108,8 @@ Each type in the `types` array can be one of the following: Some examples to illustrate the inputs and returned value: + + ```js var mediaType = 'application/json' @@ -115,38 +121,6 @@ typeis.is(mediaType, ['application/json']) // => 'application/json' typeis.is(mediaType, ['html']) // => false ``` -### typeis.match(expected, actual) - -Match the type string `expected` with `actual`, taking in to account wildcards. -A wildcard can only be in the type of the subtype part of a media type and only -in the `expected` value (as `actual` should be the real media type to match). A -suffix can still be included even with a wildcard subtype. If an input is -malformed, `false` will be returned. - -```js -typeis.match('text/html', 'text/html') // => true -typeis.match('*/html', 'text/html') // => true -typeis.match('text/*', 'text/html') // => true -typeis.match('*/*', 'text/html') // => true -typeis.match('*/*+json', 'application/x-custom+json') // => true -``` - -### typeis.normalize(type) - -Normalize a `type` string. This works by performing the following: - -- If the `type` is not a string, `false` is returned. -- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`), - then it is expanded to contain the complete wildcard notation of `*/*+suffix`. -- If the string contains a `/`, then it is returned as the type. -- Else the string is assumed to be a file extension and the mapped media type is - returned, or `false` is there is no mapping. - -This includes two special mappings: - -- `'multipart'` -> `'multipart/*'` -- `'urlencoded'` -> `'application/x-www-form-urlencoded'` - ## Examples ### Example body parser @@ -185,8 +159,6 @@ app.use(function bodyParser (req, res, next) { [MIT](LICENSE) -[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci -[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master [coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master [node-version-image]: https://badgen.net/npm/node/type-is diff --git a/node_modules/type-is/index.js b/node_modules/type-is/index.js index e773845..890ad76 100644 --- a/node_modules/type-is/index.js +++ b/node_modules/type-is/index.js @@ -12,9 +12,8 @@ * @private */ -var contentType = require('content-type') -var mime = require('mime-types') var typer = require('media-typer') +var mime = require('mime-types') /** * Module exports. @@ -116,19 +115,27 @@ function hasbody (req) { * * this.is('html'); // => false * - * @param {Object} req - * @param {(String|Array)} types... - * @return {(String|false|null)} + * @param {String|Array} types... + * @return {String|false|null} * @public */ function typeofrequest (req, types_) { + var types = types_ + // no body - if (!hasbody(req)) return null + if (!hasbody(req)) { + return null + } + // support flattened arguments - var types = arguments.length > 2 - ? Array.prototype.slice.call(arguments, 1) - : types_ + if (arguments.length > 2) { + types = new Array(arguments.length - 1) + for (var i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + // request content type var value = req.headers['content-type'] @@ -148,8 +155,7 @@ function typeofrequest (req, types_) { * and are thus ensured to work. * * @param {String} type - * @return {String|false|null} - * @public + * @private */ function normalize (type) { @@ -183,7 +189,7 @@ function normalize (type) { * @param {String} expected * @param {String} actual * @return {Boolean} - * @public + * @private */ function mimeMatch (expected, actual) { @@ -207,9 +213,9 @@ function mimeMatch (expected, actual) { } // validate suffix wildcard - if (expectedParts[1].slice(0, 2) === '*+') { + if (expectedParts[1].substr(0, 2) === '*+') { return expectedParts[1].length <= actualParts[1].length + 1 && - expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length) } // validate subtype @@ -224,26 +230,36 @@ function mimeMatch (expected, actual) { * Normalize a type and remove parameters. * * @param {string} value - * @return {(string|null)} + * @return {string} * @private */ -function normalizeType (value) { - // Parse the type - var type = contentType.parse(value).type - return typer.test(type) ? type : null +function normalizeType (value) { + // parse the type + var type = typer.parse(value) + + // remove the parameters + type.parameters = undefined + + // reformat it + return typer.format(type) } /** * Try to normalize a type and remove parameters. * * @param {string} value - * @return {(string|null)} + * @return {string} * @private */ + function tryNormalizeType (value) { + if (!value) { + return null + } + try { - return value ? normalizeType(value) : null + return normalizeType(value) } catch (err) { return null } diff --git a/node_modules/type-is/package.json b/node_modules/type-is/package.json index 08586d2..97ba5f1 100644 --- a/node_modules/type-is/package.json +++ b/node_modules/type-is/package.json @@ -1,7 +1,7 @@ { "name": "type-is", "description": "Infer the content-type of a request.", - "version": "2.0.1", + "version": "1.6.18", "contributors": [ "Douglas Christopher Wilson ", "Jonathan Ong (http://jongleberry.com)" @@ -9,20 +9,19 @@ "license": "MIT", "repository": "jshttp/type-is", "dependencies": { - "content-type": "^1.0.5", - "media-typer": "^1.1.0", - "mime-types": "^3.0.0" + "media-typer": "0.3.0", + "mime-types": "~2.1.24" }, "devDependencies": { - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "5.2.0", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.1", - "nyc": "15.1.0" + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.0.0" }, "engines": { "node": ">= 0.6" @@ -33,11 +32,10 @@ "index.js" ], "scripts": { - "lint": "eslint .", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --check-leaks --bail test/", - "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", - "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" }, "keywords": [ "content", diff --git a/node_modules/typed-function/LICENSE b/node_modules/typed-function/LICENSE deleted file mode 100644 index ce81010..0000000 --- a/node_modules/typed-function/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/typed-function/README.md b/node_modules/typed-function/README.md deleted file mode 100644 index d05204e..0000000 --- a/node_modules/typed-function/README.md +++ /dev/null @@ -1,605 +0,0 @@ -# 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/node_modules/typed-function/lib/esm/typed-function.mjs b/node_modules/typed-function/lib/esm/typed-function.mjs deleted file mode 100644 index fd6bd73..0000000 --- a/node_modules/typed-function/lib/esm/typed-function.mjs +++ /dev/null @@ -1,1946 +0,0 @@ -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 types of a parameter - * @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++) { - 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. The return value is a number that is - * negative when param1 should be considered first, positive - * when param2 should be considered first, and zero when the - * params are indistinguishable. Primarily as a debugging aid, - * the value is always less than one in absolute value, and - * a smaller absolute value indicates a less important distinction - * between the parameters. - * @param {Param} param1 - * @param {Param} param2 - * @return {number} negative, positive, or zero depending on whether - * param1 should be ordered before, after, or equivalently - * to param2 - */ - 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 0.1; - } - } else if (param2.hasAny) { - return -0.1; - } - - // 2) Prefer non-rest to rest parameters - if (param1.restParam) { - if (!param2.restParam) { - return 0.01; - } - } else if (param2.restParam) { - return -0.01; - } - - // 3) Prefer lower type index: - const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2); - if (typeDiff < 0) { - return -0.001; - } - if (typeDiff > 0) { - return 0.001; - } - - // 4) Prefer exact type match to conversions, with a strength that - // grows with the conversion index - const conv1 = getLowestConversionIndex(param1); - const conv2 = getLowestConversionIndex(param2); - if (param1.hasConversion) { - if (!param2.hasConversion) { - return (1 + conv1) * 0.000001; - } - } else if (param2.hasConversion) { - return -(1 + conv2) * 0.000001; - } - - // 5) Prefer lower conversion index - const convDiff = conv1 - conv2; - if (convDiff < 0) { - return -0.0000001; - } - if (convDiff > 0) { - return 0.0000001; - } - - // Don't have a basis for preference - return 0; - } - - /** - * Compare two signatures. The result is a number that is negative - * when the first signature should be preferred to the second, positive - * when the second signature should be preferred, and zero in case the - * two signatures are essentially equivalent. Primarily as a debugging - * aid, a larger absolute value indicates a more "important" difference. - * - * @param {Signature} signature1 - * @param {Signature} signature2 - * @return {number} returns a negative number when signature1 must get a - * lower index than signature2, a positive number when the - * opposite holds, or zero when both are equivalent. - */ - 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 10000000; - } - } else if (hasRest2 && last2.hasAny) { - return -10000000; - } - - // 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) * 1000000; - } - - // 3) A conversion rest param is less preferred - if (hasRest1 && last1.hasConversion) { - if (!hasRest2 || !last2.hasConversion) { - return 100000; - } - } else if (hasRest2 && last2.hasConversion) { - return -100000; - } - - // 4) Minimize the number of conversions - if (conv1 !== conv2) { - return (conv1 - conv2) * 10000; - } - - // 5) Prefer no rest param - if (hasRest1) { - if (!hasRest2) { - return 1000; - } - } else if (hasRest2) { - return -1000; - } - - // 6) Prefer shorter with rest param, longer without - const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -100 : 100); - 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 < 0 ? -10 : 10) + 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; - let bonus = 9; - const decrement = bonus / (comparisons.length + 1); - for (c of comparisons) { - if (c !== 0) { - return (c < 0 ? -bonus : bonus) + c; - } - bonus -= decrement; - } - - // 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) return types[0].conversionsTo; - - // Here, for each type that occurs as the from-type of any conversion - // to any of the types found, we must select the conversion of - // lowest index from that type. So first collect the types. - const knownTypes = new Set(typeNames); - const convertibleTypes = new Set(); - for (let i = 0; i < types.length; ++i) { - for (const match of types[i].conversionsTo) { - if (!knownTypes.has(match.from)) convertibleTypes.add(match.from); - } - } - - // Now get the lowest-index conversion for each type - const matches = []; - for (const typeName of convertibleTypes) { - let bestIndex = nConversions + 1; - let bestConversion = null; - for (let i = 0; i < types.length; ++i) { - for (const match of types[i].conversionsTo) { - if (match.from === typeName && match.index < bestIndex) { - bestIndex = match.index; - bestConversion = match; - } - } - } - matches.push(bestConversion); - } - 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 fn or a wrapped function if needed. If it - * has conversions, the function will be named to indicate - * what conversions are occurring. - */ - function compileArgsPreprocessing(params, fn) { - let fnConvert = fn; - - // TODO: can we make this wrapper function smarter/simpler? - - let name = ''; - if (params.some(p => p.hasConversion)) { - const restParam = hasRestParam(params); - const compiledConversions = params.map(compileArgConversion); - name = compiledConversions.map(conv => conv.name).join(';'); - 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)])); - }; - } - if (name) Object.defineProperty(fnPreprocess, 'name', { - value: name - }); - 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 = []; - let name = ''; - param.types.forEach(function (type) { - if (type.conversion) { - name += type.conversion.from + '~>' + type.conversion.to + ','; - tests.push(findType(type.conversion.from).test); - conversions.push(type.conversion.convert); - } - }); - if (name) name = name.slice(0, -1);else name = 'pass'; - - // create optimized conversion functions depending on the number of conversions - let convertor = arg => arg; - switch (conversions.length) { - case 0: - break; - case 1: - test0 = tests[0]; - conversion0 = conversions[0]; - convertor = function convertArg(arg) { - if (test0(arg)) { - return conversion0(arg); - } - return arg; - }; - break; - case 2: - test0 = tests[0]; - test1 = tests[1]; - conversion0 = conversions[0]; - conversion1 = conversions[1]; - convertor = function convertArg(arg) { - if (test0(arg)) { - return conversion0(arg); - } - if (test1(arg)) { - return conversion1(arg); - } - return arg; - }; - break; - default: - convertor = function convertArg(arg) { - for (let i = 0; i < conversions.length; i++) { - if (tests[i](arg)) { - return conversions[i](arg); - } - } - return arg; - }; - } - Object.defineProperty(convertor, 'name', { - value: name - }); - return convertor; - } - - /** - * 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, - to: to.name, - 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/node_modules/typed-function/lib/esm/typed-function.mjs.map b/node_modules/typed-function/lib/esm/typed-function.mjs.map deleted file mode 100644 index 174d702..0000000 --- a/node_modules/typed-function/lib/esm/typed-function.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"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","conv1","conv2","convDiff","compareSignatures","signature1","signature2","pars1","pars2","last1","last2","hasRest1","hasRest2","any1","par","any2","lengthCriterion","comparisons","tc","thisComparison","c","bonus","decrement","knownTypes","bestIndex","bestConversion","compileArgsPreprocessing","fnConvert","compiledConversions","compileArgConversion","conv","convertArgs","fnPreprocess","offset","preprocessRestParams","defineProperty","conversion0","conversion1","to","convertor","arg","convertArg","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","sort","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","_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","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 types of a parameter\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 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\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. The return value is a number that is\n * negative when param1 should be considered first, positive\n * when param2 should be considered first, and zero when the\n * params are indistinguishable. Primarily as a debugging aid,\n * the value is always less than one in absolute value, and\n * a smaller absolute value indicates a less important distinction\n * between the parameters.\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} negative, positive, or zero depending on whether\n * param1 should be ordered before, after, or equivalently\n * to param2\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 0.1\n }\n } else if (param2.hasAny) {\n return -0.1\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 0.01\n }\n } else if (param2.restParam) {\n return -0.01\n }\n\n // 3) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2)\n if (typeDiff < 0) {\n return -0.001\n }\n if (typeDiff > 0) {\n return 0.001\n }\n\n // 4) Prefer exact type match to conversions, with a strength that\n // grows with the conversion index\n const conv1 = getLowestConversionIndex(param1)\n const conv2 = getLowestConversionIndex(param2)\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return (1 + conv1) * 0.000001\n }\n } else if (param2.hasConversion) {\n return -(1 + conv2) * 0.000001\n }\n\n // 5) Prefer lower conversion index\n const convDiff = conv1 - conv2\n if (convDiff < 0) {\n return -0.0000001\n }\n if (convDiff > 0) {\n return 0.0000001\n }\n\n // Don't have a basis for preference\n return 0\n }\n\n /**\n * Compare two signatures. The result is a number that is negative\n * when the first signature should be preferred to the second, positive\n * when the second signature should be preferred, and zero in case the\n * two signatures are essentially equivalent. Primarily as a debugging\n * aid, a larger absolute value indicates a more \"important\" difference.\n *\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when signature1 must get a\n * lower index than signature2, a positive number when the\n * opposite holds, or zero when both are equivalent.\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 10000000\n }\n } else if (hasRest2 && last2.hasAny) {\n return -10000000\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) * 1000000\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 100000\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -100000\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return (conv1 - conv2) * 10000\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1000\n }\n } else if (hasRest2) {\n return -1000\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion =\n (pars1.length - pars2.length) * (hasRest1 ? -100 : 100)\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 < 0) ? -10 : 10) + 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 let bonus = 9\n const decrement = bonus / (comparisons.length + 1)\n for (c of comparisons) {\n if (c !== 0) {\n return ((c < 0) ? -bonus : bonus) + c\n }\n bonus -= decrement\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) return types[0].conversionsTo\n\n // Here, for each type that occurs as the from-type of any conversion\n // to any of the types found, we must select the conversion of\n // lowest index from that type. So first collect the types.\n const knownTypes = new Set(typeNames)\n const convertibleTypes = new Set()\n for (let i = 0; i < types.length; ++i) {\n for (const match of types[i].conversionsTo) {\n if (!knownTypes.has(match.from)) convertibleTypes.add(match.from)\n }\n }\n\n // Now get the lowest-index conversion for each type\n const matches = []\n for (const typeName of convertibleTypes) {\n let bestIndex = nConversions + 1\n let bestConversion = null\n for (let i = 0; i < types.length; ++i) {\n for (const match of types[i].conversionsTo) {\n if (match.from === typeName && match.index < bestIndex) {\n bestIndex = match.index\n bestConversion = match\n }\n }\n }\n matches.push(bestConversion)\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 fn or a wrapped function if needed. If it\n * has conversions, the function will be named to indicate\n * what conversions are occurring.\n */\n function compileArgsPreprocessing (params, fn) {\n let fnConvert = fn\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n let name = ''\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params)\n const compiledConversions = params.map(compileArgConversion)\n name = compiledConversions.map(conv => conv.name).join(';')\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 if (name) Object.defineProperty(fnPreprocess, 'name', { value: name })\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 let name = ''\n param.types.forEach(function (type) {\n if (type.conversion) {\n name += type.conversion.from + '~>' + type.conversion.to + ','\n tests.push(findType(type.conversion.from).test)\n conversions.push(type.conversion.convert)\n }\n })\n if (name) name = name.slice(0, -1)\n else name = 'pass'\n\n // create optimized conversion functions depending on the number of conversions\n let convertor = arg => arg\n switch (conversions.length) {\n case 0: break\n case 1:\n test0 = tests[0]\n conversion0 = conversions[0]\n convertor = function convertArg (arg) {\n if (test0(arg)) {\n return conversion0(arg)\n }\n return arg\n }\n break\n case 2:\n test0 = tests[0]\n test1 = tests[1]\n conversion0 = conversions[0]\n conversion1 = conversions[1]\n convertor = 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 break\n default:\n convertor = 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 Object.defineProperty(convertor, 'name', { value: name })\n return convertor\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 to: to.name,\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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,IAAI1P,KAAK,CACb,gDAAgD,GAAGgB,UAAU,CAACd,IAAI,GAClE,MAAM,GAAGc,UAAU,CAACkG,EAAE,CAAC;IAC3B;IACA,IAAIwI,kBAAkB,CAAC5P,OAAO,KAAKkB,UAAU,CAAClB,OAAO,EAAE;MACrD,MAAM,IAAIE,KAAK,CACb,yDAAyD,CAAC;IAC9D;IACA,MAAMpD,KAAK,GAAGsK,EAAE,CAAChK,aAAa,CAACsD,OAAO,CAACkP,kBAAkB,CAAC;IAC1DxI,EAAE,CAAChK,aAAa,CAACyS,MAAM,CAAC/S,KAAK,EAAE,CAAC,CAAC;EACnC,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEhB,KAAK,CAACgU,OAAO,GAAG,UAAUC,EAAE,EAAEC,OAAO,EAAE;IACrC,IAAI,CAACjS,eAAe,CAACgS,EAAE,CAAC,EAAE;MACxB,MAAM,IAAIxT,SAAS,CAAC3B,kBAAkB,CAAC;IACzC;IACA,MAAMqV,IAAI,GAAGF,EAAE,CAACjR,kBAAkB,CAACF,UAAU;IAC7C,KAAK,IAAI5B,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGiT,IAAI,CAACrT,MAAM,EAAE,EAAEI,CAAC,EAAE;MACpC,IAAIiT,IAAI,CAACjT,CAAC,CAAC,CAAC5B,IAAI,CAAC4U,OAAO,CAAC,EAAE;QACzB,OAAOC,IAAI,CAACjT,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/node_modules/typed-function/lib/umd/package.json b/node_modules/typed-function/lib/umd/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/node_modules/typed-function/lib/umd/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/typed-function/lib/umd/typed-function.js b/node_modules/typed-function/lib/umd/typed-function.js deleted file mode 100644 index db60e05..0000000 --- a/node_modules/typed-function/lib/umd/typed-function.js +++ /dev/null @@ -1,1954 +0,0 @@ -(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 types of a parameter - * @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++) { - 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. The return value is a number that is - * negative when param1 should be considered first, positive - * when param2 should be considered first, and zero when the - * params are indistinguishable. Primarily as a debugging aid, - * the value is always less than one in absolute value, and - * a smaller absolute value indicates a less important distinction - * between the parameters. - * @param {Param} param1 - * @param {Param} param2 - * @return {number} negative, positive, or zero depending on whether - * param1 should be ordered before, after, or equivalently - * to param2 - */ - 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 0.1; - } - } else if (param2.hasAny) { - return -0.1; - } - - // 2) Prefer non-rest to rest parameters - if (param1.restParam) { - if (!param2.restParam) { - return 0.01; - } - } else if (param2.restParam) { - return -0.01; - } - - // 3) Prefer lower type index: - const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2); - if (typeDiff < 0) { - return -1e-3; - } - if (typeDiff > 0) { - return 0.001; - } - - // 4) Prefer exact type match to conversions, with a strength that - // grows with the conversion index - const conv1 = getLowestConversionIndex(param1); - const conv2 = getLowestConversionIndex(param2); - if (param1.hasConversion) { - if (!param2.hasConversion) { - return (1 + conv1) * 0.000001; - } - } else if (param2.hasConversion) { - return -(1 + conv2) * 0.000001; - } - - // 5) Prefer lower conversion index - const convDiff = conv1 - conv2; - if (convDiff < 0) { - return -1e-7; - } - if (convDiff > 0) { - return 0.0000001; - } - - // Don't have a basis for preference - return 0; - } - - /** - * Compare two signatures. The result is a number that is negative - * when the first signature should be preferred to the second, positive - * when the second signature should be preferred, and zero in case the - * two signatures are essentially equivalent. Primarily as a debugging - * aid, a larger absolute value indicates a more "important" difference. - * - * @param {Signature} signature1 - * @param {Signature} signature2 - * @return {number} returns a negative number when signature1 must get a - * lower index than signature2, a positive number when the - * opposite holds, or zero when both are equivalent. - */ - 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 10000000; - } - } else if (hasRest2 && last2.hasAny) { - return -1e7; - } - - // 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) * 1000000; - } - - // 3) A conversion rest param is less preferred - if (hasRest1 && last1.hasConversion) { - if (!hasRest2 || !last2.hasConversion) { - return 100000; - } - } else if (hasRest2 && last2.hasConversion) { - return -1e5; - } - - // 4) Minimize the number of conversions - if (conv1 !== conv2) { - return (conv1 - conv2) * 10000; - } - - // 5) Prefer no rest param - if (hasRest1) { - if (!hasRest2) { - return 1000; - } - } else if (hasRest2) { - return -1e3; - } - - // 6) Prefer shorter with rest param, longer without - const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -100 : 100); - 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 < 0 ? -10 : 10) + 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; - let bonus = 9; - const decrement = bonus / (comparisons.length + 1); - for (c of comparisons) { - if (c !== 0) { - return (c < 0 ? -bonus : bonus) + c; - } - bonus -= decrement; - } - - // 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) return types[0].conversionsTo; - - // Here, for each type that occurs as the from-type of any conversion - // to any of the types found, we must select the conversion of - // lowest index from that type. So first collect the types. - const knownTypes = new Set(typeNames); - const convertibleTypes = new Set(); - for (let i = 0; i < types.length; ++i) { - for (const match of types[i].conversionsTo) { - if (!knownTypes.has(match.from)) convertibleTypes.add(match.from); - } - } - - // Now get the lowest-index conversion for each type - const matches = []; - for (const typeName of convertibleTypes) { - let bestIndex = nConversions + 1; - let bestConversion = null; - for (let i = 0; i < types.length; ++i) { - for (const match of types[i].conversionsTo) { - if (match.from === typeName && match.index < bestIndex) { - bestIndex = match.index; - bestConversion = match; - } - } - } - matches.push(bestConversion); - } - 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 fn or a wrapped function if needed. If it - * has conversions, the function will be named to indicate - * what conversions are occurring. - */ - function compileArgsPreprocessing(params, fn) { - let fnConvert = fn; - - // TODO: can we make this wrapper function smarter/simpler? - - let name = ''; - if (params.some(p => p.hasConversion)) { - const restParam = hasRestParam(params); - const compiledConversions = params.map(compileArgConversion); - name = compiledConversions.map(conv => conv.name).join(';'); - 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)])); - }; - } - if (name) Object.defineProperty(fnPreprocess, 'name', { - value: name - }); - 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 = []; - let name = ''; - param.types.forEach(function (type) { - if (type.conversion) { - name += type.conversion.from + '~>' + type.conversion.to + ','; - tests.push(findType(type.conversion.from).test); - conversions.push(type.conversion.convert); - } - }); - if (name) name = name.slice(0, -1);else name = 'pass'; - - // create optimized conversion functions depending on the number of conversions - let convertor = arg => arg; - switch (conversions.length) { - case 0: - break; - case 1: - test0 = tests[0]; - conversion0 = conversions[0]; - convertor = function convertArg(arg) { - if (test0(arg)) { - return conversion0(arg); - } - return arg; - }; - break; - case 2: - test0 = tests[0]; - test1 = tests[1]; - conversion0 = conversions[0]; - conversion1 = conversions[1]; - convertor = function convertArg(arg) { - if (test0(arg)) { - return conversion0(arg); - } - if (test1(arg)) { - return conversion1(arg); - } - return arg; - }; - break; - default: - convertor = function convertArg(arg) { - for (let i = 0; i < conversions.length; i++) { - if (tests[i](arg)) { - return conversions[i](arg); - } - } - return arg; - }; - } - Object.defineProperty(convertor, 'name', { - value: name - }); - return convertor; - } - - /** - * 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, - to: to.name, - 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/node_modules/typed-function/lib/umd/typed-function.js.map b/node_modules/typed-function/lib/umd/typed-function.js.map deleted file mode 100644 index 52908a0..0000000 --- a/node_modules/typed-function/lib/umd/typed-function.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 types of a parameter\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 min = Math.min(min, param.types[i].typeIndex);\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. The return value is a number that is\n * negative when param1 should be considered first, positive\n * when param2 should be considered first, and zero when the\n * params are indistinguishable. Primarily as a debugging aid,\n * the value is always less than one in absolute value, and\n * a smaller absolute value indicates a less important distinction\n * between the parameters.\n * @param {Param} param1\n * @param {Param} param2\n * @return {number} negative, positive, or zero depending on whether\n * param1 should be ordered before, after, or equivalently\n * to param2\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 0.1;\n }\n } else if (param2.hasAny) {\n return -0.1;\n }\n\n // 2) Prefer non-rest to rest parameters\n if (param1.restParam) {\n if (!param2.restParam) {\n return 0.01;\n }\n } else if (param2.restParam) {\n return -0.01;\n }\n\n // 3) Prefer lower type index:\n const typeDiff = getLowestTypeIndex(param1) - getLowestTypeIndex(param2);\n if (typeDiff < 0) {\n return -0.001;\n }\n if (typeDiff > 0) {\n return 0.001;\n }\n\n // 4) Prefer exact type match to conversions, with a strength that\n // grows with the conversion index\n const conv1 = getLowestConversionIndex(param1);\n const conv2 = getLowestConversionIndex(param2);\n if (param1.hasConversion) {\n if (!param2.hasConversion) {\n return (1 + conv1) * 0.000001;\n }\n } else if (param2.hasConversion) {\n return -(1 + conv2) * 0.000001;\n }\n\n // 5) Prefer lower conversion index\n const convDiff = conv1 - conv2;\n if (convDiff < 0) {\n return -0.0000001;\n }\n if (convDiff > 0) {\n return 0.0000001;\n }\n\n // Don't have a basis for preference\n return 0;\n }\n\n /**\n * Compare two signatures. The result is a number that is negative\n * when the first signature should be preferred to the second, positive\n * when the second signature should be preferred, and zero in case the\n * two signatures are essentially equivalent. Primarily as a debugging\n * aid, a larger absolute value indicates a more \"important\" difference.\n *\n * @param {Signature} signature1\n * @param {Signature} signature2\n * @return {number} returns a negative number when signature1 must get a\n * lower index than signature2, a positive number when the\n * opposite holds, or zero when both are equivalent.\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 10000000;\n }\n } else if (hasRest2 && last2.hasAny) {\n return -10000000;\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) * 1000000;\n }\n\n // 3) A conversion rest param is less preferred\n if (hasRest1 && last1.hasConversion) {\n if (!hasRest2 || !last2.hasConversion) {\n return 100000;\n }\n } else if (hasRest2 && last2.hasConversion) {\n return -100000;\n }\n\n // 4) Minimize the number of conversions\n if (conv1 !== conv2) {\n return (conv1 - conv2) * 10000;\n }\n\n // 5) Prefer no rest param\n if (hasRest1) {\n if (!hasRest2) {\n return 1000;\n }\n } else if (hasRest2) {\n return -1000;\n }\n\n // 6) Prefer shorter with rest param, longer without\n const lengthCriterion = (pars1.length - pars2.length) * (hasRest1 ? -100 : 100);\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 < 0 ? -10 : 10) + 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 let bonus = 9;\n const decrement = bonus / (comparisons.length + 1);\n for (c of comparisons) {\n if (c !== 0) {\n return (c < 0 ? -bonus : bonus) + c;\n }\n bonus -= decrement;\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) return types[0].conversionsTo;\n\n // Here, for each type that occurs as the from-type of any conversion\n // to any of the types found, we must select the conversion of\n // lowest index from that type. So first collect the types.\n const knownTypes = new Set(typeNames);\n const convertibleTypes = new Set();\n for (let i = 0; i < types.length; ++i) {\n for (const match of types[i].conversionsTo) {\n if (!knownTypes.has(match.from)) convertibleTypes.add(match.from);\n }\n }\n\n // Now get the lowest-index conversion for each type\n const matches = [];\n for (const typeName of convertibleTypes) {\n let bestIndex = nConversions + 1;\n let bestConversion = null;\n for (let i = 0; i < types.length; ++i) {\n for (const match of types[i].conversionsTo) {\n if (match.from === typeName && match.index < bestIndex) {\n bestIndex = match.index;\n bestConversion = match;\n }\n }\n }\n matches.push(bestConversion);\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 fn or a wrapped function if needed. If it\n * has conversions, the function will be named to indicate\n * what conversions are occurring.\n */\n function compileArgsPreprocessing(params, fn) {\n let fnConvert = fn;\n\n // TODO: can we make this wrapper function smarter/simpler?\n\n let name = '';\n if (params.some(p => p.hasConversion)) {\n const restParam = hasRestParam(params);\n const compiledConversions = params.map(compileArgConversion);\n name = compiledConversions.map(conv => conv.name).join(';');\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 if (name) Object.defineProperty(fnPreprocess, 'name', {\n value: name\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 let name = '';\n param.types.forEach(function (type) {\n if (type.conversion) {\n name += type.conversion.from + '~>' + type.conversion.to + ',';\n tests.push(findType(type.conversion.from).test);\n conversions.push(type.conversion.convert);\n }\n });\n if (name) name = name.slice(0, -1);else name = 'pass';\n\n // create optimized conversion functions depending on the number of conversions\n let convertor = arg => arg;\n switch (conversions.length) {\n case 0:\n break;\n case 1:\n test0 = tests[0];\n conversion0 = conversions[0];\n convertor = function convertArg(arg) {\n if (test0(arg)) {\n return conversion0(arg);\n }\n return arg;\n };\n break;\n case 2:\n test0 = tests[0];\n test1 = tests[1];\n conversion0 = conversions[0];\n conversion1 = conversions[1];\n convertor = 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 break;\n default:\n convertor = 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 Object.defineProperty(convertor, 'name', {\n value: name\n });\n return convertor;\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 to: to.name,\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;EACb;EACA,SAAS,KAAK,GAAG;EACjB,EAAE,OAAO,KAAK;EACd;EACA,SAAS,KAAK,GAAG;EACjB,EAAE,OAAO,SAAS;EAClB;EACA,MAAM,kBAAkB,GAAG,mCAAmC;;EAE9D;EACA;EACA;EACA;EACA;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,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;EAC1C,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;EACjC,QAAQ,OAAO,IAAI,CAAC,CAAC,CAAC;EACtB,MAAM;EACN,IAAI;EACJ,IAAI,OAAO,IAAI;EACf,EAAE,CAAC;EACH,EAAE,OAAO,KAAK;EACd;AACA,sBAAe,MAAM,EAAE;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/typed-function/package.json b/node_modules/typed-function/package.json deleted file mode 100644 index 761fc74..0000000 --- a/node_modules/typed-function/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "typed-function", - "version": "4.2.2", - "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.28.3", - "@babel/preset-env": "7.28.5", - "benchmark": "2.1.4", - "c8": "10.1.3", - "cpy-cli": "6.0.0", - "del-cli": "6.0.0", - "eslint": "8.57.1", - "eslint-config-standard": "17.1.0", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-n": "16.6.2", - "eslint-plugin-promise": "6.6.0", - "mocha": "11.7.5", - "npm-run-all": "4.1.5", - "pad-right": "0.2.2", - "rollup": "4.53.3" - }, - "files": [ - "README.md", - "LICENSE.md", - "lib" - ], - "license": "MIT" -} diff --git a/node_modules/utils-merge/.npmignore b/node_modules/utils-merge/.npmignore new file mode 100644 index 0000000..3e53844 --- /dev/null +++ b/node_modules/utils-merge/.npmignore @@ -0,0 +1,9 @@ +CONTRIBUTING.md +Makefile +docs/ +examples/ +reports/ +test/ + +.jshintrc +.travis.yml diff --git a/node_modules/utils-merge/LICENSE b/node_modules/utils-merge/LICENSE new file mode 100644 index 0000000..76f6d08 --- /dev/null +++ b/node_modules/utils-merge/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017 Jared Hanson + +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/node_modules/utils-merge/README.md b/node_modules/utils-merge/README.md new file mode 100644 index 0000000..0cb7117 --- /dev/null +++ b/node_modules/utils-merge/README.md @@ -0,0 +1,34 @@ +# utils-merge + +[![Version](https://img.shields.io/npm/v/utils-merge.svg?label=version)](https://www.npmjs.com/package/utils-merge) +[![Build](https://img.shields.io/travis/jaredhanson/utils-merge.svg)](https://travis-ci.org/jaredhanson/utils-merge) +[![Quality](https://img.shields.io/codeclimate/github/jaredhanson/utils-merge.svg?label=quality)](https://codeclimate.com/github/jaredhanson/utils-merge) +[![Coverage](https://img.shields.io/coveralls/jaredhanson/utils-merge.svg)](https://coveralls.io/r/jaredhanson/utils-merge) +[![Dependencies](https://img.shields.io/david/jaredhanson/utils-merge.svg)](https://david-dm.org/jaredhanson/utils-merge) + + +Merges the properties from a source object into a destination object. + +## Install + +```bash +$ npm install utils-merge +``` + +## Usage + +```javascript +var a = { foo: 'bar' } + , b = { bar: 'baz' }; + +merge(a, b); +// => { foo: 'bar', bar: 'baz' } +``` + +## License + +[The MIT License](http://opensource.org/licenses/MIT) + +Copyright (c) 2013-2017 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> + + Sponsor diff --git a/node_modules/utils-merge/index.js b/node_modules/utils-merge/index.js new file mode 100644 index 0000000..4265c69 --- /dev/null +++ b/node_modules/utils-merge/index.js @@ -0,0 +1,23 @@ +/** + * Merge object b with object a. + * + * var a = { foo: 'bar' } + * , b = { bar: 'baz' }; + * + * merge(a, b); + * // => { foo: 'bar', bar: 'baz' } + * + * @param {Object} a + * @param {Object} b + * @return {Object} + * @api public + */ + +exports = module.exports = function(a, b){ + if (a && b) { + for (var key in b) { + a[key] = b[key]; + } + } + return a; +}; diff --git a/node_modules/utils-merge/package.json b/node_modules/utils-merge/package.json new file mode 100644 index 0000000..e36b078 --- /dev/null +++ b/node_modules/utils-merge/package.json @@ -0,0 +1,40 @@ +{ + "name": "utils-merge", + "version": "1.0.1", + "description": "merge() utility function", + "keywords": [ + "util" + ], + "author": { + "name": "Jared Hanson", + "email": "jaredhanson@gmail.com", + "url": "http://www.jaredhanson.net/" + }, + "repository": { + "type": "git", + "url": "git://github.com/jaredhanson/utils-merge.git" + }, + "bugs": { + "url": "http://github.com/jaredhanson/utils-merge/issues" + }, + "license": "MIT", + "licenses": [ + { + "type": "MIT", + "url": "http://opensource.org/licenses/MIT" + } + ], + "main": "./index", + "dependencies": {}, + "devDependencies": { + "make-node": "0.3.x", + "mocha": "1.x.x", + "chai": "1.x.x" + }, + "engines": { + "node": ">= 0.4.0" + }, + "scripts": { + "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" + } +} diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md deleted file mode 100644 index 98eab25..0000000 --- a/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json deleted file mode 100644 index 1307520..0000000 --- a/node_modules/wrappy/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.2", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "files": [ - "wrappy.js" - ], - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^2.3.1" - }, - "scripts": { - "test": "tap --coverage test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/wrappy" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy" -} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6..0000000 --- a/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/package-lock.json b/package-lock.json index 91fd2ac..d0897ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,63 +1,76 @@ { - "name": "aljabar_matematika", + "name": "kalkulator-aljabar", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "aljabar_matematika", + "name": "kalkulator-aljabar", "version": "1.0.0", - "license": "ISC", "dependencies": { - "cors": "^2.8.6", - "express": "^5.2.1", - "mathjs": "^15.1.1" - } - }, - "node_modules/@babel/runtime": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", - "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", - "license": "MIT", - "engines": { - "node": ">=6.9.0" + "algebrite": "^1.4.0", + "express": "^4.18.2" } }, "node_modules/accepts": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", - "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "license": "MIT", "dependencies": { - "mime-types": "^3.0.0", - "negotiator": "^1.0.0" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { "node": ">= 0.6" } }, - "node_modules/body-parser": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", - "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "node_modules/algebrite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/algebrite/-/algebrite-1.4.0.tgz", + "integrity": "sha512-YPqD1baZOjuRnvR6xwyGYDJ9OvcqkPLLuxFAxnTGYVnKadzA5PyoMXm8mA1pYCE2xloMSgcZkTL1cXkK5C87cg==", "license": "MIT", "dependencies": { - "bytes": "^3.1.2", - "content-type": "^1.0.5", - "debug": "^4.4.3", - "http-errors": "^2.0.0", - "iconv-lite": "^0.7.0", - "on-finished": "^2.4.1", - "qs": "^6.14.1", - "raw-body": "^3.0.1", - "type-is": "^2.0.1" + "big-integer": "^1.6.32" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/big-integer": { + "version": "1.6.52", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", + "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", + "license": "Unlicense", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/body-parser": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", + "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" }, "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" } }, "node_modules/bytes": { @@ -98,30 +111,16 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/complex.js": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.4.3.tgz", - "integrity": "sha512-UrQVSUur14tNX6tiP4y8T4w4FeJAX3bi2cIv0pu/DTLFNxoq7z2Yh83Vfzztj6Px3X/lubqQ9IrPp7Bpn6p4MQ==", - "license": "MIT", - "engines": { - "node": "*" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/rawify" - } - }, "node_modules/content-disposition": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", - "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "license": "MIT", - "engines": { - "node": ">=18" + "dependencies": { + "safe-buffer": "5.2.1" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "engines": { + "node": ">= 0.6" } }, "node_modules/content-type": { @@ -143,54 +142,20 @@ } }, "node_modules/cookie-signature": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", - "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", - "license": "MIT", - "engines": { - "node": ">=6.6.0" - } - }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" }, "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "ms": "2.0.0" } }, - "node_modules/decimal.js": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "license": "MIT" - }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -200,6 +165,16 @@ "node": ">= 0.8" } }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -265,12 +240,6 @@ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "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/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -281,42 +250,45 @@ } }, "node_modules/express": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", - "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", + "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", "license": "MIT", "dependencies": { - "accepts": "^2.0.0", - "body-parser": "^2.2.1", - "content-disposition": "^1.0.0", - "content-type": "^1.0.5", - "cookie": "^0.7.1", - "cookie-signature": "^1.2.1", - "debug": "^4.4.0", - "depd": "^2.0.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "finalhandler": "^2.1.0", - "fresh": "^2.0.0", - "http-errors": "^2.0.0", - "merge-descriptors": "^2.0.0", - "mime-types": "^3.0.0", - "on-finished": "^2.4.1", - "once": "^1.4.0", - "parseurl": "^1.3.3", - "proxy-addr": "^2.0.7", - "qs": "^6.14.0", - "range-parser": "^1.2.1", - "router": "^2.2.0", - "send": "^1.1.0", - "serve-static": "^2.2.0", - "statuses": "^2.0.1", - "type-is": "^2.0.1", - "vary": "^1.1.2" + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.14.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" }, "engines": { - "node": ">= 18" + "node": ">= 0.10.0" }, "funding": { "type": "opencollective", @@ -324,24 +296,21 @@ } }, "node_modules/finalhandler": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", - "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", "license": "MIT", "dependencies": { - "debug": "^4.4.0", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "on-finished": "^2.4.1", - "parseurl": "^1.3.3", - "statuses": "^2.0.1" + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" }, "engines": { - "node": ">= 18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "node": ">= 0.8" } }, "node_modules/forwarded": { @@ -353,26 +322,13 @@ "node": ">= 0.6" } }, - "node_modules/fraction.js": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", - "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", - "license": "MIT", - "engines": { - "node": "*" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/rawify" - } - }, "node_modules/fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", - "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/function-bind": { @@ -478,19 +434,15 @@ } }, "node_modules/iconv-lite": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", - "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" + "safer-buffer": ">= 2.1.2 < 3" }, "engines": { "node": ">=0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" } }, "node_modules/inherits": { @@ -508,18 +460,6 @@ "node": ">= 0.10" } }, - "node_modules/is-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", - "license": "MIT" - }, - "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/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -529,97 +469,79 @@ "node": ">= 0.4" } }, - "node_modules/mathjs": { - "version": "15.1.1", - "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-15.1.1.tgz", - "integrity": "sha512-rM668DTtpSzMVoh/cKAllyQVEbBApM5g//IMGD8vD7YlrIz9ITRr3SrdhjaDxcBNTdyETWwPebj2unZyHD7ZdA==", - "license": "Apache-2.0", - "dependencies": { - "@babel/runtime": "^7.26.10", - "complex.js": "^2.2.5", - "decimal.js": "^10.4.3", - "escape-latex": "^1.2.0", - "fraction.js": "^5.2.1", - "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/media-typer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">= 0.6" } }, "node_modules/merge-descriptors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", - "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "license": "MIT", - "engines": { - "node": ">=18" - }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/mime-db": { - "version": "1.54.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", - "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { - "mime-db": "^1.54.0" + "mime-db": "1.52.0" }, - "engines": { - "node": ">=18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", - "license": "MIT", "engines": { "node": ">= 0.6" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, "node_modules/object-inspect": { @@ -646,15 +568,6 @@ "node": ">= 0.8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -665,14 +578,10 @@ } }, "node_modules/path-to-regexp": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.1.tgz", - "integrity": "sha512-fvU78fIjZ+SBM9YwCknCvKOUKkLVqtWDVctl0s7xIqfmfb38t2TT4ZU2gHm+Z8xGwgW+QWEU3oQSAzIbo89Ggw==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", + "license": "MIT" }, "node_modules/proxy-addr": { "version": "2.0.7", @@ -688,9 +597,9 @@ } }, "node_modules/qs": { - "version": "6.15.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", - "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" @@ -712,35 +621,39 @@ } }, "node_modules/raw-body": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", - "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", "license": "MIT", "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", - "iconv-lite": "~0.7.0", + "iconv-lite": "~0.4.24", "unpipe": "~1.0.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 0.8" } }, - "node_modules/router": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", - "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", - "license": "MIT", - "dependencies": { - "debug": "^4.4.0", - "depd": "^2.0.0", - "is-promise": "^4.0.0", - "parseurl": "^1.3.3", - "path-to-regexp": "^8.0.0" - }, - "engines": { - "node": ">= 18" - } + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -748,55 +661,49 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "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/send": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", - "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", "license": "MIT", "dependencies": { - "debug": "^4.4.3", - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "etag": "^1.8.1", - "fresh": "^2.0.0", - "http-errors": "^2.0.1", - "mime-types": "^3.0.2", - "ms": "^2.1.3", - "on-finished": "^2.4.1", - "range-parser": "^1.2.1", - "statuses": "^2.0.2" + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" }, "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, "node_modules/serve-static": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", - "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", "license": "MIT", "dependencies": { - "encodeurl": "^2.0.0", - "escape-html": "^1.0.3", - "parseurl": "^1.3.3", - "send": "^1.2.0" + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" }, "engines": { - "node": ">= 18" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "node": ">= 0.8.0" } }, "node_modules/setprototypeof": { @@ -886,12 +793,6 @@ "node": ">= 0.8" } }, - "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/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -902,28 +803,18 @@ } }, "node_modules/type-is": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", - "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "license": "MIT", "dependencies": { - "content-type": "^1.0.5", - "media-typer": "^1.1.0", - "mime-types": "^3.0.0" + "media-typer": "0.3.0", + "mime-types": "~2.1.24" }, "engines": { "node": ">= 0.6" } }, - "node_modules/typed-function": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.2.tgz", - "integrity": "sha512-VwaXim9Gp1bngi/q3do8hgttYn2uC3MoT/gfuMWylnj1IeZBUAyPddHZlo1K05BDoj8DYPpMdiHqH1dDYdJf2A==", - "license": "MIT", - "engines": { - "node": ">= 18" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -933,6 +824,15 @@ "node": ">= 0.8" } }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -941,28 +841,6 @@ "engines": { "node": ">= 0.8" } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC" } } } - {"{name": "aljabar_matematika", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": -} - "name": "aljabar_matematika", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "cors": "^2.8.6", - "express": "^5.2.1", - "mathjs": "^15.1.1" - } - - diff --git a/package.json b/package.json index eb4332b..47971c0 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "start": "node server.js" }, "dependencies": { + "algebrite": "^1.4.0", "express": "^4.18.2" } -} \ No newline at end of file +} diff --git a/react-app/.gitignore b/react-app/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/react-app/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/react-app/README.md b/react-app/README.md new file mode 100644 index 0000000..e16d995 --- /dev/null +++ b/react-app/README.md @@ -0,0 +1,18 @@ +# React + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) + +## React Compiler + +The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information. + +Note: This will impact Vite dev & build performances. + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project. diff --git a/react-app/eslint.config.js b/react-app/eslint.config.js new file mode 100644 index 0000000..4fa125d --- /dev/null +++ b/react-app/eslint.config.js @@ -0,0 +1,29 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{js,jsx}'], + extends: [ + js.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: { jsx: true }, + sourceType: 'module', + }, + }, + rules: { + 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], + }, + }, +]) diff --git a/react-app/index.html b/react-app/index.html new file mode 100644 index 0000000..a42fb30 --- /dev/null +++ b/react-app/index.html @@ -0,0 +1,13 @@ + + + + + + + react-app + + +
    + + + diff --git a/react-app/package-lock.json b/react-app/package-lock.json new file mode 100644 index 0000000..6f94145 --- /dev/null +++ b/react-app/package-lock.json @@ -0,0 +1,2974 @@ +{ + "name": "react-app", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "react-app", + "version": "0.0.0", + "dependencies": { + "react": "^19.2.4", + "react-dom": "^19.2.4" + }, + "devDependencies": { + "@babel/core": "^7.29.0", + "@eslint/js": "^9.39.4", + "@rolldown/plugin-babel": "^0.2.1", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "babel-plugin-react-compiler": "^1.0.0", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "vite": "^8.0.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz", + "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz", + "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz", + "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.2.tgz", + "integrity": "sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.123.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.123.0.tgz", + "integrity": "sha512-YtECP/y8Mj1lSHiUWGSRzy/C6teUKlS87dEfuVKT09LgQbUsBW1rNg+MiJ4buGu3yuADV60gbIvo9/HplA56Ew==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.13.tgz", + "integrity": "sha512-5ZiiecKH2DXAVJTNN13gNMUcCDg4Jy8ZjbXEsPnqa248wgOVeYRX0iqXXD5Jz4bI9BFHgKsI2qmyJynstbmr+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.13.tgz", + "integrity": "sha512-tz/v/8G77seu8zAB3A5sK3UFoOl06zcshEzhUO62sAEtrEuW/H1CcyoupOrD+NbQJytYgA4CppXPzlrmp4JZKA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.13.tgz", + "integrity": "sha512-8DakphqOz8JrMYWTJmWA+vDJxut6LijZ8Xcdc4flOlAhU7PNVwo2MaWBF9iXjJAPo5rC/IxEFZDhJ3GC7NHvug==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.13.tgz", + "integrity": "sha512-4wBQFfjDuXYN/SVI8inBF3Aa+isq40rc6VMFbk5jcpolUBTe5cYnMsHZ51nFWsx3PVyyNN3vgoESki0Hmr/4BA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.13.tgz", + "integrity": "sha512-JW/e4yPIXLms+jmnbwwy5LA/LxVwZUWLN8xug+V200wzaVi5TEGIWQlh8o91gWYFxW609euI98OCCemmWGuPrw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-ZfKWpXiUymDnavepCaM6KG/uGydJ4l2nBmMxg60Ci4CbeefpqjPWpfaZM7PThOhk2dssqBAcwLc6rAyr0uTdXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.13.tgz", + "integrity": "sha512-bmRg3O6Z0gq9yodKKWCIpnlH051sEfdVwt+6m5UDffAQMUUqU0xjnQqqAUm+Gu7ofAAly9DqiQDtKu2nPDEABA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-8Wtnbw4k7pMYN9B/mOEAsQ8HOiq7AZ31Ig4M9BKn2So4xRaFEhtCSa4ZJaOutOWq50zpgR4N5+L/opnlaCx8wQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-D/0Nlo8mQuxSMohNJUF2lDXWRsFDsHldfRRgD9bRgktj+EndGPj4DOV37LqDKPYS+osdyhZEH7fTakTAEcW7qg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.13.tgz", + "integrity": "sha512-eRrPvat2YaVQcwwKi/JzOP6MKf1WRnOCr+VaI3cTWz3ZoLcP/654z90lVCJ4dAuMEpPdke0n+qyAqXDZdIC4rA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.13.tgz", + "integrity": "sha512-PsdONiFRp8hR8KgVjTWjZ9s7uA3uueWL0t74/cKHfM4dR5zXYv4AjB8BvA+QDToqxAFg4ZkcVEqeu5F7inoz5w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.13.tgz", + "integrity": "sha512-hCNXgC5dI3TVOLrPT++PKFNZ+1EtS0mLQwfXXXSUD/+rGlB65gZDwN/IDuxLpQP4x8RYYHqGomlUXzpO8aVI2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.13.tgz", + "integrity": "sha512-viLS5C5et8NFtLWw9Sw3M/w4vvnVkbWkO7wSNh3C+7G1+uCkGpr6PcjNDSFcNtmXY/4trjPBqUfcOL+P3sWy/g==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/core": "1.9.1", + "@emnapi/runtime": "1.9.1", + "@napi-rs/wasm-runtime": "^1.1.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.13.tgz", + "integrity": "sha512-Fqa3Tlt1xL4wzmAYxGNFV36Hb+VfPc9PYU+E25DAnswXv3ODDu/yyWjQDbXMo5AGWkQVjLgQExuVu8I/UaZhPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.13.tgz", + "integrity": "sha512-/pLI5kPkGEi44TDlnbio3St/5gUFeN51YWNAk/Gnv6mEQBOahRBh52qVFVBpmrnU01n2yysvBML9Ynu7K4kGAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/plugin-babel": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@rolldown/plugin-babel/-/plugin-babel-0.2.2.tgz", + "integrity": "sha512-q9pE8+47bQNHb5eWVcE6oXppA+JTSwvnrhH53m0ZuHuK5MLvwsLoWrWzBTFQqQ06BVxz1gp0HblLsch8o6pvZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=22.12.0 || ^24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.29.0 || ^8.0.0-rc.1", + "@babel/plugin-transform-runtime": "^7.29.0 || ^8.0.0-rc.1", + "@babel/runtime": "^7.27.0 || ^8.0.0-rc.1", + "rolldown": "^1.0.0-rc.5", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@babel/plugin-transform-runtime": { + "optional": true + }, + "@babel/runtime": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz", + "integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", + "integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.7" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/babel-plugin-react-compiler": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz", + "integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.15", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.15.tgz", + "integrity": "sha512-1nfKCq9wuAZFTkA2ey/3OXXx7GzFjLdkTiFVNwlJ9WqdI706CZRIhEqjuwanjMIja+84jDLa9rcyZDPDiVkASQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001785", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001785.tgz", + "integrity": "sha512-blhOL/WNR+Km1RI/LCVAvA73xplXA7ZbjzI4YkMK9pa6T/P3F2GxjNpEkyw5repTw9IvkyrjyHpwjnhZ5FOvYQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.331", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.331.tgz", + "integrity": "sha512-IbxXrsTlD3hRodkLnbxAPP4OuJYdWCeM3IOdT+CpcMoIwIoDfCmRpEtSPfwBXxVkg9xmBeY7Lz2Eo2TDn/HC3Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.2.tgz", + "integrity": "sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": "^9 || ^10" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.4.0.tgz", + "integrity": "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.37", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.37.tgz", + "integrity": "sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", + "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rolldown": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.13.tgz", + "integrity": "sha512-bvVj8YJmf0rq4pSFmH7laLa6pYrhghv3PRzrCdRAr23g66zOKVJ4wkvFtgohtPLWmthgg8/rkaqRHrpUEh0Zbw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@oxc-project/types": "=0.123.0", + "@rolldown/pluginutils": "1.0.0-rc.13" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-rc.13", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.13", + "@rolldown/binding-darwin-x64": "1.0.0-rc.13", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.13", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.13", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.13", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.13", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.13", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.13", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.13", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.13", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.13" + } + }, + "node_modules/rolldown/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.13.tgz", + "integrity": "sha512-3ngTAv6F/Py35BsYbeeLeecvhMKdsKm4AoOETVhAA+Qc8nrA2I0kF7oa93mE9qnIurngOSpMnQ0x2nQY2FPviA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.3.tgz", + "integrity": "sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.8", + "rolldown": "1.0.0-rc.12", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.0", + "esbuild": "^0.27.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@oxc-project/types": { + "version": "0.122.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.122.0.tgz", + "integrity": "sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.12.tgz", + "integrity": "sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.12.tgz", + "integrity": "sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.12.tgz", + "integrity": "sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.12.tgz", + "integrity": "sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.12.tgz", + "integrity": "sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.12.tgz", + "integrity": "sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.12.tgz", + "integrity": "sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.12.tgz", + "integrity": "sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.12.tgz", + "integrity": "sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.12.tgz", + "integrity": "sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.12.tgz", + "integrity": "sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.12.tgz", + "integrity": "sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.12.tgz", + "integrity": "sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite/node_modules/rolldown": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.12.tgz", + "integrity": "sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.122.0", + "@rolldown/pluginutils": "1.0.0-rc.12" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-rc.12", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.12", + "@rolldown/binding-darwin-x64": "1.0.0-rc.12", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.12", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.12", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.12", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.12", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.12", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.12", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.12", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.12", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/react-app/package.json b/react-app/package.json new file mode 100644 index 0000000..362d36b --- /dev/null +++ b/react-app/package.json @@ -0,0 +1,30 @@ +{ + "name": "react-app", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "react": "^19.2.4", + "react-dom": "^19.2.4" + }, + "devDependencies": { + "@babel/core": "^7.29.0", + "@eslint/js": "^9.39.4", + "@rolldown/plugin-babel": "^0.2.1", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "babel-plugin-react-compiler": "^1.0.0", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "vite": "^8.0.1" + } +} diff --git a/react-app/public/favicon.svg b/react-app/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/react-app/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/react-app/public/icons.svg b/react-app/public/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/react-app/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/react-app/src/App.css b/react-app/src/App.css new file mode 100644 index 0000000..f90339d --- /dev/null +++ b/react-app/src/App.css @@ -0,0 +1,184 @@ +.counter { + font-size: 16px; + padding: 5px 10px; + border-radius: 5px; + color: var(--accent); + background: var(--accent-bg); + border: 2px solid transparent; + transition: border-color 0.3s; + margin-bottom: 24px; + + &:hover { + border-color: var(--accent-border); + } + &:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.hero { + position: relative; + + .base, + .framework, + .vite { + inset-inline: 0; + margin: 0 auto; + } + + .base { + width: 170px; + position: relative; + z-index: 0; + } + + .framework, + .vite { + position: absolute; + } + + .framework { + z-index: 1; + top: 34px; + height: 28px; + transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) + scale(1.4); + } + + .vite { + z-index: 0; + top: 107px; + height: 26px; + width: auto; + transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) + scale(0.8); + } +} + +#center { + display: flex; + flex-direction: column; + gap: 25px; + place-content: center; + place-items: center; + flex-grow: 1; + + @media (max-width: 1024px) { + padding: 32px 20px 24px; + gap: 18px; + } +} + +#next-steps { + display: flex; + border-top: 1px solid var(--border); + text-align: left; + + & > div { + flex: 1 1 0; + padding: 32px; + @media (max-width: 1024px) { + padding: 24px 20px; + } + } + + .icon { + margin-bottom: 16px; + width: 22px; + height: 22px; + } + + @media (max-width: 1024px) { + flex-direction: column; + text-align: center; + } +} + +#docs { + border-right: 1px solid var(--border); + + @media (max-width: 1024px) { + border-right: none; + border-bottom: 1px solid var(--border); + } +} + +#next-steps ul { + list-style: none; + padding: 0; + display: flex; + gap: 8px; + margin: 32px 0 0; + + .logo { + height: 18px; + } + + a { + color: var(--text-h); + font-size: 16px; + border-radius: 6px; + background: var(--social-bg); + display: flex; + padding: 6px 12px; + align-items: center; + gap: 8px; + text-decoration: none; + transition: box-shadow 0.3s; + + &:hover { + box-shadow: var(--shadow); + } + .button-icon { + height: 18px; + width: 18px; + } + } + + @media (max-width: 1024px) { + margin-top: 20px; + flex-wrap: wrap; + justify-content: center; + + li { + flex: 1 1 calc(50% - 8px); + } + + a { + width: 100%; + justify-content: center; + box-sizing: border-box; + } + } +} + +#spacer { + height: 88px; + border-top: 1px solid var(--border); + @media (max-width: 1024px) { + height: 48px; + } +} + +.ticks { + position: relative; + width: 100%; + + &::before, + &::after { + content: ''; + position: absolute; + top: -4.5px; + border: 5px solid transparent; + } + + &::before { + left: 0; + border-left-color: var(--border); + } + &::after { + right: 0; + border-right-color: var(--border); + } +} diff --git a/react-app/src/App.jsx b/react-app/src/App.jsx new file mode 100644 index 0000000..b2bf2e8 --- /dev/null +++ b/react-app/src/App.jsx @@ -0,0 +1,121 @@ +import { useState } from 'react' +import reactLogo from './assets/react.svg' +import viteLogo from './assets/vite.svg' +import heroImg from './assets/hero.png' +import './App.css' + +function App() { + const [count, setCount] = useState(0) + + return ( + <> +
    +
    + + React logo + Vite logo +
    +
    +

    Get started

    +

    + Edit src/App.jsx and save to test HMR +

    +
    + +
    + +
    + +
    +
    + +

    Documentation

    +

    Your questions, answered

    + +
    +
    + +

    Connect with us

    +

    Join the Vite community

    + +
    +
    + +
    +
    + + ) +} + +export default App diff --git a/react-app/src/App.tsx b/react-app/src/App.tsx new file mode 100644 index 0000000..46a5992 --- /dev/null +++ b/react-app/src/App.tsx @@ -0,0 +1,121 @@ +import { useState } from 'react' +import reactLogo from './assets/react.svg' +import viteLogo from './assets/vite.svg' +import heroImg from './assets/hero.png' +import './App.css' + +function App() { + const [count, setCount] = useState(0) + + return ( + <> +
    +
    + + React logo + Vite logo +
    +
    +

    Get started

    +

    + Edit src/App.tsx and save to test HMR +

    +
    + +
    + +
    + +
    +
    + +

    Documentation

    +

    Your questions, answered

    + +
    +
    + +

    Connect with us

    +

    Join the Vite community

    + +
    +
    + +
    +
    + + ) +} + +export default App diff --git a/react-app/src/assets/hero.png b/react-app/src/assets/hero.png new file mode 100644 index 0000000..cc51a3d Binary files /dev/null and b/react-app/src/assets/hero.png differ diff --git a/react-app/src/assets/react.svg b/react-app/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/react-app/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/react-app/src/assets/vite.svg b/react-app/src/assets/vite.svg new file mode 100644 index 0000000..5101b67 --- /dev/null +++ b/react-app/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/react-app/src/index.css b/react-app/src/index.css new file mode 100644 index 0000000..2c84af0 --- /dev/null +++ b/react-app/src/index.css @@ -0,0 +1,111 @@ +:root { + --text: #6b6375; + --text-h: #08060d; + --bg: #fff; + --border: #e5e4e7; + --code-bg: #f4f3ec; + --accent: #aa3bff; + --accent-bg: rgba(170, 59, 255, 0.1); + --accent-border: rgba(170, 59, 255, 0.5); + --social-bg: rgba(244, 243, 236, 0.5); + --shadow: + rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px; + + --sans: system-ui, 'Segoe UI', Roboto, sans-serif; + --heading: system-ui, 'Segoe UI', Roboto, sans-serif; + --mono: ui-monospace, Consolas, monospace; + + font: 18px/145% var(--sans); + letter-spacing: 0.18px; + color-scheme: light dark; + color: var(--text); + background: var(--bg); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + @media (max-width: 1024px) { + font-size: 16px; + } +} + +@media (prefers-color-scheme: dark) { + :root { + --text: #9ca3af; + --text-h: #f3f4f6; + --bg: #16171d; + --border: #2e303a; + --code-bg: #1f2028; + --accent: #c084fc; + --accent-bg: rgba(192, 132, 252, 0.15); + --accent-border: rgba(192, 132, 252, 0.5); + --social-bg: rgba(47, 48, 58, 0.5); + --shadow: + rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px; + } + + #social .button-icon { + filter: invert(1) brightness(2); + } +} + +body { + margin: 0; +} + +#root { + width: 1126px; + max-width: 100%; + margin: 0 auto; + text-align: center; + border-inline: 1px solid var(--border); + min-height: 100svh; + display: flex; + flex-direction: column; + box-sizing: border-box; +} + +h1, +h2 { + font-family: var(--heading); + font-weight: 500; + color: var(--text-h); +} + +h1 { + font-size: 56px; + letter-spacing: -1.68px; + margin: 32px 0; + @media (max-width: 1024px) { + font-size: 36px; + margin: 20px 0; + } +} +h2 { + font-size: 24px; + line-height: 118%; + letter-spacing: -0.24px; + margin: 0 0 8px; + @media (max-width: 1024px) { + font-size: 20px; + } +} +p { + margin: 0; +} + +code, +.counter { + font-family: var(--mono); + display: inline-flex; + border-radius: 4px; + color: var(--text-h); +} + +code { + font-size: 15px; + line-height: 135%; + padding: 4px 8px; + background: var(--code-bg); +} diff --git a/react-app/src/main.jsx b/react-app/src/main.jsx new file mode 100644 index 0000000..b9a1a6d --- /dev/null +++ b/react-app/src/main.jsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.jsx' + +createRoot(document.getElementById('root')).render( + + + , +) diff --git a/react-app/src/main.tsx b/react-app/src/main.tsx new file mode 100644 index 0000000..bef5202 --- /dev/null +++ b/react-app/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.tsx' + +createRoot(document.getElementById('root')!).render( + + + , +) diff --git a/react-app/tsconfig.app.json b/react-app/tsconfig.app.json new file mode 100644 index 0000000..af516fc --- /dev/null +++ b/react-app/tsconfig.app.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2023", + "useDefineForClassFields": true, + "lib": ["ES2023", "DOM", "DOM.Iterable"], + "module": "ESNext", + "types": ["vite/client"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/react-app/tsconfig.json b/react-app/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/react-app/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/react-app/tsconfig.node.json b/react-app/tsconfig.node.json new file mode 100644 index 0000000..8a67f62 --- /dev/null +++ b/react-app/tsconfig.node.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/react-app/vite.config.js b/react-app/vite.config.js new file mode 100644 index 0000000..d1203cd --- /dev/null +++ b/react-app/vite.config.js @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite' +import react, { reactCompilerPreset } from '@vitejs/plugin-react' +import babel from '@rolldown/plugin-babel' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + react(), + babel({ presets: [reactCompilerPreset()] }) + ], +}) diff --git a/react-app/vite.config.ts b/react-app/vite.config.ts new file mode 100644 index 0000000..d1203cd --- /dev/null +++ b/react-app/vite.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite' +import react, { reactCompilerPreset } from '@vitejs/plugin-react' +import babel from '@rolldown/plugin-babel' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + react(), + babel({ presets: [reactCompilerPreset()] }) + ], +})