public final class PermutationMatrix extends ABooleanMatrix implements IFastRows, IFastColumns, ISparse
cols, rows| Modifier and Type | Method and Description |
|---|---|
void |
addToArray(double[] data,
int offset)
Adds all the elements of this array to a double array, in row-major order
|
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
|
static PermutationMatrix |
create(Index rowPermutations) |
static PermutationMatrix |
create(int... rowPermutations) |
static PermutationMatrix |
createIdentity(int length) |
static PermutationMatrix |
createRandomPermutation(int length) |
static PermutationMatrix |
createSwap(int i,
int j,
int length) |
double |
density()
Computes the density ratio of this sparse array (proportion of non-zero elements)
|
double |
determinant()
Calculates the determinant of the matrix.
|
double |
elementAbsPowSum(double p)
Returns the sum of the absolute values of all the elements raised to a specified power
|
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
|
PermutationMatrix |
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
|
AxisVector |
getColumn(int j)
Returns a column of the matrix.
|
AxisVector |
getRow(int i)
Returns a row of the matrix.
|
PermutationMatrix |
getTranspose()
Returns the transpose of this array.
|
boolean |
hasOrthonormalColumns()
Tests whether all columns in the matrix are orthonormal vectors
|
boolean |
hasOrthonormalRows()
Tests whether all rows in the matrix are orthonormal vectors
|
boolean |
hasUncountable()
Checks to see if any element in the matrix is NaN of Infinite.
|
Matrix |
innerProduct(AMatrix a)
Computes the inner product of this matrix with another.
|
PermutationMatrix |
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 |
isDiagonal()
Returns true iff this matrix is a square diagonal matrix
|
boolean |
isIdentity()
Checks if this is an identity matrix (i.e.
|
boolean |
isLowerTriangular()
Returns true if a matrix is lower triangular.
|
boolean |
isMutable()
Returns true if the INDArray is mutable (at least partially)
|
boolean |
isOrthogonal()
Check to see if the matrix is orthogonal
(default tolerance: 1e-8)
|
boolean |
isOrthogonal(double tolerance)
Check to see if the matrix is orthogonal
|
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)
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
int |
rank()
Calculate the rank of a matrix.
|
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
|
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
This is an elementary row operation
|
double |
trace()
Computes the trace of a matrix, i.e.
|
void |
transform(AVector source,
AVector dest)
Transforms a source vector into a destination vector, using matrix multiplication (inner product).
|
void |
transform(Vector source,
Vector dest) |
Matrix |
transposeInnerProduct(Matrix s) |
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.
|
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 PermutationMatrix |
wrap(Index rowPermutations) |
static PermutationMatrix |
wrap(int[] rowPermutations) |
absCopy, elementMax, isFullyMutable, signumCopy, squareCopybandLength, checkColumn, checkIndex, checkRow, checkSameShape, checkSameShape, checkSquare, columnCount, elementCount, getShape, getShape, getShapeClone, isSameShape, isSameShape, isSameShape, isSquare, rowCountabs, add, add, add, add, add2, addAt, addCopy, 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, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumnCount, checkDimension, checkRowCount, checkShape, clamp, clone, composeWith, copy, dense, denseClone, diagonalProduct, dimensionality, divide, divide, divide, divide, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, equalsByRows, equalsTranspose, exp, fill, get, get, get, getBand, getBandWrapped, getColumnClone, getColumns, getColumnView, getElements, getLeadingDiagonal, getLongShape, getRowClone, getRows, getRowView, getSlices, getSlices, getSliceViews, getTransposeCopy, getTransposeView, hashCode, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, isElementConstrained, isHermitian, isInvertible, isPositiveDefinite, isRectangularDiagonal, isView, iterator, join, log, lowerBandwidth, lowerBandwidthLimit, mul, multiply, 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, subMatrix, toAffineTransform, toArray, toDoubleArray, toDoubleBuffer, toMatrix, toMatrixTranspose, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, transformInPlace, transformInPlace, transposeInnerProduct, transposeInPlace, upperBandwidth, upperBandwidthLimitadd, addAt, addInnerProduct, addPower, addPower, broadcastLike, checkMutable, componentCount, divideCopy, elementMin, elementProduct, equals, equalsArray, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setMultiple, setMultiple, sliceValue, sub, sub, subCopy, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitadd2, addAt, addCopy, addCopy, columnCount, diagonalProduct, getBand, getColumnClone, getColumns, getColumnView, getRowClone, getRows, getRowView, getTransposeView, innerProduct, innerProduct, isInvertible, isRectangularDiagonal, isSquare, rowCount, subMatrix, toNestedDoubleArrays, transformInPlace, transposeInPlaceabs, absCopy, add, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, clone, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementCount, elementIterator, elementMax, elementMin, elementProduct, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, equalsArray, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTransposeCopy, immutable, innerProduct, innerProduct, innerProduct, isDense, isElementConstrained, isFullyMutable, isSameShape, isSparse, isView, join, join, log, multiply, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, outerProduct, pow, reciprocal, reciprocalCopy, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, slice, sliceCount, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleArray, toDoubleBuffer, toSliceArray, toVector, withComponentsforEach, spliteratorpublic static PermutationMatrix createIdentity(int length)
public static PermutationMatrix createSwap(int i, int j, int length)
public static PermutationMatrix create(Index rowPermutations)
public static PermutationMatrix wrap(Index rowPermutations)
public static PermutationMatrix create(int... rowPermutations)
public static PermutationMatrix wrap(int[] rowPermutations)
public static PermutationMatrix createRandomPermutation(int length)
public void addToArray(double[] data,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class AMatrixpublic boolean isMutable()
INDArraypublic boolean isSymmetric()
AMatrixisSymmetric in interface IMatrixisSymmetric in class AMatrixpublic double determinant()
AMatrixdeterminant in class AMatrixpublic int rank()
AMatrixpublic boolean isIdentity()
IMatrixisIdentity in interface IMatrixisIdentity in class AMatrixpublic boolean isOrthogonal()
AMatrixisOrthogonal in class AMatrixpublic boolean isOrthogonal(double tolerance)
AMatrixisOrthogonal in class AMatrixtolerance - inner product of a column with all of the next columns should be less than tolerancepublic boolean hasOrthonormalColumns()
AMatrixhasOrthonormalColumns in class AMatrixpublic boolean hasOrthonormalRows()
AMatrixhasOrthonormalRows in class AMatrixpublic boolean isDiagonal()
IMatrixisDiagonal in interface IMatrixisDiagonal in class AMatrixpublic boolean isBoolean()
INDArrayisBoolean in interface INDArrayisBoolean in class ABooleanMatrixpublic boolean isUpperTriangular()
AMatrixisUpperTriangular in class AMatrixpublic boolean isLowerTriangular()
AMatrixisLowerTriangular in class AMatrixpublic double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class ABooleanMatrixpublic double elementSquaredSum()
AMatrixelementSquaredSum in interface INDArrayelementSquaredSum in class ABooleanMatrixpublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AMatrixpublic double trace()
IMatrixpublic PermutationMatrix inverse()
AMatrixpublic PermutationMatrix getTranspose()
INDArraygetTranspose in interface INDArraygetTranspose in interface IMatrixgetTranspose in class AMatrixpublic double get(int row,
int column)
INDArraypublic void unsafeSet(int row,
int column,
double value)
AMatrixpublic double unsafeGet(int row,
int column)
AMatrixpublic void set(int row,
int column,
double value)
INDArraypublic AxisVector getRow(int i)
IMatrixpublic AxisVector getColumn(int j)
IMatrixpublic void copyRowTo(int row,
double[] dest,
int destOffset)
AMatrixpublic void copyColumnTo(int col,
double[] dest,
int destOffset)
AMatrixcopyColumnTo in class AMatrixdest - Destination double[] arraypublic void swapRows(int i,
int j)
AMatrixpublic void swapColumns(int i,
int j)
AMatrixswapColumns in class AMatrixpublic void transform(AVector source, AVector dest)
IMatrixpublic double rowDotProduct(int i,
AVector v)
AMatrixrowDotProduct in class AMatrixpublic Matrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic Matrix transposeInnerProduct(Matrix s)
transposeInnerProduct in class AMatrixpublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class ABooleanMatrixpublic double density()
ISparsedensity in interface ISparsedensity in class AbstractArray<AVector>public PermutationMatrix exactClone()
INDArrayexactClone in interface INDArrayexactClone in class AMatrixpublic boolean hasUncountable()
AMatrixhasUncountable in interface INDArrayhasUncountable in class ABooleanMatrixpublic double elementPowSum(double p)
elementPowSum in interface INDArrayelementPowSum in class ABooleanMatrixpublic double elementAbsPowSum(double p)
elementAbsPowSum in interface INDArrayelementAbsPowSum in class ABooleanMatrixCopyright © 2016. All rights reserved.