public final class NDArray extends AbstractArray<INDArray> implements IStridedArray
| Modifier and Type | Method and Description |
|---|---|
void |
add(double a)
Adds a double value to all elements in this array
|
void |
add(INDArray a)
Adds all the elements of another array to this array, in an elementwise order.
|
void |
applyOp(IOp 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 packed elements of this array
Returns nil if there is no such underlying array
|
AVector |
asVector()
Constructs a view of 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, as a new array which will be fully mutable
and may be of a different class to the original.
|
int |
dimensionality()
Returns the dimensionality of the array (number of dimensions in the array shape)
e.g.
|
long |
elementCount()
Returns the total number of elements in this array.
|
Iterator<Double> |
elementIterator()
Returns an iterator over all elements in this array.
|
boolean |
equals(INDArray a)
Returns true if the two arrays are exactly equal in value and shape
|
boolean |
equals(NDArray a) |
NDArray |
exactClone()
Returns an exact deep clone of an array (i.e.
|
double |
get()
Returns the double value of a scalar array
|
double |
get(int... indexes)
Returns the double value at the specified index position in an array
|
double |
get(int x)
Returns the double value at the specified position in a 1D vector
|
double |
get(int x,
int y)
Returns the double value at the specified position in a 2D matrix
|
double[] |
getArray() |
int |
getArrayOffset() |
long[] |
getLongShape()
Returns the shape of the array as an array of longs.
|
int[] |
getShape()
Returns the shape of the array as an array of ints.
|
int |
getShape(int dim)
Returns the dimension size for a specific dimension in the array's shape
|
List<INDArray> |
getSlices()
Returns a list of all major slices of this array.
|
int |
getStride(int dim) |
int[] |
getStrides() |
INDArray |
getTranspose()
Returns the transpose of this array.
|
INDArray |
getTransposeView()
Returns a transposed view of the array.
|
INDArray |
innerProduct(INDArray a)
Calculates the inner product of this array with another 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 |
isPackedArray() |
boolean |
isView()
Return true if this array is a view type
|
void |
multiply(double d)
Multiplies all elements of the array by a given double value
|
static NDArray |
newArray(int... shape) |
INDArray |
outerProduct(INDArray a)
Calculates the outer product of this array with another array.
|
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) |
void |
set(int x,
double value) |
void |
set(int x,
int y,
double value) |
void |
setElements(double[] values,
int offset,
int length)
Sets all 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)
|
INDArray |
slice(int dimension,
int index)
Returns a slice view of this array along the specified dimension
|
int |
sliceCount()
returns the number of major slices in this array.
|
void |
sub(INDArray a)
Subtracts all the elements of another array from this array, in an elementwise order.
|
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) |
abs, asElementList, broadcastCloneLike, broadcastLike, clamp, copyTo, divide, divide, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, exp, fill, getElements, getSliceViews, getTransposeCopy, hashCode, isBoolean, isSameShape, isZero, iterator, log, multiply, negate, nonZeroCount, pow, reciprocal, scale, scaleAdd, set, set, setElements, signum, sqrt, square, sub, toArray, toDoubleArray, toString, toVectorfinalize, getClass, notify, notifyAll, wait, wait, waitabs, asElementList, broadcastCloneLike, broadcastLike, clamp, copyTo, divide, divide, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, exp, fill, getElements, getSliceViews, getTransposeCopy, isBoolean, isSameShape, isZero, log, multiply, negate, nonZeroCount, pow, reciprocal, scale, scaleAdd, set, set, setElements, signum, sqrt, square, sub, toArray, toDoubleArray, toVectorpublic static NDArray wrap(double[] data, int[] shape)
public static NDArray wrap(IStridedArray a)
public static NDArray newArray(int... shape)
public int dimensionality()
INDArraydimensionality in interface INDArraypublic int[] getShape()
INDArraygetShape in interface IStridedArraygetShape in interface INDArraypublic int getStride(int dim)
getStride in interface IStridedArraypublic int getShape(int dim)
INDArraygetShape in interface INDArraygetShape in class AbstractArray<INDArray>public long[] getLongShape()
INDArraygetLongShape in interface INDArraypublic double get()
INDArrayget in interface INDArrayget in class AbstractArray<INDArray>public double get(int x)
INDArrayget in interface INDArrayget in class AbstractArray<INDArray>public double get(int x,
int y)
INDArrayget in interface INDArrayget in class AbstractArray<INDArray>public double get(int... indexes)
INDArraypublic void set(double value)
INDArrayset in interface INDArrayset in class AbstractArray<INDArray>public void set(int x,
double value)
set in interface INDArrayset in class AbstractArray<INDArray>public void set(int x,
int y,
double value)
set in interface INDArrayset in class AbstractArray<INDArray>public void add(double a)
INDArrayadd in interface INDArrayadd in class AbstractArray<INDArray>public void add(INDArray a)
INDArrayadd in interface INDArrayadd in class AbstractArray<INDArray>public void sub(INDArray a)
INDArraysub in interface INDArraysub in class AbstractArray<INDArray>public INDArray innerProduct(INDArray a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<INDArray>public INDArray outerProduct(INDArray a)
INDArrayouterProduct in interface INDArrayouterProduct in class AbstractArray<INDArray>public INDArray getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in class AbstractArray<INDArray>public INDArray getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in class AbstractArray<INDArray>public AVector asVector()
INDArraypublic boolean isPackedArray()
isPackedArray in interface IStridedArraypublic 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 int sliceCount()
INDArraysliceCount in interface INDArraypublic long elementCount()
INDArrayelementCount in interface INDArraypublic boolean isMutable()
INDArraypublic boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArraypublic boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArraypublic boolean isView()
INDArraypublic void applyOp(Op op)
INDArraypublic void applyOp(IOp op)
INDArraypublic boolean equals(NDArray a)
public boolean equals(INDArray a)
INDArrayequals in interface INDArrayequals in class AbstractArray<INDArray>public NDArray exactClone()
INDArrayexactClone in interface INDArraypublic INDArray clone()
INDArrayclone in interface INDArrayclone in class AbstractArray<INDArray>public void multiply(double d)
INDArraypublic void setElements(double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraypublic 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 double[] getArray()
getArray in interface IStridedArraypublic int getArrayOffset()
getArrayOffset in interface IStridedArraypublic int[] getStrides()
getStrides in interface IStridedArraypublic static INDArray wrapStrided(double[] data, int offset, int[] shape, int[] strides)
Copyright © 2013. All Rights Reserved.