@pawells/math-extended 2.0.0 → 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 (118) hide show
  1. package/README.md +15 -21
  2. package/build/clamp.d.ts +5 -5
  3. package/build/clamp.js +5 -5
  4. package/build/core.d.ts +23 -0
  5. package/build/core.d.ts.map +1 -0
  6. package/build/core.js +25 -0
  7. package/build/core.js.map +1 -0
  8. package/build/index.d.ts +1 -4
  9. package/build/index.d.ts.map +1 -1
  10. package/build/index.js +1 -6
  11. package/build/index.js.map +1 -1
  12. package/build/interpolation.d.ts +158 -171
  13. package/build/interpolation.d.ts.map +1 -1
  14. package/build/interpolation.js +162 -181
  15. package/build/interpolation.js.map +1 -1
  16. package/build/matrices/arithmetic.d.ts +132 -132
  17. package/build/matrices/arithmetic.d.ts.map +1 -1
  18. package/build/matrices/arithmetic.js +194 -226
  19. package/build/matrices/arithmetic.js.map +1 -1
  20. package/build/matrices/asserts.d.ts +30 -408
  21. package/build/matrices/asserts.d.ts.map +1 -1
  22. package/build/matrices/asserts.js +98 -542
  23. package/build/matrices/asserts.js.map +1 -1
  24. package/build/matrices/core.d.ts +117 -46
  25. package/build/matrices/core.d.ts.map +1 -1
  26. package/build/matrices/core.js +127 -103
  27. package/build/matrices/core.js.map +1 -1
  28. package/build/matrices/decompositions.d.ts +95 -96
  29. package/build/matrices/decompositions.d.ts.map +1 -1
  30. package/build/matrices/decompositions.js +119 -160
  31. package/build/matrices/decompositions.js.map +1 -1
  32. package/build/matrices/index.d.ts +0 -1
  33. package/build/matrices/index.d.ts.map +1 -1
  34. package/build/matrices/index.js +0 -3
  35. package/build/matrices/index.js.map +1 -1
  36. package/build/matrices/linear-algebra.d.ts +45 -8
  37. package/build/matrices/linear-algebra.d.ts.map +1 -1
  38. package/build/matrices/linear-algebra.js +76 -32
  39. package/build/matrices/linear-algebra.js.map +1 -1
  40. package/build/matrices/normalization.d.ts +29 -8
  41. package/build/matrices/normalization.d.ts.map +1 -1
  42. package/build/matrices/normalization.js +32 -23
  43. package/build/matrices/normalization.js.map +1 -1
  44. package/build/matrices/transformations.d.ts +116 -148
  45. package/build/matrices/transformations.d.ts.map +1 -1
  46. package/build/matrices/transformations.js +69 -91
  47. package/build/matrices/transformations.js.map +1 -1
  48. package/build/matrices/types.d.ts +32 -60
  49. package/build/matrices/types.d.ts.map +1 -1
  50. package/build/matrices/types.js +63 -1
  51. package/build/matrices/types.js.map +1 -1
  52. package/build/quaternions/asserts.d.ts +29 -38
  53. package/build/quaternions/asserts.d.ts.map +1 -1
  54. package/build/quaternions/asserts.js +61 -77
  55. package/build/quaternions/asserts.js.map +1 -1
  56. package/build/quaternions/conversions.d.ts +26 -26
  57. package/build/quaternions/conversions.d.ts.map +1 -1
  58. package/build/quaternions/conversions.js +24 -24
  59. package/build/quaternions/core.d.ts +70 -69
  60. package/build/quaternions/core.d.ts.map +1 -1
  61. package/build/quaternions/core.js +71 -71
  62. package/build/quaternions/core.js.map +1 -1
  63. package/build/quaternions/index.d.ts +0 -1
  64. package/build/quaternions/index.d.ts.map +1 -1
  65. package/build/quaternions/index.js +0 -2
  66. package/build/quaternions/index.js.map +1 -1
  67. package/build/quaternions/interpolation.d.ts +16 -16
  68. package/build/quaternions/interpolation.d.ts.map +1 -1
  69. package/build/quaternions/interpolation.js +21 -21
  70. package/build/quaternions/interpolation.js.map +1 -1
  71. package/build/quaternions/predefined.d.ts +10 -10
  72. package/build/quaternions/predefined.d.ts.map +1 -1
  73. package/build/quaternions/predefined.js +9 -9
  74. package/build/quaternions/types.d.ts +23 -12
  75. package/build/quaternions/types.d.ts.map +1 -1
  76. package/build/quaternions/types.js +51 -1
  77. package/build/quaternions/types.js.map +1 -1
  78. package/build/random.d.ts +66 -20
  79. package/build/random.d.ts.map +1 -1
  80. package/build/random.js +73 -20
  81. package/build/random.js.map +1 -1
  82. package/build/vectors/asserts.d.ts +50 -220
  83. package/build/vectors/asserts.d.ts.map +1 -1
  84. package/build/vectors/asserts.js +141 -327
  85. package/build/vectors/asserts.js.map +1 -1
  86. package/build/vectors/core.d.ts +182 -229
  87. package/build/vectors/core.d.ts.map +1 -1
  88. package/build/vectors/core.js +234 -288
  89. package/build/vectors/core.js.map +1 -1
  90. package/build/vectors/index.d.ts +0 -1
  91. package/build/vectors/index.d.ts.map +1 -1
  92. package/build/vectors/index.js +0 -2
  93. package/build/vectors/index.js.map +1 -1
  94. package/build/vectors/interpolation.d.ts +40 -40
  95. package/build/vectors/interpolation.d.ts.map +1 -1
  96. package/build/vectors/interpolation.js +75 -86
  97. package/build/vectors/interpolation.js.map +1 -1
  98. package/build/vectors/predefined.d.ts +31 -7
  99. package/build/vectors/predefined.d.ts.map +1 -1
  100. package/build/vectors/predefined.js +30 -6
  101. package/build/vectors/predefined.js.map +1 -1
  102. package/build/vectors/types.d.ts +26 -4
  103. package/build/vectors/types.d.ts.map +1 -1
  104. package/build/vectors/types.js +50 -1
  105. package/build/vectors/types.js.map +1 -1
  106. package/package.json +3 -2
  107. package/build/matrices/_exports.d.ts +0 -13
  108. package/build/matrices/_exports.d.ts.map +0 -1
  109. package/build/matrices/_exports.js +0 -13
  110. package/build/matrices/_exports.js.map +0 -1
  111. package/build/quaternions/_exports.d.ts +0 -11
  112. package/build/quaternions/_exports.d.ts.map +0 -1
  113. package/build/quaternions/_exports.js +0 -11
  114. package/build/quaternions/_exports.js.map +0 -1
  115. package/build/vectors/_exports.d.ts +0 -10
  116. package/build/vectors/_exports.d.ts.map +0 -1
  117. package/build/vectors/_exports.js +0 -10
  118. package/build/vectors/_exports.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { TMatrix, TMatrix1, TMatrix2, TMatrix3, TMatrix4, TMatrixResult } from './types.js';
