public abstract class ASparseVector extends ASizedVector implements ISparseVector
length| Modifier | Constructor and Description |
|---|---|
protected |
ASparseVector(int length) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
add(ASparseVector v) |
void |
add(AVector v)
Adds another vector to this one
|
void |
addMultiple(AVector src,
double factor)
Adds a scaled multiple of another vector to this vector
|
AVector |
clone()
Clones the vector, creating a new mutable copy of all data.
|
void |
copyTo(int offset,
double[] destData,
int destOffset,
int length)
Copies a subset of this vector to a specified destination array offset
|
void |
copyTo(int offset,
double[] destData,
int destOffset,
int length,
int stride)
Copies a subset of this vector to a specified destination array offset
using the given stride.
|
double |
distanceL1(AVector v)
Returns the distance from this vector to another vector according to the L1 (Taxicab) norm.
|
double |
distanceLinf(AVector v)
Returns the distance from this vector to another vector according to the Linf norm.
|
double |
distanceSquared(AVector v)
Returns the squared Euclidean distance to another vector.
|
double |
dotProduct(ADenseArrayVector v)
Returns the dot product of this vector with a target ADenseArrayVector.
|
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 |
elementAbsPowSum(double p)
Returns the sum of the absolute values of all the elements raised to a specified power
|
double |
elementPowSum(double p)
Returns the sum of all the elements raised to a specified power
|
double |
elementProduct()
Returns the product of all elements in the array.
|
double |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
boolean |
equals(ASparseVector v) |
boolean |
equals(AVector v) |
List<Double> |
getSlices()
Returns a list of all major slices of this array.
|
boolean |
hasUncountable()
Returns true if any element is this array is NaN or infinite
|
abstract boolean |
includesIndex(int i)
Returns true iff the sparse vector contains the index i
|
AVector |
innerProduct(AMatrix m)
Computes the inner product of this vector with a matrix
|
boolean |
isSparse()
Returns true if the array is in a sparse format
|
boolean |
isView()
Returns true if this vector is of a view type that references other vectors / data.
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
abstract int |
nonSparseElementCount()
Returns the number of non-sparse elements in the sparse vector.
|
abstract Index |
nonSparseIndex()
Returns an Index indicating which elements of this vector are defined as non-sparse.
|
abstract AVector |
nonSparseValues()
Returns the non-sparse elements as a compacted vector
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
double |
reduce(Op2 op)
Reduces over all elements of the array in row-major order.
|
double |
reduce(Op2 op,
double init)
Reduces over all elements of the array in row-major order.
|
AVector |
reduceSlices(Op2 op,
double init)
Reduces each slice of the array by the given operator
Uses the specified init value for reduction of each slice
|
ASparseVector |
roundToZero(double precision)
Returns a vector after replacing all elements with absolute values less-than-or-equal to precision with zeros.
|
ASparseVector |
sparse()
Coerces this INDArray to a sparse format, without changing its element values.
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
SparseIndexedVector |
toSparseIndexedVector()
Coerces this vector to a SparseIndexedVector.
|
checkIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountabs, absCopy, add, add, add, add, add, add, add, add, addAt, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addMultipleToArray, addPower, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addToArray, addToArray, 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, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, divide, divide, divide, divide, divideCopy, divideCopy, divideTo, dotProduct, dotProduct, dotProduct, elementIterator, elementMax, elementMin, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, exactClone, fill, fillRange, get, get, get, get, get, getElements, getElements, getElements, getLongShape, getShape, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isMutable, isRangeZero, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, nonZeroIndices, 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, set, set, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, signum, slice, slice, sliceValue, softmax, softmaxCopy, sparseClone, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoin, unsafeGet, unsafeSet, validateadd, 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, get, isSameShape, length, multiplyCopy, normalise, normaliseCopy, rotateCopy, rotateView, set, 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, elementMax, elementMin, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, equalsArray, exactClone, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isElementConstrained, isFullyMutable, isMutable, isSameShape, join, join, log, multiply, 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, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, toVector, validate, withComponentsforEach, spliteratorpublic abstract int nonSparseElementCount()
public abstract AVector nonSparseValues()
ISparseVectornonSparseValues in interface ISparseVectorpublic abstract Index nonSparseIndex()
AVectornonSparseIndex in interface ISparseVectornonSparseIndex in class AVectorpublic abstract boolean includesIndex(int i)
i - public ASparseVector roundToZero(double precision)
precision - public void copyTo(int offset,
double[] destData,
int destOffset,
int length)
AVectorpublic void copyTo(int offset,
double[] destData,
int destOffset,
int length,
int stride)
AVectorpublic boolean isZero()
AVectorpublic boolean isView()
AVectorpublic double reduce(Op2 op, double init)
INDArraypublic double reduce(Op2 op)
INDArraypublic final AVector reduceSlices(Op2 op, double init)
INDArrayreduceSlices in interface INDArrayreduceSlices in class AVectorpublic double distanceSquared(AVector v)
AVectordistanceSquared in class AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class AVectorpublic final double dotProduct(ADenseArrayVector v)
AVectordotProduct in class AVectorpublic AVector innerProduct(AMatrix m)
AVectorinnerProduct in class AVectorpublic final boolean isSparse()
INDArrayisSparse in interface INDArrayisSparse in class AbstractArray<Double>public void add(AVector v)
AVectorpublic void addMultiple(AVector src, double factor)
AVectoraddMultiple in class AVectorpublic abstract void add(ASparseVector v)
public List<Double> getSlices()
INDArraypublic double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AVectorpublic ASparseVector sparse()
INDArraypublic AVector clone()
AVectorpublic boolean equals(ASparseVector v)
public double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AVectorpublic boolean hasUncountable()
AbstractArrayhasUncountable in interface INDArrayhasUncountable in class AVectorpublic double elementPowSum(double p)
elementPowSum in interface INDArrayelementPowSum in class AVectorpublic double elementAbsPowSum(double p)
elementAbsPowSum in interface INDArrayelementAbsPowSum in class AVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AVectorpublic double distanceL1(AVector v)
AVectordistanceL1 in class AVectorpublic double distanceLinf(AVector v)
AVectordistanceLinf in class AVectorpublic SparseIndexedVector toSparseIndexedVector()
ISparseVectortoSparseIndexedVector in interface ISparseVectorCopyright © 2016. All rights reserved.