@pawells/math-extended 1.0.5 → 2.0.0
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/README.md +5 -5
- package/build/angles.d.ts +43 -3
- package/build/angles.d.ts.map +1 -1
- package/build/angles.js +61 -34
- package/build/angles.js.map +1 -1
- package/build/clamp.d.ts +5 -3
- package/build/clamp.d.ts.map +1 -1
- package/build/clamp.js +5 -3
- package/build/clamp.js.map +1 -1
- package/build/interpolation.d.ts +444 -67
- package/build/interpolation.d.ts.map +1 -1
- package/build/interpolation.js +444 -67
- package/build/interpolation.js.map +1 -1
- package/build/matrices/_exports.d.ts +13 -0
- package/build/matrices/_exports.d.ts.map +1 -0
- package/build/matrices/_exports.js +13 -0
- package/build/matrices/_exports.js.map +1 -0
- package/build/matrices/arithmetic.d.ts +170 -181
- package/build/matrices/arithmetic.d.ts.map +1 -1
- package/build/matrices/arithmetic.js +192 -202
- package/build/matrices/arithmetic.js.map +1 -1
- package/build/matrices/asserts.d.ts +244 -116
- package/build/matrices/asserts.d.ts.map +1 -1
- package/build/matrices/asserts.js +291 -94
- package/build/matrices/asserts.js.map +1 -1
- package/build/matrices/core.d.ts +40 -41
- package/build/matrices/core.d.ts.map +1 -1
- package/build/matrices/core.js +12 -13
- package/build/matrices/core.js.map +1 -1
- package/build/matrices/decompositions.d.ts +121 -124
- package/build/matrices/decompositions.d.ts.map +1 -1
- package/build/matrices/decompositions.js +168 -226
- package/build/matrices/decompositions.js.map +1 -1
- package/build/matrices/index.d.ts +3 -2
- package/build/matrices/index.d.ts.map +1 -1
- package/build/matrices/index.js +5 -2
- package/build/matrices/index.js.map +1 -1
- package/build/matrices/linear-algebra.d.ts +18 -13
- package/build/matrices/linear-algebra.d.ts.map +1 -1
- package/build/matrices/linear-algebra.js +58 -23
- package/build/matrices/linear-algebra.js.map +1 -1
- package/build/matrices/normalization.d.ts +8 -8
- package/build/matrices/transformations.d.ts +184 -168
- package/build/matrices/transformations.d.ts.map +1 -1
- package/build/matrices/transformations.js +99 -83
- package/build/matrices/transformations.js.map +1 -1
- package/build/matrices/types.d.ts +12 -12
- package/build/matrices/types.d.ts.map +1 -1
- package/build/quaternions/_exports.d.ts +11 -0
- package/build/quaternions/_exports.d.ts.map +1 -0
- package/build/quaternions/_exports.js +11 -0
- package/build/quaternions/_exports.js.map +1 -0
- package/build/quaternions/asserts.d.ts +115 -7
- package/build/quaternions/asserts.d.ts.map +1 -1
- package/build/quaternions/asserts.js +162 -8
- package/build/quaternions/asserts.js.map +1 -1
- package/build/quaternions/conversions.d.ts +31 -21
- package/build/quaternions/conversions.d.ts.map +1 -1
- package/build/quaternions/conversions.js +28 -18
- package/build/quaternions/conversions.js.map +1 -1
- package/build/quaternions/core.d.ts +73 -41
- package/build/quaternions/core.d.ts.map +1 -1
- package/build/quaternions/core.js +84 -49
- package/build/quaternions/core.js.map +1 -1
- package/build/quaternions/index.d.ts +3 -2
- package/build/quaternions/index.d.ts.map +1 -1
- package/build/quaternions/index.js +5 -2
- package/build/quaternions/index.js.map +1 -1
- package/build/quaternions/interpolation.d.ts +15 -9
- package/build/quaternions/interpolation.d.ts.map +1 -1
- package/build/quaternions/interpolation.js +15 -9
- package/build/quaternions/interpolation.js.map +1 -1
- package/build/quaternions/predefined.d.ts +9 -3
- package/build/quaternions/predefined.d.ts.map +1 -1
- package/build/quaternions/predefined.js +9 -3
- package/build/quaternions/predefined.js.map +1 -1
- package/build/quaternions/types.d.ts +3 -3
- package/build/random.d.ts +5 -2
- package/build/random.d.ts.map +1 -1
- package/build/random.js +20 -17
- package/build/random.js.map +1 -1
- package/build/vectors/_exports.d.ts +10 -0
- package/build/vectors/_exports.d.ts.map +1 -0
- package/build/vectors/_exports.js +10 -0
- package/build/vectors/_exports.js.map +1 -0
- package/build/vectors/asserts.d.ts +153 -49
- package/build/vectors/asserts.d.ts.map +1 -1
- package/build/vectors/asserts.js +202 -52
- package/build/vectors/asserts.js.map +1 -1
- package/build/vectors/core.d.ts +216 -137
- package/build/vectors/core.d.ts.map +1 -1
- package/build/vectors/core.js +217 -158
- package/build/vectors/core.js.map +1 -1
- package/build/vectors/index.d.ts +1 -0
- package/build/vectors/index.d.ts.map +1 -1
- package/build/vectors/index.js +3 -0
- package/build/vectors/index.js.map +1 -1
- package/build/vectors/interpolation.d.ts +39 -27
- package/build/vectors/interpolation.d.ts.map +1 -1
- package/build/vectors/interpolation.js +39 -27
- package/build/vectors/interpolation.js.map +1 -1
- package/build/vectors/predefined.d.ts +48 -24
- package/build/vectors/predefined.d.ts.map +1 -1
- package/build/vectors/predefined.js +38 -18
- package/build/vectors/predefined.js.map +1 -1
- package/package.json +12 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TMatrix } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Result of eigenvalue decomposition containing eigenvalues and their corresponding eigenvectors.
|
|
4
4
|
*
|
|
@@ -10,20 +10,23 @@ type TEigenDecompositionResult = {
|
|
|
10
10
|
/** Array of eigenvalues λ in descending order */
|
|
11
11
|
eigenvalues: number[];
|
|
12
12
|
/** Matrix where each column is an eigenvector corresponding to the eigenvalue at the same index */
|
|
13
|
-
eigenvectors:
|
|
13
|
+
eigenvectors: TMatrix;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* Result of LU decomposition where A = L × U.
|
|
16
|
+
* Result of LU decomposition with partial pivoting where P × A = L × U.
|
|
17
17
|
*
|
|
18
18
|
* LU decomposition factors a square matrix into the product of a lower triangular matrix L
|
|
19
|
-
* and an upper triangular matrix U
|
|
19
|
+
* and an upper triangular matrix U, with a permutation vector P recording the row swaps
|
|
20
|
+
* performed during partial pivoting. This is useful for solving systems of linear equations,
|
|
20
21
|
* computing determinants, and matrix inversion.
|
|
21
22
|
*/
|
|
22
23
|
type TLUDecompositionResult = {
|
|
23
24
|
/** Lower triangular matrix with 1's on the diagonal */
|
|
24
|
-
readonly L:
|
|
25
|
+
readonly L: TMatrix;
|
|
25
26
|
/** Upper triangular matrix containing the pivots */
|
|
26
|
-
readonly U:
|
|
27
|
+
readonly U: TMatrix;
|
|
28
|
+
/** Permutation vector: P[i] is the original row index that now occupies row i */
|
|
29
|
+
readonly P: number[];
|
|
27
30
|
};
|
|
28
31
|
/**
|
|
29
32
|
* Result of QR decomposition where A = Q × R.
|
|
@@ -34,9 +37,9 @@ type TLUDecompositionResult = {
|
|
|
34
37
|
*/
|
|
35
38
|
type TQRDecompositionResult = {
|
|
36
39
|
/** Orthogonal matrix where Q^T × Q = I */
|
|
37
|
-
readonly Q:
|
|
40
|
+
readonly Q: TMatrix;
|
|
38
41
|
/** Upper triangular matrix */
|
|
39
|
-
readonly R:
|
|
42
|
+
readonly R: TMatrix;
|
|
40
43
|
};
|
|
41
44
|
/**
|
|
42
45
|
* Result of Singular Value Decomposition (SVD) where A = U × Σ × V^T.
|
|
@@ -48,11 +51,11 @@ type TQRDecompositionResult = {
|
|
|
48
51
|
*/
|
|
49
52
|
type TSVDDecompositionResult = {
|
|
50
53
|
/** Matrix of left singular vectors (orthogonal columns) */
|
|
51
|
-
readonly U:
|
|
54
|
+
readonly U: TMatrix;
|
|
52
55
|
/** Array of singular values σ in descending order (diagonal elements of Σ matrix) */
|
|
53
56
|
readonly S: number[];
|
|
54
57
|
/** Transpose of the matrix of right singular vectors (V^T where V has orthogonal columns) */
|
|
55
|
-
readonly VT:
|
|
58
|
+
readonly VT: TMatrix;
|
|
56
59
|
};
|
|
57
60
|
/**
|
|
58
61
|
* Performs Cholesky decomposition for symmetric positive definite matrices A = L × L^T.
|
|
@@ -74,22 +77,22 @@ type TSVDDecompositionResult = {
|
|
|
74
77
|
* @throws {Error} If matrix is not square, not symmetric, or not positive definite
|
|
75
78
|
*
|
|
76
79
|
* @example
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
* ```typescript
|
|
81
|
+
* ```ts
|
|
82
|
+
* // Symmetric positive definite matrix
|
|
83
|
+
* const A = [[4, 2], [2, 3]];
|
|
84
|
+
* const L = MatrixCholesky(A);
|
|
85
|
+
* // L = [[2, 0], [1, √2]] ≈ [[2, 0], [1, 1.414]]
|
|
86
|
+
* // Verify: L × L^T should equal A
|
|
87
|
+
* const LT = MatrixTranspose(L);
|
|
88
|
+
* const reconstructed = MatrixMultiply(L, LT);
|
|
89
|
+
* // reconstructed ≈ [[4, 2], [2, 3]]
|
|
90
|
+
* ```
|
|
91
|
+
* @complexity Time: O(n³/3), Space: O(n²) - About 2x faster than general LU decomposition
|
|
92
|
+
* @see {@link MatrixLU} For general square matrices that may not be positive definite
|
|
93
|
+
* ```
|
|
91
94
|
*/
|
|
92
|
-
export declare function MatrixCholesky(matrix:
|
|
95
|
+
export declare function MatrixCholesky(matrix: TMatrix): TMatrix;
|
|
93
96
|
/**
|
|
94
97
|
* Performs eigenvalue decomposition for square matrices to find A × v = λ × v.
|
|
95
98
|
*
|
|
@@ -114,24 +117,24 @@ export declare function MatrixCholesky(matrix: IMatrix): IMatrix;
|
|
|
114
117
|
* @throws {Error} If matrix is not square, contains invalid values, or has complex eigenvalues
|
|
115
118
|
*
|
|
116
119
|
* @example
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
120
|
+
* ```typescript
|
|
121
|
+
* ```ts
|
|
122
|
+
* // Simple 2x2 matrix
|
|
123
|
+
* const A = [[3, 1], [0, 2]];
|
|
124
|
+
* const { eigenvalues, eigenvectors } = MatrixEigen(A);
|
|
125
|
+
* // eigenvalues: [3, 2]
|
|
126
|
+
* // eigenvectors: matrix where each column corresponds to an eigenvalue
|
|
127
|
+
* // Verify eigenvalue equation: A × v = λ × v
|
|
128
|
+
* const v = Matrix_GetColumn(eigenvectors, 0); // First eigenvector
|
|
129
|
+
* const Av = MatrixMultiplyVector(A, v);
|
|
130
|
+
* const lambdaV = Matrix_ScaleVector(v, eigenvalues[0]);
|
|
131
|
+
* // Av should approximately equal lambdaV
|
|
132
|
+
* ```
|
|
133
|
+
* @complexity O(n³) time for an n×n matrix
|
|
134
|
+
* @see {@link MatrixEigenQRIteration} For the iterative algorithm used for larger matrices
|
|
135
|
+
* ```
|
|
133
136
|
*/
|
|
134
|
-
export declare function MatrixEigen(matrix:
|
|
137
|
+
export declare function MatrixEigen(matrix: TMatrix): TEigenDecompositionResult;
|
|
135
138
|
/**
|
|
136
139
|
* Simplified QR iteration algorithm for eigenvalue computation of larger matrices.
|
|
137
140
|
*
|
|
@@ -155,51 +158,46 @@ export declare function MatrixEigen(matrix: IMatrix): TEigenDecompositionResult;
|
|
|
155
158
|
* @complexity O(n³) per iteration, typically converges in O(n) iterations
|
|
156
159
|
* @see {@link MatrixQR} For the QR decomposition used in each iteration
|
|
157
160
|
*/
|
|
158
|
-
export declare function MatrixEigenQRIteration(matrix:
|
|
161
|
+
export declare function MatrixEigenQRIteration(matrix: TMatrix, iterations?: number): TEigenDecompositionResult;
|
|
159
162
|
/**
|
|
160
|
-
* Performs LU decomposition of a square matrix A = L × U
|
|
163
|
+
* Performs LU decomposition of a square matrix with partial pivoting: P × A = L × U.
|
|
161
164
|
*
|
|
162
165
|
* LU decomposition factors a square matrix into the product of a lower triangular matrix L
|
|
163
|
-
* and an upper triangular matrix U
|
|
164
|
-
*
|
|
166
|
+
* and an upper triangular matrix U, with a permutation vector P recording the row swaps
|
|
167
|
+
* performed during partial (column) pivoting. Partial pivoting selects the largest-magnitude
|
|
168
|
+
* element in each column as the pivot, improving numerical stability.
|
|
165
169
|
*
|
|
166
170
|
* **Mathematical Background:**
|
|
167
171
|
* - L is lower triangular with 1's on the diagonal (unit lower triangular)
|
|
168
172
|
* - U is upper triangular containing the pivot elements
|
|
169
|
-
* -
|
|
170
|
-
* -
|
|
171
|
-
* implementation uses Doolittle's method without pivoting for simplicity
|
|
173
|
+
* - P is a permutation vector where P[i] is the original row index at position i
|
|
174
|
+
* - The relationship is: P × A = L × U
|
|
172
175
|
*
|
|
173
176
|
* **Applications:**
|
|
174
|
-
* - Solving linear systems: Ax = b
|
|
175
|
-
* - Computing determinant: det(A) =
|
|
176
|
-
* - Matrix inversion:
|
|
177
|
+
* - Solving linear systems: Ax = b — apply permutation, solve Ly = Pb, then Ux = y
|
|
178
|
+
* - Computing determinant: det(A) = ∏ᵢ U[i,i] (with sign from permutation parity)
|
|
179
|
+
* - Matrix inversion: used internally by `MatrixInverse` for n > 3
|
|
177
180
|
*
|
|
178
|
-
* @param matrix - Square matrix to decompose (must be non-singular
|
|
179
|
-
* @returns Object
|
|
180
|
-
* @throws {
|
|
181
|
-
*
|
|
182
|
-
* @note This implementation does not use partial pivoting (row swapping). It will fail for matrices with zero-valued or near-zero leading minors even if the matrix is otherwise invertible (e.g., [[0,1],[1,0]]). For general matrices, use MatrixInverse instead.
|
|
181
|
+
* @param matrix - Square matrix to decompose (must be non-singular)
|
|
182
|
+
* @returns Object `{ L, U, P }` — lower triangular, upper triangular, and permutation vector
|
|
183
|
+
* @throws {MatrixError} If matrix is not square, singular (zero pivot), or contains invalid values
|
|
183
184
|
*
|
|
184
185
|
* @example
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
*
|
|
199
|
-
* @complexity Time: O(n³/3), Space: O(n²)
|
|
200
|
-
* @see {@link MatrixCholesky} For symmetric positive definite matrices (more efficient)
|
|
186
|
+
* ```typescript
|
|
187
|
+
* ```ts
|
|
188
|
+
* const A = [[2, 1], [1, 1]];
|
|
189
|
+
* const { L, U, P } = MatrixLU(A);
|
|
190
|
+
* // L = [[1, 0], [0.5, 1]], U = [[2, 1], [0, 0.5]], P = [0, 1]
|
|
191
|
+
* // Verify: L × U should equal P-permuted A
|
|
192
|
+
* const product = MatrixMultiply(L, U);
|
|
193
|
+
* // product ≈ [[2, 1], [1, 1]]
|
|
194
|
+
* ```
|
|
195
|
+
* @complexity Time: O(n³/3), Space: O(n²)
|
|
196
|
+
* @see {@link MatrixCholesky} For symmetric positive definite matrices (more efficient)
|
|
197
|
+
* @see {@link MatrixSolve} For solving Ax = b directly
|
|
198
|
+
* ```
|
|
201
199
|
*/
|
|
202
|
-
export declare function MatrixLU(matrix:
|
|
200
|
+
export declare function MatrixLU(matrix: TMatrix): TLUDecompositionResult;
|
|
203
201
|
/**
|
|
204
202
|
* Performs QR decomposition A = Q × R using Modified Gram-Schmidt orthogonalization.
|
|
205
203
|
*
|
|
@@ -224,25 +222,24 @@ export declare function MatrixLU(matrix: IMatrix): TLUDecompositionResult;
|
|
|
224
222
|
* @throws {Error} If matrix has more columns than rows or columns are linearly dependent
|
|
225
223
|
*
|
|
226
224
|
* @example
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
* @see {@link MatrixGramSchmidt} {@link MatrixLU} {@link MatrixEigenQRIteration}
|
|
225
|
+
* ```typescript
|
|
226
|
+
* ```ts
|
|
227
|
+
* const A = [[1, 1], [1, 0], [0, 1]]; // 3×2 matrix
|
|
228
|
+
* const { Q, R } = MatrixQR(A);
|
|
229
|
+
* // Q: 3×2 orthogonal matrix with Q^T × Q = I₂
|
|
230
|
+
* // R: 2×2 upper triangular matrix
|
|
231
|
+
* // Verify: Q × R should equal A
|
|
232
|
+
* const reconstructed = MatrixMultiply(Q, R);
|
|
233
|
+
* // reconstructed ≈ A
|
|
234
|
+
* // Check orthogonality: Q^T × Q should be identity
|
|
235
|
+
* const QT = MatrixTranspose(Q);
|
|
236
|
+
* const identity = MatrixMultiply(QT, Q);
|
|
237
|
+
* ```
|
|
238
|
+
* @complexity Time: O(mn²), Space: O(mn) where m ≥ n
|
|
239
|
+
* @see {@link MatrixGramSchmidt} {@link MatrixLU} {@link MatrixEigenQRIteration}
|
|
240
|
+
* ```
|
|
244
241
|
*/
|
|
245
|
-
export declare function MatrixQR(matrix:
|
|
242
|
+
export declare function MatrixQR(matrix: TMatrix, allowDependentColumns?: boolean): TQRDecompositionResult;
|
|
246
243
|
/**
|
|
247
244
|
* Performs Singular Value Decomposition (SVD) of a matrix A = U × Σ × V^T.
|
|
248
245
|
*
|
|
@@ -276,31 +273,30 @@ export declare function MatrixQR(matrix: IMatrix, allowDependentColumns?: boolea
|
|
|
276
273
|
* @throws {Error} If matrix contains invalid values (NaN, Infinity)
|
|
277
274
|
*
|
|
278
275
|
* @example
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
* @complexity Time: O(min(m²n, mn²)), Space: O(m² + n²)
|
|
298
|
-
* @see {@link MatrixQR} {@link MatrixEigenQRIteration} {@link Matrix_PseudoInverse}
|
|
276
|
+
* ```typescript
|
|
277
|
+
* ```ts
|
|
278
|
+
* const A = [[1, 2], [3, 4], [5, 6]]; // 3×2 matrix
|
|
279
|
+
* const { U, S, VT } = MatrixSVD(A);
|
|
280
|
+
* // U: 3×2 matrix with orthonormal columns
|
|
281
|
+
* // S: [σ₁, σ₂] singular values in descending order
|
|
282
|
+
* // VT: 2×2 orthogonal matrix (V transposed)
|
|
283
|
+
* // Verify reconstruction: U × diag(S) × VT ≈ A
|
|
284
|
+
* const Sigma = Matrix_Diagonal(S);
|
|
285
|
+
* const reconstructed = MatrixMultiply(MatrixMultiply(U, Sigma), VT);
|
|
286
|
+
* // Matrix rank from singular values (count non-zero values)
|
|
287
|
+
* const rank = S.filter(s => s > 1e-10).length;
|
|
288
|
+
* // Condition number for stability analysis
|
|
289
|
+
* const conditionNumber = S[0] / S[S.length - 1];
|
|
290
|
+
* ```
|
|
291
|
+
* @complexity Time: O(min(m²n, mn²)), Space: O(m² + n²)
|
|
292
|
+
* @see {@link MatrixQR} {@link MatrixEigenQRIteration} {@link Matrix_PseudoInverse}
|
|
293
|
+
* ```
|
|
299
294
|
*/
|
|
300
|
-
export declare function MatrixSVD(matrix:
|
|
295
|
+
export declare function MatrixSVD(matrix: TMatrix): TSVDDecompositionResult;
|
|
301
296
|
/**
|
|
302
297
|
* Solves the linear system Ax = b for the unknown vector x.
|
|
303
|
-
* Uses LU decomposition internally
|
|
298
|
+
* Uses LU decomposition with partial pivoting internally: decomposes A into P, L, U,
|
|
299
|
+
* applies the row permutation to b, then performs forward and back substitution.
|
|
304
300
|
*
|
|
305
301
|
* Given an n×n coefficient matrix A and an n-element right-hand side vector b,
|
|
306
302
|
* finds x such that A × x = b.
|
|
@@ -311,16 +307,17 @@ export declare function MatrixSVD(matrix: IMatrix): TSVDDecompositionResult;
|
|
|
311
307
|
* @throws {MatrixError} If A is not square, singular, or b has the wrong length
|
|
312
308
|
*
|
|
313
309
|
* @example
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
310
|
+
* ```typescript
|
|
311
|
+
* // 2x + y = 8
|
|
312
|
+
* // 5x + 3y = 20
|
|
313
|
+
* MatrixSolve([[2, 1], [5, 3]], [8, 20]); // [4, 0]
|
|
314
|
+
* @example
|
|
315
|
+
* // Solve a 3×3 system
|
|
316
|
+
* const A = [[1, 2, -1], [2, 1, 1], [3, -1, 2]];
|
|
317
|
+
* const b = [4, 7, 2];
|
|
318
|
+
* MatrixSolve(A, b); // solution vector x
|
|
319
|
+
* ```
|
|
323
320
|
*/
|
|
324
|
-
export declare function MatrixSolve(a:
|
|
321
|
+
export declare function MatrixSolve(a: TMatrix, b: number[]): number[];
|
|
325
322
|
export {};
|
|
326
323
|
//# sourceMappingURL=decompositions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decompositions.d.ts","sourceRoot":"","sources":["../../src/matrices/decompositions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC;;;;;;GAMG;AACH,KAAK,yBAAyB,GAAG;IAChC,iDAAiD;IACjD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mGAAmG;IACnG,YAAY,EAAE,OAAO,CAAC;CACtB,CAAC;AACF
|
|
1
|
+
{"version":3,"file":"decompositions.d.ts","sourceRoot":"","sources":["../../src/matrices/decompositions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC;;;;;;GAMG;AACH,KAAK,yBAAyB,GAAG;IAChC,iDAAiD;IACjD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mGAAmG;IACnG,YAAY,EAAE,OAAO,CAAC;CACtB,CAAC;AACF;;;;;;;GAOG;AACH,KAAK,sBAAsB,GAAG;IAC7B,uDAAuD;IAEvD,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,oDAAoD;IAEpD,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,iFAAiF;IAEjF,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AACF;;;;;;GAMG;AACH,KAAK,sBAAsB,GAAG;IAC7B,0CAA0C;IAE1C,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,8BAA8B;IAE9B,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF;;;;;;;GAOG;AACH,KAAK,uBAAuB,GAAG;IAC9B,2DAA2D;IAE3D,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,qFAAqF;IAErF,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,6FAA6F;IAE7F,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAoEvD;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,yBAAyB,CAoHtE;AACD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,GAAE,MAAW,GAAG,yBAAyB,CA+D1G;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB,CA2EhE;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,qBAAqB,UAAQ,GAAG,sBAAsB,CAiI/F;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,uBAAuB,CA2FlE;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA2D7D"}
|