/ concept-collection / turing-surface
Sign in
concept-collection / turing-surface
27 lines · 1021 BCodeBlameHistory
2 * The shared MATLAB utilities in `tools/`, as interpreter workspace files.
3 *
4 * A geometry or a seeding draw is evaluated by numbl's interpreter (see
5 * src/geom/geometry.ts), which resolves a call like `randnfunsphere(...)`
6 * against the workspace files it is handed. Everything in `tools/` is handed
7 * to every such run, so any .m can call any tool by name — MATLAB's own path
8 * semantics, where the file name is the function name.
9 *
10 * These are *not* available to the models: a model's step compiles to WGSL,
11 * where none of this exists.
12 */
13const sources = import.meta.glob('../tools/*.m', {
14 query: '?raw',
15 eager: true,
16 import: 'default',
17}) as Record<string, string>;
19export interface ToolFile {
20 name: string;
21 source: string;
24/** Every tool, named as MATLAB wants it (`randnfunsphere.m`). */
25export const toolFiles: ToolFile[] = Object.entries(sources)
26 .map(([path, source]) => ({ name: path.slice(path.lastIndexOf('/') + 1), source }))
27 .sort((a, b) => a.name.localeCompare(b.name));
moveopenescclose