public abstract class AMatrix extends ALinearTransform implements IMatrix, Iterable<AVector>, INDArray
| Constructor and Description |
|---|
AMatrix() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AMatrix m)
Adds another matrix to this matrix.
|
void |
add(AVector v) |
void |
add(double d) |
void |
add(INDArray a) |
void |
addAt(int i,
int j,
double d) |
void |
addMultiple(AMatrix m,
double factor) |
void |
addRowMultiple(int src,
int dst,
double factor) |
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()
Returns the matrix values as a single reference Vector in the form [row0
row1 row2....]
|
INDArray |
broadcast(int... targetShape) |
double |
calculateElement(int i,
AVector v)
Calculates a single element of the output.
|
AMatrix |
clone()
Clones the transform, performing a deep copy where needed
|
AVector |
cloneRow(int row) |
abstract int |
columnCount()
Returns the number of columns in the matrix
|
AMatrix |
compose(AMatrix a)
Composes this matrix with another matrix (matrix multiplication)
Returns a new matrix that represents the compose transformation.
|
ATransform |
compose(ATransform a)
Composes this transformation with another transformation, returning
a new combined transformation
|
void |
composeWith(AMatrix a) |
void |
composeWith(ATransform a)
Composes this transformation with a given transformation,
mutating the transformation to represent the combined transform
|
AMatrix |
copyOfMatrix()
Returns a deep copy of the transformation matrix for this affine transform
|
AVector |
copyOfTranslationVector()
Returns a deep copy of the translation vector for this affine transform
|
double |
determinant()
Calculates the determinant of the matrix.
|
int |
dimensionality() |
long |
elementCount() |
void |
elementMul(AMatrix m)
Multiplies this matrix in-place by another in an entrywise manner (Hadamard product).
|
double |
elementSum()
Returns the sum of all elements in the matrix
|
boolean |
epsilonEquals(AMatrix a)
Returns true if this matrix is approximately equal to
a second matrix, up to a default tolerance level
|
boolean |
equals(AAffineTransform a) |
boolean |
equals(AMatrix a) |
boolean |
equals(INDArray v)
Returns true if the two arrays are exactly equal in value and shape
|
boolean |
equals(Object o) |
abstract AMatrix |
exactClone()
Returns an exact deep clone of an array (i.e.
|
double |
get() |
double |
get(int... indexes) |
double |
get(int row) |
abstract double |
get(int row,
int column)
Returns a specified element in the matrix
|
AVector |
getColumn(int column)
Returns a column of the matrix as a vector view
|
AVector |
getLeadingDiagonal()
Returns a new vector that contains the leading diagonal values of the matrix
|
long[] |
getLongShape()
Returns the shape of the array as an array of longs.
|
AMatrix |
getMatrixComponent() |
AVector |
getRow(int row)
Returns a row of the matrix as a vector view
|
int[] |
getShape()
Returns the shape of the array as an array of ints.
|
List<AVector> |
getSlices() |
AMatrix |
getTranspose()
Returns a transposed version of this matrix.
|
int |
hashCode() |
AMatrix |
innerProduct(AMatrix a) |
AMatrix |
innerProduct(AScalar s) |
AVector |
innerProduct(AVector v) |
INDArray |
innerProduct(INDArray a) |
int |
inputDimensions()
Returns the number of dimensions required for input vectors
|
AMatrix |
inverse()
Return the inverse of this transformation if possible
|
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 |
isIdentity()
Returns true if this transform is known to be the identity function, i.e.
|
boolean |
isInvertible()
Returns true if this transform is invertible
|
boolean |
isMutable()
Returns true if the INDArray is mutable (at least partially)
|
boolean |
isSquare()
Returns true if the transform is square (same number of input and output dimensions)
|
boolean |
isView()
Return true if this is a view
|
boolean |
isZeroMatrix()
Returns true if the matrix is the zero matrix (all components zero)
|
Iterator<AVector> |
iterator()
Returns an iterator over rows in this Matrix
|
void |
mul(AMatrix a)
"Multiplies" this matrix by another, composing the transformation
|
void |
multiply(double factor) |
void |
multiplyRow(int i,
double factor) |
INDArray |
outerProduct(INDArray a) |
int |
outputDimensions()
Returns the number of dimensions required for output vectors
|
INDArray |
reshape(int... dimensions) |
abstract int |
rowCount()
Returns the number of rows in the matrix
|
void |
scale(double factor)
Scales a matrix by a constant scalar factor.
|
void |
set(AMatrix a) |
void |
set(double value) |
void |
set(INDArray a) |
void |
set(int[] indexes,
double value) |
void |
set(int row,
double value) |
abstract void |
set(int row,
int column,
double value)
Sets a specified element in the matrix
|
void |
set(Object o) |
void |
setElements(double[] values)
Sets all elements in an array using the given double values
|
void |
setElements(double[] values,
int offset,
int length) |
AVector |
slice(int rowNumber) |
int |
sliceCount() |
void |
sub(AMatrix m)
Subtracts another matrix from this one
|
void |
sub(AVector v) |
void |
sub(double d) |
void |
sub(INDArray a) |
void |
swapColumns(int i,
int j)
Swaps two columns of the matrix in place
|
void |
swapRows(int i,
int j)
Swaps two rows of the matrix in place
|
AAffineTransform |
toAffineTransform() |
AMatrix |
toMutableMatrix()
Creates a fully mutable deep copy of this matrix
|
String |
toString() |
AVector |
toVector()
Converts the matrix to a single flattened vector
in row major order.
|
double |
trace() |
void |
transform(AVector source,
AVector dest)
Transforms the source vector, storing the result in the given destination vector
|
void |
transformInPlace(AVector v)
Transforms a vector destructively.
|
void |
transposeInPlace() |
getTranslationComponent, isLinearcompose, transformNormaltakeComponents, takeComponents, takeComponents, transformpublic abstract int rowCount()
public abstract int columnCount()
columnCount in interface IMatrixpublic abstract double get(int row,
int column)
public abstract void set(int row,
int column,
double value)
public int dimensionality()
dimensionality in interface INDArraypublic long elementCount()
elementCount in interface INDArraypublic int sliceCount()
sliceCount in interface INDArraypublic int[] getShape()
INDArraypublic long[] getLongShape()
INDArraygetLongShape in interface INDArraypublic AVector getLeadingDiagonal()
public double calculateElement(int i,
AVector v)
ATransformcalculateElement in class AAffineTransformpublic AAffineTransform toAffineTransform()
toAffineTransform in class AAffineTransformpublic AMatrix getMatrixComponent()
getMatrixComponent in class AAffineTransformpublic boolean isIdentity()
ATransformisIdentity in class AAffineTransformpublic boolean isSquare()
ATransformisSquare in class ATransformpublic int inputDimensions()
ATransforminputDimensions in interface ITransforminputDimensions in class ATransformpublic int outputDimensions()
ATransformoutputDimensions in interface ITransformoutputDimensions in class ATransformpublic void transform(AVector source, AVector dest)
ATransformtransform in interface ITransformtransform in class AAffineTransformpublic void transformInPlace(AVector v)
ATransformtransformInPlace in class AAffineTransformpublic AVector getRow(int row)
public AVector getColumn(int column)
public AVector cloneRow(int row)
public void set(AMatrix a)
public void setElements(double[] values,
int offset,
int length)
setElements in interface INDArraypublic void setElements(double[] values)
INDArraysetElements in interface INDArraypublic boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArraypublic boolean isMutable()
INDArraypublic boolean isElementConstrained()
INDArrayisElementConstrained in interface INDArraypublic AMatrix clone()
ATransformclone in interface INDArrayclone in class ATransformpublic double determinant()
public AMatrix toMutableMatrix()
public void transposeInPlace()
public AMatrix getTranspose()
public void add(AMatrix m)
m - public void add(AVector v)
public void sub(AVector v)
public void sub(double d)
public final void scale(double factor)
public double elementSum()
m - public void sub(AMatrix m)
m - public void elementMul(AMatrix m)
m - public void mul(AMatrix a)
a - public void multiplyRow(int i,
double factor)
public void addRowMultiple(int src,
int dst,
double factor)
public void composeWith(ATransform a)
ATransformcomposeWith in class ATransformpublic void composeWith(AMatrix a)
public boolean isView()
INDArraypublic AMatrix copyOfMatrix()
AAffineTransformcopyOfMatrix in class AAffineTransformpublic AVector copyOfTranslationVector()
AAffineTransformcopyOfTranslationVector in class AAffineTransformpublic void addMultiple(AMatrix m, double factor)
public boolean equals(Object o)
equals in class AAffineTransformpublic boolean equals(AMatrix a)
public boolean equals(INDArray v)
INDArraypublic boolean epsilonEquals(AMatrix a)
public boolean equals(AAffineTransform a)
equals in class AAffineTransformpublic int hashCode()
hashCode in class AAffineTransformpublic AVector asVector()
public ATransform compose(ATransform a)
ATransformcompose in class AAffineTransformpublic final AMatrix compose(AMatrix a)
a - public INDArray innerProduct(INDArray a)
innerProduct in interface INDArraypublic INDArray outerProduct(INDArray a)
outerProduct in interface INDArraypublic AMatrix inverse()
ATransforminverse in class AAffineTransformpublic double trace()
public boolean isInvertible()
ATransformisInvertible in class AAffineTransformpublic void swapRows(int i,
int j)
public void swapColumns(int i,
int j)
public AVector toVector()
public void applyOp(Op op)
INDArraypublic void applyOp(IOp op)
INDArraypublic void add(double d)
public void addAt(int i,
int j,
double d)
public INDArray broadcast(int... targetShape)
public boolean isZeroMatrix()
public abstract AMatrix exactClone()
INDArrayexactClone in interface INDArrayCopyright © 2013. All Rights Reserved.