public final class NDArray extends BaseNDArray
data, dimensions, offset, strideshape| Modifier and Type | Method and Description |
|---|---|
void |
applyOp(IOperator op)
Applies a unary operator to all elements of the array (in-place)
|
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
double[] |
asDoubleArray()
Returns the underlying double array representing the densely packed elements of this array
Returns null if there is no such array
|
AVector |
asVector()
Constructs a view of all elements in the array as a single vector in row-major order.
|
INDArray |
broadcast(int... dimensions)
Returns a view of this array broadcasted up to a larger shape
|
INDArray |
clone()
Returns a clone of the array data, as a new array which will be fully mutable
and may be of a different class to the original.
|
Iterator<Double> |
elementIterator()
Returns an iterator over all elements in this array, in row-major order
|
boolean |
equals(INDArray a)
Checks if two arrays are equal exactly in terms of both value and shape
|
boolean |
equals(NDArray a) |
NDArray |
exactClone()
Creates a deep clone of an array, using the same class implementation as the original array
|
double[] |
getArray()
Gets the underlying data array for this strided array
Unsafe operation - may allow modification of otherwise immutable arrays
|
List<INDArray> |
getSlices()
Returns a list of all major slices of this array.
|
INDArray |
getTranspose()
Returns the transpose of this array.
|
INDArray |
getTransposeView()
Returns a transposed view of the array.
|
INDArray |
immutable()
Returns an immutable version of this array.
|
boolean |
isElementConstrained()
Returns true if this array has some constraints on element values
|
boolean |
isFullyMutable()
If this method returns true, the INDArray is guaranteed to be fully mutable
in all positions i.e.
|
boolean |
isMutable()
Returns true if the INDArray is mutable (at least partially)
|
boolean |
isView()
Return true if this array is considered as a view type.
|
void |
multiply(double d)
Multiplies all elements of the array in place by a given double value
|
static NDArray |
newArray(int... shape) |
INDArray |
reshape(int... dimensions)
Returns a new array by rearranging the elements of this array into the desired shape
Truncates or zero-pads the elements as required to fill the new shape
|
void |
set(double value)
Sets all elements of an array to a specific double value
|
void |
set(int[] indexes,
double value)
Sets the element at the given indexed position in a mutable array
|
void |
set(int x,
double value)
Sets a value at a given position in a mutable 1D array
|
void |
set(int x,
int y,
double value)
Sets a value at a given position in a mutable 2D array
|
void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
INDArray |
slice(int majorSlice)
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.
|
INDArray |
slice(int dimension,
int index)
Returns a slice view of this array along the specified dimension
|
NDArray |
subArray(int[] offsets,
int[] shape)
Returns a subarray view of a larger array
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
void |
validate()
Validates the internal data structure of the INDArray.
|
static NDArray |
wrap(double[] data,
int[] shape) |
static NDArray |
wrap(INDArray a) |
static NDArray |
wrap(IStridedArray a) |
static NDArray |
wrap(Matrix m) |
static NDArray |
wrap(Vector v) |
static INDArray |
wrapStrided(double[] data,
int offset,
int[] shape,
int[] strides) |
checkDimension, dimensionality, elementCount, get, get, get, get, getArrayOffset, getIndex, getLongShape, getShape, getStride, getStrides, isPackedArraygetShape, getShapeClone, isZero, reduce, reduce, sliceCountabs, absCopy, add, add, add, addAt, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, addToArray, applyOp, applyOp, applyOpCopy, asElementList, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, componentCount, copy, dense, denseClone, density, divide, divide, divideCopy, elementAbsPowSum, elementMax, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, equals, equalsArray, equalsArray, exp, fill, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getElements, getSlices, getSliceViews, getTransposeCopy, hashCode, hasUncountable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isSameShape, isSparse, iterator, join, join, log, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonZeroCount, outerProduct, pow, reciprocal, reciprocalCopy, reduceSlices, reduceSlices, reorder, reorder, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, sub, subCopy, toArray, toDoubleArray, toSliceArray, toString, toStringFull, toVector, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitabs, absCopy, add, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, addToArray, applyOp, applyOp, applyOpCopy, asElementList, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, componentCount, copy, dense, denseClone, divide, divide, divideCopy, elementAbsPowSum, elementMax, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equalsArray, equalsArray, exp, fill, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getElements, getShape, getShapeClone, getSlices, getSliceViews, getTransposeCopy, hasUncountable, innerProduct, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isSameShape, isSparse, isZero, join, join, log, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonZeroCount, outerProduct, pow, reciprocal, reciprocalCopy, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, sliceCount, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, subCopy, toArray, toDoubleArray, toSliceArray, toVector, withComponentsforEach, spliteratorpublic static NDArray wrap(double[] data, int[] shape)
public static NDArray wrap(IStridedArray a)
public static NDArray newArray(int... shape)
public void set(double value)
INDArrayset in interface INDArrayset in class AbstractArray<INDArray>public void set(int x,
double value)
INDArrayset in interface INDArrayset in class AbstractArray<INDArray>public void set(int x,
int y,
double value)
INDArrayset in interface INDArrayset in class AbstractArray<INDArray>public void set(int[] indexes,
double value)
INDArraypublic INDArray getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in class AbstractArray<INDArray>public INDArray getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in class AbstractArray<INDArray>public AVector asVector()
INDArrayasVector in interface INDArrayasVector in class AbstractArray<INDArray>public INDArray reshape(int... dimensions)
INDArrayreshape in interface INDArrayreshape in class AbstractArray<INDArray>public INDArray broadcast(int... dimensions)
INDArraybroadcast in interface INDArraybroadcast in class AbstractArray<INDArray>public INDArray slice(int majorSlice)
INDArraypublic INDArray slice(int dimension, int index)
INDArraypublic NDArray subArray(int[] offsets, int[] shape)
INDArraysubArray in interface INDArraysubArray in class AbstractArray<INDArray>public boolean isMutable()
INDArrayisMutable in interface INDArrayisMutable in class AbstractArray<INDArray>public boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArrayisFullyMutable in class AbstractArray<INDArray>public boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArrayisElementConstrained in class AbstractArray<INDArray>public boolean isView()
INDArraypublic void applyOp(Op op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<INDArray>public void applyOp(IOperator op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<INDArray>op - The operator to apply to the arraypublic boolean equals(NDArray a)
public boolean equals(INDArray a)
INDArrayequals in interface INDArrayequals in class AbstractArray<INDArray>public NDArray exactClone()
INDArraypublic INDArray clone()
INDArrayclone in interface INDArrayclone in class AbstractArray<INDArray>public void multiply(double d)
INDArraymultiply in interface INDArraymultiply in class AbstractArray<INDArray>public void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<INDArray>pos - 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 toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AbstractArray<INDArray>public double[] asDoubleArray()
INDArrayasDoubleArray in interface INDArrayasDoubleArray in class AbstractArray<INDArray>public List<INDArray> getSlices()
INDArraygetSlices in interface INDArraygetSlices in class AbstractArray<INDArray>public Iterator<Double> elementIterator()
INDArrayelementIterator in interface INDArrayelementIterator in class AbstractArray<INDArray>public void validate()
INDArrayvalidate in interface INDArrayvalidate in class AbstractArray<INDArray>public INDArray immutable()
INDArrayimmutable in interface INDArrayimmutable in class AbstractArray<INDArray>public double[] getArray()
IStridedArraypublic static INDArray wrapStrided(double[] data, int offset, int[] shape, int[] strides)
Copyright © 2016. All rights reserved.