UNPKG

mathjs

Version:

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 dif

444 lines (436 loc) 7.93 kB
/** * THIS FILE IS AUTO-GENERATED * DON'T MAKE CHANGES HERE */ import { config } from './configReadonly' import { createChainClass, createChain, createNode, createArrayNode, createConditionalNode, createFunctionAssignmentNode, createObjectNode, createParenthesisNode, createRelationalNode, createReviver, createAccessorNode, createBlockNode, createOperatorNode, createSymbolNode, createConstantNode, createRangeNode, createFunctionNode, createAssignmentNode, createIndexNode, createParse, createEvaluate, createHelpClass, createSimplify, createRationalize, createCompile, createHelp, createParserClass, createDerivative, createParser, createFilterTransform, createMapTransform, createMinTransform, createApplyTransform, createMaxTransform, createStdTransform, createVarianceTransform, createMeanTransform, createSumTransform, createForEachTransform, createSubsetTransform, createRangeTransform } from '../factoriesNumber' import { typed, Range, nthRoot, e, _false, LN10, LOG10E, _NaN, phi, SQRT1_2, // eslint-disable-line camelcase tau, version, string, filter, map, combinationsWithRep, pickRandom, randomInt, compare, compareText, smaller, larger, erf, max, format, clone, typeOf, unaryPlus, addScalar, ceil, exp, fix, gcd, log10, mod, multiply, sqrt, subtract, divideScalar, log, add, divide, bitNot, bitXor, rightArithShift, and, or, Index, subset, gamma, acosh, acoth, acsch, asech, asinh, atan2, cos, cot, csc, sec, sin, tan, isInteger, isPositive, isNaN, ResultSet, round, LN2, _null, SQRT2, number, apply, factorial, permutations, equalScalar, equal, smallerEq, deepEqual, prod, sum, variance, std, isPrime, unaryMinus, cbrt, expm1, lcm, multiplyScalar, square, pow, norm, bitOr, rightLogShift, xor, combinations, acot, asec, atan, cosh, csch, sinh, isNegative, stirlingS2, catalan, _Infinity, pi, _true, forEach, multinomial, compareNatural, largerEq, min, print, numeric, cube, log2, xgcd, bitAnd, not, acos, asin, coth, tanh, bellNumbers, LOG2E, boolean, random, unequal, mean, isNumeric, abs, sign, leftShift, acsc, sech, hypot, partitionSelect, mode, quantileSeq, hasNumericValue, log1p, atanh, composition, median, floor, isZero, equalText, matrix, range, mad, size } from './pureFunctionsNumber.generated' const math = {} // NOT pure! const mathWithTransform = {} // NOT pure! const classes = {} // NOT pure! export const Chain = createChainClass({ math }) export const chain = createChain({ Chain, typed }) export const Node = createNode({ mathWithTransform }) export const ArrayNode = createArrayNode({ Node }) export const ConditionalNode = createConditionalNode({ Node }) export const FunctionAssignmentNode = createFunctionAssignmentNode({ Node, typed }) export const ObjectNode = createObjectNode({ Node }) export const ParenthesisNode = createParenthesisNode({ Node }) export const RelationalNode = createRelationalNode({ Node }) export const reviver = createReviver({ classes }) export const AccessorNode = createAccessorNode({ Node, subset }) export const BlockNode = createBlockNode({ Node, ResultSet }) export const OperatorNode = createOperatorNode({ Node }) export const SymbolNode = createSymbolNode({ Node, math }) export const ConstantNode = createConstantNode({ Node }) export const RangeNode = createRangeNode({ Node }) export const FunctionNode = createFunctionNode({ Node, SymbolNode, math }) export const AssignmentNode = createAssignmentNode({ matrix, Node, subset }) export const IndexNode = createIndexNode({ Index, Node, Range, size }) export const parse = createParse({ AccessorNode, ArrayNode, AssignmentNode, BlockNode, ConditionalNode, ConstantNode, FunctionAssignmentNode, FunctionNode, IndexNode, ObjectNode, OperatorNode, ParenthesisNode, RangeNode, RelationalNode, SymbolNode, config, numeric, typed }) export const evaluate = createEvaluate({ parse, typed }) export const Help = createHelpClass({ parse }) export const simplify = createSimplify({ ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, add, config, divide, equal, isZero, mathWithTransform, multiply, parse, pow, subtract, typed }) export const rationalize = createRationalize({ ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, add, config, divide, equal, isZero, mathWithTransform, multiply, parse, pow, simplify, subtract, typed }) export const compile = createCompile({ parse, typed }) export const help = createHelp({ Help, mathWithTransform, typed }) export const Parser = createParserClass({ parse }) export const derivative = createDerivative({ ConstantNode, FunctionNode, OperatorNode, ParenthesisNode, SymbolNode, config, equal, isZero, numeric, parse, simplify, typed }) export const parser = createParser({ Parser, typed }) Object.assign(math, { typed, chain, nthRoot, e, false: _false, LN10, LOG10E, NaN: _NaN, phi, SQRT1_2, tau, version, string, filter, map, combinationsWithRep, pickRandom, randomInt, compare, compareText, smaller, larger, erf, max, format, clone, typeOf, reviver, unaryPlus, addScalar, ceil, exp, fix, gcd, log10, mod, multiply, sqrt, subtract, divideScalar, log, add, divide, bitNot, bitXor, rightArithShift, and, or, subset, gamma, acosh, acoth, acsch, asech, asinh, atan2, cos, cot, csc, sec, sin, tan, isInteger, isPositive, isNaN, round, 'E': e, LN2, null: _null, SQRT2, number, apply, factorial, permutations, equalScalar, equal, smallerEq, deepEqual, prod, sum, variance, std, isPrime, unaryMinus, cbrt, expm1, lcm, multiplyScalar, square, pow, norm, bitOr, rightLogShift, xor, combinations, acot, asec, atan, cosh, csch, sinh, isNegative, stirlingS2, catalan, Infinity: _Infinity, pi, true: _true, forEach, multinomial, compareNatural, largerEq, min, print, numeric, cube, log2, xgcd, bitAnd, not, acos, asin, coth, tanh, bellNumbers, LOG2E, boolean, random, unequal, mean, isNumeric, abs, sign, leftShift, acsc, sech, hypot, 'PI': pi, partitionSelect, mode, quantileSeq, hasNumericValue, log1p, atanh, composition, median, floor, isZero, equalText, matrix, range, mad, size, parse, evaluate, simplify, rationalize, compile, help, derivative, parser, config }) Object.assign(mathWithTransform, math, { filter: createFilterTransform({ typed }), map: createMapTransform({ typed }), min: createMinTransform({ smaller, typed }), apply: createApplyTransform({ isInteger, typed }), max: createMaxTransform({ larger, typed }), std: createStdTransform({ sqrt, typed, variance }), variance: createVarianceTransform({ add, apply, divide, isNaN, multiply, subtract, typed }), mean: createMeanTransform({ add, divide, typed }), sum: createSumTransform({ add, config, typed }), forEach: createForEachTransform({ typed }), subset: createSubsetTransform({ matrix, typed }), range: createRangeTransform({ matrix, config, larger, largerEq, smaller, smallerEq, typed }) }) Object.assign(classes, { Range, Chain, Node, ArrayNode, ConditionalNode, FunctionAssignmentNode, ObjectNode, ParenthesisNode, RelationalNode, Index, ResultSet, AccessorNode, BlockNode, OperatorNode, SymbolNode, ConstantNode, RangeNode, FunctionNode, AssignmentNode, IndexNode, Help, Parser }) Chain.createProxy(math) export { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs'