@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.
Files changed (113) hide show
  1. package/README.md +15 -21
  2. package/build/angles.d.ts +28 -18
  3. package/build/angles.d.ts.map +1 -1
  4. package/build/angles.js +28 -18
  5. package/build/angles.js.map +1 -1
  6. package/build/clamp.d.ts +2 -0
  7. package/build/clamp.d.ts.map +1 -1
  8. package/build/clamp.js +2 -0
  9. package/build/clamp.js.map +1 -1
  10. package/build/core.d.ts +23 -0
  11. package/build/core.d.ts.map +1 -0
  12. package/build/core.js +25 -0
  13. package/build/core.js.map +1 -0
  14. package/build/index.d.ts +1 -4
  15. package/build/index.d.ts.map +1 -1
  16. package/build/index.js +1 -6
  17. package/build/index.js.map +1 -1
  18. package/build/interpolation.d.ts +62 -13
  19. package/build/interpolation.d.ts.map +1 -1
  20. package/build/interpolation.js +66 -23
  21. package/build/interpolation.js.map +1 -1
  22. package/build/matrices/arithmetic.d.ts +65 -76
  23. package/build/matrices/arithmetic.d.ts.map +1 -1
  24. package/build/matrices/arithmetic.js +65 -107
  25. package/build/matrices/arithmetic.js.map +1 -1
  26. package/build/matrices/asserts.d.ts +26 -273
  27. package/build/matrices/asserts.d.ts.map +1 -1
  28. package/build/matrices/asserts.js +106 -350
  29. package/build/matrices/asserts.js.map +1 -1
  30. package/build/matrices/core.d.ts +150 -79
  31. package/build/matrices/core.d.ts.map +1 -1
  32. package/build/matrices/core.js +128 -104
  33. package/build/matrices/core.js.map +1 -1
  34. package/build/matrices/decompositions.d.ts +41 -44
  35. package/build/matrices/decompositions.d.ts.map +1 -1
  36. package/build/matrices/decompositions.js +51 -94
  37. package/build/matrices/decompositions.js.map +1 -1
  38. package/build/matrices/index.d.ts +2 -2
  39. package/build/matrices/index.d.ts.map +1 -1
  40. package/build/matrices/index.js +2 -2
  41. package/build/matrices/index.js.map +1 -1
  42. package/build/matrices/linear-algebra.d.ts +56 -19
  43. package/build/matrices/linear-algebra.d.ts.map +1 -1
  44. package/build/matrices/linear-algebra.js +80 -36
  45. package/build/matrices/linear-algebra.js.map +1 -1
  46. package/build/matrices/normalization.d.ts +36 -15
  47. package/build/matrices/normalization.d.ts.map +1 -1
  48. package/build/matrices/normalization.js +32 -23
  49. package/build/matrices/normalization.js.map +1 -1
  50. package/build/matrices/transformations.d.ts +39 -52
  51. package/build/matrices/transformations.d.ts.map +1 -1
  52. package/build/matrices/transformations.js +8 -11
  53. package/build/matrices/transformations.js.map +1 -1
  54. package/build/matrices/types.d.ts +39 -67
  55. package/build/matrices/types.d.ts.map +1 -1
  56. package/build/matrices/types.js +63 -1
  57. package/build/matrices/types.js.map +1 -1
  58. package/build/quaternions/asserts.d.ts +114 -15
  59. package/build/quaternions/asserts.d.ts.map +1 -1
  60. package/build/quaternions/asserts.js +189 -51
  61. package/build/quaternions/asserts.js.map +1 -1
  62. package/build/quaternions/conversions.d.ts +18 -8
  63. package/build/quaternions/conversions.d.ts.map +1 -1
  64. package/build/quaternions/conversions.js +14 -4
  65. package/build/quaternions/conversions.js.map +1 -1
  66. package/build/quaternions/core.d.ts +31 -2
  67. package/build/quaternions/core.d.ts.map +1 -1
  68. package/build/quaternions/core.js +32 -4
  69. package/build/quaternions/core.js.map +1 -1
  70. package/build/quaternions/index.d.ts +2 -2
  71. package/build/quaternions/index.d.ts.map +1 -1
  72. package/build/quaternions/index.js +3 -2
  73. package/build/quaternions/index.js.map +1 -1
  74. package/build/quaternions/interpolation.d.ts +7 -1
  75. package/build/quaternions/interpolation.d.ts.map +1 -1
  76. package/build/quaternions/interpolation.js +12 -6
  77. package/build/quaternions/interpolation.js.map +1 -1
  78. package/build/quaternions/predefined.d.ts +7 -1
  79. package/build/quaternions/predefined.d.ts.map +1 -1
  80. package/build/quaternions/predefined.js +6 -0
  81. package/build/quaternions/predefined.js.map +1 -1
  82. package/build/quaternions/types.d.ts +24 -13
  83. package/build/quaternions/types.d.ts.map +1 -1
  84. package/build/quaternions/types.js +51 -1
  85. package/build/quaternions/types.js.map +1 -1
  86. package/build/random.d.ts +66 -20
  87. package/build/random.d.ts.map +1 -1
  88. package/build/random.js +73 -20
  89. package/build/random.js.map +1 -1
  90. package/build/vectors/asserts.d.ts +33 -99
  91. package/build/vectors/asserts.d.ts.map +1 -1
  92. package/build/vectors/asserts.js +145 -181
  93. package/build/vectors/asserts.js.map +1 -1
  94. package/build/vectors/core.d.ts +76 -44
  95. package/build/vectors/core.d.ts.map +1 -1
  96. package/build/vectors/core.js +128 -119
  97. package/build/vectors/core.js.map +1 -1
  98. package/build/vectors/index.d.ts.map +1 -1
  99. package/build/vectors/index.js +1 -0
  100. package/build/vectors/index.js.map +1 -1
  101. package/build/vectors/interpolation.d.ts +13 -1
  102. package/build/vectors/interpolation.d.ts.map +1 -1
  103. package/build/vectors/interpolation.js +48 -47
  104. package/build/vectors/interpolation.js.map +1 -1
  105. package/build/vectors/predefined.d.ts +73 -25
  106. package/build/vectors/predefined.d.ts.map +1 -1
  107. package/build/vectors/predefined.js +62 -18
  108. package/build/vectors/predefined.js.map +1 -1
  109. package/build/vectors/types.d.ts +26 -4
  110. package/build/vectors/types.d.ts.map +1 -1
  111. package/build/vectors/types.js +50 -1
  112. package/build/vectors/types.js.map +1 -1
  113. package/package.json +4 -3
