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

Method mutableAdd

JSAT/src/jsat/linear/SparseVector.java:554–566  ·  view source on GitHub ↗
(double c)

Source from the content-addressed store, hash-verified

552 }
553
554 @Override
555 public void mutableAdd(double c)
556 {
557 if(c == 0.0)
558 return;
559 clearCaches();
560 /* This NOT the most efficient way to implement this.
561 * But adding a constant to every value in a sparce
562 * vector defeats its purpos.
563 */
564 for(int i = 0; i < length(); i++)
565 this.set(i, get(i) + c);
566 }
567
568 @Override
569 public void mutableAdd(double c, Vec v)

Callers 1

testCloneMethod · 0.95

Calls 11

clearCachesMethod · 0.95
lengthMethod · 0.95
setMethod · 0.95
getMethod · 0.95
getIndexMethod · 0.95
getValueMethod · 0.95
isSparseMethod · 0.45
nnzMethod · 0.45
getNonZeroIteratorMethod · 0.45
nextMethod · 0.45
hasNextMethod · 0.45

Tested by 1

testCloneMethod · 0.76