public abstract class AScalar extends AbstractArray<Object> implements IScalar
| 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(AScalar s) |
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 |
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... targetShape)
Returns a view of this array broadcasted up to a larger shape
|
void |
clamp(double min,
double max)
Clamps all the elments of this array within the specified [min,max] range
|
Scalar |
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.
|
void |
copyTo(double[] arr)
Copies all the elements of this INDArray to the specified double array
|
int |
dimensionality()
Returns the dimensionality of the array (number of dimensions in the array shape)
e.g.
|
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.
|
double |
elementSquaredSum()
Returns the total sum of elements in this array.
|
double |
elementSum()
Returns the total sum of elements in this array.
|
boolean |
epsilonEquals(INDArray a)
Tests is 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)
Returns true if the two arrays are exactly equal in value and shape
|
boolean |
equals(Object o) |
abstract AScalar |
exactClone()
Returns an exact deep clone of an array (i.e.
|
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
|
void |
getElements(double[] dest,
int offset)
Gets all elements of the array, copying them into a double array
|
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() |
AScalar |
immutable() |
Scalar |
innerProduct(AScalar a) |
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 |
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 by a given double value
|
void |
multiply(INDArray a)
Multiplies all elements by the equivalent elements in a second array
|
AScalar |
mutable() |
void |
negate()
Negates all elements in the array
|
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
|
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 |
setElements(double[] values,
int offset,
int length)
Sets all 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)
|
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 |
sub(AScalar s) |
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.
|
double[] |
toDoubleArray()
Copies the elements of this INDArray to a new double array
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
String |
toString() |
void |
validate()
Validates the internal data structure of the INDArray.
|
asElementList, broadcastCloneLike, broadcastLike, divide, ensureMutable, exp, fill, get, get, getSliceViews, getTransposeCopy, isBoolean, isSameShape, log, reciprocal, scale, scaleAdd, set, set, set, set, setElements, signum, sqrt, toArray, toVectorfinalize, getClass, notify, notifyAll, wait, wait, waitasElementList, broadcastCloneLike, broadcastLike, divide, ensureMutable, exp, fill, get, get, getSliceViews, getTransposeCopy, isBoolean, isSameShape, isView, log, reciprocal, scale, scaleAdd, set, set, set, set, setElements, signum, sqrt, toArray, toVectorpublic abstract double get()
INDArraypublic void set(double value)
INDArraypublic void setElements(double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraypublic void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AbstractArray<Object>public AScalar getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in class AbstractArray<Object>public final AScalar getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in class AbstractArray<Object>public int dimensionality()
INDArraydimensionality in interface INDArraypublic INDArray slice(int position)
INDArraypublic INDArray slice(int dimension, int index)
INDArraypublic int sliceCount()
INDArraysliceCount in interface INDArraypublic List<Object> getSlices()
INDArraygetSlices in interface INDArraygetSlices in class AbstractArray<Object>public boolean isMutable()
INDArraypublic boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArraypublic boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArraypublic boolean isZero()
INDArrayisZero in interface INDArrayisZero in class AbstractArray<Object>public void add(double d)
INDArrayadd in interface INDArrayadd in class AbstractArray<Object>public void sub(double d)
INDArraysub in interface INDArraysub in class AbstractArray<Object>public void add(AScalar s)
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 sub(AScalar s)
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 INDArray outerProduct(INDArray a)
INDArrayouterProduct in interface INDArrayouterProduct in class AbstractArray<Object>public double get(int... indexes)
INDArraypublic int[] getShape()
INDArraypublic int getShape(int dim)
INDArraygetShape in interface INDArraygetShape in class AbstractArray<Object>public long[] getLongShape()
INDArraygetLongShape in interface INDArraypublic final long elementCount()
INDArrayelementCount in interface INDArraypublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AbstractArray<Object>public void copyTo(double[] arr)
INDArraycopyTo in interface INDArraycopyTo in class AbstractArray<Object>public AVector asVector()
INDArraypublic INDArray reshape(int... dimensions)
INDArrayreshape in interface INDArrayreshape in class AbstractArray<Object>public void applyOp(IOp op)
INDArraypublic void applyOp(Op op)
INDArraypublic Scalar clone()
INDArrayclone in interface INDArrayclone in class AbstractArray<Object>public void multiply(double factor)
INDArraypublic 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 elementSquaredSum()
INDArrayelementSquaredSum in interface INDArrayelementSquaredSum in class AbstractArray<Object>public INDArray broadcast(int... targetShape)
INDArraybroadcast in interface INDArraybroadcast in class AbstractArray<Object>public 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 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 abstract AScalar exactClone()
INDArrayexactClone in interface INDArraypublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class AbstractArray<Object>Copyright © 2013. All Rights Reserved.