public abstract class AStridedVector extends AArrayVector implements IStridedArray
datalength| Modifier | Constructor and Description |
|---|---|
protected |
AStridedVector(int length,
double[] data) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int offset,
AVector a,
int aOffset,
int length)
Adds a segment of another vector into this one, at the specified offset
|
abstract 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 |
addMultipleToArray(double factor,
int offset,
double[] destData,
int destOffset,
int length)
Adds a multiple of a subvector of this vector into a double array at the specified offset
|
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
|
abstract void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
Vector |
applyOpCopy(Op op)
Applies a unary operator to all elements of the array (creating a new array)
|
double[] |
asDoubleArray()
Returns the underlying double array representing the densely packed elements of this array
Returns null if there is no such array
|
INDArray |
broadcast(int... shape)
Returns a view of this array broadcasted up to a larger shape
|
AStridedMatrix |
broadcastLike(AMatrix target)
Broadcasts an array to match the shape of the target matrix
|
Vector |
clone()
Clones the vector, creating a new mutable copy of all data.
|
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.
|
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 |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementProduct()
Returns the product of all elements in the array.
|
double |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in a vector
|
AStridedVector |
ensureMutable()
Ensures the array is a fully mutable, efficient representation that is not
a view.
|
boolean |
equalsArray(double[] vs,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
double[] |
getArray()
Gets the underlying double[] data array for this vector
|
abstract int |
getArrayOffset()
Gets the offset into the underlying double[] data array for the first element of this vector
|
void |
getElements(double[] dest,
int destOffset)
Gets all elements of the array, copying them into a double array at the specified offset
|
void |
getElements(double[] dest,
int destOffset,
int[] indices)
Gets the elements in this vector from the specified indices, storing at the specified
offset in the destination array
|
abstract int |
getStride()
Gets the stride of this strided vector.
|
int |
getStride(int dimension)
Gets the stide for a specific dimension in this strided array.
|
int[] |
getStrides()
Gets the strides for each dimension of this strided array.
|
boolean |
hasUncountable()
Returns true if any element is this array is NaN or infinite
|
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.
|
Iterator<Double> |
iterator() |
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 |
selectView(int... inds)
Selects a subset of indices from a vector, returning a view
|
abstract void |
set(AVector v)
Sets the vector to equal the value of another vector
|
abstract void |
setElements(double[] values,
int offset)
Sets all elements in an array using the given double values
|
abstract void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
void |
validate()
Validates the internal data structure of the INDArray.
|
index, slicecheckIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountabs, absCopy, add, add, add, add, add, add, add, add, addAt, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, 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, asElementList, asVector, broadcastLike, broadcastLike, checkDimension, checkSameLength, clamp, clampMax, clampMin, compareTo, copy, copyTo, copyTo, copyTo, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideCopy, divideCopy, divideTo, dotProduct, dotProduct, dotProduct, elementAbsPowSum, elementIterator, elementPowSum, elementsEqual, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, exactClone, fill, fillRange, get, 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, isView, isZero, join, join, join, log, logistic, magnitude, magnitudeSquared, maxAbsElement, maxAbsElementIndex, maxElement, maxElementIndex, minElement, minElementIndex, multiply, multiply, multiply, multiply, multiply, multiplyCopy, multiplyCopy, multiplyCopy, multiplyTo, mutable, negate, negateCopy, nonSparseIndex, nonZeroCount, nonZeroIndices, nonZeroValues, normalise, normaliseCopy, normaliseMaxAbsElement, outerProduct, outerProduct, pow, projectToPlane, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateCopy, rotateView, rotateView, scale, scaleAdd, scaleAdd, scaleAdd, scaleAdd, scaleCopy, scaleToMagnitude, select, selectClone, set, set, set, set, set, set, set, set, set, set, setElements, setInnerProduct, setInnerProduct, setInnerProduct, setMultiple, setMultiple, setMultiple, setMultiple, shiftCopy, signum, slice, sliceValue, softmax, softmaxCopy, sparse, sparseClone, sqrtCopy, square, squareCopy, sub, sub, subArray, subAt, subCopy, subCopy, subMultiple, subVector, tanh, toDoubleArray, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoin, unsafeGet, unsafeSetadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, density, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocal, reciprocalCopy, scale, set, set, signumCopy, sqrt, sub, sub, toArray, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitabs, absCopy, add, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, addToArray, applyOp, applyOp, applyOp, asElementList, asVector, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkMutable, clamp, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementPowSum, elementsEqual, epsilonEquals, epsilonEquals, equals, equalsArray, exactClone, exp, fill, get, 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, isView, isZero, join, join, log, multiply, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonZeroCount, outerProduct, pow, reciprocal, reciprocalCopy, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, set, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, slice, sliceCount, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleArray, toDoubleBuffer, toSliceArray, toVector, withComponentsforEach, spliteratorpublic final double[] getArray()
getArray in interface IStridedArraypublic abstract int getArrayOffset()
getArrayOffset in interface IStridedArraypublic abstract int getStride()
public AStridedVector ensureMutable()
INDArrayensureMutable in interface INDArrayensureMutable in class AbstractArray<Double>public boolean isRangeZero(int start,
int length)
AVectorisRangeZero in class AVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AVectorpublic double dotProduct(AVector v)
AVectordotProduct in class AVectorpublic double elementSum()
AVectorelementSum in interface INDArrayelementSum in class AVectorpublic double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AVectorpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AVectorpublic double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AVectorpublic INDArray broadcast(int... shape)
INDArraypublic AStridedMatrix broadcastLike(AMatrix target)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AVectortarget - The target matrixpublic AVector selectView(int... inds)
AVectorselectView in class AArrayVectorpublic Vector clone()
AVectorpublic abstract void set(AVector v)
AVectorpublic abstract void setElements(double[] values,
int offset)
INDArraysetElements in interface INDArraysetElements in class AVectorvalues - 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.public abstract void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AVectorpos - 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 void add(int offset,
AVector a,
int aOffset,
int length)
AVectorpublic abstract void addAt(int i,
double v)
AVectorpublic void addToArray(int offset,
double[] destData,
int destOffset,
int length)
AVectoraddToArray in class AVectorpublic void addMultipleToArray(double factor,
int offset,
double[] destData,
int destOffset,
int length)
AVectoraddMultipleToArray in class AVectorpublic void addToArray(double[] dest,
int destOffset,
int destStride)
AVectoraddToArray in class AVectorpublic abstract void applyOp(Op op)
INDArraypublic final Vector applyOpCopy(Op op)
INDArrayapplyOpCopy in interface INDArrayapplyOpCopy in class AVectorpublic double reduce(Op2 op, double init)
INDArraypublic double reduce(Op2 op)
INDArraypublic void copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
AVectorpublic boolean hasUncountable()
AbstractArrayhasUncountable in interface INDArrayhasUncountable in class AVectorpublic double[] asDoubleArray()
INDArrayasDoubleArray in interface INDArrayasDoubleArray in class AVectorpublic boolean isPackedArray()
IStridedArrayisPackedArray in interface IStridedArraypublic int[] getStrides()
IStridedArraygetStrides in interface IStridedArraypublic int getStride(int dimension)
IStridedArraygetStride in interface IStridedArraypublic double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AVectorpublic void getElements(double[] dest,
int destOffset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic void getElements(double[] dest,
int destOffset,
int[] indices)
AVectorgetElements in class AVectorpublic boolean equalsArray(double[] vs,
int offset)
AVectorequalsArray in interface INDArrayequalsArray in class ASizedVectorvs - Array of double element values to check for equalityoffset - Offset into the data arraypublic void validate()
INDArrayCopyright © 2016. All rights reserved.