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

Method get

JSAT/src/jsat/linear/SparseVector.java:221–233  ·  view source on GitHub ↗
(int index)

Source from the content-addressed store, hash-verified

219 }
220
221 @Override
222 public double get(int index)
223 {
224 if (index > length - 1 || index < 0)
225 throw new ArithmeticException("Can not access an index larger then the vector or a negative index");
226
227 int location = Arrays.binarySearch(indexes, 0, used, index);
228
229 if (location < 0)
230 return 0.0;
231 else
232 return values[location];
233 }
234
235 @Override
236 public void set(int index, double val)

Callers 9

mutableAddMethod · 0.95
getNearbyMethod · 0.95
pdfMethod · 0.95
SparseVectorMethod · 0.45
dotMethod · 0.45
multiplyMethod · 0.45
pNormDistMethod · 0.45
mutablePairwiseDivideMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected