public abstract class ASparseIndexedVector extends ASparseVector
length| Constructor and Description |
|---|
ASparseIndexedVector(int length) |
| Modifier and Type | Method and Description |
|---|---|
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)
Adds this vector to a double[] array, starting at the specified offset.
|
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 |
cloneIncludingIndices(int[] ixs)
Create a clone of this sparse indexed vector including the new indexes specified
Intended to allow fast subsequent modification
|
protected void |
copySparseValuesTo(double[] array,
int offset)
Copy only the sparse values in this vector to a target array.
|
void |
copyTo(AVector v,
int offset)
Copies a the contents of a vector to a vector at the specified offset
|
double |
dotProduct(ASparseVector v) |
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 |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
boolean |
equals(AVector v) |
boolean |
equalsArray(double[] ds,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
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
|
AVector |
innerProduct(AMatrix a)
Computes the inner product of this vector with a matrix
|
boolean |
isRangeZero(int start,
int length)
Returns true if a sub-vector range is completely zero.
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
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
|
add, add, addMultiple, clone, copyTo, copyTo, distanceL1, distanceLinf, distanceSquared, dotProduct, elementAbsPowSum, elementPowSum, elementProduct, equals, getSlices, hasUncountable, isSparse, isView, nonSparseElementCount, nonSparseIndex, nonSparseValues, 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, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addPower, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, 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, elementMax, elementMin, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, exactClone, fill, fillRange, get, get, get, get, get, getElements, getElements, getLongShape, getShape, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isMutable, isSameShape, isUnitLengthVector, isUnitLengthVector, iterator, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, 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, 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, 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, exactClone, 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, isElementConstrained, isFullyMutable, isMutable, 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, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, toVector, validate, withComponentsforEach, spliteratorpublic boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseVectorpublic boolean isZero()
AVectorisZero in interface INDArrayisZero in class ASparseVectorpublic boolean isRangeZero(int start,
int length)
AVectorisRangeZero in class AVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class ASparseVectorpublic void multiply(double factor)
AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class ASparseVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount 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 AVector innerProduct(AMatrix a)
AVectorinnerProduct in class ASparseVectorpublic final double dotProduct(AVector v)
AVectordotProduct in class ASparseVectorpublic final double dotProduct(ASparseVector v)
public int[] nonZeroIndices()
AVectornonZeroIndices in class AVectorpublic void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddToArray in class AVectorpublic void addToArray(double[] dest,
int offset)
AVectoraddToArray in interface INDArrayaddToArray in class AVectorpublic void addToArray(double[] dest,
int offset,
int stride)
AVectoraddToArray in class AVectorpublic void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddMultipleToArray 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 boolean equalsArray(double[] ds,
int offset)
AVectorequalsArray in interface INDArrayequalsArray in class ASizedVectords - Array of double element values to check for equalityoffset - Offset into the data arraypublic boolean equals(AVector v)
equals in class ASparseVectorpublic final SparseIndexedVector cloneIncludingIndices(int[] ixs)
public final void getElements(double[] array,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic final void copyTo(AVector v, int offset)
AVectorprotected final void copySparseValuesTo(double[] array,
int offset)
array - offset - Copyright © 2016. All rights reserved.