2
- import { TVector, TVector2, TVector3, TVector4 } from '../vectors/types.js';
1
+ import type { TMatrix, TMatrix1, TMatrix2, TMatrix3, TMatrix4, TMatrixResult } from './types.js';
2
+ import type { TVector, TVector2, TVector3, TVector4 } from '../vectors/types.js';
3
3
  /**
4
4
  * Performs element-wise addition of two matrices.
5
5
  *
@@ -26,18 +26,18 @@ import { TVector, TVector2, TVector3, TVector4 } from '../vectors/types.js';
26
26
  * @throws {Error} If matrices have different dimensions or contain invalid values
27
27
  *
28
28
  * @example
29
- * ```typescript
30
- * ```typescript
31
- * // Adding 2×2 matrices
32
- * MatrixAdd([[1, 2], [3, 4]], [[5, 6], [7, 8]]) // Returns [[6, 8], [10, 12]]
33
- * // Adding 1×3 row vectors
34
- * MatrixAdd([[1, 2, 3]], [[4, 5, 6]]) // Returns [[5, 7, 9]]
35
- * // Type-safe matrix addition with specific matrix types
36
- * const matrixA: TMatrix2 = [[1, 2], [3, 4]];
37
- * const matrixB: TMatrix2 = [[5, 6], [7, 8]];
38
- * const result: TMatrix2 = MatrixAdd(matrixA, matrixB);
39
- * ```
40
- * ```
29
+ * ```typescript
30
+ * ```typescript
31
+ * // Adding 2×2 matrices
32
+ * MatrixAdd([[1, 2], [3, 4]], [[5, 6], [7, 8]]) // Returns [[6, 8], [10, 12]]
33
+ * // Adding 1×3 row vectors
34
+ * MatrixAdd([[1, 2, 3]], [[4, 5, 6]]) // Returns [[5, 7, 9]]
35
+ * // Type-safe matrix addition with specific matrix types
36
+ * const matrixA: TMatrix2 = [[1, 2], [3, 4]];
37
+ * const matrixB: TMatrix2 = [[5, 6], [7, 8]];
38
+ * const result: TMatrix2 = MatrixAdd(matrixA, matrixB);
39
+ * ```
40
+ * ```
41
41
  */
