public class SubVector extends Vec
Constructor and Description |
---|
SubVector(int startPosition,
int length,
Vec vec)
Creates a new sub vector of the input vector
|
Modifier and Type | Method and Description |
---|---|
Vec |
clone() |
double |
get(int index)
Gets the value stored at a specific index in the vector
|
Iterator<IndexValue> |
getNonZeroIterator(int start)
Returns an iterator that will go over the non zero values starting from
the specified index in the given vector.
|
boolean |
isSparse()
Indicates whether or not this vector is optimized for sparce computation,
meaning that most values in the vector are zero - and considered
implicit.
|
int |
length()
Returns the length of this vector
|
void |
set(int index,
double val)
Sets the value stored at a specified index in the vector
|
add, add, applyFunction, applyIndexFunction, arrayCopy, canBeMutated, copyTo, copyToCol, copyToRow, countNaNs, divide, dot, equals, equals, getNonZeroIterator, hashCode, increment, iterator, kurtosis, max, mean, median, min, multiply, multiply, multiply, multiply, mutableAdd, mutableAdd, mutableAdd, mutableDivide, mutableMultiply, mutablePairwiseDivide, mutablePairwiseMultiply, mutableSubtract, mutableSubtract, mutableSubtract, nnz, normalize, normalized, pairwiseDivide, pairwiseMultiply, pNorm, pNormDist, random, random, skewness, sortedCopy, standardDeviation, subtract, subtract, sum, toString, variance, zeroOut, zeros
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public SubVector(int startPosition, int length, Vec vec)
startPosition
- the starting index (inclusive) or the original
vectorlength
- the length of the new sub vectorvec
- the original vector to back this sub vector.public int length()
Vec
public double get(int index)
Vec
public void set(int index, double val)
Vec
public boolean isSparse()
Vec
public Iterator<IndexValue> getNonZeroIterator(int start)
Vec
Iterator.remove()
method.
getNonZeroIterator
in class Vec
start
- the first index (inclusive) to start returning non-zero
values fromCopyright © 2017. All rights reserved.