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

Method copyTo

JSAT/src/jsat/linear/Vec.java:626–641  ·  view source on GitHub ↗

Copies the values of this Vector into another vector @param destination the vector to store the values in. @throws ArithmeticException if the vectors are not of the same length

(Vec destination)

Source from the content-addressed store, hash-verified

624 * @throws ArithmeticException if the vectors are not of the same length
625 */
626 public void copyTo(Vec destination)
627 {
628 if(this.length() != destination.length())
629 throw new ArithmeticException("Source and destination must be the same size");
630 if (this.isSparse())
631 {
632 destination.zeroOut();
633 for (IndexValue iv : this)
634 destination.set(iv.getIndex(), iv.getValue());
635 }
636 else
637 {
638 for (int i = 0; i < length(); i++)
639 destination.set(i, this.get(i));
640 }
641 }
642
643 /**
644 * Copies the values of this vector into a row of another Matrix

Callers 15

changeSizeMethod · 0.95
covarianceMatrixMethod · 0.95
feedForwardMethod · 0.95
trainCMethod · 0.95
clusterMethod · 0.95
mStepMethod · 0.95
runMethod · 0.95
clusterMethod · 0.95
fitMethod · 0.95
mutableTransformMethod · 0.95
runMethod · 0.95
optimizeMethod · 0.95

Calls 7

lengthMethod · 0.95
isSparseMethod · 0.95
getMethod · 0.95
zeroOutMethod · 0.45
setMethod · 0.45
getIndexMethod · 0.45
getValueMethod · 0.45

Tested by 3

testCluster_WeightedMethod · 0.36
testCluster_WeightedMethod · 0.36
testCluster_WeightedMethod · 0.36