(Vec destination)
| 460 | } |
| 461 | |
| 462 | @Override |
| 463 | public void copyTo(Vec destination) |
| 464 | { |
| 465 | if(destination instanceof SparseVector) |
| 466 | { |
| 467 | SparseVector other = (SparseVector) destination; |
| 468 | if(other.indexes.length < this.used) |
| 469 | { |
| 470 | other.indexes = Arrays.copyOf(this.indexes, this.used); |
| 471 | other.values = Arrays.copyOf(this.values, this.used); |
| 472 | other.used = this.used; |
| 473 | other.clearCaches(); |
| 474 | } |
| 475 | else |
| 476 | { |
| 477 | other.used = this.used; |
| 478 | other.clearCaches(); |
| 479 | System.arraycopy(this.indexes, 0, other.indexes, 0, this.used); |
| 480 | System.arraycopy(this.values, 0, other.values, 0, this.used); |
| 481 | } |
| 482 | } |
| 483 | else |
| 484 | super.copyTo(destination); |
| 485 | } |
| 486 | |
| 487 | @Override |
| 488 | public double dot(Vec v) |
nothing calls this directly
no test coverage detected