public final class ZeroVector extends ASparseVector
length
Modifier and Type | Method and Description |
---|---|
void |
add(ASparseVector v) |
void |
addToArray(int offset,
double[] array,
int arrayOffset,
int length) |
static ZeroVector |
create(int dimensions) |
double |
density()
Computes the density ratio of this sparse array (proportion of non-zero elements)
|
double |
dotProduct(AVector v) |
double |
dotProduct(double[] data,
int offset)
Fast dot product with a double[] array.
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
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
|
int |
hashCode()
Computes the hashcode of a vector.
|
boolean |
includesIndex(int i)
Returns true iff the sparse vector contains the index i
|
AVector |
innerProduct(AMatrix m) |
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 |
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() |
AVector |
join(AVector a)
Returns a new vector that refers to this vector joined to a second vector
|
ZeroVector |
join(ZeroVector a) |
double |
magnitude()
Returns the magnitude (Euclidean length) of the vector
|
double |
magnitudeSquared() |
double |
maxAbsElement()
Returns the maximum absolute element 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
|
int |
nonSparseElementCount()
Returns the number of non-sparse elements in the sparse vector.
|
Index |
nonSparseIndexes()
Returns the non-sparse indexes
|
AVector |
nonSparseValues()
Returns the non-sparse values as a compacted vector view
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
void |
set(int i,
double value)
Set a specified element in a vector
|
ImmutableScalar |
slice(int i)
Returns the specified major slice of this array as a view (slice along dimension 0)
|
AVector |
subVector(int offset,
int length)
Obtains a sub-vector that refers to this vector.
|
double |
unsafeGet(int i) |
void |
unsafeSet(int i,
double value) |
equals, equals
elementCount, getShape, getShape, getShapeClone, length, sliceCount
abs, add, add, add, add, add, add, addAt, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleToArray, addProduct, addProduct, addProduct, addProductToArray, addProductToArray, addToArray, addWeighted, angle, applyOp, applyOp, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, clamp, clampMax, clampMin, clone, compareTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, crossProduct, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideTo, dotProduct, dotProduct, elementIterator, elementSquaredSum, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equalsArray, equalsArray, fill, fillRange, get, get, get, get, getElements, getLongShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, interpolate, isElementConstrained, isSameShape, isSameShape, isView, join, log, logistic, maxElement, minElement, multiply, multiply, multiply, multiply, multiplyTo, mutable, negate, normalise, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reshape, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleToMagnitude, set, set, set, set, set, set, set, set, set, setElements, setElements, setRange, setValues, signum, slice, sparse, sparseClone, square, sub, sub, sub, subArray, subMultiple, tanh, toDoubleArray, toDoubleBuffer, toList, toNormal, toString, toVector, unsafeGetInteger, unsafeSetInteger, validate, zeroCount
broadcastCloneLike, ensureMutable, exp, getSlices, getSliceViews, reciprocal, scale, set, set, sqrt, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
broadcastCloneLike, ensureMutable, exp, getSlices, getSliceViews, reciprocal, scale, set, set, sqrt, toArray
public static ZeroVector create(int dimensions)
public double dotProduct(AVector v)
dotProduct
in class ASparseVector
public double dotProduct(double[] data, int offset)
AVector
dotProduct
in class AVector
public AVector innerProduct(AMatrix m)
innerProduct
in class AVector
public double get(int i)
INDArray
public void set(int i, double value)
IVector
public void add(ASparseVector v)
add
in class ASparseVector
public double magnitudeSquared()
magnitudeSquared
in class AVector
public double magnitude()
AVector
public double elementSum()
AVector
elementSum
in interface INDArray
elementSum
in class AVector
public double elementMax()
INDArray
elementMax
in interface INDArray
elementMax
in class AVector
public double elementMin()
INDArray
elementMin
in interface INDArray
elementMin
in class AVector
public int maxElementIndex()
AVector
maxElementIndex
in class AVector
public double maxAbsElement()
AVector
maxAbsElement
in class AVector
public int maxAbsElementIndex()
AVector
maxAbsElementIndex
in class AVector
public int minElementIndex()
AVector
minElementIndex
in class AVector
public long nonZeroCount()
INDArray
nonZeroCount
in interface INDArray
nonZeroCount
in class AVector
public boolean isZero()
AVector
public boolean isBoolean()
INDArray
isBoolean
in interface INDArray
isBoolean
in class AbstractArray<Double>
public boolean isMutable()
AVector
public boolean isFullyMutable()
AVector
isFullyMutable
in interface INDArray
isFullyMutable
in class AVector
public boolean isUnitLengthVector()
AVector
isUnitLengthVector
in class AVector
public void addToArray(int offset, double[] array, int arrayOffset, int length)
addToArray
in class AVector
public final ImmutableScalar slice(int i)
INDArray
public int hashCode()
AVector
public ZeroVector exactClone()
AVector
exactClone
in interface INDArray
exactClone
in class AVector
public double density()
ISparse
density
in interface ISparse
density
in class ASparseVector
public AVector subVector(int offset, int length)
AVector
public AVector join(AVector a)
AVector
public ZeroVector join(ZeroVector a)
public int nonSparseElementCount()
ASparseVector
nonSparseElementCount
in class ASparseVector
public AVector nonSparseValues()
ASparseVector
nonSparseValues
in class ASparseVector
public Index nonSparseIndexes()
ASparseVector
nonSparseIndexes
in class ASparseVector
public boolean includesIndex(int i)
ASparseVector
includesIndex
in class ASparseVector
Copyright © 2014. All Rights Reserved.