| 10 | * and to emit a warning when lengths do not match. |
| 11 | */ |
| 12 | const prioritizeSmallerDimension = function (currentVectorDimension, args) { |
| 13 | const resultDimension = Math.min(currentVectorDimension, args.length); |
| 14 | if (Array.isArray(args) && currentVectorDimension !== args.length) { |
| 15 | console.warn( |
| 16 | 'When working with two vectors of different sizes, the smaller dimension is used. In this operation, both vector will be treated as ' + resultDimension + 'D vectors, and any additional values of the linger vector will be ignored.' |
| 17 | ); |
| 18 | } |
| 19 | return resultDimension; |
| 20 | }; |
| 21 | |
| 22 | /** |
| 23 | * @private |