public final class ZeroVector extends ASparseVector
length| Modifier and Type | Method and Description |
|---|---|
ZeroVector |
absCopy()
Returns a copy of the array with the abs operator applied to each element
|
void |
add(ASparseVector v) |
AVector |
addCopy(AVector a)
Adds a vector element-wise to this vector, returning a new vector.
|
AVector |
addCopy(double a)
Creates a new array equal to this array with a constant value added to every element
|
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 |
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
|
AVector |
applyOpCopy(Op op)
Applies a unary operator to all elements of the array (creating a new array)
|
void |
copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
Copies a subset of this vector to a specified destination array offset
using the given stride.
|
static ZeroVector |
create(INDArray array)
Creates a ZeroVector with the same number of elements as the given array.
|
static ZeroVector |
create(int dimensions)
Create a ZeroVector with the specified number of dimensions
|
static ZeroVector |
createCached(int dimensions) |
static ZeroVector |
createNew(int dimensions) |
double |
density()
Computes the density ratio of this sparse array (proportion of non-zero elements)
|
ZeroVector |
divideCopy(AVector a)
Divides this vector element-wise by another vector, returning a new vector.
|
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 |
elementAbsPowSum(double p)
Returns the sum of the absolute values of all the elements raised to a specified power
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
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.
|
boolean |
elementsEqual(double value)
Returns true if all elements are equal to a specific value
|
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[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
ZeroVector |
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[] dest,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
void |
getElements(Object[] dest,
int offset)
Gets all elements of the array, copying them into an object array at the specified offset
|
int |
hashCode()
Computes the hashcode of a vector.
|
boolean |
hasUncountable()
Returns true if any element is this array is NaN or infinite
|
boolean |
includesIndex(int i)
Returns true iff the sparse vector contains the index i
|
Scalar |
innerProduct(ADenseArrayVector v)
Overloaded inner product for dense array vector argument
|
AVector |
innerProduct(AMatrix m)
Computes the inner product of this vector with a matrix
|
boolean |
isBoolean()
Returns true if the array is boolean (contains only 0.0 or 1.0 values)
|
boolean |
isFullyMutable()
Returns true if this vector is fully mutable, i.e.
|
boolean |
isMutable()
Returns true if this vector is mutable.
|
boolean |
isRangeZero(int start,
int length)
Returns true if a sub-vector range is completely zero.
|
boolean |
isUnitLengthVector()
Returns true if the vector has unit length
|
boolean |
isZero()
Returns true if this vector is a zero vector (all components zero)
|
Iterator<Double> |
iterator() |
ZeroVector |
join(ZeroVector a) |
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
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(AVector a) |
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
ZeroVector |
multiplyCopy(AVector a)
Multiplies a vector element-wise with this vector, returning a new vector.
|
ZeroVector |
multiplyCopy(double factor)
Returns a copy of the array with all elements multiplied by a single constant value
|
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.
|
AVector |
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
|
double[] |
nonZeroValues()
Return an double array specifying the values in this vector which are non-zero
|
AVector |
normaliseCopy()
Returns a copy of this vector normalised to a Euclidean length of 1.0
Has no effect on a zero-length vector (i.e.
|
RepeatedElementVector |
reciprocalCopy()
Returns a new array where every element is the reciprocal of the corresponding element in this 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 |
select(int... order)
Selects a subset of indices from a vector
|
AVector |
selectClone(int... inds)
Selects a subset of indices from a vector, returning a mutable clone of data
|
AVector |
selectView(int... inds)
Selects a subset of indices from a vector, returning a view
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
ImmutableScalar |
slice(int i)
Returns the specified major slice of this array as a view (slice along dimension 0)
0 dimensional slice results are permitted, but attempting to slice a 0 dimensional array
will result in an error.
|
AVector |
sparseClone()
Clones the vector into a sparse mutable format
|
AVector |
squareCopy()
Squares all elements of the array, returning a new array
|
AVector |
subCopy(AVector a)
Subtracts a vector element-wise from this vector, returning a new vector.
|
AVector |
subVector(int offset,
int length)
Obtains a sub-vector view that refers to this vector.
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
AVector |
tryEfficientJoin(AVector a)
Attempts to perform an efficient join with a second vector.
|
double |
unsafeGet(int i) |
void |
unsafeSet(int i,
double value) |
add, addMultiple, clone, copyTo, distanceL1, distanceLinf, distanceSquared, dotProduct, equals, getSlices, isSparse, isView, reduceSlices, roundToZero, sparse, toSparseIndexedVectorcheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountabs, add, add, add, add, add, add, add, add, addAt, addAt, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addMultipleToArray, addPower, addPower, addPower, addProduct, addProduct, addProduct, addProductCopy, addProductCopy, addProductToArray, addProductToArray, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, applyOp, 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, divideTo, dotProduct, elementIterator, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, fill, fillRange, get, get, get, get, getElements, getLongShape, getShape, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isSameShape, isUnitLengthVector, join, join, join, log, logistic, magnitudeSquared, maxElement, minElement, multiply, multiply, multiply, multiplyCopy, multiplyTo, mutable, negate, negateCopy, normalise, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, set, set, set, set, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, signum, slice, sliceValue, softmax, softmaxCopy, sqrtCopy, square, sub, sub, subArray, subAt, subCopy, subMultiple, tanh, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, validateadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isDense, reciprocal, scale, set, set, signumCopy, sqrt, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitepsilonEquals, isSameShape, length, normalise, rotateCopy, rotateView, shiftCopy, sqrtCopyabs, add, add, addAt, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, addToArray, applyOp, applyOp, applyOp, applyOp, asDoubleArray, asElementList, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementCount, elementIterator, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isDense, isElementConstrained, isSameShape, join, join, log, multiply, multiplyCopy, mutable, negate, negateCopy, outerProduct, pow, reciprocal, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, sliceCount, sliceValue, sqrt, square, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, toVector, validate, withComponentsforEach, spliteratorpublic static ZeroVector create(int dimensions)
dimensions - public static ZeroVector createNew(int dimensions)
public static ZeroVector createCached(int dimensions)
public static ZeroVector create(INDArray array)
arraySize - public double dotProduct(AVector v)
AVectordotProduct in class ASparseVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AVectorpublic AVector innerProduct(AMatrix m)
AVectorinnerProduct in class ASparseVectorpublic Scalar innerProduct(ADenseArrayVector v)
AVectorinnerProduct in class AVectorpublic double get(int i)
INDArraypublic void set(int i,
double value)
INDArraypublic void add(ASparseVector v)
add in class ASparseVectorpublic AVector addCopy(AVector a)
IVectorpublic AVector addCopy(double a)
INDArraypublic AVector subCopy(AVector a)
IVectorpublic RepeatedElementVector reciprocalCopy()
INDArrayreciprocalCopy in interface INDArrayreciprocalCopy in class AbstractArray<Double>public ZeroVector absCopy()
INDArraypublic void multiply(double factor)
AVectorpublic ZeroVector multiplyCopy(AVector a)
IVectormultiplyCopy in interface IVectormultiplyCopy in class AVectorpublic ZeroVector multiplyCopy(double factor)
INDArraymultiplyCopy in interface INDArraymultiplyCopy in class AVectorfactor - A scalar factorpublic AVector normaliseCopy()
AVectornormaliseCopy in interface IVectornormaliseCopy in class AVectorpublic ZeroVector divideCopy(AVector a)
IVectordivideCopy in interface IVectordivideCopy in class AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class ASparseVectorpublic double magnitude()
AVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class ASparseVectorpublic double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class ASparseVectorpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AVectorpublic double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AVectorpublic int maxElementIndex()
AVectormaxElementIndex in class AVectorpublic double maxAbsElement()
AVectormaxAbsElement in class AVectorpublic int maxAbsElementIndex()
AVectormaxAbsElementIndex in class AVectorpublic int minElementIndex()
AVectorminElementIndex in class AVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class ASparseVectorpublic double[] nonZeroValues()
AVectornonZeroValues in class AVectorpublic boolean isZero()
AVectorisZero in interface INDArrayisZero in class ASparseVectorpublic boolean isRangeZero(int start,
int length)
AVectorisRangeZero in class AVectorpublic boolean isBoolean()
INDArrayisBoolean in interface INDArrayisBoolean in class AbstractArray<Double>public boolean isMutable()
AVectorpublic boolean isFullyMutable()
AVectorisFullyMutable in interface INDArrayisFullyMutable in class AVectorpublic boolean isUnitLengthVector()
AVectorisUnitLengthVector in class AVectorpublic double reduce(Op2 op, double init)
INDArrayreduce in interface INDArrayreduce in class ASparseVectorpublic double reduce(Op2 op)
INDArrayreduce in interface INDArrayreduce in class ASparseVectorpublic AVector applyOpCopy(Op op)
INDArrayapplyOpCopy in interface INDArrayapplyOpCopy in class AVectorpublic void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddToArray in class AVectorpublic void copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
AVectorcopyTo in class ASparseVectorpublic 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 final ImmutableScalar slice(int i)
INDArraypublic double density()
ISparsedensity in interface ISparsedensity in class AbstractArray<Double>public AVector subVector(int offset, int length)
AVectorpublic ZeroVector join(ZeroVector a)
public AVector tryEfficientJoin(AVector a)
AVectortryEfficientJoin in class AVectorpublic AVector select(int... order)
AVectorpublic int nonSparseElementCount()
ASparseVectornonSparseElementCount in class ASparseVectorpublic AVector nonSparseValues()
ISparseVectornonSparseValues in interface ISparseVectornonSparseValues in class ASparseVectorpublic Index nonSparseIndex()
AVectornonSparseIndex in interface ISparseVectornonSparseIndex in class ASparseVectorpublic int[] nonZeroIndices()
AVectornonZeroIndices in class AVectorpublic AVector squareCopy()
INDArraysquareCopy in interface INDArraysquareCopy in class AVectorpublic boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseVectorpublic int hashCode()
AVectorpublic ZeroVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorpublic AVector sparseClone()
AVectorsparseClone in interface INDArraysparseClone in class AVectorpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class ASparseVectorpublic void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic void getElements(Object[] dest, int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic AVector selectClone(int... inds)
AVectorselectClone in class AVectorpublic AVector selectView(int... inds)
AVectorselectView in class AVectorpublic boolean equals(AVector v)
equals 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 boolean elementsEqual(double value)
INDArrayelementsEqual in interface INDArrayelementsEqual in class AVectorpublic boolean hasUncountable()
AbstractArrayhasUncountable in interface INDArrayhasUncountable in class ASparseVectorpublic double elementPowSum(double p)
ASparseVectorelementPowSum in interface INDArrayelementPowSum in class ASparseVectorpublic double elementAbsPowSum(double p)
ASparseVectorelementAbsPowSum in interface INDArrayelementAbsPowSum in class ASparseVectorpublic double dotProduct(double[] data,
int offset,
int stride)
AVectordotProduct in class AVectorCopyright © 2016. All rights reserved.