runmat 0.4.1 → 0.4.3
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/artifacts/stdlib.snapshot +0 -0
- package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
- package/dist/generated/builtin-examples-catalog.js +1 -1
- package/dist/generated/builtin-examples-catalog.js.map +1 -1
- package/dist/generated/builtins/blackman.d.ts +4 -0
- package/dist/generated/builtins/blackman.d.ts.map +1 -0
- package/dist/generated/builtins/blackman.js +75 -0
- package/dist/generated/builtins/blackman.js.map +1 -0
- package/dist/generated/builtins/datetime.d.ts +4 -0
- package/dist/generated/builtins/datetime.d.ts.map +1 -0
- package/dist/generated/builtins/datetime.js +150 -0
- package/dist/generated/builtins/datetime.js.map +1 -0
- package/dist/generated/builtins/duration.d.ts +4 -0
- package/dist/generated/builtins/duration.d.ts.map +1 -0
- package/dist/generated/builtins/duration.js +118 -0
- package/dist/generated/builtins/duration.js.map +1 -0
- package/dist/generated/builtins/hamming.d.ts +4 -0
- package/dist/generated/builtins/hamming.d.ts.map +1 -0
- package/dist/generated/builtins/hamming.js +70 -0
- package/dist/generated/builtins/hamming.js.map +1 -0
- package/dist/generated/builtins/hann.d.ts +4 -0
- package/dist/generated/builtins/hann.d.ts.map +1 -0
- package/dist/generated/builtins/hann.js +75 -0
- package/dist/generated/builtins/hann.js.map +1 -0
- package/dist/generated/builtins/nextpow2.d.ts +4 -0
- package/dist/generated/builtins/nextpow2.d.ts.map +1 -0
- package/dist/generated/builtins/nextpow2.js +71 -0
- package/dist/generated/builtins/nextpow2.js.map +1 -0
- package/dist/generated/builtins/peaks.d.ts +4 -0
- package/dist/generated/builtins/peaks.d.ts.map +1 -0
- package/dist/generated/builtins/peaks.js +127 -0
- package/dist/generated/builtins/peaks.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -1
- package/dist/generated/builtins-manifest.js +141 -0
- package/dist/generated/builtins-manifest.js.map +1 -1
- package/dist/lsp/runmat_lsp.d.ts +2 -2
- package/dist/lsp/runmat_lsp.js +4 -4
- package/dist/lsp/runmat_lsp_bg.wasm +0 -0
- package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
- package/dist/pkg-web/runmat_wasm_web.d.ts +4 -4
- package/dist/pkg-web/runmat_wasm_web.js +10 -10
- package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
- package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +4 -4
- package/dist/runtime/stdlib.snapshot +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blackman.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/blackman.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAsEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "blackman",
|
|
5
|
+
"category": "math/signal",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"blackman",
|
|
8
|
+
"window",
|
|
9
|
+
"signal processing",
|
|
10
|
+
"dsp",
|
|
11
|
+
"fft"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Generate a Blackman window as an N-by-1 real column vector.",
|
|
14
|
+
"description": "`blackman` generates Blackman windows for signal-processing workflows where lower spectral leakage is desired. RunMat supports the common MATLAB symmetric and periodic forms, including optional single-precision output.",
|
|
15
|
+
"behaviors": [
|
|
16
|
+
"`blackman(L)` returns an `L x 1` symmetric Blackman window.",
|
|
17
|
+
"`blackman(L, 'periodic')` returns the periodic form used in spectral-analysis workflows.",
|
|
18
|
+
"`blackman(..., 'single')` returns a single-precision window; `'double'` is the default.",
|
|
19
|
+
"If `L` is noninteger, RunMat rounds it to the nearest integer before constructing the window.",
|
|
20
|
+
"`blackman(0)` returns an empty `0 x 1` tensor.",
|
|
21
|
+
"`blackman(1)` returns `1`.",
|
|
22
|
+
"For the symmetric case and `L > 1`, coefficients follow `0.42 - 0.5*cos(2*pi*n/(L-1)) + 0.08*cos(4*pi*n/(L-1))`.",
|
|
23
|
+
"The periodic form is constructed by evaluating a symmetric window of length `L + 1` and dropping the final sample."
|
|
24
|
+
],
|
|
25
|
+
"examples": [
|
|
26
|
+
{
|
|
27
|
+
"description": "Generate a short Blackman window",
|
|
28
|
+
"input": "w = blackman(8);\ndisp(w')"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"description": "Generate a periodic Blackman window",
|
|
32
|
+
"input": "w = blackman(8, 'periodic');\ndisp(w')"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"description": "Generate a single-precision Blackman window",
|
|
36
|
+
"input": "w = blackman(8, 'single');\nclass(w)"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"faqs": [
|
|
40
|
+
{
|
|
41
|
+
"question": "Why would I use `blackman` instead of `hann` or `hamming`?",
|
|
42
|
+
"answer": "A Blackman window is often used when you want lower spectral leakage at the cost of a wider main lobe. It is a common tradeoff choice in spectral analysis workflows."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"question": "What is the difference between the symmetric and periodic Blackman window?",
|
|
46
|
+
"answer": "Use the symmetric form for filter-design style workflows. Use `'periodic'` for FFT-based spectral analysis, where RunMat constructs a symmetric window of length `L + 1` and removes the final sample."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"question": "Does `blackman` support single precision?",
|
|
50
|
+
"answer": "Yes. Pass `'single'` as the final option to request a single-precision output. The default output type is double precision."
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"links": [
|
|
54
|
+
{
|
|
55
|
+
"label": "hann",
|
|
56
|
+
"url": "./hann"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "hamming",
|
|
60
|
+
"url": "./hamming"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"label": "fft",
|
|
64
|
+
"url": "./fft"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"key": "blackman",
|
|
68
|
+
"slug": "blackman",
|
|
69
|
+
"categoryPath": [
|
|
70
|
+
"math",
|
|
71
|
+
"signal"
|
|
72
|
+
]
|
|
73
|
+
};
|
|
74
|
+
export default builtinDoc;
|
|
75
|
+
//# sourceMappingURL=blackman.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blackman.js","sourceRoot":"","sources":["../../../src/generated/builtins/blackman.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,QAAQ;QACR,mBAAmB;QACnB,KAAK;QACL,KAAK;KACN;IACD,SAAS,EAAE,6DAA6D;IACxE,aAAa,EAAE,4NAA4N;IAC3O,WAAW,EAAE;QACX,6DAA6D;QAC7D,0FAA0F;QAC1F,yFAAyF;QACzF,+FAA+F;QAC/F,gDAAgD;QAChD,4BAA4B;QAC5B,kHAAkH;QAClH,oHAAoH;KACrH;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE,4BAA4B;SACtC;QACD;YACE,aAAa,EAAE,qCAAqC;YACpD,OAAO,EAAE,wCAAwC;SAClD;QACD;YACE,aAAa,EAAE,6CAA6C;YAC5D,OAAO,EAAE,sCAAsC;SAChD;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,4DAA4D;YACxE,QAAQ,EAAE,uKAAuK;SAClL;QACD;YACE,UAAU,EAAE,4EAA4E;YACxF,QAAQ,EAAE,wMAAwM;SACnN;QACD;YACE,UAAU,EAAE,2CAA2C;YACvD,QAAQ,EAAE,6HAA6H;SACxI;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACf;KACF;IACD,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/datetime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAiJjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "datetime",
|
|
5
|
+
"category": "datetime",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"datetime",
|
|
8
|
+
"date",
|
|
9
|
+
"time",
|
|
10
|
+
"serial date number",
|
|
11
|
+
"datenum",
|
|
12
|
+
"Format",
|
|
13
|
+
"MATLAB compatibility"
|
|
14
|
+
],
|
|
15
|
+
"summary": "Create MATLAB-compatible datetime arrays from components, text, or serial date numbers.",
|
|
16
|
+
"references": [
|
|
17
|
+
"https://www.mathworks.com/help/matlab/ref/datetime.html"
|
|
18
|
+
],
|
|
19
|
+
"gpu_support": {
|
|
20
|
+
"elementwise": false,
|
|
21
|
+
"reduction": false,
|
|
22
|
+
"precisions": [],
|
|
23
|
+
"broadcasting": "none",
|
|
24
|
+
"notes": "datetime values are host-side objects backed by serial date tensors; there is no GPU-resident datetime type."
|
|
25
|
+
},
|
|
26
|
+
"fusion": {
|
|
27
|
+
"elementwise": false,
|
|
28
|
+
"reduction": false,
|
|
29
|
+
"max_inputs": 0,
|
|
30
|
+
"constants": "inline"
|
|
31
|
+
},
|
|
32
|
+
"requires_feature": null,
|
|
33
|
+
"tested": {
|
|
34
|
+
"integration": "runmat-ignition/tests/datetime.rs"
|
|
35
|
+
},
|
|
36
|
+
"description": "`datetime` constructs MATLAB-style datetime objects. RunMat currently supports creation from year-month-day component inputs, from text scalars or text arrays, from serial date numbers, and from numeric inputs marked with `ConvertFrom='datenum'`. The resulting object stores serial dates internally and exposes a writable `Format` property used by display, `string`, and `char` conversion.",
|
|
37
|
+
"behaviors": [
|
|
38
|
+
"`datetime()` with no arguments returns the current local date and time.",
|
|
39
|
+
"`datetime(Y, M, D)` and `datetime(Y, M, D, H, MN, S)` construct datetimes from numeric components. Scalar inputs expand to match non-scalar component arrays.",
|
|
40
|
+
"`datetime(text)` accepts string scalars, string arrays, and character vectors. Supported text includes common ISO-like forms, `dd-MMM-yyyy` forms, and `now`.",
|
|
41
|
+
"`datetime(serials, 'ConvertFrom', 'datenum')` interprets numeric values as MATLAB serial date numbers.",
|
|
42
|
+
"`datetime(serials)` also accepts raw serial date numbers for the current implementation, producing datetime values directly from those serials.",
|
|
43
|
+
"The `Format` property controls text rendering. Assigning `t.Format = 'yyyy-MM-dd HH:mm:ss'` updates how the object displays without changing the stored point in time.",
|
|
44
|
+
"Linear indexing `t(k)` is supported and returns datetime values.",
|
|
45
|
+
"Comparison operators and `plus`/`minus` day arithmetic are supported. Subtracting two datetime values returns numeric day deltas."
|
|
46
|
+
],
|
|
47
|
+
"examples": [
|
|
48
|
+
{
|
|
49
|
+
"description": "Constructing a scalar datetime from numeric components",
|
|
50
|
+
"input": "t = datetime(2024, 4, 9, 13, 30, 0)",
|
|
51
|
+
"output": "t =\n 09-Apr-2024 13:30:00"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"description": "Parsing text into datetimes",
|
|
55
|
+
"input": "t = datetime([\"2024-04-09 13:30:00\"; \"2024-04-10 08:15:00\"])",
|
|
56
|
+
"output": "t =\n09-Apr-2024 13:30:00\n10-Apr-2024 08:15:00"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"description": "Creating datetimes from serial date numbers",
|
|
60
|
+
"input": "d = datetime([739351; 739352], 'ConvertFrom', 'datenum')",
|
|
61
|
+
"output": "d =\n09-Apr-2024 00:00:00\n10-Apr-2024 00:00:00"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"description": "Changing display format without changing the stored value",
|
|
65
|
+
"input": "t = datetime(2024, 4, 9, 13, 30, 0);\nt.Format = 'yyyy-MM-dd HH:mm:ss';\ndisp(t)",
|
|
66
|
+
"output": "2024-04-09 13:30:00"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"description": "Extracting calendar and clock components",
|
|
70
|
+
"input": "t = datetime(2024, 4, 9, 13, 30, 5);\ny = year(t)\nm = month(t)\nd = day(t)\nh = hour(t)",
|
|
71
|
+
"output": "y = 2024\nm = 4\nd = 9\nh = 13"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"description": "Adding days and subtracting datetimes",
|
|
75
|
+
"input": "t0 = datetime(2024, 4, 9);\nt1 = t0 + 7;\ndelta = t1 - t0",
|
|
76
|
+
"output": "delta = 7"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"faqs": [
|
|
80
|
+
{
|
|
81
|
+
"question": "What does the `Format` property change?",
|
|
82
|
+
"answer": "Only the textual representation. The stored serial date number is unchanged, so comparisons and arithmetic still refer to the same instant."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"question": "How is subtraction interpreted?",
|
|
86
|
+
"answer": "Subtracting one datetime from another returns a numeric delta measured in days. Subtracting a numeric value from a datetime shifts it backward by that many days."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"question": "Can I index datetime arrays?",
|
|
90
|
+
"answer": "Yes. Linear `()` indexing is supported and preserves the datetime type."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"question": "Does `datetime` run on the GPU?",
|
|
94
|
+
"answer": "No. datetime values are represented as host-side objects. Numeric inputs may be gathered first, but the resulting datetime object remains on the CPU."
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"links": [
|
|
98
|
+
{
|
|
99
|
+
"label": "year",
|
|
100
|
+
"url": "./year"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"label": "month",
|
|
104
|
+
"url": "./month"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"label": "day",
|
|
108
|
+
"url": "./day"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"label": "hour",
|
|
112
|
+
"url": "./hour"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"label": "minute",
|
|
116
|
+
"url": "./minute"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"label": "second",
|
|
120
|
+
"url": "./second"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"label": "string",
|
|
124
|
+
"url": "./string"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"label": "char",
|
|
128
|
+
"url": "./char"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "disp",
|
|
132
|
+
"url": "./disp"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"source": {
|
|
136
|
+
"label": "`crates/runmat-runtime/src/builtins/datetime/mod.rs`",
|
|
137
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/datetime/mod.rs"
|
|
138
|
+
},
|
|
139
|
+
"gpu_residency": "No. RunMat represents `datetime` values as host-side objects with an internal serial-date tensor and a `Format` property. Even when the constructor receives gathered numeric data, the resulting object remains resident on the CPU.",
|
|
140
|
+
"gpu_behavior": [
|
|
141
|
+
"`datetime` does not allocate GPU objects or invoke provider kernels. If a numeric input originates on the GPU, RunMat gathers it before building the datetime object."
|
|
142
|
+
],
|
|
143
|
+
"key": "datetime",
|
|
144
|
+
"slug": "datetime",
|
|
145
|
+
"categoryPath": [
|
|
146
|
+
"datetime"
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
export default builtinDoc;
|
|
150
|
+
//# sourceMappingURL=datetime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime.js","sourceRoot":"","sources":["../../../src/generated/builtins/datetime.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/duration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAiHjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "duration",
|
|
5
|
+
"category": "datetime",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"duration",
|
|
8
|
+
"elapsed time",
|
|
9
|
+
"time span",
|
|
10
|
+
"Format",
|
|
11
|
+
"MATLAB compatibility"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Create MATLAB-compatible duration arrays from hour, minute, and second components.",
|
|
14
|
+
"references": [
|
|
15
|
+
"https://www.mathworks.com/help/matlab/ref/duration.html"
|
|
16
|
+
],
|
|
17
|
+
"gpu_support": {
|
|
18
|
+
"elementwise": false,
|
|
19
|
+
"reduction": false,
|
|
20
|
+
"precisions": [],
|
|
21
|
+
"broadcasting": "none",
|
|
22
|
+
"notes": "duration values are host-side objects backed by day-count tensors; there is no GPU-resident duration type."
|
|
23
|
+
},
|
|
24
|
+
"fusion": {
|
|
25
|
+
"elementwise": false,
|
|
26
|
+
"reduction": false,
|
|
27
|
+
"max_inputs": 0,
|
|
28
|
+
"constants": "inline"
|
|
29
|
+
},
|
|
30
|
+
"requires_feature": null,
|
|
31
|
+
"tested": {
|
|
32
|
+
"unit": "builtins::duration::tests"
|
|
33
|
+
},
|
|
34
|
+
"description": "`duration` constructs MATLAB-style duration objects from numeric hour, minute, and second components. Scalar component inputs expand to match non-scalar arrays, the resulting object stores elapsed time internally as days, and the writable `Format` property controls display, `string`, and `char` conversion.",
|
|
35
|
+
"behaviors": [
|
|
36
|
+
"`duration(H)` treats the input as hours.",
|
|
37
|
+
"`duration(H, M)` treats the inputs as hours and minutes.",
|
|
38
|
+
"`duration(H, M, S)` treats the inputs as hours, minutes, and seconds.",
|
|
39
|
+
"Scalar component inputs broadcast to match non-scalar component arrays; non-scalar inputs must share the same shape.",
|
|
40
|
+
"The `Format` property controls text rendering. Supported values are `hh:mm:ss`, `hh:mm`, `mm:ss`, `s`, and `ss`.",
|
|
41
|
+
"Linear indexing `d(k)` is supported and returns duration values.",
|
|
42
|
+
"Comparison operators and `plus`/`minus` duration arithmetic are supported.",
|
|
43
|
+
"Adding a duration to a datetime returns a datetime shifted by that elapsed time."
|
|
44
|
+
],
|
|
45
|
+
"examples": [
|
|
46
|
+
{
|
|
47
|
+
"description": "Constructing a scalar duration from numeric components",
|
|
48
|
+
"input": "t = duration(1, 30, 45)",
|
|
49
|
+
"output": "t =\n 01:30:45"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"description": "Broadcasting scalar minutes across an hour vector",
|
|
53
|
+
"input": "t = duration([1 2], 15)",
|
|
54
|
+
"output": "t =\n01:15:00 02:15:00"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"description": "Changing the display format without changing the stored value",
|
|
58
|
+
"input": "t = duration(1, 5, 0);\nt.Format = 'hh:mm';\ndisp(t)",
|
|
59
|
+
"output": "01:05"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"description": "Adding a duration to a datetime",
|
|
63
|
+
"input": "t0 = datetime(2024, 4, 9, 8, 0, 0);\nt1 = t0 + duration(1, 30, 0)",
|
|
64
|
+
"output": "t1 =\n 09-Apr-2024 09:30:00"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"faqs": [
|
|
68
|
+
{
|
|
69
|
+
"question": "What does the `Format` property change?",
|
|
70
|
+
"answer": "Only the textual representation. The stored elapsed time is unchanged, so comparisons and arithmetic still refer to the same duration."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"question": "Can I index duration arrays?",
|
|
74
|
+
"answer": "Yes. Linear `()` indexing is supported and preserves the duration type."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"question": "Does `duration` run on the GPU?",
|
|
78
|
+
"answer": "No. duration values are represented as host-side objects. Numeric inputs may be gathered first, but the resulting duration object remains on the CPU."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"question": "Can I add a duration to a datetime?",
|
|
82
|
+
"answer": "Yes. RunMat supports `datetime + duration` and returns a datetime shifted by the specified elapsed time."
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"links": [
|
|
86
|
+
{
|
|
87
|
+
"label": "datetime",
|
|
88
|
+
"url": "./datetime"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"label": "string",
|
|
92
|
+
"url": "./string"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "char",
|
|
96
|
+
"url": "./char"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"label": "disp",
|
|
100
|
+
"url": "./disp"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"source": {
|
|
104
|
+
"label": "`crates/runmat-runtime/src/builtins/duration/mod.rs`",
|
|
105
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/duration/mod.rs"
|
|
106
|
+
},
|
|
107
|
+
"gpu_residency": "No. RunMat represents `duration` values as host-side objects with an internal day-count tensor and a `Format` property. Even when the constructor receives gathered numeric data, the resulting object remains resident on the CPU.",
|
|
108
|
+
"gpu_behavior": [
|
|
109
|
+
"`duration` does not allocate GPU objects or invoke provider kernels. If a numeric input originates on the GPU, RunMat gathers it before building the duration object."
|
|
110
|
+
],
|
|
111
|
+
"key": "duration",
|
|
112
|
+
"slug": "duration",
|
|
113
|
+
"categoryPath": [
|
|
114
|
+
"datetime"
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
export default builtinDoc;
|
|
118
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../../src/generated/builtins/duration.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE;QACV,UAAU;QACV,cAAc;QACd,WAAW;QACX,QAAQ;QACR,sBAAsB;KACvB;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,4GAA4G;KACtH;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,2BAA2B;KACpC;IACD,aAAa,EAAE,qTAAqT;IACpU,WAAW,EAAE;QACX,0CAA0C;QAC1C,0DAA0D;QAC1D,uEAAuE;QACvE,sHAAsH;QACtH,kHAAkH;QAClH,kEAAkE;QAClE,4EAA4E;QAC5E,kFAAkF;KACnF;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,wDAAwD;YACvE,OAAO,EAAE,yBAAyB;YAClC,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,aAAa,EAAE,mDAAmD;YAClE,OAAO,EAAE,yBAAyB;YAClC,QAAQ,EAAE,yBAAyB;SACpC;QACD;YACE,aAAa,EAAE,+DAA+D;YAC9E,OAAO,EAAE,sDAAsD;YAC/D,QAAQ,EAAE,OAAO;SAClB;QACD;YACE,aAAa,EAAE,iCAAiC;YAChD,OAAO,EAAE,mEAAmE;YAC5E,QAAQ,EAAE,8BAA8B;SACzC;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,yCAAyC;YACrD,QAAQ,EAAE,wIAAwI;SACnJ;QACD;YACE,UAAU,EAAE,8BAA8B;YAC1C,QAAQ,EAAE,yEAAyE;SACpF;QACD;YACE,UAAU,EAAE,iCAAiC;YAC7C,QAAQ,EAAE,uJAAuJ;SAClK;QACD;YACE,UAAU,EAAE,qCAAqC;YACjD,QAAQ,EAAE,0GAA0G;SACrH;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;QACD;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,sDAAsD;QAC/D,KAAK,EAAE,mGAAmG;KAC3G;IACD,eAAe,EAAE,qOAAqO;IACtP,cAAc,EAAE;QACd,uKAAuK;KACxK;IACD,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,cAAc,EAAE;QACd,UAAU;KACX;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hamming.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/hamming.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAiEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "hamming",
|
|
5
|
+
"category": "math/signal",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"hamming",
|
|
8
|
+
"window",
|
|
9
|
+
"signal processing",
|
|
10
|
+
"dsp",
|
|
11
|
+
"fft"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Generate a Hamming window as an N-by-1 real column vector.",
|
|
14
|
+
"description": "`hamming` generates Hamming windows for signal-processing workflows such as spectral analysis and filter design. RunMat supports the standard MATLAB symmetric and periodic forms.",
|
|
15
|
+
"behaviors": [
|
|
16
|
+
"`hamming(L)` returns an `L x 1` symmetric Hamming window.",
|
|
17
|
+
"`hamming(L, 'periodic')` returns the periodic form used in spectral-analysis workflows.",
|
|
18
|
+
"If `L` is noninteger, RunMat rounds it to the nearest integer before constructing the window.",
|
|
19
|
+
"`hamming(0)` returns an empty `0 x 1` tensor.",
|
|
20
|
+
"`hamming(1)` returns `1`.",
|
|
21
|
+
"For the symmetric case and `L > 1`, coefficients follow `0.54 - 0.46*cos(2*pi*n/(L-1))`.",
|
|
22
|
+
"The periodic form is constructed by evaluating a symmetric window of length `L + 1` and dropping the final sample."
|
|
23
|
+
],
|
|
24
|
+
"examples": [
|
|
25
|
+
{
|
|
26
|
+
"description": "Generate a short Hamming window",
|
|
27
|
+
"input": "w = hamming(8);\ndisp(w')"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"description": "Generate a periodic Hamming window",
|
|
31
|
+
"input": "w = hamming(8, 'periodic');\ndisp(w')"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"faqs": [
|
|
35
|
+
{
|
|
36
|
+
"question": "When should I use the periodic Hamming window?",
|
|
37
|
+
"answer": "Use `'periodic'` when the window will be paired with FFT-based spectral analysis. The periodic form is built from a symmetric window of length `L + 1` with the final sample removed."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"question": "What shape does `hamming(L)` return?",
|
|
41
|
+
"answer": "It returns an `L x 1` column vector."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"question": "Does RunMat support a `typeName` overload for `hamming`?",
|
|
45
|
+
"answer": "RunMat currently implements the documented `hamming(L)` and `hamming(L, sflag)` forms."
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"links": [
|
|
49
|
+
{
|
|
50
|
+
"label": "hann",
|
|
51
|
+
"url": "./hann"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"label": "blackman",
|
|
55
|
+
"url": "./blackman"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"label": "fft",
|
|
59
|
+
"url": "./fft"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"key": "hamming",
|
|
63
|
+
"slug": "hamming",
|
|
64
|
+
"categoryPath": [
|
|
65
|
+
"math",
|
|
66
|
+
"signal"
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
export default builtinDoc;
|
|
70
|
+
//# sourceMappingURL=hamming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hamming.js","sourceRoot":"","sources":["../../../src/generated/builtins/hamming.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,QAAQ;QACR,mBAAmB;QACnB,KAAK;QACL,KAAK;KACN;IACD,SAAS,EAAE,4DAA4D;IACvE,aAAa,EAAE,oLAAoL;IACnM,WAAW,EAAE;QACX,2DAA2D;QAC3D,yFAAyF;QACzF,+FAA+F;QAC/F,+CAA+C;QAC/C,2BAA2B;QAC3B,0FAA0F;QAC1F,oHAAoH;KACrH;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,iCAAiC;YAChD,OAAO,EAAE,2BAA2B;SACrC;QACD;YACE,aAAa,EAAE,oCAAoC;YACnD,OAAO,EAAE,uCAAuC;SACjD;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,gDAAgD;YAC5D,QAAQ,EAAE,uLAAuL;SAClM;QACD;YACE,UAAU,EAAE,sCAAsC;YAClD,QAAQ,EAAE,sCAAsC;SACjD;QACD;YACE,UAAU,EAAE,0DAA0D;YACtE,QAAQ,EAAE,wFAAwF;SACnG;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;QACD;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACf;KACF;IACD,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hann.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/hann.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAsEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "hann",
|
|
5
|
+
"category": "math/signal",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"hann",
|
|
8
|
+
"window",
|
|
9
|
+
"signal processing",
|
|
10
|
+
"dsp",
|
|
11
|
+
"fft"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Generate a Hann window as an N-by-1 real column vector.",
|
|
14
|
+
"description": "`hann` generates Hann windows for signal-processing workflows such as spectral analysis and filter design. RunMat supports the common MATLAB call forms for symmetric and periodic windows, including optional single-precision output.",
|
|
15
|
+
"behaviors": [
|
|
16
|
+
"`hann(L)` returns an `L x 1` symmetric Hann window.",
|
|
17
|
+
"`hann(L, 'periodic')` returns the periodic form used in spectral-analysis workflows.",
|
|
18
|
+
"`hann(..., 'single')` returns a single-precision window; `'double'` is the default.",
|
|
19
|
+
"If `L` is noninteger, RunMat rounds it to the nearest integer before constructing the window.",
|
|
20
|
+
"`hann(0)` returns an empty `0 x 1` tensor.",
|
|
21
|
+
"`hann(1)` returns `1`.",
|
|
22
|
+
"For the symmetric case and `L > 1`, coefficients follow `0.5 - 0.5*cos(2*pi*n/(L-1))`.",
|
|
23
|
+
"The periodic form is constructed by evaluating a symmetric window of length `L + 1` and dropping the final sample."
|
|
24
|
+
],
|
|
25
|
+
"examples": [
|
|
26
|
+
{
|
|
27
|
+
"description": "Generate a short Hann window",
|
|
28
|
+
"input": "w = hann(8);\ndisp(w')"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"description": "Generate a periodic Hann window for spectral analysis",
|
|
32
|
+
"input": "w = hann(8, 'periodic');\ndisp(w')"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"description": "Generate a single-precision Hann window",
|
|
36
|
+
"input": "w = hann(8, 'single');\nclass(w)"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"faqs": [
|
|
40
|
+
{
|
|
41
|
+
"question": "What is the difference between the symmetric and periodic Hann window?",
|
|
42
|
+
"answer": "Use the default symmetric window for filter-design style workflows. Use `'periodic'` for spectral analysis, where MATLAB and RunMat construct a symmetric window of length `L + 1` and drop the last sample so the sequence matches the periodicity assumptions of the DFT."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"question": "What shape does `hann(L)` return?",
|
|
46
|
+
"answer": "It returns an `L x 1` column vector, matching MATLAB's window-function convention."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"question": "Does `hann` support single precision?",
|
|
50
|
+
"answer": "Yes. Pass `'single'` as the final option to request a single-precision output. The default output type is double precision."
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"links": [
|
|
54
|
+
{
|
|
55
|
+
"label": "hamming",
|
|
56
|
+
"url": "./hamming"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "blackman",
|
|
60
|
+
"url": "./blackman"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"label": "fft",
|
|
64
|
+
"url": "./fft"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"key": "hann",
|
|
68
|
+
"slug": "hann",
|
|
69
|
+
"categoryPath": [
|
|
70
|
+
"math",
|
|
71
|
+
"signal"
|
|
72
|
+
]
|
|
73
|
+
};
|
|
74
|
+
export default builtinDoc;
|
|
75
|
+
//# sourceMappingURL=hann.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hann.js","sourceRoot":"","sources":["../../../src/generated/builtins/hann.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,MAAM;QACN,QAAQ;QACR,mBAAmB;QACnB,KAAK;QACL,KAAK;KACN;IACD,SAAS,EAAE,yDAAyD;IACpE,aAAa,EAAE,yOAAyO;IACxP,WAAW,EAAE;QACX,qDAAqD;QACrD,sFAAsF;QACtF,qFAAqF;QACrF,+FAA+F;QAC/F,4CAA4C;QAC5C,wBAAwB;QACxB,wFAAwF;QACxF,oHAAoH;KACrH;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,8BAA8B;YAC7C,OAAO,EAAE,wBAAwB;SAClC;QACD;YACE,aAAa,EAAE,uDAAuD;YACtE,OAAO,EAAE,oCAAoC;SAC9C;QACD;YACE,aAAa,EAAE,yCAAyC;YACxD,OAAO,EAAE,kCAAkC;SAC5C;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,wEAAwE;YACpF,QAAQ,EAAE,6QAA6Q;SACxR;QACD;YACE,UAAU,EAAE,mCAAmC;YAC/C,QAAQ,EAAE,oFAAoF;SAC/F;QACD;YACE,UAAU,EAAE,uCAAuC;YACnD,QAAQ,EAAE,6HAA6H;SACxI;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;QACD;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACf;KACF;IACD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextpow2.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/nextpow2.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAkEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "nextpow2",
|
|
5
|
+
"category": "math/elementwise",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"nextpow2",
|
|
8
|
+
"power of two",
|
|
9
|
+
"fft",
|
|
10
|
+
"zero padding",
|
|
11
|
+
"gpu"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Return the exponent p such that 2^p is the next power of two greater than or equal to abs(n).",
|
|
14
|
+
"description": "`nextpow2(X)` applies the standard power-of-two exponent transform elementwise, returning `ceil(log2(abs(X)))` with zero mapped to zero. This is commonly used in FFT workflows such as `2^nextpow2(length(x))`.",
|
|
15
|
+
"behaviors": [
|
|
16
|
+
"`nextpow2` accepts real numeric scalars and tensors.",
|
|
17
|
+
"The transform is applied elementwise for array inputs.",
|
|
18
|
+
"Zero maps to `0`.",
|
|
19
|
+
"Negative values use `abs(X)` before computing the exponent.",
|
|
20
|
+
"`Inf` remains infinite and `NaN` remains `NaN`.",
|
|
21
|
+
"GPU tensors use a unary provider hook when available and otherwise gather to the host.",
|
|
22
|
+
"The output preserves the input's scalar/tensor shape."
|
|
23
|
+
],
|
|
24
|
+
"examples": [
|
|
25
|
+
{
|
|
26
|
+
"description": "Compute an FFT-friendly zero-padding length",
|
|
27
|
+
"input": "x = rand(1000, 1);\nN = 2^nextpow2(length(x))"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"description": "Apply nextpow2 elementwise to an array",
|
|
31
|
+
"input": "p = nextpow2([0 1 3 9])",
|
|
32
|
+
"output": "p = [0 0 2 4]"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"faqs": [
|
|
36
|
+
{
|
|
37
|
+
"question": "Why does `nextpow2` return an exponent instead of the actual power of two?",
|
|
38
|
+
"answer": "That matches MATLAB semantics. To get the actual power of two, use `2^nextpow2(x)` for a scalar or `2.^nextpow2(X)` elementwise for arrays."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"question": "How is `nextpow2` used in FFT workflows?",
|
|
42
|
+
"answer": "A common pattern is `N = 2^nextpow2(length(x))`, which computes a power-of-two transform length suitable for zero padding before an FFT."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"question": "Does `nextpow2` preserve array shape?",
|
|
46
|
+
"answer": "Yes. The transform is elementwise and the output has the same scalar/tensor shape as the input."
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"links": [
|
|
50
|
+
{
|
|
51
|
+
"label": "fft",
|
|
52
|
+
"url": "./fft"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"label": "pow2",
|
|
56
|
+
"url": "./pow2"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "length",
|
|
60
|
+
"url": "./length"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"key": "nextpow2",
|
|
64
|
+
"slug": "nextpow2",
|
|
65
|
+
"categoryPath": [
|
|
66
|
+
"math",
|
|
67
|
+
"elementwise"
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
export default builtinDoc;
|
|
71
|
+
//# sourceMappingURL=nextpow2.js.map
|