public final class NDArray extends BaseNDArray
data, dimensions, offset, shape, stride
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(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 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.
|
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[] |
getArray() |
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 INDArray's data
|
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 |
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
|
void |
sub(INDArray a)
Subtracts all the elements of another array from this array, in an elementwise order.
|
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) |
dimensionality, elementCount, get, get, get, get, getArrayOffset, getIndex, getLongShape, getShape, getShape, getShapeClone, getStride, getStrides, isPackedArray, sliceCount
abs, asElementList, broadcastCloneLike, broadcastLike, clamp, copyTo, density, divide, divide, elementMax, elementMin, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, exp, fill, getElements, getSlices, getSliceViews, getTransposeCopy, hashCode, isBoolean, isSameShape, isZero, iterator, join, log, multiply, mutable, negate, nonZeroCount, pow, reciprocal, rotateView, scale, scaleAdd, set, set, setElements, signum, sparse, sqrt, square, sub, toArray, toDoubleArray, toString, toVector
finalize, getClass, notify, notifyAll, wait, wait, wait
abs, asElementList, broadcastCloneLike, broadcastLike, clamp, copyTo, divide, divide, elementMax, elementMin, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, exp, fill, getElements, getSlices, getSliceViews, getTransposeCopy, isBoolean, isSameShape, isZero, join, log, multiply, mutable, negate, nonZeroCount, pow, reciprocal, rotateView, scale, scaleAdd, set, set, setElements, signum, sparse, sqrt, square, sub, toArray, toDoubleArray, toVector
public static NDArray wrap(double[] data, int[] shape)
public static NDArray wrap(IStridedArray a)
public static NDArray newArray(int... shape)
public void set(double value)
INDArray
set
in interface INDArray
set
in class AbstractArray<INDArray>
public void set(int x, double value)
set
in interface INDArray
set
in class AbstractArray<INDArray>
public void set(int x, int y, double value)
set
in interface INDArray
set
in class AbstractArray<INDArray>
public void set(int[] indexes, double value)
public void add(double a)
INDArray
add
in interface INDArray
add
in class AbstractArray<INDArray>
public void add(INDArray a)
INDArray
add
in interface INDArray
add
in class AbstractArray<INDArray>
public void sub(INDArray a)
INDArray
sub
in interface INDArray
sub
in class AbstractArray<INDArray>
public INDArray innerProduct(INDArray a)
INDArray
innerProduct
in interface INDArray
innerProduct
in class AbstractArray<INDArray>
public INDArray outerProduct(INDArray a)
INDArray
outerProduct
in interface INDArray
outerProduct
in class AbstractArray<INDArray>
public INDArray getTranspose()
INDArray
getTranspose
in interface INDArray
getTranspose
in class AbstractArray<INDArray>
public INDArray getTransposeView()
INDArray
getTransposeView
in interface INDArray
getTransposeView
in class AbstractArray<INDArray>
public AVector asVector()
INDArray
asVector
in interface INDArray
asVector
in class AbstractArray<INDArray>
public INDArray reshape(int... dimensions)
INDArray
reshape
in interface INDArray
reshape
in class AbstractArray<INDArray>
public INDArray broadcast(int... dimensions)
INDArray
broadcast
in interface INDArray
broadcast
in class AbstractArray<INDArray>
public INDArray slice(int majorSlice)
INDArray
public INDArray slice(int dimension, int index)
INDArray
public NDArray subArray(int[] offsets, int[] shape)
INDArray
subArray
in interface INDArray
subArray
in class AbstractArray<INDArray>
public boolean isMutable()
INDArray
isMutable
in interface INDArray
isMutable
in class AbstractArray<INDArray>
public boolean isFullyMutable()
INDArray
isFullyMutable
in interface INDArray
isFullyMutable
in class AbstractArray<INDArray>
public boolean isElementConstrained()
INDArray
isElementConstrained
in interface INDArray
isElementConstrained
in class AbstractArray<INDArray>
public boolean isView()
INDArray
public void applyOp(Op op)
INDArray
applyOp
in interface INDArray
applyOp
in class AbstractArray<INDArray>
public void applyOp(IOperator op)
INDArray
applyOp
in interface INDArray
applyOp
in class AbstractArray<INDArray>
public boolean equals(NDArray a)
public boolean equals(INDArray a)
INDArray
equals
in interface INDArray
equals
in class AbstractArray<INDArray>
public NDArray exactClone()
INDArray
public INDArray clone()
INDArray
clone
in interface INDArray
clone
in class AbstractArray<INDArray>
public void multiply(double d)
INDArray
multiply
in interface INDArray
multiply
in class AbstractArray<INDArray>
public void setElements(double[] values, int offset, int length)
INDArray
setElements
in interface INDArray
setElements
in class AbstractArray<INDArray>
public void toDoubleBuffer(DoubleBuffer dest)
INDArray
toDoubleBuffer
in interface INDArray
toDoubleBuffer
in class AbstractArray<INDArray>
public double[] asDoubleArray()
INDArray
asDoubleArray
in interface INDArray
asDoubleArray
in class AbstractArray<INDArray>
public List<INDArray> getSlices()
INDArray
getSlices
in interface INDArray
getSlices
in class AbstractArray<INDArray>
public Iterator<Double> elementIterator()
INDArray
elementIterator
in interface INDArray
elementIterator
in class AbstractArray<INDArray>
public void validate()
INDArray
validate
in interface INDArray
validate
in class AbstractArray<INDArray>
public INDArray immutable()
INDArray
immutable
in interface INDArray
immutable
in class AbstractArray<INDArray>
public double[] getArray()
public static INDArray wrapStrided(double[] data, int offset, int[] shape, int[] strides)
Copyright © 2014. All Rights Reserved.