runmat 0.5.2-dev.3 → 0.5.2-dev.4

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.
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=rref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rref.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/rref.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAgIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,133 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "rref",
5
+ "category": "math/linalg/solve",
6
+ "keywords": [
7
+ "rref",
8
+ "reduced row echelon form",
9
+ "pivot columns",
10
+ "Gaussian elimination",
11
+ "tolerance",
12
+ "gpu"
13
+ ],
14
+ "summary": "Compute reduced row echelon form and MATLAB-style pivot column indices.",
15
+ "references": [],
16
+ "gpu_support": {
17
+ "elementwise": false,
18
+ "reduction": false,
19
+ "precisions": [
20
+ "f32",
21
+ "f64"
22
+ ],
23
+ "broadcasting": "none",
24
+ "notes": "Invokes the acceleration provider's rref hook when available; the current WGPU backend gathers to the host, runs the shared elimination implementation, and re-uploads R and pivcol to keep downstream residency intact."
25
+ },
26
+ "fusion": {
27
+ "elementwise": false,
28
+ "reduction": false,
29
+ "max_inputs": 1,
30
+ "constants": "inline"
31
+ },
32
+ "requires_feature": null,
33
+ "tested": {
34
+ "unit": "builtins::math::linalg::solve::rref::tests",
35
+ "gpu": "builtins::math::linalg::solve::rref::tests::rref_gpu_provider_round_trip",
36
+ "wgpu": "builtins::math::linalg::solve::rref::tests::rref_wgpu_matches_cpu"
37
+ },
38
+ "description": "`rref(A)` returns the reduced row echelon form of matrix `A`. `[R, pivcol] = rref(A)` also returns the 1-based pivot column indices as a row vector.",
39
+ "behaviors": [
40
+ "Supports real numeric, logical, integer, scalar, vector, matrix, and complex matrix inputs. Logical and integer inputs are promoted to double precision before elimination.",
41
+ "The optional second argument `rref(A, tol)` overrides the pivot tolerance. Tolerance must be a finite, non-negative real scalar.",
42
+ "When tolerance is omitted, RunMat uses MATLAB-compatible scaling: `max(size(A)) * eps(norm(A, inf))`.",
43
+ "Pivot search proceeds left to right and chooses the largest-magnitude entry in the remaining rows of the active column.",
44
+ "Pivot column indices in `pivcol` are MATLAB-style 1-based double values. If no pivots are found, `pivcol` has shape `1 x 0`.",
45
+ "Empty matrices and all-zero matrices return unchanged matrix-shaped output with no pivot columns.",
46
+ "Complex inputs use complex division and magnitudes during pivot selection and elimination."
47
+ ],
48
+ "examples": [
49
+ {
50
+ "description": "Computing reduced row echelon form",
51
+ "input": "A = [1 2; 3 4];\nR = rref(A)",
52
+ "output": "R =\n 1 0\n 0 1"
53
+ },
54
+ {
55
+ "description": "Returning pivot columns",
56
+ "input": "A = [1 2; 2 4];\n[R, pivcol] = rref(A)",
57
+ "output": "R =\n 1 2\n 0 0\npivcol =\n 1"
58
+ },
59
+ {
60
+ "description": "Applying an explicit tolerance",
61
+ "input": "A = diag([1, 1e-10]);\n[R, pivcol] = rref(A, 1e-9)",
62
+ "output": "R =\n 1 0\n 0 0\npivcol =\n 1"
63
+ },
64
+ {
65
+ "description": "Reducing a row vector",
66
+ "input": "v = [2 4 6];\nR = rref(v)",
67
+ "output": "R =\n 1 2 3"
68
+ },
69
+ {
70
+ "description": "Using rref with gpuArray data",
71
+ "input": "G = gpuArray([1 2; 3 4]);\n[R, pivcol] = rref(G);\nR_host = gather(R)\npiv_host = gather(pivcol)",
72
+ "output": "R_host =\n 1 0\n 0 1\npiv_host =\n 1 2"
73
+ }
74
+ ],
75
+ "faqs": [
76
+ {
77
+ "question": "How is the default tolerance chosen?",
78
+ "answer": "RunMat follows MATLAB's dense-matrix rule: `max(size(A)) * eps(norm(A, inf))`. Larger or more highly scaled matrices therefore receive a larger pivot cutoff."
79
+ },
80
+ {
81
+ "question": "What shape is `pivcol`?",
82
+ "answer": "`pivcol` is always a row vector of 1-based double indices. No pivots returns an empty row vector with shape `1 x 0`."
83
+ },
84
+ {
85
+ "question": "Does `rref` support complex matrices?",
86
+ "answer": "Yes. Complex values use magnitude-based pivoting and complex arithmetic for row normalization and elimination."
87
+ },
88
+ {
89
+ "question": "Will calling `rref` move GPU data back to the CPU?",
90
+ "answer": "Only when the active provider lacks a native implementation. The current WGPU backend gathers, computes on the host, and re-uploads both outputs so later GPU work can continue with resident tensors."
91
+ }
92
+ ],
93
+ "links": [
94
+ {
95
+ "label": "rank",
96
+ "url": "./rank"
97
+ },
98
+ {
99
+ "label": "pinv",
100
+ "url": "./pinv"
101
+ },
102
+ {
103
+ "label": "lu",
104
+ "url": "./lu"
105
+ },
106
+ {
107
+ "label": "qr",
108
+ "url": "./qr"
109
+ },
110
+ {
111
+ "label": "gather",
112
+ "url": "./gather"
113
+ }
114
+ ],
115
+ "source": {
116
+ "label": "crates/runmat-runtime/src/builtins/math/linalg/solve/rref.rs",
117
+ "url": "crates/runmat-runtime/src/builtins/math/linalg/solve/rref.rs"
118
+ },
119
+ "gpu_residency": "RunMat first offers `rref` to the active acceleration provider through the `rref` hook. Providers without a native implementation gather the input, run the shared host RREF algorithm, and upload both `R` and `pivcol` so downstream GPU kernels can continue without an explicit user-managed transfer.",
120
+ "gpu_behavior": [
121
+ "The current WGPU backend implements `rref` as a provider hook backed by host fallback and re-upload. The builtin is not fused into elementwise kernels; producers flush before `rref` runs, and both outputs are new resident GPU handles when the provider path is active."
122
+ ],
123
+ "key": "rref",
124
+ "slug": "rref",
125
+ "aliases": [],
126
+ "categoryPath": [
127
+ "math",
128
+ "linalg",
129
+ "solve"
130
+ ]
131
+ };
132
+ export default builtinDoc;
133
+ //# sourceMappingURL=rref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rref.js","sourceRoot":"","sources":["../../../src/generated/builtins/rref.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE;QACV,MAAM;QACN,0BAA0B;QAC1B,eAAe;QACf,sBAAsB;QACtB,WAAW;QACX,KAAK;KACN;IACD,SAAS,EAAE,yEAAyE;IACpF,YAAY,EAAE,EAAE;IAChB,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE;YACZ,KAAK;YACL,KAAK;SACN;QACD,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,0NAA0N;KACpO;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,4CAA4C;QACpD,KAAK,EAAE,0EAA0E;QACjF,MAAM,EAAE,mEAAmE;KAC5E;IACD,aAAa,EAAE,sJAAsJ;IACrK,WAAW,EAAE;QACX,6KAA6K;QAC7K,kIAAkI;QAClI,uGAAuG;QACvG,yHAAyH;QACzH,8HAA8H;QAC9H,mGAAmG;QACnG,4FAA4F;KAC7F;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,oCAAoC;YACnD,OAAO,EAAE,8BAA8B;YACvC,QAAQ,EAAE,iCAAiC;SAC5C;QACD;YACE,aAAa,EAAE,yBAAyB;YACxC,OAAO,EAAE,wCAAwC;YACjD,QAAQ,EAAE,mDAAmD;SAC9D;QACD;YACE,aAAa,EAAE,gCAAgC;YAC/C,OAAO,EAAE,oDAAoD;YAC7D,QAAQ,EAAE,mDAAmD;SAC9D;QACD;YACE,aAAa,EAAE,uBAAuB;YACtC,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,yBAAyB;SACpC;QACD;YACE,aAAa,EAAE,+BAA+B;YAC9C,OAAO,EAAE,kGAAkG;YAC3G,QAAQ,EAAE,gEAAgE;SAC3E;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,sCAAsC;YAClD,QAAQ,EAAE,+JAA+J;SAC1K;QACD;YACE,UAAU,EAAE,yBAAyB;YACrC,QAAQ,EAAE,sHAAsH;SACjI;QACD;YACE,UAAU,EAAE,uCAAuC;YACnD,QAAQ,EAAE,gHAAgH;SAC3H;QACD;YACE,UAAU,EAAE,oDAAoD;YAChE,QAAQ,EAAE,wMAAwM;SACnN;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,MAAM;SACd;QACD;YACE,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,MAAM;SACd;QACD;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,8DAA8D;QACvE,KAAK,EAAE,8DAA8D;KACtE;IACD,eAAe,EAAE,4SAA4S;IAC7T,cAAc,EAAE;QACd,6QAA6Q;KAC9Q;IACD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;QACR,OAAO;KACR;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,EA83QjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAya9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
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,EAo5QjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA0a9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
@@ -6517,6 +6517,28 @@ export const builtinManifest = [
6517
6517
  "summary": "Round values to nearest integers, decimal places, or significant digits with MATLAB-compatible modes.",
6518
6518
  "exampleCount": 5
6519
6519
  },
