public class ConcatenatedVec extends Vec
Constructor and Description |
---|
ConcatenatedVec(List<Vec> vecs)
Creates a new Vector that is the concatenation of the given vectors in
the given order.
|
ConcatenatedVec(Vec... vecs)
Creates a new Vector that is the concatenation of the given vectors in
the given order.
|
Modifier and Type | Method and Description |
---|---|
ConcatenatedVec |
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.
|
void |
increment(int index,
double val)
Increments the value stored at a specified index in the 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 |
mutableAdd(double c,
Vec b)
Alters this vector such that
this = this + c * b
This method should be overloaded for a serious implementation. |
int |
nnz()
Computes the number of non zero values in 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, iterator, kurtosis, max, mean, median, min, multiply, multiply, multiply, multiply, mutableAdd, mutableAdd, mutableDivide, mutableMultiply, mutablePairwiseDivide, mutablePairwiseMultiply, mutableSubtract, mutableSubtract, mutableSubtract, 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 ConcatenatedVec(List<Vec> vecs)
vecs
- the list of vectors to concatenatepublic ConcatenatedVec(Vec... vecs)
vecs
- the array of vectors to concatenatepublic int length()
Vec
public double get(int index)
Vec
public void set(int index, double val)
Vec
public void increment(int index, double val)
Vec
public int nnz()
Vec
public void mutableAdd(double c, Vec b)
Vec
mutableAdd
in class Vec
c
- a scalar constantb
- the vector to add to thispublic Iterator<IndexValue> getNonZeroIterator(int start)
Vec
Iterator.remove()
method.
getNonZeroIterator
in class Vec
start
- the first index (inclusive) to start returning non-zero
values frompublic boolean isSparse()
Vec
public ConcatenatedVec clone()
Copyright © 2017. All rights reserved.