public class IndexedSparseVector extends SparseVector implements Serializable
hasInfinite, indices, values| Constructor and Description |
|---|
IndexedSparseVector()
Create an empty vector
|
IndexedSparseVector(int[] featureIndices)
Create binary vector
|
IndexedSparseVector(int[] featureIndices,
double[] values)
Create non-binary vector, possibly dense if "featureIndices" or possibly sparse, if not
|
IndexedSparseVector(int[] indices,
double[] values,
int capacity,
int size,
boolean copy,
boolean checkIndicesSorted,
boolean removeDuplicates) |
| Modifier and Type | Method and Description |
|---|---|
ConstantMatrix |
cloneMatrix()
CLONING
|
ConstantMatrix |
cloneMatrixZeroed() |
void |
columnPlusEquals(int index,
double value) |
double |
dotProduct(DenseVector v) |
double |
dotProduct(SparseVector v) |
void |
indexVector() |
int |
location(int index) |
void |
plusEqualsSparse(SparseVector v)
For each index i that is present in this vector,
set this[i] += v[i].
|
void |
plusEqualsSparse(SparseVector v,
double factor)
For each index i that is present in this vector,
set this[i] += factor * v[i].
|
void |
setAll(double v)
Sets every present index in the vector to v.
|
void |
setValue(int index,
double value)
Sets the value at the given index.
|
void |
setValueAtLocation(int location,
double value)
Sets the value at the given location.
|
absNorm, addTo, addTo, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, indexAtLocation, infinityNorm, isBinary, isNaN, makeBinary, makeNonBinary, map, numLocations, oneNorm, print, removeDuplicates, singleIndex, singleSize, singleToIndices, singleValue, sortIndices, timesEquals, timesEqualsSparse, timesEqualsSparse, toString, toString, twoNorm, value, value, valueAtLocation, vectorAddpublic IndexedSparseVector(int[] indices,
double[] values,
int capacity,
int size,
boolean copy,
boolean checkIndicesSorted,
boolean removeDuplicates)
public IndexedSparseVector()
public IndexedSparseVector(int[] featureIndices,
double[] values)
public IndexedSparseVector(int[] featureIndices)
public ConstantMatrix cloneMatrix()
SparseVectorcloneMatrix in interface ConstantMatrixcloneMatrix in class SparseVectorpublic ConstantMatrix cloneMatrixZeroed()
cloneMatrixZeroed in class SparseVectorpublic void indexVector()
public final void setValue(int index,
double value)
SparseVectorsetValue in class SparseVectorpublic final void setValueAtLocation(int location,
double value)
SparseVectorsetValueAtLocation in class SparseVectorpublic void columnPlusEquals(int index,
double value)
public final double dotProduct(DenseVector v)
dotProduct in class SparseVectorpublic final double dotProduct(SparseVector v)
dotProduct in class SparseVectorpublic final void plusEqualsSparse(SparseVector v, double factor)
SparseVectorplusEqualsSparse in class SparseVectorpublic final void plusEqualsSparse(SparseVector v)
SparseVectorplusEqualsSparse in class SparseVectorpublic final void setAll(double v)
SparseVectorsetAll in class SparseVectorpublic int location(int index)
location in interface ConstantMatrixlocation in class SparseVectorCopyright © 2019 JULIE Lab, Germany. All rights reserved.