MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / copyTo

Method copyTo

JSAT/src/jsat/linear/SparseVector.java:462–485  ·  view source on GitHub ↗
(Vec destination)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

clearCachesMethod · 0.95
copyOfMethod · 0.80

Tested by

no test coverage detected