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.
- package/binding.gyp +12 -6
- package/dist-browser/browser/index.d.ts +1 -1
- package/dist-browser/browser/mip.d.ts +7 -0
- package/dist-browser/browser/protocol.d.ts +1 -1
- package/dist-browser/browser.js +1 -1
- package/dist-browser/db/operations.d.ts +0 -1
- package/dist-browser/gpuHelper.d.ts +29 -0
- package/dist-browser/hooks/projectFilesState.d.ts +37 -0
- package/dist-browser/numbl-core/execSession.d.ts +39 -0
- package/dist-browser/numbl-core/executeCode.d.ts +10 -1
- package/dist-browser/numbl-core/executors/classification.d.ts +2 -10
- package/dist-browser/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-browser/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-browser/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-browser/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-browser/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-browser/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-browser/numbl-core/executors/registry.d.ts +32 -133
- package/dist-browser/numbl-core/executors/types.d.ts +30 -92
- package/dist-browser/numbl-core/functionResolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-browser/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-browser/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-browser/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-browser/numbl-core/helpers/sparse-direct.d.ts +107 -0
- package/dist-browser/numbl-core/helpers/warn.d.ts +9 -0
- package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +4 -1
- package/dist-browser/numbl-core/interpreter/builtins/sparse-solvers.d.ts +16 -0
- package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-browser/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-browser/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-browser/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-browser/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-browser/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-browser/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-browser/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-browser/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-browser/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-browser/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-browser/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-browser/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-browser/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-browser/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-browser/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-browser/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-browser/numbl-core/native/lapack-bridge.d.ts +137 -128
- package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-browser/numbl-core/native/ts-lapack-eig-hermitian.d.ts +33 -0
- package/dist-browser/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-browser/numbl-core/parser/types.d.ts +1 -21
- package/{dist-lib/numbl-core/runtime → dist-browser/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/dist-browser/{graphics → numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-browser/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-browser/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-browser/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-browser/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-browser/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-browser/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-browser/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-browser/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-browser/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-browser/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-browser/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-browser/numbl-core/plotting/streamline.d.ts +16 -0
- package/{dist-graphics/graphics → dist-browser/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-browser/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-browser/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-browser/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-browser/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-browser/numbl-core/runtime/types.d.ts +12 -0
- package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-browser/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-browser/numbl-core/version.d.ts +1 -1
- package/dist-browser/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-browser/ts-lapack/src/BLAS/dsymv.d.ts +1 -0
- package/dist-browser/ts-lapack/src/BLAS/dsyr2.d.ts +1 -0
- package/dist-browser/ts-lapack/src/SRC/dlae2.d.ts +4 -0
- package/dist-browser/ts-lapack/src/SRC/dlaev2.d.ts +6 -0
- package/dist-browser/ts-lapack/src/SRC/dlanst.d.ts +1 -0
- package/dist-browser/ts-lapack/src/SRC/dlansy.d.ts +1 -0
- package/dist-browser/ts-lapack/src/SRC/dlasrt.d.ts +1 -0
- package/dist-browser/ts-lapack/src/SRC/dorgtr.d.ts +1 -0
- package/dist-browser/ts-lapack/src/SRC/dsteqr.d.ts +4 -0
- package/dist-browser/ts-lapack/src/SRC/dsyev.d.ts +1 -0
- package/dist-browser/ts-lapack/src/SRC/dsytd2.d.ts +1 -0
- package/dist-browser/vfs/syncVfsChanges.d.ts +2 -2
- package/dist-cli/cli.js +74241 -77271
- package/dist-graphics/graphics/FigureView.d.ts +1 -1
- package/dist-graphics/graphics/SurfView.d.ts +3 -2
- package/dist-graphics/graphics/drawPlot.d.ts +1 -1
- package/dist-graphics/graphics/exportFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/figureHashTransport.d.ts +1 -1
- package/dist-graphics/graphics/figureUpload.d.ts +1 -1
- package/dist-graphics/graphics/importFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/openInFigureViewer.d.ts +1 -1
- package/dist-graphics/graphics/plotHelpers.d.ts +1 -1
- package/dist-graphics/graphics/plotLegend.d.ts +1 -1
- package/dist-graphics/graphics/plotMarkers.d.ts +1 -1
- package/dist-graphics/graphics/restoreNaNs.d.ts +1 -1
- package/dist-graphics/graphics/uihtmlRelay.d.ts +16 -0
- package/dist-graphics/graphics-lib.d.ts +3 -3
- package/dist-graphics/index.js +294 -328
- package/{dist-lib/graphics → dist-graphics/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-graphics/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-graphics/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/{dist-browser/graphics → dist-graphics/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/browser/mip.d.ts +17 -0
- package/dist-lib/cli-scan.d.ts +8 -1
- package/dist-lib/lib.d.ts +1 -1
- package/dist-lib/lib.js +37081 -39889
- package/dist-lib/node.js +22 -14
- package/dist-lib/numbl-core/execSession.d.ts +39 -0
- package/dist-lib/numbl-core/executeCode.d.ts +10 -1
- package/dist-lib/numbl-core/executors/classification.d.ts +2 -10
- package/dist-lib/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-lib/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-lib/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-lib/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-lib/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-lib/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-lib/numbl-core/executors/registry.d.ts +32 -133
- package/dist-lib/numbl-core/executors/types.d.ts +30 -92
- package/dist-lib/numbl-core/functionResolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-lib/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-lib/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-lib/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-lib/numbl-core/helpers/sparse-direct.d.ts +107 -0
- package/dist-lib/numbl-core/helpers/warn.d.ts +9 -0
- package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +4 -1
- package/dist-lib/numbl-core/interpreter/builtins/sparse-solvers.d.ts +16 -0
- package/dist-lib/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-lib/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-lib/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-lib/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-lib/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-lib/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-lib/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-lib/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-lib/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-lib/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-lib/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-lib/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-lib/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-lib/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-lib/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-lib/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-lib/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-lib/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-lib/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-lib/numbl-core/native/lapack-bridge.d.ts +137 -128
- package/dist-lib/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-lib/numbl-core/native/ts-lapack-eig-hermitian.d.ts +33 -0
- package/dist-lib/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-lib/numbl-core/parser/types.d.ts +1 -21
- package/{dist-browser/numbl-core/runtime → dist-lib/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/{dist-graphics/graphics → dist-lib/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-lib/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-lib/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-lib/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-lib/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-lib/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-lib/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-lib/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-lib/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-lib/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-lib/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-lib/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-lib/numbl-core/plotting/streamline.d.ts +16 -0
- package/dist-lib/{graphics → numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-lib/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-lib/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-lib/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-lib/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-lib/numbl-core/runtime/types.d.ts +12 -0
- package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-lib/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-lib/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-lib/ts-lapack/src/BLAS/dsymv.d.ts +1 -0
- package/dist-lib/ts-lapack/src/BLAS/dsyr2.d.ts +1 -0
- package/dist-lib/ts-lapack/src/SRC/dlae2.d.ts +4 -0
- package/dist-lib/ts-lapack/src/SRC/dlaev2.d.ts +6 -0
- package/dist-lib/ts-lapack/src/SRC/dlanst.d.ts +1 -0
- package/dist-lib/ts-lapack/src/SRC/dlansy.d.ts +1 -0
- package/dist-lib/ts-lapack/src/SRC/dlasrt.d.ts +1 -0
- package/dist-lib/ts-lapack/src/SRC/dorgtr.d.ts +1 -0
- package/dist-lib/ts-lapack/src/SRC/dsteqr.d.ts +4 -0
- package/dist-lib/ts-lapack/src/SRC/dsyev.d.ts +1 -0
- package/dist-lib/ts-lapack/src/SRC/dsytd2.d.ts +1 -0
- package/dist-lib/vfs/unzipToFiles.d.ts +7 -0
- package/dist-plot-viewer/assets/index-C0fIevlp.js +4504 -0
- package/dist-plot-viewer/index.html +1 -1
- package/dist-site-viewer/assets/index-BDaviCH6.js +4832 -0
- package/dist-site-viewer/assets/numbl-worker-D6m4K2PP.js +5691 -0
- package/dist-site-viewer/index.html +2 -2
- package/native/lapack_eig.cpp +156 -0
- package/native/numbl_addon.cpp +8 -12
- package/native/numbl_addon_common.h +14 -5
- package/package.json +6 -5
- package/dist-browser/hooks/useProjectFiles.d.ts +0 -45
- package/dist-browser/numbl-core/executors/context.d.ts +0 -76
- package/dist-browser/numbl-core/executors/index.d.ts +0 -14
- package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-browser/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-browser/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-browser/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-browser/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-browser/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-graphics/graphics/surfColormap.d.ts +0 -2
- package/dist-lib/numbl-core/executors/context.d.ts +0 -76
- package/dist-lib/numbl-core/executors/index.d.ts +0 -14
- package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-lib/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-lib/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-lib/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-lib/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-lib/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-lib/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-plot-viewer/assets/index-YeXWXIxH.js +0 -4504
- package/dist-site-viewer/assets/index-B5Y5557F.js +0 -4831
- package/dist-site-viewer/assets/numbl-worker-CtoT7C0f.js +0 -5355
- package/native/elemwise.cpp +0 -360
- package/native/unary_elemwise.cpp +0 -67
- /package/dist-browser/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-graphics/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-lib/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
|
@@ -5,20 +5,10 @@
|
|
|
5
5
|
* If A is non-square, uses QR / LQ factorisation (dgels / dgeqrf+solve):
|
|
6
6
|
* overdetermined (m > n): least-squares solution minimising ||A*X - B||₂
|
|
7
7
|
* underdetermined (m < n): minimum-norm solution minimising ||X||₂
|
|
8
|
-
*
|
|
9
|
-
* Both the native LAPACK addon and the ts-lapack TypeScript fallback are
|
|
10
|
-
* supported; the native addon is preferred when available.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Dispatch linsolve to the native addon (preferred) or ts-lapack fallback.
|
|
14
|
-
* Returns null only when neither bridge exposes `linsolve` (should not happen
|
|
15
|
-
* in practice since ts-lapack always has it).
|
|
16
|
-
*/
|
|
17
|
-
export declare function linsolveLapack(A: Float64Array, m: number, n: number, B: Float64Array, nrhs: number): Float64Array | null;
|
|
18
|
-
/**
|
|
19
|
-
* Dispatch complex linsolve to the native addon (preferred) or ts-lapack fallback.
|
|
20
|
-
* The ts-lapack fallback throws — native addon is required for complex linsolve.
|
|
21
8
|
*/
|
|
9
|
+
/** Real A \ B through the LAPACK bridge. */
|
|
10
|
+
export declare function linsolveLapack(A: Float64Array, m: number, n: number, B: Float64Array, nrhs: number): Float64Array;
|
|
11
|
+
/** Complex A \ B through the LAPACK bridge. */
|
|
22
12
|
export declare function linsolveComplexLapack(ARe: Float64Array, AIm: Float64Array, m: number, n: number, BRe: Float64Array, BIm: Float64Array, nrhs: number): {
|
|
23
13
|
re: Float64Array;
|
|
24
14
|
im: Float64Array;
|
|
@@ -34,9 +34,6 @@ export declare function logicalAlongDim(v: RuntimeTensor, dim: number, mode: "an
|
|
|
34
34
|
/** Sum a sparse matrix along dim 1 (columns) or dim 2 (rows).
|
|
35
35
|
* Returns sparse for dim=1, dense tensor for dim=2. */
|
|
36
36
|
export declare function sparseSum(v: RuntimeSparseMatrix, dim: number): RuntimeValue;
|
|
37
|
-
/** any/all on sparse matrix along a dimension.
|
|
38
|
-
* Returns sparse for dim=1, dense for dim=2. */
|
|
39
|
-
export declare function sparseAnyAll(v: RuntimeSparseMatrix, dim: number, mode: "any" | "all"): RuntimeValue;
|
|
40
37
|
/** Type check for reductions that return Num without dim arg, Tensor with dim arg. */
|
|
41
38
|
/** Strip trailing 'omitnan'/'includenan' from args. Returns cleaned args and flag. */
|
|
42
39
|
export declare function parseNanFlag(args: RuntimeValue[]): {
|
|
@@ -62,5 +59,6 @@ export declare function sliceKernel(sliceFn: (slice: ArrayLike<number>) => numbe
|
|
|
62
59
|
export declare function accumKernelOmitNaN(reduceFn: (acc: number, val: number) => number, initial: number, finalizeFn?: (acc: number, count: number) => number): ReductionKernel;
|
|
63
60
|
/** Create a slice kernel that filters NaN before applying the function. */
|
|
64
61
|
export declare function sliceKernelOmitNaN(sliceFn: (slice: ArrayLike<number>) => number): ReductionKernel;
|
|
65
|
-
/**
|
|
62
|
+
/** The values of a numeric or logical scalar or array as a plain array (real
|
|
63
|
+
* parts only). Errors for other types. */
|
|
66
64
|
export declare function toNumArray(v: RuntimeValue, name: string): number[];
|
|
@@ -5,3 +5,13 @@ import { type RuntimeValue } from "../runtime/index.js";
|
|
|
5
5
|
import { type RuntimeTensor } from "../runtime/types.js";
|
|
6
6
|
/** Promote a scalar (number, logical, complex) to a 1×1 tensor. Tensors pass through. */
|
|
7
7
|
export declare function coerceToTensor(v: RuntimeValue, name: string): RuntimeTensor;
|
|
8
|
+
/** Validate one dimension value: MATLAB rejects NaN, Inf, and non-integer
|
|
9
|
+
* sizes; negative integers are silently clamped to 0. */
|
|
10
|
+
export declare function validateDim(x: number): number;
|
|
11
|
+
/** Extract a single scalar dimension. With multiple size args MATLAB requires
|
|
12
|
+
* each to be a scalar — a 1×1 array counts, but a multi-element vector errors
|
|
13
|
+
* with "Size inputs must be scalar." */
|
|
14
|
+
export declare function toScalarDim(v: RuntimeValue): number;
|
|
15
|
+
/** Parse shape arguments: zeros(2,3) or zeros([2,3]) -> [2, 3].
|
|
16
|
+
* Negative dimensions are clamped to 0. */
|
|
17
|
+
export declare function parseShapeArgs(args: RuntimeValue[]): number[];
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sparse direct solvers on the CSC representation (real arithmetic):
|
|
3
|
+
* Kronecker product, structural triangularity checks, triangular solves,
|
|
4
|
+
* up-looking sparse Cholesky, left-looking sparse LU with partial pivoting
|
|
5
|
+
* (Gilbert-Peierls), permutations, fill-reducing orderings (minimum degree,
|
|
6
|
+
* reverse Cuthill-McKee), and the `A \ b` driver used by mldivide.
|
|
7
|
+
*
|
|
8
|
+
* Complex sparse matrices are not handled here; callers fall back to the
|
|
9
|
+
* dense path for them.
|
|
10
|
+
*/
|
|
11
|
+
import { type RuntimeSparseMatrix, type RuntimeTensor, type SparseTriInfo } from "../runtime/types.js";
|
|
12
|
+
type Sp = RuntimeSparseMatrix;
|
|
13
|
+
export declare const SINGULAR_WARNING = "Matrix is singular to working precision.";
|
|
14
|
+
/** Convert a dense tensor to CSC (dropping zeros). */
|
|
15
|
+
export declare function denseToSparse(t: RuntimeTensor): Sp;
|
|
16
|
+
/** Build CSC from column-major dense data, dropping zeros. */
|
|
17
|
+
export declare function denseDataToSparse(data: Float64Array, m: number, n: number): Sp;
|
|
18
|
+
/** Sparse permutation matrix P with P(k, p[k]) = 1, so (P*A)(k,:) = A(p[k],:). */
|
|
19
|
+
export declare function permutationMatrix(p: Int32Array | number[]): Sp;
|
|
20
|
+
/** 1-based row vector from a 0-based permutation. */
|
|
21
|
+
export declare function permVectorTensor(p: Int32Array): RuntimeTensor;
|
|
22
|
+
export declare function invertPerm(p: Int32Array): Int32Array;
|
|
23
|
+
/** C = A(p, q) for 0-based permutations p (rows) and q (columns). */
|
|
24
|
+
export declare function sparsePermute(A: Sp, p: Int32Array, q: Int32Array): Sp;
|
|
25
|
+
export declare function sparseKron(A: Sp, B: Sp): Sp;
|
|
26
|
+
/**
|
|
27
|
+
* One O(nnz) pass over the pattern: is the matrix upper / lower triangular
|
|
28
|
+
* (explicitly stored zeros ignored), and where is each diagonal entry. The
|
|
29
|
+
* result is cached on the matrix object.
|
|
30
|
+
*/
|
|
31
|
+
export declare function triangularInfo(S: Sp): SparseTriInfo;
|
|
32
|
+
/** True if every stored nonzero lies on or above the diagonal. */
|
|
33
|
+
export declare function sparseIsUpper(S: Sp): boolean;
|
|
34
|
+
/** True if every stored nonzero lies on or below the diagonal. */
|
|
35
|
+
export declare function sparseIsLower(S: Sp): boolean;
|
|
36
|
+
/** Exact numerical symmetry (A == A'), real sparse only. */
|
|
37
|
+
export declare function sparseIsSymmetric(S: Sp): boolean;
|
|
38
|
+
/** Solve R * X = B for upper-triangular R (n×n), B column-major n×nrhs.
|
|
39
|
+
* Returns the solution in a fresh array and whether a zero pivot was hit. */
|
|
40
|
+
export declare function sparseSolveUpper(R: Sp, B: Float64Array, nrhs: number): {
|
|
41
|
+
x: Float64Array;
|
|
42
|
+
singular: boolean;
|
|
43
|
+
};
|
|
44
|
+
/** Solve L * X = B for lower-triangular L (n×n). */
|
|
45
|
+
export declare function sparseSolveLower(L: Sp, B: Float64Array, nrhs: number): {
|
|
46
|
+
x: Float64Array;
|
|
47
|
+
singular: boolean;
|
|
48
|
+
};
|
|
49
|
+
export interface CholResult {
|
|
50
|
+
/** Lower factor with L * L' = A (only when ok). */
|
|
51
|
+
L: Sp;
|
|
52
|
+
ok: boolean;
|
|
53
|
+
/** 0 on success, otherwise the 1-based column at which the pivot failed. */
|
|
54
|
+
p: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Cholesky factorization of a symmetric positive definite sparse matrix.
|
|
58
|
+
* Only the upper triangle of A is read; symmetry is not checked. On failure
|
|
59
|
+
* returns the leading (p-1)×(p-1) factor computed so far.
|
|
60
|
+
*/
|
|
61
|
+
export declare function sparseChol(A: Sp): CholResult;
|
|
62
|
+
export interface LuResult {
|
|
63
|
+
/** Unit lower triangular, m × min(m,n), rows in pivot order. */
|
|
64
|
+
L: Sp;
|
|
65
|
+
/** Upper triangular, min(m,n) × n. */
|
|
66
|
+
U: Sp;
|
|
67
|
+
/** Row permutation: row k of P*A*Q is row p[k] of A. */
|
|
68
|
+
p: Int32Array;
|
|
69
|
+
/** Column permutation: column k of P*A*Q is column q[k] of A. */
|
|
70
|
+
q: Int32Array;
|
|
71
|
+
singular: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* LU factorization P*A*Q = L*U of a real sparse matrix with threshold
|
|
75
|
+
* partial pivoting (tol = 1 is plain partial pivoting; smaller values prefer
|
|
76
|
+
* the diagonal entry when it is at least tol times the largest candidate).
|
|
77
|
+
*/
|
|
78
|
+
export declare function sparseLu(A: Sp, q: Int32Array | null, tol: number): LuResult;
|
|
79
|
+
export declare function identityPerm(n: number): Int32Array;
|
|
80
|
+
/**
|
|
81
|
+
* Minimum degree ordering on the pattern of A + A', computed on an explicit
|
|
82
|
+
* elimination graph. Returns a 0-based permutation p such that A(p,p) tends
|
|
83
|
+
* to have a sparser Cholesky factor. This is a plain minimum-degree
|
|
84
|
+
* ordering, not MATLAB's approximate minimum degree, so the permutation
|
|
85
|
+
* differs from MATLAB's `amd` while serving the same purpose.
|
|
86
|
+
*/
|
|
87
|
+
export declare function minimumDegreeOrdering(A: Sp): Int32Array;
|
|
88
|
+
/**
|
|
89
|
+
* Reverse Cuthill-McKee ordering on the pattern of A + A'. Returns a 0-based
|
|
90
|
+
* permutation that tends to reduce the bandwidth of A(p,p).
|
|
91
|
+
*/
|
|
92
|
+
export declare function reverseCuthillMcKee(A: Sp): Int32Array;
|
|
93
|
+
/** Column ordering for LU: minimum degree on the pattern of A'*A. */
|
|
94
|
+
export declare function columnOrdering(A: Sp): Int32Array;
|
|
95
|
+
/**
|
|
96
|
+
* Solve A * X = B for square real sparse A and dense B (n × nrhs,
|
|
97
|
+
* column-major). Returns null when the caller should use the dense path
|
|
98
|
+
* (non-square, complex, or nearly full A).
|
|
99
|
+
*/
|
|
100
|
+
export declare function sparseSolve(A: Sp, B: Float64Array, nrhs: number): Float64Array | null;
|
|
101
|
+
/** Solve with precomputed LU factors: X = Q * U \ (L \ (P * B)). */
|
|
102
|
+
export declare function luSolve(lu: LuResult, B: Float64Array, nrhs: number): Float64Array;
|
|
103
|
+
/** Solve with LU factors of A for the transposed system A' * X = B. */
|
|
104
|
+
export declare function luSolveTransposed(lu: LuResult, B: Float64Array, nrhs: number): Float64Array;
|
|
105
|
+
/** Inverse of a square real sparse matrix, returned sparse. */
|
|
106
|
+
export declare function sparseInverse(A: Sp): Sp;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MATLAB-style warnings from helper code that has no Runtime handle.
|
|
3
|
+
*
|
|
4
|
+
* The Runtime installs a sink that routes messages through its output
|
|
5
|
+
* channel ("Warning: <msg>"); before a Runtime exists, messages fall back
|
|
6
|
+
* to console.warn.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setWarningSink(fn: (msg: string) => void): void;
|
|
9
|
+
export declare function emitWarning(msg: string): void;
|
|
@@ -27,6 +27,7 @@ import "./cell-struct.js";
|
|
|
27
27
|
import "./time-system.js";
|
|
28
28
|
import "./datetime.js";
|
|
29
29
|
import "./sparse.js";
|
|
30
|
+
import "./sparse-solvers.js";
|
|
30
31
|
import "./graph.js";
|
|
31
32
|
import "./gallery.js";
|
|
32
33
|
import "./special-math.js";
|
|
@@ -35,6 +36,8 @@ import "./misc.js";
|
|
|
35
36
|
import "./dictionary.js";
|
|
36
37
|
import "./hash.js";
|
|
37
38
|
import "./help-text.js";
|
|
38
|
-
export { getIBuiltin, getIBuiltinHelp, getIBuiltinNargin, getAllIBuiltinNames, registerBuiltinHelp, inferJitType, } from "./types.js";
|
|
39
|
+
export { getIBuiltin, getIBuiltinHelp, getIBuiltinNargin, getAllIBuiltinNames, registerBuiltinHelp, inferJitType, inferDispatchType, } from "./types.js";
|
|
39
40
|
export type { IBuiltin, IBuiltinResolution, BuiltinHelp } from "./types.js";
|
|
40
41
|
export { resetAppdataStore, convertJsonValue } from "./misc.js";
|
|
42
|
+
import "../../runtime/specialBuiltins.js";
|
|
43
|
+
import "../../plotting/builtins.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sparse direct-solver builtins: fill-reducing orderings (symrcm, amd,
|
|
3
|
+
* colamd), random sparse matrices (sprand, sprandn, sprandsym), and the
|
|
4
|
+
* `decomposition` object that stores factors for repeated solves.
|
|
5
|
+
*
|
|
6
|
+
* The factorizations themselves live in helpers/sparse-direct.ts; chol, lu,
|
|
7
|
+
* kron, inv and the operators `\` and `/` dispatch to them from
|
|
8
|
+
* linear-algebra.ts and helpers/arithmetic.ts.
|
|
9
|
+
*/
|
|
10
|
+
import type { RuntimeValue } from "../../runtime/types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Hook for the mldivide / mrdivide operator builtins: `dA \ B` and `B / dA`
|
|
13
|
+
* with a decomposition object. Returns undefined when neither operand is a
|
|
14
|
+
* decomposition so the ordinary operator runs.
|
|
15
|
+
*/
|
|
16
|
+
export declare function tryDecompositionDivide(name: "mldivide" | "mrdivide", a: RuntimeValue, b: RuntimeValue): RuntimeValue | undefined;
|
|
@@ -20,16 +20,16 @@ export interface IBuiltin {
|
|
|
20
20
|
}
|
|
21
21
|
export declare function getIBuiltin(name: string): IBuiltin | undefined;
|
|
22
22
|
export declare function registerIBuiltin(b: IBuiltin): void;
|
|
23
|
-
/** Register a dynamic IBuiltin (e.g. .js user functions), replacing any
|
|
24
|
-
* existing entry with the same name without error. */
|
|
25
|
-
export declare function registerDynamicIBuiltin(b: IBuiltin): void;
|
|
26
|
-
export declare function unregisterIBuiltin(name: string): void;
|
|
27
23
|
export declare function getAllIBuiltinNames(): string[];
|
|
28
24
|
export declare function getIBuiltinHelp(name: string): BuiltinHelp | undefined;
|
|
29
25
|
export declare function registerBuiltinHelp(name: string, help: BuiltinHelp): void;
|
|
30
26
|
/** Probe an IBuiltin to determine its nargin (number of input args).
|
|
31
27
|
* Tries resolve with 1, 2, 3 number-type args to find the accepted count. */
|
|
32
28
|
export declare function getIBuiltinNargin(name: string): number | undefined;
|
|
29
|
+
/** Builtin dispatch only looks at the kind and class of a struct or object
|
|
30
|
+
* argument, never its field types, so it skips the walk over the fields
|
|
31
|
+
* that the JIT's specialization needs. */
|
|
32
|
+
export declare function inferDispatchType(value: unknown): JitType;
|
|
33
33
|
export declare function inferJitType(value: unknown): JitType;
|
|
34
34
|
export declare function mkc(re: number, im: number): number | RuntimeComplexNumber;
|
|
35
35
|
export declare function makeTensor(data: Float64Array, imag: Float64Array | undefined, shape: number[]): RuntimeTensor;
|
|
@@ -83,9 +83,9 @@ interface UnaryElemwiseSpec {
|
|
|
83
83
|
};
|
|
84
84
|
/** Use applyUnaryElemwiseMaybeComplex instead of applyUnaryElemwise */
|
|
85
85
|
maybeComplex?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
/** OpUnary code for the tensor-ops dispatch. Used by the maybeComplex path
|
|
87
|
+
* so that e.g. sqrt/log can run in native C on the common all-in-domain
|
|
88
|
+
* case, then fall back for NaN entries only. */
|
|
89
89
|
nativeOpCode?: number;
|
|
90
90
|
}
|
|
91
91
|
/** Generate cases for a unary element-wise builtin. Each accepted kind gets
|
|
@@ -72,6 +72,10 @@ export declare class Interpreter {
|
|
|
72
72
|
* post-loop liveness scan can't see reads after the enclosing block —
|
|
73
73
|
* the classifier must then keep every loop-assigned name live-out. */
|
|
74
74
|
condBlockDepth: number;
|
|
75
|
+
/** @internal Number of enclosing `try` bodies being executed, across
|
|
76
|
+
* calls. The C-JIT declines while it is non-zero: a runtime error in
|
|
77
|
+
* compiled C exits the process, so it can't be caught. */
|
|
78
|
+
tryDepth: number;
|
|
75
79
|
/** @internal */
|
|
76
80
|
functionDefCache: Map<string, FunctionDef>;
|
|
77
81
|
/** @internal Pre-built line break tables for offset→line lookup per file. */
|
|
@@ -103,11 +107,6 @@ export declare class Interpreter {
|
|
|
103
107
|
/** Bridge for loading native shared libraries. Undefined in browser
|
|
104
108
|
* contexts. */
|
|
105
109
|
nativeBridge?: import("../workspace/types.js").NativeBridge;
|
|
106
|
-
/** Telemetry: invoked after a registered executor's `run()` succeeds.
|
|
107
|
-
* Used to track which optimizers fire in a session. The kind is the
|
|
108
|
-
* LoweredStmt kind the executor handled ("top-level", "loop", "call",
|
|
109
|
-
* ...). Hot path — keep the callback cheap. */
|
|
110
|
-
onExecutorFired?: (name: string, kind: string) => void;
|
|
111
110
|
/** Verbose log sink (plumbed from ExecOptions.log). */
|
|
112
111
|
log?: (message: string) => void;
|
|
113
112
|
/** Executor registry. Holds the strategies (JS-JIT, C-kernel, ...)
|
|
@@ -207,6 +206,7 @@ export declare class Interpreter {
|
|
|
207
206
|
propertyDefaults: Map<string, Expr>;
|
|
208
207
|
};
|
|
209
208
|
isHandleClass: (classInfo: ClassInfo) => boolean;
|
|
210
|
-
|
|
209
|
+
evalPropertyDefault: (className: string, propName: string, defaultExpr: Expr) => RuntimeValue;
|
|
210
|
+
evalInLocalScope: (codeArg: unknown, fileName?: string, nargout?: number) => unknown;
|
|
211
211
|
processArgumentsBlocks: (fn: FunctionDef, args: unknown[]) => void;
|
|
212
212
|
}
|
|
@@ -49,12 +49,20 @@ export declare function findFunctionInWorkspaceFile(this: Interpreter, wsName: s
|
|
|
49
49
|
export declare function findFunctionInClassFile(this: Interpreter, className: string, funcName: string, methodScope?: string): FunctionDef | null;
|
|
50
50
|
export declare function findMethodInClass(this: Interpreter, classInfo: ClassInfo, methodName: string): FunctionDef | null;
|
|
51
51
|
export declare function findExternalMethod(this: Interpreter, classInfo: ClassInfo, methodName: string): FunctionDef | null;
|
|
52
|
+
/** Evaluate a property's default value expression. MATLAB reports an
|
|
53
|
+
* invalid default as an error rather than leaving the property unset. */
|
|
54
|
+
export declare function evalPropertyDefault(this: Interpreter, className: string, propName: string, defaultExpr: Expr): RuntimeValue;
|
|
52
55
|
export declare function collectClassProperties(this: Interpreter, classInfo: ClassInfo): {
|
|
53
56
|
propertyNames: string[];
|
|
54
57
|
propertyDefaults: Map<string, Expr>;
|
|
55
58
|
};
|
|
56
59
|
export declare function isHandleClass(this: Interpreter, classInfo: ClassInfo): boolean;
|
|
57
|
-
|
|
60
|
+
/** Run MATLAB text in the current scope (eval, evalin, run, input,
|
|
61
|
+
* str2num). With `nargout` > 0 the text must be one expression, whose
|
|
62
|
+
* value(s) are returned; otherwise its statements run (displaying
|
|
63
|
+
* unsuppressed results) and nothing is returned. `fileName` sets the file
|
|
64
|
+
* context, e.g. for `run(script)`. */
|
|
65
|
+
export declare function evalInLocalScope(this: Interpreter, codeArg: unknown, fileName?: string, nargout?: number): unknown;
|
|
58
66
|
/**
|
|
59
67
|
* Apply `arguments`-block defaults and build name-value struct parameters,
|
|
60
68
|
* binding the results into the *current* function environment.
|
|
@@ -9,7 +9,7 @@ export interface InterpreterContext {
|
|
|
9
9
|
setEnv: (env: Environment) => void;
|
|
10
10
|
callerEnv: Environment | undefined;
|
|
11
11
|
workspaceEnv: Environment | undefined;
|
|
12
|
-
evalInLocalScope: (codeArg: unknown, fileName?: string) => unknown;
|
|
12
|
+
evalInLocalScope: (codeArg: unknown, fileName?: string, nargout?: number) => unknown;
|
|
13
13
|
callFunction: (name: string, args: unknown[], nargout: number) => unknown;
|
|
14
14
|
rt: Runtime;
|
|
15
15
|
/** Optimization mode: "0" = no JIT, "1" = JS-JIT, "2" = C-JIT. */
|
|
@@ -18,8 +18,8 @@ export interface InterpreterContext {
|
|
|
18
18
|
* or undefined if no workspace file provides that name.
|
|
19
19
|
* `kind` distinguishes a regular .m function from a .numbl.js
|
|
20
20
|
* user function (treated as a MEX-equivalent) or a class file.
|
|
21
|
-
* `source` is the raw .m source for "function"/"class" kinds, or
|
|
22
|
-
*
|
|
21
|
+
* `source` is the raw .m source for "function"/"class" kinds, or the
|
|
22
|
+
* help text registered by a "jsfunction" (empty if none). */
|
|
23
23
|
lookupWorkspaceFile: (name: string) => {
|
|
24
24
|
path: string;
|
|
25
25
|
kind: "function" | "jsfunction" | "class";
|
|
@@ -29,6 +29,9 @@ export interface InterpreterContext {
|
|
|
29
29
|
* ones, in declaration order. Returns undefined if `className` is not a
|
|
30
30
|
* known class. Backs `properties(obj)`. */
|
|
31
31
|
classPublicProperties: (className: string) => string[] | undefined;
|
|
32
|
+
/** Public method names of a class (including inherited, static and the
|
|
33
|
+
* constructor), or undefined if not a known class. Backs `ismethod`. */
|
|
34
|
+
classPublicMethods: (className: string) => Set<string> | undefined;
|
|
32
35
|
}
|
|
33
36
|
export declare const FALL_THROUGH: unique symbol;
|
|
34
37
|
export type InterpreterSpecialBuiltinHandler = (ctx: InterpreterContext, args: unknown[], nargout: number) => unknown | typeof FALL_THROUGH;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Helpers shared across multiple builtin files.
|
|
3
3
|
*/
|
|
4
4
|
import type { Span } from "../../parser/index.js";
|
|
5
|
-
import { type Type
|
|
5
|
+
import { type Type } from "../../lowering/types.js";
|
|
6
6
|
export declare function requireScalarRealDouble(t: Type, what: string, span?: Span): void;
|
|
7
7
|
/** Like `requireScalarRealDouble` but accepts non-scalar real doubles
|
|
8
8
|
* (the elemwise path). Logical also accepted (stored as double in C). */
|
|
@@ -37,7 +37,3 @@ export declare function exactScalarAsComplex(t: Type): {
|
|
|
37
37
|
re: number;
|
|
38
38
|
im: number;
|
|
39
39
|
} | undefined;
|
|
40
|
-
/** True when this numeric is statically known to be complex (the static
|
|
41
|
-
* flag, not the runtime value). Centralizes the predicate so callers
|
|
42
|
-
* don't sprinkle `(t as NumericType).isComplex` checks. */
|
|
43
|
-
export declare function isStaticComplex(t: Type): t is NumericType;
|
|
@@ -59,8 +59,7 @@ export declare function broadcastFoldExact(a: NumericType, b: NumericType, outSh
|
|
|
59
59
|
* `complexFold` / `complexScalarExpr` / `complexRuntimeDeps` are
|
|
60
60
|
* optional; when set, a scalar+scalar op with at least one complex
|
|
61
61
|
* operand routes through them (and `transfer` returns a complex
|
|
62
|
-
* result).
|
|
63
|
-
* rejected until Phase 3 lands the runtime helpers.
|
|
62
|
+
* result).
|
|
64
63
|
*/
|
|
65
64
|
export declare function defineElemwiseRealBinary(opts: {
|
|
66
65
|
name: string;
|
|
@@ -5,9 +5,9 @@ interface ComplexPredSpec {
|
|
|
5
5
|
* to `1.0` / `0.0`. */
|
|
6
6
|
cScalarComplex: (re: string, im: string) => string;
|
|
7
7
|
/** JS scalar expression: same shape as `cScalarComplex` but for
|
|
8
|
-
* the
|
|
8
|
+
* the JS path; operates on real-and-imag JS expressions. */
|
|
9
9
|
jsScalarComplex: (re: string, im: string) => string;
|
|
10
|
-
/** JS fold
|
|
10
|
+
/** JS fold rule on a `{re, im}` value. */
|
|
11
11
|
jsFnComplex: (re: number, im: number) => boolean;
|
|
12
12
|
/** Runtime tensor helper name (in `tensor_predicate_complex.h`). */
|
|
13
13
|
tensorHelperComplex: string;
|
|
@@ -18,7 +18,7 @@ export interface UnaryPredOpts {
|
|
|
18
18
|
cScalar: (arg: string) => string;
|
|
19
19
|
/** JS scalar expression given the arg's JS text. */
|
|
20
20
|
jsScalar: (arg: string) => string;
|
|
21
|
-
/** JS fold
|
|
21
|
+
/** JS fold rule. */
|
|
22
22
|
jsFn: (x: number) => boolean;
|
|
23
23
|
/** Runtime tensor helper name (in `tensor_predicate.h`). */
|
|
24
24
|
tensorHelper: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* cell-element type being `char` (matches MATLAB and the
|
|
6
6
|
* interpreter, which also emits chars).
|
|
7
7
|
*
|
|
8
|
-
* Interpreter-only for now; the
|
|
8
|
+
* Interpreter-only for now; the JIT would need to materialize
|
|
9
9
|
* a heterogeneous-len cell of chars which is a different feature
|
|
10
10
|
* class. The `emitC` / `emitJs` hooks exist so the registry-shape
|
|
11
11
|
* invariant holds but they raise `UnsupportedConstruct` rather than
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* error; the inputs simply compare unequal.
|
|
8
8
|
* - Either arg non-text → `false`. Numbl gates the comparison
|
|
9
9
|
* behind `isText(a) && isText(b)`; non-text just yields `0`
|
|
10
|
-
* silently. We mirror that
|
|
10
|
+
* silently. We mirror that.
|
|
11
11
|
* - Cell-of-text vectorization (`strcmp({'a','b'}, 'a')`) is in
|
|
12
12
|
* numbl but cells aren't yet a feature class in mtoc2 — that
|
|
13
13
|
* overload will fall out naturally when cells land.
|
|
@@ -5,8 +5,7 @@ export interface UnaryRealMathOpts {
|
|
|
5
5
|
name: string;
|
|
6
6
|
/** C `<math.h>` function name for the scalar path (e.g. `"cos"`). */
|
|
7
7
|
cFnReal: string;
|
|
8
|
-
/** JS-side scalar fn for compile-time fold
|
|
9
|
-
* `call` hook). */
|
|
8
|
+
/** JS-side scalar fn for compile-time fold. */
|
|
10
9
|
jsFn: (x: number) => number;
|
|
11
10
|
/** Optional JS expression form (textual) for `emitJs`'s scalar real
|
|
12
11
|
* path. Defaults to `Math.${name}(arg)` which works for most names
|
|
@@ -14,6 +13,10 @@ export interface UnaryRealMathOpts {
|
|
|
14
13
|
* Override for `fix` (`Math.trunc`) and `round`
|
|
15
14
|
* (custom half-away-from-zero form). */
|
|
16
15
|
jsExpr?: (arg: string) => string;
|
|
16
|
+
/** Optional `mtoc2_`-prefixed helper from `tensor_unary_real_math.js`
|
|
17
|
+
* for `emitJs`'s scalar real path. Activates that snippet and takes
|
|
18
|
+
* precedence over `jsExpr`. */
|
|
19
|
+
jsFnReal?: string;
|
|
17
20
|
/** Sign refinement on the result type. Called with the (validated)
|
|
18
21
|
* real-numeric input type. */
|
|
19
22
|
signRule: (t: NumericType) => Sign;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** `realsqrt(x)`: square root that stays real. Unlike `sqrt`, an input
|
|
2
|
+
* of unknown sign stays on the real path; a negative element raises
|
|
3
|
+
* MATLAB's error at run time instead of lifting to complex. An input
|
|
4
|
+
* known to be negative (sign or exact value) declines, so the
|
|
5
|
+
* interpreter raises the error. */
|
|
6
|
+
export declare const realsqrt: import("../../registry.js").Builtin;
|
|
@@ -103,11 +103,6 @@ export declare function reductionEmitJs(spec: {
|
|
|
103
103
|
dimArgIndex: 1 | 2;
|
|
104
104
|
outputElem: "double" | "logical";
|
|
105
105
|
}): Builtin["emitJs"];
|
|
106
|
-
export declare function reductionCall(spec: {
|
|
107
|
-
name: string;
|
|
108
|
-
dimArgIndex: 1 | 2;
|
|
109
|
-
outputElem: "double" | "logical";
|
|
110
|
-
}): Builtin["call"];
|
|
111
106
|
export declare function reductionEmit(spec: {
|
|
112
107
|
name: string;
|
|
113
108
|
dimArgIndex: 1 | 2;
|
|
@@ -25,10 +25,6 @@
|
|
|
25
25
|
* time gives a proper span.
|
|
26
26
|
*/
|
|
27
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
28
|
/** Runtime dim validator shared by both backends. Mirrors the
|
|
33
29
|
* interpreter's `validateDim` (interpreter/builtins/array-construction.ts):
|
|
34
30
|
* a non-finite or non-integer size is an error, a negative size clamps
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* - argument validation (1..2 args, real-double tensor, k literal int)
|
|
7
7
|
* - `transfer` (exact-fold when input data fits)
|
|
8
|
-
* - hooks builders (emitC / emitJs
|
|
8
|
+
* - hooks builders (emitC / emitJs) parameterized by the
|
|
9
9
|
* family-specific predicate + runtime helper.
|
|
10
10
|
*
|
|
11
11
|
* Mirrors `triPart` in numbl's
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
* both supported; sparse inputs and rank > 2 are deferred / rejected.
|
|
14
14
|
*/
|
|
15
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
16
|
interface TriangularSpec {
|
|
19
17
|
/** Source-level name (registry key). */
|
|
20
18
|
name: string;
|
|
@@ -25,10 +23,6 @@ interface TriangularSpec {
|
|
|
25
23
|
cHelperComplex: string;
|
|
26
24
|
/** Keep predicate matching numbl's `triPart` (column-major i,j). */
|
|
27
25
|
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
26
|
}
|
|
33
27
|
export declare function defineTriangular(spec: TriangularSpec): Builtin;
|
|
34
|
-
export {
|
|
28
|
+
export {};
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
* it's a runtime error. mtoc2 lifts the equality check into
|
|
11
11
|
* `transfer` so the mismatch is a type-time error.
|
|
12
12
|
*
|
|
13
|
-
* The result types are the input types as-is. The
|
|
14
|
-
*
|
|
15
|
-
* "freshly-owned at every consume site" invariant; the
|
|
16
|
-
*
|
|
17
|
-
* interpreter follows numbl and deep-clones owned values too.
|
|
13
|
+
* The result types are the input types as-is. The C backend still
|
|
14
|
+
* has to emit `_copy(...)` for owned types to satisfy the
|
|
15
|
+
* "freshly-owned at every consume site" invariant; the JS backend
|
|
16
|
+
* uses `mtoc2_deep_clone` for the same reason.
|
|
18
17
|
*/
|
|
19
18
|
import type { Builtin } from "../../registry.js";
|
|
20
19
|
export declare const deal: Builtin;
|
|
@@ -2,35 +2,13 @@
|
|
|
2
2
|
* feval(handle_or_name, args...) — invoke a function handle (or a
|
|
3
3
|
* function named by a char) with the given args.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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.
|
|
5
|
+
* The lowerer intercepts `feval(...)` in `lowerFuncCall` and
|
|
6
|
+
* `lowerMultiAssign` and rewrites it to a direct call on the
|
|
7
|
+
* underlying handle / function name (see `tryLowerFevalCall`), since
|
|
8
|
+
* invoking a user function needs specialization that a builtin emit
|
|
9
|
+
* hook can't do. This def exists to keep `feval` in
|
|
10
|
+
* `allBuiltinNames()` and as a safety net: every hook raises
|
|
11
|
+
* `UnsupportedConstruct`.
|
|
34
12
|
*/
|
|
35
13
|
import type { Builtin } from "../../registry.js";
|
|
36
14
|
export declare const feval: Builtin;
|