42
42
  export declare function MatrixAdd<T extends TMatrix>(a: T, b: T): TMatrixResult<T>;
43
43
  /**
@@ -66,17 +66,17 @@ export declare function MatrixAdd<T extends TMatrix>(a: T, b: T): TMatrixResult<
66
66
  * @throws {Error} If matrices have different dimensions or contain invalid values
67
67
  *
68
68
  * @example
69
- * ```typescript
70
- * ```typescript
71
- * // Subtracting 2×2 matrices
72
- * MatrixSubtract([[10, 8], [6, 4]], [[3, 2], [1, 1]]) // Returns [[7, 6], [5, 3]]
73
- * // Order matters: A - B ≠ B - A
74
- * MatrixSubtract([[1, 2]], [[3, 4]]) // Returns [[-2, -2]]
75
- * MatrixSubtract([[3, 4]], [[1, 2]]) // Returns [[2, 2]]
76
- * // Self-subtraction produces zero matrix
77
- * MatrixSubtract([[5, 6]], [[5, 6]]) // Returns [[0, 0]]
78
- * ```
79
- * ```
69
+ * ```typescript
70
+ * ```typescript
71
+ * // Subtracting 2×2 matrices
72
+ * MatrixSubtract([[10, 8], [6, 4]], [[3, 2], [1, 1]]) // Returns [[7, 6], [5, 3]]
73
+ * // Order matters: A - B ≠ B - A
74
+ * MatrixSubtract([[1, 2]], [[3, 4]]) // Returns [[-2, -2]]
75
+ * MatrixSubtract([[3, 4]], [[1, 2]]) // Returns [[2, 2]]
76
+ * // Self-subtraction produces zero matrix
77
+ * MatrixSubtract([[5, 6]], [[5, 6]]) // Returns [[0, 0]]
78
+ * ```
79
+ * ```
80
80
  */
81
81
  export declare function MatrixSubtract<T extends TMatrix>(a: T, b: T): TMatrixResult<T>;
