@pawells/math-extended 1.1.1 → 3.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 +15 -21
- package/build/angles.d.ts +28 -18
- package/build/angles.d.ts.map +1 -1
- package/build/angles.js +28 -18
- package/build/angles.js.map +1 -1
- package/build/clamp.d.ts +2 -0
- package/build/clamp.d.ts.map +1 -1
- package/build/clamp.js +2 -0
- package/build/clamp.js.map +1 -1
- package/build/core.d.ts +23 -0
- package/build/core.d.ts.map +1 -0
- package/build/core.js +25 -0
- package/build/core.js.map +1 -0
- package/build/index.d.ts +1 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -6
- package/build/index.js.map +1 -1
- package/build/interpolation.d.ts +62 -13
- package/build/interpolation.d.ts.map +1 -1
- package/build/interpolation.js +66 -23
- package/build/interpolation.js.map +1 -1
- package/build/matrices/arithmetic.d.ts +65 -76
- package/build/matrices/arithmetic.d.ts.map +1 -1
- package/build/matrices/arithmetic.js +65 -107
- package/build/matrices/arithmetic.js.map +1 -1
- package/build/matrices/asserts.d.ts +26 -273
- package/build/matrices/asserts.d.ts.map +1 -1
- package/build/matrices/asserts.js +106 -350
- package/build/matrices/asserts.js.map +1 -1
- package/build/matrices/core.d.ts +150 -79
- package/build/matrices/core.d.ts.map +1 -1
- package/build/matrices/core.js +128 -104
- package/build/matrices/core.js.map +1 -1
- package/build/matrices/decompositions.d.ts +41 -44
- package/build/matrices/decompositions.d.ts.map +1 -1
- package/build/matrices/decompositions.js +51 -94
- package/build/matrices/decompositions.js.map +1 -1
- package/build/matrices/index.d.ts +2 -2
- package/build/matrices/index.d.ts.map +1 -1
- package/build/matrices/index.js +2 -2
- package/build/matrices/index.js.map +1 -1
- package/build/matrices/linear-algebra.d.ts +56 -19
- package/build/matrices/linear-algebra.d.ts.map +1 -1
- package/build/matrices/linear-algebra.js +80 -36
- package/build/matrices/linear-algebra.js.map +1 -1
- package/build/matrices/normalization.d.ts +36 -15
- package/build/matrices/normalization.d.ts.map +1 -1
- package/build/matrices/normalization.js +32 -23
- package/build/matrices/normalization.js.map +1 -1
- package/build/matrices/transformations.d.ts +39 -52
- package/build/matrices/transformations.d.ts.map +1 -1
- package/build/matrices/transformations.js +8 -11
- package/build/matrices/transformations.js.map +1 -1
- package/build/matrices/types.d.ts +39 -67
- package/build/matrices/types.d.ts.map +1 -1
- package/build/matrices/types.js +63 -1
- package/build/matrices/types.js.map +1 -1
- package/build/quaternions/asserts.d.ts +114 -15
- package/build/quaternions/asserts.d.ts.map +1 -1
- package/build/quaternions/asserts.js +189 -51
- package/build/quaternions/asserts.js.map +1 -1
- package/build/quaternions/conversions.d.ts +18 -8
- package/build/quaternions/conversions.d.ts.map +1 -1
- package/build/quaternions/conversions.js +14 -4
- package/build/quaternions/conversions.js.map +1 -1
- package/build/quaternions/core.d.ts +31 -2
- package/build/quaternions/core.d.ts.map +1 -1
- package/build/quaternions/core.js +32 -4
- package/build/quaternions/core.js.map +1 -1
- package/build/quaternions/index.d.ts +2 -2
- package/build/quaternions/index.d.ts.map +1 -1
- package/build/quaternions/index.js +3 -2
- package/build/quaternions/index.js.map +1 -1
- package/build/quaternions/interpolation.d.ts +7 -1
- package/build/quaternions/interpolation.d.ts.map +1 -1
- package/build/quaternions/interpolation.js +12 -6
- package/build/quaternions/interpolation.js.map +1 -1
- package/build/quaternions/predefined.d.ts +7 -1
- package/build/quaternions/predefined.d.ts.map +1 -1
- package/build/quaternions/predefined.js +6 -0
- package/build/quaternions/predefined.js.map +1 -1
- package/build/quaternions/types.d.ts +24 -13
- package/build/quaternions/types.d.ts.map +1 -1
- package/build/quaternions/types.js +51 -1
- package/build/quaternions/types.js.map +1 -1
- package/build/random.d.ts +66 -20
- package/build/random.d.ts.map +1 -1
- package/build/random.js +73 -20
- package/build/random.js.map +1 -1
- package/build/vectors/asserts.d.ts +33 -99
- package/build/vectors/asserts.d.ts.map +1 -1
- package/build/vectors/asserts.js +145 -181
- package/build/vectors/asserts.js.map +1 -1
- package/build/vectors/core.d.ts +76 -44
- package/build/vectors/core.d.ts.map +1 -1
- package/build/vectors/core.js +128 -119
- package/build/vectors/core.js.map +1 -1
- package/build/vectors/index.d.ts.map +1 -1
- package/build/vectors/index.js +1 -0
- package/build/vectors/index.js.map +1 -1
- package/build/vectors/interpolation.d.ts +13 -1
- package/build/vectors/interpolation.d.ts.map +1 -1
- package/build/vectors/interpolation.js +48 -47
- package/build/vectors/interpolation.js.map +1 -1
- package/build/vectors/predefined.d.ts +73 -25
- package/build/vectors/predefined.d.ts.map +1 -1
- package/build/vectors/predefined.js +62 -18
- package/build/vectors/predefined.js.map +1 -1
- package/build/vectors/types.d.ts +26 -4
- package/build/vectors/types.d.ts.map +1 -1
- package/build/vectors/types.js +50 -1
- package/build/vectors/types.js.map +1 -1
- package/package.json +4 -3
package/build/matrices/core.d.ts
CHANGED
|
@@ -1,76 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function MatrixCreate():
|
|
3
|
-
export declare function MatrixCreate(size: 1):
|
|
4
|
-
export declare function MatrixCreate(size: 2):
|
|
5
|
-
export declare function MatrixCreate(size: 3):
|
|
6
|
-
export declare function MatrixCreate(size: 4):
|
|
7
|
-
export declare function MatrixCreate(size: number):
|
|
8
|
-
export declare function MatrixCreate(rows: number, cols: number):
|
|
1
|
+
import type { TMatrix, TMatrix1, TMatrix2, TMatrix3, TMatrix4, TMatrixResult } from './types.js';
|
|
2
|
+
export declare function MatrixCreate(): TMatrix1;
|
|
3
|
+
export declare function MatrixCreate(size: 1): TMatrix1;
|
|
4
|
+
export declare function MatrixCreate(size: 2): TMatrix2;
|
|
5
|
+
export declare function MatrixCreate(size: 3): TMatrix3;
|
|
6
|
+
export declare function MatrixCreate(size: 4): TMatrix4;
|
|
7
|
+
export declare function MatrixCreate(size: number): TMatrix;
|
|
8
|
+
export declare function MatrixCreate(rows: number, cols: number): TMatrix;
|
|
9
9
|
/**
|
|
10
10
|
* Returns the dimensions of a matrix as [rows, columns].
|
|
11
11
|
* @param matrix - The matrix to measure
|
|
12
12
|
* @returns {[number, number]} Tuple [rows, columns]. Returns [0, 0] for empty matrices.
|
|
13
13
|
* @throws {Error} If the input is not a valid matrix
|
|
14
|
-
* @example
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* MatrixSize([[1, 2, 3], [4, 5, 6]]) // [2, 3]
|
|
17
|
+
* ```
|
|
15
18
|
*/
|
|
16
|
-
export declare function MatrixSize(matrix:
|
|
19
|
+
export declare function MatrixSize(matrix: TMatrix): [number, number];
|
|
17
20
|
/**
|
|
18
21
|
* Returns the size of a square matrix (number of rows/columns).
|
|
19
22
|
* @param matrix - The square matrix to measure
|
|
20
23
|
* @returns {number} The size (n for an n×n matrix)
|
|
21
24
|
* @throws {Error} If the matrix is not square
|
|
22
|
-
* @example
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* MatrixSizeSquare([[1, 2], [3, 4]]) // 2
|
|
28
|
+
* ```
|
|
23
29
|
*/
|
|
24
|
-
export declare function MatrixSizeSquare(matrix:
|
|
25
|
-
/**
|
|
26
|
-
* Validates that the input is a well-formed matrix.
|
|
27
|
-
* @param matrix - The value to validate as a matrix
|
|
28
|
-
* @returns {boolean} True if the input is a valid matrix, false otherwise
|
|
29
|
-
* @example MatrixIsValid([[1, 2], [3, 4]]) // true
|
|
30
|
-
* @example MatrixIsValid([[1, 'invalid'], [3, 4]]) // false
|
|
31
|
-
*/
|
|
32
|
-
export declare function MatrixIsValid(matrix: unknown): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Checks if a matrix is square (equal number of rows and columns).
|
|
35
|
-
* @param matrix - The matrix to check
|
|
36
|
-
* @returns {boolean} True if the matrix is square, false otherwise
|
|
37
|
-
* @example MatrixIsSquare([[1, 2], [3, 4]]) // true (2×2)
|
|
38
|
-
* @example MatrixIsSquare([[1, 2, 3], [4, 5, 6]]) // false (3×2)
|
|
39
|
-
*/
|
|
40
|
-
export declare function MatrixIsSquare(matrix: IMatrix): boolean;
|
|
30
|
+
export declare function MatrixSizeSquare(matrix: TMatrix): number;
|
|
41
31
|
/**
|
|
42
32
|
* Checks if a matrix is a zero matrix (all elements are zero within tolerance).
|
|
43
33
|
* @param matrix - The matrix to check
|
|
44
34
|
* @param threshold - Tolerance for considering values as zero (default: 1e-14)
|
|
45
35
|
* @returns {boolean} True if all matrix elements are within threshold of zero
|
|
46
36
|
* @throws {Error} If the input is not a valid matrix
|
|
47
|
-
* @example
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* MatrixIsZero([[0, 0], [0, 0]]) // true
|
|
40
|
+
* ```
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* MatrixIsZero([[1e-15, 0], [0, 0]]) // true (within default threshold)
|
|
44
|
+
* ```
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* MatrixIsZero([[0.1, 0], [0, 0]]) // false
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function MatrixIsZero(matrix: TMatrix, threshold?: number): boolean;
|
|
52
51
|
/**
|
|
53
52
|
* Checks if a matrix is an identity matrix (1s on the main diagonal, 0s elsewhere).
|
|
54
53
|
* @param matrix - The matrix to check
|
|
55
54
|
* @param threshold - Tolerance for floating-point comparisons (default: 1e-14)
|
|
56
55
|
* @returns {boolean} True if the matrix is an identity matrix within tolerance
|
|
57
56
|
* @throws {Error} If the input is not a valid matrix
|
|
58
|
-
* @example
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* MatrixIsIdentity([[1, 0], [0, 1]]) // true
|
|
60
|
+
* ```
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* MatrixIsIdentity([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) // true
|
|
64
|
+
* ```
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* MatrixIsIdentity([[1, 1], [0, 1]]) // false
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function MatrixIsIdentity(matrix: TMatrix, threshold?: number): boolean;
|
|
63
71
|
/**
|
|
64
72
|
* Checks if a matrix is symmetric (A = Aᵀ, i.e. A[i][j] === A[j][i] for all i, j).
|
|
65
73
|
* @param matrix - The matrix to check (must be square)
|
|
66
74
|
* @param threshold - Tolerance for floating-point comparisons (default: 1e-14)
|
|
67
75
|
* @returns {boolean} True if the matrix is symmetric within tolerance
|
|
68
76
|
* @throws {Error} If the input is not a valid matrix
|
|
69
|
-
* @example
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* MatrixIsSymmetric([[1, 2], [2, 1]]) // true
|
|
80
|
+
* ```
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* MatrixIsSymmetric([[1, 2], [3, 4]]) // false
|
|
84
|
+
* ```
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* MatrixIsSymmetric([[1, 2, 3], [2, 5, 4], [3, 4, 6]]) // true
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function MatrixIsSymmetric(matrix: TMatrix, threshold?: number): boolean;
|
|
74
91
|
/**
|
|
75
92
|
* Checks if a matrix is diagonal (all off-diagonal elements are zero within tolerance).
|
|
76
93
|
* A diagonal matrix has non-zero values only on its main diagonal.
|
|
@@ -78,33 +95,51 @@ export declare function MatrixIsSymmetric(matrix: IMatrix, threshold?: number):
|
|
|
78
95
|
* @param threshold - Tolerance for considering values as zero (default: 1e-14)
|
|
79
96
|
* @returns {boolean} True if the matrix is diagonal within tolerance
|
|
80
97
|
* @throws {Error} If the input is not a valid matrix
|
|
81
|
-
* @example
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* MatrixIsDiagonal([[3, 0], [0, 7]]) // true
|
|
101
|
+
* ```
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* MatrixIsDiagonal([[1, 0, 0], [0, 5, 0], [0, 0, 2]]) // true
|
|
105
|
+
* ```
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* MatrixIsDiagonal([[1, 2], [0, 1]]) // false
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function MatrixIsDiagonal(matrix: TMatrix, threshold?: number): boolean;
|
|
86
112
|
/**
|
|
87
113
|
* Creates an identity matrix of the specified size.
|
|
88
114
|
* @param size - The dimensions of the square identity matrix (must be non-negative integer)
|
|
89
|
-
* @returns {
|
|
115
|
+
* @returns {TMatrix} A square identity matrix of size n×n
|
|
90
116
|
* @throws {Error} If size is negative or not an integer
|
|
91
|
-
* @example
|
|
92
|
-
*
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* MatrixIdentity(2) // [[1, 0], [0, 1]]
|
|
120
|
+
* ```
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* MatrixIdentity(3) // [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function MatrixIdentity(size: 0): TMatrix;
|
|
127
|
+
export declare function MatrixIdentity(size: 1): TMatrix1;
|
|
128
|
+
export declare function MatrixIdentity(size: 2): TMatrix2;
|
|
129
|
+
export declare function MatrixIdentity(size: 3): TMatrix3;
|
|
130
|
+
export declare function MatrixIdentity(size: 4): TMatrix4;
|
|
131
|
+
export declare function MatrixIdentity(size: number): TMatrix;
|
|
100
132
|
/**
|
|
101
133
|
* Creates a deep copy of the given matrix.
|
|
102
134
|
* @param matrix - The matrix to clone
|
|
103
135
|
* @returns {TMatrixResult<T>} A new matrix with identical values but independent memory allocation
|
|
104
136
|
* @throws {Error} If the input is not a valid matrix
|
|
105
|
-
* @example
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* MatrixClone([[1, 2], [3, 4]]) // [[1, 2], [3, 4]] (independent copy)
|
|
140
|
+
* ```
|
|
106
141
|
*/
|
|
107
|
-
export declare function MatrixClone<T extends
|
|
142
|
+
export declare function MatrixClone<T extends TMatrix>(matrix: T): TMatrixResult<T>;
|
|
108
143
|
/**
|
|
109
144
|
* Checks if two matrices are equal within a specified tolerance.
|
|
110
145
|
* @param a - First matrix to compare
|
|
@@ -112,56 +147,92 @@ export declare function MatrixClone<T extends IMatrix>(matrix: T): TMatrixResult
|
|
|
112
147
|
* @param tolerance - Maximum allowed difference between corresponding elements (default: 1e-8)
|
|
113
148
|
* @returns {boolean} True if matrices are equal within tolerance, false otherwise
|
|
114
149
|
* @throws {Error} If either input is not a valid matrix or if matrix data is corrupted
|
|
115
|
-
* @example
|
|
116
|
-
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* MatrixEquals([[1, 2]], [[1.0001, 2]], 0.001) // true
|
|
153
|
+
* ```
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* MatrixEquals([[1, 2]], [[1, 3]]) // false
|
|
157
|
+
* ```
|
|
117
158
|
*/
|
|
118
|
-
export declare function MatrixEquals(a:
|
|
159
|
+
export declare function MatrixEquals(a: TMatrix, b: TMatrix, tolerance?: number): boolean;
|
|
119
160
|
/**
|
|
120
161
|
* Converts a matrix to a formatted string representation.
|
|
121
162
|
* @param matrix - The matrix to convert to string
|
|
122
163
|
* @param precision - Number of decimal places for formatting (default: 2)
|
|
123
164
|
* @returns {string} A formatted string representation of the matrix
|
|
124
165
|
* @throws {Error} If the input is not a valid matrix
|
|
125
|
-
* @example
|
|
126
|
-
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* MatrixToString([[1.23, 2.7]]) // "[ 1.23, 2.70 ]"
|
|
169
|
+
* ```
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* MatrixToString([[1, 2], [3, 4]], 0) // "[ 1, 2 ]\n[ 3, 4 ]"
|
|
173
|
+
* ```
|
|
127
174
|
*/
|
|
128
|
-
export declare function MatrixToString(matrix:
|
|
175
|
+
export declare function MatrixToString(matrix: TMatrix, precision?: number): string;
|
|
129
176
|
/**
|
|
130
177
|
* Computes the rank of a matrix using Gaussian elimination.
|
|
131
178
|
* @param matrix - The input matrix (any dimensions)
|
|
132
179
|
* @param tolerance - Numerical tolerance for zero detection (default: 1e-10)
|
|
133
180
|
* @returns {number} The rank of the matrix (0 ≤ rank ≤ min(rows, columns))
|
|
134
181
|
* @throws {Error} If the matrix contains invalid values
|
|
135
|
-
* @example
|
|
136
|
-
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* MatrixRank([[1, 2], [2, 4]]) // 1 (second row = 2 × first row)
|
|
185
|
+
* ```
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* MatrixRank([[1, 0], [0, 1]]) // 2 (full rank)
|
|
189
|
+
* ```
|
|
137
190
|
*/
|
|
138
|
-
export declare function MatrixRank(matrix:
|
|
191
|
+
export declare function MatrixRank(matrix: TMatrix, tolerance?: number): number;
|
|
139
192
|
/**
|
|
140
193
|
* Computes the trace of a matrix (sum of main diagonal elements).
|
|
141
194
|
* @param matrix - The input matrix (can be square or rectangular)
|
|
142
195
|
* @returns {number} The trace value (sum of diagonal elements)
|
|
143
196
|
* @throws {Error} If the matrix contains invalid values
|
|
144
|
-
* @example
|
|
145
|
-
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* MatrixTrace([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) // 15 (1 + 5 + 9)
|
|
200
|
+
* ```
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* MatrixTrace([[1, 2], [3, 4], [5, 6]]) // 5 (1 + 4, rectangular matrix)
|
|
204
|
+
* ```
|
|
146
205
|
*/
|
|
147
|
-
export declare function MatrixTrace(matrix:
|
|
206
|
+
export declare function MatrixTrace(matrix: TMatrix): number;
|
|
148
207
|
/**
|
|
149
208
|
* Returns the transpose of a matrix (rows become columns and vice versa).
|
|
150
209
|
* @param matrix - The matrix to transpose (can be any m×n matrix)
|
|
151
210
|
* @returns {TMatrixResult<T>} The transposed matrix with dimensions n×m
|
|
152
211
|
* @throws {Error} If the input is not a valid matrix
|
|
153
|
-
* @example
|
|
154
|
-
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* MatrixTranspose([[1, 2, 3], [4, 5, 6]]) // [[1, 4], [2, 5], [3, 6]]
|
|
215
|
+
* ```
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* MatrixTranspose([[1, 2], [3, 4]]) // [[1, 3], [2, 4]]
|
|
219
|
+
* ```
|
|
155
220
|
*/
|
|
156
|
-
export declare function MatrixTranspose<T extends
|
|
221
|
+
export declare function MatrixTranspose<T extends TMatrix>(matrix: T): TMatrixResult<T>;
|
|
157
222
|
/**
|
|
158
223
|
* Applies a transformation function to each element of the matrix.
|
|
159
224
|
* @param matrix - The input matrix to transform
|
|
160
225
|
* @param fn - Transformation function: (value, row, col) => transformedValue
|
|
161
226
|
* @returns {TMatrixResult<T>} A new matrix with transformed values (same dimensions as input)
|
|
162
227
|
* @throws {Error} If the input matrix is invalid or transformation function throws
|
|
163
|
-
* @example
|
|
164
|
-
*
|
|
165
|
-
|
|
166
|
-
|
|
228
|
+
* @example
|
|
229
|
+
* ```typescript
|
|
230
|
+
* MatrixMap([[1, 2], [3, 4]], (value) => value * value) // [[1, 4], [9, 16]]
|
|
231
|
+
* ```
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* MatrixMap([[1, 2], [3, 4]], (value, row, col) => value + row + col) // [[1, 3], [4, 6]]
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
export declare function MatrixMap<T extends TMatrix>(matrix: T, fn: (value: number, row: number, col: number) => number): TMatrixResult<T>;
|
|
167
238
|
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/matrices/core.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/matrices/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIjG,wBAAgB,YAAY,IAAI,QAAQ,CAAC;AAEzC,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC;AAEhD,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC;AAEhD,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC;AAEhD,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC;AAEhD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;AAEpD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;AAqElE;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,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