runmat 0.4.9-dev.1 → 0.4.9

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 (94) hide show
  1. package/artifacts/stdlib.snapshot +0 -0
  2. package/dist/builtins.d.ts +1 -0
  3. package/dist/builtins.d.ts.map +1 -1
  4. package/dist/builtins.js.map +1 -1
  5. package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
  6. package/dist/generated/builtin-examples-catalog.js +1 -1
  7. package/dist/generated/builtin-examples-catalog.js.map +1 -1
  8. package/dist/generated/builtins/complex.d.ts +4 -0
  9. package/dist/generated/builtins/complex.d.ts.map +1 -0
  10. package/dist/generated/builtins/complex.js +157 -0
  11. package/dist/generated/builtins/complex.js.map +1 -0
  12. package/dist/generated/builtins/cosd.d.ts +4 -0
  13. package/dist/generated/builtins/cosd.d.ts.map +1 -0
  14. package/dist/generated/builtins/cosd.js +109 -0
  15. package/dist/generated/builtins/cosd.js.map +1 -0
  16. package/dist/generated/builtins/db.d.ts +4 -0
  17. package/dist/generated/builtins/db.d.ts.map +1 -0
  18. package/dist/generated/builtins/db.js +122 -0
  19. package/dist/generated/builtins/db.js.map +1 -0
  20. package/dist/generated/builtins/fgetl.d.ts +4 -0
  21. package/dist/generated/builtins/fgetl.d.ts.map +1 -0
  22. package/dist/generated/builtins/fgetl.js +133 -0
  23. package/dist/generated/builtins/fgetl.js.map +1 -0
  24. package/dist/generated/builtins/fgets.d.ts.map +1 -1
  25. package/dist/generated/builtins/fgets.js +4 -0
  26. package/dist/generated/builtins/fgets.js.map +1 -1
  27. package/dist/generated/builtins/fill3.d.ts +4 -0
  28. package/dist/generated/builtins/fill3.d.ts.map +1 -0
  29. package/dist/generated/builtins/fill3.js +152 -0
  30. package/dist/generated/builtins/fill3.js.map +1 -0
  31. package/dist/generated/builtins/fminbnd.d.ts +4 -0
  32. package/dist/generated/builtins/fminbnd.d.ts.map +1 -0
  33. package/dist/generated/builtins/fminbnd.js +104 -0
  34. package/dist/generated/builtins/fminbnd.js.map +1 -0
  35. package/dist/generated/builtins/impulse.d.ts +4 -0
  36. package/dist/generated/builtins/impulse.d.ts.map +1 -0
  37. package/dist/generated/builtins/impulse.js +123 -0
  38. package/dist/generated/builtins/impulse.js.map +1 -0
  39. package/dist/generated/builtins/integral.d.ts +4 -0
  40. package/dist/generated/builtins/integral.d.ts.map +1 -0
  41. package/dist/generated/builtins/integral.js +101 -0
  42. package/dist/generated/builtins/integral.js.map +1 -0
  43. package/dist/generated/builtins/mode.d.ts +4 -0
  44. package/dist/generated/builtins/mode.d.ts.map +1 -0
  45. package/dist/generated/builtins/mode.js +146 -0
  46. package/dist/generated/builtins/mode.js.map +1 -0
  47. package/dist/generated/builtins/optimset.d.ts.map +1 -1
  48. package/dist/generated/builtins/optimset.js +8 -4
  49. package/dist/generated/builtins/optimset.js.map +1 -1
  50. package/dist/generated/builtins/patch.d.ts +4 -0
  51. package/dist/generated/builtins/patch.d.ts.map +1 -0
  52. package/dist/generated/builtins/patch.js +135 -0
  53. package/dist/generated/builtins/patch.js.map +1 -0
  54. package/dist/generated/builtins/repelem.d.ts +4 -0
  55. package/dist/generated/builtins/repelem.d.ts.map +1 -0
  56. package/dist/generated/builtins/repelem.js +135 -0
  57. package/dist/generated/builtins/repelem.js.map +1 -0
  58. package/dist/generated/builtins/sawtooth.d.ts +4 -0
  59. package/dist/generated/builtins/sawtooth.d.ts.map +1 -0
  60. package/dist/generated/builtins/sawtooth.js +111 -0
  61. package/dist/generated/builtins/sawtooth.js.map +1 -0
  62. package/dist/generated/builtins/sinc.d.ts +4 -0
  63. package/dist/generated/builtins/sinc.d.ts.map +1 -0
  64. package/dist/generated/builtins/sinc.js +142 -0
  65. package/dist/generated/builtins/sinc.js.map +1 -0
  66. package/dist/generated/builtins/sind.d.ts +4 -0
  67. package/dist/generated/builtins/sind.d.ts.map +1 -0
  68. package/dist/generated/builtins/sind.js +109 -0
  69. package/dist/generated/builtins/sind.js.map +1 -0
  70. package/dist/generated/builtins/square.d.ts +4 -0
  71. package/dist/generated/builtins/square.d.ts.map +1 -0
  72. package/dist/generated/builtins/square.js +110 -0
  73. package/dist/generated/builtins/square.js.map +1 -0
  74. package/dist/generated/builtins/step.d.ts +4 -0
  75. package/dist/generated/builtins/step.d.ts.map +1 -0
  76. package/dist/generated/builtins/step.js +125 -0
  77. package/dist/generated/builtins/step.js.map +1 -0
  78. package/dist/generated/builtins/tand.d.ts +4 -0
  79. package/dist/generated/builtins/tand.d.ts.map +1 -0
  80. package/dist/generated/builtins/tand.js +109 -0
  81. package/dist/generated/builtins/tand.js.map +1 -0
  82. package/dist/generated/builtins-manifest.d.ts.map +1 -1
  83. package/dist/generated/builtins-manifest.js +363 -1
  84. package/dist/generated/builtins-manifest.js.map +1 -1
  85. package/dist/lsp/runmat_lsp.d.ts +2 -2
  86. package/dist/lsp/runmat_lsp.js +4 -4
  87. package/dist/lsp/runmat_lsp_bg.wasm +0 -0
  88. package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
  89. package/dist/pkg-web/runmat_wasm_web.d.ts +42 -42
  90. package/dist/pkg-web/runmat_wasm_web.js +85 -85
  91. package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
  92. package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +35 -35
  93. package/dist/runtime/stdlib.snapshot +0 -0
  94. package/package.json +1 -1
