numbl 0.4.19 → 0.4.22

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 (314) hide show
  1. package/binding.gyp +12 -6
  2. package/dist-browser/browser/index.d.ts +1 -1
  3. package/dist-browser/browser/mip.d.ts +7 -0
  4. package/dist-browser/browser/protocol.d.ts +1 -1
  5. package/dist-browser/browser.js +1 -1
  6. package/dist-browser/db/operations.d.ts +0 -1
  7. package/dist-browser/gpuHelper.d.ts +29 -0
  8. package/dist-browser/hooks/projectFilesState.d.ts +37 -0
  9. package/dist-browser/numbl-core/execSession.d.ts +39 -0
  10. package/dist-browser/numbl-core/executeCode.d.ts +10 -1
  11. package/dist-browser/numbl-core/executors/classification.d.ts +2 -10
  12. package/dist-browser/numbl-core/executors/jit/backend.d.ts +65 -0
  13. package/dist-browser/numbl-core/executors/jit/cBackend.d.ts +22 -0
  14. package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +13 -44
  15. package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
  16. package/dist-browser/numbl-core/executors/jit/jsBackend.d.ts +15 -0
  17. package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
  18. package/dist-browser/numbl-core/executors/jit/session.d.ts +1 -1
  19. package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
  20. package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
  21. package/dist-browser/numbl-core/executors/lowering.d.ts +38 -96
  22. package/dist-browser/numbl-core/executors/plugins.d.ts +14 -28
  23. package/dist-browser/numbl-core/executors/registry.d.ts +32 -133
  24. package/dist-browser/numbl-core/executors/types.d.ts +30 -92
  25. package/dist-browser/numbl-core/functionResolve.d.ts +3 -13
  26. package/dist-browser/numbl-core/helpers/check-helpers.d.ts +0 -5
  27. package/dist-browser/numbl-core/helpers/glob.d.ts +14 -0
  28. package/dist-browser/numbl-core/helpers/linsolve.d.ts +3 -13
  29. package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +2 -4
  30. package/dist-browser/numbl-core/helpers/shape-utils.d.ts +10 -0
  31. package/dist-browser/numbl-core/helpers/sparse-direct.d.ts +107 -0
  32. package/dist-browser/numbl-core/helpers/warn.d.ts +9 -0
  33. package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +4 -1
  34. package/dist-browser/numbl-core/interpreter/builtins/sparse-solvers.d.ts +16 -0
  35. package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
  36. package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +7 -7
  37. package/dist-browser/numbl-core/interpreter/interpreter.d.ts +6 -6
  38. package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
  39. package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
  40. package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
  41. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
  42. package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
  43. package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
  44. package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
  45. package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
  46. package/dist-browser/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
  47. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
  48. package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
  49. package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
  50. package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
  51. package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
  52. package/dist-browser/numbl-core/jit/builtins/registry.d.ts +15 -30
  53. package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  54. package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
  55. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
  56. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
  57. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
  58. package/dist-browser/numbl-core/jit/codegen/emit.d.ts +9 -30
  59. package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +9 -27
  60. package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
  61. package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
  62. package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
  63. package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
  64. package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +7 -28
  65. package/dist-browser/numbl-core/jit/compileSpec.d.ts +3 -6
  66. package/dist-browser/numbl-core/jit/compileSpecC.d.ts +5 -0
  67. package/dist-browser/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
  68. package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
  69. package/dist-browser/numbl-core/jit/lowering/errors.d.ts +3 -15
  70. package/dist-browser/numbl-core/jit/lowering/ir.d.ts +0 -2
  71. package/dist-browser/numbl-core/jit/lowering/lower.d.ts +4 -12
  72. package/dist-browser/numbl-core/jit/lowering/types.d.ts +2 -7
  73. package/dist-browser/numbl-core/jit/numbl/index.d.ts +5 -14
  74. package/dist-browser/numbl-core/jit/parser/index.d.ts +4 -9
  75. package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +32 -136
  76. package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
  77. package/dist-browser/numbl-core/jsUserFunctions.d.ts +10 -12
  78. package/dist-browser/numbl-core/lowering/classInfo.d.ts +4 -1
  79. package/dist-browser/numbl-core/lowering/loweringContext.d.ts +15 -23
  80. package/dist-browser/numbl-core/native/lapack-bridge.d.ts +137 -128
  81. package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
  82. package/dist-browser/numbl-core/native/ts-lapack-complex.d.ts +23 -0
  83. package/dist-browser/numbl-core/native/ts-lapack-eig-hermitian.d.ts +33 -0
  84. package/dist-browser/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
  85. package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
  86. package/dist-browser/numbl-core/ops/dispatch.d.ts +4 -5
  87. package/dist-browser/numbl-core/parser/types.d.ts +1 -21
  88. package/{dist-lib/numbl-core/runtime → dist-browser/numbl-core/plotting}/axisCommand.d.ts +2 -2
  89. package/dist-browser/{graphics → numbl-core/plotting}/axisLimits.d.ts +14 -2
  90. package/dist-browser/numbl-core/plotting/builtins.d.ts +8 -0
  91. package/dist-browser/numbl-core/plotting/colormaps.d.ts +10 -0
  92. package/dist-browser/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
  93. package/dist-browser/numbl-core/plotting/imagescExtent.d.ts +19 -0
  94. package/dist-browser/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
  95. package/dist-browser/numbl-core/plotting/parseArgsChart.d.ts +94 -0
  96. package/dist-browser/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
  97. package/dist-browser/numbl-core/plotting/parseArgsLine.d.ts +103 -0
  98. package/dist-browser/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
  99. package/dist-browser/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
  100. package/dist-browser/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
  101. package/dist-browser/numbl-core/plotting/streamline.d.ts +16 -0
  102. package/{dist-graphics/graphics → dist-browser/numbl-core/plotting}/types.d.ts +9 -7
  103. package/dist-browser/numbl-core/runtime/cow.d.ts +0 -8
  104. package/dist-browser/numbl-core/runtime/refcount.d.ts +0 -3
  105. package/dist-browser/numbl-core/runtime/registerSpecial.d.ts +15 -0
  106. package/dist-browser/numbl-core/runtime/runtime.d.ts +11 -35
  107. package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
  108. package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +3 -9
  109. package/dist-browser/numbl-core/runtime/types.d.ts +12 -0
  110. package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +5 -13
  111. package/dist-browser/numbl-core/runtime/utils.d.ts +4 -1
  112. package/dist-browser/numbl-core/version.d.ts +1 -1
  113. package/dist-browser/numbl-core/workspace/workspace.d.ts +64 -0
  114. package/dist-browser/ts-lapack/src/BLAS/dsymv.d.ts +1 -0
  115. package/dist-browser/ts-lapack/src/BLAS/dsyr2.d.ts +1 -0
  116. package/dist-browser/ts-lapack/src/SRC/dlae2.d.ts +4 -0
  117. package/dist-browser/ts-lapack/src/SRC/dlaev2.d.ts +6 -0
  118. package/dist-browser/ts-lapack/src/SRC/dlanst.d.ts +1 -0
  119. package/dist-browser/ts-lapack/src/SRC/dlansy.d.ts +1 -0
  120. package/dist-browser/ts-lapack/src/SRC/dlasrt.d.ts +1 -0
  121. package/dist-browser/ts-lapack/src/SRC/dorgtr.d.ts +1 -0
  122. package/dist-browser/ts-lapack/src/SRC/dsteqr.d.ts +4 -0
  123. package/dist-browser/ts-lapack/src/SRC/dsyev.d.ts +1 -0
  124. package/dist-browser/ts-lapack/src/SRC/dsytd2.d.ts +1 -0
  125. package/dist-browser/vfs/syncVfsChanges.d.ts +2 -2
  126. package/dist-cli/cli.js +74241 -77271
  127. package/dist-graphics/graphics/FigureView.d.ts +1 -1
  128. package/dist-graphics/graphics/SurfView.d.ts +3 -2
  129. package/dist-graphics/graphics/drawPlot.d.ts +1 -1
  130. package/dist-graphics/graphics/exportFigureHdf5.d.ts +1 -1
  131. package/dist-graphics/graphics/figureHashTransport.d.ts +1 -1
  132. package/dist-graphics/graphics/figureUpload.d.ts +1 -1
  133. package/dist-graphics/graphics/importFigureHdf5.d.ts +1 -1
  134. package/dist-graphics/graphics/openInFigureViewer.d.ts +1 -1
  135. package/dist-graphics/graphics/plotHelpers.d.ts +1 -1
  136. package/dist-graphics/graphics/plotLegend.d.ts +1 -1
  137. package/dist-graphics/graphics/plotMarkers.d.ts +1 -1
  138. package/dist-graphics/graphics/restoreNaNs.d.ts +1 -1
  139. package/dist-graphics/graphics/uihtmlRelay.d.ts +16 -0
  140. package/dist-graphics/graphics-lib.d.ts +3 -3
  141. package/dist-graphics/index.js +294 -328
  142. package/{dist-lib/graphics → dist-graphics/numbl-core/plotting}/axisLimits.d.ts +14 -2
  143. package/dist-graphics/numbl-core/plotting/colormaps.d.ts +10 -0
  144. package/dist-graphics/numbl-core/plotting/imagescExtent.d.ts +19 -0
  145. package/{dist-browser/graphics → dist-graphics/numbl-core/plotting}/types.d.ts +9 -7
  146. package/dist-lib/browser/mip.d.ts +17 -0
  147. package/dist-lib/cli-scan.d.ts +8 -1
  148. package/dist-lib/lib.d.ts +1 -1
  149. package/dist-lib/lib.js +37081 -39889
  150. package/dist-lib/node.js +22 -14
  151. package/dist-lib/numbl-core/execSession.d.ts +39 -0
  152. package/dist-lib/numbl-core/executeCode.d.ts +10 -1
  153. package/dist-lib/numbl-core/executors/classification.d.ts +2 -10
  154. package/dist-lib/numbl-core/executors/jit/backend.d.ts +65 -0
  155. package/dist-lib/numbl-core/executors/jit/cBackend.d.ts +22 -0
  156. package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +13 -44
  157. package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
  158. package/dist-lib/numbl-core/executors/jit/jsBackend.d.ts +15 -0
  159. package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
  160. package/dist-lib/numbl-core/executors/jit/session.d.ts +1 -1
  161. package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
  162. package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
  163. package/dist-lib/numbl-core/executors/lowering.d.ts +38 -96
  164. package/dist-lib/numbl-core/executors/plugins.d.ts +14 -28
  165. package/dist-lib/numbl-core/executors/registry.d.ts +32 -133
  166. package/dist-lib/numbl-core/executors/types.d.ts +30 -92
  167. package/dist-lib/numbl-core/functionResolve.d.ts +3 -13
  168. package/dist-lib/numbl-core/helpers/check-helpers.d.ts +0 -5
  169. package/dist-lib/numbl-core/helpers/glob.d.ts +14 -0
  170. package/dist-lib/numbl-core/helpers/linsolve.d.ts +3 -13
  171. package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +2 -4
  172. package/dist-lib/numbl-core/helpers/shape-utils.d.ts +10 -0
  173. package/dist-lib/numbl-core/helpers/sparse-direct.d.ts +107 -0
  174. package/dist-lib/numbl-core/helpers/warn.d.ts +9 -0
  175. package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +4 -1
  176. package/dist-lib/numbl-core/interpreter/builtins/sparse-solvers.d.ts +16 -0
  177. package/dist-lib/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
  178. package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +7 -7
  179. package/dist-lib/numbl-core/interpreter/interpreter.d.ts +6 -6
  180. package/dist-lib/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
  181. package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
  182. package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
  183. package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
  184. package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
  185. package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
  186. package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
  187. package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
  188. package/dist-lib/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
  189. package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
  190. package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
  191. package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
  192. package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
  193. package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
  194. package/dist-lib/numbl-core/jit/builtins/registry.d.ts +15 -30
  195. package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  196. package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
  197. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
  198. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
  199. package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
  200. package/dist-lib/numbl-core/jit/codegen/emit.d.ts +9 -30
  201. package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +9 -27
  202. package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
  203. package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
  204. package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
  205. package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
  206. package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +7 -28
  207. package/dist-lib/numbl-core/jit/compileSpec.d.ts +3 -6
  208. package/dist-lib/numbl-core/jit/compileSpecC.d.ts +5 -0
  209. package/dist-lib/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
  210. package/dist-lib/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
  211. package/dist-lib/numbl-core/jit/lowering/errors.d.ts +3 -15
  212. package/dist-lib/numbl-core/jit/lowering/ir.d.ts +0 -2
  213. package/dist-lib/numbl-core/jit/lowering/lower.d.ts +4 -12
  214. package/dist-lib/numbl-core/jit/lowering/types.d.ts +2 -7
  215. package/dist-lib/numbl-core/jit/numbl/index.d.ts +5 -14
  216. package/dist-lib/numbl-core/jit/parser/index.d.ts +4 -9
  217. package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +32 -136
  218. package/dist-lib/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
  219. package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -12
  220. package/dist-lib/numbl-core/lowering/classInfo.d.ts +4 -1
  221. package/dist-lib/numbl-core/lowering/loweringContext.d.ts +15 -23
  222. package/dist-lib/numbl-core/native/lapack-bridge.d.ts +137 -128
  223. package/dist-lib/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
  224. package/dist-lib/numbl-core/native/ts-lapack-complex.d.ts +23 -0
  225. package/dist-lib/numbl-core/native/ts-lapack-eig-hermitian.d.ts +33 -0
  226. package/dist-lib/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
  227. package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
  228. package/dist-lib/numbl-core/ops/dispatch.d.ts +4 -5
  229. package/dist-lib/numbl-core/parser/types.d.ts +1 -21
  230. package/{dist-browser/numbl-core/runtime → dist-lib/numbl-core/plotting}/axisCommand.d.ts +2 -2
  231. package/{dist-graphics/graphics → dist-lib/numbl-core/plotting}/axisLimits.d.ts +14 -2
  232. package/dist-lib/numbl-core/plotting/builtins.d.ts +8 -0
  233. package/dist-lib/numbl-core/plotting/colormaps.d.ts +10 -0
  234. package/dist-lib/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
  235. package/dist-lib/numbl-core/plotting/imagescExtent.d.ts +19 -0
  236. package/dist-lib/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
  237. package/dist-lib/numbl-core/plotting/parseArgsChart.d.ts +94 -0
  238. package/dist-lib/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
  239. package/dist-lib/numbl-core/plotting/parseArgsLine.d.ts +103 -0
  240. package/dist-lib/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
  241. package/dist-lib/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
  242. package/dist-lib/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
  243. package/dist-lib/numbl-core/plotting/streamline.d.ts +16 -0
  244. package/dist-lib/{graphics → numbl-core/plotting}/types.d.ts +9 -7
  245. package/dist-lib/numbl-core/runtime/cow.d.ts +0 -8
  246. package/dist-lib/numbl-core/runtime/refcount.d.ts +0 -3
  247. package/dist-lib/numbl-core/runtime/registerSpecial.d.ts +15 -0
  248. package/dist-lib/numbl-core/runtime/runtime.d.ts +11 -35
  249. package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
  250. package/dist-lib/numbl-core/runtime/specialBuiltins.d.ts +3 -9
  251. package/dist-lib/numbl-core/runtime/types.d.ts +12 -0
  252. package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +5 -13
  253. package/dist-lib/numbl-core/runtime/utils.d.ts +4 -1
  254. package/dist-lib/numbl-core/version.d.ts +1 -1
  255. package/dist-lib/numbl-core/workspace/workspace.d.ts +64 -0
  256. package/dist-lib/ts-lapack/src/BLAS/dsymv.d.ts +1 -0
  257. package/dist-lib/ts-lapack/src/BLAS/dsyr2.d.ts +1 -0
  258. package/dist-lib/ts-lapack/src/SRC/dlae2.d.ts +4 -0
  259. package/dist-lib/ts-lapack/src/SRC/dlaev2.d.ts +6 -0
  260. package/dist-lib/ts-lapack/src/SRC/dlanst.d.ts +1 -0
  261. package/dist-lib/ts-lapack/src/SRC/dlansy.d.ts +1 -0
  262. package/dist-lib/ts-lapack/src/SRC/dlasrt.d.ts +1 -0
  263. package/dist-lib/ts-lapack/src/SRC/dorgtr.d.ts +1 -0
  264. package/dist-lib/ts-lapack/src/SRC/dsteqr.d.ts +4 -0
  265. package/dist-lib/ts-lapack/src/SRC/dsyev.d.ts +1 -0
  266. package/dist-lib/ts-lapack/src/SRC/dsytd2.d.ts +1 -0
  267. package/dist-lib/vfs/unzipToFiles.d.ts +7 -0
  268. package/dist-plot-viewer/assets/index-C0fIevlp.js +4504 -0
  269. package/dist-plot-viewer/index.html +1 -1
  270. package/dist-site-viewer/assets/index-BDaviCH6.js +4832 -0
  271. package/dist-site-viewer/assets/numbl-worker-D6m4K2PP.js +5691 -0
  272. package/dist-site-viewer/index.html +2 -2
  273. package/native/lapack_eig.cpp +156 -0
  274. package/native/numbl_addon.cpp +8 -12
  275. package/native/numbl_addon_common.h +14 -5
  276. package/package.json +6 -5
  277. package/dist-browser/hooks/useProjectFiles.d.ts +0 -45
  278. package/dist-browser/numbl-core/executors/context.d.ts +0 -76
  279. package/dist-browser/numbl-core/executors/index.d.ts +0 -14
  280. package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
  281. package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
  282. package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
  283. package/dist-browser/numbl-core/helpers/dummy.d.ts +0 -5
  284. package/dist-browser/numbl-core/jit/runtime/context.d.ts +0 -23
  285. package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +0 -10
  286. package/dist-browser/numbl-core/jit/runtime/value.d.ts +0 -101
  287. package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
  288. package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
  289. package/dist-browser/numbl-core/native/bridge-resolve.d.ts +0 -14
  290. package/dist-browser/numbl-core/runtime/plotUtils.d.ts +0 -336
  291. package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
  292. package/dist-graphics/graphics/surfColormap.d.ts +0 -2
  293. package/dist-lib/numbl-core/executors/context.d.ts +0 -76
  294. package/dist-lib/numbl-core/executors/index.d.ts +0 -14
  295. package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
  296. package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
  297. package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
  298. package/dist-lib/numbl-core/helpers/dummy.d.ts +0 -5
  299. package/dist-lib/numbl-core/jit/runtime/context.d.ts +0 -23
  300. package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +0 -10
  301. package/dist-lib/numbl-core/jit/runtime/value.d.ts +0 -101
  302. package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
  303. package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
  304. package/dist-lib/numbl-core/native/bridge-resolve.d.ts +0 -14
  305. package/dist-lib/numbl-core/runtime/plotUtils.d.ts +0 -336
  306. package/dist-lib/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
  307. package/dist-plot-viewer/assets/index-YeXWXIxH.js +0 -4504
  308. package/dist-site-viewer/assets/index-B5Y5557F.js +0 -4831
  309. package/dist-site-viewer/assets/numbl-worker-CtoT7C0f.js +0 -5355
  310. package/native/elemwise.cpp +0 -360
  311. package/native/unary_elemwise.cpp +0 -67
  312. /package/dist-browser/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
  313. /package/dist-graphics/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
  314. /package/dist-lib/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
