public final class DiagonalMatrix extends ADiagonalMatrix
dimensions| Constructor and Description |
|---|
DiagonalMatrix(int dimensions) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
static DiagonalMatrix |
create(AMatrix m) |
static DiagonalMatrix |
create(AVector v) |
static DiagonalMatrix |
create(double... values) |
static DiagonalMatrix |
createDimensions(int dims) |
double |
determinant()
Calculates the determinant of the matrix.
|
double |
diagonalProduct()
Computes the product of entries on the main diagonal of a matrix
|
double |
elementSum()
Returns the sum of all elements in this matrix
|
DiagonalMatrix |
exactClone()
Creates a deep clone of an array, using the same class implementation as the original array
|
double |
get(int row,
int column)
Returns the double value at the specified position in a 2D matrix
|
double |
getDiagonalValue(int i) |
Vector |
getLeadingDiagonal()
Returns a vector view of the leading diagonal values of the matrix
|
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.
|
DiagonalMatrix |
inverse()
Computes the inverse of a matrix.
|
boolean |
isBoolean()
Returns true if the array is boolean (contains only 0.0 or 1.0 values)
|
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 |
isMutable()
Returns true if the INDArray is mutable (at least partially)
|
boolean |
isZero()
Returns true if the matrix is the zero matrix (all components zero)
|
void |
multiply(double factor)
Multiplies all elements of the array in place by a given double value
|
DiagonalMatrix |
multiplyCopy(double factor)
Returns a copy of the array with all elements multiplied by a single constant value
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
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 |
trace()
Computes the trace of a matrix, i.e.
|
void |
transform(Vector source,
Vector dest) |
void |
transformInPlace(ADenseArrayVector v) |
void |
transformInPlace(AVector v) |
double |
unsafeGet(int row,
int column)
Gets an element in the matrix in an unsafe fashion, without performing bound checks
The result is undefined if the row and column are out of bounds.
|
double |
unsafeGetDiagonalValue(int i) |
void |
unsafeSet(int row,
int column,
double value)
Sets an element value in the matrix in an unsafe fashion, without performing bound checks
The result is undefined if the row and column are out of bounds.
|
void |
validate()
Validates the internal data structure of the INDArray.
|
static DiagonalMatrix |
wrap(double[] data) |
static DiagonalMatrix |
wrap(Vector data) |
addCopy, addToArray, checkIndex, checkSameShape, checkSameShape, checkSquare, columnCount, copyColumnTo, copyRowTo, density, dimensions, elementAbsPowSum, elementMax, elementMin, elementPowSum, elementSquaredSum, equalsTranspose, getBand, getColumn, getNonZeroBand, getRow, getTranspose, getTransposeView, hasUncountable, isDiagonal, isLowerTriangular, isRectangularDiagonal, isSameShape, isSameShape, isSquare, isSymmetric, isUpperTriangular, lowerBandwidthLimit, nonZeroBand, rank, rowCount, toDoubleArray, toMatrix, toMatrixTranspose, transposeInnerProduct, transposeInPlace, upperBandwidthLimitisSparse, subMatrixfill, getRowView, lowerBandwidth, 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, 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, isElementConstrained, isHermitian, isInvertible, isOrthogonal, isOrthogonal, isPositiveDefinite, isSameShape, isView, iterator, join, log, mul, multiply, multiply, multiply, 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, transposeInnerProductabsCopy, 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 static DiagonalMatrix createDimensions(int dims)
public static DiagonalMatrix create(double... values)
public static DiagonalMatrix create(AVector v)
public static DiagonalMatrix create(AMatrix m)
public static DiagonalMatrix wrap(double[] data)
public static DiagonalMatrix wrap(Vector data)
public double trace()
IMatrixtrace in interface IMatrixtrace in class ADiagonalMatrixpublic double diagonalProduct()
AMatrixdiagonalProduct in interface IMatrixdiagonalProduct in class ADiagonalMatrixpublic double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class ADiagonalMatrixpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class ADiagonalMatrixpublic double get(int row,
int column)
INDArraypublic double unsafeGet(int row,
int column)
AMatrixpublic void set(int row,
int column,
double value)
INDArraypublic void unsafeSet(int row,
int column,
double value)
AMatrixpublic boolean isMutable()
INDArrayisMutable in interface INDArrayisMutable in class ADiagonalMatrixpublic boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArrayisFullyMutable in class ADiagonalMatrixpublic void multiply(double factor)
INDArraymultiply in interface INDArraymultiply in class ABandedMatrixpublic DiagonalMatrix multiplyCopy(double factor)
INDArraymultiplyCopy in interface INDArraymultiplyCopy in class AMatrixfactor - A scalar factorpublic double rowDotProduct(int i,
AVector v)
AMatrixrowDotProduct in class ADiagonalMatrixpublic void transform(Vector source, Vector dest)
transform in class ADiagonalMatrixpublic void transformInPlace(AVector v)
transformInPlace in interface IMatrixtransformInPlace in class ADiagonalMatrixpublic void transformInPlace(ADenseArrayVector v)
transformInPlace in class ADiagonalMatrixpublic boolean isIdentity()
IMatrixisIdentity in interface IMatrixisIdentity in class ADiagonalMatrixpublic boolean isBoolean()
INDArrayisBoolean in interface INDArrayisBoolean in class ADiagonalMatrixpublic boolean isZero()
AMatrixisZero in interface INDArrayisZero in class ADiagonalMatrixpublic AMatrix clone()
INDArrayclone in interface INDArrayclone in class ADiagonalMatrixpublic double determinant()
AMatrixdeterminant in class ADiagonalMatrixpublic DiagonalMatrix inverse()
AMatrixpublic double getDiagonalValue(int i)
getDiagonalValue in class ADiagonalMatrixpublic double unsafeGetDiagonalValue(int i)
unsafeGetDiagonalValue in class ADiagonalMatrixpublic Vector getLeadingDiagonal()
AMatrixgetLeadingDiagonal in class ADiagonalMatrixpublic AMatrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class ADiagonalMatrixpublic AMatrix innerProduct(ADiagonalMatrix a)
ADiagonalMatrixinnerProduct in class ADiagonalMatrixpublic DiagonalMatrix exactClone()
INDArrayexactClone in interface INDArrayexactClone in class ADiagonalMatrixpublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class ADiagonalMatrixCopyright © 2016. All rights reserved.