public abstract class ADenseArrayVector extends AStridedVector implements IDenseArray
datalength| Modifier | Constructor and Description |
|---|---|
protected |
ADenseArrayVector(int length,
double[] data) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ADenseArrayVector src,
int srcOffset) |
void |
add(AVector src)
Adds another vector to this one
|
void |
add(AVector src,
int srcOffset)
Adds part another vector to this one, starting at the specified offset in the source vector
|
void |
add(double constant)
Adds a double value to all elements in this array.
|
void |
add(double[] data,
int offset)
Adds to this vector from a given double array.
|
void |
add(int offset,
ADenseArrayVector src) |
void |
add(int offset,
ADenseArrayVector src,
int srcOffset,
int length) |
void |
add(int offset,
AVector src)
Adds another vector into this one, at the specified offset
|
void |
addAt(int i,
double v)
Adds a value to a specific element of the vector
This function does not perform bounds checking, i.e.
|
void |
addMultiple(ADenseArrayVector v,
double factor) |
void |
addMultiple(AVector v,
double factor)
Adds a scaled multiple of another vector to this vector
|
void |
addMultiple(int offset,
AVector src,
int srcOffset,
int length,
double factor) |
void |
addMultipleToArray(double factor,
double[] array,
int arrayOffset)
Adds a multiple of this vector into a double array at the specified offset
|
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 |
addProduct(AVector a,
AVector b)
Adds the element-wise product of two vectors to this vector.
|
void |
addProduct(AVector a,
AVector b,
double factor)
Adds the element-wise product of two vectors and a constant factor to this vector.
|
void |
addProduct(AVector a,
int aOffset,
AVector b,
int bOffset,
double factor)
Adds the scaled elementwise product of two vectors to this vector
|
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 destOffset,
int destStride)
Adds this vector to a double[] array, using the specified offset and stride into the destination array
|
void |
addToArray(int offset,
double[] destData,
int destOffset,
int length)
Adds a subvector of this vector into a double array at the specified offset
|
void |
applyOp(Op2 op,
AVector b)
Applies a binary operator to this vector and a second vector
|
void |
clamp(double min,
double max)
Clamps all values in the vector to a given range
|
void |
copyTo(int offset,
ADenseArrayVector dest,
int destOffset,
int length) |
void |
copyTo(int start,
AVector dest,
int destOffset,
int length)
Copies a subset of this vector to a vector at the specified offset
|
void |
copyTo(int offset,
double[] dest,
int destOffset,
int length)
Copies a subset of this vector to a specified destination array offset
|
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.
|
ADenseArrayVector |
dense()
Coerces this INDArray to a dense format, without changing its element values.
|
void |
divide(AVector v) |
void |
divide(double[] data,
int offset)
Divides the elements in this vector by corresponding elements in the target array
|
void |
divideTo(double[] data,
int offset)
Divides the elements in the target array by corresponding elements in this 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[] src,
int srcOffset,
int stride)
Fast dot product with a double[] array and a stride.
|
double |
elementAbsPowSum(double exponent)
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 exponent)
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 |
equals(INDArray v)
Checks if two arrays are equal exactly in terms of both value and shape
|
boolean |
equalsArray(double[] data)
Returns true if this vector exactly matches a double[] array.
|
boolean |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
void |
exp()
Computes the function e^x (in-place) for all array elements
|
void |
fill(double value)
Fills the entire vector with a given value
|
void |
fillRange(int offset,
int length,
double value) |
abstract double |
get(int i)
Returns the double value at the specified position in a 1D vector
|
void |
getElements(double[] data,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
int |
getStride()
ADenseArrayVector has a fixed stride of 1, which enables efficient operations
on arrays
|
boolean |
isPackedArray()
Checks if this array is fully packed in row major order.
|
boolean |
isRangeZero(int start,
int length)
Returns true if a sub-vector range is completely zero.
|
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)
|
AVector |
join(ADenseArrayVector v) |
AVector |
join(AVector v) |
JoinedArrayVector |
join(JoinedArrayVector v) |
void |
log()
Computes the natural logarithm (in-place) for all array elements
|
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 v) |
void |
multiply(double factor)
Multiplies the vector by a constant factor
|
void |
multiply(double[] src,
int srcOffset)
Multiplies the elements in this vector by corresponding elements in the target array
|
void |
multiplyTo(double[] dest,
int destOffset)
Multiplies the elements in the target array by corresponding elements in this 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
|
void |
pow(double exponent)
Raises all elements of the array to a specified power in place
|
void |
reciprocal()
Replaces all elements in the array with their reciprocal
|
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.
|
void |
scaleAdd(double factor,
AVector v,
double vfactor,
double constant)
Scales all elements of the array by a given double value, adds a
scaled second vector and adds a constant value
|
void |
scaleAdd(double factor,
double constant)
Scales this vector and adds a constant to every element
|
AVector |
selectView(int... inds)
Selects a subset of indices from a vector, returning a view
|
void |
set(AVector a)
Sets the vector to equal the value of another vector
|
void |
set(AVector src,
int srcOffset)
Set the vector equal to an offset into another vector
|
abstract void |
set(int i,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
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)
|
ArrayIndexScalar |
slice(int position)
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.
|
void |
sqrt()
Computes the square root of all elements in the array
|
void |
square()
Squares all elements of the array in place
|
Vector |
squareCopy()
Squares all elements of the array, returning a new array
|
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.
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
AVector |
tryEfficientJoin(AVector v)
Attempts to perform an efficient join with a second vector.
|
abstract double |
unsafeGet(int i) |
abstract void |
unsafeSet(int i,
double value) |
void |
validate()
Validates the internal data structure of the INDArray.
|
add, applyOp, applyOpCopy, asDoubleArray, broadcast, broadcastLike, clone, ensureMutable, getArray, getArrayOffset, getElements, getStride, getStrides, hasUncountable, iterator, setElementsindexcheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, get, getShape, getShapeClone, isSameShape, length, sliceCountabs, absCopy, add, add, add, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultiple, addMultipleCopy, addPower, addPower, addPower, addProductCopy, addProductCopy, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, asElementList, asVector, broadcastLike, broadcastLike, checkDimension, checkSameLength, clampMax, clampMin, compareTo, copy, copyTo, copyTo, crossProduct, crossProduct, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divideCopy, divideCopy, dotProduct, dotProduct, elementIterator, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, exactClone, get, get, get, get, getElements, getLongShape, getShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isMutable, isSameShape, isUnitLengthVector, isUnitLengthVector, join, join, logistic, magnitudeSquared, maxElement, minElement, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonSparseIndex, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, projectToPlane, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, set, set, set, set, set, set, set, set, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, slice, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, tanh, toList, toNormal, toSliceArray, toString, toStringFull, toVectoradd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, density, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocalCopy, scale, set, set, signumCopy, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitgetArray, getArrayOffsetabs, absCopy, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, addToArray, applyOp, applyOp, applyOp, asElementList, asVector, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkMutable, componentCount, copy, denseClone, dimensionality, divide, divide, divideCopy, elementCount, elementIterator, epsilonEquals, epsilonEquals, exactClone, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, immutable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isElementConstrained, isFullyMutable, isMutable, isSameShape, isSparse, join, join, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, outerProduct, reciprocalCopy, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleCopy, set, set, set, set, set, set, setElements, setInnerProduct, setMultiple, setMultiple, signumCopy, slice, sliceCount, sliceValue, sparse, sparseClone, sub, sub, subArray, subCopy, toArray, toSliceArray, toVector, withComponentsforEach, spliteratorpublic final int getStride()
getStride in class AStridedVectorpublic AVector subVector(int offset, int length)
AVectorpublic ArrayIndexScalar slice(int position)
INDArrayslice in interface INDArrayslice in class AArrayVectorpublic AVector selectView(int... inds)
AVectorselectView in class AStridedVectorpublic boolean isPackedArray()
IStridedArrayisPackedArray in interface IStridedArrayisPackedArray in class AStridedVectorpublic boolean isView()
AVectorpublic boolean isZero()
AVectorpublic boolean isRangeZero(int start,
int length)
AVectorisRangeZero in class AStridedVectorpublic void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AVectorpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AVectorpublic void getElements(double[] data,
int offset)
INDArraygetElements in interface INDArraygetElements in class AStridedVectorpublic ADenseArrayVector dense()
INDArraypublic void fillRange(int offset,
int length,
double value)
public void set(AVector a)
AVectorset in class AStridedVectorpublic void set(AVector src, int srcOffset)
AVectorpublic void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AStridedVectorpos - Offset into this array, expressed in terms of number of elements in row major ordervalues - Element values in a double[] array. There must be at least as many element values as elements in this array.offset - Position in the values array from which to start taking values.length - Number of elements to set.public abstract double get(int i)
INDArraypublic abstract void set(int i,
double value)
INDArraypublic void add(AVector src)
AVectorpublic void add(AVector src, int srcOffset)
AVectorpublic void add(int offset,
AVector src)
AVectorpublic void add(int offset,
ADenseArrayVector src)
public void add(int offset,
ADenseArrayVector src,
int srcOffset,
int length)
public void addMultiple(AVector v, double factor)
AVectoraddMultiple in class AVectorpublic void scaleAdd(double factor,
double constant)
AVectorpublic void add(double constant)
INDArraypublic void addProduct(AVector a, int aOffset, AVector b, int bOffset, double factor)
AVectoraddProduct in class AVectorpublic void addToArray(int offset,
double[] destData,
int destOffset,
int length)
AVectoraddToArray in class AStridedVectorpublic void addToArray(double[] dest,
int destOffset,
int destStride)
AVectoraddToArray in class AStridedVectorpublic void addProduct(AVector a, AVector b)
AVectoraddProduct in class AVectorpublic void addProduct(AVector a, AVector b, double factor)
AVectoraddProduct in class AVectorpublic void addMultipleToArray(double factor,
double[] array,
int arrayOffset)
AVectoraddMultipleToArray in class AVectorpublic void addMultipleToArray(double factor,
int offset,
double[] array,
int arrayOffset,
int length)
AVectoraddMultipleToArray in class AStridedVectorpublic 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 void add(ADenseArrayVector src, int srcOffset)
public void add(double[] data,
int offset)
AVectorpublic void addAt(int i,
double v)
AVectoraddAt in class AStridedVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AStridedVectorpublic double dotProduct(double[] src,
int srcOffset,
int stride)
AVectordotProduct in class AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class AStridedVectorpublic void log()
INDArraypublic void exp()
INDArrayexp in interface INDArrayexp in class AbstractArray<Double>public void applyOp(Op2 op, AVector b)
AVectorpublic double reduce(Op2 op, double init)
INDArrayreduce in interface INDArrayreduce in class AStridedVectorpublic double reduce(Op2 op)
INDArrayreduce in interface INDArrayreduce in class AStridedVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class AStridedVectorpublic double elementPowSum(double exponent)
AbstractArrayelementPowSum in interface INDArrayelementPowSum in class AVectorpublic double elementAbsPowSum(double exponent)
AbstractArrayelementAbsPowSum in interface INDArrayelementAbsPowSum in class AVectorpublic double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AStridedVectorpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AStridedVectorpublic double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AStridedVectorpublic double maxAbsElement()
AVectormaxAbsElement in class AVectorpublic int minElementIndex()
AVectorminElementIndex in class AVectorpublic int maxElementIndex()
AVectormaxElementIndex in class AVectorpublic int maxAbsElementIndex()
AVectormaxAbsElementIndex in class AVectorpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AVectorpublic int[] nonZeroIndices()
AVectornonZeroIndices in class AVectorpublic void square()
INDArraypublic Vector squareCopy()
INDArraysquareCopy in interface INDArraysquareCopy in class AVectorpublic void sqrt()
INDArraysqrt in interface INDArraysqrt in class AbstractArray<Double>public void signum()
INDArraypublic void multiply(double[] src,
int srcOffset)
AVectorpublic void multiplyTo(double[] dest,
int destOffset)
AVectormultiplyTo in class AVectordestOffset - The offset into the target arraypublic void divide(double[] data,
int offset)
AVectorpublic void divideTo(double[] data,
int offset)
AVectorpublic void copyTo(int start,
AVector dest,
int destOffset,
int length)
AVectorpublic void copyTo(int offset,
ADenseArrayVector dest,
int destOffset,
int length)
public void copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
AVectorcopyTo in class AStridedVectorpublic void copyTo(int offset,
double[] dest,
int destOffset,
int length)
AVectorpublic void addMultiple(ADenseArrayVector v, double factor)
public void addMultiple(int offset,
AVector src,
int srcOffset,
int length,
double factor)
addMultiple in class AVectorpublic void scaleAdd(double factor,
AVector v,
double vfactor,
double constant)
AVectorpublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AStridedVectorpublic double magnitude()
AVectorpublic void fill(double value)
AVectorpublic void pow(double exponent)
INDArraypublic void reciprocal()
INDArrayreciprocal in interface INDArrayreciprocal in class AbstractArray<Double>public void clamp(double min,
double max)
AVectorpublic void multiply(double factor)
AVectorpublic AVector tryEfficientJoin(AVector v)
AVectortryEfficientJoin in class AVectorpublic AVector join(ADenseArrayVector v)
public JoinedArrayVector join(JoinedArrayVector v)
public boolean equals(INDArray v)
INDArraypublic boolean equalsArray(double[] data,
int offset)
AVectorequalsArray in interface INDArrayequalsArray in class AStridedVectordata - Array of double element values to check for equalityoffset - Offset into the data arraypublic boolean equalsArray(double[] data)
AVectorequalsArray in interface INDArrayequalsArray in class ASizedVectordata - Array of double element values to check for equalitypublic boolean elementsEqual(double value)
INDArrayelementsEqual in interface INDArrayelementsEqual in class AVectorpublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class AStridedVectorCopyright © 2016. All rights reserved.