mikera.matrixx.impl
Class ASingleBandMatrix
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<AVector>
-
- mikera.matrixx.AMatrix
-
- mikera.matrixx.impl.ABandedMatrix
-
- mikera.matrixx.impl.ASingleBandMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<AVector>, INDArray, ISparse, IMatrix, IFastBands
- Direct Known Subclasses:
- ADiagonalMatrix
public abstract class ASingleBandMatrix extends ABandedMatrix implements ISparse
Abstract base class to represent sparse matrices with a single non-zero band Unlike ADiagonalMatrix, this matrix need not be square, and may have non-zero values on an arbitrary diagonal.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ASingleBandMatrix()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description doubleelementAbsPowSum(double p)Returns the sum of the absolute values of all the elements raised to a specified powerdoubleelementPowSum(double p)Returns the sum of all the elements raised to a specified powerAVectorgetBand(int band)Gets a specific band of the matrix, as a view vector.abstract AVectorgetNonZeroBand()Gets the non-zero band from the matrixbooleanhasUncountable()Checks to see if any element in the matrix is NaN of Infinite.booleanisIdentity()Checks if this is an identity matrix (i.e.booleanisSparse()Returns true if the array is in a sparse formatbooleanisSymmetric()Returns true if a matrix is symmetricbooleanisZero()Returns true if the matrix is the zero matrix (all components zero)abstract intnonZeroBand()Specifies which band of the matrix is nonzerolongnonZeroCount()Returns the number of non-zero elements in the array.intrank()Calculate the rank of a matrix.AMatrixsubMatrix(int rowStart, int rows, int colStart, int cols)Gets a rectangular submatrix view of part of a matrix-
Methods inherited from class mikera.matrixx.impl.ABandedMatrix
addToArray, copyRowTo, density, diagonalProduct, elementSquaredSum, elementSum, fill, getRowView, isFullyMutable, isLowerTriangular, isMutable, isUpperTriangular, lowerBandwidth, lowerBandwidthLimit, multiply, setSparse, toDoubleArray, toMatrix, toMatrixTranspose, trace, upperBandwidth, upperBandwidthLimit, validate
-
Methods inherited from class mikera.matrixx.AMatrix
abs, add, add, add, add, add2, addAt, addCopy, addCopy, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addOuterProduct, addOuterProduct, addOuterProductSparse, addOuterProductSparse, addRowMultiple, addSparse, addSparse, applyOp, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, bandIndex, bandLength, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumn, checkRow, checkSquare, clamp, clone, composeWith, copy, copyColumnTo, dense, denseClone, determinant, dimensionality, divide, divide, divide, divide, divideCopy, elementCount, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, equalsTranspose, exactClone, exp, get, get, get, get, get, getBandWrapped, getColumn, getColumnClone, getColumns, getColumnView, getElement, getElements, getLeadingDiagonal, getLongShape, getRow, getRowClone, getRows, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasOrthonormalColumns, hasOrthonormalRows, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isBoolean, isDiagonal, isElementConstrained, isHermitian, isInvertible, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSameShape, isSameShape, isSquare, 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, rowDotProduct, scaleAdd, scaleAdd, set, set, set, set, set, set, set, set, set, setApplyOp, setApplyOp, setColumn, setElements, setElements, setMultiple, setMultiple, setMultiple, setMultiple, setMultiple, setRow, setSparse, setSparse, signum, slice, slice, sliceCount, sparse, sparseClone, sqrt, square, sub, sub, sub, subArray, subCopy, swapColumns, swapRows, toAffineTransform, toDoubleBuffer, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, transform, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, unsafeGet, unsafeSet
-
Methods inherited from class mikera.arrayz.impl.AbstractArray
absCopy, absDiff, absDiffCopy, add, addApplyOp, addAt, addCopy, addInnerProduct, addInnerProduct, addMultipleSparse, addPower, addPower, addSparse, broadcastLike, compareTo, componentCount, divideCopy, elementMax, elementMaxAbs, elementMin, elementProduct, epsilonEquals, equals, equalsArray, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponents
-
Methods inherited from interface mikera.matrixx.IMatrix
columnCount, rowCount
-
Methods inherited from interface mikera.arrayz.INDArray
absCopy, absDiff, absDiffCopy, addApplyOp, addAt, addInnerProduct, addMultipleSparse, addPower, addPower, addSparse, broadcastLike, componentCount, divideCopy, elementMax, elementMaxAbs, elementMin, elementProduct, epsilonEquals, equalsArray, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, signumCopy, sliceValue, squareCopy, sub, subCopy, withComponents
-
-
-
-
Method Detail
-
nonZeroBand
public abstract int nonZeroBand()
Specifies which band of the matrix is nonzero- Returns:
-
getNonZeroBand
public abstract AVector getNonZeroBand()
Gets the non-zero band from the matrix- Returns:
-
isSymmetric
public boolean isSymmetric()
Description copied from class:AMatrixReturns true if a matrix is symmetric- Specified by:
isSymmetricin interfaceIMatrix- Overrides:
isSymmetricin classABandedMatrix- Returns:
-
subMatrix
public AMatrix subMatrix(int rowStart, int rows, int colStart, int cols)
Description copied from interface:IMatrixGets a rectangular submatrix view of part of a matrix
-
isIdentity
public boolean isIdentity()
Description copied from interface:IMatrixChecks if this is an identity matrix (i.e. 1.0 in leading diagonal, 0.0 elsewhere)- Specified by:
isIdentityin interfaceIMatrix- Overrides:
isIdentityin classAMatrix- Returns:
- true if this matrix is a square identity matrix, false otherwise.
-
isZero
public boolean isZero()
Description copied from class:AMatrixReturns true if the matrix is the zero matrix (all components zero)- Specified by:
isZeroin interfaceINDArray- Overrides:
isZeroin classABandedMatrix
-
isSparse
public final boolean isSparse()
Description copied from interface:INDArrayReturns true if the array is in a sparse format- Specified by:
isSparsein interfaceINDArray- Overrides:
isSparsein classABandedMatrix
-
nonZeroCount
public long nonZeroCount()
Description copied from interface:INDArrayReturns the number of non-zero elements in the array.- Specified by:
nonZeroCountin interfaceINDArray- Overrides:
nonZeroCountin classABandedMatrix
-
getBand
public AVector getBand(int band)
Description copied from class:AMatrixGets a specific band of the matrix, as a view vector. The band is truncated at the edges of the matrix, i.e. it does not wrap around the matrix.- Specified by:
getBandin interfaceIMatrix- Specified by:
getBandin interfaceIFastBands- Specified by:
getBandin classABandedMatrix- Returns:
-
hasUncountable
public boolean hasUncountable()
Description copied from class:AMatrixChecks to see if any element in the matrix is NaN of Infinite.- Specified by:
hasUncountablein interfaceINDArray- Overrides:
hasUncountablein classAMatrix- Returns:
- True if any element in the matrix is NaN of Infinite.
-
rank
public int rank()
Description copied from class:AMatrixCalculate the rank of a matrix. This is equivalent to the maximum number of linearly independent rows or columns.
-
elementPowSum
public double elementPowSum(double p)
Returns the sum of all the elements raised to a specified power- Specified by:
elementPowSumin interfaceINDArray- Overrides:
elementPowSumin classAbstractArray<AVector>- Returns:
-
elementAbsPowSum
public double elementAbsPowSum(double p)
Returns the sum of the absolute values of all the elements raised to a specified power- Specified by:
elementAbsPowSumin interfaceINDArray- Overrides:
elementAbsPowSumin classAbstractArray<AVector>- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG