public final class Array extends AbstractArray<INDArray> implements IStridedArray
| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Replaces all elements of this array with their absolute values, according to Math.abs(double)
|
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
|
Vector |
asVector()
Constructs a view of the array as a single vector in row-major order.
|
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.
|
static Array |
create(INDArray a) |
static Array |
createFromVector(AVector a,
int[] shape)
Creates a new matrix using the elements in the specified vector.
|
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.
|
double |
elementSquaredSum()
Returns the total sum of elements in this array.
|
double |
elementSum()
Returns the total sum of elements in this array.
|
boolean |
equals(Array a) |
boolean |
equals(INDArray a)
Returns true if the two arrays are exactly equal in value and shape
|
Array |
exactClone()
Returns an exact deep clone of an array (i.e.
|
void |
exp()
Computes the function e^x (in-place) for all array elements
|
double |
get(int... indexes)
Returns the double value at the specified index position in an array
|
double[] |
getArray() |
int |
getArrayOffset() |
int |
getIndex(int... indexes) |
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.
|
List<INDArray> |
getSlices()
Returns a list of all major slices of this array.
|
int |
getStride(int dim) |
int[] |
getStrides() |
boolean |
isElementConstrained()
Returns true if this array has some constraints on element values
|
boolean |
isFullyMutable()
Returns true if the INDArray is 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 |
log()
Computes the natural logarithm (in-place) for all array elements
|
void |
multiply(double factor)
Multiplies all elements of the array by a given double value
|
static Array |
newArray(int... shape) |
void |
set(int[] indexes,
double value) |
void |
setElements(double[] values,
int offset,
int length)
Sets all elements in an array using the given double values
|
void |
signum()
Calculates the signum of all elements of the array
|
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 |
square()
Squares all elements of the array
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
Vector |
toVector()
Converts the array into a flattened vector
|
void |
validate()
Validates the internal data structure of the INDArray.
|
static INDArray |
wrap(double[] data,
int[] shape) |
static Array |
wrap(Matrix m) |
static Array |
wrap(Vector v) |
add, add, asElementList, broadcast, broadcastCloneLike, broadcastLike, clamp, copyTo, divide, divide, elementIterator, ensureMutable, epsilonEquals, epsilonEquals, equals, fill, get, get, get, getElements, getShape, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hashCode, innerProduct, isBoolean, isSameShape, isZero, iterator, multiply, negate, nonZeroCount, outerProduct, pow, reciprocal, reshape, scale, scaleAdd, set, set, set, set, set, setElements, sqrt, sub, sub, toArray, toDoubleArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitadd, add, asElementList, broadcast, broadcastCloneLike, broadcastLike, clamp, copyTo, divide, divide, elementIterator, ensureMutable, epsilonEquals, epsilonEquals, fill, get, get, get, getElements, getShape, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, innerProduct, isBoolean, isSameShape, isZero, multiply, negate, nonZeroCount, outerProduct, pow, reciprocal, reshape, scale, scaleAdd, set, set, set, set, set, setElements, sqrt, sub, sub, toArray, toDoubleArraypublic static INDArray wrap(double[] data, int[] shape)
public static Array newArray(int... shape)
public int dimensionality()
INDArraydimensionality in interface INDArraypublic int[] getShape()
INDArraygetShape in interface IStridedArraygetShape in interface INDArraypublic long[] getLongShape()
INDArraygetLongShape in interface INDArraypublic int getStride(int dim)
getStride in interface IStridedArraypublic int getIndex(int... indexes)
public double get(int... indexes)
INDArraypublic Vector asVector()
INDArraypublic Vector toVector()
INDArraytoVector in interface INDArraytoVector 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 double elementSum()
INDArrayelementSum in interface INDArrayelementSum in class AbstractArray<INDArray>public double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AbstractArray<INDArray>public void abs()
INDArrayabs in interface INDArrayabs in class AbstractArray<INDArray>public void signum()
INDArraysignum in interface INDArraysignum in class AbstractArray<INDArray>public void square()
INDArraysquare in interface INDArraysquare in class AbstractArray<INDArray>public void exp()
INDArrayexp in interface INDArrayexp in class AbstractArray<INDArray>public void log()
INDArraylog in interface INDArraylog in class AbstractArray<INDArray>public 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(INDArray a)
INDArrayequals in interface INDArrayequals in class AbstractArray<INDArray>public boolean equals(Array a)
public Array exactClone()
INDArrayexactClone in interface INDArraypublic void setElements(double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraypublic void multiply(double factor)
INDArraypublic List<INDArray> getSlices()
INDArraygetSlices in interface INDArraygetSlices in class AbstractArray<INDArray>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 INDArray clone()
INDArrayclone in interface INDArrayclone in class AbstractArray<INDArray>public void validate()
INDArrayvalidate in interface INDArrayvalidate in class AbstractArray<INDArray>public static Array createFromVector(AVector a, int[] shape)
data - rows - columns - public double[] getArray()
getArray in interface IStridedArraypublic int getArrayOffset()
getArrayOffset in interface IStridedArraypublic int[] getStrides()
getStrides in interface IStridedArraypublic boolean isPackedArray()
isPackedArray in interface IStridedArrayCopyright © 2013. All Rights Reserved.