@@ -1,76 +1,93 @@
1
- import { IMatrix, IMatrix1, IMatrix2, IMatrix3, IMatrix4, TMatrixResult } from './types.js';
2
- export declare function MatrixCreate(): IMatrix1;
3
- export declare function MatrixCreate(size: 1): IMatrix1;
4
- export declare function MatrixCreate(size: 2): IMatrix2;
5
- export declare function MatrixCreate(size: 3): IMatrix3;
6
- export declare function MatrixCreate(size: 4): IMatrix4;
7
- export declare function MatrixCreate(size: number): IMatrix;
8
- export declare function MatrixCreate(rows: number, cols: number): IMatrix;
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 MatrixSize([[1, 2, 3], [4, 5, 6]]) // [2, 3]
14
+ * @example
15
+ * ```typescript
16
+ * MatrixSize([[1, 2, 3], [4, 5, 6]]) // [2, 3]
17
+ * ```
15
18
  */
16
- export declare function MatrixSize(matrix: IMatrix): [number, number];
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 MatrixSizeSquare([[1, 2], [3, 4]]) // 2
25
+ * @example
26
+ * ```typescript
27
+ * MatrixSizeSquare([[1, 2], [3, 4]]) // 2
28
+ * ```
23
29
  */
24
- export declare function MatrixSizeSquare(matrix: IMatrix): number;
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 MatrixIsZero([[0, 0], [0, 0]]) // true
48
- * @example MatrixIsZero([[1e-15, 0], [0, 0]]) // true (within default threshold)
49
- * @example MatrixIsZero([[0.1, 0], [0, 0]]) // false
50
- */
51
- export declare function MatrixIsZero(matrix: IMatrix, threshold?: number): boolean;
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 MatrixIsIdentity([[1, 0], [0, 1]]) // true
59
- * @example MatrixIsIdentity([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) // true
60
- * @example MatrixIsIdentity([[1, 1], [0, 1]]) // false
61
- */
62
- export declare function MatrixIsIdentity(matrix: IMatrix, threshold?: number): boolean;
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 MatrixIsSymmetric([[1, 2], [2, 1]]) // true
70
- * @example MatrixIsSymmetric([[1, 2], [3, 4]]) // false
71
- * @example MatrixIsSymmetric([[1, 2, 3], [2, 5, 4], [3, 4, 6]]) // true
72
- */
73
- export declare function MatrixIsSymmetric(matrix: IMatrix, threshold?: number): boolean;
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 MatrixIsDiagonal([[3, 0], [0, 7]]) // true
82
- * @example MatrixIsDiagonal([[1, 0, 0], [0, 5, 0], [0, 0, 2]]) // true
83
- * @example MatrixIsDiagonal([[1, 2], [0, 1]]) // false
84
- */
85
- export declare function MatrixIsDiagonal(matrix: IMatrix, threshold?: number): boolean;
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 {IMatrix} A square identity matrix of size n×n
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 MatrixIdentity(2) // [[1, 0], [0, 1]]
92
- * @example MatrixIdentity(3) // [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
93
- */
94
- export declare function MatrixIdentity(size: 0): IMatrix;
95
- export declare function MatrixIdentity(size: 1): IMatrix1;
96
- export declare function MatrixIdentity(size: 2): IMatrix2;
97
- export declare function MatrixIdentity(size: 3): IMatrix3;
98
- export declare function MatrixIdentity(size: 4): IMatrix4;
99
- export declare function MatrixIdentity(size: number): IMatrix;
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 MatrixClone([[1, 2], [3, 4]]) // [[1, 2], [3, 4]] (independent copy)
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 IMatrix>(matrix: T): TMatrixResult<T>;
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 MatrixEquals([[1, 2]], [[1.0001, 2]], 0.001) // true
116
- * @example MatrixEquals([[1, 2]], [[1, 3]]) // false
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: IMatrix, b: IMatrix, tolerance?: number): boolean;
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 MatrixToString([[1.23, 2.7]]) // "[ 1.23, 2.70 ]"
126
- * @example MatrixToString([[1, 2], [3, 4]], 0) // "[ 1, 2 ]\n[ 3, 4 ]"
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: IMatrix, precision?: number): string;
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 MatrixRank([[1, 2], [2, 4]]) // 1 (second row = 2 × first row)
136
- * @example MatrixRank([[1, 0], [0, 1]]) // 2 (full rank)
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: IMatrix, tolerance?: number): number;
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 MatrixTrace([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) // 15 (1 + 5 + 9)
145
- * @example MatrixTrace([[1, 2], [3, 4], [5, 6]]) // 5 (1 + 4, rectangular matrix)
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: IMatrix): number;
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 MatrixTranspose([[1, 2, 3], [4, 5, 6]]) // [[1, 4], [2, 5], [3, 6]]
154
- * @example MatrixTranspose([[1, 2], [3, 4]]) // [[1, 3], [2, 4]]
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 IMatrix>(matrix: T): TMatrixResult<T>;
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 MatrixMap([[1, 2], [3, 4]], (value) => value * value) // [[1, 4], [9, 16]]
164
- * @example MatrixMap([[1, 2], [3, 4]], (value, row, col) => value + row + col) // [[1, 3], [4, 6]]
165
- */
166
- export declare function MatrixMap<T extends IMatrix>(matrix: T, fn: (value: number, row: number, col: number) => number): TMatrixResult<T>;
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;AAI5F,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;AA4DlE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAS5D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAKxD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAOtD;AAED;;;;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