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

Method getThisSide

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

Returns a suitable vector that can be altered for some function of the form a op b, where a = this @param other the other vector. May be null @return the mutable vector

(Vec other)

Source from the content-addressed store, hash-verified

69 * @return the mutable vector
70 */
71 private Vec getThisSide(Vec other)
72 {
73 if (this.canBeMutated())
74 return this.clone();
75 if (other == null)
76 if (this.isSparse())
77 return new SparseVector(this);
78 else
79 return new DenseVector(this);
80 if (this.isSparse() && other.isSparse())
81 return new SparseVector(this);
82 else
83 return new DenseVector(this);
84 }
85
86 /**
87 * Computes the number of non zero values in this vector

Callers 7

addMethod · 0.95
subtractMethod · 0.95
pairwiseMultiplyMethod · 0.95
multiplyMethod · 0.95
pairwiseDivideMethod · 0.95
divideMethod · 0.95
normalizedMethod · 0.95

Calls 3

canBeMutatedMethod · 0.95
cloneMethod · 0.95
isSparseMethod · 0.95

Tested by

no test coverage detected