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.
|
Iterator<Double> |
elementIterator()
Returns an iterator over all 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() |
void |
getElements(double[] values,
int offset)
Gets all elements of the array, copying them into a double array
|
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.
|
int[] |
getShapeClone()
Returns the shape of the array as an array of ints, guaranteed to be a new array
|
List<INDArray> |
getSlices()
Returns a list of all major slices of this array.
|
int |
getStride(int dim) |
int[] |
getStrides() |
INDArray |
immutable()
Returns an immutable version of this INDArray's data
|
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
|
boolean |
isZero()
Returns true if the array is zero (all elements equal to zero)
|
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
|
INDArray |
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
|
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, ensureMutable, epsilonEquals, epsilonEquals, equals, fill, get, get, get, getShape, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hashCode, innerProduct, isBoolean, isSameShape, iterator, join, multiply, mutable, negate, nonZeroCount, outerProduct, pow, reciprocal, reshape, rotateView, 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, ensureMutable, epsilonEquals, epsilonEquals, fill, get, get, get, getShape, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, innerProduct, isBoolean, isSameShape, join, multiply, mutable, negate, nonZeroCount, outerProduct, pow, reciprocal, reshape, rotateView, 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 int[] getShapeClone()
INDArraygetShapeClone in interface INDArraygetShapeClone in class AbstractArray<INDArray>public long[] getLongShape()
INDArraygetLongShape in interface INDArraygetLongShape in class AbstractArray<INDArray>public int getStride(int dim)
getStride in interface IStridedArraypublic int getIndex(int... indexes)
public double get(int... indexes)
INDArraypublic Vector asVector()
INDArrayasVector in interface INDArrayasVector in class AbstractArray<INDArray>public Vector toVector()
INDArraytoVector in interface INDArraytoVector in class AbstractArray<INDArray>public INDArray slice(int majorSlice)
INDArraypublic INDArray slice(int dimension, int index)
INDArraypublic INDArray subArray(int[] offsets, int[] shape)
INDArraysubArray in interface INDArraysubArray in class AbstractArray<INDArray>public 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()
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(IOp op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<INDArray>public 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 INDArraysetElements in class AbstractArray<INDArray>public void getElements(double[] values,
int offset)
INDArraygetElements in interface INDArraygetElements in class AbstractArray<INDArray>public Iterator<Double> elementIterator()
INDArrayelementIterator in interface INDArrayelementIterator in class AbstractArray<INDArray>public void multiply(double factor)
INDArraymultiply in interface INDArraymultiply in class AbstractArray<INDArray>public 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 IStridedArraypublic boolean isZero()
INDArrayisZero in interface INDArrayisZero in class AbstractArray<INDArray>Copyright © 2013. All Rights Reserved.