82
82
  /**
@@ -133,33 +133,33 @@ export declare function MatrixSubtract<T extends TMatrix>(a: T, b: T): TMatrixRe
133
133
  * @throws {Error} If matrix dimensions are incompatible for multiplication
134
134
  *
135
135
  * @example
136
- * ```typescript
137
- * ```typescript
138
- * // Type-safe scalar multiplication with specific matrix types
139
- * const matrix2: TMatrix2 = [[1, 2], [3, 4]];
140
- * const scalar2Result: TMatrix2 = MatrixMultiply(matrix2, 2); // [[2, 4], [6, 8]]
141
- * const matrix3: TMatrix3 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
142
- * const scalar3Result: TMatrix3 = MatrixMultiply(matrix3, 5); // Identity × 5
143
- * // Type-safe vector multiplication with specific matrix/vector types
144
- * const matrix2x2: TMatrix2 = [[1, 2], [3, 4]];
145
- * const vector2: TVector2 = [5, 6];
146
- * const vectorResult: TVector2 = MatrixMultiply(matrix2x2, vector2); // [17, 39]
147
- * const matrix4x4: TMatrix4 = [[1,0,0,0], [0,1,0,0], [0,0,1,0], [0,0,0,1]];
148
- * const vector4: TVector4 = [1, 2, 3, 4];
149
- * const vector4Result: TVector4 = MatrixMultiply(matrix4x4, vector4); // [1, 2, 3, 4]
150
- * // Type-safe matrix multiplication with specific matrix types
151
- * const matrixA: TMatrix2 = [[1, 2], [3, 4]];
152
- * const matrixB: TMatrix2 = [[5, 6], [7, 8]];
153
- * const matrixResult: TMatrix2 = MatrixMultiply(matrixA, matrixB); // [[19, 22], [43, 50]]
154
- * // General matrix operations (fallback to generic types)
155
- * MatrixMultiply([[1, 2]], [[3], [4]]) // Returns [[11]]
156
- * MatrixMultiply([[1], [2]], [[3, 4]]) // Returns [[3, 4], [6, 8]]
157
- * // Type detection is automatic - no need to specify operation type
158
- * const scalarResult = MatrixMultiply(matrixA, 5); // Scalar multiplication
159
- * const vectorResult2 = MatrixMultiply(matrixA, vector2); // Vector multiplication
160
- * const matrixResult2 = MatrixMultiply(matrixA, matrixB); // Matrix multiplication
161
- * ```
162
- * ```
136
+ * ```typescript
137
+ * ```typescript
138
+ * // Type-safe scalar multiplication with specific matrix types
139
+ * const matrix2: TMatrix2 = [[1, 2], [3, 4]];
140
+ * const scalar2Result: TMatrix2 = MatrixMultiply(matrix2, 2); // [[2, 4], [6, 8]]
141
+ * const matrix3: TMatrix3 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
142
+ * const scalar3Result: TMatrix3 = MatrixMultiply(matrix3, 5); // Identity × 5
143
+ * // Type-safe vector multiplication with specific matrix/vector types
144
+ * const matrix2x2: TMatrix2 = [[1, 2], [3, 4]];
145
+ * const vector2: TVector2 = [5, 6];
146
+ * const vectorResult: TVector2 = MatrixMultiply(matrix2x2, vector2); // [17, 39]
147
+ * const matrix4x4: TMatrix4 = [[1,0,0,0], [0,1,0,0], [0,0,1,0], [0,0,0,1]];
148
+ * const vector4: TVector4 = [1, 2, 3, 4];
149
+ * const vector4Result: TVector4 = MatrixMultiply(matrix4x4, vector4); // [1, 2, 3, 4]
150
+ * // Type-safe matrix multiplication with specific matrix types
151
+ * const matrixA: TMatrix2 = [[1, 2], [3, 4]];
152
+ * const matrixB: TMatrix2 = [[5, 6], [7, 8]];
153
+ * const matrixResult: TMatrix2 = MatrixMultiply(matrixA, matrixB); // [[19, 22], [43, 50]]
154
+ * // General matrix operations (fallback to generic types)
155
+ * MatrixMultiply([[1, 2]], [[3], [4]]) // Returns [[11]]
156
+ * MatrixMultiply([[1], [2]], [[3, 4]]) // Returns [[3, 4], [6, 8]]
157
+ * // Type detection is automatic - no need to specify operation type
158
+ * const scalarResult = MatrixMultiply(matrixA, 5); // Scalar multiplication
159
+ * const vectorResult2 = MatrixMultiply(matrixA, vector2); // Vector multiplication
160
+ * const matrixResult2 = MatrixMultiply(matrixA, matrixB); // Matrix multiplication
161
+ * ```
162
+ * ```
163
163
  */
