@mojir/lits 2.2.2-alpha.6 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (908) hide show
  1. package/README.md +1556 -107
  2. package/dist/cli/cli/src/cli.d.ts +1 -1
  3. package/dist/cli/cli/src/cliDocumentation/getCliType.d.ts +1 -1
  4. package/dist/cli/cli/src/colorizer.d.ts +36 -36
  5. package/dist/cli/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  6. package/dist/cli/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  7. package/dist/cli/cli/src/js-interop/Cli/index.d.ts +3 -0
  8. package/dist/cli/cli/src/js-interop/utils.d.ts +2 -0
  9. package/dist/cli/cli.js +30531 -12755
  10. package/dist/cli/reference/api.d.ts +53 -41
  11. package/dist/cli/reference/index.d.ts +150 -23
  12. package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +24 -0
  13. package/dist/cli/src/Lits/Cache.d.ts +1 -1
  14. package/dist/cli/src/Lits/Lits.d.ts +26 -22
  15. package/dist/cli/src/allModules.d.ts +2 -0
  16. package/dist/cli/src/builtin/bindingNode.d.ts +5 -0
  17. package/dist/cli/src/builtin/{normalExpressions/categories → core}/array.d.ts +1 -1
  18. package/dist/cli/src/builtin/{normalExpressions/categories → core}/bitwise.d.ts +1 -1
  19. package/dist/{src/builtin/normalExpressions/categories → cli/src/builtin/core}/collection.d.ts +1 -1
  20. package/dist/{src/builtin/normalExpressions/categories → cli/src/builtin/core}/functional.d.ts +1 -1
  21. package/dist/{src/builtin/normalExpressions/categories → cli/src/builtin/core}/math.d.ts +1 -1
  22. package/dist/cli/src/builtin/core/meta.d.ts +3 -0
  23. package/dist/cli/src/builtin/{normalExpressions/categories → core}/misc.d.ts +1 -1
  24. package/dist/{src/builtin/normalExpressions/categories → cli/src/builtin/core}/object.d.ts +1 -1
  25. package/dist/{src/builtin/normalExpressions/categories → cli/src/builtin/core}/predicates.d.ts +1 -1
  26. package/dist/{src/builtin/normalExpressions/categories → cli/src/builtin/core}/regexp.d.ts +1 -1
  27. package/dist/cli/src/builtin/core/sequence.d.ts +2 -0
  28. package/dist/cli/src/builtin/{normalExpressions/categories → core}/string.d.ts +1 -1
  29. package/dist/cli/src/builtin/core/vector.d.ts +2 -0
  30. package/dist/cli/src/builtin/index.d.ts +10 -34
  31. package/dist/cli/src/builtin/interface.d.ts +92 -24
  32. package/dist/cli/src/builtin/modules/assert/docs.d.ts +2 -0
  33. package/dist/cli/src/builtin/modules/assert/index.d.ts +2 -0
  34. package/dist/cli/src/builtin/modules/bitwise/index.d.ts +2 -0
  35. package/dist/cli/src/builtin/modules/collection/index.d.ts +2 -0
  36. package/dist/cli/src/builtin/modules/functional/index.d.ts +2 -0
  37. package/dist/cli/src/builtin/modules/grid/docs.d.ts +2 -0
  38. package/dist/cli/src/builtin/modules/grid/fromArray.d.ts +8 -0
  39. package/dist/cli/src/builtin/modules/grid/index.d.ts +2 -0
  40. package/dist/cli/src/builtin/modules/grid/transpose.d.ts +2 -0
  41. package/dist/cli/src/builtin/modules/interface.d.ts +11 -0
  42. package/dist/cli/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  43. package/dist/cli/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  44. package/dist/cli/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  45. package/dist/cli/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  46. package/dist/cli/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  47. package/dist/cli/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  48. package/dist/cli/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  49. package/dist/cli/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  50. package/dist/cli/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  51. package/dist/cli/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  52. package/dist/cli/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  53. package/dist/cli/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  54. package/dist/cli/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  55. package/dist/cli/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  56. package/dist/cli/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  57. package/dist/cli/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  58. package/dist/cli/src/builtin/modules/math/index.d.ts +2 -0
  59. package/dist/cli/src/builtin/modules/matrix/docs.d.ts +2 -0
  60. package/dist/cli/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  61. package/dist/cli/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  62. package/dist/cli/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  63. package/dist/cli/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  64. package/dist/cli/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  65. package/dist/cli/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  66. package/dist/cli/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  67. package/dist/cli/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  68. package/dist/cli/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  69. package/dist/cli/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  70. package/dist/cli/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  71. package/dist/cli/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  72. package/dist/cli/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  73. package/dist/cli/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  74. package/dist/cli/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  75. package/dist/cli/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  76. package/dist/cli/src/builtin/modules/matrix/index.d.ts +4 -0
  77. package/dist/cli/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  78. package/dist/cli/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  79. package/dist/cli/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  80. package/dist/cli/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  81. package/dist/cli/src/builtin/modules/number-theory/docs.d.ts +2 -0
  82. package/dist/cli/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  83. package/dist/cli/src/builtin/modules/number-theory/index.d.ts +4 -0
  84. package/dist/cli/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  85. package/dist/cli/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  86. package/dist/cli/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  87. package/dist/cli/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  88. package/dist/cli/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  89. package/dist/cli/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  90. package/dist/cli/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  91. package/dist/cli/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  92. package/dist/cli/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  93. package/dist/cli/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  94. package/dist/cli/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  95. package/dist/cli/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  96. package/dist/cli/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  97. package/dist/cli/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  98. package/dist/cli/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  99. package/dist/cli/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  100. package/dist/cli/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  101. package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +26 -0
  102. package/dist/cli/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  103. package/dist/cli/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  104. package/dist/cli/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  105. package/dist/cli/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  106. package/dist/cli/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  107. package/dist/cli/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  108. package/dist/cli/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  109. package/dist/cli/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  110. package/dist/cli/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  111. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  112. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  113. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  114. package/dist/cli/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  115. package/dist/cli/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  116. package/dist/cli/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  117. package/dist/cli/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  118. package/dist/cli/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  119. package/dist/cli/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  120. package/dist/cli/src/builtin/modules/random/docs.d.ts +2 -0
  121. package/dist/cli/src/builtin/modules/random/index.d.ts +2 -0
  122. package/dist/cli/src/builtin/modules/sequence/index.d.ts +2 -0
  123. package/dist/cli/src/builtin/modules/string/index.d.ts +2 -0
  124. package/dist/cli/src/builtin/modules/vector/bincount.d.ts +9 -0
  125. package/dist/cli/src/builtin/modules/vector/calcMad.d.ts +1 -0
  126. package/dist/cli/src/builtin/modules/vector/calcMean.d.ts +1 -0
  127. package/dist/cli/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  128. package/dist/cli/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  129. package/dist/cli/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  130. package/dist/cli/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  131. package/dist/cli/src/builtin/modules/vector/docs.d.ts +2 -0
  132. package/dist/cli/src/builtin/modules/vector/entropy.d.ts +8 -0
  133. package/dist/cli/src/builtin/modules/vector/histogram.d.ts +9 -0
  134. package/dist/cli/src/builtin/modules/vector/index.d.ts +2 -0
  135. package/dist/cli/src/builtin/modules/vector/mode.d.ts +6 -0
  136. package/dist/cli/src/builtin/modules/vector/outliers.d.ts +7 -0
  137. package/dist/cli/src/builtin/modules/vector/percentile.d.ts +7 -0
  138. package/dist/cli/src/builtin/modules/vector/quartiles.d.ts +1 -0
  139. package/dist/cli/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  140. package/dist/cli/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  141. package/dist/cli/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  142. package/dist/cli/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  143. package/dist/cli/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  144. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  145. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  146. package/dist/cli/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  147. package/dist/cli/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  148. package/dist/cli/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  149. package/dist/cli/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  150. package/dist/cli/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  151. package/dist/cli/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  152. package/dist/cli/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  153. package/dist/cli/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  154. package/dist/cli/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  155. package/dist/cli/src/builtin/normalExpressions/index.d.ts +7 -1
  156. package/dist/cli/src/builtin/specialExpressionTypes.d.ts +23 -0
  157. package/dist/cli/src/builtin/specialExpressions/and.d.ts +3 -3
  158. package/dist/cli/src/builtin/specialExpressions/array.d.ts +6 -0
  159. package/dist/cli/src/builtin/specialExpressions/block.d.ts +6 -0
  160. package/dist/cli/src/builtin/specialExpressions/cond.d.ts +3 -3
  161. package/dist/cli/src/builtin/specialExpressions/def.d.ts +5 -4
  162. package/dist/cli/src/builtin/specialExpressions/defined.d.ts +5 -0
  163. package/dist/cli/src/builtin/specialExpressions/functions.d.ts +5 -17
  164. package/dist/cli/src/builtin/specialExpressions/if.d.ts +3 -3
  165. package/dist/cli/src/builtin/specialExpressions/let.d.ts +3 -7
  166. package/dist/cli/src/builtin/specialExpressions/loop.d.ts +3 -4
  167. package/dist/cli/src/builtin/specialExpressions/loops.d.ts +5 -14
  168. package/dist/cli/src/builtin/specialExpressions/object.d.ts +6 -0
  169. package/dist/cli/src/builtin/specialExpressions/or.d.ts +3 -3
  170. package/dist/cli/src/builtin/specialExpressions/qq.d.ts +3 -3
  171. package/dist/cli/src/builtin/specialExpressions/recur.d.ts +3 -3
  172. package/dist/cli/src/builtin/specialExpressions/switch.d.ts +6 -0
  173. package/dist/cli/src/builtin/specialExpressions/throw.d.ts +3 -3
  174. package/dist/cli/src/builtin/specialExpressions/try.d.ts +3 -5
  175. package/dist/cli/src/builtin/specialExpressions/unless.d.ts +6 -0
  176. package/dist/cli/src/builtin/utils.d.ts +3 -15
  177. package/dist/cli/src/cli.d.ts +1 -1
  178. package/dist/cli/src/cliDocumentation/getCliType.d.ts +1 -1
  179. package/dist/cli/src/colorizer.d.ts +36 -36
  180. package/dist/cli/src/constants/constants.d.ts +18 -44
  181. package/dist/cli/src/errors.d.ts +2 -5
  182. package/dist/cli/src/evaluator/ContextStack.d.ts +16 -11
  183. package/dist/cli/src/evaluator/functionExecutors.d.ts +4 -4
  184. package/dist/cli/src/evaluator/index.d.ts +2 -2
  185. package/dist/cli/src/evaluator/interface.d.ts +5 -5
  186. package/dist/cli/src/getUndefinedSymbols/index.d.ts +7 -0
  187. package/dist/cli/src/index.d.ts +9 -12
  188. package/dist/cli/src/initReferenceData.d.ts +1 -0
  189. package/dist/cli/src/interface.d.ts +1 -2
  190. package/dist/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  191. package/dist/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  192. package/dist/cli/src/js-interop/Cli/index.d.ts +3 -0
  193. package/dist/cli/src/js-interop/utils.d.ts +2 -0
  194. package/dist/cli/src/parser/Parser.d.ts +58 -0
  195. package/dist/cli/src/parser/types.d.ts +133 -0
  196. package/dist/cli/src/symbolPatterns.d.ts +2 -0
  197. package/dist/cli/src/tokenizer/minifyTokenStream.d.ts +4 -0
  198. package/dist/cli/src/tokenizer/operators.d.ts +12 -0
  199. package/dist/cli/src/tokenizer/reservedNames.d.ts +66 -0
  200. package/dist/cli/src/tokenizer/token.d.ts +86 -0
  201. package/dist/cli/src/tokenizer/tokenize.d.ts +8 -0
  202. package/dist/cli/src/tokenizer/tokenizers.d.ts +14 -19
  203. package/dist/cli/src/transformer/index.d.ts +2 -2
  204. package/dist/cli/src/typeGuards/annotatedArrays.d.ts +16 -0
  205. package/dist/cli/src/typeGuards/array.d.ts +1 -1
  206. package/dist/cli/src/typeGuards/astNode.d.ts +20 -17
  207. package/dist/cli/src/typeGuards/index.d.ts +1 -10
  208. package/dist/cli/src/typeGuards/lits.d.ts +5 -2
  209. package/dist/cli/src/typeGuards/litsFunction.d.ts +3 -3
  210. package/dist/cli/src/typeGuards/number.d.ts +1 -1
  211. package/dist/cli/src/typeGuards/string.d.ts +1 -1
  212. package/dist/cli/src/untokenizer/index.d.ts +1 -1
  213. package/dist/cli/src/utils/arity.d.ts +10 -0
  214. package/dist/cli/src/utils/debug/debugTools.d.ts +0 -2
  215. package/dist/cli/src/utils/debug/getCodeMarker.d.ts +2 -0
  216. package/dist/cli/src/utils/debug/getSourceCodeInfo.d.ts +2 -2
  217. package/dist/cli/src/utils/docString/generateDocString.d.ts +2 -0
  218. package/dist/cli/src/utils/getAssertionError.d.ts +1 -1
  219. package/dist/cli/src/utils/index.d.ts +9 -6
  220. package/dist/full.esm.js +2 -0
  221. package/dist/full.esm.js.map +1 -0
  222. package/dist/full.js +2 -0
  223. package/dist/full.js.map +1 -0
  224. package/dist/index.esm.js +1 -15635
  225. package/dist/index.esm.js.map +1 -1
  226. package/dist/index.js +1 -15663
  227. package/dist/index.js.map +1 -1
  228. package/dist/lits.iife.js +1 -15668
  229. package/dist/lits.iife.js.map +1 -1
  230. package/dist/modules/assert.esm.js +2 -0
  231. package/dist/modules/assert.esm.js.map +1 -0
  232. package/dist/modules/assert.js +2 -0
  233. package/dist/modules/assert.js.map +1 -0
  234. package/dist/modules/bitwise.esm.js +2 -0
  235. package/dist/modules/bitwise.esm.js.map +1 -0
  236. package/dist/modules/bitwise.js +2 -0
  237. package/dist/modules/bitwise.js.map +1 -0
  238. package/dist/modules/cli/src/cli.d.ts +2 -0
  239. package/dist/modules/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  240. package/dist/modules/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  241. package/dist/modules/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  242. package/dist/modules/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  243. package/dist/modules/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  244. package/dist/modules/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  245. package/dist/modules/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  246. package/dist/modules/cli/src/cliFormatterRules.d.ts +13 -0
  247. package/dist/modules/cli/src/colorizer.d.ts +939 -0
  248. package/dist/modules/cli/src/createReadlineInterface.d.ts +5 -0
  249. package/dist/modules/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  250. package/dist/modules/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  251. package/dist/modules/cli/src/js-interop/Cli/index.d.ts +3 -0
  252. package/dist/modules/cli/src/js-interop/utils.d.ts +2 -0
  253. package/dist/modules/collection.esm.js +2 -0
  254. package/dist/modules/collection.esm.js.map +1 -0
  255. package/dist/modules/collection.js +2 -0
  256. package/dist/modules/collection.js.map +1 -0
  257. package/dist/modules/common/createFormatter.d.ts +6 -0
  258. package/dist/modules/common/utils.d.ts +2 -0
  259. package/dist/modules/functional.esm.js +2 -0
  260. package/dist/modules/functional.esm.js.map +1 -0
  261. package/dist/modules/functional.js +2 -0
  262. package/dist/modules/functional.js.map +1 -0
  263. package/dist/modules/grid.esm.js +2 -0
  264. package/dist/modules/grid.esm.js.map +1 -0
  265. package/dist/modules/grid.js +2 -0
  266. package/dist/modules/grid.js.map +1 -0
  267. package/dist/modules/linear-algebra.esm.js +2 -0
  268. package/dist/modules/linear-algebra.esm.js.map +1 -0
  269. package/dist/modules/linear-algebra.js +2 -0
  270. package/dist/modules/linear-algebra.js.map +1 -0
  271. package/dist/modules/math.esm.js +2 -0
  272. package/dist/modules/math.esm.js.map +1 -0
  273. package/dist/modules/math.js +2 -0
  274. package/dist/modules/math.js.map +1 -0
  275. package/dist/modules/matrix.esm.js +2 -0
  276. package/dist/modules/matrix.esm.js.map +1 -0
  277. package/dist/modules/matrix.js +2 -0
  278. package/dist/modules/matrix.js.map +1 -0
  279. package/dist/modules/number-theory.esm.js +2 -0
  280. package/dist/modules/number-theory.esm.js.map +1 -0
  281. package/dist/modules/number-theory.js +2 -0
  282. package/dist/modules/number-theory.js.map +1 -0
  283. package/dist/modules/random.esm.js +2 -0
  284. package/dist/modules/random.esm.js.map +1 -0
  285. package/dist/modules/random.js +2 -0
  286. package/dist/modules/random.js.map +1 -0
  287. package/dist/modules/reference/api.d.ts +71 -0
  288. package/dist/modules/reference/datatype.d.ts +3 -0
  289. package/dist/modules/reference/index.d.ts +178 -0
  290. package/dist/modules/reference/shorthand.d.ts +3 -0
  291. package/dist/modules/sequence.esm.js +2 -0
  292. package/dist/modules/sequence.esm.js.map +1 -0
  293. package/dist/modules/sequence.js +2 -0
  294. package/dist/modules/sequence.js.map +1 -0
  295. package/dist/modules/src/AutoCompleter/AutoCompleter.d.ts +24 -0
  296. package/dist/modules/src/Lits/Cache.d.ts +16 -0
  297. package/dist/modules/src/Lits/Lits.d.ts +58 -0
  298. package/dist/modules/src/allModules.d.ts +2 -0
  299. package/dist/modules/src/builtin/bindingNode.d.ts +5 -0
  300. package/dist/{src/builtin/normalExpressions/categories → modules/src/builtin/core}/array.d.ts +1 -1
  301. package/dist/{src/builtin/normalExpressions/categories → modules/src/builtin/core}/bitwise.d.ts +1 -1
  302. package/dist/{cli/src/builtin/normalExpressions/categories → modules/src/builtin/core}/collection.d.ts +1 -1
  303. package/dist/{cli/src/builtin/normalExpressions/categories → modules/src/builtin/core}/functional.d.ts +1 -1
  304. package/dist/{cli/src/builtin/normalExpressions/categories → modules/src/builtin/core}/math.d.ts +1 -1
  305. package/dist/modules/src/builtin/core/meta.d.ts +3 -0
  306. package/dist/{src/builtin/normalExpressions/categories → modules/src/builtin/core}/misc.d.ts +1 -1
  307. package/dist/{cli/src/builtin/normalExpressions/categories → modules/src/builtin/core}/object.d.ts +1 -1
  308. package/dist/{cli/src/builtin/normalExpressions/categories → modules/src/builtin/core}/predicates.d.ts +1 -1
  309. package/dist/{cli/src/builtin/normalExpressions/categories → modules/src/builtin/core}/regexp.d.ts +1 -1
  310. package/dist/modules/src/builtin/core/sequence.d.ts +2 -0
  311. package/dist/{src/builtin/normalExpressions/categories → modules/src/builtin/core}/string.d.ts +1 -1
  312. package/dist/modules/src/builtin/core/vector.d.ts +2 -0
  313. package/dist/modules/src/builtin/index.d.ts +14 -0
  314. package/dist/modules/src/builtin/interface.d.ts +110 -0
  315. package/dist/modules/src/builtin/modules/assert/docs.d.ts +2 -0
  316. package/dist/modules/src/builtin/modules/assert/index.d.ts +2 -0
  317. package/dist/modules/src/builtin/modules/bitwise/index.d.ts +2 -0
  318. package/dist/modules/src/builtin/modules/collection/index.d.ts +2 -0
  319. package/dist/modules/src/builtin/modules/functional/index.d.ts +2 -0
  320. package/dist/modules/src/builtin/modules/grid/docs.d.ts +2 -0
  321. package/dist/modules/src/builtin/modules/grid/fromArray.d.ts +8 -0
  322. package/dist/modules/src/builtin/modules/grid/index.d.ts +2 -0
  323. package/dist/modules/src/builtin/modules/grid/transpose.d.ts +2 -0
  324. package/dist/modules/src/builtin/modules/interface.d.ts +11 -0
  325. package/dist/modules/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  326. package/dist/modules/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  327. package/dist/modules/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  328. package/dist/modules/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  329. package/dist/modules/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  330. package/dist/modules/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  331. package/dist/modules/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  332. package/dist/modules/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  333. package/dist/modules/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  334. package/dist/modules/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  335. package/dist/modules/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  336. package/dist/modules/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  337. package/dist/modules/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  338. package/dist/modules/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  339. package/dist/modules/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  340. package/dist/modules/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  341. package/dist/modules/src/builtin/modules/math/index.d.ts +2 -0
  342. package/dist/modules/src/builtin/modules/matrix/docs.d.ts +2 -0
  343. package/dist/modules/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  344. package/dist/modules/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  345. package/dist/modules/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  346. package/dist/modules/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  347. package/dist/modules/src/builtin/modules/matrix/helpers/diagonal.d.ts +1 -0
  348. package/dist/modules/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  349. package/dist/modules/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  350. package/dist/modules/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  351. package/dist/modules/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  352. package/dist/modules/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  353. package/dist/modules/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  354. package/dist/modules/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  355. package/dist/modules/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  356. package/dist/modules/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  357. package/dist/modules/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  358. package/dist/modules/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  359. package/dist/modules/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  360. package/dist/modules/src/builtin/modules/matrix/index.d.ts +4 -0
  361. package/dist/modules/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  362. package/dist/modules/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  363. package/dist/modules/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  364. package/dist/modules/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  365. package/dist/modules/src/builtin/modules/number-theory/docs.d.ts +2 -0
  366. package/dist/modules/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  367. package/dist/modules/src/builtin/modules/number-theory/index.d.ts +4 -0
  368. package/dist/modules/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  369. package/dist/modules/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  370. package/dist/modules/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  371. package/dist/modules/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  372. package/dist/modules/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  373. package/dist/modules/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  374. package/dist/modules/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  375. package/dist/modules/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  376. package/dist/modules/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  377. package/dist/modules/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  378. package/dist/modules/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  379. package/dist/modules/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  380. package/dist/modules/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  381. package/dist/modules/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  382. package/dist/modules/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  383. package/dist/modules/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  384. package/dist/modules/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  385. package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +26 -0
  386. package/dist/modules/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  387. package/dist/modules/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  388. package/dist/modules/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  389. package/dist/modules/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  390. package/dist/modules/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  391. package/dist/modules/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  392. package/dist/modules/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  393. package/dist/modules/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  394. package/dist/modules/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  395. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  396. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  397. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  398. package/dist/modules/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  399. package/dist/modules/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  400. package/dist/modules/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  401. package/dist/modules/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  402. package/dist/modules/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  403. package/dist/modules/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  404. package/dist/modules/src/builtin/modules/random/docs.d.ts +2 -0
  405. package/dist/modules/src/builtin/modules/random/index.d.ts +2 -0
  406. package/dist/modules/src/builtin/modules/sequence/index.d.ts +2 -0
  407. package/dist/modules/src/builtin/modules/string/index.d.ts +2 -0
  408. package/dist/modules/src/builtin/modules/vector/bincount.d.ts +9 -0
  409. package/dist/modules/src/builtin/modules/vector/calcMad.d.ts +1 -0
  410. package/dist/modules/src/builtin/modules/vector/calcMean.d.ts +1 -0
  411. package/dist/modules/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  412. package/dist/modules/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  413. package/dist/modules/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  414. package/dist/modules/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  415. package/dist/modules/src/builtin/modules/vector/docs.d.ts +2 -0
  416. package/dist/modules/src/builtin/modules/vector/entropy.d.ts +8 -0
  417. package/dist/modules/src/builtin/modules/vector/histogram.d.ts +9 -0
  418. package/dist/modules/src/builtin/modules/vector/index.d.ts +2 -0
  419. package/dist/modules/src/builtin/modules/vector/mode.d.ts +6 -0
  420. package/dist/modules/src/builtin/modules/vector/outliers.d.ts +7 -0
  421. package/dist/modules/src/builtin/modules/vector/percentile.d.ts +7 -0
  422. package/dist/modules/src/builtin/modules/vector/quartiles.d.ts +1 -0
  423. package/dist/modules/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  424. package/dist/modules/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  425. package/dist/modules/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  426. package/dist/modules/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  427. package/dist/modules/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  428. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  429. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  430. package/dist/modules/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  431. package/dist/modules/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  432. package/dist/modules/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  433. package/dist/modules/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  434. package/dist/modules/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  435. package/dist/modules/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  436. package/dist/modules/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  437. package/dist/modules/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  438. package/dist/modules/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  439. package/dist/modules/src/builtin/normalExpressions/index.d.ts +8 -0
  440. package/dist/modules/src/builtin/specialExpressionTypes.d.ts +23 -0
  441. package/dist/modules/src/builtin/specialExpressions/and.d.ts +6 -0
  442. package/dist/modules/src/builtin/specialExpressions/array.d.ts +6 -0
  443. package/dist/modules/src/builtin/specialExpressions/block.d.ts +6 -0
  444. package/dist/modules/src/builtin/specialExpressions/cond.d.ts +6 -0
  445. package/dist/modules/src/builtin/specialExpressions/def.d.ts +6 -0
  446. package/dist/modules/src/builtin/specialExpressions/defined.d.ts +5 -0
  447. package/dist/modules/src/builtin/specialExpressions/functions.d.ts +6 -0
  448. package/dist/modules/src/builtin/specialExpressions/if.d.ts +6 -0
  449. package/dist/modules/src/builtin/specialExpressions/let.d.ts +6 -0
  450. package/dist/modules/src/builtin/specialExpressions/loop.d.ts +6 -0
  451. package/dist/modules/src/builtin/specialExpressions/loops.d.ts +9 -0
  452. package/dist/modules/src/builtin/specialExpressions/object.d.ts +6 -0
  453. package/dist/modules/src/builtin/specialExpressions/or.d.ts +6 -0
  454. package/dist/modules/src/builtin/specialExpressions/qq.d.ts +6 -0
  455. package/dist/modules/src/builtin/specialExpressions/recur.d.ts +5 -0
  456. package/dist/modules/src/builtin/specialExpressions/switch.d.ts +6 -0
  457. package/dist/modules/src/builtin/specialExpressions/throw.d.ts +5 -0
  458. package/dist/modules/src/builtin/specialExpressions/try.d.ts +6 -0
  459. package/dist/modules/src/builtin/specialExpressions/unless.d.ts +6 -0
  460. package/dist/modules/src/builtin/utils.d.ts +6 -0
  461. package/dist/modules/src/constants/constants.d.ts +19 -0
  462. package/dist/modules/src/errors.d.ts +24 -0
  463. package/dist/modules/src/evaluator/ContextStack.d.ts +29 -0
  464. package/dist/modules/src/evaluator/functionExecutors.d.ts +11 -0
  465. package/dist/modules/src/evaluator/index.d.ts +5 -0
  466. package/dist/modules/src/evaluator/interface.d.ts +12 -0
  467. package/dist/modules/src/full.d.ts +17 -0
  468. package/dist/modules/src/getUndefinedSymbols/index.d.ts +7 -0
  469. package/dist/modules/src/index.d.ts +14 -0
  470. package/dist/modules/src/initReferenceData.d.ts +1 -0
  471. package/dist/modules/src/interface.d.ts +7 -0
  472. package/dist/modules/src/modules/assert.d.ts +2 -0
  473. package/dist/modules/src/modules/bitwise.d.ts +2 -0
  474. package/dist/modules/src/modules/collection.d.ts +2 -0
  475. package/dist/modules/src/modules/functional.d.ts +2 -0
  476. package/dist/modules/src/modules/grid.d.ts +2 -0
  477. package/dist/modules/src/modules/linear-algebra.d.ts +2 -0
  478. package/dist/modules/src/modules/math.d.ts +2 -0
  479. package/dist/modules/src/modules/matrix.d.ts +2 -0
  480. package/dist/modules/src/modules/number-theory.d.ts +2 -0
  481. package/dist/modules/src/modules/random.d.ts +2 -0
  482. package/dist/modules/src/modules/sequence.d.ts +2 -0
  483. package/dist/modules/src/modules/string.d.ts +2 -0
  484. package/dist/modules/src/modules/vector.d.ts +2 -0
  485. package/dist/modules/src/parser/Parser.d.ts +58 -0
  486. package/dist/modules/src/parser/types.d.ts +133 -0
  487. package/dist/modules/src/symbolPatterns.d.ts +2 -0
  488. package/dist/modules/src/testFramework/index.d.ts +14 -0
  489. package/dist/modules/src/tokenizer/minifyTokenStream.d.ts +4 -0
  490. package/dist/modules/src/tokenizer/operators.d.ts +12 -0
  491. package/dist/modules/src/tokenizer/reservedNames.d.ts +66 -0
  492. package/dist/modules/src/tokenizer/token.d.ts +86 -0
  493. package/dist/modules/src/tokenizer/tokenize.d.ts +8 -0
  494. package/dist/modules/src/tokenizer/tokenizers.d.ts +14 -0
  495. package/dist/modules/src/transformer/index.d.ts +2 -0
  496. package/dist/modules/src/typeGuards/annotatedArrays.d.ts +16 -0
  497. package/dist/modules/src/typeGuards/array.d.ts +9 -0
  498. package/dist/modules/src/typeGuards/astNode.d.ts +20 -0
  499. package/dist/modules/src/typeGuards/index.d.ts +8 -0
  500. package/dist/modules/src/typeGuards/lits.d.ts +24 -0
  501. package/dist/modules/src/typeGuards/litsFunction.d.ts +12 -0
  502. package/dist/modules/src/typeGuards/number.d.ts +66 -0
  503. package/dist/modules/src/typeGuards/string.d.ts +15 -0
  504. package/dist/modules/src/untokenizer/index.d.ts +2 -0
  505. package/dist/modules/src/utils/arity.d.ts +10 -0
  506. package/dist/modules/src/utils/debug/debugTools.d.ts +1 -0
  507. package/dist/modules/src/utils/debug/getCodeMarker.d.ts +2 -0
  508. package/dist/modules/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  509. package/dist/modules/src/utils/docString/generateDocString.d.ts +2 -0
  510. package/dist/modules/src/utils/getAssertionError.d.ts +3 -0
  511. package/dist/modules/src/utils/index.d.ts +14 -0
  512. package/dist/modules/src/utils/symbols.d.ts +2 -0
  513. package/dist/modules/string.esm.js +2 -0
  514. package/dist/modules/string.esm.js.map +1 -0
  515. package/dist/modules/string.js +2 -0
  516. package/dist/modules/string.js.map +1 -0
  517. package/dist/modules/vector.esm.js +2 -0
  518. package/dist/modules/vector.esm.js.map +1 -0
  519. package/dist/modules/vector.js +2 -0
  520. package/dist/modules/vector.js.map +1 -0
  521. package/dist/reference/api.d.ts +53 -41
  522. package/dist/reference/index.d.ts +150 -23
  523. package/dist/src/AutoCompleter/AutoCompleter.d.ts +24 -0
  524. package/dist/src/Lits/Cache.d.ts +1 -1
  525. package/dist/src/Lits/Lits.d.ts +26 -22
  526. package/dist/src/allModules.d.ts +2 -0
  527. package/dist/src/builtin/bindingNode.d.ts +5 -0
  528. package/dist/src/builtin/core/array.d.ts +2 -0
  529. package/dist/src/builtin/core/bitwise.d.ts +2 -0
  530. package/dist/src/builtin/core/collection.d.ts +2 -0
  531. package/dist/src/builtin/core/functional.d.ts +2 -0
  532. package/dist/src/builtin/core/math.d.ts +2 -0
  533. package/dist/src/builtin/core/meta.d.ts +3 -0
  534. package/dist/src/builtin/core/misc.d.ts +2 -0
  535. package/dist/src/builtin/core/object.d.ts +2 -0
  536. package/dist/src/builtin/core/predicates.d.ts +2 -0
  537. package/dist/src/builtin/core/regexp.d.ts +2 -0
  538. package/dist/src/builtin/core/sequence.d.ts +2 -0
  539. package/dist/src/builtin/core/string.d.ts +2 -0
  540. package/dist/src/builtin/core/vector.d.ts +2 -0
  541. package/dist/src/builtin/index.d.ts +10 -34
  542. package/dist/src/builtin/interface.d.ts +92 -24
  543. package/dist/src/builtin/modules/assert/docs.d.ts +2 -0
  544. package/dist/src/builtin/modules/assert/index.d.ts +2 -0
  545. package/dist/src/builtin/modules/bitwise/index.d.ts +2 -0
  546. package/dist/src/builtin/modules/collection/index.d.ts +2 -0
  547. package/dist/src/builtin/modules/functional/index.d.ts +2 -0
  548. package/dist/src/builtin/modules/grid/docs.d.ts +2 -0
  549. package/dist/src/builtin/modules/grid/fromArray.d.ts +8 -0
  550. package/dist/src/builtin/modules/grid/index.d.ts +2 -0
  551. package/dist/src/builtin/modules/grid/transpose.d.ts +2 -0
  552. package/dist/src/builtin/modules/interface.d.ts +11 -0
  553. package/dist/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  554. package/dist/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  555. package/dist/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  556. package/dist/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  557. package/dist/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  558. package/dist/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  559. package/dist/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  560. package/dist/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  561. package/dist/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  562. package/dist/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  563. package/dist/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  564. package/dist/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  565. package/dist/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  566. package/dist/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  567. package/dist/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  568. package/dist/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  569. package/dist/src/builtin/modules/math/index.d.ts +2 -0
  570. package/dist/src/builtin/modules/matrix/docs.d.ts +2 -0
  571. package/dist/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  572. package/dist/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  573. package/dist/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  574. package/dist/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  575. package/dist/src/builtin/modules/matrix/helpers/diagonal.d.ts +1 -0
  576. package/dist/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  577. package/dist/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  578. package/dist/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  579. package/dist/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  580. package/dist/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  581. package/dist/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  582. package/dist/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  583. package/dist/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  584. package/dist/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  585. package/dist/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  586. package/dist/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  587. package/dist/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  588. package/dist/src/builtin/modules/matrix/index.d.ts +4 -0
  589. package/dist/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  590. package/dist/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  591. package/dist/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  592. package/dist/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  593. package/dist/src/builtin/modules/number-theory/docs.d.ts +2 -0
  594. package/dist/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  595. package/dist/src/builtin/modules/number-theory/index.d.ts +4 -0
  596. package/dist/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  597. package/dist/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  598. package/dist/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  599. package/dist/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  600. package/dist/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  601. package/dist/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  602. package/dist/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  603. package/dist/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  604. package/dist/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  605. package/dist/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  606. package/dist/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  607. package/dist/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  608. package/dist/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  609. package/dist/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  610. package/dist/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  611. package/dist/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  612. package/dist/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  613. package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +26 -0
  614. package/dist/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  615. package/dist/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  616. package/dist/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  617. package/dist/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  618. package/dist/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  619. package/dist/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  620. package/dist/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  621. package/dist/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  622. package/dist/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  623. package/dist/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  624. package/dist/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  625. package/dist/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  626. package/dist/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  627. package/dist/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  628. package/dist/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  629. package/dist/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  630. package/dist/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  631. package/dist/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  632. package/dist/src/builtin/modules/random/docs.d.ts +2 -0
  633. package/dist/src/builtin/modules/random/index.d.ts +2 -0
  634. package/dist/src/builtin/modules/sequence/index.d.ts +2 -0
  635. package/dist/src/builtin/modules/string/index.d.ts +2 -0
  636. package/dist/src/builtin/modules/vector/bincount.d.ts +9 -0
  637. package/dist/src/builtin/modules/vector/calcMad.d.ts +1 -0
  638. package/dist/src/builtin/modules/vector/calcMean.d.ts +1 -0
  639. package/dist/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  640. package/dist/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  641. package/dist/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  642. package/dist/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  643. package/dist/src/builtin/modules/vector/docs.d.ts +2 -0
  644. package/dist/src/builtin/modules/vector/entropy.d.ts +8 -0
  645. package/dist/src/builtin/modules/vector/histogram.d.ts +9 -0
  646. package/dist/src/builtin/modules/vector/index.d.ts +2 -0
  647. package/dist/src/builtin/modules/vector/mode.d.ts +6 -0
  648. package/dist/src/builtin/modules/vector/outliers.d.ts +7 -0
  649. package/dist/src/builtin/modules/vector/percentile.d.ts +7 -0
  650. package/dist/src/builtin/modules/vector/quartiles.d.ts +1 -0
  651. package/dist/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  652. package/dist/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  653. package/dist/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  654. package/dist/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  655. package/dist/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  656. package/dist/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  657. package/dist/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  658. package/dist/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  659. package/dist/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  660. package/dist/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  661. package/dist/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  662. package/dist/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  663. package/dist/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  664. package/dist/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  665. package/dist/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  666. package/dist/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  667. package/dist/src/builtin/normalExpressions/index.d.ts +7 -1
  668. package/dist/src/builtin/specialExpressionTypes.d.ts +23 -0
  669. package/dist/src/builtin/specialExpressions/and.d.ts +3 -3
  670. package/dist/src/builtin/specialExpressions/array.d.ts +6 -0
  671. package/dist/src/builtin/specialExpressions/block.d.ts +6 -0
  672. package/dist/src/builtin/specialExpressions/cond.d.ts +3 -3
  673. package/dist/src/builtin/specialExpressions/def.d.ts +5 -4
  674. package/dist/src/builtin/specialExpressions/defined.d.ts +5 -0
  675. package/dist/src/builtin/specialExpressions/functions.d.ts +5 -17
  676. package/dist/src/builtin/specialExpressions/if.d.ts +3 -3
  677. package/dist/src/builtin/specialExpressions/let.d.ts +3 -7
  678. package/dist/src/builtin/specialExpressions/loop.d.ts +3 -4
  679. package/dist/src/builtin/specialExpressions/loops.d.ts +5 -14
  680. package/dist/src/builtin/specialExpressions/object.d.ts +6 -0
  681. package/dist/src/builtin/specialExpressions/or.d.ts +3 -3
  682. package/dist/src/builtin/specialExpressions/qq.d.ts +3 -3
  683. package/dist/src/builtin/specialExpressions/recur.d.ts +3 -3
  684. package/dist/src/builtin/specialExpressions/switch.d.ts +6 -0
  685. package/dist/src/builtin/specialExpressions/throw.d.ts +3 -3
  686. package/dist/src/builtin/specialExpressions/try.d.ts +3 -5
  687. package/dist/src/builtin/specialExpressions/unless.d.ts +6 -0
  688. package/dist/src/builtin/utils.d.ts +3 -15
  689. package/dist/src/constants/constants.d.ts +18 -44
  690. package/dist/src/errors.d.ts +2 -5
  691. package/dist/src/evaluator/ContextStack.d.ts +16 -11
  692. package/dist/src/evaluator/functionExecutors.d.ts +4 -4
  693. package/dist/src/evaluator/index.d.ts +2 -2
  694. package/dist/src/evaluator/interface.d.ts +5 -5
  695. package/dist/src/full.d.ts +17 -0
  696. package/dist/src/getUndefinedSymbols/index.d.ts +7 -0
  697. package/dist/src/index.d.ts +9 -12
  698. package/dist/src/initReferenceData.d.ts +1 -0
  699. package/dist/src/interface.d.ts +1 -2
  700. package/dist/src/modules/assert.d.ts +2 -0
  701. package/dist/src/modules/bitwise.d.ts +2 -0
  702. package/dist/src/modules/collection.d.ts +2 -0
  703. package/dist/src/modules/functional.d.ts +2 -0
  704. package/dist/src/modules/grid.d.ts +2 -0
  705. package/dist/src/modules/linear-algebra.d.ts +2 -0
  706. package/dist/src/modules/math.d.ts +2 -0
  707. package/dist/src/modules/matrix.d.ts +2 -0
  708. package/dist/src/modules/number-theory.d.ts +2 -0
  709. package/dist/src/modules/random.d.ts +2 -0
  710. package/dist/src/modules/sequence.d.ts +2 -0
  711. package/dist/src/modules/string.d.ts +2 -0
  712. package/dist/src/modules/vector.d.ts +2 -0
  713. package/dist/src/parser/Parser.d.ts +58 -0
  714. package/dist/src/parser/types.d.ts +133 -0
  715. package/dist/src/symbolPatterns.d.ts +2 -0
  716. package/dist/src/tokenizer/minifyTokenStream.d.ts +4 -0
  717. package/dist/src/tokenizer/operators.d.ts +12 -0
  718. package/dist/src/tokenizer/reservedNames.d.ts +66 -0
  719. package/dist/src/tokenizer/token.d.ts +86 -0
  720. package/dist/src/tokenizer/tokenize.d.ts +8 -0
  721. package/dist/src/tokenizer/tokenizers.d.ts +14 -19
  722. package/dist/src/transformer/index.d.ts +2 -2
  723. package/dist/src/typeGuards/annotatedArrays.d.ts +16 -0
  724. package/dist/src/typeGuards/array.d.ts +1 -1
  725. package/dist/src/typeGuards/astNode.d.ts +20 -17
  726. package/dist/src/typeGuards/index.d.ts +1 -10
  727. package/dist/src/typeGuards/lits.d.ts +5 -2
  728. package/dist/src/typeGuards/litsFunction.d.ts +3 -3
  729. package/dist/src/typeGuards/number.d.ts +1 -1
  730. package/dist/src/typeGuards/string.d.ts +1 -1
  731. package/dist/src/untokenizer/index.d.ts +1 -1
  732. package/dist/src/utils/arity.d.ts +10 -0
  733. package/dist/src/utils/debug/debugTools.d.ts +0 -2
  734. package/dist/src/utils/debug/getCodeMarker.d.ts +2 -0
  735. package/dist/src/utils/debug/getSourceCodeInfo.d.ts +2 -2
  736. package/dist/src/utils/docString/generateDocString.d.ts +2 -0
  737. package/dist/src/utils/getAssertionError.d.ts +1 -1
  738. package/dist/src/utils/index.d.ts +9 -6
  739. package/dist/testFramework.esm.js +1 -8913
  740. package/dist/testFramework.esm.js.map +1 -1
  741. package/dist/testFramework.js +1 -8916
  742. package/dist/testFramework.js.map +1 -1
  743. package/package.json +88 -8
  744. package/dist/cli/common/clojureDocs.d.ts +0 -1
  745. package/dist/cli/reference/categories/array.d.ts +0 -3
  746. package/dist/cli/reference/categories/assert.d.ts +0 -3
  747. package/dist/cli/reference/categories/bitwise.d.ts +0 -3
  748. package/dist/cli/reference/categories/collection.d.ts +0 -3
  749. package/dist/cli/reference/categories/functional.d.ts +0 -3
  750. package/dist/cli/reference/categories/math.d.ts +0 -3
  751. package/dist/cli/reference/categories/misc.d.ts +0 -3
  752. package/dist/cli/reference/categories/object.d.ts +0 -3
  753. package/dist/cli/reference/categories/predicate.d.ts +0 -3
  754. package/dist/cli/reference/categories/regularExpression.d.ts +0 -3
  755. package/dist/cli/reference/categories/sequence.d.ts +0 -3
  756. package/dist/cli/reference/categories/specialExpressions.d.ts +0 -3
  757. package/dist/cli/reference/categories/string.d.ts +0 -3
  758. package/dist/cli/src/analyze/calculateOutcomes/calculateAndOutcomes.d.ts +0 -3
  759. package/dist/cli/src/analyze/calculateOutcomes/calculateCommentOutcomes.d.ts +0 -3
  760. package/dist/cli/src/analyze/calculateOutcomes/calculateCondOutcomes.d.ts +0 -3
  761. package/dist/cli/src/analyze/calculateOutcomes/calculateDeclaredOutcomes.d.ts +0 -3
  762. package/dist/cli/src/analyze/calculateOutcomes/calculateDefOutcomes.d.ts +0 -3
  763. package/dist/cli/src/analyze/calculateOutcomes/calculateDefsOutcomes.d.ts +0 -3
  764. package/dist/cli/src/analyze/calculateOutcomes/calculateDoOutcomes.d.ts +0 -3
  765. package/dist/cli/src/analyze/calculateOutcomes/calculateFunctionOutcomes.d.ts +0 -5
  766. package/dist/cli/src/analyze/calculateOutcomes/calculateIfLetOutcomes.d.ts +0 -3
  767. package/dist/cli/src/analyze/calculateOutcomes/calculateIfNotOutcomes.d.ts +0 -3
  768. package/dist/cli/src/analyze/calculateOutcomes/calculateIfOutcomes.d.ts +0 -3
  769. package/dist/cli/src/analyze/calculateOutcomes/calculateLetOutcomes.d.ts +0 -3
  770. package/dist/cli/src/analyze/calculateOutcomes/calculateLoopOutcomes.d.ts +0 -3
  771. package/dist/cli/src/analyze/calculateOutcomes/calculateLoopsOutcomes.d.ts +0 -4
  772. package/dist/cli/src/analyze/calculateOutcomes/calculateOrOutcomes.d.ts +0 -3
  773. package/dist/cli/src/analyze/calculateOutcomes/calculateQqOutcomes.d.ts +0 -3
  774. package/dist/cli/src/analyze/calculateOutcomes/calculateRecurOutcomes.d.ts +0 -3
  775. package/dist/cli/src/analyze/calculateOutcomes/calculateThrowOutcomes.d.ts +0 -3
  776. package/dist/cli/src/analyze/calculateOutcomes/calculateTimeOutcomes.d.ts +0 -3
  777. package/dist/cli/src/analyze/calculateOutcomes/calculateTryOutcomes.d.ts +0 -3
  778. package/dist/cli/src/analyze/calculateOutcomes/calculateWhenFirstOutcomes.d.ts +0 -3
  779. package/dist/cli/src/analyze/calculateOutcomes/calculateWhenLetOutcomes.d.ts +0 -3
  780. package/dist/cli/src/analyze/calculateOutcomes/calculateWhenNotOutcomes.d.ts +0 -3
  781. package/dist/cli/src/analyze/calculateOutcomes/calculateWhenOutcomes.d.ts +0 -3
  782. package/dist/cli/src/analyze/calculateOutcomes/index.d.ts +0 -18
  783. package/dist/cli/src/analyze/calculateOutcomes/specialExpressionCalculators.d.ts +0 -55
  784. package/dist/cli/src/analyze/findUnresolvedIdentifiers.d.ts +0 -2
  785. package/dist/cli/src/analyze/index.d.ts +0 -17
  786. package/dist/cli/src/analyze/utils.d.ts +0 -4
  787. package/dist/cli/src/builtin/normalExpressions/categories/assert.d.ts +0 -2
  788. package/dist/cli/src/builtin/normalExpressions/categories/sequence.d.ts +0 -4
  789. package/dist/cli/src/builtin/specialExpressions/comment.d.ts +0 -5
  790. package/dist/cli/src/builtin/specialExpressions/declared.d.ts +0 -5
  791. package/dist/cli/src/builtin/specialExpressions/defs.d.ts +0 -5
  792. package/dist/cli/src/builtin/specialExpressions/do.d.ts +0 -6
  793. package/dist/cli/src/builtin/specialExpressions/if-let.d.ts +0 -10
  794. package/dist/cli/src/builtin/specialExpressions/if-not.d.ts +0 -6
  795. package/dist/cli/src/builtin/specialExpressions/time.d.ts +0 -6
  796. package/dist/cli/src/builtin/specialExpressions/when-first.d.ts +0 -7
  797. package/dist/cli/src/builtin/specialExpressions/when-let.d.ts +0 -7
  798. package/dist/cli/src/builtin/specialExpressions/when-not.d.ts +0 -6
  799. package/dist/cli/src/builtin/specialExpressions/when.d.ts +0 -6
  800. package/dist/cli/src/identifier.d.ts +0 -8
  801. package/dist/cli/src/parser/index.d.ts +0 -3
  802. package/dist/cli/src/parser/interface.d.ts +0 -155
  803. package/dist/cli/src/parser/parsers.d.ts +0 -4
  804. package/dist/cli/src/removeCommentNodes/index.d.ts +0 -11
  805. package/dist/cli/src/removeCommentNodes/removeCommentNodesFromSpecialExpression.d.ts +0 -3
  806. package/dist/cli/src/reservedNames.d.ts +0 -7
  807. package/dist/cli/src/tokenizer/index.d.ts +0 -9
  808. package/dist/cli/src/tokenizer/interface.d.ts +0 -35
  809. package/dist/cli/src/tokenizer/sugar/applyCollectionAccessor.d.ts +0 -2
  810. package/dist/cli/src/tokenizer/sugar/index.d.ts +0 -3
  811. package/dist/cli/src/typeGuards/token.d.ts +0 -13
  812. package/dist/cli/src/unparser/UnparseOptions.d.ts +0 -15
  813. package/dist/cli/src/unparser/unparse.d.ts +0 -5
  814. package/dist/cli/src/unparser/unparseArrayLiteral.d.ts +0 -3
  815. package/dist/cli/src/unparser/unparseBindings.d.ts +0 -3
  816. package/dist/cli/src/unparser/unparseNormalExpression.d.ts +0 -3
  817. package/dist/cli/src/unparser/unparseObjectLiteral.d.ts +0 -3
  818. package/dist/cli/src/unparser/unparseParams.d.ts +0 -17
  819. package/dist/cli/src/unparser/unparseSpecialExpression/index.d.ts +0 -3
  820. package/dist/cli/src/unparser/unparseSpecialExpression/unparseCond.d.ts +0 -3
  821. package/dist/cli/src/unparser/unparseSpecialExpression/unparseDo.d.ts +0 -3
  822. package/dist/cli/src/unparser/unparseSpecialExpression/unparseIfLet.d.ts +0 -3
  823. package/dist/cli/src/unparser/unparseSpecialExpression/unparseIfOrWhenLike.d.ts +0 -6
  824. package/dist/cli/src/unparser/unparseSpecialExpression/unparseLet.d.ts +0 -3
  825. package/dist/cli/src/unparser/utils.d.ts +0 -5
  826. package/dist/common/clojureDocs.d.ts +0 -1
  827. package/dist/reference/categories/array.d.ts +0 -3
  828. package/dist/reference/categories/assert.d.ts +0 -3
  829. package/dist/reference/categories/bitwise.d.ts +0 -3
  830. package/dist/reference/categories/collection.d.ts +0 -3
  831. package/dist/reference/categories/functional.d.ts +0 -3
  832. package/dist/reference/categories/math.d.ts +0 -3
  833. package/dist/reference/categories/misc.d.ts +0 -3
  834. package/dist/reference/categories/object.d.ts +0 -3
  835. package/dist/reference/categories/predicate.d.ts +0 -3
  836. package/dist/reference/categories/regularExpression.d.ts +0 -3
  837. package/dist/reference/categories/sequence.d.ts +0 -3
  838. package/dist/reference/categories/specialExpressions.d.ts +0 -3
  839. package/dist/reference/categories/string.d.ts +0 -3
  840. package/dist/src/analyze/calculateOutcomes/calculateAndOutcomes.d.ts +0 -3
  841. package/dist/src/analyze/calculateOutcomes/calculateCommentOutcomes.d.ts +0 -3
  842. package/dist/src/analyze/calculateOutcomes/calculateCondOutcomes.d.ts +0 -3
  843. package/dist/src/analyze/calculateOutcomes/calculateDeclaredOutcomes.d.ts +0 -3
  844. package/dist/src/analyze/calculateOutcomes/calculateDefOutcomes.d.ts +0 -3
  845. package/dist/src/analyze/calculateOutcomes/calculateDefsOutcomes.d.ts +0 -3
  846. package/dist/src/analyze/calculateOutcomes/calculateDoOutcomes.d.ts +0 -3
  847. package/dist/src/analyze/calculateOutcomes/calculateFunctionOutcomes.d.ts +0 -5
  848. package/dist/src/analyze/calculateOutcomes/calculateIfLetOutcomes.d.ts +0 -3
  849. package/dist/src/analyze/calculateOutcomes/calculateIfNotOutcomes.d.ts +0 -3
  850. package/dist/src/analyze/calculateOutcomes/calculateIfOutcomes.d.ts +0 -3
  851. package/dist/src/analyze/calculateOutcomes/calculateLetOutcomes.d.ts +0 -3
  852. package/dist/src/analyze/calculateOutcomes/calculateLoopOutcomes.d.ts +0 -3
  853. package/dist/src/analyze/calculateOutcomes/calculateLoopsOutcomes.d.ts +0 -4
  854. package/dist/src/analyze/calculateOutcomes/calculateOrOutcomes.d.ts +0 -3
  855. package/dist/src/analyze/calculateOutcomes/calculateQqOutcomes.d.ts +0 -3
  856. package/dist/src/analyze/calculateOutcomes/calculateRecurOutcomes.d.ts +0 -3
  857. package/dist/src/analyze/calculateOutcomes/calculateThrowOutcomes.d.ts +0 -3
  858. package/dist/src/analyze/calculateOutcomes/calculateTimeOutcomes.d.ts +0 -3
  859. package/dist/src/analyze/calculateOutcomes/calculateTryOutcomes.d.ts +0 -3
  860. package/dist/src/analyze/calculateOutcomes/calculateWhenFirstOutcomes.d.ts +0 -3
  861. package/dist/src/analyze/calculateOutcomes/calculateWhenLetOutcomes.d.ts +0 -3
  862. package/dist/src/analyze/calculateOutcomes/calculateWhenNotOutcomes.d.ts +0 -3
  863. package/dist/src/analyze/calculateOutcomes/calculateWhenOutcomes.d.ts +0 -3
  864. package/dist/src/analyze/calculateOutcomes/index.d.ts +0 -18
  865. package/dist/src/analyze/calculateOutcomes/specialExpressionCalculators.d.ts +0 -55
  866. package/dist/src/analyze/findUnresolvedIdentifiers.d.ts +0 -2
  867. package/dist/src/analyze/index.d.ts +0 -17
  868. package/dist/src/analyze/utils.d.ts +0 -4
  869. package/dist/src/builtin/normalExpressions/categories/assert.d.ts +0 -2
  870. package/dist/src/builtin/normalExpressions/categories/sequence.d.ts +0 -4
  871. package/dist/src/builtin/specialExpressions/comment.d.ts +0 -5
  872. package/dist/src/builtin/specialExpressions/declared.d.ts +0 -5
  873. package/dist/src/builtin/specialExpressions/defs.d.ts +0 -5
  874. package/dist/src/builtin/specialExpressions/do.d.ts +0 -6
  875. package/dist/src/builtin/specialExpressions/if-let.d.ts +0 -10
  876. package/dist/src/builtin/specialExpressions/if-not.d.ts +0 -6
  877. package/dist/src/builtin/specialExpressions/time.d.ts +0 -6
  878. package/dist/src/builtin/specialExpressions/when-first.d.ts +0 -7
  879. package/dist/src/builtin/specialExpressions/when-let.d.ts +0 -7
  880. package/dist/src/builtin/specialExpressions/when-not.d.ts +0 -6
  881. package/dist/src/builtin/specialExpressions/when.d.ts +0 -6
  882. package/dist/src/identifier.d.ts +0 -8
  883. package/dist/src/parser/index.d.ts +0 -3
  884. package/dist/src/parser/interface.d.ts +0 -155
  885. package/dist/src/parser/parsers.d.ts +0 -4
  886. package/dist/src/removeCommentNodes/index.d.ts +0 -11
  887. package/dist/src/removeCommentNodes/removeCommentNodesFromSpecialExpression.d.ts +0 -3
  888. package/dist/src/reservedNames.d.ts +0 -7
  889. package/dist/src/tokenizer/index.d.ts +0 -9
  890. package/dist/src/tokenizer/interface.d.ts +0 -35
  891. package/dist/src/tokenizer/sugar/applyCollectionAccessor.d.ts +0 -2
  892. package/dist/src/tokenizer/sugar/index.d.ts +0 -3
  893. package/dist/src/typeGuards/token.d.ts +0 -13
  894. package/dist/src/unparser/UnparseOptions.d.ts +0 -15
  895. package/dist/src/unparser/__tests__/testFormatter.d.ts +0 -1
  896. package/dist/src/unparser/unparse.d.ts +0 -5
  897. package/dist/src/unparser/unparseArrayLiteral.d.ts +0 -3
  898. package/dist/src/unparser/unparseBindings.d.ts +0 -3
  899. package/dist/src/unparser/unparseNormalExpression.d.ts +0 -3
  900. package/dist/src/unparser/unparseObjectLiteral.d.ts +0 -3
  901. package/dist/src/unparser/unparseParams.d.ts +0 -17
  902. package/dist/src/unparser/unparseSpecialExpression/index.d.ts +0 -3
  903. package/dist/src/unparser/unparseSpecialExpression/unparseCond.d.ts +0 -3
  904. package/dist/src/unparser/unparseSpecialExpression/unparseDo.d.ts +0 -3
  905. package/dist/src/unparser/unparseSpecialExpression/unparseIfLet.d.ts +0 -3
  906. package/dist/src/unparser/unparseSpecialExpression/unparseIfOrWhenLike.d.ts +0 -6
  907. package/dist/src/unparser/unparseSpecialExpression/unparseLet.d.ts +0 -3
  908. package/dist/src/unparser/utils.d.ts +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/debug/debugTools.ts","../../src/utils/symbols.ts","../../src/typeGuards/number.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/typeGuards/annotatedArrays.ts","../../src/utils/index.ts","../../src/utils/arity.ts","../../src/builtin/modules/matrix/docs.ts","../../src/builtin/modules/matrix/helpers/determinant.ts","../../src/builtin/modules/matrix/helpers/minor.ts","../../src/builtin/modules/matrix/helpers/adjugate.ts","../../src/builtin/modules/matrix/helpers/isSquare.ts","../../src/builtin/modules/matrix/helpers/isIdentity.ts","../../src/builtin/modules/matrix/helpers/matrixMultiply.ts","../../src/builtin/modules/matrix/index.ts","../../src/builtin/modules/matrix/helpers/inverse.ts","../../src/builtin/modules/matrix/helpers/cofactor.ts","../../src/builtin/modules/matrix/helpers/trace.ts","../../src/builtin/modules/matrix/helpers/isSymetric.ts","../../src/builtin/modules/matrix/helpers/isTriangular.ts","../../src/builtin/modules/matrix/helpers/isDiagonal.ts","../../src/builtin/modules/matrix/helpers/isOrthogonal.ts","../../src/builtin/modules/grid/transpose.ts","../../src/builtin/modules/matrix/helpers/band.ts","../../src/builtin/modules/matrix/helpers/isBanded.ts","../../src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.ts","../../src/builtin/modules/matrix/helpers/norm1.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getLitsErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class LitsError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getLitsErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, LitsError.prototype)\n this.name = 'LitsError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends LitsError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends LitsError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends LitsError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isLitsError(error: unknown): error is LitsError {\n return error instanceof LitsError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'Builtin',\n 'SpecialBuiltin',\n 'NativeJsFunction',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { LitsFunction, Node } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isLitsFunction(func: unknown): func is LitsFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is Node {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isLitsFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new LitsError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import { LitsError } from '../errors'\nimport type { Any } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isNumber } from './number'\n\nconst annotatedArrays = new WeakSet<unknown[]>()\nconst vectors = new WeakSet<unknown[]>()\nconst notVectors = new WeakSet<unknown[]>()\nconst matrices = new WeakSet<unknown[]>()\nconst notMatrices = new WeakSet<unknown[]>()\nconst grids = new WeakSet<unknown[]>()\nconst notGrids = new WeakSet<unknown[]>()\n\nexport function annotate<T>(value: T): T {\n if (!Array.isArray(value)) {\n return value\n }\n if (annotatedArrays.has(value)) {\n return value\n }\n isVector(value)\n if (!isMatrix(value)) {\n isGrid(value)\n }\n\n return value\n}\nexport function isVector(vector: unknown): vector is number[] {\n if (!Array.isArray(vector)) {\n return false\n }\n\n if (vectors.has(vector)) {\n return true\n }\n if (notVectors.has(vector)) {\n return false\n }\n\n if (vector.every(elem => isNumber(elem))) {\n annotatedArrays.add(vector)\n vectors.add(vector)\n return true\n }\n notVectors.add(vector)\n return false\n}\n\nexport function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n if (!isVector(vector)) {\n throw new LitsError(`Expected a vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is2dVector(vector: unknown): vector is [number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 2\n}\nexport function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number] {\n if (!is2dVector(vector)) {\n throw new LitsError(`Expected a 2d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is3dVector(vector: unknown): vector is [number, number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 3\n}\nexport function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number] {\n if (!is3dVector(vector)) {\n throw new LitsError(`Expected a 3d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n assertVector(vector, sourceCodeInfo)\n if (vector.length === 0) {\n throw new LitsError(`Expected a non empty vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function isGrid(grid: unknown): grid is unknown[][] {\n if (!Array.isArray(grid)) {\n return false\n }\n if (grids.has(grid)) {\n return true\n }\n if (notGrids.has(grid)) {\n return false\n }\n if (grid.length === 0) {\n notGrids.add(grid)\n return false\n }\n if (!Array.isArray(grid[0])) {\n notGrids.add(grid)\n return false\n }\n const nbrOfCols = grid[0].length\n for (const row of grid.slice(1)) {\n if (!Array.isArray(row)) {\n notGrids.add(grid)\n return false\n }\n if (row.length !== nbrOfCols) {\n notGrids.add(grid)\n return false\n }\n }\n annotatedArrays.add(grid)\n grids.add(grid)\n return true\n}\n\nexport function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][] {\n if (!isGrid(grid)) {\n throw new LitsError(`Expected a grid, but got ${grid}`, sourceCodeInfo)\n }\n}\n\nexport function isMatrix(matrix: unknown): matrix is number[][] {\n if (!Array.isArray(matrix)) {\n return false\n }\n if (matrices.has(matrix)) {\n return true\n }\n if (notMatrices.has(matrix)) {\n return false\n }\n if (matrix.length === 0) {\n notMatrices.add(matrix)\n return false\n }\n if (!Array.isArray(matrix[0]) || matrix[0].length === 0) {\n notMatrices.add(matrix)\n return false\n }\n const nbrOfCols = matrix[0].length\n for (const row of matrix) {\n if (!Array.isArray(row) || row.length !== nbrOfCols || row.some(cell => !isNumber(cell))) {\n notMatrices.add(matrix)\n return false\n }\n }\n annotatedArrays.add(matrix)\n grids.add(matrix)\n matrices.add(matrix)\n return true\n}\n\nexport function assertMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n}\n\nexport function assertSquareMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n if (matrix.length !== matrix[0]!.length) {\n throw new LitsError(`Expected square matrix, but got ${matrix.length} and ${matrix[0]!.length}`, sourceCodeInfo)\n }\n}\n\nexport function isSquareMatrix(matrix: unknown): matrix is number[][] {\n if (!isMatrix(matrix)) {\n return false\n }\n if (matrix.length !== matrix[0]!.length) {\n return false\n }\n return true\n}\n","import type { Any, Coll, Obj } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { asAny, isColl, isObj, isRegularExpression } from '../typeGuards/lits'\nimport { isNumber } from '../typeGuards/number'\nimport { asString, assertStringOrNumber } from '../typeGuards/string'\nimport { isUnknownRecord } from '../typeGuards'\nimport { LitsError } from '../errors'\n\nexport function collHasKey(coll: unknown, key: string | number): boolean {\n if (!isColl(coll))\n return false\n\n if (typeof coll === 'string' || Array.isArray(coll)) {\n if (!isNumber(key, { integer: true }))\n return false\n\n return key >= 0 && key < coll.length\n }\n return !!Object.getOwnPropertyDescriptor(coll, key)\n}\n\nexport function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number {\n assertStringOrNumber(a, sourceCodeInfo)\n assertStringOrNumber(b, sourceCodeInfo)\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a < b ? -1 : a > b ? 1 : 0\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.sign((a) - (b))\n }\n throw new LitsError(`Cannot compare values of different types: ${typeof a} and ${typeof b}`, sourceCodeInfo)\n}\n\nexport function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean {\n if (a === b)\n return true\n\n if (typeof a === 'number' && typeof b === 'number')\n return approxEqual(a, b)\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false\n\n for (let i = 0; i < a.length; i += 1) {\n if (!deepEqual(asAny(a[i], sourceCodeInfo), asAny(b[i], sourceCodeInfo), sourceCodeInfo))\n return false\n }\n return true\n }\n if (isRegularExpression(a) && isRegularExpression(b))\n return a.s === b.s && a.f === b.f\n\n if (isUnknownRecord(a) && isUnknownRecord(b)) {\n const aKeys = Object.keys(a)\n const bKeys = Object.keys(b)\n if (aKeys.length !== bKeys.length)\n return false\n\n for (let i = 0; i < aKeys.length; i += 1) {\n const key = asString(aKeys[i], sourceCodeInfo)\n if (!deepEqual(a[key], b[key], sourceCodeInfo))\n return false\n }\n return true\n }\n return false\n}\n\nexport function toNonNegativeInteger(num: number): number {\n return Math.max(0, Math.ceil(num))\n}\n\nexport function toAny(value: unknown): Any {\n return (value ?? null) as Any\n}\n\nfunction clone<T>(value: T): T {\n if (isObj(value)) {\n return Object.entries(value).reduce((result: Obj, entry) => {\n const [key, val] = entry\n result[key] = clone(val)\n return result\n }, {}) as T\n }\n if (Array.isArray(value))\n // eslint-disable-next-line ts/no-unsafe-return\n return value.map(item => clone(item)) as unknown as T\n\n return value\n}\n\nexport function cloneColl<T extends Coll>(value: T): T {\n return clone(value)\n}\n\nexport function joinSets<T>(...results: Set<T>[]): Set<T> {\n const result = new Set<T>()\n for (const symbols of results)\n symbols.forEach(symbol => result.add(symbol))\n\n return result\n}\n\nexport function addToSet<T>(target: Set<T>, source: Set<T>): void {\n source.forEach(symbol => target.add(symbol))\n}\n\nexport const EPSILON = 1e-10\n\nexport function approxEqual(a: number, b: number, epsilon: number = EPSILON): boolean {\n if (a === b) {\n return true\n }\n\n const diff = Math.abs(a - b)\n\n if (a === 0 || b === 0 || diff < epsilon) {\n // Use absolute error for values near zero\n return diff < epsilon\n }\n const absA = Math.abs(a)\n const absB = Math.abs(b)\n\n // Use relative error for larger values\n return diff / (absA + absB) < epsilon\n}\n\nexport function approxZero(value: number): boolean {\n return Math.abs(value) < EPSILON\n}\n\nexport function smartTrim(str: string, minIndent = 0): string {\n const lines = str.split('\\n')\n while (lines[0]?.match(/^\\s*$/)) {\n lines.shift() // Remove leading empty lines\n }\n while (lines[lines.length - 1]?.match(/^\\s*$/)) {\n lines.pop() // Remove trailing empty lines\n }\n const indent = lines.reduce((acc, line) => {\n if (line.match(/^\\s*$/))\n return acc // Skip empty lines\n const lineIndent = line.match(/^\\s*/)![0].length\n return Math.min(acc, lineIndent)\n }, Infinity)\n return lines.map(line => ' '.repeat(minIndent) + line.slice(indent)).join('\\n').trimEnd()\n}\n","import type { Arity } from '../builtin/interface'\nimport { LitsError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/lits'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new LitsError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new LitsError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import type { FunctionDocs } from '../../interface'\n\nexport const moduleDocs: Record<string, FunctionDocs> = {\n 'mul': {\n category: 'matrix',\n description: 'Multiplies two `matrices` using standard `matrix` multiplication based on **dot products** of rows and columns.',\n returns: {\n type: 'matrix',\n },\n args: {\n a: {\n type: 'matrix',\n },\n b: {\n type: 'matrix',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n ],\n examples: [\n 'let { mul } = import(\"matrix\");\\nmul([[1, 2], [3, 4]], [[5, 6], [7, 8]])',\n 'let { mul } = import(\"matrix\");\\nmul([[1, 2, 3], [4, 5, 6]], [[7, 8], [9, 10], [11, 12]])',\n ],\n seeAlso: ['matrix.det', 'matrix.inv'],\n },\n 'det': {\n category: 'matrix',\n description: 'Calculates the **determinant** of a square matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the determinant of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { det } = import(\"matrix\");\\ndet([[1, 2], [3, 4]])',\n 'let { det } = import(\"matrix\");\\ndet([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.inv', 'matrix.cofactor', 'matrix.adj', 'matrix.trace', 'matrix.rank', 'matrix.invertible?', 'matrix.mul', 'matrix.minor'],\n },\n 'inv': {\n category: 'matrix',\n description: 'Calculates the **inverse** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the inverse of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { inv } = import(\"matrix\");\\ninv([[1, 2], [3, 4]])',\n 'let { inv } = import(\"matrix\");\\ninv([[1, 2, 3], [4, 5, 7], [7, 8, 10]])',\n ],\n seeAlso: ['matrix.det', 'matrix.adj', 'matrix.invertible?', 'linear-algebra.solve', 'matrix.mul', 'matrix.orthogonal?'],\n },\n 'adj': {\n category: 'matrix',\n description: 'Calculates the **adjugate** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the adjugate of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { adj } = import(\"matrix\");\\nadj([[1, 2], [3, 4]])',\n 'let { adj } = import(\"matrix\");\\nadj([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { adj } = import(\"matrix\");\\nadj([[1, 2, 3], [7, 8, 9], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.cofactor', 'matrix.det', 'matrix.inv'],\n },\n 'cofactor': {\n category: 'matrix',\n description: 'Calculates the **cofactor** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the cofactor of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { cofactor } = import(\"matrix\");\\ncofactor([[1, 2], [3, 4]])',\n 'let { cofactor } = import(\"matrix\");\\ncofactor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { cofactor } = import(\"matrix\");\\ncofactor([[1, 2, 3], [7, 8, 9], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.adj', 'matrix.minor', 'matrix.det'],\n },\n 'minor': {\n category: 'matrix',\n description: 'Calculates the **minor** of a square matrix.',\n returns: {\n type: 'matrix',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the minor of.',\n },\n row: {\n type: 'integer',\n description: 'The row index of the element to calculate the minor for.',\n },\n col: {\n type: 'integer',\n description: 'The column index of the element to calculate the minor for.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n 'row',\n 'col',\n ],\n },\n ],\n examples: [\n 'let { minor } = import(\"matrix\");\\nminor([[1, 2], [3, 4]], 0, 1)',\n 'let { minor } = import(\"matrix\");\\nminor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1, 1)',\n ],\n seeAlso: ['matrix.cofactor', 'matrix.det'],\n },\n 'trace': {\n category: 'matrix',\n description: 'Calculates the **trace** of a square matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the trace of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { trace } = import(\"matrix\");\\ntrace([[1, 2], [3, 4]])',\n 'let { trace } = import(\"matrix\");\\ntrace([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.det', 'matrix.diagonal?'],\n },\n 'symmetric?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **symmetric**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for symmetry.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { symmetric? } = import(\"matrix\");\\nsymmetric?([[1, 2], [2, 1]])',\n 'let { symmetric? } = import(\"matrix\");\\nsymmetric?([[1, 2, 3], [2, 1, 4], [3, 4, 1]])',\n ],\n seeAlso: ['matrix.orthogonal?', 'matrix.diagonal?', 'matrix.square?', 'matrix.hilbert'],\n },\n 'triangular?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **triangular**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for triangularity.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { triangular? } = import(\"matrix\");\\ntriangular?([[2, 0], [0, 1]])',\n 'let { triangular? } = import(\"matrix\");\\ntriangular?([[1, 2, 3], [0, 4, 5], [0, 0, 6]])',\n ],\n seeAlso: ['matrix.upper-triangular?', 'matrix.lower-triangular?', 'matrix.diagonal?', 'matrix.banded?'],\n },\n 'upper-triangular?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **upper triangular**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for upper triangularity.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { upper-triangular? } = import(\"matrix\");\\nupper-triangular?([[1, 2], [0, 3]])',\n 'let { upper-triangular? } = import(\"matrix\");\\nupper-triangular?([[1, 2, 3], [0, 4, 5], [0, 0, 6]])',\n ],\n seeAlso: ['matrix.lower-triangular?', 'matrix.triangular?', 'matrix.diagonal?'],\n },\n 'lower-triangular?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **lower triangular**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for lower triangularity.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { lower-triangular? } = import(\"matrix\");\\nlower-triangular?([[1, 0], [2, 3]])',\n 'let { lower-triangular? } = import(\"matrix\");\\nlower-triangular?([[1, 0, 0], [2, 3, 0], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.upper-triangular?', 'matrix.triangular?', 'matrix.diagonal?'],\n },\n 'diagonal?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **diagonal**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for diagonal property.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { diagonal? } = import(\"matrix\");\\ndiagonal?([[1, 0], [0, 2]])',\n 'let { diagonal? } = import(\"matrix\");\\ndiagonal?([[1, 0, 0], [0, 2, 0], [0, 0, 3]])',\n 'let { diagonal? } = import(\"matrix\");\\ndiagonal?([[1, 0, 0], [2, 2, 2], [0, 0, 3]])',\n ],\n seeAlso: ['matrix.identity?', 'matrix.symmetric?', 'matrix.triangular?', 'matrix.trace', 'matrix.upper-triangular?', 'matrix.lower-triangular?', 'matrix.band', 'matrix.banded?'],\n },\n 'square?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **square**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for square property.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { square? } = import(\"matrix\");\\nsquare?([[1, 2], [3, 4]])',\n 'let { square? } = import(\"matrix\");\\nsquare?([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { square? } = import(\"matrix\");\\nsquare?([[1, 2, 3], [4, 5, 6]])',\n ],\n seeAlso: ['matrix.symmetric?', 'matrix.identity?', 'matrix.invertible?'],\n },\n 'orthogonal?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **orthogonal**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for **orthogonality**.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { orthogonal? } = import(\"matrix\");\\northogonal?([[1, 0], [0, 1]])',\n 'let { orthogonal? } = import(\"matrix\");\\northogonal?([[1, 0], [0, -1]])',\n 'let { orthogonal? } = import(\"matrix\");\\northogonal?([[1, 2], [3, 4]])',\n ],\n seeAlso: ['matrix.symmetric?', 'matrix.inv', 'matrix.identity?', 'linear-algebra.orthogonal?'],\n },\n 'identity?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is an **identity matrix**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for identity property.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { identity? } = import(\"matrix\");\\nidentity?([[1, 0], [0, 1]])',\n 'let { identity? } = import(\"matrix\");\\nidentity?([[1, 0, 0], [0, 1, 0], [0, 0, 1]])',\n 'let { identity? } = import(\"matrix\");\\nidentity?([[1, 0, 0], [0, 1, 0], [0, 0, 0]])',\n ],\n seeAlso: ['matrix.diagonal?', 'matrix.square?', 'matrix.orthogonal?'],\n },\n 'invertible?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **invertible**.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for invertibility.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { invertible? } = import(\"matrix\");\\ninvertible?([[1, 2], [3, 4]])',\n 'let { invertible? } = import(\"matrix\");\\ninvertible?([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { invertible? } = import(\"matrix\");\\ninvertible?([[1, 2], [2, 4]])',\n ],\n seeAlso: ['matrix.det', 'matrix.inv', 'matrix.rank', 'matrix.square?'],\n },\n 'hilbert': {\n category: 'matrix',\n description: 'Generates a **Hilbert matrix** of size `n`.',\n returns: {\n type: 'matrix',\n },\n args: {\n n: {\n type: 'integer',\n description: 'The size of the Hilbert matrix.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'n',\n ],\n },\n ],\n examples: [\n 'let { hilbert } = import(\"matrix\");\\nhilbert(3)',\n 'let { hilbert } = import(\"matrix\");\\nhilbert(4)',\n ],\n seeAlso: ['matrix.vandermonde', 'matrix.symmetric?'],\n },\n 'vandermonde': {\n category: 'matrix',\n description: 'Generates a **Vandermonde matrix** from a vector.',\n returns: {\n type: 'matrix',\n },\n args: {\n v: {\n type: 'vector',\n description: 'The vector to generate the Vandermonde matrix from.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'v',\n ],\n },\n ],\n examples: [\n 'let { vandermonde } = import(\"matrix\");\\nvandermonde([1, 2, 3])',\n 'let { vandermonde } = import(\"matrix\");\\nvandermonde([1, 0, 1])',\n ],\n seeAlso: ['matrix.hilbert', 'matrix.band'],\n },\n 'band': {\n category: 'matrix',\n description: 'Generates a **banded matrix** of size `n` with lower band index `lband` and upper band index `uband`.',\n returns: {\n type: 'matrix',\n },\n args: {\n n: {\n type: 'integer',\n description: 'The size of the banded matrix.',\n },\n lband: {\n type: 'integer',\n description: 'The lower band index.',\n },\n uband: {\n type: 'integer',\n description: 'The upper band index.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'n',\n 'lband',\n 'uband',\n ],\n },\n ],\n examples: [\n 'let { band } = import(\"matrix\");\\nband(3, 1, 1)',\n 'let { band } = import(\"matrix\");\\nband(4, 1, 2)',\n ],\n seeAlso: ['matrix.banded?', 'matrix.diagonal?', 'matrix.vandermonde'],\n },\n 'banded?': {\n category: 'matrix',\n description: 'Checks if a `matrix` is **banded** with lower band index `lband` and upper band index `uband`.',\n returns: {\n type: 'boolean',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to check for **banded** property.',\n },\n lband: {\n type: 'integer',\n description: 'The lower band index.',\n },\n uband: {\n type: 'integer',\n description: 'The upper band index.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n 'lband',\n 'uband',\n ],\n },\n ],\n examples: [\n 'let { banded? } = import(\"matrix\");\\nbanded?([\\n [1, 1, 1, 0],\\n [1, 1, 1, 1],\\n [1, 1, 1, 1],\\n [0, 1, 1, 1],\\n], 2, 2)',\n 'let { banded? } = import(\"matrix\");\\nbanded?([\\n [1, 1, 1, 0],\\n [1, 1, 1, 1],\\n [1, 1, 1, 1],\\n [0, 1, 1, 1],\\n], 1, 1)',\n ],\n seeAlso: ['matrix.band', 'matrix.triangular?', 'matrix.diagonal?'],\n },\n 'rank': {\n category: 'matrix',\n description: 'Calculates the **rank** of a matrix using **Gaussian elimination**.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the rank of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { rank } = import(\"matrix\");\\nrank([[1, 0, 0], [0, 1, 0], [0, 0, 1]])',\n 'let { rank } = import(\"matrix\");\\nrank([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n 'let { rank } = import(\"matrix\");\\nrank([[2, 4, 6], [3, 6, 9], [4, 8, 12]])',\n ],\n seeAlso: ['matrix.det', 'matrix.invertible?', 'linear-algebra.rref'],\n },\n 'frobenius-norm': {\n category: 'matrix',\n description: 'Calculates the **Frobenius norm** of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the Frobenius norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { frobenius-norm } = import(\"matrix\");\\nfrobenius-norm([[1, 2], [3, 4]])',\n 'let { frobenius-norm } = import(\"matrix\");\\nfrobenius-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.one-norm', 'matrix.inf-norm', 'matrix.max-norm'],\n },\n 'one-norm': {\n category: 'matrix',\n description: 'Calculates the **one-norm** (column norm) of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the one-norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { one-norm } = import(\"matrix\");\\none-norm([[1, 2], [3, 4]])',\n 'let { one-norm } = import(\"matrix\");\\none-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.frobenius-norm', 'matrix.inf-norm', 'matrix.max-norm'],\n },\n 'inf-norm': {\n category: 'matrix',\n description: 'Calculates the **infinity norm** of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the infinity norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { inf-norm } = import(\"matrix\");\\ninf-norm([[1, 2], [3, 4]])',\n 'let { inf-norm } = import(\"matrix\");\\ninf-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.frobenius-norm', 'matrix.one-norm', 'matrix.max-norm'],\n },\n 'max-norm': {\n category: 'matrix',\n description: 'Calculates the **max norm** of a matrix.',\n returns: {\n type: 'number',\n },\n args: {\n m: {\n type: 'matrix',\n description: 'The `matrix` to calculate the max norm of.',\n },\n },\n variants: [\n {\n argumentNames: [\n 'm',\n ],\n },\n ],\n examples: [\n 'let { max-norm } = import(\"matrix\");\\nmax-norm([[1, 2], [3, 4]])',\n 'let { max-norm } = import(\"matrix\");\\nmax-norm([[1, 2, 3], [4, 5, 6], [7, 8, 9]])',\n ],\n seeAlso: ['matrix.frobenius-norm', 'matrix.one-norm', 'matrix.inf-norm'],\n },\n}\n","import { approxZero } from '../../../../utils'\n\n/**\n * Calculates the determinant of a matrix using Gaussian Elimination\n * @param matrix A square matrix represented as a 2D array\n * @returns The determinant of the matrix\n */\nexport function determinant(matrix: number[][]): number {\n // First, make a deep copy of the matrix to avoid modifying the original\n const n = matrix.length\n const A: number[][] = []\n\n for (let i = 0; i < n; i++) {\n A[i] = [...matrix[i]!]\n }\n\n // Handle special cases for small matrices\n if (n === 1) {\n return A[0]![0]!\n }\n\n if (n === 2) {\n return A[0]![0]! * A[1]![1]! - A[0]![1]! * A[1]![0]!\n }\n\n // For larger matrices, use Gaussian elimination\n let sign = 1 // Track sign changes from row swaps\n\n // Perform Gaussian elimination to get an upper triangular matrix\n for (let i = 0; i < n - 1; i += 1) {\n // Find pivot (maximum element in current column)\n let maxRow = i\n\n for (let j = i + 1; j < n; j += 1) {\n if (Math.abs(A[j]![i]!) > Math.abs(A[maxRow]![i]!)) {\n maxRow = j\n }\n }\n\n // If the pivot is zero, the determinant is zero\n if (approxZero(A[maxRow]![i]!)) {\n return 0\n }\n\n // Swap rows if necessary\n if (maxRow !== i) {\n [A[i], A[maxRow]] = [A[maxRow]!, A[i]!] // ES6 array destructuring for swap\n sign = -sign // Each row swap changes the sign\n }\n\n // Eliminate entries below the pivot\n for (let j = i + 1; j < n; j += 1) {\n const factor = A[j]![i]! / A[i]![i]!\n\n // Subtract (factor * pivot row) from current row\n for (let k = i; k < n; k++) {\n A[j]![k]! -= factor * A[i]![k]!\n }\n }\n }\n\n // Calculate determinant as the product of diagonal elements\n let det = sign\n for (let i = 0; i < n; i++) {\n det *= A[i]![i]!\n }\n\n return det\n}\n","export function minor(matrix: number[][], row: number, col: number): number[][] {\n const n = matrix.length\n const result: number[][] = []\n\n for (let i = 0; i < n; i++) {\n if (i !== row) {\n const minorRow: number[] = []\n for (let j = 0; j < n; j++) {\n if (j !== col) {\n minorRow.push(matrix[i]![j]!)\n }\n }\n result.push(minorRow)\n }\n }\n\n return result\n}\n","import { determinant } from './determinant'\nimport { minor } from './minor'\n\nexport function adjugate(matrix: number[][]): number[][] {\n const n = matrix.length\n const adj: number[][] = []\n for (let i = 0; i < n; i++) {\n adj[i] = []\n for (let j = 0; j < n; j++) {\n const min = minor(matrix, j, i)\n const sign = (-1) ** (i + j)\n const cofactor = sign * determinant(min)\n adj[i]![j] = cofactor\n }\n }\n return adj\n}\n","export function isSquare(matrix: number[][]): boolean {\n return matrix.length === matrix[0]!.length\n}\n","import { approxEqual, approxZero } from '../../../../utils'\nimport { isSquare } from './isSquare'\n\nexport function isIdentity(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const n = matrix.length\n\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < n; j++) {\n if (i === j) {\n if (!approxEqual(matrix[i]![j]!, 1)) {\n return false\n }\n }\n else {\n if (!approxZero(matrix[i]![j]!)) {\n return false\n }\n }\n }\n }\n\n return true\n}\n","/**\n * Performs cache-optimized matrix multiplication.\n * @param A The first input matrix (m x n)\n * @param B The second input matrix (n x p)\n * @returns The result matrix C (m x p) where C = A × B\n */\nexport function matrixMultiply(A: number[][], B: number[][]): number[][] {\n // Check if matrices can be multiplied\n if (A.length === 0 || B.length === 0 || A[0]!.length !== B.length) {\n throw new Error('Matrix dimensions do not match for multiplication')\n }\n\n const m = A.length // Number of rows in A\n const n = A[0]!.length // Number of columns in A / Number of rows in B\n const p = B[0]!.length // Number of columns in B\n\n // Initialize result matrix C with zeros\n const C: number[][] = (Array(m).fill(0) as number[]).map(() => Array(p).fill(0) as number[])\n\n // Perform multiplication with cache-optimized loop order (i-k-j)\n for (let i = 0; i < m; i++) {\n for (let k = 0; k < n; k++) {\n const aik = A[i]![k]! // Cache this value to avoid repeated lookups\n for (let j = 0; j < p; j++) {\n C[i]![j]! += aik * B[k]![j]!\n }\n }\n }\n\n return C\n}\n","import { LitsError } from '../../../errors'\nimport { assertMatrix, assertSquareMatrix, assertVector, isSquareMatrix } from '../../../typeGuards/annotatedArrays'\nimport { assertNumber } from '../../../typeGuards/number'\nimport { approxZero } from '../../../utils'\nimport { toFixedArity } from '../../../utils/arity'\nimport type { BuiltinNormalExpressions } from '../../../builtin/interface'\nimport type { LitsModule } from '../interface'\nimport { gaussJordanElimination } from '../linear-algebra/helpers/gaussJordanElimination'\nimport { moduleDocs } from './docs'\nimport { adjugate } from './helpers/adjugate'\nimport { band } from './helpers/band'\nimport { cofactor } from './helpers/cofactor'\nimport { determinant } from './helpers/determinant'\nimport { inverse } from './helpers/inverse'\nimport { isBanded } from './helpers/isBanded'\nimport { isDiagonal } from './helpers/isDiagonal'\nimport { isIdentity } from './helpers/isIdentity'\nimport { isOrthogonal } from './helpers/isOrthogonal'\nimport { isSquare } from './helpers/isSquare'\nimport { isSymetric } from './helpers/isSymetric'\nimport { isTriangular, isTriangularLower, isTriangularUpper } from './helpers/isTriangular'\nimport { matrixMultiply } from './helpers/matrixMultiply'\nimport { minor } from './helpers/minor'\nimport { norm1 } from './helpers/norm1'\nimport { trace } from './helpers/trace'\n\nexport const matrixNormalExpression: BuiltinNormalExpressions = {\n 'mul': {\n evaluate: ([matrix1, matrix2], sourceCodeInfo): number[][] => {\n assertMatrix(matrix1, sourceCodeInfo)\n assertMatrix(matrix2, sourceCodeInfo)\n try {\n return matrixMultiply(matrix1, matrix2)\n }\n catch (error) {\n throw new LitsError(`The number of columns in the first matrix must be equal to the number of rows in the second matrix, but got ${matrix1[0]!.length} and ${matrix2.length}`, sourceCodeInfo)\n }\n },\n arity: toFixedArity(2),\n },\n 'det': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return determinant(matrix)\n },\n arity: toFixedArity(1),\n },\n 'inv': {\n evaluate: ([matrix], sourceCodeInfo): number[][] => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n const result = inverse(matrix)\n if (result === null) {\n throw new LitsError('The matrix must be invertible', sourceCodeInfo)\n }\n return result\n },\n arity: toFixedArity(1),\n },\n 'adj': {\n evaluate: ([matrix], sourceCodeInfo): number[][] => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return adjugate(matrix)\n },\n arity: toFixedArity(1),\n },\n 'cofactor': {\n evaluate: ([matrix], sourceCodeInfo): number[][] => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return cofactor(matrix)\n },\n arity: toFixedArity(1),\n },\n 'minor': {\n evaluate: ([matrix, row, col], sourceCodeInfo): number[][] => {\n assertMatrix(matrix, sourceCodeInfo)\n assertNumber(row, sourceCodeInfo, { integer: true, nonNegative: true, lte: matrix.length })\n assertNumber(col, sourceCodeInfo, { integer: true, nonNegative: true, lte: matrix[0]!.length })\n\n return minor(matrix, row, col)\n },\n arity: toFixedArity(3),\n },\n 'trace': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertSquareMatrix(matrix, sourceCodeInfo)\n return trace(matrix)\n },\n arity: toFixedArity(1),\n },\n 'symmetric?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isSymetric(matrix)\n },\n arity: toFixedArity(1),\n },\n 'triangular?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isTriangular(matrix)\n },\n arity: toFixedArity(1),\n },\n 'upper-triangular?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isTriangularUpper(matrix)\n },\n arity: toFixedArity(1),\n },\n 'lower-triangular?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isTriangularLower(matrix)\n },\n arity: toFixedArity(1),\n },\n 'diagonal?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isDiagonal(matrix)\n },\n arity: toFixedArity(1),\n },\n 'square?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isSquare(matrix)\n },\n arity: toFixedArity(1),\n },\n 'orthogonal?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isOrthogonal(matrix)\n },\n arity: toFixedArity(1),\n },\n 'identity?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n return isIdentity(matrix)\n },\n arity: toFixedArity(1),\n },\n 'invertible?': {\n evaluate: ([matrix], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n if (!isSquareMatrix(matrix)) {\n return false\n }\n return !approxZero(determinant(matrix))\n },\n arity: toFixedArity(1),\n },\n 'hilbert': {\n evaluate: ([size], sourceCodeInfo): number[][] => {\n assertNumber(size, sourceCodeInfo, { integer: true, positive: true })\n const result: number[][] = []\n for (let i = 0; i < size; i += 1) {\n const row: number[] = []\n for (let j = 0; j < size; j += 1) {\n row.push(1 / (i + j + 1))\n }\n result.push(row)\n }\n return result\n },\n arity: toFixedArity(1),\n },\n 'vandermonde': {\n evaluate: ([vector], sourceCodeInfo): number[][] => {\n assertVector(vector, sourceCodeInfo)\n const result: number[][] = []\n for (let i = 0; i < vector.length; i += 1) {\n const row: number[] = []\n for (let j = 0; j < vector.length; j += 1) {\n row.push((vector[i]!) ** j)\n }\n result.push(row)\n }\n return result\n },\n arity: toFixedArity(1),\n },\n 'band': {\n evaluate: ([n, lband, uband], sourceCodeInfo): number[][] => {\n assertNumber(n, sourceCodeInfo, { integer: true, positive: true })\n assertNumber(lband, sourceCodeInfo, { integer: true, nonNegative: true, lt: n })\n assertNumber(uband, sourceCodeInfo, { integer: true, nonNegative: true, lte: n })\n return band(n, lband, uband)\n },\n arity: toFixedArity(3),\n },\n 'banded?': {\n evaluate: ([matrix, lband, uband], sourceCodeInfo): boolean => {\n assertMatrix(matrix, sourceCodeInfo)\n const maxBand = Math.max(matrix.length, matrix[0]!.length)\n assertNumber(lband, sourceCodeInfo, { integer: true, nonNegative: true, lt: maxBand })\n assertNumber(uband, sourceCodeInfo, { integer: true, nonNegative: true, lt: maxBand })\n return isBanded(matrix, lband, uband)\n },\n arity: toFixedArity(3),\n },\n 'rank': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n const [, result] = gaussJordanElimination(matrix)\n return result\n },\n arity: toFixedArity(1),\n },\n // Frobenius norm\n 'frobenius-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return Math.sqrt(matrix.reduce((sum, row) => sum + row.reduce((rowSum, cell) => rowSum + cell * cell, 0), 0))\n },\n arity: toFixedArity(1),\n },\n // one-norm (column norm)\n 'one-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return norm1(matrix)\n },\n arity: toFixedArity(1),\n },\n // Infinity norm\n 'inf-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return matrix.reduce((max, row) => Math.max(max, row.reduce((sum, cell) => sum + Math.abs(cell), 0)), 0)\n },\n arity: toFixedArity(1),\n },\n // Max norm\n 'max-norm': {\n evaluate: ([matrix], sourceCodeInfo): number => {\n assertMatrix(matrix, sourceCodeInfo)\n return matrix.reduce((maxVal, row) => {\n const rowMax = row.reduce((max, val) => Math.max(max, Math.abs(val)), 0)\n return Math.max(maxVal, rowMax)\n }, 0)\n },\n arity: toFixedArity(1),\n },\n}\n\nfor (const [key, docs] of Object.entries(moduleDocs)) {\n if (matrixNormalExpression[key])\n matrixNormalExpression[key].docs = docs\n}\n\nexport const matrixModule: LitsModule = {\n name: 'matrix',\n functions: matrixNormalExpression,\n}\n","/**\n * Calculate the inverse of a matrix using the adjugate method\n * @param matrix The input matrix\n * @returns The inverse matrix or null if the matrix is not invertible\n */\n\nimport { approxZero } from '../../../../utils'\nimport { adjugate } from './adjugate'\nimport { determinant } from './determinant'\n\nexport function inverse(matrix: number[][]): number[][] | null {\n const n = matrix.length\n\n // Special case for 1x1 matrix - handle it directly\n if (n === 1) {\n const element = matrix[0]![0]!\n if (approxZero(element)) {\n return null // Not invertible\n }\n return [[1 / element]]\n }\n\n // Calculate determinant\n const det = determinant(matrix)\n\n // Check if matrix is invertible\n if (approxZero(det)) {\n return null // Matrix is not invertible\n }\n\n // Get the adjugate matrix\n const adj = adjugate(matrix)\n\n // Calculate the inverse: inverse = adjugate / determinant\n const inverseMatrix: number[][] = []\n for (let i = 0; i < n; i++) {\n inverseMatrix[i] = []\n for (let j = 0; j < n; j++) {\n inverseMatrix[i]![j] = adj[i]![j]! / det\n }\n }\n\n return inverseMatrix\n}\n","import { determinant } from './determinant'\nimport { minor } from './minor'\n\nexport function cofactor(matrix: number[][]): number[][] {\n const n = matrix.length\n const cofactors: number[][] = []\n\n // Create a new matrix to store cofactors\n for (let i = 0; i < n; i++) {\n cofactors[i] = []\n for (let j = 0; j < n; j++) {\n // Get the minor by removing row i and column j\n const min = minor(matrix, i, j)\n const sign = (-1) ** (i + j)\n cofactors[i]![j] = sign * determinant(min)\n }\n }\n\n return cofactors\n}\n","/**\n * Calculates the trace of a square matrix.\n * The trace is defined as the sum of the elements on the main diagonal.\n *\n * @param matrix - A 2D array representing a square matrix.\n * @returns The trace of the matrix.\n */\nexport function trace(matrix: number[][]): number {\n return matrix.reduce((sum, row, i) => sum + row[i]!, 0)\n}\n","import { isSquare } from './isSquare'\n\n/**\n * Checks if a given matrix is symmetric.\n * A matrix is symmetric if it is square and its transpose is equal to itself.\n *\n * @param matrix - A 2D array representing the matrix.\n * @returns `true` if the matrix is symmetric, otherwise `false`.\n */\nexport function isSymetric(matrix: number[][]): boolean {\n const rows = matrix.length\n\n // Check if the matrix is square\n if (!isSquare(matrix)) {\n return false\n }\n\n // Check symmetry\n for (let i = 0; i < rows; i += 1) {\n for (let j = 0; j < i; j += 1) {\n if (matrix[i]![j]! !== matrix[j]![i]!) {\n return false\n }\n }\n }\n\n return true\n}\n","import { isSquare } from './isSquare'\n\n/**\n * Determines whether a given matrix is triangular.\n *\n * A triangular matrix is a square matrix where all elements\n * below or above the main diagonal are zero. This function\n * checks if the matrix is square and symmetric.\n *\n * @param matrix - A two-dimensional array of numbers representing the matrix.\n * @returns `true` if the matrix is triangular, otherwise `false`.\n */\nexport function isTriangular(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n\n const rows = matrix.length\n\n let isUpperTriangular = true\n let isLowerTriangular = true\n\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < rows; j++) {\n if (i > j && matrix[i]![j] !== 0) {\n isUpperTriangular = false\n if (!isLowerTriangular) {\n return false\n }\n }\n if (i < j && matrix[i]![j] !== 0) {\n isLowerTriangular = false\n }\n }\n }\n\n return isUpperTriangular || isLowerTriangular\n}\n\nexport function isTriangularUpper(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const rows = matrix.length\n\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < i; j++) {\n if (matrix[i]![j] !== 0) {\n return false\n }\n }\n }\n\n return true\n}\n\nexport function isTriangularLower(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const rows = matrix.length\n\n // Check if the matrix is square\n if (!matrix.every(row => row.length === rows)) {\n return false\n }\n\n for (let i = 0; i < rows; i++) {\n for (let j = i + 1; j < rows; j++) {\n if (matrix[i]![j] !== 0) {\n return false\n }\n }\n }\n\n return true\n}\n","import { isSquare } from './isSquare'\n\n/**\n * Checks if a given matrix is diagonal.\n *\n * A matrix is considered diagonal if it is square (i.e., the number of rows equals the number of columns)\n * and all elements outside the main diagonal are zero.\n *\n * @param matrix - A two-dimensional array of numbers representing the matrix to check.\n * @returns `true` if the matrix is diagonal, otherwise `false`.\n */\nexport function isDiagonal(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n const rows = matrix.length\n\n for (let i = 0; i < rows; i += 1) {\n for (let j = 0; j < rows; j += 1) {\n if (i !== j && matrix[i]![j] !== 0) {\n return false\n }\n }\n }\n\n return true\n}\n","import { transpose } from '../../../modules/grid/transpose'\nimport { matrixMultiply } from './matrixMultiply'\nimport { isIdentity } from './isIdentity'\nimport { isSquare } from './isSquare'\n\nexport function isOrthogonal(matrix: number[][]): boolean {\n if (!isSquare(matrix)) {\n return false\n }\n\n // Calculate matrix transpose\n const transposed = transpose(matrix)\n\n // Check if matrix * transpose = Identity\n const product = matrixMultiply(matrix, transposed)\n\n // Check if the product is an identity matrix\n return isIdentity(product)\n}\n","import type { Any } from '../../../interface'\n\nexport function transpose<T extends Any>(grid: T[][]): T[][] {\n const result: T[][] = []\n\n for (let i = 0; i < grid[0]!.length; i += 1) {\n const row: T[] = []\n for (let j = 0; j < grid.length; j += 1) {\n row.push(grid[j]![i]!)\n }\n result.push(row)\n }\n return result\n}\n","/**\n * Creates a band matrix with specified lower and upper bandwidths\n *\n * @param n Size of the square matrix\n * @param lband Lower bandwidth (number of non-zero diagonals below main diagonal)\n * @param uband Upper bandwidth (number of non-zero diagonals above main diagonal)\n * @returns A 2D array representing the band matrix with 1s in the band and 0s elsewhere\n */\nexport function band(n: number, lband: number, uband: number): number[][] {\n // Create an n×n matrix filled with zeros\n const matrix: number[][] = Array.from({ length: n }, () => Array.from({ length: n }, () => 0))\n\n // Fill the band with 1s\n for (let i = 0; i < n; i++) {\n for (let j = Math.max(0, i - lband); j <= Math.min(n - 1, i + uband); j++) {\n matrix[i]![j] = 1\n }\n }\n\n return matrix\n}\n","/**\n * Checks if a matrix is banded with the given lower and upper bandwidth.\n * A matrix is banded if all non-zero elements are within 'lower' diagonals\n * below the main diagonal and 'upper' diagonals above the main diagonal.\n *\n * @param matrix - The matrix to check, represented as a 2D array of numbers\n * @param lower - Number of non-zero diagonals below the main diagonal\n * @param upper - Number of non-zero diagonals above the main diagonal\n * @returns true if the matrix is banded with the given parameters, false otherwise\n */\nexport function isBanded(matrix: number[][], lower: number, upper: number): boolean {\n const rows = matrix.length\n const cols = matrix[0]!.length\n\n // Check each element in the matrix\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n // If we find a non-zero element outside the band, return false\n if (matrix[i]![j] !== 0 && (i - j > lower || j - i > upper)) {\n return false\n }\n }\n }\n\n // All elements outside the band are zero\n return true\n}\n","import { approxZero } from '../../../../utils'\n\n/**\n * Performs Gauss-Jordan elimination on a matrix, transforming it to reduced row echelon form\n *\n * @param matrix - The input matrix\n * @returns A tuple containing the reduced row echelon form matrix and the rank\n */\nexport function gaussJordanElimination(matrix: number[][]): [number[][], number] {\n // Create a copy of the matrix to avoid modifying the original\n const m = matrix.map(row => [...row])\n const rows = m.length\n const cols = m[0]!.length\n\n let rank = 0\n let rowsProcessed = 0\n\n // Row reduction to reduced row echelon form\n for (let col = 0; col < cols; col++) {\n // Find the pivot\n let pivotRow = -1\n\n for (let row = rowsProcessed; row < rows; row++) {\n if (!approxZero(m[row]![col]!)) {\n pivotRow = row\n break\n }\n }\n\n if (pivotRow === -1)\n continue // No pivot in this column\n\n // Increase rank\n rank += 1\n\n // Swap rows\n if (pivotRow !== rowsProcessed) {\n [m[pivotRow], m[rowsProcessed]] = [m[rowsProcessed]!, m[pivotRow]!]\n }\n\n // Get the pivot value\n const pivotValue = m[rowsProcessed]![col]!\n\n // Normalize the pivot row (always, for RREF)\n for (let j = col; j < cols; j++) {\n m[rowsProcessed]![j]! /= pivotValue\n }\n\n // Eliminate above and below (full Gauss-Jordan)\n for (let row = 0; row < rows; row++) {\n if (row !== rowsProcessed && !approxZero(m[row]![col]!)) {\n const factor = m[row]![col]!\n for (let j = col; j < cols; j++) {\n m[row]![j]! -= factor * m[rowsProcessed]![j]!\n }\n }\n }\n\n rowsProcessed++\n if (rowsProcessed === rows)\n break\n }\n\n return [m, rank]\n}\n","// Assuming a matrix is represented as a 2D array\nexport function norm1(matrix: number[][]): number {\n const numRows = matrix.length\n const numCols = matrix[0]!.length\n\n let maxColSum = 0\n\n // Iterate through each column\n for (let j = 0; j < numCols; j += 1) {\n let colSum = 0\n\n // Sum the absolute values of all elements in this column\n for (let i = 0; i < numRows; i += 1) {\n colSum += Math.abs(matrix[i]![j]!)\n }\n\n // Update the maximum column sum if necessary\n maxColSum = Math.max(maxColSum, colSum)\n }\n\n return maxColSum\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","LitsError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getLitsErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","isLitsFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","anyValue","getSourceCodeInfo","annotatedArrays","WeakSet","vectors","notVectors","matrices","notMatrices","grids","assertVector","vector","every","elem","add","isVector","isMatrix","matrix","nbrOfCols","row","some","cell","assertMatrix","assertSquareMatrix","approxEqual","a","b","epsilon","diff","abs","approxZero","toFixedArity","arity","min","moduleDocs","mul","category","description","returns","args","variants","argumentNames","examples","seeAlso","det","m","inv","adj","cofactor","minor","col","trace","hilbert","n","vandermonde","v","band","lband","uband","rank","determinant","A","i","maxRow","j","factor","k","result","minorRow","push","adjugate","isSquare","isIdentity","matrixMultiply","B","p","C","fill","map","aik","matrixNormalExpression","evaluate","matrix1","matrix2","error","element","inverseMatrix","inverse","cofactors","reduce","sum","rows","isSymetric","isUpperTriangular","isLowerTriangular","isTriangular","isTriangularUpper","isTriangularLower","isDiagonal","grid","transpose","isOrthogonal","isSquareMatrix","size","from","maxBand","lower","upper","cols","isBanded","rowsProcessed","pivotRow","pivotValue","gaussJordanElimination","sqrt","rowSum","numRows","numCols","maxColSum","colSum","norm1","maxVal","rowMax","val","docs","entries","matrixModule","functions"],"mappings":"aAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAkBC,MACbX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA6BD,EAAiBf,GAC5C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIjB,EAAeE,SACbH,EAAcC,IAExC,CAoBUoB,CAAoBL,EAASf,IACnCqB,KAAKT,aAAeG,EACpBM,KAAKrB,eAAiBA,EACtBsB,OAAOC,eAAeF,KAAMX,EAAUc,WACtCH,KAAKI,KAAO,WACb,CAEM,aAAA1B,GACL,OAAOsB,KAAKrB,gBAAkBD,EAAcsB,KAAKrB,eAClD,EC5CI,MAAM0B,EAAY,CACvBC,OAAQ,EACRC,OAAQ,EACRC,iBAAkB,EAClBC,kBAAmB,EACnBC,kBAAmB,EACnBC,oBAAqB,EACrBC,qBAAsB,EACtBC,eAAgB,EAChBC,QAAS,EACTC,OAAQ,IAGJC,EAAe,IAAIC,IAAIhB,OAAOiB,OAAOb,IAa3C,MAgBMc,EAAkB,IAAIF,IAhBN,CACpB,cACA,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