numbl 0.3.0 → 0.4.0

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 (403) hide show
  1. package/binding.gyp +17 -33
  2. package/dist-cli/cli.js +61511 -46223
  3. package/dist-lib/graphics/types.d.ts +22 -0
  4. package/dist-lib/lib.js +37582 -22275
  5. package/dist-lib/numbl-core/executeCode.d.ts +11 -16
  6. package/dist-lib/numbl-core/executors/cache.d.ts +26 -0
  7. package/dist-lib/numbl-core/executors/classification.d.ts +134 -0
  8. package/dist-lib/numbl-core/executors/context.d.ts +76 -0
  9. package/dist-lib/numbl-core/executors/handleInline.d.ts +42 -0
  10. package/dist-lib/numbl-core/executors/index.d.ts +14 -0
  11. package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +35 -0
  12. package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +31 -0
  13. package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +29 -0
  14. package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +45 -0
  15. package/dist-lib/numbl-core/executors/jit/compileC.d.ts +51 -0
  16. package/dist-lib/numbl-core/executors/jit/compileC.node.d.ts +25 -0
  17. package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +27 -0
  18. package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +41 -0
  19. package/dist-lib/numbl-core/executors/jit/session.d.ts +17 -0
  20. package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +36 -0
  21. package/dist-lib/numbl-core/executors/jit/typeAdapter.d.ts +28 -0
  22. package/dist-lib/numbl-core/executors/jit/typeAdapterC.d.ts +73 -0
  23. package/dist-lib/numbl-core/executors/jit/valueAdapter.d.ts +48 -0
  24. package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +108 -0
  25. package/dist-lib/numbl-core/executors/lowering.d.ts +120 -0
  26. package/dist-lib/numbl-core/executors/plugins.d.ts +32 -0
  27. package/dist-lib/numbl-core/executors/registry.d.ts +148 -0
  28. package/dist-lib/numbl-core/executors/types.d.ts +103 -0
  29. package/dist-lib/numbl-core/functionResolve.d.ts +7 -0
  30. package/dist-lib/numbl-core/helpers/check-helpers.d.ts +4 -5
  31. package/dist-lib/numbl-core/helpers/linsolve.d.ts +2 -3
  32. package/dist-lib/numbl-core/helpers/prng.d.ts +1 -2
  33. package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +4 -1
  34. package/dist-lib/numbl-core/interpreter/builtins/datetime.d.ts +2 -1
  35. package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +1 -1
  36. package/dist-lib/numbl-core/interpreter/builtins/misc.d.ts +4 -1
  37. package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +4 -109
  38. package/dist-lib/numbl-core/interpreter/interpreter.d.ts +51 -49
  39. package/dist-lib/numbl-core/interpreter/interpreterExec.d.ts +6 -0
  40. package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
  41. package/dist-lib/numbl-core/interpreter/types.d.ts +27 -12
  42. package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +43 -0
  43. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +123 -0
  44. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/minus.d.ts +2 -0
  45. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/mpower.d.ts +12 -0
  46. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/mrdivide.d.ts +5 -0
  47. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/mtimes.d.ts +2 -0
  48. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/plus.d.ts +2 -0
  49. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/power.d.ts +30 -0
  50. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/rdivide.d.ts +2 -0
  51. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/times.d.ts +2 -0
  52. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/uminus.d.ts +2 -0
  53. package/dist-lib/numbl-core/jit/builtins/defs/compare/_compare.d.ts +12 -0
  54. package/dist-lib/numbl-core/jit/builtins/defs/compare/eq.d.ts +2 -0
  55. package/dist-lib/numbl-core/jit/builtins/defs/compare/ge.d.ts +2 -0
  56. package/dist-lib/numbl-core/jit/builtins/defs/compare/gt.d.ts +2 -0
  57. package/dist-lib/numbl-core/jit/builtins/defs/compare/le.d.ts +2 -0
  58. package/dist-lib/numbl-core/jit/builtins/defs/compare/lt.d.ts +2 -0
  59. package/dist-lib/numbl-core/jit/builtins/defs/compare/ne.d.ts +2 -0
  60. package/dist-lib/numbl-core/jit/builtins/defs/diag/assert.d.ts +6 -0
  61. package/dist-lib/numbl-core/jit/builtins/defs/io/_format_args.d.ts +17 -0
  62. package/dist-lib/numbl-core/jit/builtins/defs/io/disp.d.ts +2 -0
  63. package/dist-lib/numbl-core/jit/builtins/defs/io/error.d.ts +2 -0
  64. package/dist-lib/numbl-core/jit/builtins/defs/io/fprintf.d.ts +2 -0
  65. package/dist-lib/numbl-core/jit/builtins/defs/io/sprintf.d.ts +2 -0
  66. package/dist-lib/numbl-core/jit/builtins/defs/io/warning.d.ts +15 -0
  67. package/dist-lib/numbl-core/jit/builtins/defs/logical/_shortcircuit.d.ts +30 -0
  68. package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +30 -0
  69. package/dist-lib/numbl-core/jit/builtins/defs/logical/and.d.ts +5 -0
  70. package/dist-lib/numbl-core/jit/builtins/defs/logical/andand.d.ts +1 -0
  71. package/dist-lib/numbl-core/jit/builtins/defs/logical/boolconst.d.ts +3 -0
  72. package/dist-lib/numbl-core/jit/builtins/defs/logical/classBuiltin.d.ts +21 -0
  73. package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +15 -0
  74. package/dist-lib/numbl-core/jit/builtins/defs/logical/isa.d.ts +13 -0
  75. package/dist-lib/numbl-core/jit/builtins/defs/logical/iscell.d.ts +8 -0
  76. package/dist-lib/numbl-core/jit/builtins/defs/logical/isempty.d.ts +2 -0
  77. package/dist-lib/numbl-core/jit/builtins/defs/logical/isequal.d.ts +2 -0
  78. package/dist-lib/numbl-core/jit/builtins/defs/logical/isfield.d.ts +20 -0
  79. package/dist-lib/numbl-core/jit/builtins/defs/logical/isinf.d.ts +2 -0
  80. package/dist-lib/numbl-core/jit/builtins/defs/logical/isnan.d.ts +1 -0
  81. package/dist-lib/numbl-core/jit/builtins/defs/logical/isnumeric.d.ts +7 -0
  82. package/dist-lib/numbl-core/jit/builtins/defs/logical/isreal.d.ts +2 -0
  83. package/dist-lib/numbl-core/jit/builtins/defs/logical/isscalar.d.ts +20 -0
  84. package/dist-lib/numbl-core/jit/builtins/defs/logical/isstruct.d.ts +7 -0
  85. package/dist-lib/numbl-core/jit/builtins/defs/logical/logical.d.ts +1 -0
  86. package/dist-lib/numbl-core/jit/builtins/defs/logical/not.d.ts +15 -0
  87. package/dist-lib/numbl-core/jit/builtins/defs/logical/or.d.ts +11 -0
  88. package/dist-lib/numbl-core/jit/builtins/defs/logical/oror.d.ts +1 -0
  89. package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +21 -0
  90. package/dist-lib/numbl-core/jit/builtins/defs/logical/typequery.d.ts +10 -0
  91. package/dist-lib/numbl-core/jit/builtins/defs/logical/xor.d.ts +12 -0
  92. package/dist-lib/numbl-core/jit/builtins/defs/math/_complex_fold.d.ts +34 -0
  93. package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +51 -0
  94. package/dist-lib/numbl-core/jit/builtins/defs/math/abs.d.ts +7 -0
  95. package/dist-lib/numbl-core/jit/builtins/defs/math/angle.d.ts +7 -0
  96. package/dist-lib/numbl-core/jit/builtins/defs/math/asinh.d.ts +1 -0
  97. package/dist-lib/numbl-core/jit/builtins/defs/math/atan.d.ts +1 -0
  98. package/dist-lib/numbl-core/jit/builtins/defs/math/atan2.d.ts +3 -0
  99. package/dist-lib/numbl-core/jit/builtins/defs/math/besselh.d.ts +2 -0
  100. package/dist-lib/numbl-core/jit/builtins/defs/math/ceil.d.ts +4 -0
  101. package/dist-lib/numbl-core/jit/builtins/defs/math/conj.d.ts +7 -0
  102. package/dist-lib/numbl-core/jit/builtins/defs/math/constants.d.ts +7 -0
  103. package/dist-lib/numbl-core/jit/builtins/defs/math/cos.d.ts +1 -0
  104. package/dist-lib/numbl-core/jit/builtins/defs/math/cosh.d.ts +1 -0
  105. package/dist-lib/numbl-core/jit/builtins/defs/math/dot.d.ts +20 -0
  106. package/dist-lib/numbl-core/jit/builtins/defs/math/double.d.ts +28 -0
  107. package/dist-lib/numbl-core/jit/builtins/defs/math/exp.d.ts +1 -0
  108. package/dist-lib/numbl-core/jit/builtins/defs/math/fix.d.ts +4 -0
  109. package/dist-lib/numbl-core/jit/builtins/defs/math/floor.d.ts +4 -0
  110. package/dist-lib/numbl-core/jit/builtins/defs/math/hypot.d.ts +3 -0
  111. package/dist-lib/numbl-core/jit/builtins/defs/math/imag.d.ts +7 -0
  112. package/dist-lib/numbl-core/jit/builtins/defs/math/linspace.d.ts +6 -0
  113. package/dist-lib/numbl-core/jit/builtins/defs/math/log.d.ts +4 -0
  114. package/dist-lib/numbl-core/jit/builtins/defs/math/log10.d.ts +3 -0
  115. package/dist-lib/numbl-core/jit/builtins/defs/math/log2.d.ts +5 -0
  116. package/dist-lib/numbl-core/jit/builtins/defs/math/logspace.d.ts +8 -0
  117. package/dist-lib/numbl-core/jit/builtins/defs/math/mod.d.ts +1 -0
  118. package/dist-lib/numbl-core/jit/builtins/defs/math/norm.d.ts +2 -0
  119. package/dist-lib/numbl-core/jit/builtins/defs/math/real.d.ts +7 -0
  120. package/dist-lib/numbl-core/jit/builtins/defs/math/rem.d.ts +3 -0
  121. package/dist-lib/numbl-core/jit/builtins/defs/math/round.d.ts +1 -0
  122. package/dist-lib/numbl-core/jit/builtins/defs/math/sign.d.ts +5 -0
  123. package/dist-lib/numbl-core/jit/builtins/defs/math/sin.d.ts +1 -0
  124. package/dist-lib/numbl-core/jit/builtins/defs/math/sinh.d.ts +1 -0
  125. package/dist-lib/numbl-core/jit/builtins/defs/math/sqrt.d.ts +11 -0
  126. package/dist-lib/numbl-core/jit/builtins/defs/math/tan.d.ts +1 -0
  127. package/dist-lib/numbl-core/jit/builtins/defs/math/tanh.d.ts +1 -0
  128. package/dist-lib/numbl-core/jit/builtins/defs/math/uniquetol.d.ts +22 -0
  129. package/dist-lib/numbl-core/jit/builtins/defs/plot/dispatch.d.ts +6 -0
  130. package/dist-lib/numbl-core/jit/builtins/defs/reduction/_cumulative.d.ts +49 -0
  131. package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +126 -0
  132. package/dist-lib/numbl-core/jit/builtins/defs/reduction/_variance.d.ts +17 -0
  133. package/dist-lib/numbl-core/jit/builtins/defs/reduction/all.d.ts +1 -0
  134. package/dist-lib/numbl-core/jit/builtins/defs/reduction/any.d.ts +1 -0
  135. package/dist-lib/numbl-core/jit/builtins/defs/reduction/cummax.d.ts +1 -0
  136. package/dist-lib/numbl-core/jit/builtins/defs/reduction/cummin.d.ts +1 -0
  137. package/dist-lib/numbl-core/jit/builtins/defs/reduction/cumprod.d.ts +1 -0
  138. package/dist-lib/numbl-core/jit/builtins/defs/reduction/cumsum.d.ts +1 -0
  139. package/dist-lib/numbl-core/jit/builtins/defs/reduction/diff.d.ts +16 -0
  140. package/dist-lib/numbl-core/jit/builtins/defs/reduction/length.d.ts +2 -0
  141. package/dist-lib/numbl-core/jit/builtins/defs/reduction/max.d.ts +1 -0
  142. package/dist-lib/numbl-core/jit/builtins/defs/reduction/mean.d.ts +1 -0
  143. package/dist-lib/numbl-core/jit/builtins/defs/reduction/min.d.ts +1 -0
  144. package/dist-lib/numbl-core/jit/builtins/defs/reduction/numel.d.ts +2 -0
  145. package/dist-lib/numbl-core/jit/builtins/defs/reduction/prod.d.ts +1 -0
  146. package/dist-lib/numbl-core/jit/builtins/defs/reduction/std.d.ts +1 -0
  147. package/dist-lib/numbl-core/jit/builtins/defs/reduction/sum.d.ts +1 -0
  148. package/dist-lib/numbl-core/jit/builtins/defs/reduction/var.d.ts +1 -0
  149. package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +67 -0
  150. package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +34 -0
  151. package/dist-lib/numbl-core/jit/builtins/defs/shape/cat.d.ts +33 -0
  152. package/dist-lib/numbl-core/jit/builtins/defs/shape/diag.d.ts +29 -0
  153. package/dist-lib/numbl-core/jit/builtins/defs/shape/eye.d.ts +5 -0
  154. package/dist-lib/numbl-core/jit/builtins/defs/shape/flip.d.ts +7 -0
  155. package/dist-lib/numbl-core/jit/builtins/defs/shape/meshgrid.d.ts +12 -0
  156. package/dist-lib/numbl-core/jit/builtins/defs/shape/ones.d.ts +1 -0
  157. package/dist-lib/numbl-core/jit/builtins/defs/shape/repmat.d.ts +37 -0
  158. package/dist-lib/numbl-core/jit/builtins/defs/shape/reshape.d.ts +39 -0
  159. package/dist-lib/numbl-core/jit/builtins/defs/shape/size.d.ts +20 -0
  160. package/dist-lib/numbl-core/jit/builtins/defs/shape/sort.d.ts +19 -0
  161. package/dist-lib/numbl-core/jit/builtins/defs/shape/transpose.d.ts +6 -0
  162. package/dist-lib/numbl-core/jit/builtins/defs/shape/tril.d.ts +16 -0
  163. package/dist-lib/numbl-core/jit/builtins/defs/shape/triu.d.ts +16 -0
  164. package/dist-lib/numbl-core/jit/builtins/defs/shape/zeros.d.ts +1 -0
  165. package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +20 -0
  166. package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +36 -0
  167. package/dist-lib/numbl-core/jit/builtins/defs/system/pathBuiltins.d.ts +4 -0
  168. package/dist-lib/numbl-core/jit/builtins/defs/system/tic.d.ts +8 -0
  169. package/dist-lib/numbl-core/jit/builtins/defs/system/toc.d.ts +5 -0
  170. package/dist-lib/numbl-core/jit/builtins/index.d.ts +16 -0
  171. package/dist-lib/numbl-core/jit/builtins/registry.d.ts +138 -0
  172. package/dist-lib/numbl-core/jit/builtins/runtime/cell/cell.d.ts +24 -0
  173. package/dist-lib/numbl-core/jit/builtins/runtime/indexing/loop_count.d.ts +1 -0
  174. package/dist-lib/numbl-core/jit/builtins/runtime/indexing/range_value.d.ts +1 -0
  175. package/dist-lib/numbl-core/jit/builtins/runtime/indexing/scalar_index.d.ts +11 -0
  176. package/dist-lib/numbl-core/jit/builtins/runtime/indexing/tensor_make_range.d.ts +5 -0
  177. package/dist-lib/numbl-core/jit/builtins/runtime/io/assert_fmt.d.ts +1 -0
  178. package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_complex.d.ts +1 -0
  179. package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_double.d.ts +1 -0
  180. package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_struct.d.ts +1 -0
  181. package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_tensor.d.ts +1 -0
  182. package/dist-lib/numbl-core/jit/builtins/runtime/io/disp_tensor_complex.d.ts +1 -0
  183. package/dist-lib/numbl-core/jit/builtins/runtime/io/error_fmt.d.ts +2 -0
  184. package/dist-lib/numbl-core/jit/builtins/runtime/io/format_complex.d.ts +1 -0
  185. package/dist-lib/numbl-core/jit/builtins/runtime/io/format_double.d.ts +1 -0
  186. package/dist-lib/numbl-core/jit/builtins/runtime/io/format_engine.d.ts +1 -0
  187. package/dist-lib/numbl-core/jit/builtins/runtime/io/fprintf.d.ts +1 -0
  188. package/dist-lib/numbl-core/jit/builtins/runtime/io/sprintf.d.ts +5 -0
  189. package/dist-lib/numbl-core/jit/builtins/runtime/io/warning_fmt.d.ts +2 -0
  190. package/dist-lib/numbl-core/jit/builtins/runtime/plot/plot_dispatch.d.ts +1 -0
  191. package/dist-lib/numbl-core/jit/builtins/runtime/snippets.gen.d.ts +86 -0
  192. package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  193. package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +103 -0
  194. package/dist-lib/numbl-core/jit/builtins/runtime/system/deep_clone.d.ts +1 -0
  195. package/dist-lib/numbl-core/jit/builtins/runtime/system/isequal.d.ts +2 -0
  196. package/dist-lib/numbl-core/jit/builtins/runtime/system/tictoc.d.ts +5 -0
  197. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor.d.ts +6 -0
  198. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc.d.ts +5 -0
  199. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_complex.d.ts +6 -0
  200. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd.d.ts +5 -0
  201. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd_complex.d.ts +6 -0
  202. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_copy_complex.d.ts +6 -0
  203. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix.d.ts +5 -0
  204. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix_complex.d.ts +6 -0
  205. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_row.d.ts +5 -0
  206. package/dist-lib/numbl-core/jit/builtins/runtime/tensor/tensor_from_row_complex.d.ts +6 -0
  207. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cat.d.ts +11 -0
  208. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cumulative.d.ts +32 -0
  209. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diag.d.ts +33 -0
  210. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diff.d.ts +5 -0
  211. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_dot.d.ts +16 -0
  212. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_complex.d.ts +90 -0
  213. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real.d.ts +75 -0
  214. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +95 -0
  215. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_eye.d.ts +10 -0
  216. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_nd.d.ts +11 -0
  217. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_square.d.ts +5 -0
  218. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_flip.d.ts +11 -0
  219. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_linspace.d.ts +5 -0
  220. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logical_real.d.ts +10 -0
  221. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logspace.d.ts +5 -0
  222. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_meshgrid.d.ts +29 -0
  223. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_complex.d.ts +10 -0
  224. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_real.d.ts +6 -0
  225. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_norm.d.ts +4 -0
  226. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_nd.d.ts +5 -0
  227. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_square.d.ts +5 -0
  228. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_predicate.d.ts +42 -0
  229. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_complex.d.ts +53 -0
  230. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +42 -0
  231. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_repmat.d.ts +11 -0
  232. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd.d.ts +5 -0
  233. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd_complex.d.ts +6 -0
  234. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_size.d.ts +5 -0
  235. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_sort_real.d.ts +36 -0
  236. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose.d.ts +5 -0
  237. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose_complex.d.ts +6 -0
  238. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_triangular.d.ts +22 -0
  239. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_complex_math.d.ts +128 -0
  240. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +95 -0
  241. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_uniquetol.d.ts +5 -0
  242. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_var.d.ts +12 -0
  243. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_nd.d.ts +5 -0
  244. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_square.d.ts +5 -0
  245. package/dist-lib/numbl-core/jit/builtins/runtime/text/strcmp.d.ts +2 -0
  246. package/dist-lib/numbl-core/jit/codegen/cFormat.d.ts +36 -0
  247. package/dist-lib/numbl-core/jit/codegen/cHelpers.d.ts +48 -0
  248. package/dist-lib/numbl-core/jit/codegen/emit.d.ts +55 -0
  249. package/dist-lib/numbl-core/jit/codegen/emitCellTypedef.d.ts +23 -0
  250. package/dist-lib/numbl-core/jit/codegen/emitExpr.d.ts +33 -0
  251. package/dist-lib/numbl-core/jit/codegen/emitIndex.d.ts +56 -0
  252. package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +64 -0
  253. package/dist-lib/numbl-core/jit/codegen/emitNamedTypedef.d.ts +58 -0
  254. package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +76 -0
  255. package/dist-lib/numbl-core/jit/codegen/emitTensorConcat.d.ts +23 -0
  256. package/dist-lib/numbl-core/jit/codegen/emitTensorConcatJs.d.ts +16 -0
  257. package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +77 -0
  258. package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +66 -0
  259. package/dist-lib/numbl-core/jit/codegen/liveness.d.ts +58 -0
  260. package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +24 -0
  261. package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +150 -0
  262. package/dist-lib/numbl-core/jit/compileSpec.d.ts +84 -0
  263. package/dist-lib/numbl-core/jit/compileSpecC.d.ts +93 -0
  264. package/dist-lib/numbl-core/jit/index.d.ts +13 -5
  265. package/dist-lib/numbl-core/jit/lowering/classDefs.d.ts +109 -0
  266. package/dist-lib/numbl-core/jit/lowering/errors.d.ts +35 -0
  267. package/dist-lib/numbl-core/jit/lowering/indexFold.d.ts +31 -0
  268. package/dist-lib/numbl-core/jit/lowering/indexResolve.d.ts +100 -0
  269. package/dist-lib/numbl-core/jit/lowering/ir.d.ts +584 -0
  270. package/dist-lib/numbl-core/jit/lowering/lower.d.ts +271 -0
  271. package/dist-lib/numbl-core/jit/lowering/lowerCellIndex.d.ts +41 -0
  272. package/dist-lib/numbl-core/jit/lowering/lowerCellLit.d.ts +19 -0
  273. package/dist-lib/numbl-core/jit/lowering/lowerClassConstructor.d.ts +55 -0
  274. package/dist-lib/numbl-core/jit/lowering/lowerFuncCall.d.ts +34 -0
  275. package/dist-lib/numbl-core/jit/lowering/lowerHandle.d.ts +57 -0
  276. package/dist-lib/numbl-core/jit/lowering/lowerIndexLoad.d.ts +16 -0
  277. package/dist-lib/numbl-core/jit/lowering/lowerIndexSlice.d.ts +29 -0
  278. package/dist-lib/numbl-core/jit/lowering/lowerIndexSliceStore.d.ts +19 -0
  279. package/dist-lib/numbl-core/jit/lowering/lowerIndexStore.d.ts +14 -0
  280. package/dist-lib/numbl-core/jit/lowering/lowerMethodCall.d.ts +45 -0
  281. package/dist-lib/numbl-core/jit/lowering/lowerMultiAssign.d.ts +36 -0
  282. package/dist-lib/numbl-core/jit/lowering/lowerTensorLit.d.ts +25 -0
  283. package/dist-lib/numbl-core/jit/lowering/rangeCount.d.ts +19 -0
  284. package/dist-lib/numbl-core/jit/lowering/specialize.d.ts +93 -0
  285. package/dist-lib/numbl-core/jit/lowering/types.d.ts +503 -0
  286. package/dist-lib/numbl-core/jit/lowering/walk.d.ts +17 -0
  287. package/dist-lib/numbl-core/jit/numbl/index.d.ts +30 -0
  288. package/dist-lib/numbl-core/jit/parser/astUtils.d.ts +43 -0
  289. package/dist-lib/numbl-core/jit/parser/index.d.ts +12 -0
  290. package/dist-lib/numbl-core/jit/parser/sourceLoc.d.ts +12 -0
  291. package/dist-lib/numbl-core/jit/runtime/context.d.ts +23 -0
  292. package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +10 -0
  293. package/dist-lib/numbl-core/jit/runtime/value.d.ts +101 -0
  294. package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +59 -0
  295. package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +62 -0
  296. package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +243 -0
  297. package/dist-lib/numbl-core/jitTypes.d.ts +94 -0
  298. package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -2
  299. package/dist-lib/numbl-core/lowering/loweringContext.d.ts +24 -0
  300. package/dist-lib/numbl-core/native/lapack-bridge.d.ts +3 -3
  301. package/dist-lib/numbl-core/parser/ClassParser.d.ts +3 -0
  302. package/dist-lib/numbl-core/parser/types.d.ts +20 -0
  303. package/dist-lib/numbl-core/runtime/alloc.d.ts +12 -23
  304. package/dist-lib/numbl-core/runtime/constructors.d.ts +6 -6
  305. package/dist-lib/numbl-core/runtime/cow.d.ts +33 -0
  306. package/dist-lib/numbl-core/runtime/index.d.ts +4 -3
  307. package/dist-lib/numbl-core/runtime/indexing.d.ts +17 -2
  308. package/dist-lib/numbl-core/runtime/plotBuiltinDispatch.d.ts +86 -0
  309. package/dist-lib/numbl-core/runtime/plotUtils.d.ts +17 -2
  310. package/dist-lib/numbl-core/runtime/refcount.d.ts +85 -0
  311. package/dist-lib/numbl-core/runtime/runtime.d.ts +43 -67
  312. package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +2 -2
  313. package/dist-lib/numbl-core/runtime/runtimeIndexing.d.ts +2 -2
  314. package/dist-lib/numbl-core/runtime/runtimeMemberAccess.d.ts +1 -1
  315. package/dist-lib/numbl-core/runtime/runtimePlot.d.ts +1 -0
  316. package/dist-lib/numbl-core/runtime/struct-access.d.ts +2 -1
  317. package/dist-lib/numbl-core/runtime/types.d.ts +117 -62
  318. package/dist-lib/numbl-core/runtime/utils.d.ts +2 -8
  319. package/dist-lib/numbl-core/version.d.ts +1 -1
  320. package/dist-lib/numbl-core/workspace/types.d.ts +8 -0
  321. package/dist-plot-viewer/assets/index-COAM8o1E.js +4426 -0
  322. package/dist-plot-viewer/index.html +1 -1
  323. package/dist-site-viewer/404.html +33 -0
  324. package/dist-site-viewer/assets/index-CgBUy7v7.js +4748 -0
  325. package/dist-site-viewer/assets/index-D5YY8PKx.css +1 -0
  326. package/dist-site-viewer/assets/numbl-worker-VkVtodCX.js +11836 -0
  327. package/dist-site-viewer/coi-serviceworker.js +70 -0
  328. package/dist-site-viewer/favicon.svg +23 -0
  329. package/dist-site-viewer/index.html +16 -0
  330. package/dist-site-viewer/logo.svg +26 -0
  331. package/dist-site-viewer/numbl-embed.js +111 -0
  332. package/dist-site-viewer/vite.svg +1 -0
  333. package/native/lapack_linsolve.cpp +1 -1
  334. package/native/numbl_addon_common.h +2 -2
  335. package/native/ops/comparison.c +1 -1
  336. package/native/ops/real_unary_elemwise.c +3 -1
  337. package/package.json +16 -13
  338. package/dist-lib/numbl-core/jit/c/abi.d.ts +0 -90
  339. package/dist-lib/numbl-core/jit/c/assemble.d.ts +0 -56
  340. package/dist-lib/numbl-core/jit/c/classify.d.ts +0 -70
  341. package/dist-lib/numbl-core/jit/c/compile.d.ts +0 -37
  342. package/dist-lib/numbl-core/jit/c/context.d.ts +0 -152
  343. package/dist-lib/numbl-core/jit/c/emit/assign.d.ts +0 -20
  344. package/dist-lib/numbl-core/jit/c/emit/complexScalar.d.ts +0 -18
  345. package/dist-lib/numbl-core/jit/c/emit/fused.d.ts +0 -42
  346. package/dist-lib/numbl-core/jit/c/emit/helpers.d.ts +0 -40
  347. package/dist-lib/numbl-core/jit/c/emit/index.d.ts +0 -14
  348. package/dist-lib/numbl-core/jit/c/emit/scalar.d.ts +0 -23
  349. package/dist-lib/numbl-core/jit/c/emit/stmt.d.ts +0 -25
  350. package/dist-lib/numbl-core/jit/c/emit/tensor.d.ts +0 -127
  351. package/dist-lib/numbl-core/jit/c/emit/userCall.d.ts +0 -58
  352. package/dist-lib/numbl-core/jit/c/epilogue.d.ts +0 -26
  353. package/dist-lib/numbl-core/jit/c/feasibility.d.ts +0 -44
  354. package/dist-lib/numbl-core/jit/c/prelude.d.ts +0 -37
  355. package/dist-lib/numbl-core/jit/c/visit.d.ts +0 -63
  356. package/dist-lib/numbl-core/jit/e1/complexKernelEmit.d.ts +0 -46
  357. package/dist-lib/numbl-core/jit/e1/hash.d.ts +0 -10
  358. package/dist-lib/numbl-core/jit/e1/install.d.ts +0 -13
  359. package/dist-lib/numbl-core/jit/e1/kernelEmit.d.ts +0 -54
  360. package/dist-lib/numbl-core/jit/e1/multiReductionKernel.d.ts +0 -66
  361. package/dist-lib/numbl-core/jit/e1/openmpFlag.d.ts +0 -13
  362. package/dist-lib/numbl-core/jit/e1/scalarFnKernel.d.ts +0 -44
  363. package/dist-lib/numbl-core/jit/e2/assignKernel.d.ts +0 -34
  364. package/dist-lib/numbl-core/jit/e2/astToJitExpr.d.ts +0 -25
  365. package/dist-lib/numbl-core/jit/e2/cache.d.ts +0 -80
  366. package/dist-lib/numbl-core/jit/e2/chainKernelEmit.d.ts +0 -55
  367. package/dist-lib/numbl-core/jit/e2/classify.d.ts +0 -119
  368. package/dist-lib/numbl-core/jit/e2/compileFn.d.ts +0 -16
  369. package/dist-lib/numbl-core/jit/e2/complexChainKernelEmit.d.ts +0 -79
  370. package/dist-lib/numbl-core/jit/e2/emitShared.d.ts +0 -71
  371. package/dist-lib/numbl-core/jit/e2/install.d.ts +0 -11
  372. package/dist-lib/numbl-core/jit/e2/liveness.d.ts +0 -29
  373. package/dist-lib/numbl-core/jit/e2/loopKernel.d.ts +0 -49
  374. package/dist-lib/numbl-core/jit/e2/loopKernelEmit.d.ts +0 -75
  375. package/dist-lib/numbl-core/jit/e2/multiReductionDriver.d.ts +0 -24
  376. package/dist-lib/numbl-core/jit/e2/reductionKernelEmit.d.ts +0 -72
  377. package/dist-lib/numbl-core/jit/e2/scalarFnDriver.d.ts +0 -29
  378. package/dist-lib/numbl-core/jit/fusedChainHelpers.d.ts +0 -65
  379. package/dist-lib/numbl-core/jit/fusedScalarEmit.d.ts +0 -69
  380. package/dist-lib/numbl-core/jit/fusion.d.ts +0 -71
  381. package/dist-lib/numbl-core/jit/fusionOps.d.ts +0 -25
  382. package/dist-lib/numbl-core/jit/heavyOps.d.ts +0 -15
  383. package/dist-lib/numbl-core/jit/jitBailSafety.d.ts +0 -41
  384. package/dist-lib/numbl-core/jit/jitLoop.d.ts +0 -25
  385. package/dist-lib/numbl-core/jit/jitLoopAnalysis.d.ts +0 -37
  386. package/dist-lib/numbl-core/jit/jitLower.d.ts +0 -122
  387. package/dist-lib/numbl-core/jit/jitLowerExpr.d.ts +0 -27
  388. package/dist-lib/numbl-core/jit/jitLowerStmt.d.ts +0 -9
  389. package/dist-lib/numbl-core/jit/jitLowerTypes.d.ts +0 -29
  390. package/dist-lib/numbl-core/jit/jitTopLevel.d.ts +0 -22
  391. package/dist-lib/numbl-core/jit/jitTypes.d.ts +0 -394
  392. package/dist-lib/numbl-core/jit/js/jitCodegen.d.ts +0 -7
  393. package/dist-lib/numbl-core/jit/js/jitCodegenHoist.d.ts +0 -70
  394. package/dist-lib/numbl-core/jit/js/jitHelpers.d.ts +0 -34
  395. package/dist-lib/numbl-core/jit/js/jitHelpersComplex.d.ts +0 -21
  396. package/dist-lib/numbl-core/jit/js/jitHelpersIndex.d.ts +0 -33
  397. package/dist-lib/numbl-core/jit/js/jitHelpersTensor.d.ts +0 -34
  398. package/dist-lib/numbl-core/jit/js/jsFusedCodegen.d.ts +0 -17
  399. package/dist-lib/numbl-core/jit/js/jsMultiReduction.d.ts +0 -70
  400. package/dist-lib/numbl-core/jit/scalarEmit.d.ts +0 -58
  401. package/dist-plot-viewer/assets/index-GiUNnMQg.js +0 -4426
  402. package/native/jit_runtime/jit_runtime.c +0 -261
  403. package/native/jit_runtime/jit_runtime.h +0 -204
