public final class AxisVector extends ASingleElementVector
indexlength| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Replaces all elements of this array with their absolute values, according to Math.abs(double)
|
AxisVector |
absCopy()
Returns a copy of the array with the abs operator applied to each element
|
void |
add(ASparseVector v) |
AVector |
addCopy(AVector v)
Adds a vector element-wise to this vector, returning a new vector.
|
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[] array,
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
|
int |
axis() |
static AxisVector |
create(int axisIndex,
int dimensions) |
double |
density()
Computes the density ratio of this sparse array (proportion of non-zero elements)
|
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 |
dotProduct(Vector2 v) |
double |
dotProduct(Vector3 v) |
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
|
AxisVector |
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
|
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 |
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)
|
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
|
AVector |
multiplyCopy(double d)
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
|
double |
normalise()
Normalises this vector to a magnitude of 1.0
Has no effect on a zero-length vector (i.e.
|
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.
|
void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
signum()
Calculates the signum of all elements of this mutable array
Sets each component of the array to its sign value (-1, 0 or 1)
|
AxisVector |
signumCopy()
Returns a copy of the array with the signum operator applied to each element
|
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.
|
SparseIndexedVector |
sparseClone()
Clones the vector into a sparse mutable format
|
void |
sqrt()
Computes the square root of all elements in the array
|
AxisVector |
sqrtCopy()
Computes the square root for each element in this vector, returning a new vector.
|
void |
square()
Squares all elements of the array in place
|
AVector |
squareCopy()
Squares all elements of the array, returning a new array
|
AVector |
subCopy(AVector v)
Subtracts a vector element-wise from this vector, returning a new vector.
|
AVector |
subVector(int start,
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.
|
Vector |
toNormal()
Creates a new mutable vector representing the normalised value of this vector
Returns null if the vector cannot be normalised (i.e.
|
Vector |
toVector()
Coerces this vector to the standard dense Vector format.
|
double |
unsafeGet(int i) |
void |
validate()
Validates the internal data structure of the INDArray.
|
protected double |
value() |
indexadd, addMultiple, clone, copyTo, copyTo, distanceL1, distanceLinf, distanceSquared, dotProduct, equals, getSlices, isSparse, isView, reduce, reduce, reduceSlices, roundToZero, sparse, toSparseIndexedVectorcheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountadd, add, add, add, add, add, add, add, addAt, addAt, addCopy, 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, 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, elementIterator, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, fill, fillRange, get, get, get, get, getElements, getElements, getElements, getLongShape, getShape, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isSameShape, isUnitLengthVector, iterator, join, join, join, log, logistic, magnitudeSquared, maxElement, minElement, multiply, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, 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, setElements, setElements, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, slice, sliceValue, softmax, softmaxCopy, sub, sub, subArray, subAt, subCopy, subMultiple, tanh, toDoubleBuffer, toList, toSliceArray, toString, toStringFull, tryEfficientJoin, unsafeSetadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isDense, reciprocal, reciprocalCopy, scale, set, set, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitdivideCopy, epsilonEquals, isSameShape, length, multiplyCopy, rotateCopy, rotateView, shiftCopyadd, 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, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, 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, isDense, isElementConstrained, isFullyMutable, isSameShape, join, join, log, multiply, multiply, 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, slice, sliceCount, sliceValue, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, withComponentsforEach, spliteratorpublic static AxisVector create(int axisIndex, int dimensions)
public int axis()
public double magnitude()
AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class ASparseVectorpublic double normalise()
AVectorpublic AVector normaliseCopy()
AVectornormaliseCopy in interface IVectornormaliseCopy in class AVectorpublic void square()
INDArraypublic AVector squareCopy()
INDArraysquareCopy in interface INDArraysquareCopy in class AVectorpublic void abs()
INDArraypublic AxisVector absCopy()
INDArraypublic void sqrt()
INDArraysqrt in interface INDArraysqrt in class AbstractArray<Double>public AxisVector sqrtCopy()
IVectorpublic void signum()
INDArraypublic AxisVector signumCopy()
INDArraysignumCopy in interface INDArraysignumCopy in class AbstractArray<Double>public 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 boolean isZero()
AVectorisZero in interface INDArrayisZero in class ASparseVectorpublic boolean isRangeZero(int start,
int length)
AVectorisRangeZero in class AVectorpublic boolean isMutable()
AVectorpublic boolean isBoolean()
INDArrayisBoolean in interface INDArrayisBoolean in class AbstractArray<Double>public boolean isUnitLengthVector()
AVectorisUnitLengthVector in class AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class ASingleElementVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class ASingleElementVectorpublic double dotProduct(double[] data,
int offset,
int stride)
AVectordotProduct in class AVectorpublic double dotProduct(Vector3 v)
public double dotProduct(Vector2 v)
public AVector multiplyCopy(double d)
INDArraymultiplyCopy in interface INDArraymultiplyCopy in class AVectord - A scalar factorpublic Scalar innerProduct(ADenseArrayVector v)
AVectorinnerProduct in class AVectorpublic AVector innerProduct(AMatrix m)
AVectorinnerProduct in class ASparseVectorpublic double get(int i)
INDArraypublic void addToArray(int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddToArray in class AVectorpublic void addToArray(double[] array,
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 Vector toNormal()
AVectorpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class ASparseVectorpublic Vector toVector()
AVectorpublic AVector subVector(int start, int length)
AVectorpublic double density()
ISparsedensity in interface ISparsedensity in class AbstractArray<Double>public int nonSparseElementCount()
ASparseVectornonSparseElementCount in class ASingleElementVectorpublic AVector nonSparseValues()
ISparseVectornonSparseValues in interface ISparseVectornonSparseValues in class ASingleElementVectorpublic Index nonSparseIndex()
AVectornonSparseIndex in interface ISparseVectornonSparseIndex in class ASingleElementVectorpublic int[] nonZeroIndices()
AVectornonZeroIndices in class ASingleElementVectorpublic double[] nonZeroValues()
AVectornonZeroValues in class AVectorpublic void add(ASparseVector v)
add in class ASparseVectorpublic AVector addCopy(AVector v)
IVectorpublic AVector subCopy(AVector v)
IVectorpublic boolean includesIndex(int i)
ASparseVectorincludesIndex in class ASparseVectorpublic void set(int i,
double value)
INDArraypublic 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 equals(AVector v)
equals in class ASingleElementVectorpublic boolean elementsEqual(double value)
INDArrayelementsEqual in interface INDArrayelementsEqual in class AVectorpublic AxisVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorpublic SparseIndexedVector sparseClone()
AVectorsparseClone in interface INDArraysparseClone in class AVectorpublic void validate()
INDArraypublic boolean hasUncountable()
AbstractArrayhasUncountable in interface INDArrayhasUncountable in class ASparseVectorpublic double elementPowSum(double p)
elementPowSum in interface INDArrayelementPowSum in class ASparseVectorpublic double elementAbsPowSum(double p)
elementAbsPowSum in interface INDArrayelementAbsPowSum in class ASparseVectorprotected double value()
value in class ASingleElementVectorCopyright © 2016. All rights reserved.