@pawells/math-extended 1.0.1
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/LICENSE +21 -0
- package/README.md +319 -0
- package/build/angles.d.ts +31 -0
- package/build/angles.d.ts.map +1 -0
- package/build/angles.js +85 -0
- package/build/angles.js.map +1 -0
- package/build/angles.spec.d.ts +2 -0
- package/build/angles.spec.d.ts.map +1 -0
- package/build/angles.spec.js +147 -0
- package/build/angles.spec.js.map +1 -0
- package/build/clamp.d.ts +17 -0
- package/build/clamp.d.ts.map +1 -0
- package/build/clamp.js +19 -0
- package/build/clamp.js.map +1 -0
- package/build/clamp.spec.d.ts +2 -0
- package/build/clamp.spec.d.ts.map +1 -0
- package/build/clamp.spec.js +19 -0
- package/build/clamp.spec.js.map +1 -0
- package/build/documentation-validation.spec.d.ts +11 -0
- package/build/documentation-validation.spec.d.ts.map +1 -0
- package/build/documentation-validation.spec.js +401 -0
- package/build/documentation-validation.spec.js.map +1 -0
- package/build/index.d.ts +8 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +8 -0
- package/build/index.js.map +1 -0
- package/build/interpolation.d.ts +175 -0
- package/build/interpolation.d.ts.map +1 -0
- package/build/interpolation.js +369 -0
- package/build/interpolation.js.map +1 -0
- package/build/interpolation.spec.d.ts +2 -0
- package/build/interpolation.spec.d.ts.map +1 -0
- package/build/interpolation.spec.js +480 -0
- package/build/interpolation.spec.js.map +1 -0
- package/build/matrices/arithmetic.d.ts +411 -0
- package/build/matrices/arithmetic.d.ts.map +1 -0
- package/build/matrices/arithmetic.js +954 -0
- package/build/matrices/arithmetic.js.map +1 -0
- package/build/matrices/arithmetic.spec.d.ts +2 -0
- package/build/matrices/arithmetic.spec.d.ts.map +1 -0
- package/build/matrices/arithmetic.spec.js +915 -0
- package/build/matrices/arithmetic.spec.js.map +1 -0
- package/build/matrices/asserts.d.ts +306 -0
- package/build/matrices/asserts.d.ts.map +1 -0
- package/build/matrices/asserts.js +396 -0
- package/build/matrices/asserts.js.map +1 -0
- package/build/matrices/asserts.spec.d.ts +2 -0
- package/build/matrices/asserts.spec.d.ts.map +1 -0
- package/build/matrices/asserts.spec.js +565 -0
- package/build/matrices/asserts.spec.js.map +1 -0
- package/build/matrices/core.d.ts +168 -0
- package/build/matrices/core.d.ts.map +1 -0
- package/build/matrices/core.js +457 -0
- package/build/matrices/core.js.map +1 -0
- package/build/matrices/core.spec.d.ts +2 -0
- package/build/matrices/core.spec.d.ts.map +1 -0
- package/build/matrices/core.spec.js +634 -0
- package/build/matrices/core.spec.js.map +1 -0
- package/build/matrices/decompositions.d.ts +326 -0
- package/build/matrices/decompositions.d.ts.map +1 -0
- package/build/matrices/decompositions.js +816 -0
- package/build/matrices/decompositions.js.map +1 -0
- package/build/matrices/decompositions.spec.d.ts +2 -0
- package/build/matrices/decompositions.spec.d.ts.map +1 -0
- package/build/matrices/decompositions.spec.js +195 -0
- package/build/matrices/decompositions.spec.js.map +1 -0
- package/build/matrices/index.d.ts +9 -0
- package/build/matrices/index.d.ts.map +1 -0
- package/build/matrices/index.js +9 -0
- package/build/matrices/index.js.map +1 -0
- package/build/matrices/linear-algebra.d.ts +64 -0
- package/build/matrices/linear-algebra.d.ts.map +1 -0
- package/build/matrices/linear-algebra.js +253 -0
- package/build/matrices/linear-algebra.js.map +1 -0
- package/build/matrices/linear-algebra.spec.d.ts +2 -0
- package/build/matrices/linear-algebra.spec.d.ts.map +1 -0
- package/build/matrices/linear-algebra.spec.js +355 -0
- package/build/matrices/linear-algebra.spec.js.map +1 -0
- package/build/matrices/normalization.d.ts +62 -0
- package/build/matrices/normalization.d.ts.map +1 -0
- package/build/matrices/normalization.js +167 -0
- package/build/matrices/normalization.js.map +1 -0
- package/build/matrices/normalization.spec.d.ts +2 -0
- package/build/matrices/normalization.spec.d.ts.map +1 -0
- package/build/matrices/normalization.spec.js +335 -0
- package/build/matrices/normalization.spec.js.map +1 -0
- package/build/matrices/transformations.d.ts +484 -0
- package/build/matrices/transformations.d.ts.map +1 -0
- package/build/matrices/transformations.js +592 -0
- package/build/matrices/transformations.js.map +1 -0
- package/build/matrices/transformations.spec.d.ts +2 -0
- package/build/matrices/transformations.spec.d.ts.map +1 -0
- package/build/matrices/transformations.spec.js +755 -0
- package/build/matrices/transformations.spec.js.map +1 -0
- package/build/matrices/types.d.ts +134 -0
- package/build/matrices/types.d.ts.map +1 -0
- package/build/matrices/types.js +6 -0
- package/build/matrices/types.js.map +1 -0
- package/build/quaternions/asserts.d.ts +77 -0
- package/build/quaternions/asserts.d.ts.map +1 -0
- package/build/quaternions/asserts.js +175 -0
- package/build/quaternions/asserts.js.map +1 -0
- package/build/quaternions/asserts.spec.d.ts +2 -0
- package/build/quaternions/asserts.spec.d.ts.map +1 -0
- package/build/quaternions/asserts.spec.js +320 -0
- package/build/quaternions/asserts.spec.js.map +1 -0
- package/build/quaternions/conversions.d.ts +73 -0
- package/build/quaternions/conversions.d.ts.map +1 -0
- package/build/quaternions/conversions.js +179 -0
- package/build/quaternions/conversions.js.map +1 -0
- package/build/quaternions/conversions.spec.d.ts +2 -0
- package/build/quaternions/conversions.spec.d.ts.map +1 -0
- package/build/quaternions/conversions.spec.js +344 -0
- package/build/quaternions/conversions.spec.js.map +1 -0
- package/build/quaternions/core.d.ts +203 -0
- package/build/quaternions/core.d.ts.map +1 -0
- package/build/quaternions/core.js +374 -0
- package/build/quaternions/core.js.map +1 -0
- package/build/quaternions/core.spec.d.ts +2 -0
- package/build/quaternions/core.spec.d.ts.map +1 -0
- package/build/quaternions/core.spec.js +294 -0
- package/build/quaternions/core.spec.js.map +1 -0
- package/build/quaternions/index.d.ts +7 -0
- package/build/quaternions/index.d.ts.map +1 -0
- package/build/quaternions/index.js +7 -0
- package/build/quaternions/index.js.map +1 -0
- package/build/quaternions/interpolation.d.ts +54 -0
- package/build/quaternions/interpolation.d.ts.map +1 -0
- package/build/quaternions/interpolation.js +201 -0
- package/build/quaternions/interpolation.js.map +1 -0
- package/build/quaternions/interpolation.spec.d.ts +2 -0
- package/build/quaternions/interpolation.spec.d.ts.map +1 -0
- package/build/quaternions/interpolation.spec.js +64 -0
- package/build/quaternions/interpolation.spec.js.map +1 -0
- package/build/quaternions/predefined.d.ts +36 -0
- package/build/quaternions/predefined.d.ts.map +1 -0
- package/build/quaternions/predefined.js +42 -0
- package/build/quaternions/predefined.js.map +1 -0
- package/build/quaternions/predefined.spec.d.ts +2 -0
- package/build/quaternions/predefined.spec.d.ts.map +1 -0
- package/build/quaternions/predefined.spec.js +35 -0
- package/build/quaternions/predefined.spec.js.map +1 -0
- package/build/quaternions/types.d.ts +55 -0
- package/build/quaternions/types.d.ts.map +1 -0
- package/build/quaternions/types.js +7 -0
- package/build/quaternions/types.js.map +1 -0
- package/build/random.d.ts +66 -0
- package/build/random.d.ts.map +1 -0
- package/build/random.js +115 -0
- package/build/random.js.map +1 -0
- package/build/random.spec.d.ts +2 -0
- package/build/random.spec.d.ts.map +1 -0
- package/build/random.spec.js +267 -0
- package/build/random.spec.js.map +1 -0
- package/build/vectors/asserts.d.ts +182 -0
- package/build/vectors/asserts.d.ts.map +1 -0
- package/build/vectors/asserts.js +285 -0
- package/build/vectors/asserts.js.map +1 -0
- package/build/vectors/asserts.spec.d.ts +2 -0
- package/build/vectors/asserts.spec.d.ts.map +1 -0
- package/build/vectors/asserts.spec.js +260 -0
- package/build/vectors/asserts.spec.js.map +1 -0
- package/build/vectors/core.d.ts +507 -0
- package/build/vectors/core.d.ts.map +1 -0
- package/build/vectors/core.js +825 -0
- package/build/vectors/core.js.map +1 -0
- package/build/vectors/core.spec.d.ts +2 -0
- package/build/vectors/core.spec.d.ts.map +1 -0
- package/build/vectors/core.spec.js +343 -0
- package/build/vectors/core.spec.js.map +1 -0
- package/build/vectors/index.d.ts +6 -0
- package/build/vectors/index.d.ts.map +1 -0
- package/build/vectors/index.js +6 -0
- package/build/vectors/index.js.map +1 -0
- package/build/vectors/interpolation.d.ts +404 -0
- package/build/vectors/interpolation.d.ts.map +1 -0
- package/build/vectors/interpolation.js +585 -0
- package/build/vectors/interpolation.js.map +1 -0
- package/build/vectors/interpolation.spec.d.ts +2 -0
- package/build/vectors/interpolation.spec.d.ts.map +1 -0
- package/build/vectors/interpolation.spec.js +378 -0
- package/build/vectors/interpolation.spec.js.map +1 -0
- package/build/vectors/predefined.d.ts +191 -0
- package/build/vectors/predefined.d.ts.map +1 -0
- package/build/vectors/predefined.js +191 -0
- package/build/vectors/predefined.js.map +1 -0
- package/build/vectors/predefined.spec.d.ts +2 -0
- package/build/vectors/predefined.spec.d.ts.map +1 -0
- package/build/vectors/predefined.spec.js +333 -0
- package/build/vectors/predefined.spec.js.map +1 -0
- package/build/vectors/types.d.ts +62 -0
- package/build/vectors/types.d.ts.map +1 -0
- package/build/vectors/types.js +6 -0
- package/build/vectors/types.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { AssertArray2D, AssertNumber, SetExceptionClass, SetExceptionMessage, ThrowException } from '@pawells/typescript-common';
|
|
2
|
+
import { MatrixSize } from './core.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom error class for matrix-related validation failures.
|
|
5
|
+
*
|
|
6
|
+
* This error class provides a specific error type for matrix validation
|
|
7
|
+
* failures, making it easier to catch and handle matrix-specific errors
|
|
8
|
+
* separately from other types of errors in your application.
|
|
9
|
+
*
|
|
10
|
+
* @class MatrixError
|
|
11
|
+
* @extends Error
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* try {
|
|
15
|
+
* AssertMatrix(invalidMatrix);
|
|
16
|
+
* } catch (error) {
|
|
17
|
+
* if (error instanceof MatrixError) {
|
|
18
|
+
* console.log('Matrix validation failed:', error.message);
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export class MatrixError extends Error {
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new MatrixError instance.
|
|
26
|
+
*
|
|
27
|
+
* @param message - Optional error message describing the validation failure
|
|
28
|
+
*/
|
|
29
|
+
constructor(message) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.name = 'MatrixError';
|
|
32
|
+
// Maintains proper prototype chain for instanceof checks
|
|
33
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Validates that an unknown value is a valid matrix conforming to the IMatrix interface.
|
|
38
|
+
*
|
|
39
|
+
* This function performs comprehensive validation of matrix structure including:
|
|
40
|
+
* - Type checking to ensure the value is a proper matrix
|
|
41
|
+
* - Dimensional constraints (min/max/exact rows and columns)
|
|
42
|
+
* - Square matrix validation if required
|
|
43
|
+
* - Size validation against specified dimensions
|
|
44
|
+
*
|
|
45
|
+
* @param matrix - The value to validate as a matrix
|
|
46
|
+
* @param args - Validation configuration options
|
|
47
|
+
* @param exception - Custom exception details if validation fails
|
|
48
|
+
* @throws {IAssertException} When the matrix doesn't meet the specified criteria
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* // Validate a 3x3 square matrix
|
|
53
|
+
* AssertMatrix(someValue, { square: true, size: 3 });
|
|
54
|
+
*
|
|
55
|
+
* // Validate minimum dimensions
|
|
56
|
+
* AssertMatrix(someValue, { minRows: 2, minColumns: 3 });
|
|
57
|
+
*
|
|
58
|
+
* // Validate exact dimensions
|
|
59
|
+
* AssertMatrix(someValue, { rows: 4, columns: 5 });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export function AssertMatrix(matrix, args = {}, exception = {}) {
|
|
63
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
64
|
+
SetExceptionClass(exception, MatrixError);
|
|
65
|
+
// First validation: ensure the input is a valid 2D array structure
|
|
66
|
+
AssertArray2D(matrix, {}, exception);
|
|
67
|
+
// Second validation: verify all elements are numeric values
|
|
68
|
+
// Note: We check both type and NaN since NaN has type 'number' but isn't a valid matrix element
|
|
69
|
+
for (let i = 0; i < matrix.length; i++) {
|
|
70
|
+
const row = matrix[i];
|
|
71
|
+
if (row) {
|
|
72
|
+
for (let j = 0; j < row.length; j++) {
|
|
73
|
+
if (typeof row[j] !== 'number' || Number.isNaN(row[j])) {
|
|
74
|
+
SetExceptionMessage(exception, `Matrix[${i}][${j}] Not a Number`);
|
|
75
|
+
ThrowException(exception);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Extract matrix dimensions for constraint validation
|
|
81
|
+
const [rows, columns] = MatrixSize(matrix);
|
|
82
|
+
// Reject empty matrices (zero rows or zero columns)
|
|
83
|
+
if (rows === 0 || columns === 0) {
|
|
84
|
+
SetExceptionMessage(exception, 'Matrix must have at least one row and one column');
|
|
85
|
+
ThrowException(exception);
|
|
86
|
+
}
|
|
87
|
+
// Validate exact size constraint when specified as [rows, columns] tuple
|
|
88
|
+
if (Array.isArray(args.size)) {
|
|
89
|
+
const [expectedRows, expectedColumns] = args.size;
|
|
90
|
+
if (rows !== expectedRows) {
|
|
91
|
+
SetExceptionMessage(exception, `Matrix has ${rows} rows, expected exactly ${expectedRows}`);
|
|
92
|
+
ThrowException(exception);
|
|
93
|
+
}
|
|
94
|
+
if (columns !== expectedColumns) {
|
|
95
|
+
SetExceptionMessage(exception, `Matrix has ${columns} columns, expected exactly ${expectedColumns}`);
|
|
96
|
+
ThrowException(exception);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (typeof args.size === 'number') {
|
|
100
|
+
// Validate exact size constraint when specified as single number (assumes square matrix)
|
|
101
|
+
if (rows !== args.size) {
|
|
102
|
+
SetExceptionMessage(exception, `Square matrix has ${rows} rows, expected exactly ${args.size}`);
|
|
103
|
+
ThrowException(exception);
|
|
104
|
+
}
|
|
105
|
+
if (columns !== args.size) {
|
|
106
|
+
SetExceptionMessage(exception, `Square matrix has ${columns} columns, expected exactly ${args.size}`);
|
|
107
|
+
ThrowException(exception);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Validate exact row count constraint when explicitly specified
|
|
111
|
+
if (args.rows !== undefined && rows !== args.rows) {
|
|
112
|
+
SetExceptionMessage(exception, `Matrix has ${rows} rows, expected exactly ${args.rows}`);
|
|
113
|
+
ThrowException(exception);
|
|
114
|
+
}
|
|
115
|
+
// Validate exact column count constraint when explicitly specified
|
|
116
|
+
if (args.columns !== undefined && columns !== args.columns) {
|
|
117
|
+
SetExceptionMessage(exception, `Matrix has ${columns} columns, expected exactly ${args.columns}`);
|
|
118
|
+
ThrowException(exception);
|
|
119
|
+
}
|
|
120
|
+
// Validate minimum row count constraint (useful for operations requiring minimum dimensions)
|
|
121
|
+
if (args.minRows !== undefined && rows < args.minRows) {
|
|
122
|
+
SetExceptionMessage(exception, `Matrix has ${rows} rows, minimum required is ${args.minRows}`);
|
|
123
|
+
ThrowException(exception);
|
|
124
|
+
}
|
|
125
|
+
// Validate maximum row count constraint (useful for memory or performance limits)
|
|
126
|
+
if (args.maxRows !== undefined && rows > args.maxRows) {
|
|
127
|
+
SetExceptionMessage(exception, `Matrix has ${rows} rows, maximum allowed is ${args.maxRows}`);
|
|
128
|
+
ThrowException(exception);
|
|
129
|
+
}
|
|
130
|
+
// Validate minimum column count constraint (useful for operations requiring minimum dimensions)
|
|
131
|
+
if (args.minColumns !== undefined && columns < args.minColumns) {
|
|
132
|
+
SetExceptionMessage(exception, `Matrix has ${columns} columns, minimum required is ${args.minColumns}`);
|
|
133
|
+
ThrowException(exception);
|
|
134
|
+
}
|
|
135
|
+
// Validate maximum column count constraint (useful for memory or performance limits)
|
|
136
|
+
if (args.maxColumns !== undefined && columns > args.maxColumns) {
|
|
137
|
+
SetExceptionMessage(exception, `Matrix has ${columns} columns, maximum allowed is ${args.maxColumns}`);
|
|
138
|
+
ThrowException(exception);
|
|
139
|
+
}
|
|
140
|
+
// Validate square matrix constraint (required for operations like determinant, inverse, etc.)
|
|
141
|
+
if (args.square === true && rows !== columns) {
|
|
142
|
+
SetExceptionMessage(exception, `Matrix must be square but has ${rows} rows and ${columns} columns`);
|
|
143
|
+
ThrowException(exception);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Validates that an unknown value is a valid matrix row (array of numbers).
|
|
148
|
+
*
|
|
149
|
+
* This function ensures that the provided value is a proper matrix row,
|
|
150
|
+
* which should be an array containing only numeric values.
|
|
151
|
+
*
|
|
152
|
+
* @param row - The value to validate as a matrix row
|
|
153
|
+
* @param exception - Custom exception details if validation fails
|
|
154
|
+
* @param rowIndex - Optional row index for more descriptive error messages
|
|
155
|
+
* @throws {IAssertException} When the row is not a valid array of numbers
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* // Validate a matrix row
|
|
160
|
+
* AssertMatrixRow([1, 2, 3, 4]);
|
|
161
|
+
*
|
|
162
|
+
* // Validate with row index for better error messages
|
|
163
|
+
* AssertMatrixRow([1, 2, 3, 4], {}, 0);
|
|
164
|
+
*
|
|
165
|
+
* // This would throw an exception
|
|
166
|
+
* AssertMatrixRow([1, "2", 3]); // Contains non-numeric value
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export function AssertMatrixRow(row, exception = {}) {
|
|
170
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
171
|
+
SetExceptionClass(exception, MatrixError);
|
|
172
|
+
// First validation: ensure the input is an array
|
|
173
|
+
if (!Array.isArray(row)) {
|
|
174
|
+
const rowInfo = exception.rowIndex !== undefined ? ` at row ${exception.rowIndex}` : '';
|
|
175
|
+
SetExceptionMessage(exception, `Matrix row${rowInfo} must be an array`);
|
|
176
|
+
ThrowException(exception);
|
|
177
|
+
}
|
|
178
|
+
// Safe cast to array since we've verified it's an array
|
|
179
|
+
const rowArray = row;
|
|
180
|
+
// Second validation: ensure all elements are finite numbers
|
|
181
|
+
// This excludes NaN, Infinity, and -Infinity which are technically numbers but invalid for matrices
|
|
182
|
+
for (let i = 0; i < rowArray.length; i++) {
|
|
183
|
+
if (typeof rowArray[i] !== 'number' || !isFinite(rowArray[i])) {
|
|
184
|
+
const rowInfo = exception.rowIndex !== undefined ? ` at row ${exception.rowIndex}` : '';
|
|
185
|
+
SetExceptionMessage(exception, `Matrix row${rowInfo} element at index ${i} is not a finite number`);
|
|
186
|
+
ThrowException(exception);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Validates that an unknown value is a valid matrix element (finite number).
|
|
192
|
+
*
|
|
193
|
+
* This function ensures that the provided value is a proper matrix element,
|
|
194
|
+
* which should be a finite number (not NaN, Infinity, or -Infinity).
|
|
195
|
+
*
|
|
196
|
+
* @param value - The value to validate as a matrix element
|
|
197
|
+
* @param exception - Custom exception details if validation fails
|
|
198
|
+
* @param rowIndex - Optional row index for more descriptive error messages
|
|
199
|
+
* @param columnIndex - Optional column index for more descriptive error messages
|
|
200
|
+
* @throws {IAssertException} When the value is not a finite number
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* // Validate a matrix element
|
|
205
|
+
* AssertMatrixValue(42);
|
|
206
|
+
*
|
|
207
|
+
* // Validate with position information for better error messages
|
|
208
|
+
* AssertMatrixValue(3.14, {}, 0, 1);
|
|
209
|
+
*
|
|
210
|
+
* // This would throw an exception
|
|
211
|
+
* AssertMatrixValue(NaN); // Not a finite number
|
|
212
|
+
* AssertMatrixValue(Infinity); // Not a finite number
|
|
213
|
+
* AssertMatrixValue("5"); // Not a number
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
export function AssertMatrixValue(value, exception = {}) {
|
|
217
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
218
|
+
SetExceptionClass(exception, MatrixError);
|
|
219
|
+
// Build position information for error messages when row and column indices are available
|
|
220
|
+
// This provides more context about where the validation failure occurred
|
|
221
|
+
const position = exception.rowIndex !== undefined && exception.columnIndex !== undefined ? ` at row ${exception.rowIndex}, column ${exception.columnIndex}` : '';
|
|
222
|
+
SetExceptionMessage(exception, `Matrix value${position} must be a finite number`);
|
|
223
|
+
// Delegate to the general number assertion which handles finite number validation
|
|
224
|
+
AssertNumber(value, { finite: true }, exception);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Validates compatibility between two matrices for mathematical operations.
|
|
228
|
+
*
|
|
229
|
+
* This function checks that two matrices are compatible for operations like
|
|
230
|
+
* multiplication, addition, or other matrix operations that require specific
|
|
231
|
+
* dimensional relationships.
|
|
232
|
+
*
|
|
233
|
+
* @param a - The first matrix to validate
|
|
234
|
+
* @param b - The second matrix to validate
|
|
235
|
+
* @param args - Validation configuration options
|
|
236
|
+
* @param exception - Custom exception details if validation fails
|
|
237
|
+
* @throws {IAssertException} When the matrices are not compatible
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* // Validate matrices for multiplication (A columns must equal B rows)
|
|
242
|
+
* AssertMatrices(matrixA, matrixB);
|
|
243
|
+
*
|
|
244
|
+
* // Allow transposed compatibility
|
|
245
|
+
* AssertMatrices(matrixA, matrixB, { transposition: true });
|
|
246
|
+
* ```
|
|
247
|
+
*/
|
|
248
|
+
export function AssertMatrices(a, b, args = {}, exception = {}) {
|
|
249
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
250
|
+
SetExceptionClass(exception, MatrixError);
|
|
251
|
+
// First validation: ensure both inputs are valid matrices
|
|
252
|
+
AssertMatrix(a, {}, exception);
|
|
253
|
+
AssertMatrix(b, {}, exception);
|
|
254
|
+
// Safe cast to IMatrix since we've validated both inputs
|
|
255
|
+
const matrixA = a;
|
|
256
|
+
const matrixB = b;
|
|
257
|
+
// Extract dimensions from both matrices for compatibility checking
|
|
258
|
+
const rowsA = matrixA.length;
|
|
259
|
+
const columnsA = rowsA > 0 && matrixA[0] ? matrixA[0].length : 0;
|
|
260
|
+
const rowsB = matrixB.length;
|
|
261
|
+
const columnsB = rowsB > 0 && matrixB[0] ? matrixB[0].length : 0;
|
|
262
|
+
// Check compatibility based on whether transposition is allowed
|
|
263
|
+
if (args.transposition === true) {
|
|
264
|
+
// With transposition allowed, check all possible multiplication combinations:
|
|
265
|
+
// - A × B (standard): columns of A must equal rows of B
|
|
266
|
+
// - A × B^T (B transposed): columns of A must equal columns of B
|
|
267
|
+
// - A^T × B (A transposed): rows of A must equal rows of B
|
|
268
|
+
// - A^T × B^T (both transposed): rows of A must equal columns of B
|
|
269
|
+
const canMultiplyAB = columnsA === rowsB;
|
|
270
|
+
const canMultiplyABT = columnsA === columnsB;
|
|
271
|
+
const canMultiplyATB = rowsA === rowsB;
|
|
272
|
+
const canMultiplyATBT = rowsA === columnsB;
|
|
273
|
+
if (!canMultiplyAB && !canMultiplyABT && !canMultiplyATB && !canMultiplyATBT) {
|
|
274
|
+
SetExceptionMessage(exception, `Matrices are not compatible for multiplication even with transposition. Matrix A is ${rowsA}×${columnsA}, Matrix B is ${rowsB}×${columnsB}`);
|
|
275
|
+
ThrowException(exception);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
// Without transposition: matrices must have identical dimensions
|
|
280
|
+
// This is required for element-wise operations like addition and subtraction
|
|
281
|
+
if (rowsA !== rowsB || columnsA !== columnsB) {
|
|
282
|
+
SetExceptionMessage(exception, `Matrices must have identical dimensions for addition/subtraction. Matrix A is ${rowsA}×${columnsA}, Matrix B is ${rowsB}×${columnsB}`);
|
|
283
|
+
ThrowException(exception);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Validates that an unknown value is a valid 1x1 matrix.
|
|
289
|
+
*
|
|
290
|
+
* This function ensures that the provided value is a proper 1x1 matrix,
|
|
291
|
+
* which should be a 2D array with exactly 1 row and 1 column containing a number.
|
|
292
|
+
*
|
|
293
|
+
* @param matrix - The value to validate as a 1x1 matrix
|
|
294
|
+
* @param exception - Custom exception details if validation fails
|
|
295
|
+
* @throws {IAssertException} When the matrix is not a valid 1x1 matrix
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* // Validate a 1x1 matrix
|
|
300
|
+
* AssertMatrix1([[5]]);
|
|
301
|
+
*
|
|
302
|
+
* // This would throw an exception
|
|
303
|
+
* AssertMatrix1([[1, 2]]); // Too many columns
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
export function AssertMatrix1(matrix, exception = {}) {
|
|
307
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
308
|
+
SetExceptionClass(exception, MatrixError);
|
|
309
|
+
// Delegate to the general matrix assertion with 1x1 square matrix constraints
|
|
310
|
+
// This ensures the matrix is exactly 1 row by 1 column
|
|
311
|
+
AssertMatrix(matrix, { square: true, size: 1 }, exception);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Validates that an unknown value is a valid 2x2 matrix.
|
|
315
|
+
*
|
|
316
|
+
* This function ensures that the provided value is a proper 2x2 matrix,
|
|
317
|
+
* which should be a 2D array with exactly 2 rows and 2 columns containing numbers.
|
|
318
|
+
*
|
|
319
|
+
* @param matrix - The value to validate as a 2x2 matrix
|
|
320
|
+
* @param exception - Custom exception details if validation fails
|
|
321
|
+
* @throws {IAssertException} When the matrix is not a valid 2x2 matrix
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```typescript
|
|
325
|
+
* // Validate a 2x2 matrix
|
|
326
|
+
* AssertMatrix2([[1, 2], [3, 4]]);
|
|
327
|
+
*
|
|
328
|
+
* // This would throw an exception
|
|
329
|
+
* AssertMatrix2([[1, 2, 3], [4, 5, 6]]); // Too many columns
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
export function AssertMatrix2(matrix, exception = {}) {
|
|
333
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
334
|
+
SetExceptionClass(exception, MatrixError);
|
|
335
|
+
// Delegate to the general matrix assertion with 2x2 square matrix constraints
|
|
336
|
+
// This ensures the matrix is exactly 2 rows by 2 columns
|
|
337
|
+
AssertMatrix(matrix, { square: true, size: 2 }, exception);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Validates that an unknown value is a valid 3x3 matrix.
|
|
341
|
+
*
|
|
342
|
+
* This function ensures that the provided value is a proper 3x3 matrix,
|
|
343
|
+
* which should be a 2D array with exactly 3 rows and 3 columns containing numbers.
|
|
344
|
+
*
|
|
345
|
+
* @param matrix - The value to validate as a 3x3 matrix
|
|
346
|
+
* @param exception - Custom exception details if validation fails
|
|
347
|
+
* @throws {IAssertException} When the matrix is not a valid 3x3 matrix
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* ```typescript
|
|
351
|
+
* // Validate a 3x3 matrix
|
|
352
|
+
* AssertMatrix3([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);
|
|
353
|
+
*
|
|
354
|
+
* // This would throw an exception
|
|
355
|
+
* AssertMatrix3([[1, 2], [3, 4]]); // Too few rows and columns
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
358
|
+
export function AssertMatrix3(matrix, exception = {}) {
|
|
359
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
360
|
+
SetExceptionClass(exception, MatrixError);
|
|
361
|
+
// Delegate to the general matrix assertion with 3x3 square matrix constraints
|
|
362
|
+
// This ensures the matrix is exactly 3 rows by 3 columns
|
|
363
|
+
AssertMatrix(matrix, { square: true, size: 3 }, exception);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Validates that an unknown value is a valid 4x4 matrix.
|
|
367
|
+
*
|
|
368
|
+
* This function ensures that the provided value is a proper 4x4 matrix,
|
|
369
|
+
* which should be a 2D array with exactly 4 rows and 4 columns containing numbers.
|
|
370
|
+
*
|
|
371
|
+
* @param matrix - The value to validate as a 4x4 matrix
|
|
372
|
+
* @param exception - Custom exception details if validation fails
|
|
373
|
+
* @throws {IAssertException} When the matrix is not a valid 4x4 matrix
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```typescript
|
|
377
|
+
* // Validate a 4x4 matrix
|
|
378
|
+
* AssertMatrix4([
|
|
379
|
+
* [1, 2, 3, 4],
|
|
380
|
+
* [5, 6, 7, 8],
|
|
381
|
+
* [9, 10, 11, 12],
|
|
382
|
+
* [13, 14, 15, 16]
|
|
383
|
+
* ]);
|
|
384
|
+
*
|
|
385
|
+
* // This would throw an exception
|
|
386
|
+
* AssertMatrix4([[1, 2], [3, 4]]); // Too few rows and columns
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
export function AssertMatrix4(matrix, exception = {}) {
|
|
390
|
+
// Initialize the exception with the default MatrixError class if not provided
|
|
391
|
+
SetExceptionClass(exception, MatrixError);
|
|
392
|
+
// Delegate to the general matrix assertion with 4x4 square matrix constraints
|
|
393
|
+
// This ensures the matrix is exactly 4 rows by 4 columns
|
|
394
|
+
AssertMatrix(matrix, { square: true, size: 4 }, exception);
|
|
395
|
+
}
|
|
396
|
+
//# sourceMappingURL=asserts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asserts.js","sourceRoot":"","sources":["../../src/matrices/asserts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEnJ,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AA2FvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACrC;;;;OAIG;IACH,YAAY,OAAgB;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,yDAAyD;QACzD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;CACD;AAED;;;;;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