public abstract class AScalar extends AbstractArray<Object> implements IScalar
| Constructor and Description |
|---|
AScalar() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AScalar s) |
void |
add(double d) |
void |
add(INDArray a) |
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)
|
AVector |
asVector()
Creates a view of the array as a single vector in row-major order.
|
INDArray |
broadcast(int... targetShape) |
AScalar |
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 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.
|
long |
elementCount()
Returns the total number of elements in this array.
|
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.
|
int |
hashCode() |
INDArray |
innerProduct(INDArray a) |
boolean |
isElementConstrained()
Returns true if the IND has additional 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)
|
Iterator<Object> |
iterator() |
void |
multiply(double factor)
Multiplies all elements of the array by a given double value
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
INDArray |
outerProduct(INDArray a) |
INDArray |
reshape(int... dimensions) |
void |
set(double value)
Sets the double value of a scalar array
|
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) |
int |
sliceCount() |
void |
sub(AScalar s) |
void |
sub(double d) |
void |
sub(INDArray a) |
String |
toString() |
void |
validate()
Validates the internal data structure of the INDArray.
|
get, get, scale, set, set, set, set, setElements, squarepublic abstract double get()
INDArraypublic void set(double value)
IScalarpublic 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 int dimensionality()
INDArraydimensionality in interface INDArraypublic int sliceCount()
sliceCount 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 void add(double d)
public void sub(double d)
public void add(AScalar s)
public void add(INDArray a)
add in interface INDArrayadd in class AbstractArray<Object>public void sub(INDArray a)
sub in interface INDArraysub in class AbstractArray<Object>public void sub(AScalar s)
public INDArray innerProduct(INDArray a)
innerProduct in interface INDArrayinnerProduct in class AbstractArray<Object>public INDArray outerProduct(INDArray a)
outerProduct 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 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)
reshape in interface INDArrayreshape in class AbstractArray<Object>public void applyOp(IOp op)
INDArraypublic void applyOp(Op op)
INDArraypublic AScalar clone()
INDArrayclone in interface INDArrayclone in class AbstractArray<Object>public void multiply(double factor)
INDArraypublic INDArray broadcast(int... targetShape)
broadcast in interface INDArraybroadcast in class AbstractArray<Object>public boolean equals(Object o)
equals in class AbstractArray<Object>public boolean equals(INDArray o)
INDArraypublic boolean equals(AScalar o)
public int hashCode()
hashCode in class AbstractArray<Object>public String toString()
toString 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.