public abstract class AScalar extends AbstractArray<Object> implements IScalar, IDense
| Constructor and Description |
|---|
AScalar() |
| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Replaces all elements of this array with their absolute values, according to Math.abs(double)
|
void |
add(double d)
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 |
addAt(long i,
double v)
Adds to a mutable array, indexed by element position in row major order.
|
AScalar |
addCopy(double d)
Creates a new array equal to this array with a constant value added to every element
|
void |
addInnerProduct(INDArray a,
INDArray b)
Adds the inner product of two arrays to this array.
|
void |
addToArray(double[] data,
int offset)
Adds all the elements of this array to a double array, in row-major 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)
|
void |
applyOp(Op2 op,
double b)
Applies a binary operator to this array and a double value.
|
void |
applyOp(Op2 op,
INDArray b)
Applies a binary operator to this array and a second array.
|
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... targetShape)
Returns a view of this array broadcasted up to a larger shape
|
AMatrix |
broadcastLike(AMatrix v)
Broadcasts an array to match the shape of the target matrix
|
AVector |
broadcastLike(AVector v)
Broadcasts an array to match the shape of the target vector
|
INDArray |
broadcastLike(INDArray v)
Broadcasts an array to match the shape of the target
|
protected void |
checkDimension(int dimension)
Checks if an array has the specified dimension.
|
void |
clamp(double min,
double max)
Clamps all the elements of this array within the specified [min,max] range
|
Scalar |
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.
|
INDArray |
dense()
Coerces this INDArray to a dense format, without changing its element values.
|
Scalar |
denseClone()
Creates a fully mutable dense clone of this array.
|
int |
dimensionality()
Returns the dimensionality of the array (i.e.
|
void |
divide(double factor)
Divides all elements by a given factor
|
long |
elementCount()
Returns the total number of elements in this array.
|
Iterator<Double> |
elementIterator()
Returns an iterator over all elements in this array, in row-major order
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementProduct()
Returns the product of all elements in the array.
|
boolean |
elementsEqual(double value)
Returns true if all elements are equal to a specific value
|
double |
elementSquaredSum()
Returns the sum of squared elements in this array.
|
double |
elementSum()
Returns the sum of all elements in this array.
|
boolean |
epsilonEquals(INDArray a)
Tests if this array is approximately equal to another array.
|
boolean |
epsilonEquals(INDArray a,
double epsilon)
Tests is this array is approximately equal to another array, up to a given tolerance (epsilon)
The arrays must have the same shape
|
boolean |
equals(AScalar o) |
boolean |
equals(INDArray o)
Checks if two arrays are equal exactly in terms of both value and shape
|
boolean |
equals(Object o) |
boolean |
equalsArray(double[] data,
int offset)
Returns true if the elements in this array exactly match the elements in the given array, in
row-major order
|
abstract AScalar |
exactClone()
Creates a deep clone of an array, using the same class implementation as the original array
|
abstract 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
|
void |
getElements(double[] arr)
Copies all the elements of this INDArray to the specified double array
|
void |
getElements(double[] dest,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
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<Object> |
getSlices()
Returns a list of all major slices of this array.
|
AScalar |
getTranspose()
Returns the transpose of this array.
|
AScalar |
getTransposeView()
Returns a transposed view of the array.
|
int |
hashCode() |
boolean |
hasUncountable()
Returns true if any element is this array is NaN or infinite
|
ImmutableScalar |
immutable()
Returns an immutable version of this array.
|
Scalar |
innerProduct(AScalar a)
Calculates the inner product of this array with a scalar
|
AVector |
innerProduct(AVector a)
Computes the inner product of this array with a vector
|
Scalar |
innerProduct(double a)
Calculates the inner product of this array with a double value
|
INDArray |
innerProduct(INDArray a)
Calculates the inner product of this array with another array.
|
boolean |
isBoolean()
Returns true if the array is boolean (contains only 0.0 or 1.0 values)
|
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 |
isZero()
Returns true if the array is zero (all elements equal to zero)
|
Iterator<Object> |
iterator() |
void |
multiply(double factor)
Multiplies all elements of the array in place by a given double value
|
void |
multiply(INDArray a)
Multiplies all elements by the equivalent elements in a second array, i.e.
|
AScalar |
mutable()
Coerces this INDArray to a fully mutable format.
|
void |
negate()
Negates all elements in the array in place
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
INDArray |
outerProduct(INDArray a)
Calculates the outer product of this array with another array.
|
void |
pow(double exponent)
Raises all elements of the array to a specified power in place
|
double |
reduce(Op2 op)
Reduces over all elements of the array in row-major order.
|
double |
reduce(Op2 op,
double init)
Reduces over all elements of the array in row-major order.
|
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 |
setElements(double[] values,
int offset)
Sets all elements in an array using the given double values
|
void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
INDArray |
slice(int position)
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
|
int |
sliceCount()
Returns the number of major slices in this array (i.e.
|
AScalar |
sparse()
Coerces this INDArray to a sparse format, without changing its element values.
|
Scalar |
sparseClone()
Creates a fully mutable clone of this array.
|
void |
square()
Squares all elements of the array in place
|
void |
sub(double d)
Subtracts a double value from all elements in this array
|
void |
sub(INDArray a)
Subtracts all the elements of another array from this array, in an elementwise order.
|
AScalar |
subArray(int[] offsets,
int[] shape)
Returns a subarray view of a larger array
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
INDArray[] |
toSliceArray()
Copies the slices of this array to a new INDArray[]
|
String |
toString() |
void |
validate()
Validates the internal data structure of the INDArray.
|
absCopy, add, addCopy, addInnerProduct, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, applyOpCopy, asElementList, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, copy, density, divide, divideCopy, elementAbsPowSum, elementPowSum, ensureMutable, equals, equalsArray, exp, fill, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getShapeClone, getSlices, getSliceViews, getTransposeCopy, isDense, isSameShape, isSparse, join, join, log, multiplyCopy, multiplyCopy, negateCopy, reciprocal, reciprocalCopy, reduceSlices, reduceSlices, reorder, reorder, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, sliceValue, sqrt, squareCopy, sub, subCopy, toArray, toStringFull, toVector, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitabsCopy, addCopy, addMultiple, addOuterProduct, addPower, addPower, applyOpCopy, asElementList, broadcastCloneLike, broadcastCopyLike, checkMutable, componentCount, copy, divide, divideCopy, elementAbsPowSum, elementPowSum, ensureMutable, equalsArray, exp, fill, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getShapeClone, getSlices, getSliceViews, getTransposeCopy, isDense, isSameShape, isSparse, isView, join, join, log, multiplyCopy, multiplyCopy, negateCopy, reciprocal, reciprocalCopy, reduceSlices, reduceSlices, reorder, reorder, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, sliceValue, sqrt, squareCopy, subCopy, toArray, toVector, withComponentsforEach, spliteratorpublic abstract double get()
INDArraypublic void set(double value)
INDArraypublic double get(int x)
INDArrayget in interface INDArrayget in class AbstractArray<Object>public double get(int x,
int y)
INDArrayget in interface INDArrayget in class AbstractArray<Object>public void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<Object>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 getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AbstractArray<Object>public final AScalar getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in class AbstractArray<Object>public final AScalar getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in class AbstractArray<Object>public final int dimensionality()
INDArraydimensionality in interface INDArraypublic INDArray slice(int position)
INDArraypublic INDArray slice(int dimension, int index)
INDArraypublic final int sliceCount()
INDArraysliceCount in interface INDArraypublic List<Object> getSlices()
INDArraygetSlices in interface INDArraygetSlices in class AbstractArray<Object>public AScalar subArray(int[] offsets, int[] shape)
INDArraysubArray in interface INDArraysubArray in class AbstractArray<Object>public boolean isMutable()
INDArrayisMutable in interface INDArrayisMutable in class AbstractArray<Object>public boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArrayisFullyMutable in class AbstractArray<Object>public boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArrayisElementConstrained in class AbstractArray<Object>public boolean isZero()
INDArrayisZero in interface INDArrayisZero in class AbstractArray<Object>public boolean isBoolean()
INDArrayisBoolean in interface INDArrayisBoolean in class AbstractArray<Object>public void add(double d)
INDArrayadd in interface INDArrayadd in class AbstractArray<Object>public AScalar addCopy(double d)
INDArrayaddCopy in interface INDArrayaddCopy in class AbstractArray<Object>public void addAt(long i,
double v)
INDArrayaddAt in interface INDArrayaddAt in class AbstractArray<Object>public void addToArray(double[] data,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class AbstractArray<Object>public final void addInnerProduct(INDArray a, INDArray b)
INDArrayaddInnerProduct in interface INDArrayaddInnerProduct in class AbstractArray<Object>public void sub(double d)
INDArraysub in interface INDArraysub in class AbstractArray<Object>public void add(INDArray a)
INDArrayadd in interface INDArrayadd in class AbstractArray<Object>public void sub(INDArray a)
INDArraysub in interface INDArraysub in class AbstractArray<Object>public void negate()
INDArraynegate in interface INDArraynegate in class AbstractArray<Object>public void square()
INDArraysquare in interface INDArraysquare in class AbstractArray<Object>public void pow(double exponent)
INDArraypow in interface INDArraypow in class AbstractArray<Object>public void clamp(double min,
double max)
INDArrayclamp in interface INDArrayclamp in class AbstractArray<Object>public INDArray innerProduct(INDArray a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<Object>public Scalar innerProduct(AScalar a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<Object>public Scalar innerProduct(double a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<Object>public AVector innerProduct(AVector a)
INDArrayinnerProduct in interface INDArrayinnerProduct in class AbstractArray<Object>a - A vectorpublic INDArray outerProduct(INDArray a)
INDArrayouterProduct in interface INDArrayouterProduct in class AbstractArray<Object>public double get(int... indexes)
INDArraypublic void set(int[] indexes,
double value)
INDArraypublic int[] getShape()
INDArraypublic int getShape(int dim)
INDArraygetShape in interface INDArraygetShape in class AbstractArray<Object>public long[] getLongShape()
INDArraygetLongShape in interface INDArraygetLongShape in class AbstractArray<Object>public final long elementCount()
INDArrayelementCount in interface INDArraypublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AbstractArray<Object>public void getElements(double[] arr)
INDArraygetElements in interface INDArraygetElements in class AbstractArray<Object>public void setElements(double[] values,
int offset)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<Object>values - 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.public AVector asVector()
INDArrayasVector in interface INDArrayasVector in class AbstractArray<Object>public INDArray reshape(int... dimensions)
INDArrayreshape in interface INDArrayreshape in class AbstractArray<Object>public void applyOp(IOperator op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Object>op - The operator to apply to the arraypublic void applyOp(Op op)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Object>public void applyOp(Op2 op, INDArray b)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Object>public void applyOp(Op2 op, double b)
INDArrayapplyOp in interface INDArrayapplyOp in class AbstractArray<Object>public double reduce(Op2 op, double init)
INDArrayreduce in interface INDArrayreduce in class AbstractArray<Object>public final double reduce(Op2 op)
INDArrayreduce in interface INDArrayreduce in class AbstractArray<Object>public Scalar clone()
INDArrayclone in interface INDArrayclone in class AbstractArray<Object>public void multiply(double factor)
INDArraymultiply in interface INDArraymultiply in class AbstractArray<Object>public void divide(double factor)
INDArraydivide in interface INDArraydivide in class AbstractArray<Object>public void multiply(INDArray a)
INDArraymultiply in interface INDArraymultiply in class AbstractArray<Object>public final double elementSum()
INDArrayelementSum in interface INDArrayelementSum in class AbstractArray<Object>public final double elementProduct()
INDArrayelementProduct in interface INDArrayelementProduct in class AbstractArray<Object>public double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AbstractArray<Object>public double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AbstractArray<Object>public final double elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AbstractArray<Object>public INDArray broadcast(int... targetShape)
INDArraybroadcast in interface INDArraybroadcast in class AbstractArray<Object>public INDArray broadcastLike(INDArray v)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AbstractArray<Object>v - The target arraypublic AVector broadcastLike(AVector v)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AbstractArray<Object>v - The target vectorpublic AMatrix broadcastLike(AMatrix v)
INDArraybroadcastLike in interface INDArraybroadcastLike in class AbstractArray<Object>v - The target matrixpublic boolean equals(Object o)
equals in class AbstractArray<Object>public boolean epsilonEquals(INDArray a)
INDArrayepsilonEquals in interface INDArrayepsilonEquals in class AbstractArray<Object>public boolean epsilonEquals(INDArray a, double epsilon)
INDArrayepsilonEquals in interface INDArrayepsilonEquals in class AbstractArray<Object>public boolean equals(INDArray o)
INDArrayequals in interface INDArrayequals in class AbstractArray<Object>public boolean equalsArray(double[] data,
int offset)
INDArrayequalsArray in interface INDArrayequalsArray in class AbstractArray<Object>data - Array of double element values to check for equalityoffset - Offset into the data arraypublic boolean equals(AScalar o)
public int hashCode()
hashCode in class AbstractArray<Object>public String toString()
toString in class AbstractArray<Object>public Iterator<Double> elementIterator()
INDArrayelementIterator in interface INDArrayelementIterator in class AbstractArray<Object>public void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AbstractArray<Object>public double[] asDoubleArray()
INDArrayasDoubleArray in interface INDArrayasDoubleArray in class AbstractArray<Object>public double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class AbstractArray<Object>public INDArray[] toSliceArray()
INDArraytoSliceArray in interface INDArraytoSliceArray in class AbstractArray<Object>public abstract AScalar exactClone()
INDArrayexactClone in interface INDArraypublic AScalar mutable()
INDArraypublic boolean elementsEqual(double value)
INDArrayelementsEqual in interface INDArrayelementsEqual in class AbstractArray<Object>public AScalar sparse()
INDArraysparse in interface INDArraysparse in class AbstractArray<Object>public INDArray dense()
INDArraydense in interface INDArraydense in class AbstractArray<Object>public final Scalar denseClone()
INDArraydenseClone in interface INDArraydenseClone in class AbstractArray<Object>public final Scalar sparseClone()
INDArraysparseClone in interface INDArraysparseClone in class AbstractArray<Object>public ImmutableScalar immutable()
INDArraypublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class AbstractArray<Object>protected final void checkDimension(int dimension)
AbstractArraycheckDimension in class AbstractArray<Object>public void abs()
INDArrayabs in interface INDArrayabs in class AbstractArray<Object>public boolean hasUncountable()
AbstractArrayhasUncountable in interface INDArrayhasUncountable in class AbstractArray<Object>Copyright © 2016. All rights reserved.