public class SparseHashedVector extends ASparseVector
length| Modifier and Type | Method and Description |
|---|---|
void |
add(ASparseVector v) |
void |
addAt(int i,
double value)
Adds a value to a specific element of the vector
This function does not perform bounds checking, i.e.
|
void |
addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
Adds a multiple of a subvector of this vector into a double array at the specified offset
|
void |
addProductToArray(double factor,
int offset,
ADenseArrayVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
Adds the scaled elementwise product of this vector and another vector to the destimation array
|
void |
addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length) |
void |
addToArray(double[] dest,
int offset,
int stride)
Adds this vector to a double[] array, using the specified offset and stride into the destination array
|
void |
addToArray(int offset,
double[] array,
int arrayOffset,
int length)
Adds a subvector of this vector into a double array at the specified offset
|
SparseIndexedVector |
clone()
Clones the vector, creating a new mutable copy of all data.
|
void |
copySparseValuesTo(double[] array,
int offset) |
void |
copyTo(AVector v,
int offset)
Copies a the contents of a vector to a vector at the specified offset
|
static SparseHashedVector |
create(AVector v)
Creates a SparseHashedVector with the specified values
|
static SparseHashedVector |
create(int length,
Index index,
Vector values)
Create a SparseHashedVector with specified non-zero indexes and values.
|
static AVector |
createFromRow(AMatrix m,
int row)
Creates a SparseIndexedVector from a row of an existing matrix
|
static SparseHashedVector |
createLength(int length) |
double |
dotProduct(AVector v)
Returns the dot product of this vector with another vector
The vectors must have the same length: if not the result is undefined
|
double |
dotProduct(double[] data,
int offset)
Fast dot product with a double[] array.
|
double |
dotProduct(double[] data,
int offset,
int stride)
Fast dot product with a double[] array and a stride.
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
boolean |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
SparseHashedVector |
exactClone()
Returns an exact clone of this vector, i.e.
|
double |
get(int i)
Returns the double value at the specified position in a 1D vector
|
void |
getElements(double[] array,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
boolean |
includesIndex(int i)
Returns true iff the sparse vector contains the index i
|
boolean |
isElementConstrained()
Returns true if this array has some constraints on element values
|
boolean |
isFullyMutable()
Returns true if this vector is fully mutable, i.e.
|
boolean |
isMutable()
Returns true if this vector is mutable.
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
double |
maxAbsElement()
Returns the maximum absolute element value of a vector
|
int |
maxAbsElementIndex()
Returns the index of the maximum absolute element of a vector
|
int |
maxElementIndex()
Returns the index of the maximum element of a vector
|
int |
minElementIndex()
Returns the index of the minimum element of a vector
|
void |
multiply(double d)
Multiplies the vector by a constant factor
|
int |
nonSparseElementCount()
Returns the number of non-sparse elements in the sparse vector.
|
Index |
nonSparseIndex()
Returns an Index indicating which elements of this vector are defined as non-sparse.
|
Vector |
nonSparseValues()
Returns the non-sparse elements as a compacted vector
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
int[] |
nonZeroIndices()
Return an int array specifying the positions in this vector which are non-zero
|
void |
set(AVector v)
Sets the vector to equal the value of another vector
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
set(SparseHashedVector v) |
SparseIndexedVector |
sparseClone()
Clones the vector into a sparse mutable format
|
double |
unsafeGet(int i) |
void |
unsafeSet(int i,
double value) |
void |
validate()
Validates the internal data structure of the INDArray.
|
add, addMultiple, copyTo, copyTo, distanceL1, distanceLinf, distanceSquared, dotProduct, elementAbsPowSum, elementPowSum, elementProduct, equals, equals, getSlices, hasUncountable, innerProduct, isSparse, isView, reduce, reduce, reduceSlices, roundToZero, sparse, toDoubleArray, toSparseIndexedVectorcheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountabs, absCopy, add, add, add, add, add, add, add, add, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addPower, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, checkDimension, checkSameLength, clamp, clampMax, clampMin, compareTo, copy, copyTo, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, divide, divide, divide, divide, divideCopy, divideCopy, divideTo, dotProduct, elementIterator, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, fill, fillRange, get, get, get, get, getElements, getElements, getLongShape, getShape, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isRangeZero, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxElement, minElement, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, selectView, set, set, set, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, signum, slice, slice, sliceValue, softmax, softmaxCopy, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoinadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, density, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, reciprocal, reciprocalCopy, scale, set, set, signumCopy, sqrt, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitaddCopy, divideCopy, epsilonEquals, isSameShape, length, multiplyCopy, normalise, normaliseCopy, rotateCopy, rotateView, shiftCopy, sqrtCopy, subCopyabs, absCopy, add, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, addToArray, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementCount, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isSameShape, join, join, log, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, outerProduct, pow, reciprocal, reciprocalCopy, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, slice, sliceCount, sliceValue, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, toVector, withComponentsforEach, spliteratorpublic static SparseHashedVector create(AVector v)
public static SparseHashedVector create(int length, Index index, Vector values)
public static SparseHashedVector createLength(int length)
public static AVector createFromRow(AMatrix m, int row)
public int nonSparseElementCount()
ASparseVectornonSparseElementCount in class ASparseVectorpublic boolean isZero()
AVectorisZero in interface INDArrayisZero in class ASparseVectorpublic boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArrayisElementConstrained in class AVectorpublic double get(int i)
INDArraypublic boolean isFullyMutable()
AVectorisFullyMutable in interface INDArrayisFullyMutable in class AVectorpublic boolean isMutable()
AVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class ASparseVectorpublic void multiply(double d)
AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class ASparseVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AVectorpublic double dotProduct(double[] data,
int offset,
int stride)
AVectordotProduct in class AVectorpublic void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddMultipleToArray in class AVectorpublic void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddToArray in class AVectorpublic void addToArray(double[] dest,
int offset,
int stride)
AVectoraddToArray in class AVectorpublic void addProductToArray(double factor,
int offset,
AVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
addProductToArray in class AVectorpublic void addProductToArray(double factor,
int offset,
ADenseArrayVector other,
int otherOffset,
double[] array,
int arrayOffset,
int length)
AVectoraddProductToArray in class AVectorpublic void getElements(double[] array,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic void copySparseValuesTo(double[] array,
int offset)
public void copyTo(AVector v, int offset)
AVectorpublic void set(int i,
double value)
INDArraypublic void set(AVector v)
AVectorpublic void set(SparseHashedVector v)
public void addAt(int i,
double value)
AVectorpublic double maxAbsElement()
AVectormaxAbsElement in class AVectorpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AVectorpublic double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AVectorpublic int maxElementIndex()
AVectormaxElementIndex in class AVectorpublic int maxAbsElementIndex()
AVectormaxAbsElementIndex in class AVectorpublic int minElementIndex()
AVectorminElementIndex in class AVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class ASparseVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class ASparseVectorpublic Vector nonSparseValues()
ISparseVectornonSparseValues in interface ISparseVectornonSparseValues in class ASparseVectorpublic int[] nonZeroIndices()
AVectornonZeroIndices in class AVectorpublic Index nonSparseIndex()
AVectornonSparseIndex in interface ISparseVectornonSparseIndex in class ASparseVectorpublic boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseVectorpublic void add(ASparseVector v)
add in class ASparseVectorpublic boolean equalsArray(double[] data,
int offset)
AVectorequalsArray in interface INDArrayequalsArray in class ASizedVectordata - Array of double element values to check for equalityoffset - Offset into the data arraypublic SparseIndexedVector clone()
AVectorpublic SparseHashedVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorpublic SparseIndexedVector sparseClone()
AVectorsparseClone in interface INDArraysparseClone in class AVectorpublic void validate()
INDArrayCopyright © 2016. All rights reserved.