@@ -0,0 +1,146 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "mode",
5
+ "category": "stats/summary",
6
+ "keywords": [
7
+ "mode",
8
+ "frequency",
9
+ "statistics",
10
+ "reduction",
11
+ "ties"
12
+ ],
13
+ "summary": "Most frequent value along a dimension with MATLAB-compatible tie semantics.",
14
+ "references": [],
15
+ "gpu_support": {
16
+ "elementwise": false,
17
+ "reduction": false,
18
+ "precisions": [
19
+ "f64"
20
+ ],
21
+ "broadcasting": "none",
22
+ "notes": "Mode currently executes on the host; GPU tensors are gathered to the CPU before computing the result."
23
+ },
24
+ "fusion": {
25
+ "elementwise": false,
26
+ "reduction": false,
27
+ "max_inputs": 1,
28
+ "constants": "inline"
29
+ },
30
+ "requires_feature": null,
31
+ "tested": {
32
+ "unit": "builtins::stats::summary::mode::tests"
33
+ },
34
+ "description": "`mode(A)` returns the value that appears most frequently in `A`. When multiple values share the same maximum frequency, the smallest tied value is returned in `M`, matching MATLAB. Requesting `[M, F, C] = mode(A)` additionally yields the frequency of the mode and a cell array `C` whose entries are sorted column vectors of the tied values for each slice.",
35
+ "behaviors": [
36
+ "`mode(A)` reduces along the first non-singleton dimension of `A`.",
37
+ "`mode(A, dim)` reduces along the specified dimension (1-based, `>= 1`).",
38
+ "`mode(A, 'all')` collapses every element of `A` into a single scalar mode.",
39
+ "`[M, F, C] = mode(A, ...)` additionally returns the frequency `F` of the mode (as a double) and a cell array `C` of sorted tied values per slice.",
40
+ "Ties resolve to the smallest tied value in `M`, while `C` contains the full tied set sorted in ascending order.",
41
+ "NaN entries are ignored. If a slice is entirely `NaN` (or empty), the corresponding `M` value is `NaN`, `F` is `0`, and the cell entry is an empty `0 × 1` column.",
42
+ "Logical, integer, and boolean inputs are promoted to double precision before counting frequencies.",
43
+ "Dimensions larger than `ndims(A)` treat the input as having trailing singleton dimensions, so each slice contains a single element."
44
+ ],
45
+ "examples": [
46
+ {
47
+ "description": "Mode of a vector with a clear majority",
48
+ "input": "x = [1 2 2 3 3 3 4];\nm = mode(x)",
49
+ "output": "m = 3"
50
+ },
51
+ {
52
+ "description": "Ties return the smallest value with the full sorted set",
53
+ "input": "x = [1 1 2 2];\n[m, f, c] = mode(x)",
54
+ "output": "m = 1\nf = 2\nc = {[1; 2]}"
55
+ },
56
+ {
57
+ "description": "Column-wise mode of a matrix",
58
+ "input": "A = [1 2 1; 2 2 3; 2 4 3];\nm = mode(A)",
59
+ "output": "m = [2 2 3]"
60
+ },
61
+ {
62
+ "description": "Mode along the second dimension",
63
+ "input": "A = [1 2 1; 2 2 3; 2 4 3];\nm = mode(A, 2)",
64
+ "output": "m = [1; 2; 2]"
65
+ },
66
+ {
67
+ "description": "Mode across every element",
68
+ "input": "A = [1 2 3; 2 3 2];\nm = mode(A, 'all')",
69
+ "output": "m = 2"
70
+ },
71
+ {
72
+ "description": "NaN values are ignored unless every element is NaN",
73
+ "input": "x = [1 NaN 2 2 NaN];\n[m, f] = mode(x)",
74
+ "output": "m = 2\nf = 2"
75
+ }
76
+ ],
77
+ "faqs": [
78
+ {
79
+ "question": "How are ties resolved?",
80
+ "answer": "`M` returns the smallest value among the tied set. The third output `C` contains every tied value sorted in ascending order as a column vector."
81
+ },
82
+ {
83
+ "question": "What happens with NaN values?",
84
+ "answer": "NaN entries are skipped while counting frequencies. If a slice is entirely NaN, RunMat returns `NaN` for the mode, `0` for the frequency, and an empty `0 × 1` column in the cell array."
85
+ },
86
+ {
87
+ "question": "Does mode support logical or integer inputs?",
88
+ "answer": "Yes. Logical and integer arrays are promoted to double precision before counting, matching MATLAB."
89
+ },
90
+ {
91
+ "question": "Can I reduce across all elements of an array?",
92
+ "answer": "Use `mode(A, 'all')` to collapse every element of `A` into a single scalar."
93
+ },
94
+ {
95
+ "question": "Does mode execute on the GPU?",
96
+ "answer": "Not today. GPU tensors are gathered to the host so the result remains bit-for-bit MATLAB compatible; future providers may expose dedicated mode kernels."
97
+ }
98
+ ],
99
+ "links": [
100
+ {
101
+ "label": "mean",
102
+ "url": "./mean"
103
+ },
104
+ {
105
+ "label": "median",
106
+ "url": "./median"
107
+ },
108
+ {
109
+ "label": "max",
110
+ "url": "./max"
111
+ },
112
+ {
113
+ "label": "min",
114
+ "url": "./min"
115
+ },
116
+ {
117
+ "label": "std",
118
+ "url": "./std"
119
+ },
120
+ {
121
+ "label": "var",
122
+ "url": "./var"
123
+ },
124
+ {
125
+ "label": "histcounts",
126
+ "url": "./histcounts"
127
+ },
128
+ {
129
+ "label": "unique",
130
+ "url": "./unique"
131
+ }
132
+ ],
133
+ "source": {
134
+ "label": "`crates/runmat-runtime/src/builtins/stats/summary/mode.rs`",
135
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/stats/summary/mode.rs"
136
+ },
137
+ "key": "mode",
138
+ "slug": "mode",
139
+ "aliases": [],
140
+ "categoryPath": [
141
+ "stats",
142
+ "summary"
143
+ ]
144
+ };
145
+ export default builtinDoc;
146
+ //# sourceMappingURL=mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode.js","sourceRoot":"","sources":["../../../src/generated/builtins/mode.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,eAAe;IAC3B,UAAU,EAAE;QACV,MAAM;QACN,WAAW;QACX,YAAY;QACZ,WAAW;QACX,MAAM;KACP;IACD,SAAS,EAAE,6EAA6E;IACxF,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,KAAK;SACN;QACD,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,uGAAuG;KACjH;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,uCAAuC;KAChD;IACD,aAAa,EAAE,qWAAqW;IACpX,WAAW,EAAE;QACX,mEAAmE;QACnE,yEAAyE;QACzE,4EAA4E;QAC5E,mJAAmJ;QACnJ,iHAAiH;QACjH,oKAAoK;QACpK,oGAAoG;QACpG,qIAAqI;KACtI;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,wCAAwC;YACvD,OAAO,EAAE,mCAAmC;YAC5C,QAAQ,EAAE,OAAO;SAClB;QACD;YACE,aAAa,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KAAK,EAAE,UAAU;SAClB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,4DAA4D;QACrE,KAAK,EAAE,yGAAyG;KACjH;IACD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,OAAO;QACP,SAAS;KACV;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"optimset.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/optimset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAkEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"optimset.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/optimset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAsEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -11,7 +11,7 @@ const builtinDoc = {
11
11
  "MaxIter",