@@ -12,9 +12,8 @@
12
12
  *
13
13
  * Two seams are installed from one instantiated module (see
14
14
  * `installWasmLapackBridge`):
15
- * 1. `setLapackBridge()` — covers the *interpreter* path (opt 0), which
16
- * already resolves per-op via `getEffectiveBridge` and falls back to
17
- * ts-lapack for any op the bridge omits.
15
+ * 1. `setLapackBridge()` — covers the *interpreter* path (opt 0);
16
+ * `getLapackBridge()` takes ts-lapack for any op the module omits.
18
17
  * 2. `globalThis.$matmulAccel` — the hook the JS-JIT matmul runtime
19
18
  * snippet consults (opt 1, the browser IDE default), which otherwise
20
19
  * runs a naive JS triple-loop that never touches the bridge.
@@ -85,9 +84,9 @@ export declare function makeWasmMatmul(exports: WasmLapackExports): MatmulFn;
85
84
  /**
86
85
  * Assemble a (partial) `LapackBridge` from an instantiated module, exposing
87
86
  * only the ops the manifest advertises. Ops the bridge omits resolve to
88
- * ts-lapack via `getEffectiveBridge`.
87
+ * ts-lapack in `getLapackBridge`.
89
88
  */
90
- export declare function buildLapackBridgeFromWasm(exports: WasmLapackExports, manifest: AcceleratorManifest): LapackBridge;
89
+ export declare function buildLapackBridgeFromWasm(exports: WasmLapackExports, manifest: AcceleratorManifest): Partial<LapackBridge>;
91
90
  /**
92
91
  * Install/remove the JS-JIT matmul accelerator hook (`globalThis.$matmulAccel`)
93
92
  * that `mtoc2_tensor_mtimes_real` consults. Pass `null` to uninstall.
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Tensor-ops dispatcher: chooses native bridge or pure-TS fallback.
2
+ * Tensor-ops entry points: thin wrappers over the LAPACK bridge's tensorOp*
3
+ * kernels (native addon when installed, the TS kernels in this directory
4
+ * otherwise; see native/lapack-bridge.ts).
3
5
  *
4
- * All entry points have identical signatures across native and TS impls.
5
6
  * Caller owns input AND output memory; functions never allocate output.
6
- *
7
- * Selection happens once on first use per category and is cached
8
- * (the bridge identity is captured at module load via getLapackBridge()).
7
+ * Element-wise ops skip the bridge entirely for empty inputs.
9
8
  */