164
164
  export declare function MatrixMultiply(a: TMatrix1, b: number): TMatrix1;
165
165
  export declare function MatrixMultiply(a: TMatrix2, b: number): TMatrix2;
@@ -218,29 +218,29 @@ export declare function MatrixMultiply(a: TMatrix, b: number): TMatrix;
218
218
  * @returns {TMatrix} The extracted submatrix with dimensions height×width
219
219
  * @throws {Error} If extraction bounds exceed matrix dimensions or contain invalid values
220
220
  * @example
221
- * ```typescript
222
- * ```typescript
223
- * const matrix = [
224
- * [1, 2, 3, 4],
225
- * [5, 6, 7, 8],
226
- * [9, 10, 11, 12]
227
- * ]; // 3×4 matrix
228
- * // Extract 2×2 submatrix from top-left corner
229
- * MatrixSubmatrix(matrix, 0, 0, 2, 2) // Returns [[1, 2], [5, 6]]
230
- * // Extract 2×2 submatrix from center-right region
231
- * MatrixSubmatrix(matrix, 2, 1, 2, 2) // Returns [[7, 8], [11, 12]]
232
- * // Extract single column (column vector)
233
- * MatrixSubmatrix(matrix, 1, 0, 1, 3) // Returns [[2], [6], [10]]
234
- * // Extract single row (row vector)
235
- * MatrixSubmatrix(matrix, 0, 1, 4, 1) // Returns [[5, 6, 7, 8]]
236
- * // Block matrix partitioning for algorithms
237
- * const large = MatrixCreate(8, 8); // 8×8 matrix
238
- * const topLeft = MatrixSubmatrix(large, 0, 0, 4, 4); // Top-left 4×4 block
239
- * const topRight = MatrixSubmatrix(large, 4, 0, 4, 4); // Top-right 4×4 block
240
- * const bottomLeft = MatrixSubmatrix(large, 0, 4, 4, 4); // Bottom-left 4×4 block
241
- * const bottomRight = MatrixSubmatrix(large, 4, 4, 4, 4); // Bottom-right 4×4 block
242
- * ```
243
- * ```
221
+ * ```typescript
222
+ * ```typescript
223
+ * const matrix = [
224
+ * [1, 2, 3, 4],
225
+ * [5, 6, 7, 8],
226
+ * [9, 10, 11, 12]
227
+ * ]; // 3×4 matrix
228
+ * // Extract 2×2 submatrix from top-left corner
229
+ * MatrixSubmatrix(matrix, 0, 0, 2, 2) // Returns [[1, 2], [5, 6]]
230
+ * // Extract 2×2 submatrix from center-right region
231
+ * MatrixSubmatrix(matrix, 2, 1, 2, 2) // Returns [[7, 8], [11, 12]]
232
+ * // Extract single column (column vector)
233
+ * MatrixSubmatrix(matrix, 1, 0, 1, 3) // Returns [[2], [6], [10]]
234
+ * // Extract single row (row vector)
235
+ * MatrixSubmatrix(matrix, 0, 1, 4, 1) // Returns [[5, 6, 7, 8]]
236
+ * // Block matrix partitioning for algorithms
237
+ * const large = MatrixCreate(8, 8); // 8×8 matrix
238
+ * const topLeft = MatrixSubmatrix(large, 0, 0, 4, 4); // Top-left 4×4 block
239
+ * const topRight = MatrixSubmatrix(large, 4, 0, 4, 4); // Top-right 4×4 block
240
+ * const bottomLeft = MatrixSubmatrix(large, 0, 4, 4, 4); // Bottom-left 4×4 block
241
+ * const bottomRight = MatrixSubmatrix(large, 4, 4, 4, 4); // Bottom-right 4×4 block
242
+ * ```
243
+ * ```
244
244
  */