12
12
  "Display"
13
13
  ],
14
- "summary": "Create or update an optimization options structure for fzero and fsolve.",
14
+ "summary": "Create or update an optimization options structure for fminbnd, fzero, and fsolve.",
15
15
  "references": [
16
16
  "https://www.mathworks.com/help/matlab/ref/optimset.html"
17
17
  ],
@@ -32,7 +32,7 @@ const builtinDoc = {
32
32
  "tested": {
33
33
  "unit": "builtins::math::optim::optimset::tests"
34
34
  },
35
- "description": "`opts = optimset(name, value, ...)` creates a struct of optimization options. `opts = optimset(old, name, value, ...)` copies an existing options struct and applies overrides.",
35
+ "description": "`opts = optimset(name, value, ...)` creates a struct of optimization options. `opts = optimset(old, name, value, ...)` copies an existing options struct and applies overrides. The resulting struct can be passed to optimization builtins such as `fminbnd`, `fzero`, and `fsolve`.",
36
36
  "behaviors": [
37
37
  "Option names are case-insensitive for the builtins that consume them.",
38
38
  "`TolX`, `TolFun`, `MaxIter`, `MaxFunEvals`, and `Display` are canonicalized when constructed with `optimset`.",
@@ -40,12 +40,16 @@ const builtinDoc = {
40
40
  ],
41
41
  "examples": [
42
42
  {
43
- "description": "Create options for fzero",
44
- "input": "opts = optimset('TolX', 1e-10, 'Display', 'off');\nx = fzero(@sin, [3 4], opts)",
43
+ "description": "Create options for fminbnd",
44
+ "input": "opts = optimset('TolX', 1e-10, 'Display', 'off');\nx = fminbnd(@cos, 0, pi, opts)",
45
45
  "output": "x =\n 3.1416"
46
46
  }
47
47
  ],
48
48
  "links": [
49
+ {
50
+ "label": "fminbnd",
51
+ "url": "./fminbnd"
52
+ },
49
53
  {
50
54
  "label": "fzero",
51
55
  "url": "./fzero"
@@ -1 +1 @@
1
- {"version":3,"file":"optimset.js","sourceRoot":"","sources":["../../../src/generated/builtins/optimset.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE;QACV,UAAU;QACV,SAAS;QACT,MAAM;QACN,QAAQ;QACR,SAAS;QACT,SAAS;KACV;IACD,SAAS,EAAE,0EAA0E;IACrF,YAAY,EAAE;QACZ,yDAAyD;KAC1D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,4BAA4B;KACtC;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,wCAAwC;KACjD;IACD,aAAa,EAAE,iLAAiL;IAChM,WAAW,EAAE;QACX,uEAAuE;QACvE,+GAA+G;QAC/G,qEAAqE;KACtE;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,0BAA0B;YACzC,OAAO,EAAE,iFAAiF;YAC1F,QAAQ,EAAE,iBAAiB;SAC5B;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,6DAA6D;QACtE,KAAK,EAAE,0GAA0G;KAClH;IACD,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,OAAO;KACR;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"optimset.js","sourceRoot":"","sources":["../../../src/generated/builtins/optimset.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE;QACV,UAAU;QACV,SAAS;QACT,MAAM;QACN,QAAQ;QACR,SAAS;QACT,SAAS;KACV;IACD,SAAS,EAAE,oFAAoF;IAC/F,YAAY,EAAE;QACZ,yDAAyD;KAC1D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,4BAA4B;KACtC;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,wCAAwC;KACjD;IACD,aAAa,EAAE,uRAAuR;IACtS,WAAW,EAAE;QACX,uEAAuE;QACvE,+GAA+G;QAC/G,qEAAqE;KACtE;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,4BAA4B;YAC3C,OAAO,EAAE,mFAAmF;YAC5F,QAAQ,EAAE,iBAAiB;SAC5B;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,6DAA6D;QACtE,KAAK,EAAE,0GAA0G;KAClH;IACD,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,OAAO;KACR;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=patch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/patch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAkIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,135 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "patch",
5
+ "category": "plotting",
6
+ "keywords": [
7
+ "patch",
8
+ "polygon",
9
+ "filled polygon",
10
+ "faces",
11
+ "vertices",
12
+ "matlab patch",
13
+ "graphics primitive"
14
+ ],
15
+ "summary": "Create MATLAB-compatible colored polygon patch objects from coordinate data or Faces/Vertices definitions.",
16
+ "gpu_support": {
17
+ "elementwise": false,
18
+ "reduction": false,
19
+ "precisions": [
20
+ "single",
21
+ "double"
22
+ ],
23
+ "broadcasting": "none",
24
+ "notes": "`patch` is a plotting sink. The initial implementation gathers GPU-resident coordinate inputs, triangulates polygon faces on the host, then renders through RunMat's shared GPU plotting renderer."
25
+ },
26
+ "fusion": {
27
+ "elementwise": false,
28
+ "reduction": false,
29
+ "max_inputs": 4,
30
+ "constants": "inline"
31
+ },
32
+ "requires_feature": null,
33
+ "tested": {
34
+ "unit": "builtins::plotting::patch::tests",
35
+ "integration": "runmat-plot/src/plots/patch.rs"
36
+ },
37
+ "description": "`patch` creates filled polygon graphics objects. RunMat supports practical MATLAB forms including `patch(X,Y,C)`, `patch(X,Y,Z,C)`, name-value `XData`/`YData`/`ZData`, `Faces`/`Vertices`, struct input, explicit axes handles, and common face, edge, alpha, line-width, display-name, and visibility properties.",
38
+ "behaviors": [
39
+ "Vector coordinate inputs create one polygon.",
40
+ "Matrix coordinate inputs create one polygon per column.",
41
+ "Patch edges close automatically, matching MATLAB's open-polygon behavior.",
42
+ "`Faces` values are interpreted as MATLAB-style one-based vertex indices.",
43
+ "2-D vertices are accepted as N-by-2; 3-D vertices are accepted as N-by-3.",
44
+ "The returned value is a patch graphics handle that works with `get`, `set`, `ishandle`, and `isgraphics`.",
45
+ "Per-vertex or per-face `CData` colormap interpolation is not yet implemented; non-scalar color data is accepted only as compatibility input and currently falls back to the default face color unless `FaceColor` supplies a concrete RGB/color-name value."
46
+ ],
47
+ "options": [
48
+ "`FaceColor` accepts color names, RGB triples, `flat`, or `none`.",
49
+ "`EdgeColor` accepts color names, RGB triples, or `none`.",
50
+ "`FaceAlpha` and `EdgeAlpha` accept numeric values from 0 to 1.",
51
+ "`LineWidth`, `DisplayName`, and `Visible` use the shared plotting property model.",
52
+ "`FaceColor`, `EdgeColor`, alpha, line width, display name, visibility, `Faces`, `Vertices`, `XData`, `YData`, and `ZData` are the first supported patch property set. Lighting, normals, texture coordinates, and callback properties are deferred."
53
+ ],
54
+ "examples": [
55
+ {
56
+ "description": "Create a triangle patch",
57
+ "input": "x = [0 1 0];\ny = [0 0 1];\npatch(x, y, 'red');"
58
+ },
59
+ {
60
+ "description": "Create two rectangle patches from matrix columns",
61
+ "input": "X = [0 2; 1 3; 1 3; 0 2];\nY = [0 0; 0 0; 1 1; 1 1];\npatch(X, Y, 'cyan', 'EdgeColor', 'black');"
62
+ },
63
+ {
64
+ "description": "Create a patch from Faces and Vertices",
65
+ "input": "V = [0 0; 1 0; 1 1; 0 1];\nF = [1 2 3 4];\nh = patch('Faces', F, 'Vertices', V, 'FaceColor', [0.2 0.6 0.9]);\nget(h, 'Type')",
66
+ "output": "ans =\n 'patch'"
67
+ },
68
+ {
69
+ "description": "Create a 3-D patch",
70
+ "input": "V = [0 0 0; 1 0 0; 0.5 1 0.5];\nF = [1 2 3];\npatch('Faces', F, 'Vertices', V, 'FaceAlpha', 0.6);\nview(3);"
71
+ }
72
+ ],
73
+ "faqs": [
74
+ {
75
+ "question": "Does patch close polygons automatically?",
76
+ "answer": "Yes. You can provide open polygon coordinate lists; RunMat closes the edge loop when rendering the patch."
77
+ },
78
+ {
79
+ "question": "Are Faces indices zero-based or one-based?",
80
+ "answer": "They are one-based to match MATLAB. `Faces = [1 2 3]` references the first, second, and third rows of `Vertices`."
81
+ },
82
+ {
83
+ "question": "Does patch have a direct GPU-resident geometry path?",
84
+ "answer": "Not yet. RunMat gathers GPU-resident patch inputs for validation and triangulation, then submits the resulting geometry to the shared GPU renderer. A direct GPU triangulation/packing path can be added later for very large patch meshes."
85
+ }
86
+ ],
87
+ "links": [
88
+ {
89
+ "label": "surf",
90
+ "url": "./surf"
91
+ },
92
+ {
93
+ "label": "plot3",
94
+ "url": "./plot3"
95
+ },
96
+ {
97
+ "label": "fill",
98
+ "url": "./fill"
99
+ },
100
+ {
101
+ "label": "get",
102
+ "url": "./get"
103
+ },
104
+ {
105
+ "label": "set",
106
+ "url": "./set"
107
+ },
108
+ {
109
+ "label": "Graphics Handles",
110
+ "url": "/docs/plotting/graphics-handles"
111
+ },
112
+ {
113
+ "label": "Plot replay and export",
114
+ "url": "/docs/plotting/plot-replay-and-export"
115
+ }
116
+ ],
117
+ "source": {
118
+ "label": "`crates/runmat-runtime/src/builtins/plotting/ops/patch.rs`",
119
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/plotting/ops/patch.rs"
120
+ },
121
+ "gpu_residency": "`patch` gathers GPU-resident coordinate inputs in the first implementation because MATLAB-compatible patch parsing requires shape validation, one-based Faces handling, NaN padding, and polygon triangulation. The rendered geometry still flows through the shared GPU plotting renderer.",
122
+ "gpu_behavior": [
123
+ "Patch rendering is a plotting sink and fusion barrier.",
124
+ "Host and gathered-GPU inputs produce the same graphics object and handle behavior.",
125
+ "A future direct GPU path should preserve the same Faces/Vertices semantics and only replace the triangulation/packing step."
126
+ ],
127
+ "key": "patch",
128
+ "slug": "patch",
129
+ "aliases": [],
130
+ "categoryPath": [
131
+ "plotting"
132
+ ]
133
+ };
134
+ export default builtinDoc;
135
+ //# sourceMappingURL=patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.js","sourceRoot":"","sources":["../../../src/generated/builtins/patch.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE;QACV,OAAO;QACP,SAAS;QACT,gBAAgB;QAChB,OAAO;QACP,UAAU;QACV,cAAc;QACd,oBAAoB;KACrB;IACD,SAAS,EAAE,4GAA4G;IACvH,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,QAAQ;YACR,QAAQ;SACT;QACD,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,oMAAoM;KAC9M;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK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AK,EAAE,OAAO;SACf;QACD;YACE,OAAO,EAAE,kBAAkB;YAC3B,KAAK,EAAE,iCAAiC;SACzC;QACD;YACE,OAAO,EAAE,wBAAwB;YACjC,KAAK,EAAE,uCAAuC;SAC/C;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,4DAA4D;QACrE,KAAK,EAAE,yGAAyG;KACjH;IACD,eAAe,EAAE,6RAA6R;IAC9S,cAAc,EAAE;QACd,wDAAwD;QACxD,oFAAoF;QACpF,6HAA6H;KAC9H;IACD,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,UAAU;KACX;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=repelem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repelem.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/repelem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAkIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,135 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "repelem",
5
+ "category": "array/shape",
6
+ "keywords": [
7
+ "repelem",
8
+ "replicate",
9
+ "repeat",
10
+ "array",
11
+ "cell"
12
+ ],
13
+ "summary": "Replicate each element of an array along one or more dimensions.",
14
+ "references": [],
15
+ "gpu_support": {
16
+ "elementwise": false,
17
+ "reduction": false,
18
+ "precisions": [],
19
+ "broadcasting": "none",
20
+ "notes": "GPU inputs are gathered to host memory before replication; no provider hook exists yet."
21
+ },
22
+ "fusion": {
23
+ "elementwise": false,
24
+ "reduction": false,
25
+ "max_inputs": 1,
26
+ "constants": "inline"
27
+ },
28
+ "requires_feature": null,
29
+ "tested": {
30
+ "unit": "builtins::array::shape::repelem::tests",
31
+ "integration": "crates/runmat-runtime/tests/nd_ops.rs"
32
+ },
33
+ "description": "`repelem(A, r1, r2, ..., rN)` repeats each element of `A` along the requested dimensions. Unlike `repmat`, which tiles whole arrays, `repelem` expands individual elements into runs or blocks.",
34
+ "behaviors": [
35
+ "`repelem(v, n)` repeats each element of a row or column vector `v` `n` times and preserves vector orientation.",
36
+ "`repelem(v, counts)` accepts a count vector with one non-negative integer count per element of `v`.",
37
+ "`repelem(A, r1, r2, ..., rN)` repeats matrix or N-D array elements along each dimension; scalar factors create element blocks and vector factors provide per-index counts for that dimension.",
38
+ "Numeric, logical, complex, string, char, and cell inputs are supported. Numeric, logical, complex, string, and cell arrays support N-D replication; char arrays are represented as 2-D character matrices.",
39
+ "Zero counts are allowed and remove the corresponding element or dimension slice from the output.",
40
+ "Replication counts must be finite, non-negative integers. Count vectors must match the size of the dimension they apply to.",
41
+ "The builtin checks shape and size overflow before materializing output arrays."
42
+ ],
43
+ "examples": [
44
+ {
45
+ "description": "Repeating every element of a row vector",
46
+ "input": "u = repelem([1 2 3], 2)",
47
+ "output": "u =\n 1 1 2 2 3 3"
48
+ },
49
+ {
50
+ "description": "Using a per-element count vector",
51
+ "input": "u = repelem([1 2 3], [1 2 3])",
52
+ "output": "u =\n 1 2 2 3 3 3"
53
+ },
54
+ {
55
+ "description": "Expanding a matrix into element blocks",
56
+ "input": "A = [1 2; 3 4];\nB = repelem(A, 2, 3)",
57
+ "output": "B =\n 1 1 1 2 2 2\n 1 1 1 2 2 2\n 3 3 3 4 4 4\n 3 3 3 4 4 4"
58
+ },
59
+ {
60
+ "description": "Dropping elements with zero counts",
61
+ "input": "u = repelem([1 2 3 4 5], [0 1 0 2 1])",
62
+ "output": "u =\n 2 4 4 5"
63
+ },
64
+ {
65
+ "description": "Repeating along a higher dimension",
66
+ "input": "C = {1; 2};\nD = repelem(reshape(C, [1 1 2]), 1, 1, 2);\nsize(D)",
67
+ "output": "ans =\n 1 1 4"
68
+ }
69
+ ],
70
+ "faqs": [
71
+ {
72
+ "question": "How is `repelem` different from `repmat`?",
73
+ "answer": "`repmat` tiles a whole array. `repelem` repeats each individual element, so matrix inputs expand into element-wise blocks."
74
+ },
75
+ {
76
+ "question": "Can counts be different for each element?",
77
+ "answer": "Yes. In vector form, the count vector must have one entry for each vector element. In multi-dimensional form, a count vector applies to the dimension at the same argument position."
78
+ },
79
+ {
80
+ "question": "Are zero counts valid?",
81
+ "answer": "Yes. A zero count omits that element or dimension index from the output."
82
+ },
83
+ {
84
+ "question": "Does `repelem` preserve row and column vector orientation?",
85
+ "answer": "Yes. Row vectors remain row vectors, column vectors remain column vectors, including empty column vectors."
86
+ },
87
+ {
88
+ "question": "Does `repelem` run on the GPU?",
89
+ "answer": "Not yet. The runtime gathers GPU tensors to host memory for this builtin, computes the replicated result on the CPU, and returns a host value."
90
+ }
91
+ ],
92
+ "links": [
93
+ {
94
+ "label": "repmat",
95
+ "url": "./repmat"
96
+ },
97
+ {
98
+ "label": "kron",
99
+ "url": "./kron"
100
+ },
101
+ {
102
+ "label": "reshape",
103
+ "url": "./reshape"
104
+ },
105
+ {
106
+ "label": "cat",
107
+ "url": "./cat"
108
+ },
109
+ {
110
+ "label": "size",
111
+ "url": "./size"
112
+ }
113
+ ],
114
+ "source": {
115
+ "label": "crates/runmat-runtime/src/builtins/array/shape/repelem.rs",
116
+ "url": "crates/runmat-runtime/src/builtins/array/shape/repelem.rs"
117
+ },
118
+ "gpu_residency": "`repelem` is currently a host-resident array construction builtin. If a GPU tensor reaches this builtin, RunMat gathers it before replication.",
119
+ "gpu_behavior": [
120
+ "RunMat does not yet expose a provider hook for element-wise replication. Backends can add one later without changing the MATLAB-facing behavior."
121
+ ],
122
+ "extended_capabilities": [
123
+ "`repelem` preserves the input value class for numeric dtype metadata, logical arrays, complex tensors, string arrays, char arrays, and cell arrays.",
124
+ "N-D numeric, logical, complex, string, and cell replication uses the runtime's native storage order for each value kind."
125
+ ],
126
+ "key": "repelem",
127
+ "slug": "repelem",
128
+ "aliases": [],
129
+ "categoryPath": [
130
+ "array",
131
+ "shape"
132
+ ]
133
+ };
134
+ export default builtinDoc;
135
+ //# sourceMappingURL=repelem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repelem.js","sourceRoot":"","sources":["../../../src/generated/builtins/repelem.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,SAAS;QACT,WAAW;QACX,QAAQ;QACR,OAAO;QACP,MAAM;KACP;IACD,SAAS,EAAE,kEAAkE;IAC7E,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,yFAAyF;KACnG;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,wCAAwC;QAChD,aAAa,EAAE,uCAAuC;KACvD;IACD,aAAa,EAAE,iMAAiM;IAChN,WAAW,EAAE;QACX,gHAAgH;QAChH,qGAAqG;QACrG,+LAA+L;QAC/L,4MAA4M;QAC5M,kGAAkG;QAClG,6HAA6H;QAC7H,gFAAgF;KACjF;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,yCAAyC;YACxD,OAAO,EAAE,yBAAyB;YAClC,QAAQ,EAAE,2CAA2C;SACtD;QACD;YACE,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE,+BAA+B;YACxC,QAAQ,EA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AAE;QACd,OAAO;QACP,OAAO;KACR;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=sawtooth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sawtooth.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/sawtooth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UA0GjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,111 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "sawtooth",
5
+ "category": "math/signal",
6
+ "keywords": [
7
+ "sawtooth",
8
+ "waveform",
9
+ "signal processing",
10
+ "triangle",
11
+ "periodic",
12
+ "elementwise"
13
+ ],
14
+ "summary": "Generate a periodic sawtooth waveform with optional peak position.",
15
+ "references": [],
16
+ "gpu_support": {
17
+ "elementwise": true,
18
+ "reduction": false,
19
+ "precisions": [
20
+ "f64"
21
+ ],
22
+ "broadcasting": "elementwise",
23
+ "notes": "GPU inputs are gathered to the host so the reference implementation can guarantee MATLAB-compatible piecewise-linear evaluation at the period boundary."
24
+ },
25
+ "fusion": {
26
+ "elementwise": false,
27
+ "reduction": false,
28
+ "max_inputs": 1,
29
+ "constants": "inline",
30
+ "notes": "Fusion is intentionally disabled for v1 because the WGSL piecewise expression is non-trivial and brings little benefit relative to the host loop."
31
+ },
32
+ "requires_feature": null,
33
+ "tested": {
34
+ "unit": "builtins::math::signal::sawtooth::tests",
35
+ "integration": null
36
+ },
37
+ "description": "`y = sawtooth(t)` generates a sawtooth wave with period `2*pi` at the sample times in `t`, ranging in `[-1, 1]`. `y = sawtooth(t, xmax)` controls the peak position with `xmax` in `[0, 1]`: `xmax = 1` (the default) produces a rising sawtooth, `xmax = 0` produces a falling sawtooth, and intermediate values such as `xmax = 0.5` produce a triangle wave whose peak is at the centre of each period.",
38
+ "behaviors": [
39
+ "Operates element-wise on scalars, vectors, matrices, and N-D tensors; preserves input shape.",
40
+ "Reduces input modulo `2*pi` so the waveform is periodic across negative and positive sample times.",
41
+ "Returns `-1` at the start of each period and approaches `+1` just before the period boundary wraps when `xmax = 1`.",
42
+ "Returns a piecewise-linear triangle wave when `xmax = 0.5`, peaking at `1` at the centre of each period.",
43
+ "Returns a pure falling ramp when `xmax = 0` and a pure rising ramp when `xmax = 1`.",
44
+ "Integer and logical inputs are promoted to double precision before evaluation.",
45
+ "Non-finite sample times (`NaN`, `+Inf`, `-Inf`) propagate as `NaN` element-wise, matching MATLAB.",
46
+ "Complex and text inputs are rejected with a builtin-scoped error.",
47
+ "Rejects `xmax` values outside `[0, 1]` and non-scalar `xmax` arguments."
48
+ ],
49
+ "examples": [
50
+ {
51
+ "description": "Default rising sawtooth over two periods",
52
+ "input": "t = 0:pi/2:4*pi;\ny = sawtooth(t)",
53
+ "output": "y = [-1 -0.5 0 0.5 -1 -0.5 0 0.5 -1]"
54
+ },
55
+ {
56
+ "description": "Triangle wave via xmax = 0.5",
57
+ "input": "t = linspace(0, 2*pi, 5);\ny = sawtooth(t, 0.5)",
58
+ "output": "y = [-1 0 1 0 -1]"
59
+ },
60
+ {
61
+ "description": "Pure falling sawtooth via xmax = 0",
62
+ "input": "y = sawtooth([0 pi 2*pi], 0)",
63
+ "output": "y = [1 0 1]"
64
+ }
65
+ ],
66
+ "faqs": [
67
+ {
68
+ "question": "Why does `sawtooth(2*pi)` return `-1` instead of `+1`?",
69
+ "answer": "RunMat reduces the input modulo `2*pi`, so `2*pi` is folded back to the start of the next period. The default rising sawtooth therefore restarts at `-1` exactly on each period boundary, matching MATLAB."
70
+ },
71
+ {
72
+ "question": "How do I produce a triangle wave?",
73
+ "answer": "Pass `xmax = 0.5` so the peak sits at the centre of each period and the waveform ramps symmetrically up and back down."
74
+ },
75
+ {
76
+ "question": "Can `sawtooth` accept complex inputs?",
77
+ "answer": "No. `sawtooth` is defined on real samples and rejects complex inputs with a builtin-scoped error to match MATLAB."
78
+ }
79
+ ],
80
+ "links": [
81
+ {
82
+ "label": "square",
83
+ "url": "./square"
84
+ },
85
+ {
86
+ "label": "sin",
87
+ "url": "./sin"
88
+ },
89
+ {
90
+ "label": "cos",
91
+ "url": "./cos"
92
+ },
93
+ {
94
+ "label": "linspace",
95
+ "url": "./linspace"
96
+ }
97
+ ],
98
+ "source": {
99
+ "label": "`crates/runmat-runtime/src/builtins/math/signal/sawtooth.rs`",
100
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/math/signal/sawtooth.rs"
101
+ },
102
+ "key": "sawtooth",
103
+ "slug": "sawtooth",
104
+ "aliases": [],
105
+ "categoryPath": [
106
+ "math",
107
+ "signal"
108
+ ]
109
+ };
110
+ export default builtinDoc;
111
+ //# sourceMappingURL=sawtooth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sawtooth.js","sourceRoot":"","sources":["../../../src/generated/builtins/sawtooth.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,UAAU;QACV,UAAU;QACV,mBAAmB;QACnB,UAAU;QACV,UAAU;QACV,aAAa;KACd;IACD,SAAS,EAAE,oEAAoE;IAC/E,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE;QACb,aAAa,EAAE,IAAI;QACnB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,KAAK;SACN;QACD,cAAc,EAAE,aAAa;QAC7B,OAAO,EAAE,yJAAyJ;KACnK;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE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;IAClB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=sinc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sinc.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/sinc.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAyIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}