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

Method setLength

JSAT/src/jsat/linear/SparseVector.java:171–176  ·  view source on GitHub ↗

Because sparce vectors do not have most value set, they can have their length increased, and sometimes decreased, without any effort. The length can always be extended. The length can be reduced down to the size of the largest non zero element. @param length the new length of this vector

(int length)

Source from the content-addressed store, hash-verified

169 * @param length the new length of this vector
170 */
171 public void setLength(int length)
172 {
173 if(used > 0 && length < indexes[used-1])
174 throw new RuntimeException("Can not set the length to a value less then an index already in use");
175 this.length = length;
176 }
177
178 @Override
179 public int nnz()

Callers 10

changeSizeMethod · 0.95
loadGMethod · 0.95
testSetLengthMethod · 0.45
readCSVMethod · 0.45
addOriginalDocumentMethod · 0.45
addWordMethod · 0.45
finishAddingMethod · 0.45
addOriginalDocumentMethod · 0.45
tokenizeMethod · 0.45
tokenizeMethod · 0.45

Calls

no outgoing calls

Tested by 1

testSetLengthMethod · 0.36