245
245
  export declare function MatrixSubmatrix(matrix: TMatrix, startCol: number, startRow: number, width: number, height: number): TMatrix;
246
246
  /**
@@ -284,33 +284,33 @@ export declare function MatrixSubmatrix(matrix: TMatrix, startCol: number, start
284
284
  * @returns {TMatrix} The padded matrix with dimensions newRows×newCols
285
285
  * @throws {Error} If new dimensions are smaller than current dimensions
286
286
  * @example
287
- * ```typescript
288
- * ```typescript
289
- * const matrix = [[1, 2], [3, 4]]; // 2×2 matrix
290
- * // Pad to 4×4 matrix (symmetric padding)
291
- * MatrixPad(matrix, 4, 4)
292
- * // Returns:
293
- * // [[1, 2, 0, 0],
294
- * // [3, 4, 0, 0],
295
- * // [0, 0, 0, 0],
296
- * // [0, 0, 0, 0]]
297
- * // Pad to 3×4 matrix (asymmetric padding)
298
- * MatrixPad(matrix, 3, 4)
299
- * // Returns:
300
- * // [[1, 2, 0, 0],
301
- * // [3, 4, 0, 0],
302
- * // [0, 0, 0, 0]]
303
- * // Prepare for power-of-2 algorithm (e.g., FFT-based convolution)
304
- * const data = [[1, 2, 3], [4, 5, 6]]; // 2×3 matrix
305
- * const powerOf2 = MatrixPad(data, 4, 4); // Pad to 4×4 for FFT
306
- * // Batch size alignment in machine learning
307
- * const features = MatrixCreate(7, 10); // 7 samples, 10 features
308
- * const aligned = MatrixPad(features, 8, 10); // Align to batch size 8
309
- * // Image border padding for convolution
310
- * const image = MatrixCreate(28, 28); // 28×28 image
311
- * const padded = MatrixPad(image, 32, 32); // Add border for valid convolution
312
- * ```
313
- * ```
287
+ * ```typescript
288
+ * ```typescript
289
+ * const matrix = [[1, 2], [3, 4]]; // 2×2 matrix
290
+ * // Pad to 4×4 matrix (symmetric padding)
291
+ * MatrixPad(matrix, 4, 4)
292
+ * // Returns:
293
+ * // [[1, 2, 0, 0],
294
+ * // [3, 4, 0, 0],
295
+ * // [0, 0, 0, 0],
296
+ * // [0, 0, 0, 0]]
297
+ * // Pad to 3×4 matrix (asymmetric padding)
298
+ * MatrixPad(matrix, 3, 4)
299
+ * // Returns:
300
+ * // [[1, 2, 0, 0],
301
+ * // [3, 4, 0, 0],
302
+ * // [0, 0, 0, 0]]
303
+ * // Prepare for power-of-2 algorithm (e.g., FFT-based convolution)
304
+ * const data = [[1, 2, 3], [4, 5, 6]]; // 2×3 matrix
305
+ * const powerOf2 = MatrixPad(data, 4, 4); // Pad to 4×4 for FFT
306
+ * // Batch size alignment in machine learning
307
+ * const features = MatrixCreate(7, 10); // 7 samples, 10 features
308
+ * const aligned = MatrixPad(features, 8, 10); // Align to batch size 8
309
+ * // Image border padding for convolution
310
+ * const image = MatrixCreate(28, 28); // 28×28 image
311
+ * const padded = MatrixPad(image, 32, 32); // Add border for valid convolution
312
+ * ```
313
+ * ```
314
314
  */
315
315
  export declare function MatrixPad(matrix: TMatrix, newRows: number, newCols: number): TMatrix;
316
316
  /**
@@ -365,36 +365,36 @@ export declare function MatrixPad(matrix: TMatrix, newRows: number, newCols: num
365
365
  * @throws {Error} If quadrants have mismatched dimensions or invalid values
366
366
  *
367
367
  * @example
368
- * ```typescript
369
- * ```typescript
370
- * // Basic 2×2 quadrant combination
371
- * const topLeft = [[1, 2], [3, 4]];
372
- * const topRight = [[5, 6], [7, 8]];
373
- * const bottomLeft = [[9, 10], [11, 12]];
374
- * const bottomRight = [[13, 14], [15, 16]];
375
- * MatrixCombine(topLeft, topRight, bottomLeft, bottomRight)
376
- * // Returns:
377
- * // [[1, 2, 5, 6],
378
- * // [3, 4, 7, 8],
379
- * // [9, 10, 13, 14],
380
- * // [11,12, 15, 16]]
381
- * // Strassen algorithm result reconstruction
382
- * const m1 = computeStrassenProduct1(); // Computed Strassen intermediate results
383
- * const m2 = computeStrassenProduct2();
384
- * const m3 = computeStrassenProduct3();
385
- * const m4 = computeStrassenProduct4();
386
- * const finalResult = MatrixCombine(m1, m2, m3, m4); // Assemble final result
387
- * // Image processing: combining processed quadrants
388
- * const processedTopLeft = processImageQuadrant(imageTopLeft);
389
- * const processedTopRight = processImageQuadrant(imageTopRight);
390
- * const processedBottomLeft = processImageQuadrant(imageBottomLeft);
391
- * const processedBottomRight = processImageQuadrant(imageBottomRight);
392
- * const reconstructedImage = MatrixCombine(
393
- * processedTopLeft, processedTopRight,
394
- * processedBottomLeft, processedBottomRight
395
- * );
396
- * ```
397
- * ```
368
+ * ```typescript
369
+ * ```typescript
370
+ * // Basic 2×2 quadrant combination
371
+ * const topLeft = [[1, 2], [3, 4]];
372
+ * const topRight = [[5, 6], [7, 8]];
373
+ * const bottomLeft = [[9, 10], [11, 12]];
374
+ * const bottomRight = [[13, 14], [15, 16]];
375
+ * MatrixCombine(topLeft, topRight, bottomLeft, bottomRight)
376
+ * // Returns:
377
+ * // [[1, 2, 5, 6],
378
+ * // [3, 4, 7, 8],
379
+ * // [9, 10, 13, 14],
380
+ * // [11,12, 15, 16]]
381
+ * // Strassen algorithm result reconstruction
382
+ * const m1 = computeStrassenProduct1(); // Computed Strassen intermediate results
383
+ * const m2 = computeStrassenProduct2();
384
+ * const m3 = computeStrassenProduct3();
385
+ * const m4 = computeStrassenProduct4();
386
+ * const finalResult = MatrixCombine(m1, m2, m3, m4); // Assemble final result
387
+ * // Image processing: combining processed quadrants
388
+ * const processedTopLeft = processImageQuadrant(imageTopLeft);
389
+ * const processedTopRight = processImageQuadrant(imageTopRight);
390
+ * const processedBottomLeft = processImageQuadrant(imageBottomLeft);
391
+ * const processedBottomRight = processImageQuadrant(imageBottomRight);
392
+ * const reconstructedImage = MatrixCombine(
393
+ * processedTopLeft, processedTopRight,
394
+ * processedBottomLeft, processedBottomRight
395
+ * );
396
+ * ```
397
+ * ```
398
398
  */
399
399
  export declare function MatrixCombine(c11: TMatrix, c12: TMatrix, c21: TMatrix, c22: TMatrix): TMatrix;
400
400
  //# sourceMappingURL=arithmetic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arithmetic.d.ts","sourceRoot":"","sources":["../../src/matrices/arithmetic.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,q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