()
| 531 | |
| 532 | |
| 533 | public int maxIndex() { |
| 534 | checkMinMax("maxIndex"); |
| 535 | double m; |
| 536 | int mi = -1; |
| 537 | for (int i = 0; i < count; i++) { |
| 538 | // find one good value to start |
| 539 | if (data[i] == data[i]) { |
| 540 | m = data[i]; |
| 541 | mi = i; |
| 542 | |
| 543 | // calculate the rest |
| 544 | for (int j = i+1; j < count; j++) { |
| 545 | double d = data[j]; |
| 546 | if (!Double.isNaN(d) && (d > m)) { |
| 547 | m = data[j]; |
| 548 | mi = j; |
| 549 | } |
| 550 | } |
| 551 | break; |
| 552 | } |
| 553 | } |
| 554 | return mi; |
| 555 | } |
| 556 | |
| 557 | |
| 558 | public double sum() { |