10
9
  export declare const tensorOps: {
11
10
  realBinaryElemwise(op: number, n: number, a: Float64Array, b: Float64Array, out: Float64Array): void;
@@ -313,7 +313,7 @@ export type Stmt = {
313
313
  type: "ClassDef";
314
314
  name: string;
315
315
  classAttributes: Attr[];
316
- superClass: string | null;
316
+ superClasses: string[];
317
317
  members: ClassMember[];
318
318
  span: Span;
319
319
  } | {
@@ -322,26 +322,6 @@ export type Stmt = {
322
322
  directive: string;
323
323
  args: string[];
324
324
  span: Span;
325
- } | {
326
- /** Synthetic stmt produced by an executor-registered AST
327
- * transformer (e.g. the C-JIT chain pass). Wraps a contiguous
328
- * run of original stmts so a specialized executor can claim
329
- * them as a unit; the interpreter falls back to executing
330
- * `subStmts` in order when the executor isn't registered or
331
- * declines.
332
- *
333
- * Never produced by the parser. */
334
- type: "Synth";
335
- /** Identifies the executor that this synth node was built for
336
- * (e.g. `"c-jit-chain"`). The matching executor reads `data`. */
337
- tag: string;
338
- /** Original adjacent stmts, in source order. Used by the
339
- * interpreter fallback. */
340
- subStmts: Stmt[];
341
- /** Executor-specific pre-computed analysis. Opaque to the
342
- * interpreter. */
343
- data: unknown;
344
- span: Span;
345
325
  };
346
326
  export interface AbstractSyntaxTree {
347
327
  body: Stmt[];
@@ -19,8 +19,8 @@
19
19
  * `lim = axis(ax)` carry no setting argument; the runtime detects them via
20
20
  * the `false` return value and computes the limits separately.
21
21
  */
22
- import type { RuntimeValue } from "./types.js";
23
- import type { PlotInstruction } from "../../graphics/types.js";
22
+ import type { RuntimeValue } from "../runtime/types.js";
23
+ import type { PlotInstruction } from "./types.js";
24
24
  /**
25
25
  * Process an `axis(...)` call, pushing instructions onto `instructions`.
26
26
  *
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * This is the source of truth for the query form `lim = axis`: the numbl
5
5
  * runtime reduces its accumulated plot instructions into an `AxesState` and
6
- * asks this module for the limit vector. It is deliberately rendering-free
7
- * (no canvas, no DOM) so numbl-core can import it.
6
+ * asks this module for the limit vector. It is rendering-free (no canvas, no
7
+ * DOM); the renderer in src/graphics/ uses it too.
8
8
  *
9
9
  * For an axis with an explicit limit, that limit is returned verbatim (a
10
10
  * `null` bound falls back to the data-derived bound). For a fully automatic
@@ -13,11 +13,23 @@
13
13
  * what is drawn.
14
14
  */
15
15
  import type { AxesState } from "./figuresReducer.js";
16
+ type Extent = {
17
+ min: number;
18
+ max: number;
19
+ };
16
20
  /** Does this axes hold any 3-D content (so limits are a 6-vector)? */
17
21
  export declare function axesIs3D(axes: AxesState): boolean;
22
+ /** Raw data extents (no padding) across every renderable trace type.
23
+ * Non-finite values are ignored; an empty axis has min > max. */
24
+ export declare function dataExtents(axes: Partial<AxesState>): {
25
+ x: Extent;
26
+ y: Extent;
27
+ z: Extent;
28
+ };
18
29
  /**
19
30
  * Compute the limit vector for `lim = axis`.
20
31
  * Returns 4 elements `[xmin xmax ymin ymax]` for a 2-D view, or 6 elements
21
32
  * `[xmin xmax ymin ymax zmin zmax]` when the axes holds 3-D content.
22
33
  */
23
34
  export declare function computeAxisLimits(axes: AxesState): number[];
35
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Plot builtin registrations: data-bearing plot calls (plot, surf, contour,
3
+ * ...), graphics ops with figure/axes state (figure, hold, subplot, ...), and
4
+ * the ops that return handles or need the runtime's plot state. Names with no
5
+ * custom registration fall through to the generic loop at the end, which
6
+ * routes them to `dispatchPlotBuiltin`.
7
+ */
8
+ export {};
@@ -0,0 +1,10 @@
1
+ export type RGB = [number, number, number];
2
+ /** An axes colormap: a named map, or custom N×3 `data` (which wins). */
3
+ export interface ColormapSpec {
4
+ name?: string;
5
+ data?: number[][];
6
+ }
7
+ export declare const PARULA_ANCHORS: RGB[];
8
+ /** Color at t ∈ [0, 1] (clamped; non-finite → 0) in the given colormap.
9
+ * Unknown names fall back to parula. */
10
+ export declare function colormapLookup(t: number, cm?: ColormapSpec): RGB;
@@ -3,19 +3,10 @@
3
3
  * `(name, args)` → `PlotInstruction[]` mapping that every plotting
4
4
  * builtin performs.
5
5
  *
6
- * Historically this logic was scattered across two places:
7
- * - `runtime.ts` registered the data-bearing plot names
8
- * (`plot`, `surf`, `imagesc`, …) inside `initBuiltins`.
9
- * - `specialBuiltins.ts` registered the graphics ops (`figure`,
10
- * `title`, `xlabel`, `hold`, `subplot`, `clf`, …) inside
11
- * `registerSpecialBuiltins`.
12
- *
13
- * Both sites pushed onto `rt.plotInstructions` and (for `hold` /
14
- * `tiledlayout` / `nexttile`) updated small flags on the Runtime.
15
- * `dispatchPlotBuiltin` is the consolidation. The Runtime registers
16
- * each name with a 1-line wrapper that calls this function and then
17
- * returns the right `nargout`-handle value; the side-effect (the
18
- * push) lives here.
6
+ * Registration lives in `builtins.ts`: each name gets a wrapper that
7
+ * calls this function and returns the right `nargout`-handle value; the
8
+ * side effect (the push onto `rt.plotInstructions`, plus the small
9
+ * hold / tiled-layout flags on the Runtime) lives here.
19
10
  *
20
11
  * Out-of-scope names — kept registered separately because their
21
12
  * semantics need the full Runtime context:
@@ -32,8 +23,8 @@
32
23
  * sibling project) imports this function to render plots in its
33
24
  * browser IDE without reimplementing per-builtin logic.
34
25
  */
35
- import type { RuntimeValue } from "./types.js";
36
- import type { PlotInstruction } from "../../graphics/types.js";
26
+ import type { RuntimeValue } from "../runtime/types.js";
27
+ import type { PlotInstruction } from "./types.js";
37
28
  /** State carried by graphics ops that need to remember things between
38
29
  * calls. `holdState` is read by `ishold()` so `hold on; if ishold ...`
39
30
  * works; `tiledLayoutState` lets `nexttile` know where to place the
@@ -64,17 +55,16 @@ export interface TiledLayoutState {
64
55
  * refactor. Returns `true` iff `name` was a recognized plot builtin;
65
56
  * callers fall through to their own dispatch on `false`. */
66
57
  export declare function dispatchPlotBuiltin(name: string, args: RuntimeValue[], instructions: PlotInstruction[], state: PlotDispatchState): boolean;
67
- /** Names handled by `dispatchPlotBuiltin`. Useful for registering all
68
- * of them in a loop (numbl's `initBuiltins` / `registerSpecialBuiltins`
69
- * do that for the side-effect-only subset). Stays in sync with the
70
- * cases above by construction. */
58
+ /** Names handled by `dispatchPlotBuiltin`. `builtins.ts` registers all
59
+ * of them in a loop (for the side-effect-only subset). Stays in sync
60
+ * with the cases above by construction. */
71
61
  export declare const PLOT_DISPATCH_NAMES: ReadonlyArray<string>;
72
62
  /** Graphics-related names numbl exposes as no-op (or near-no-op)
73
63
  * stubs — they don't push plot instructions and don't render, but
74
64
  * numbl accepts them so MATLAB scripts compile and run. Sources:
75
65
  * - `interpreter/builtins/misc.ts` (`groot`, `gcf`, `gca`, `shg`,
76
- * `newplot`, `xlim`, `ylim`, `set`, `get`, `ishold`)
77
- * - `runtime/specialBuiltins.ts` (`drawnow`, `pause`)
66
+ * `newplot`, `xlim`, `ylim`, `get`)
67
+ * - `plotting/builtins.ts` (`drawnow`, `pause`, `ishold`, `set`)
78
68
  *
79
69
  * These names belong here, alongside `PLOT_DISPATCH_NAMES`, because
80
70
  * downstream consumers (mtoc2's translator, syntax highlighters,
@@ -85,8 +75,7 @@ export declare const PLOT_DISPATCH_NAMES: ReadonlyArray<string>;
85
75
  export declare const PLOT_STUB_NAMES: ReadonlyArray<string>;
86
76
  /** The union of `PLOT_DISPATCH_NAMES` (renderable) and
87
77
  * `PLOT_STUB_NAMES` (recognized-but-no-render). Every name a plotting
88
- * script might invoke that numbl tolerates. Mtoc2 imports this to
89
- * drive its own builtin registration so the two repos stay in
90
- * lockstep — when numbl gains a new plot builtin, mtoc2 picks it up
91
- * at the next `tsc` / `vite build` with no mtoc2-side edit. */
78
+ * script might invoke that numbl tolerates. The JIT registers its plot
79
+ * builtins from this list, so a new plot builtin needs no JIT-side
80
+ * edit. */
92
81
  export declare const PLOT_ALL_NAMES: ReadonlyArray<string>;
@@ -0,0 +1,19 @@
1
+ import type { ImagescTrace } from "./types.js";
2
+ /**
3
+ * Pixel geometry of an imagesc trace. As in MATLAB, `x` and `y` hold the
4
+ * centers of the first and last columns/rows (XData/YData), so the image
5
+ * extends half a pixel beyond them; a single column or row is one unit wide.
6
+ * `dx`/`dy` may be negative (decreasing XData/YData).
7
+ */
8
+ export declare function imagescExtent(t: ImagescTrace): {
9
+ dx: number;
10
+ dy: number;
11
+ x: [number, number];
12
+ y: [number, number];
13
+ };
14
+ /**
15
+ * Color limits for an imagesc trace: the axes' caxis/clim when set, else the
16
+ * finite data range. Values outside the limits clamp to the colormap ends.
17
+ * Returns null when there is no finite data and no caxis.
18
+ */
19
+ export declare function imagescColorLimits(t: ImagescTrace, caxis?: [number, number]): [number, number] | null;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Plot-related operations for the runtime.
2
+ * Plot instruction builders: one `*Call` per plotting builtin, each parsing
3
+ * its runtime arguments and pushing the resulting `PlotInstruction`s.
3
4
  */
4
5
  import { type RuntimeValue } from "../runtime/index.js";
5
- import type { PlotInstruction } from "../../graphics/types.js";
6
- import type { ExecOptions } from "../executeCode.js";
7
- import type { Runtime } from "./runtime.js";
6
+ import type { PlotInstruction } from "./types.js";
7
+ import type { Runtime } from "../runtime/runtime.js";
8
8
  export declare function plotInstr(plotInstructions: PlotInstruction[], instr: {
9
9
  type: "set_figure_handle";
10
10
  handle: unknown;
@@ -74,6 +74,7 @@ export declare function plot3Call(plotInstructions: PlotInstruction[], args: Run
74
74
  export declare function lineCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
75
75
  export declare function patchCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
76
76
  export declare function trimeshCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
77
+ export declare function trisurfCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
77
78
  export declare function fillCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
78
79
  export declare function surfCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
79
80
  export declare function surfaceCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
@@ -114,16 +115,3 @@ export declare function heatmapCall(plotInstructions: PlotInstruction[], args: R
114
115
  export declare function quiverCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
115
116
  export declare function quiver3Call(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
116
117
  export declare function legendCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): void;
117
- export declare function drawnow(plotInstructions: PlotInstruction[], options: ExecOptions): void;
118
- export declare function pause(seconds: unknown): void;
119
- /**
120
- * streamline(X,Y,U,V,startX,startY) — compute and plot 2D streamlines.
121
- * streamline(verts) — plot from pre-computed cell array of vertex matrices.
122
- * Returns a dummy graphics handle.
123
- */
124
- export declare function streamlineCall(plotInstructions: PlotInstruction[], args: RuntimeValue[]): RuntimeValue;
125
- /**
126
- * stream2(X,Y,U,V,startX,startY) — compute 2D streamline vertices.
127
- * Returns a cell array of Nx2 vertex matrices.
128
- */
129
- export declare function stream2Call(args: RuntimeValue[]): RuntimeValue;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Argument parsers for statistical charts: bar, barh, bar3, histogram,
3
+ * histogram2, boxchart, swarmchart, and piechart/donutchart.
4
+ */
5
+ import { type RuntimeValue } from "../runtime/types.js";
6
+ import type { PlotTrace, Plot3Trace, BarTrace, Bar3Trace, BoxTrace, PieTrace } from "./types.js";
7
+ /**
8
+ * Parse bar() arguments.
9
+ *
10
+ * Supported forms:
11
+ * bar(Y) — Y values with x = 1:length(Y)
12
+ * bar(X, Y) — explicit X positions
13
+ * bar(..., width) — relative bar width (scalar 0–1)
14
+ * bar(..., color) — single-char color spec
15
+ */
16
+ export declare function parseBarArgs(args: RuntimeValue[]): BarTrace[];
17
+ /**
18
+ * Parse barh() arguments — same forms as bar() but rendered horizontally.
19
+ *
20
+ * Supported forms:
21
+ * barh(Y) — Y values (bar lengths) with positions = 1:length(Y)
22
+ * barh(X, Y) — explicit positions X, bar lengths Y
23
+ * barh(..., width) — relative bar thickness (scalar 0–1)
24
+ * barh(..., color) — single-char color spec
25
+ */
26
+ export declare function parseBarHArgs(args: RuntimeValue[]): BarTrace[];
27
+ /**
28
+ * Parse bar3() / bar3h() arguments.
29
+ *
30
+ * Supported forms:
31
+ * bar3(Z) — Z values with y = 1:m, x = 1:n
32
+ * bar3(Y, Z) — explicit Y positions
33
+ * bar3(..., width) — relative bar width (scalar 0–1)
34
+ * bar3(..., color) — single-char color spec
35
+ */
36
+ export declare function parseBar3Args(args: RuntimeValue[]): Bar3Trace;
37
+ /**
38
+ * Parse histogram() arguments.
39
+ *
40
+ * Supported forms:
41
+ * histogram(X)
42
+ * histogram(X, nbins)
43
+ * histogram(X, edges)
44
+ */
45
+ export declare function parseHistogramArgs(args: RuntimeValue[]): BarTrace[];
46
+ /**
47
+ * Parse histogram2() arguments.
48
+ *
49
+ * Supported forms:
50
+ * histogram2(X, Y)
51
+ * histogram2(X, Y, nbins) — nbins is scalar or [nx, ny]
52
+ * histogram2(X, Y, Xedges, Yedges)
53
+ */
54
+ export declare function parseHistogram2Args(args: RuntimeValue[]): Bar3Trace;
55
+ /**
56
+ * Parse boxchart() arguments.
57
+ *
58
+ * Supported forms:
59
+ * boxchart(ydata) — one box per column of ydata
60
+ * boxchart(xgroupdata, ydata) — group ydata by unique values in xgroupdata
61
+ */
62
+ export declare function parseBoxchartArgs(args: RuntimeValue[]): BoxTrace[];
63
+ /**
64
+ * Parse swarmchart() arguments.
65
+ *
66
+ * Supported forms:
67
+ * swarmchart(x, y)
68
+ * swarmchart(x, y, sz)
69
+ * swarmchart(x, y, sz, c)
70
+ * swarmchart(..., 'filled')
71
+ * swarmchart(..., markertype)
72
+ */
73
+ export declare function parseSwarmchartArgs(args: RuntimeValue[]): PlotTrace[];
74
+ /**
75
+ * Parse swarmchart3() arguments.
76
+ *
77
+ * Supported forms:
78
+ * swarmchart3(x, y, z)
79
+ * swarmchart3(x, y, z, sz)
80
+ * swarmchart3(x, y, z, sz, c)
81
+ * swarmchart3(..., 'filled')
82
+ * swarmchart3(..., markertype)
83
+ */
84
+ export declare function parseSwarmchart3Args(args: RuntimeValue[]): Plot3Trace[];
85
+ /**
86
+ * Parse piechart() / donutchart() arguments.
87
+ *
88
+ * Supported forms:
89
+ * piechart(data)
90
+ * piechart(data, names)
91
+ *
92
+ * @param innerRadius 0 for pie, >0 for donut
93
+ */
94
+ export declare function parsePiechartArgs(args: RuntimeValue[], innerRadius: number): PieTrace;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Shared helpers for plot argument parsing: color specs, LineSpec strings,
3
+ * Name-Value key detection, and conversion of runtime values to plain
4
+ * number arrays and grids.
5
+ */
6
+ import { type RuntimeValue, type RuntimeTensor } from "../runtime/types.js";
7
+ export declare const COLOR_SHORT: Record<string, [number, number, number]>;
8
+ export declare function resolveColor(v: RuntimeValue | string): [number, number, number] | undefined;
9
+ export interface ParsedLineSpec {
10
+ color?: string;
11
+ lineStyle?: string;
12
+ marker?: string;
13
+ }
14
+ export declare function parseLineSpec(s: string): ParsedLineSpec | null;
15
+ export declare function isNameValueKey(v: RuntimeValue): string | null;
16
+ export declare function isNumericArg(v: unknown): boolean;
17
+ export declare function isStringArg(v: unknown): boolean;
18
+ export declare function getStringValue(v: RuntimeValue): string;
19
+ /** Convert runtime value to a flat number array */
20
+ export declare function toNumberArray(v: RuntimeValue): number[];
21
+ /** Extract column j from a column-major tensor with shape [m, n] */
22
+ export declare function tensorColumn(tensor: RuntimeTensor, col: number): number[];
23
+ /**
24
+ * Get the number of columns of a numeric value for matrix splitting.
25
+ * Only returns > 1 for true matrices (nRows > 1 && nCols > 1).
26
+ * Row vectors (1×N) and column vectors (N×1) return 1.
27
+ */
28
+ export declare function numColumns(v: RuntimeValue): number;
29
+ /** Generate 1-based index array [1, 2, ..., n] */
30
+ export declare function oneBasedIndices(n: number): number[];
31
+ /**
32
+ * Expand a numeric value into column-wise traces.
33
+ * For a vector (row or column), returns one array.
34
+ * For an m×n matrix (m>1, n>1), returns n arrays (one per column).
35
+ */
36
+ export declare function expandColumns(v: RuntimeValue): number[][];
37
+ /** A leading argument that should be skipped as an axes handle. numbl has no
38
+ * real axes handles, so `line(ax, ___)` is accepted and the handle ignored. */
39
+ export declare function isAxesHandleArg(v: RuntimeValue): boolean;
40
+ export declare function getMatrixInfo(v: RuntimeValue): {
41
+ data: number[];
42
+ rows: number;
43
+ cols: number;
44
+ };
45
+ /** Generate meshgrid X and Y for a rows×cols grid: X = 1:cols, Y = 1:rows (column-major) */
46
+ export declare function generateMeshgrid(rows: number, cols: number): {
47
+ x: number[];
48
+ y: number[];
49
+ };
50
+ /**
51
+ * Expand X and Y to match the grid dimensions of Z.
52
+ * Handles:
53
+ * - X and Y as full m×n matrices (pass through)
54
+ * - X as 1×n row vector, Y as m×1 column vector (meshgrid expansion)
55
+ * - X as n-element vector, Y as m-element vector (meshgrid expansion)
56
+ */
57
+ export declare function expandXY(xVal: RuntimeValue, yVal: RuntimeValue, rows: number, cols: number): {
58
+ x: number[];
59
+ y: number[];
60
+ };
61
+ /** Get string value if the value is a string/char, otherwise undefined */
62
+ export declare function getStringValueIfString(v: RuntimeValue): string | undefined;
63
+ /** Create a runtime tensor from a plain number array (for synthetic args). */
64
+ export declare function tensorFromArray(arr: number[]): RuntimeValue;
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Argument parsers for line-like plots: plot, plot3, line, scatter, scatter3,
3
+ * stairs, errorbar, and area.
4
+ *
5
+ * Handles: plot(Y), plot(X,Y), plot(X1,Y1,...,Xn,Yn),
6
+ * plot(X1,Y1,LineSpec1,...), and Name-Value pairs like 'Color','r','LineWidth',2.
7
+ */
8
+ import { type RuntimeValue } from "../runtime/types.js";
9
+ import type { PlotTrace, Plot3Trace, ErrorBarTrace } from "./types.js";
10
+ export declare function parsePlotArgs(args: RuntimeValue[]): PlotTrace[];
11
+ /**
12
+ * Parse plot3() arguments.
13
+ *
14
+ * Supported forms:
15
+ * plot3(X, Y, Z)
16
+ * plot3(X, Y, Z, LineSpec)
17
+ * plot3(X1,Y1,Z1,...,Xn,Yn,Zn)
18
+ * plot3(X1,Y1,Z1,LineSpec1,...,Xn,Yn,Zn,LineSpecn)
19
+ * plot3(..., Name, Value)
20
+ */
21
+ export declare function parsePlot3Args(args: RuntimeValue[]): Plot3Trace[];
22
+ /** Result of parsing line() arguments: a set of 2-D or 3-D traces. */
23
+ export type ParsedLine = {
24
+ kind: "2d";
25
+ traces: PlotTrace[];
26
+ } | {
27
+ kind: "3d";
28
+ traces: Plot3Trace[];
29
+ };
30
+ /**
31
+ * Parse line() arguments.
32
+ *
33
+ * Supported forms:
34
+ * line — line from (0,0) to (1,1)
35
+ * line(x, y) — 2-D line(s)
36
+ * line(x, y, z) — 3-D line(s)
37
+ * line(___, Name, Value) — Color/LineStyle/LineWidth/Marker/...
38
+ * line('XData', x, 'YData', y, ...) — low-level form (black line)
39
+ * line(ax, ___) — leading axes handle (ignored)
40
+ *
41
+ * Like plot/plot3, vector inputs make a single line and matrix inputs make one
42
+ * line per column.
43
+ */
44
+ export declare function parseLineArgs(args: RuntimeValue[]): ParsedLine;
45
+ /**
46
+ * Parse scatter() arguments.
47
+ *
48
+ * Supported forms:
49
+ * scatter(X, Y)
50
+ * scatter(X, Y, sz)
51
+ * scatter(X, Y, sz, c)
52
+ * scatter(X, Y, ..., 'filled')
53
+ * scatter(X, Y, ..., mkr)
54
+ * scatter(X, Y, ..., Name, Value)
55
+ */
56
+ export declare function parseScatterArgs(args: RuntimeValue[]): PlotTrace[];
57
+ /**
58
+ * Parse stairs() arguments — same forms as plot() but with staircase-transformed coordinates.
59
+ *
60
+ * Supported forms:
61
+ * stairs(Y)
62
+ * stairs(X, Y)
63
+ * stairs(..., LineSpec)
64
+ * stairs(..., Name, Value)
65
+ */
66
+ export declare function parseStairsArgs(args: RuntimeValue[]): PlotTrace[];
67
+ /**
68
+ * Parse errorbar() arguments.
69
+ *
70
+ * Supported forms:
71
+ * errorbar(y, err) — symmetric vertical
72
+ * errorbar(x, y, err) — symmetric vertical with explicit x
73
+ * errorbar(x, y, neg, pos) — asymmetric vertical
74
+ * errorbar(x, y, yneg, ypos, xneg, xpos) — both axes
75
+ * errorbar(..., LineSpec)
76
+ */
77
+ export declare function parseErrorBarArgs(args: RuntimeValue[]): ErrorBarTrace[];
78
+ /**
79
+ * Parse area() arguments.
80
+ *
81
+ * Supported forms:
82
+ * area(Y) — fill under Y with x = 1:length(Y)
83
+ * area(X, Y) — explicit X
84
+ * area(..., basevalue) — scalar baseline (default 0)
85
+ * area(..., Name, Value)
86
+ *
87
+ * Returns { traces, baseValue }.
88
+ */
89
+ export declare function parseAreaArgs(args: RuntimeValue[]): {
90
+ traces: PlotTrace[];
91
+ baseValue: number;
92
+ };
93
+ /**
94
+ * Parse scatter3() arguments.
95
+ *
96
+ * Supported forms:
97
+ * scatter3(X, Y, Z)
98
+ * scatter3(X, Y, Z, S)
99
+ * scatter3(X, Y, Z, S, C)
100
+ * scatter3(..., 'filled')
101
+ * scatter3(..., markertype)
102
+ */
103
+ export declare function parseScatter3Args(args: RuntimeValue[]): Plot3Trace[];
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Argument parsers for patch-based plots: patch, fill, trimesh, and trisurf.
3
+ */
4
+ import { type RuntimeValue } from "../runtime/types.js";
5
+ import type { PatchTrace } from "./types.js";
6
+ /** Apply a single patch property (lower-cased key) to the trace. Shared by the
7
+ * Name-Value, struct, and `set`/handle paths. */
8
+ export declare function applyPatchProp(trace: PatchTrace, key: string, val: RuntimeValue): void;
9
+ /**
10
+ * Parse patch() arguments into a canonical PatchTrace.
11
+ *
12
+ * Supported forms:
13
+ * patch(X, Y, C) — 2-D polygons, color C
14
+ * patch(X, Y, Z, C) — 3-D polygons
15
+ * patch('XData', X, 'YData', Y[, 'ZData', Z]) — coords as name-value
16
+ * patch('Faces', F, 'Vertices', V) — faces/vertices model
17
+ * patch(S) — struct of patch properties
18
+ * patch(___, Name, Value) — patch properties
19
+ * patch(ax, ___) — leading axes handle (ignored)
20
+ */
21
+ export declare function parsePatchArgs(args: RuntimeValue[]): PatchTrace;
22
+ /**
23
+ * Parse fill() arguments into one patch trace per (X,Y,C) group. fill is the
24
+ * 2-D coordinate form of patch repeated over groups, so it reuses the patch
25
+ * vertex/color/property helpers — the only fill-specific logic is splitting
26
+ * the argument list into X,Y,C triplets.
27
+ *
28
+ * Supported forms:
29
+ * fill(X, Y, C)
30
+ * fill(X1, Y1, C1, ..., Xn, Yn, Cn)
31
+ * fill(___, Name, Value)
32
+ * fill(ax, ___)
33
+ */
34
+ export declare function parseFillArgs(args: RuntimeValue[]): PatchTrace[];
35
+ export declare function parseTriMeshArgs(args: RuntimeValue[]): PatchTrace;
36
+ /** Parse trisurf() arguments. Same forms as trimesh, but (matching MATLAB)
37
+ * the faces default to 'flat' coloring by the per-vertex z values (or c). */
38
+ export declare function parseTriSurfArgs(args: RuntimeValue[]): PatchTrace;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Argument parsers for vector fields: quiver and quiver3.
3
+ */
4
+ import { type RuntimeValue } from "../runtime/types.js";
5
+ import type { QuiverTrace, Quiver3Trace } from "./types.js";
6
+ /**
7
+ * Parse quiver() arguments.
8
+ *
9
+ * Supported forms:
10
+ * quiver(U, V)
11
+ * quiver(X, Y, U, V)
12
+ * quiver(..., scale) — scale: nonnegative number or 'off'
13
+ * quiver(..., LineSpec)
14
+ * quiver(..., LineSpec, 'filled')
15
+ * quiver(..., Name, Value) — Color, LineStyle, LineWidth, ShowArrowHead, etc.
16
+ *
17
+ * X, Y, U, V can be vectors or matrices. If U,V are matrices and X,Y are
18
+ * vectors, X and Y are expanded to a meshgrid.
19
+ */
20
+ export declare function parseQuiverArgs(args: RuntimeValue[]): QuiverTrace[];
21
+ /**
22
+ * Parse quiver3() arguments.
23
+ *
24
+ * Supported forms:
25
+ * quiver3(Z, U, V, W)
26
+ * quiver3(X, Y, Z, U, V, W)
27
+ * quiver3(..., scale) — scale: nonnegative number or 'off'
28
+ * quiver3(..., LineSpec)
29
+ * quiver3(..., LineSpec, 'filled')
30
+ * quiver3(..., Name, Value) — Color, LineStyle, LineWidth, ShowArrowHead, …
31
+ */
32
+ export declare function parseQuiver3Args(args: RuntimeValue[]): Quiver3Trace;