public abstract class ADiagonalMatrix extends ASingleBandMatrix
| Modifier and Type | Field and Description |
|---|---|
protected int |
dimensions |
| Modifier | Constructor and Description |
|---|---|
protected |
ADiagonalMatrix(int dimensions) |
| Modifier and Type | Method and Description |
|---|---|
AMatrix |
addCopy(AMatrix a)
Adds another matrix to this matrix, returning a new matrix
|
void |
addToArray(double[] dest,
int offset)
Adds all the elements of this array to a double array, in row-major order
|
protected void |
checkIndex(int i,
int j)
Checks if the given index is valid for this matrix.
|
protected void |
checkSameShape(AMatrix m)
Checks if this matrix has the same shape as another matrix.
|
protected void |
checkSameShape(ARectangularMatrix m)
Checks if this matrix has the same shape as another matrix.
|
int |
checkSquare()
Checks if a matrix is square.
|
AMatrix |
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.
|
int |
columnCount()
Gets the number of columns in this matrix (dimension 1)
|
void |
copyColumnTo(int col,
double[] dest,
int destOffset)
Copies the elements in a selected row of this matrix to a double array
|
void |
copyRowTo(int row,
double[] dest,
int destOffset)
Copies the elements in a slected row of this matrix to a double array
|
double |
density()
Computes the density ratio of this sparse array (proportion of non-zero elements)
|
double |
determinant()
Calculates the determinant of the matrix.
|
double |
diagonalProduct()
Computes the product of entries on the main diagonal of a matrix
|
int |
dimensions()
Returns the number of dimensions of this diagonal matrix
|
double |
elementAbsPowSum(double p)
Returns the sum of the absolute values of all the elements raised to a specified power
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementPowSum(double p)
Returns the sum of all the elements raised to a specified power
|
double |
elementSquaredSum()
Returns the squared sum of all elements in this matrix
|
double |
elementSum()
Returns the sum of all elements in this matrix
|
boolean |
equalsTranspose(AMatrix m)
Tests if this matrix is exactly equal to the transpose of another matrix
|
abstract ADiagonalMatrix |
exactClone()
Creates a deep clone of an array, using the same class implementation as the original array
|
AVector |
getBand(int band)
Gets a specific band of the matrix, as a view vector.
|
ASingleElementVector |
getColumn(int col)
Returns a column of the matrix.
|
double |
getDiagonalValue(int i) |
abstract AVector |
getLeadingDiagonal()
Returns a vector view of the leading diagonal values of the matrix
|
AVector |
getNonZeroBand()
Gets the non-zero band from the matrix
|
ASingleElementVector |
getRow(int row)
Returns a row of the matrix.
|
ADiagonalMatrix |
getTranspose()
Returns the transpose of this array.
|
ADiagonalMatrix |
getTransposeView()
Returns a transposed view of the array.
|
boolean |
hasUncountable()
Checks to see if any element in the matrix is NaN of Infinite.
|
AMatrix |
innerProduct(ADiagonalMatrix a)
Computes the inner product of this matrix with another diagonal matrix of the same shape.
|
AMatrix |
innerProduct(AMatrix a)
Computes the inner product of this matrix with another.
|
boolean |
isBoolean()
Returns true if the array is boolean (contains only 0.0 or 1.0 values)
|
boolean |
isDiagonal()
Returns true iff this matrix is a square diagonal matrix
|
boolean |
isFullyMutable()
If this method returns true, the INDArray is guaranteed to be fully mutable
in all positions i.e.
|
boolean |
isIdentity()
Checks if this is an identity matrix (i.e.
|
boolean |
isLowerTriangular()
Returns true if a matrix is lower triangular.
|
abstract boolean |
isMutable()
Returns true if the INDArray is mutable (at least partially)
|
boolean |
isRectangularDiagonal()
Returns true iff this matrix is a diagonal matrix (might not be square)
|
boolean |
isSameShape(AMatrix m)
Returns true iff this matrix is exactly the same shape as another matrix
|
boolean |
isSameShape(ARectangularMatrix m) |
boolean |
isSquare()
Checks if this is a square matrix
|
boolean |
isSymmetric()
Returns true if a matrix is symmetric
|
boolean |
isUpperTriangular()
Returns true if a matrix is upper triangular
An upper triangular matrix is defined as having all elements equal to 0.0 where i > j
|
boolean |
isZero()
Returns true if the matrix is the zero matrix (all components zero)
|
int |
lowerBandwidthLimit()
A limit on the lower bandwidth of the banded matrix.
|
int |
nonZeroBand()
Specifies which band of the matrix is nonzero
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
int |
rank()
Calculate the rank of a matrix.
|
int |
rowCount()
Gets the number of rows in this matrix (dimension 0)
|
double |
rowDotProduct(int i,
AVector v)
Returns the dot product of a specific row with a vector.
|
void |
set(int row,
int column,
double value)
Sets a value at a given position in a mutable 2D array
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
Matrix |
toMatrix()
Coerces the matrix to the standard mutable Matrix type
in row major order.
|
Matrix |
toMatrixTranspose()
Coerces the transpose of a matrix to the standard mutable Matrix type
in row major order.
|
double |
trace()
Computes the trace of a matrix, i.e.
|
void |
transform(Vector source,
Vector dest) |
void |
transformInPlace(ADenseArrayVector v) |
void |
transformInPlace(AVector v) |
AMatrix |
transposeInnerProduct(AMatrix s) |
void |
transposeInPlace()
Transposes a matrix in place, if possible.
|
double |
unsafeGetDiagonalValue(int i) |
int |
upperBandwidthLimit()
A limit on the upper bandwidth of the banded matrix.
|
void |
validate()
Validates the internal data structure of the INDArray.
|
isSparse, subMatrixfill, getRowView, lowerBandwidth, multiply, upperBandwidthabs, add, add, add, add, add2, addAt, addCopy, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addOuterProduct, addOuterProduct, addRowMultiple, applyOp, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, bandIndex, bandLength, bandLength, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumn, checkColumnCount, checkDimension, checkRow, checkRowCount, checkShape, clamp, composeWith, copy, dense, denseClone, dimensionality, divide, divide, divide, divide, elementCount, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, equalsByRows, exp, get, get, get, get, getBandWrapped, getColumnClone, getColumns, getColumnView, getElements, getLongShape, getRowClone, getRows, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTransposeCopy, hashCode, hasOrthonormalColumns, hasOrthonormalRows, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isElementConstrained, isHermitian, isInvertible, isOrthogonal, isOrthogonal, isPositiveDefinite, isSameShape, isView, iterator, join, log, mul, multiply, multiply, multiply, multiplyCopy, multiplyRow, mutable, negate, outerProduct, outputDimensions, pow, reciprocal, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, replaceColumn, replaceRow, reshape, reshape, rotateView, scaleAdd, scaleAdd, set, set, set, set, set, set, set, set, setColumn, setElements, setElements, setRow, signum, slice, slice, sliceCount, sparse, sparseClone, sqrt, square, sub, sub, sub, subArray, swapColumns, swapRows, toAffineTransform, toArray, toDoubleBuffer, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, transform, transposeInnerProduct, unsafeGet, unsafeSetabsCopy, add, addAt, addInnerProduct, addPower, addPower, broadcastLike, checkMutable, componentCount, divideCopy, elementProduct, equals, equalsArray, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setMultiple, setMultiple, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitabsCopy, addAt, addPower, addPower, broadcastLike, checkMutable, componentCount, divideCopy, elementProduct, equalsArray, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setMultiple, setMultiple, signumCopy, sliceValue, squareCopy, sub, subCopy, withComponentsforEach, spliteratorpublic int nonZeroBand()
ASingleBandMatrixnonZeroBand in class ASingleBandMatrixpublic boolean isSquare()
IMatrixpublic boolean isZero()
AMatrixisZero in interface INDArrayisZero in class ASingleBandMatrixpublic boolean isBoolean()
INDArraypublic boolean isSymmetric()
AMatrixisSymmetric in interface IMatrixisSymmetric in class ASingleBandMatrixpublic boolean isDiagonal()
IMatrixisDiagonal in interface IMatrixisDiagonal in class AMatrixpublic boolean isRectangularDiagonal()
IMatrixisRectangularDiagonal in interface IMatrixisRectangularDiagonal in class AMatrixpublic boolean isUpperTriangular()
AMatrixisUpperTriangular in class ABandedMatrixpublic boolean isLowerTriangular()
AMatrixisLowerTriangular in class ABandedMatrixpublic abstract boolean isMutable()
INDArrayisMutable in interface INDArrayisMutable in class ABandedMatrixpublic boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArrayisFullyMutable in class ABandedMatrixprotected void checkSameShape(AMatrix m)
AMatrixcheckSameShape in class AMatrixprotected void checkSameShape(ARectangularMatrix m)
AMatrixcheckSameShape in class AMatrixprotected final void checkIndex(int i,
int j)
AMatrixcheckIndex in class AMatrixpublic final boolean isSameShape(ARectangularMatrix m)
public final int upperBandwidthLimit()
AMatrixupperBandwidthLimit in class ABandedMatrixpublic final int lowerBandwidthLimit()
AMatrixlowerBandwidthLimit in class ABandedMatrixpublic AVector getBand(int band)
AMatrixgetBand in interface IMatrixgetBand in interface IFastBandsgetBand in class ASingleBandMatrixpublic AVector getNonZeroBand()
ASingleBandMatrixgetNonZeroBand in class ASingleBandMatrixpublic double determinant()
AMatrixdeterminant in class AMatrixpublic int rank()
AMatrixrank in class ASingleBandMatrixpublic int dimensions()
public boolean isSameShape(AMatrix m)
AMatrixisSameShape in class AMatrixpublic int checkSquare()
AMatrixcheckSquare in class AMatrixpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AbstractArray<AVector>public double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AbstractArray<AVector>public double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class ABandedMatrixpublic double elementSquaredSum()
AMatrixelementSquaredSum in interface INDArrayelementSquaredSum in class ABandedMatrixpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class ASingleBandMatrixpublic void copyRowTo(int row,
double[] dest,
int destOffset)
AMatrixcopyRowTo in class ABandedMatrixrow - The index of the selected rowdest - Destination double[] arraydestOffset - Offset into destination arraypublic void addToArray(double[] dest,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class ABandedMatrixpublic AMatrix addCopy(AMatrix a)
IMatrixpublic void copyColumnTo(int col,
double[] dest,
int destOffset)
AMatrixcopyColumnTo in class AMatrixdest - Destination double[] arraypublic AMatrix innerProduct(ADiagonalMatrix a)
a - public AMatrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic AMatrix transposeInnerProduct(AMatrix s)
transposeInnerProduct in class AMatrixpublic void transformInPlace(AVector v)
transformInPlace in interface IMatrixtransformInPlace in class AMatrixpublic void transformInPlace(ADenseArrayVector v)
transformInPlace in class AMatrixpublic int rowCount()
IMatrixpublic int columnCount()
IMatrixpublic boolean isIdentity()
IMatrixisIdentity in interface IMatrixisIdentity in class ASingleBandMatrixpublic void transposeInPlace()
IMatrixtransposeInPlace in interface IMatrixtransposeInPlace in class AMatrixpublic double rowDotProduct(int i,
AVector v)
AMatrixrowDotProduct in class AMatrixpublic void set(int row,
int column,
double value)
INDArraypublic abstract AVector getLeadingDiagonal()
AMatrixgetLeadingDiagonal in class AMatrixpublic double getDiagonalValue(int i)
public ASingleElementVector getRow(int row)
IMatrixpublic ASingleElementVector getColumn(int col)
IMatrixpublic double unsafeGetDiagonalValue(int i)
public ADiagonalMatrix getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in interface IMatrixgetTranspose in class AMatrixpublic ADiagonalMatrix getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in interface IMatrixgetTransposeView in class AMatrixpublic double density()
ISparsedensity in interface ISparsedensity in class ABandedMatrixpublic Matrix toMatrix()
AMatrixtoMatrix in class ABandedMatrixpublic double trace()
IMatrixtrace in interface IMatrixtrace in class ABandedMatrixpublic double diagonalProduct()
AMatrixdiagonalProduct in interface IMatrixdiagonalProduct in class ABandedMatrixpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class ABandedMatrixpublic final Matrix toMatrixTranspose()
AMatrixtoMatrixTranspose in class ABandedMatrixpublic boolean equalsTranspose(AMatrix m)
AMatrixequalsTranspose in class AMatrixpublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class ABandedMatrixpublic abstract ADiagonalMatrix exactClone()
INDArrayexactClone in interface INDArrayexactClone in class AMatrixpublic AMatrix clone()
INDArraypublic boolean hasUncountable()
AMatrixhasUncountable in interface INDArrayhasUncountable in class ASingleBandMatrixpublic double elementPowSum(double p)
elementPowSum in interface INDArrayelementPowSum in class ASingleBandMatrixpublic double elementAbsPowSum(double p)
elementAbsPowSum in interface INDArrayelementAbsPowSum in class ASingleBandMatrixCopyright © 2016. All rights reserved.