public final class IndexedArrayVector extends ASizedVector
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
indexes |
length| Modifier and Type | Method and Description |
|---|---|
void |
addAt(int i,
double value)
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[] dest,
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 offset)
Adds this vector to a double[] array, starting at the specified offset.
|
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
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.
|
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.
|
boolean |
equalsArray(double[] data,
int offset)
Returns true if this vector exactly matches the elements in double[] array, starting
from the specified offset
|
IndexedArrayVector |
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
|
boolean |
isView()
Returns true if this vector is of a view type that references other vectors / data.
|
AVector |
join(AVector v) |
protected IndexedArrayVector |
replaceIndex(int[] newIndices) |
IndexedArrayVector |
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
|
ArrayIndexScalar |
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 |
subVector(int offset,
int length)
Obtains a sub-vector view that refers to this vector.
|
double |
unsafeGet(int i) |
void |
unsafeSet(int i,
double value) |
void |
validate()
Validates the internal data structure of the INDArray.
|
static IndexedArrayVector |
wrap(double[] data,
int[] indexes)
Wraps the specified indexes into a double[] array as an IndexedArrayVector
The length of the vector will equal the number of indices provided.
|
checkIndex, checkLength, checkRange, checkSameLength, checkSameLength, elementCount, equalsArray, get, getShape, getShapeClone, isSameShape, length, sliceCountabs, absCopy, add, 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, addToArray, addWeighted, angle, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastLike, broadcastLike, broadcastLike, checkDimension, checkSameLength, clamp, clampMax, clampMin, clone, compareTo, copy, copyTo, copyTo, copyTo, crossProduct, crossProduct, dense, denseClone, dimensionality, distance, distanceL1, distanceLinf, distanceSquared, divide, divide, divide, divide, divideCopy, divideCopy, divideTo, dotProduct, dotProduct, dotProduct, elementAbsPowSum, elementIterator, elementMax, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, fill, fillRange, get, get, get, get, getElements, getElements, getLongShape, getShape, getSlices, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, interpolate, isElementConstrained, isFullyMutable, isMutable, isRangeZero, isSameShape, isUnitLengthVector, isUnitLengthVector, isZero, iterator, 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, reduce, reduce, 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, setElements, 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, tanh, toDoubleArray, toDoubleBuffer, toList, toNormal, toSliceArray, toString, toStringFull, toVector, tryEfficientJoinadd, addInnerProduct, addInnerProduct, addOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, density, ensureMutable, 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, waitaddOuterProduct, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, ensureMutable, exp, get, get, get, getComponent, getComponents, getElements, getElements, getSlices, getSliceViews, isBoolean, isDense, isSparse, reciprocal, reciprocalCopy, scale, set, set, signumCopy, sqrt, sub, toArray, withComponentsforEach, spliteratorpublic static IndexedArrayVector wrap(double[] data, int[] indexes)
data - indexes - public final double get(int i)
INDArraypublic IndexedArrayVector selectView(int... inds)
AVectorselectView in class AVectorpublic final void set(int i,
double value)
INDArraypublic void addAt(int i,
double value)
AVectorpublic void applyOp(Op op)
INDArraypublic AVector subVector(int offset, int length)
AVectorpublic ArrayIndexScalar slice(int i)
INDArraypublic void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AVectorpublic void copyTo(int offset,
double[] dest,
int destOffset,
int length)
AVectorpublic void copyTo(int offset,
double[] dest,
int destOffset,
int length,
int stride)
AVectorpublic void addToArray(double[] dest,
int offset)
AVectoraddToArray in interface INDArrayaddToArray in class AVectorpublic void addMultipleToArray(double factor,
int offset,
double[] dest,
int destOffset,
int length)
AVectoraddMultipleToArray in class AVectorpublic double dotProduct(double[] data,
int offset)
AVectordotProduct in class AVectorpublic double dotProduct(double[] data,
int offset,
int stride)
AVectordotProduct in class AVectorpublic IndexedArrayVector exactClone()
AVectorexactClone in interface INDArrayexactClone in class AVectorprotected IndexedArrayVector replaceIndex(int[] newIndices)
public 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 void validate()
INDArrayCopyright © 2016. All rights reserved.