6520
+ {
6521
+ "key": "rref",
6522
+ "title": "rref",
6523
+ "slug": "rref",
6524
+ "aliases": [],
6525
+ "category": "math/linalg/solve",
6526
+ "categoryPath": [
6527
+ "math",
6528
+ "linalg",
6529
+ "solve"
6530
+ ],
6531
+ "keywords": [
6532
+ "rref",
6533
+ "reduced row echelon form",
6534
+ "pivot columns",
6535
+ "Gaussian elimination",
6536
+ "tolerance",
6537
+ "gpu"
6538
+ ],
6539
+ "summary": "Compute reduced row echelon form and MATLAB-style pivot column indices.",
6540
+ "exampleCount": 5
6541
+ },
6520
6542
  {
6521
6543
  "key": "save",
6522
6544
  "title": "save",
@@ -8897,6 +8919,7 @@ export const builtinDocLoaders = {
8897
8919
  "roots": () => import("./builtins/roots.js").then((mod) => mod.default),
8898
8920
  "rot90": () => import("./builtins/rot90.js").then((mod) => mod.default),
8899
8921
  "round": () => import("./builtins/round.js").then((mod) => mod.default),
8922
+ "rref": () => import("./builtins/rref.js").then((mod) => mod.default),
8900
8923
  "save": () => import("./builtins/save.js").then((mod) => mod.default),
8901
8924
  "savepath": () => import("./builtins/savepath.js").then((mod) => mod.default),
8902
8925
  "sawtooth": () => import("./builtins/sawtooth.js").then((mod) => mod.default),