runmat 0.4.6-dev.0 → 0.4.6-dev.1
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/exprnd.d.ts +4 -0
- package/dist/generated/builtins/exprnd.d.ts.map +1 -0
- package/dist/generated/builtins/exprnd.js +125 -0
- package/dist/generated/builtins/exprnd.js.map +1 -0
- package/dist/generated/builtins/normrnd.d.ts +4 -0
- package/dist/generated/builtins/normrnd.d.ts.map +1 -0
- package/dist/generated/builtins/normrnd.js +125 -0
- package/dist/generated/builtins/normrnd.js.map +1 -0
- package/dist/generated/builtins/unifrnd.d.ts +4 -0
- package/dist/generated/builtins/unifrnd.d.ts.map +1 -0
- package/dist/generated/builtins/unifrnd.js +124 -0
- package/dist/generated/builtins/unifrnd.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -1
- package/dist/generated/builtins-manifest.js +66 -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":"exprnd.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/exprnd.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAwHjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "exprnd",
|
|
5
|
+
"category": "stats/random",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"exprnd",
|
|
8
|
+
"exponential",
|
|
9
|
+
"random",
|
|
10
|
+
"distribution",
|
|
11
|
+
"statistics",
|
|
12
|
+
"queueing",
|
|
13
|
+
"poisson"
|
|
14
|
+
],
|
|
15
|
+
"summary": "Exponentially-distributed random numbers with mean mu.",
|
|
16
|
+
"references": [],
|
|
17
|
+
"gpu_support": {
|
|
18
|
+
"elementwise": false,
|
|
19
|
+
"reduction": false,
|
|
20
|
+
"precisions": [
|
|
21
|
+
"f64"
|
|
22
|
+
],
|
|
23
|
+
"broadcasting": "none",
|
|
24
|
+
"notes": "Uses the provider random_exponential hook (Philox CSPRNG + inverse-transform sampling) when an F64-precision provider is active. F32 providers and providers without the hook fall back to host generation."
|
|
25
|
+
},
|
|
26
|
+
"fusion": {
|
|
27
|
+
"elementwise": false,
|
|
28
|
+
"reduction": false,
|
|
29
|
+
"max_inputs": 0,
|
|
30
|
+
"constants": "none"
|
|
31
|
+
},
|
|
32
|
+
"requires_feature": null,
|
|
33
|
+
"tested": {
|
|
34
|
+
"unit": "builtins::stats::random::exprnd::tests",
|
|
35
|
+
"integration": null
|
|
36
|
+
},
|
|
37
|
+
"description": "`exprnd` draws pseudorandom samples from the exponential distribution with mean `mu` (equivalently, rate parameter `lambda = 1/mu`). It is part of the **Statistics and Machine Learning Toolbox** family in MATLAB and Octave's `statistics` package. RunMat implements it via inverse transform sampling: `r = -mu * ln(U)` where `U ~ Uniform(0, 1)`.",
|
|
38
|
+
"behaviors": [
|
|
39
|
+
"`exprnd(mu)` returns a scalar double drawn from `Exp(mu)`.",
|
|
40
|
+
"`exprnd(mu, n)` returns an `n × n` matrix of samples.",
|
|
41
|
+
"`exprnd(mu, m, n)` returns an `m × n` matrix of samples.",
|
|
42
|
+
"`exprnd(mu, sz)` accepts a size vector and returns an array with shape `sz`.",
|
|
43
|
+
"`mu` must be a positive scalar; `exprnd` errors if `mu <= 0`.",
|
|
44
|
+
"All outputs are double precision regardless of input type."
|
|
45
|
+
],
|
|
46
|
+
"examples": [
|
|
47
|
+
{
|
|
48
|
+
"description": "Single sample from Exp(2)",
|
|
49
|
+
"input": "rng(0);\nr = exprnd(2)"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"description": "Matrix of arrival times for a Poisson process (lambda = 2)",
|
|
53
|
+
"input": "rng(0);\nlambda = 2;\nintervals = exprnd(1/lambda, 1, 5)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"description": "M/M/1 queueing simulation fragment",
|
|
57
|
+
"input": "rng(0);\nlambda = 2; mu_svc = 2.5; Tsim = 100;\nt = 0; arrivals = 0;\nwhile t < Tsim\n t = t + exprnd(1/lambda);\n arrivals = arrivals + 1;\nend\narrivals"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"description": "Specifying dimensions with a size vector",
|
|
61
|
+
"input": "rng(0);\nT = exprnd(1, [2 3])"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"faqs": [
|
|
65
|
+
{
|
|
66
|
+
"question": "What is the relationship between mu and lambda?",
|
|
67
|
+
"answer": "The exponential distribution can be parameterised by its mean `mu` or its rate `lambda`. They are reciprocals: `mu = 1/lambda`. `exprnd(mu)` is equivalent to `exprnd(1/lambda)`."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"question": "What is the workaround if exprnd is unavailable?",
|
|
71
|
+
"answer": "`exprnd(mu)` is mathematically equivalent to `-mu * log(rand())`. You can substitute `-log(rand())/lambda` inline until `exprnd` is available."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"question": "Why must mu be positive?",
|
|
75
|
+
"answer": "A non-positive mean is undefined for the exponential distribution. `exprnd` raises an error if `mu <= 0` to catch common parameter mistakes early."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"question": "What use cases does exprnd support?",
|
|
79
|
+
"answer": "Common uses include queueing theory (M/M/1, M/G/1 inter-arrival and service times), reliability engineering (time-to-failure models), Poisson process simulation, and Monte Carlo sampling."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"question": "Does exprnd fuse with other operations?",
|
|
83
|
+
"answer": "No. Random generation is excluded from fusion planning to preserve statistical properties."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"question": "How do I control reproducibility?",
|
|
87
|
+
"answer": "Use `rng` before calling `exprnd` to seed the global generator."
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"links": [
|
|
91
|
+
{
|
|
92
|
+
"label": "normrnd",
|
|
93
|
+
"url": "./normrnd"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"label": "unifrnd",
|
|
97
|
+
"url": "./unifrnd"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"label": "rand",
|
|
101
|
+
"url": "./rand"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "randn",
|
|
105
|
+
"url": "./randn"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"label": "rng",
|
|
109
|
+
"url": "./rng"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"source": {
|
|
113
|
+
"label": "`crates/runmat-runtime/src/builtins/stats/random/exprnd.rs`",
|
|
114
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/stats/random/exprnd.rs"
|
|
115
|
+
},
|
|
116
|
+
"key": "exprnd",
|
|
117
|
+
"slug": "exprnd",
|
|
118
|
+
"aliases": [],
|
|
119
|
+
"categoryPath": [
|
|
120
|
+
"stats",
|
|
121
|
+
"random"
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
export default builtinDoc;
|
|
125
|
+
//# sourceMappingURL=exprnd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exprnd.js","sourceRoot":"","sources":["../../../src/generated/builtins/exprnd.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE;QACV,QAAQ;QACR,aAAa;QACb,QAAQ;QACR,cAAc;QACd,YAAY;QACZ,UAAU;QACV,SAAS;KACV;IACD,SAAS,EAAE,wDAAwD;IACnE,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,6MAA6M;KACvN;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,MAAM;KACpB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,wCAAwC;QAChD,aAAa,EAAE,IAAI;KACpB;IACD,aAAa,EAAE,0VAA0V;IACzW,WAAW,EAAE;QACX,4DAA4D;QAC5D,uDAAuD;QACvD,0DAA0D;QAC1D,8EAA8E;QAC9E,+DAA+D;QAC/D,4DAA4D;KAC7D;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,2BAA2B;YAC1C,OAAO,EAAE,wBAAwB;SAClC;QACD;YACE,aAAa,EAAE,4DAA4D;YAC3E,OAAO,EAAE,0DAA0D;SACpE;QACD;YACE,aAAa,EAAE,oCAAoC;YACnD,OAAO,EAAE,kKAAkK;SAC5K;QACD;YACE,aAAa,EAAE,0CAA0C;YACzD,OAAO,EAAE,+BAA+B;SACzC;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,iDAAiD;YAC7D,QAAQ,EAAE,mLAAmL;SAC9L;QACD;YACE,UAAU,EAAE,kDAAkD;YAC9D,QAAQ,EAAE,gJAAgJ;SAC3J;QACD;YACE,UAAU,EAAE,0BAA0B;YACtC,QAAQ,EAAE,oJAAoJ;SAC/J;QACD;YACE,UAAU,EAAE,qCAAqC;YACjD,QAAQ,EAAE,6LAA6L;SACxM;QACD;YACE,UAAU,EAAE,yCAAyC;YACrD,QAAQ,EAAE,4FAA4F;SACvG;QACD;YACE,UAAU,EAAE,mCAAmC;YAC/C,QAAQ,EAAE,iEAAiE;SAC5E;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACf;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,6DAA6D;QACtE,KAAK,EAAE,0GAA0G;KAClH;IACD,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,OAAO;QACP,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normrnd.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/normrnd.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAwHjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "normrnd",
|
|
5
|
+
"category": "stats/random",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"normrnd",
|
|
8
|
+
"normal",
|
|
9
|
+
"gaussian",
|
|
10
|
+
"random",
|
|
11
|
+
"distribution",
|
|
12
|
+
"statistics"
|
|
13
|
+
],
|
|
14
|
+
"summary": "Normally-distributed random numbers with mean mu and standard deviation sigma.",
|
|
15
|
+
"references": [],
|
|
16
|
+
"gpu_support": {
|
|
17
|
+
"elementwise": false,
|
|
18
|
+
"reduction": false,
|
|
19
|
+
"precisions": [
|
|
20
|
+
"f64"
|
|
21
|
+
],
|
|
22
|
+
"broadcasting": "none",
|
|
23
|
+
"notes": "Uses the provider random_normrnd hook (Philox CSPRNG + Box-Muller sampling) when an F64-precision provider is active. F32 providers and providers without the hook fall back to host generation."
|
|
24
|
+
},
|
|
25
|
+
"fusion": {
|
|
26
|
+
"elementwise": false,
|
|
27
|
+
"reduction": false,
|
|
28
|
+
"max_inputs": 0,
|
|
29
|
+
"constants": "none"
|
|
30
|
+
},
|
|
31
|
+
"requires_feature": null,
|
|
32
|
+
"tested": {
|
|
33
|
+
"unit": "builtins::stats::random::normrnd::tests",
|
|
34
|
+
"integration": null
|
|
35
|
+
},
|
|
36
|
+
"description": "`normrnd` draws pseudorandom samples from the normal distribution with mean `mu` and standard deviation `sigma`. It is part of the **Statistics and Machine Learning Toolbox** family in MATLAB and Octave's `statistics` package. RunMat implements it by generating standard normal variates and scaling them as `r = mu + sigma * Z` where `Z ~ N(0, 1)`.",
|
|
37
|
+
"behaviors": [
|
|
38
|
+
"`normrnd(mu, sigma)` returns a scalar double drawn from `N(mu, sigma^2)`.",
|
|
39
|
+
"`normrnd(mu, sigma, n)` returns an `n × n` matrix of samples.",
|
|
40
|
+
"`normrnd(mu, sigma, m, n)` returns an `m × n` matrix of samples.",
|
|
41
|
+
"`normrnd(mu, sigma, sz)` accepts a size vector and returns an array with shape `sz`.",
|
|
42
|
+
"`mu` and `sigma` must be scalar numeric values.",
|
|
43
|
+
"`sigma` must be non-negative; `normrnd` errors if `sigma < 0`.",
|
|
44
|
+
"All outputs are double precision regardless of input type."
|
|
45
|
+
],
|
|
46
|
+
"examples": [
|
|
47
|
+
{
|
|
48
|
+
"description": "Single sample from N(0, 1)",
|
|
49
|
+
"input": "rng(0);\nr = normrnd(0, 1)"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"description": "Matrix of Gaussian noise with mean 10 and standard deviation 2",
|
|
53
|
+
"input": "rng(0);\nX = normrnd(10, 2, 2, 3)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"description": "Simulating normally-distributed measurement errors",
|
|
57
|
+
"input": "rng(0);\ntrueValue = 100;\nsigma = 0.5;\nmeasurements = trueValue + normrnd(0, sigma, 1, 5)"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"description": "Specifying dimensions with a size vector",
|
|
61
|
+
"input": "rng(0);\nT = normrnd(5, 1.5, [2 3])"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"faqs": [
|
|
65
|
+
{
|
|
66
|
+
"question": "What do mu and sigma mean?",
|
|
67
|
+
"answer": "`mu` is the distribution mean and `sigma` is the standard deviation. The variance is `sigma^2`, so `normrnd(mu, sigma)` draws from `N(mu, sigma^2)`."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"question": "What is the workaround if normrnd is unavailable?",
|
|
71
|
+
"answer": "`normrnd(mu, sigma)` is mathematically equivalent to `mu + sigma * randn()`. For arrays, use `mu + sigma * randn(sz)` with the same requested size."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"question": "Can sigma be zero?",
|
|
75
|
+
"answer": "Yes. `sigma = 0` is allowed and returns deterministic samples equal to `mu`. Negative standard deviations are undefined and raise an error."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"question": "What use cases does normrnd support?",
|
|
79
|
+
"answer": "Common uses include Gaussian noise generation, measurement error simulation, confidence interval experiments, Monte Carlo sampling, and normally-distributed model residuals."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"question": "Does normrnd fuse with other operations?",
|
|
83
|
+
"answer": "No. Random generation is excluded from fusion planning to preserve statistical properties."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"question": "How do I control reproducibility?",
|
|
87
|
+
"answer": "Use `rng` before calling `normrnd` to seed the global generator."
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"links": [
|
|
91
|
+
{
|
|
92
|
+
"label": "exprnd",
|
|
93
|
+
"url": "./exprnd"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"label": "unifrnd",
|
|
97
|
+
"url": "./unifrnd"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"label": "rand",
|
|
101
|
+
"url": "./rand"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "randn",
|
|
105
|
+
"url": "./randn"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"label": "rng",
|
|
109
|
+
"url": "./rng"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"source": {
|
|
113
|
+
"label": "`crates/runmat-runtime/src/builtins/stats/random/normrnd.rs`",
|
|
114
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/stats/random/normrnd.rs"
|
|
115
|
+
},
|
|
116
|
+
"key": "normrnd",
|
|
117
|
+
"slug": "normrnd",
|
|
118
|
+
"aliases": [],
|
|
119
|
+
"categoryPath": [
|
|
120
|
+
"stats",
|
|
121
|
+
"random"
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
export default builtinDoc;
|
|
125
|
+
//# sourceMappingURL=normrnd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normrnd.js","sourceRoot":"","sources":["../../../src/generated/builtins/normrnd.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE;QACV,SAAS;QACT,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,cAAc;QACd,YAAY;KACb;IACD,SAAS,EAAE,gFAAgF;IAC3F,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,kMAAkM;KAC5M;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,MAAM;KACpB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,yCAAyC;QACjD,aAAa,EAAE,IAAI;KACpB;IACD,aAAa,EAAE,8VAA8V;IAC7W,WAAW,EAAE;QACX,2EAA2E;QAC3E,+DAA+D;QAC/D,kEAAkE;QAClE,sFAAsF;QACtF,iDAAiD;QACjD,gEAAgE;QAChE,4DAA4D;KAC7D;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,4BAA4B;YAC3C,OAAO,EAAE,4BAA4B;SACtC;QACD;YACE,aAAa,EAAE,gEAAgE;YAC/E,OAAO,EAAE,mCAAmC;SAC7C;QACD;YACE,aAAa,EAAE,oDAAoD;YACnE,OAAO,EAAE,6FAA6F;SACvG;QACD;YACE,aAAa,EAAE,0CAA0C;YACzD,OAAO,EAAE,qCAAqC;SAC/C;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,4BAA4B;YACxC,QAAQ,EAAE,sJAAsJ;SACjK;QACD;YACE,UAAU,EAAE,mDAAmD;YAC/D,QAAQ,EAAE,qJAAqJ;SAChK;QACD;YACE,UAAU,EAAE,oBAAoB;YAChC,QAAQ,EAAE,6IAA6I;SACxJ;QACD;YACE,UAAU,EAAE,sCAAsC;YAClD,QAAQ,EAAE,+KAA+K;SAC1L;QACD;YACE,UAAU,EAAE,0CAA0C;YACtD,QAAQ,EAAE,4FAA4F;SACvG;QACD;YACE,UAAU,EAAE,mCAAmC;YAC/C,QAAQ,EAAE,kEAAkE;SAC7E;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACf;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,8DAA8D;QACvE,KAAK,EAAE,2GAA2G;KACnH;IACD,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,OAAO;QACP,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unifrnd.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/unifrnd.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAuHjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "unifrnd",
|
|
5
|
+
"category": "stats/random",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"unifrnd",
|
|
8
|
+
"uniform",
|
|
9
|
+
"random",
|
|
10
|
+
"distribution",
|
|
11
|
+
"statistics"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Uniformly-distributed random numbers on the interval [a, b).",
|
|
14
|
+
"references": [],
|
|
15
|
+
"gpu_support": {
|
|
16
|
+
"elementwise": false,
|
|
17
|
+
"reduction": false,
|
|
18
|
+
"precisions": [
|
|
19
|
+
"f64"
|
|
20
|
+
],
|
|
21
|
+
"broadcasting": "none",
|
|
22
|
+
"notes": "Uses the provider random_unifrnd hook (Philox CSPRNG + affine scaling) when an F64-precision provider is active. F32 providers and providers without the hook fall back to host generation."
|
|
23
|
+
},
|
|
24
|
+
"fusion": {
|
|
25
|
+
"elementwise": false,
|
|
26
|
+
"reduction": false,
|
|
27
|
+
"max_inputs": 0,
|
|
28
|
+
"constants": "none"
|
|
29
|
+
},
|
|
30
|
+
"requires_feature": null,
|
|
31
|
+
"tested": {
|
|
32
|
+
"unit": "builtins::stats::random::unifrnd::tests",
|
|
33
|
+
"integration": null
|
|
34
|
+
},
|
|
35
|
+
"description": "`unifrnd` draws pseudorandom samples from the continuous uniform distribution on the half-open interval `[a, b)`. It is part of the **Statistics and Machine Learning Toolbox** family in MATLAB and Octave's `statistics` package. RunMat implements it by scaling base uniform variates as `r = a + (b - a) * U` where `U ~ Uniform(0, 1)`.",
|
|
36
|
+
"behaviors": [
|
|
37
|
+
"`unifrnd(a, b)` returns a scalar double drawn from `Uniform(a, b)`.",
|
|
38
|
+
"`unifrnd(a, b, n)` returns an `n × n` matrix of samples.",
|
|
39
|
+
"`unifrnd(a, b, m, n)` returns an `m × n` matrix of samples.",
|
|
40
|
+
"`unifrnd(a, b, sz)` accepts a size vector and returns an array with shape `sz`.",
|
|
41
|
+
"`a` and `b` must be scalar numeric values.",
|
|
42
|
+
"`a` must be less than `b`; `unifrnd` errors if `a >= b`.",
|
|
43
|
+
"All outputs are double precision regardless of input type."
|
|
44
|
+
],
|
|
45
|
+
"examples": [
|
|
46
|
+
{
|
|
47
|
+
"description": "Single sample from Uniform(2, 5)",
|
|
48
|
+
"input": "rng(0);\nr = unifrnd(2, 5)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"description": "Matrix of random values between -1 and 1",
|
|
52
|
+
"input": "rng(0);\nX = unifrnd(-1, 1, 2, 3)"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"description": "Monte Carlo samples for uncertain input bounds",
|
|
56
|
+
"input": "rng(0);\nlow = 10; high = 20;\nsamples = unifrnd(low, high, 1, 5)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"description": "Specifying dimensions with a size vector",
|
|
60
|
+
"input": "rng(0);\nT = unifrnd(0, 100, [2 3])"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"faqs": [
|
|
64
|
+
{
|
|
65
|
+
"question": "Are the bounds inclusive?",
|
|
66
|
+
"answer": "RunMat generates samples on the half-open interval `[a, b)`: values can be equal to `a`, but are always strictly less than `b`."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"question": "What is the workaround if unifrnd is unavailable?",
|
|
70
|
+
"answer": "`unifrnd(a, b)` is mathematically equivalent to `a + (b - a) * rand()`. For arrays, use `a + (b - a) * rand(sz)` with the same requested size."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"question": "Why must a be less than b?",
|
|
74
|
+
"answer": "A continuous uniform distribution needs a positive-width interval. `unifrnd` raises an error if `a >= b` to catch invalid bounds early."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"question": "What use cases does unifrnd support?",
|
|
78
|
+
"answer": "Common uses include Monte Carlo sampling, randomized initial conditions, parameter sweeps over bounded ranges, simulation inputs, and continuous random perturbations."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"question": "Does unifrnd fuse with other operations?",
|
|
82
|
+
"answer": "No. Random generation is excluded from fusion planning to preserve statistical properties."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"question": "How do I control reproducibility?",
|
|
86
|
+
"answer": "Use `rng` before calling `unifrnd` to seed the global generator."
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"links": [
|
|
90
|
+
{
|
|
91
|
+
"label": "exprnd",
|
|
92
|
+
"url": "./exprnd"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "normrnd",
|
|
96
|
+
"url": "./normrnd"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"label": "rand",
|
|
100
|
+
"url": "./rand"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"label": "randn",
|
|
104
|
+
"url": "./randn"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"label": "rng",
|
|
108
|
+
"url": "./rng"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"source": {
|
|
112
|
+
"label": "`crates/runmat-runtime/src/builtins/stats/random/unifrnd.rs`",
|
|
113
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/stats/random/unifrnd.rs"
|
|
114
|
+
},
|
|
115
|
+
"key": "unifrnd",
|
|
116
|
+
"slug": "unifrnd",
|
|
117
|
+
"aliases": [],
|
|
118
|
+
"categoryPath": [
|
|
119
|
+
"stats",
|
|
120
|
+
"random"
|
|
121
|
+
]
|
|
122
|
+
};
|
|
123
|
+
export default builtinDoc;
|
|
124
|
+
//# sourceMappingURL=unifrnd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unifrnd.js","sourceRoot":"","sources":["../../../src/generated/builtins/unifrnd.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE;QACV,SAAS;QACT,SAAS;QACT,QAAQ;QACR,cAAc;QACd,YAAY;KACb;IACD,SAAS,EAAE,8DAA8D;IACzE,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,6LAA6L;KACvM;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,MAAM;KACpB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,yCAAyC;QACjD,aAAa,EAAE,IAAI;KACpB;IACD,aAAa,EAAE,+UAA+U;IAC9V,WAAW,EAAE;QACX,qEAAqE;QACrE,0DAA0D;QAC1D,6DAA6D;QAC7D,iFAAiF;QACjF,4CAA4C;QAC5C,0DAA0D;QAC1D,4DAA4D;KAC7D;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE,4BAA4B;SACtC;QACD;YACE,aAAa,EAAE,0CAA0C;YACzD,OAAO,EAAE,mCAAmC;SAC7C;QACD;YACE,aAAa,EAAE,gDAAgD;YAC/D,OAAO,EAAE,mEAAmE;SAC7E;QACD;YACE,aAAa,EAAE,0CAA0C;YACzD,OAAO,EAAE,qCAAqC;SAC/C;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,2BAA2B;YACvC,QAAQ,EAAE,iIAAiI;SAC5I;QACD;YACE,UAAU,EAAE,mDAAmD;YAC/D,QAAQ,EAAE,gJAAgJ;SAC3J;QACD;YACE,UAAU,EAAE,4BAA4B;YACxC,QAAQ,EAAE,yIAAyI;SACpJ;QACD;YACE,UAAU,EAAE,sCAAsC;YAClD,QAAQ,EAAE,wKAAwK;SACnL;QACD;YACE,UAAU,EAAE,0CAA0C;YACtD,QAAQ,EAAE,4FAA4F;SACvG;QACD;YACE,UAAU,EAAE,mCAAmC;YAC/C,QAAQ,EAAE,kEAAkE;SAC7E;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,OAAO;SACf;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,8DAA8D;QACvE,KAAK,EAAE,2GAA2G;KACnH;IACD,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,OAAO;QACP,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EA8iPjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA+X9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
|
|
@@ -1803,6 +1803,28 @@ export const builtinManifest = [
|
|
|
1803
1803
|
"summary": "Accurate element-wise computation of exp(x) - 1 for scalars, vectors, matrices, or N-D tensors.",
|
|
1804
1804
|
"exampleCount": 5
|
|
1805
1805
|
},
|
|
1806
|
+
{
|
|
1807
|
+
"key": "exprnd",
|
|
1808
|
+
"title": "exprnd",
|
|
1809
|
+
"slug": "exprnd",
|
|
1810
|
+
"aliases": [],
|
|
1811
|
+
"category": "stats/random",
|
|
1812
|
+
"categoryPath": [
|
|
1813
|
+
"stats",
|
|
1814
|
+
"random"
|
|
1815
|
+
],
|
|
1816
|
+
"keywords": [
|
|
1817
|
+
"exprnd",
|
|
1818
|
+
"exponential",
|
|
1819
|
+
"random",
|
|
1820
|
+
"distribution",
|
|
1821
|
+
"statistics",
|
|
1822
|
+
"queueing",
|
|
1823
|
+
"poisson"
|
|
1824
|
+
],
|
|
1825
|
+
"summary": "Exponentially-distributed random numbers with mean mu.",
|
|
1826
|
+
"exampleCount": 4
|
|
1827
|
+
},
|
|
1806
1828
|
{
|
|
1807
1829
|
"key": "extractbetween",
|
|
1808
1830
|
"title": "extractBetween",
|
|
@@ -4651,6 +4673,27 @@ export const builtinManifest = [
|
|
|
4651
4673
|
"summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.",
|
|
4652
4674
|
"exampleCount": 6
|
|
4653
4675
|
},
|
|
4676
|
+
{
|
|
4677
|
+
"key": "normrnd",
|
|
4678
|
+
"title": "normrnd",
|
|
4679
|
+
"slug": "normrnd",
|
|
4680
|
+
"aliases": [],
|
|
4681
|
+
"category": "stats/random",
|
|
4682
|
+
"categoryPath": [
|
|
4683
|
+
"stats",
|
|
4684
|
+
"random"
|
|
4685
|
+
],
|
|
4686
|
+
"keywords": [
|
|
4687
|
+
"normrnd",
|
|
4688
|
+
"normal",
|
|
4689
|
+
"gaussian",
|
|
4690
|
+
"random",
|
|
4691
|
+
"distribution",
|
|
4692
|
+
"statistics"
|
|
4693
|
+
],
|
|
4694
|
+
"summary": "Normally-distributed random numbers with mean mu and standard deviation sigma.",
|
|
4695
|
+
"exampleCount": 4
|
|
4696
|
+
},
|
|
4654
4697
|
{
|
|
4655
4698
|
"key": "not",
|
|
4656
4699
|
"title": "not",
|
|
@@ -7280,6 +7323,26 @@ export const builtinManifest = [
|
|
|
7280
7323
|
"summary": "Create logical arrays filled with true values.",
|
|
7281
7324
|
"exampleCount": 3
|
|
7282
7325
|
},
|
|
7326
|
+
{
|
|
7327
|
+
"key": "unifrnd",
|
|
7328
|
+
"title": "unifrnd",
|
|
7329
|
+
"slug": "unifrnd",
|
|
7330
|
+
"aliases": [],
|
|
7331
|
+
"category": "stats/random",
|
|
7332
|
+
"categoryPath": [
|
|
7333
|
+
"stats",
|
|
7334
|
+
"random"
|
|
7335
|
+
],
|
|
7336
|
+
"keywords": [
|
|
7337
|
+
"unifrnd",
|
|
7338
|
+
"uniform",
|
|
7339
|
+
"random",
|
|
7340
|
+
"distribution",
|
|
7341
|
+
"statistics"
|
|
7342
|
+
],
|
|
7343
|
+
"summary": "Uniformly-distributed random numbers on the interval [a, b).",
|
|
7344
|
+
"exampleCount": 4
|
|
7345
|
+
},
|
|
7283
7346
|
{
|
|
7284
7347
|
"key": "union",
|
|
7285
7348
|
"title": "union",
|
|
@@ -7754,6 +7817,7 @@ export const builtinDocLoaders = {
|
|
|
7754
7817
|
"exist": () => import("./builtins/exist.js").then((mod) => mod.default),
|
|
7755
7818
|
"exp": () => import("./builtins/exp.js").then((mod) => mod.default),
|
|
7756
7819
|
"expm1": () => import("./builtins/expm1.js").then((mod) => mod.default),
|
|
7820
|
+
"exprnd": () => import("./builtins/exprnd.js").then((mod) => mod.default),
|
|
7757
7821
|
"extractbetween": () => import("./builtins/extractBetween.js").then((mod) => mod.default),
|
|
7758
7822
|
"eye": () => import("./builtins/eye.js").then((mod) => mod.default),
|
|
7759
7823
|
"factorial": () => import("./builtins/factorial.js").then((mod) => mod.default),
|
|
@@ -7894,6 +7958,7 @@ export const builtinDocLoaders = {
|
|
|
7894
7958
|
"nextpow2": () => import("./builtins/nextpow2.js").then((mod) => mod.default),
|
|
7895
7959
|
"nnz": () => import("./builtins/nnz.js").then((mod) => mod.default),
|
|
7896
7960
|
"norm": () => import("./builtins/norm.js").then((mod) => mod.default),
|
|
7961
|
+
"normrnd": () => import("./builtins/normrnd.js").then((mod) => mod.default),
|
|
7897
7962
|
"not": () => import("./builtins/not.js").then((mod) => mod.default),
|
|
7898
7963
|
"num2str": () => import("./builtins/num2str.js").then((mod) => mod.default),
|
|
7899
7964
|
"numel": () => import("./builtins/numel.js").then((mod) => mod.default),
|
|
@@ -8025,6 +8090,7 @@ export const builtinDocLoaders = {
|
|
|
8025
8090
|
"tril": () => import("./builtins/tril.js").then((mod) => mod.default),
|
|
8026
8091
|
"triu": () => import("./builtins/triu.js").then((mod) => mod.default),
|
|
8027
8092
|
"true": () => import("./builtins/true.js").then((mod) => mod.default),
|
|
8093
|
+
"unifrnd": () => import("./builtins/unifrnd.js").then((mod) => mod.default),
|
|
8028
8094
|
"union": () => import("./builtins/union.js").then((mod) => mod.default),
|
|
8029
8095
|
"unique": () => import("./builtins/unique.js").then((mod) => mod.default),
|
|
8030
8096
|
"upper": () => import("./builtins/upper.js").then((mod) => mod.default),
|