public class Poly2Vec extends Vec
N
non zero values, then this vec will have
O(N2) non zero values. (N+2)(N+1)/2 non zero values to be exact.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
|
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
|
void |
setBase(Vec base)
Creates a new vector that implicitly represents the degree 2 polynomial
of the base 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, 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 Poly2Vec(Vec base)
public void setBase(Vec base)
base
- the base vectorpublic int length()
Vec
public int nnz()
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.