* Maximum value of each component in this attribute. Values returned by this method do not * reflect normalization: use .getMinNormalized in that case.
(target: number[])
| 278 | * reflect normalization: use {@link .getMinNormalized} in that case. |
| 279 | */ |
| 280 | public getMax(target: number[]): number[] { |
| 281 | const array = this.get('array'); |
| 282 | const count = this.getCount(); |
| 283 | const elementSize = this.getElementSize(); |
| 284 | |
| 285 | for (let j = 0; j < elementSize; j++) target[j] = -Infinity; |
| 286 | |
| 287 | for (let i = 0; i < count * elementSize; i += elementSize) { |
| 288 | for (let j = 0; j < elementSize; j++) { |
| 289 | const value = array![i + j]; |
| 290 | if (Number.isFinite(value)) { |
| 291 | target[j] = Math.max(target[j], value); |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | return target; |
| 297 | } |
| 298 | |
| 299 | /********************************************************************************************** |
| 300 | * Layout. |
no test coverage detected