@@ -0,0 +1,2 @@
1
+ import type { Builtin } from "../../registry.js";
2
+ export declare const numel: Builtin;
@@ -0,0 +1 @@
1
+ export declare const prod: import("../../registry.js").Builtin;
@@ -0,0 +1 @@
1
+ export declare const stdBuiltin: import("../../registry.js").Builtin;
@@ -0,0 +1 @@
1
+ export declare const sum: import("../../registry.js").Builtin;
@@ -0,0 +1 @@
1
+ export declare const varBuiltin: import("../../registry.js").Builtin;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared infrastructure for the rank-N constructor builtins
3
+ * (`zeros`, `ones`). Each call site supplies 1..MTOC2_MAX_NDIM scalar
4
+ * real shape arguments. Each dim arg is either statically-known
5
+ * (`exact` set on its NumericType) or dynamic (a runtime scalar
6
+ * `double`); both are accepted. MATLAB's `zeros(n)` / `ones(n)`
7
+ * one-arg form means an n×n square — codegen routes the dynamic
8
+ * variant through `mtoc2_tensor_<kind>_square` so the dim expression
9
+ * is evaluated exactly once.
10
+ *
11
+ * When every dim is exact the transfer can compute the shape (and
12
+ * sometimes the fill data); when any dim is dynamic the result type
13
+ * is built via `tensorDoubleFromDims` so the unknown axes propagate
14
+ * through the type lattice unchanged.
15
+ *
16
+ * Codegen always emits a runtime call:
17
+ * - all-exact dims: `mtoc2_tensor_<kind>_nd(<N>, (long[]){<lit>,…})`
18
+ * - dynamic single-arg square form:
19
+ * `mtoc2_tensor_<kind>_square((long)(<arg>))`
20
+ * - dynamic multi-arg form:
21
+ * `mtoc2_tensor_<kind>_nd(<N>, (long[]){<lit-or-cast>,…})`
22
+ *
23
+ * The element cap (8 = MTOC2_MAX_NDIM) is enforced at the source side
24
+ * too; the runtime helper aborts beyond that, but raising at lowering
25
+ * time gives a proper span.
26
+ */
27
+ import type { Builtin, InlineSnippet } from "../../registry.js";
28
+ /** Runtime dim validation for the interpreter-shim `call` path —
29
+ * mirrors the emitted `mtoc2_check_dim` and the interpreter's
30
+ * `validateDim`: reject non-finite / non-integer, clamp negative to 0. */
31
+ export declare function checkDimRuntime(x: number): number;
32
+ /** Runtime dim validator shared by both backends. Mirrors the
33
+ * interpreter's `validateDim` (interpreter/builtins/array-construction.ts):
34
+ * a non-finite or non-integer size is an error, a negative size clamps
35
+ * to 0 (empty axis). A dynamic dim previously truncated silently
36
+ * (`(long)` / `Math.trunc`), so `zeros(1, 3.7)` built a 1×3 instead of
37
+ * raising. */
38
+ export declare const CHECK_DIM_SNIPPET: InlineSnippet;
39
+ /** Options for `defineShapeConstructor`. When `cFillValue` is set, the
40
+ * factory builds a "parameterized fill" constructor: the runtime
41
+ * helpers are invoked with `cFillValue` as their first arg
42
+ * (`mtoc2_tensor_fill_nd(v, ndim, dims)` style) and the scalar-
43
+ * collapse emit uses `cFillValue` verbatim. This is the path used by
44
+ * the non-finite constants (`nan`/`NaN`/`Inf`/`inf`), where the JS
45
+ * number's `toString` ("NaN" / "Infinity") doesn't round-trip to
46
+ * valid C. When `cFillValue` is undefined, the factory keeps the
47
+ * original zeros/ones contract: helpers take `(ndim, dims)` only
48
+ * and scalar collapse emits a JS-derived literal. */
49
+ interface ShapeConstructorOpts {
50
+ /** Inclusive lower bound on argument count. Defaults to 1 (zeros /
51
+ * ones don't accept the 0-arg form). Set to 0 by callers that
52
+ * combine a scalar-constant 0-arg branch with the shape
53
+ * constructor (the constants in `math/constants.ts`); the
54
+ * combined builtin's transfer/codegen pre-dispatches 0 args
55
+ * before delegating to this factory's transfer/codegen. */
56
+ minArgs?: number;
57
+ /** When set, prepend this C expression as the first arg of every
58
+ * helper call and emit it directly for the scalar-collapse case.
59
+ * Required when `fillValue` is non-finite (NaN/Infinity). */
60
+ cFillValue?: string;
61
+ }
62
+ /** Build a `zeros` / `ones` / fill-style shape-constructor builtin.
63
+ * `fillValue` is the constant the output is filled with at the
64
+ * type level (Float64Array). See `ShapeConstructorOpts.cFillValue`
65
+ * for the per-helper invocation contract. */
66
+ export declare function defineShapeConstructor(name: string, fillValue: number, ndHelper: string, squareHelper: string, opts?: ShapeConstructorOpts): Builtin;
67
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared logic for `triu` / `tril` — the two builtins differ only by
3
+ * the keep-predicate (column - row vs. row - column) and the runtime
4
+ * helper they dispatch to. This module centralizes:
5
+ *
6
+ * - argument validation (1..2 args, real-double tensor, k literal int)
7
+ * - `transfer` (exact-fold when input data fits)
8
+ * - hooks builders (emitC / emitJs / call) parameterized by the
9
+ * family-specific predicate + runtime helper.
10
+ *
11
+ * Mirrors `triPart` in numbl's
12
+ * `interpreter/builtins/array-extras.ts`. Real and complex inputs
13
+ * both supported; sparse inputs and rank > 2 are deferred / rejected.
14
+ */
15
+ import type { Builtin } from "../../registry.js";
16
+ import type { RuntimeTensor } from "../../../runtime/value.js";
17
+ import { mtoc2_tensor_triu as jsTriu, mtoc2_tensor_tril as jsTril, mtoc2_tensor_triu_complex as jsTriuComplex, mtoc2_tensor_tril_complex as jsTrilComplex } from "../../runtime/snippets.gen.js";
18
+ interface TriangularSpec {
19
+ /** Source-level name (registry key). */
20
+ name: string;
21
+ /** C runtime helper name for real-input (e.g. `"mtoc2_tensor_triu"`). */
22
+ cHelper: string;
23
+ /** C runtime helper name for complex-input
24
+ * (e.g. `"mtoc2_tensor_triu_complex"`). */
25
+ cHelperComplex: string;
26
+ /** Keep predicate matching numbl's `triPart` (column-major i,j). */
27
+ keep(i: number, j: number, k: number): boolean;
28
+ /** JS-side helper for real input. */
29
+ jsHelper: (a: RuntimeTensor, k: number) => unknown;
30
+ /** JS-side helper for complex input. */
31
+ jsHelperComplex: (a: RuntimeTensor, k: number) => unknown;
32
+ }
33
+ export declare function defineTriangular(spec: TriangularSpec): Builtin;
34
+ export { jsTriu, jsTril, jsTriuComplex, jsTrilComplex };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `cat` builtin — concatenate N tensors along a given dimension.
3
+ *
4
+ * Surface: `cat(dim, A, B, ...)` where `dim >= 1` is a statically-known
5
+ * positive integer literal (dynamic dims are deferred). Mirrors numbl's
6
+ * `cat` (and the underlying `catAlongDim` in
7
+ * `numbl/runtime/tensor-construction.ts`):
8
+ *
9
+ * - dim==1 → vertical concat (along rows). Equivalent to `[A; B]`.
10
+ * - dim==2 → horizontal concat (along cols). Equivalent to `[A B]`.
11
+ * - dim>=3 → grow a new outer axis; result is N-D.
12
+ *
13
+ * Discipline:
14
+ * - Every non-dim arg must be numeric (double or logical), real
15
+ * or complex. Any complex input contaminates the result to
16
+ * complex (real inputs flow through with `imag = 0` lanes).
17
+ * - Scalar args are treated as 1×1 tensors (matching numbl).
18
+ * - Empty inputs along the cat axis are dropped at runtime. A zero-
19
+ * element input also drops when its non-cat dims don't match the
20
+ * reference shape (the asymmetric MATLAB rule).
21
+ * - All inputs must agree on every non-cat axis; the result extent
22
+ * along the cat axis is the sum of input extents.
23
+ *
24
+ * Exact-folding: when every input has statically-known shape and exact
25
+ * data, and the result fits `EXACT_ARRAY_MAX_ELEMENTS`, the result is
26
+ * computed at transfer time.
27
+ *
28
+ * Codegen dispatches to `mtoc2_tensor_cat(dim, nin, xs)` (a single
29
+ * runtime helper that accepts a tagged-arg array — see
30
+ * `tensor_cat.h`).
31
+ */
32
+ import type { Builtin } from "../../registry.js";
33
+ export declare const cat: Builtin;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `diag` builtin — matrix-diagonal extract / vector-to-diagonal
3
+ * construct.
4
+ *
5
+ * diag(v) — vector (1×N or N×1) ⇒ N×N matrix with v on the
6
+ * main diagonal, zeros elsewhere.
7
+ * diag(A) — 2-D matrix (neither dim ≡ 1) ⇒ min(M,N)×1 column
8
+ * vector of the main diagonal.
9
+ * diag(v, k) — k-th super-/sub-diagonal. `k` must be a
10
+ * statically-known integer literal. `k > 0` is
11
+ * super-, `k < 0` is sub-diagonal.
12
+ * diag(scalar) — pass-through (matches numbl's 1+|k| sizing
13
+ * with k=0).
14
+ * diag(scalar, k≠0) — (|k|+1)×(|k|+1) matrix with the scalar at
15
+ * the k-th diagonal position.
16
+ *
17
+ * Mirrors numbl's `diag` tensor-branch in
18
+ * `interpreter/builtins/array-manipulation.ts`. Real and complex
19
+ * inputs both supported (complex routes through `*_diag_*_complex`
20
+ * runtime helpers); the sparse-matrix branch is N/A (mtoc2 has no
21
+ * sparse type).
22
+ *
23
+ * Input shape must be statically known (matches numbl's eager
24
+ * dispatch on rows/cols), and `k` must be statically known so the
25
+ * result shape is decidable at lowering time. Both restrictions can
26
+ * be relaxed later.
27
+ */
28
+ import type { Builtin } from "../../registry.js";
29
+ export declare const diag: Builtin;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * `eye(n)` and `eye(m, n)` — 2-D identity matrices.
3
+ */
4
+ import type { Builtin } from "../../registry.js";
5
+ export declare const eye: Builtin;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `flipud`, `fliplr`, `flip` — axis-flip builtins.
3
+ */
4
+ import type { Builtin } from "../../registry.js";
5
+ export declare const flipud: Builtin;
6
+ export declare const fliplr: Builtin;
7
+ export declare const flip: Builtin;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `meshgrid` — 2-D coordinate grid builder.
3
+ *
4
+ * Forms supported:
5
+ * - `[X, Y] = meshgrid(x, y)` — `x` length M, `y` length N.
6
+ * Returns X (N×M, each row = x) and
7
+ * Y (N×M, each column = y).
8
+ * - `[X, Y] = meshgrid(x)` — shorthand for `meshgrid(x, x)`.
9
+ * - `Z = meshgrid(x, y)` / `Z = meshgrid(x)` — returns just X.
10
+ */
11
+ import type { Builtin } from "../../registry.js";
12
+ export declare const meshgrid: Builtin;
@@ -0,0 +1 @@
1
+ export declare const ones: import("../../registry.js").Builtin;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * `repmat` builtin. Surface forms (mirrors numbl's
3
+ * array-manipulation `repmat`):
4
+ *
5
+ * repmat(A, n) — `n×n` tile (single scalar rep → square)
6
+ * repmat(A, m, n, ...) — Form A: variadic scalar reps per axis
7
+ * repmat(A, [m n p ...]) — Form B: dim-vector reps (must be static)
8
+ *
9
+ * Discipline:
10
+ * - A may be a scalar or a tensor of double / logical / complex
11
+ * elements. Complex inputs route through `mtoc2_tensor_repmat_complex`
12
+ * (or `_fill_nd_complex` for scalar A).
13
+ * - Each rep arg is a scalar real double; statically-known finite
14
+ * integers pin the corresponding output axis, dynamic scalars leave
15
+ * that axis as `unknown` in the result lattice.
16
+ * - Form B requires the dim vector to be a statically-known constant
17
+ * (no runtime-vector reps in v1).
18
+ * - Negative reps clamp to 0 (matching numbl/MATLAB), which yields an
19
+ * empty axis at runtime. Statically-known negatives propagate
20
+ * through the type system as 0 too.
21
+ * - Output shape is `padShape[i] * padReps[i]` where the input's
22
+ * shape and the reps vector are both right-padded with 1s to a
23
+ * common rank. There's one numbl quirk we replicate: scalar input
24
+ * with a single-element Form B vector (`repmat(5, [3])`) produces
25
+ * an `n×n` square instead of a 1-D vector.
26
+ *
27
+ * Codegen:
28
+ * - Scalar input: emit `mtoc2_tensor_fill_nd(<val>, ndim, dims)`
29
+ * directly — no need to build a 1×1 tensor first.
30
+ * - Tensor input: emit `mtoc2_tensor_repmat(<in>, ndim, dims)`.
31
+ *
32
+ * Exact-data folding: when the input is exact and the reps are exact,
33
+ * the transfer computes the tiled data and pins it on the result type
34
+ * (subject to the EXACT_ARRAY_MAX_ELEMENTS cap).
35
+ */
36
+ import type { Builtin } from "../../registry.js";
37
+ export declare const repmat: Builtin;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * `reshape` builtin. Two surface forms:
3
+ *
4
+ * Form A — variadic scalar dims: reshape(A, d1, d2, …, dN)
5
+ * Form B — vector of dims: reshape(A, [d1, d2, …, dN])
6
+ *
7
+ * Discipline (mirrors numbl's array-manipulation `reshape`):
8
+ * - 1 ≤ N ≤ MTOC2_MAX_NDIM (8). Trailing-singletons are stripped
9
+ * down to a 2-axis minimum (numbl:
10
+ * `while (s.length>2 && s.last===1) s.pop()`), then padded back
11
+ * up to 2 axes if N=1 was given (mtoc2 represents every tensor
12
+ * as min-2D).
13
+ * - Form A — each `di` is a scalar real double; statically-known
14
+ * finite non-negative integers pin the corresponding axis, and
15
+ * dynamic scalars (no `exact`) leave the axis as `unknown` in
16
+ * the result lattice.
17
+ * - Form B — the dim vector must be a statically-known
18
+ * `Float64Array` of dims (runtime vectors are not yet supported).
19
+ * - Form A allows at most one `[]` auto-infer slot. The translator
20
+ * fills it from `numel(A)` / `prod(other dims)` when both are
21
+ * known statically, else codegen passes `-1L` to
22
+ * `mtoc2_reshape_nd` which computes the slot at runtime. Form B
23
+ * still rejects the placeholder (the dim vector itself must be a
24
+ * static constant; a single `[]` inside the bracket is ambiguous).
25
+ * - Input `A` must be a real numeric (scalar or tensor); complex /
26
+ * handle / struct / class / void / string rejected with TypeError.
27
+ * - Element-count check at transfer time when the input shape and
28
+ * every new dim are statically known; deferred to the runtime
29
+ * helper otherwise.
30
+ *
31
+ * Codegen routes through the per-op runtime helper `mtoc2_reshape_nd`
32
+ * (declared in `src/codegen/runtime/tensor_reshape_nd.h`), which
33
+ * already accepts a runtime `(int ndim, const long *dims)` pair plus
34
+ * an optional `-1L` auto-infer sentinel. The result is freshly owned,
35
+ * so the standard ANF / scope-exit-free pipeline carries it without
36
+ * changes.
37
+ */
38
+ import type { Builtin } from "../../registry.js";
39
+ export declare const reshape: Builtin;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `size` builtin.
3
+ *
4
+ * Three forms supported in mtoc2 v1:
5
+ *
6
+ * - `size(A)` → 1×ndim row tensor of dim sizes.
7
+ * - `size(A, k)` → scalar (k-th dim, 1-based).
8
+ * - `[d1, d2, ...] → one scalar per requested output. Each output
9
+ * = size(A)` slot i (0-based) returns `A.dims[i]` when
10
+ * i < ndim and 1 otherwise — matches numbl,
11
+ * which does NOT collapse trailing dims into
12
+ * the last output (unlike MATLAB).
13
+ *
14
+ * Multi-output combined with the `dim` arg is rejected — numbl
15
+ * silently drops the extra outputs in that combo (leaves them
16
+ * unset), and matching that behavior would leak undefined values
17
+ * into mtoc2's typed env.
18
+ */
19
+ import type { Builtin } from "../../registry.js";
20
+ export declare const size: Builtin;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `sort` — stable sort with optional 'ascend' / 'descend' mode arg.
3
+ *
4
+ * Supported forms in v1:
5
+ * - `b = sort(a)` — ascending
6
+ * - `b = sort(a, 'ascend' | 'descend')` — explicit mode
7
+ * - `[v, i] = sort(...)` — values + 1-based positions
8
+ *
9
+ * Real and complex inputs both supported. Complex sort orders by
10
+ * magnitude (then phase as tiebreak), matching numbl / MATLAB.
11
+ *
12
+ * `dim` arg and `sort(a, dim, mode)` form are out of scope for v1 —
13
+ * the runtime helper walks the flat column-major buffer and the
14
+ * type system restricts inputs to 1×N / N×1 vectors. The descending
15
+ * comparator preserves the stable tie-break (ascending original
16
+ * index) in both directions, matching numbl.
17
+ */
18
+ import type { Builtin } from "../../registry.js";
19
+ export declare const sort: Builtin;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `transpose` builtin — backs the `.'` operator. Conjugate `'` on a
3
+ * complex input lowers to `transpose(conj(z))`.
4
+ */
5
+ import type { Builtin } from "../../registry.js";
6
+ export declare const transpose: Builtin;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `tril(A [, k])` — lower triangular part of a matrix around the k-th
3
+ * diagonal. Keeps entries where `i - j >= -k` (equivalently
4
+ * `j - i <= k`), zeros the rest.
5
+ *
6
+ * tril(A) ≡ tril(A, 0): zero everything strictly above the main
7
+ * diagonal.
8
+ * tril(A, k) with `k > 0` widens the kept block upward by `k`
9
+ * super-diagonals; `k < 0` narrows it (kept band
10
+ * starts `|k|` below the main diagonal).
11
+ *
12
+ * `k` must be a statically-known integer literal. Real and complex
13
+ * inputs both supported; rank > 2 is deferred with `UnsupportedConstruct`.
14
+ * Mirrors numbl's `tril` in `interpreter/builtins/array-extras.ts`.
15
+ */
16
+ export declare const tril: import("../../registry.js").Builtin;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `triu(A [, k])` — upper triangular part of a matrix around the k-th
3
+ * diagonal. Keeps entries where `j - i >= k`, zeros the rest.
4
+ *
5
+ * triu(A) ≡ triu(A, 0): zero everything strictly below the main
6
+ * diagonal.
7
+ * triu(A, k) with `k > 0` shifts the kept band upward (kept block
8
+ * starts at the k-th super-diagonal); `k < 0` shifts
9
+ * downward (kept block extends into the |k| sub-
10
+ * diagonals).
11
+ *
12
+ * `k` must be a statically-known integer literal. Real and complex
13
+ * inputs both supported; rank > 2 is deferred with `UnsupportedConstruct`.
14
+ * Mirrors numbl's `triu` in `interpreter/builtins/array-extras.ts`.
15
+ */
16
+ export declare const triu: import("../../registry.js").Builtin;
@@ -0,0 +1 @@
1
+ export declare const zeros: import("../../registry.js").Builtin;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `deal` — multi-output passthrough.
3
+ *
4
+ * [a, b, c] = deal(x, y, z) → a=x, b=y, c=z (N-arg form)
5
+ * [a, b, c] = deal(x) → a=x, b=x, c=x (broadcast form)
6
+ * a = deal(x) → x
7
+ *
8
+ * Numbl's rule (the dialect oracle): single-input broadcasts to any
9
+ * `nargout >= 1`; otherwise `args.length` must equal `nargout` or
10
+ * it's a runtime error. mtoc2 lifts the equality check into
11
+ * `transfer` so the mismatch is a type-time error.
12
+ *
13
+ * The result types are the input types as-is. The c-aot backend
14
+ * still has to emit `_copy(...)` for owned types to satisfy the
15
+ * "freshly-owned at every consume site" invariant; the js-aot
16
+ * backend uses `mtoc2_deep_clone` for the same reason; the
17
+ * interpreter follows numbl and deep-clones owned values too.
18
+ */
19
+ import type { Builtin } from "../../registry.js";
20
+ export declare const deal: Builtin;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * feval(handle_or_name, args...) — invoke a function handle (or a
3
+ * function named by a char) with the given args.
4
+ *
5
+ * Implementation strategy:
6
+ *
7
+ * The c-aot / js-aot backends cannot route through a builtin
8
+ * emitC / emitJs hook because invoking a user function requires
9
+ * specialization (the target's mangled C name is created at
10
+ * lowering time, with the actual arg types) — information a
11
+ * builtin emit hook doesn't have access to. So the lowerer
12
+ * intercepts `feval(...)` in `lowerFuncCall` and
13
+ * `lowerMultiAssign` and rewrites it to a direct call on the
14
+ * underlying handle / function name (see `tryLowerFevalCall` in
15
+ * `src/lowering/lowerFuncCall.ts`). Once the rewrite fires, the
16
+ * builtin's emit hooks are never reached.
17
+ *
18
+ * The interpreter parallels this with a special-case in
19
+ * `callByName` (next to the existing `struct` / `cell`
20
+ * special-cases) — it consumes args[0] as a handle or char,
21
+ * dispatches via `callHandle` or recursively via `callByName`,
22
+ * and threads `nargout` through. Once that fires, this builtin's
23
+ * `call` hook is unreachable.
24
+ *
25
+ * This file therefore exists primarily to:
26
+ * - keep `feval` in `allBuiltinNames()` for syntax highlighting
27
+ * and the `@feval` rejection path,
28
+ * - validate arity / argument shape via `transfer` as a safety
29
+ * net if a future codepath bypasses the lowerer / interpreter
30
+ * interception.
31
+ *
32
+ * All four hooks raise `UnsupportedConstruct` with a message
33
+ * pointing the reader at where the real implementation lives.
34
+ */
35
+ import type { Builtin } from "../../registry.js";
36
+ export declare const feval: Builtin;
@@ -0,0 +1,4 @@
1
+ import type { Builtin } from "../../registry.js";
2
+ export declare const addpath: Builtin;
3
+ export declare const rmpath: Builtin;
4
+ export declare const savepath: Builtin;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * tic — start the wall-clock stopwatch.
3
+ *
4
+ * Returns the start time in seconds (matches numbl: `performance.now()
5
+ * / 1000`).
6
+ */
7
+ import type { Builtin } from "../../registry.js";
8
+ export declare const tic: Builtin;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * toc — read the elapsed wall-clock seconds since `tic`.
3
+ */
4
+ import type { Builtin } from "../../registry.js";
5
+ export declare const toc: Builtin;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Builtins package. Each builtin lives in its own file and is registered
3
+ * here via `registerBuiltin`. Public API:
4
+ *
5
+ * - `getBuiltin(name)` / `allBuiltinNames()` for runtime lookup.
6
+ * - `binaryOpBuiltin(op)` / `unaryOpBuiltin(op)` to map AST operator
7
+ * enums to builtin names.
8
+ *
9
+ * See `registry.ts` for the `Builtin` interface and the registry itself.
10
+ */
11
+ import type { Span } from "../parser/index.js";
12
+ import { BinaryOperation, UnaryOperation } from "../parser/index.js";
13
+ export type { Builtin } from "./registry.js";
14
+ export { registerBuiltin, getBuiltin, allBuiltinNames } from "./registry.js";
15
+ export declare function binaryOpBuiltin(op: BinaryOperation, span: Span): string;
16
+ export declare function unaryOpBuiltin(op: UnaryOperation, span: Span): string;
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Builtin registry — the contract every mtoc2 builtin (and future
3
+ * user `.mtoc2.js` function) implements.
4
+ *
5
+ * Each builtin can supply up to three mirrored hooks plus the
6
+ * always-required `transfer`:
7
+ *
8
+ * transfer(argTypes, nargout) — required. Given input types and
9
+ * the number of outputs the call site wants, return one Type
10
+ * per output. When every input is exact, set `exact` on the
11
+ * returned type(s) so the lowerer can key specialization on the
12
+ * value (and fold `if` conditions). Throws plain `Error` /
13
+ * `TypeError` / `UnsupportedConstruct` on bad input — no source
14
+ * span; the framework attaches the call-site span via `withSpan`.
15
+ *
16
+ * emitC({argsC, argTypes, nargout, outArgsC?, useRuntime}) —
17
+ * optional. C codegen. Returns the full string ready to splice
18
+ * into the surrounding context:
19
+ * - nargout=1: a C expression (`(a + b)`,
20
+ * `mtoc2_tensor_plus_tt(a, b)`)
21
+ * - nargout≥2: a full call including out-pointer args
22
+ * (`mtoc2_sort_real_2(a, &v, &i)`). `outArgsC` holds those
23
+ * pre-built `&v`, `&i` strings in the order the call site
24
+ * requested.
25
+ * Activate any runtime snippets this emit-output references by
26
+ * calling `useRuntime(name)`.
27
+ *
28
+ * emitJs({argsJs, argTypes, nargout, outTargetsJs?, useRuntime}) —
29
+ * optional. JS codegen. Returns a JS expression (or call
30
+ * sequence) ready to splice. Multi-output calls receive
31
+ * `outTargetsJs` pre-built as `o1`, `o2`, … the secondary
32
+ * outputs land in these locals via the framework's destructuring
33
+ * wrapper. Activates JS-side runtime snippets via `useRuntime`.
34
+ *
35
+ * call({args, argTypes, nargout, ctx}) — optional. Direct JS
36
+ * function used by the interpreter and as a JIT bailout target.
37
+ * Returns one runtime value per output slot. The args shape
38
+ * mirrors the emit hooks' shape so dispatch on `argTypes` /
39
+ * `nargout` stays parallel across all three.
40
+ *
41
+ * elementwise? — when true, every defined emit hook (and `call`)
42
+ * must also produce a correct scalar output when called with
43
+ * scalar argTypes and scalar argsC/argsJs/args. The framework
44
+ * uses this for same-shape tensor fusion (and, later, broadcast
45
+ * / reduction-inner / mask / stencil fusion). Absence = "do not
46
+ * fuse me; use the regular emit on the full tensor types."
47
+ *
48
+ * Each backend selector requires the matching hook to be defined on
49
+ * every builtin in the call's transitive reach; the framework
50
+ * computes the maximum compatible backend per call site.
51
+ */
52
+ import type { Type } from "../lowering/types.js";
53
+ import type { RuntimeValue } from "../runtime/value.js";
54
+ import type { RuntimeContext } from "../runtime/context.js";
55
+ /** Common across every hook — the type-level call descriptor. */
56
+ interface CommonArgs {
57
+ /** Per-arg type (after lowering / inference). */
58
+ argTypes: Type[];
59
+ /** Number of outputs requested at the call site. */
60
+ nargout: number;
61
+ }
62
+ export interface EmitCArgs extends CommonArgs {
63
+ /** Per-arg C expression. In fused contexts this is scalar form
64
+ * (e.g. `<var>.real[i]`); in the regular path it's whatever the
65
+ * framework's `emitExpr` produced. */
66
+ argsC: string[];
67
+ /** Out-pointer C expressions for multi-output calls (length =
68
+ * nargout when nargout≥2; otherwise undefined). The framework
69
+ * pre-builds these as `&v`, `&i`, … so `emit` just splices them
70
+ * in. */
71
+ outArgsC?: string[];
72
+ /** Activate a runtime C snippet on the current translation unit.
73
+ * See `runtime.ts` for the registry and `InlineSnippet` for the
74
+ * user-supplied form. */
75
+ useRuntime(spec: string | InlineSnippet): void;
76
+ }
77
+ export interface EmitJsArgs extends CommonArgs {
78
+ /** Per-arg JS expression. */
79
+ argsJs: string[];
80
+ /** Out-target JS expressions for multi-output calls. The
81
+ * framework pre-builds these as `o1`, `o2`, … and destructures
82
+ * the call's return into them. Length equals `nargout-1` when
83
+ * `nargout≥2` (the primary output is the expression's value).
84
+ * Undefined for `nargout≤1`. */
85
+ outTargetsJs?: string[];
86
+ /** Activate a JS-side runtime snippet. Snippets are inlined once
87
+ * per build at the top of the emitted module, so the call site
88
+ * invokes them by bare name. Mirrors the C-side `useRuntime` —
89
+ * same registry, paired `.h`/`.js` source files. An `InlineSnippet`
90
+ * (with a `jsCode` body) defines a one-off helper from a builtin. */
91
+ useRuntime(spec: string | InlineSnippet): void;
92
+ }
93
+ export interface CallArgs extends CommonArgs {
94
+ /** Per-arg runtime values, evaluated by the interpreter at the
95
+ * call site. */
96
+ args: RuntimeValue[];
97
+ /** Host bag — `helpers.write` for stdout, future hooks for plot /
98
+ * error / time. */
99
+ ctx: RuntimeContext;
100
+ }
101
+ export interface Builtin {
102
+ /** Source-level name (registry key). */
103
+ name: string;
104
+ /** Required: output Type per output slot. Pure — safe to invoke
105
+ * as a probe (the framework calls this for bare-identifier 0-arg
106
+ * detection). */
107
+ transfer(argTypes: Type[], nargout: number): Type[];
108
+ /** Optional: C codegen. */
109
+ emitC?(args: EmitCArgs): string;
110
+ /** Optional: JS codegen. */
111
+ emitJs?(args: EmitJsArgs): string;
112
+ /** Optional: direct JS function — interpreter / JIT bailout. */
113
+ call?(args: CallArgs): RuntimeValue[];
114
+ /** Elementwise = result is computed pointwise. */
115
+ elementwise?: boolean;
116
+ }
117
+ /** Inline-defined runtime snippet supplied by a user `.mtoc2.js`
118
+ * builtin's `emitC` / `emitJs`. Re-exported from `runtime.ts` — kept
119
+ * here for doc-locality with the `Builtin` contract. */
120
+ export interface InlineSnippet {
121
+ name: string;
122
+ /** C body (required for `emitC` consumers; ignored on the JS path). */
123
+ code: string;
124
+ /** Optional JS body (required for `emitJs` consumers). */
125
+ jsCode?: string;
126
+ headers?: ReadonlyArray<string>;
127
+ deps?: ReadonlyArray<string>;
128
+ }
129
+ export declare function registerBuiltin(b: Builtin): void;
130
+ export declare function getBuiltin(name: string): Builtin | undefined;
131
+ /** Names of every registered builtin. Drives Monaco syntax highlighting. */
132
+ export declare function allBuiltinNames(): readonly string[];
133
+ export type Backend = "c" | "js" | "interpreter";
134
+ export declare function builtinSupports(b: Builtin, backend: Backend): boolean;
135
+ export declare function requireEmitC(b: Builtin): (args: EmitCArgs) => string;
136
+ export declare function requireEmitJs(b: Builtin): (args: EmitJsArgs) => string;
137
+ export declare function requireCall(b: Builtin): (args: CallArgs) => RuntimeValue[];
138
+ export {};
@@ -0,0 +1,24 @@
1
+ /** Construct a cell from a flat slot list (column-major) and a shape.
2
+ * Caller has already produced fresh slot values (deep_clone'd where
3
+ * the slot was an owned alias), so we simply build the wrapper. */
4
+ export function mtoc2_cell_make(slots: any, shape: any): {
5
+ mtoc2Tag: string;
6
+ shape: any;
7
+ data: any;
8
+ };
9
+ /** `cell(n)` / `cell(n, m)` / `cell(n, m, k, ...)`. The 1-arg square
10
+ * form has already been expanded to two dim args at lowering time so
11
+ * this helper is dim-symmetric.
12
+ *
13
+ * Each axis is coerced to a non-negative integer (matching numbl —
14
+ * `Math.floor` then clamp at 0). The slot count is the dim product;
15
+ * each slot is the empty-double sentinel. */
16
+ export function mtoc2_cell_empty(dims: any): {
17
+ mtoc2Tag: string;
18
+ shape: any;
19
+ data: any[];
20
+ };
21
+ /** Format a cell value to match numbl's `formatCell` byte-for-byte:
22
+ * `{e1, e2, ...}` with chars in `'...'`, strings in `"..."`, other
23
+ * values via `formatValue`. Empty cell renders as `{}`. */
24
+ export function mtoc2_format_cell(c: any): string;
@@ -0,0 +1 @@
1
+ export function mtoc2_loop_count(start: any, end: any, step: any): number;