mikera.matrixx.impl
Class ARectangularMatrix
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<AVector>
-
- mikera.matrixx.AMatrix
-
- mikera.matrixx.impl.ARectangularMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<AVector>, INDArray, IMatrix
- Direct Known Subclasses:
- AArrayMatrix, ABlockMatrix, ABooleanMatrix, ASparseRCMatrix, AVectorAsMatrixView, AVectorMatrix, BroadcastVectorMatrix, BufferMatrix, ImmutableMatrix, PermutedMatrix, SubMatrixView, TransposedMatrix, ZeroMatrix
public abstract class ARectangularMatrix extends AMatrix
Abstract class for regular rectangular matrices that maintain a final fixed row and column count. Most concrete matrix implementations should inherit from this.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intbandLength(int band)Returns the length of a band of the matrix.intcheckColumn(int column)Checks if the given column index is valid for this matrix.intcheckRow(int row)Checks if the given rows index is valid for this matrix.intcheckSquare()Checks if a matrix is square.intcolumnCount()Gets the number of columns in this matrix (dimension 1)longelementCount()Returns the total number of elements in this array.doublegetElement(long i)Gets a specific element of this array, indexed in row-major orderint[]getShape()Returns the shape of the array as an array of ints.intgetShape(int dim)Returns the dimension size for a specific dimension in the array's shapeint[]getShapeClone()Returns the shape of the array as an array of ints, guaranteed to be a new array i.e.booleanisSameShape(AMatrix m)Returns true iff this matrix is exactly the same shape as another matrixbooleanisSameShape(ARectangularMatrix m)booleanisSameShape(INDArray m)Returns true if this array is the same shape as another arraybooleanisSquare()Checks if this is a square matrixintrowCount()Gets the number of rows in this matrix (dimension 0)voidset(int i, int j, double value)Sets a value at a given position in a mutable 2D array-
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, addToArray, applyOp, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, bandIndex, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, clamp, clone, composeWith, copy, copyColumnTo, copyRowTo, dense, denseClone, determinant, diagonalProduct, dimensionality, divide, divide, divide, divide, divideCopy, elementIterator, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsArray, equalsTranspose, exactClone, exp, fill, get, get, get, get, get, getBand, getBandWrapped, getColumn, getColumnClone, getColumns, getColumnView, getElements, getLeadingDiagonal, getLongShape, getRow, getRowClone, getRows, getRowView, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isBoolean, isDiagonal, isElementConstrained, isFullyMutable, isHermitian, isIdentity, isInvertible, isLowerTriangular, isMutable, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSymmetric, isUpperTriangular, isView, isZero, iterator, join, log, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiply, multiplyCopy, multiplyRow, mutable, negate, nonZeroCount, outerProduct, outputDimensions, pow, rank, reciprocal, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, replaceColumn, replaceRow, reshape, reshape, rotateView, rowDotProduct, scaleAdd, scaleAdd, 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, subMatrix, swapColumns, swapRows, toAffineTransform, toDoubleArray, toDoubleBuffer, toMatrix, toMatrixTranspose, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, trace, transform, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, unsafeGet, unsafeSet, upperBandwidth, upperBandwidthLimit, validate
-
Methods inherited from class mikera.arrayz.impl.AbstractArray
absCopy, absDiff, absDiffCopy, add, addApplyOp, addAt, addCopy, addInnerProduct, addInnerProduct, addMultipleSparse, addPower, addPower, addSparse, broadcastLike, compareTo, componentCount, density, divideCopy, elementAbsPowSum, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, epsilonEquals, equals, equalsArray, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setSparse, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponents
-
Methods inherited from interface mikera.arrayz.INDArray
absCopy, absDiff, absDiffCopy, addApplyOp, addAt, addInnerProduct, addMultipleSparse, addPower, addPower, addSparse, broadcastLike, componentCount, divideCopy, elementAbsPowSum, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, epsilonEquals, equalsArray, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setSparse, signumCopy, sliceValue, squareCopy, sub, subCopy, withComponents
-
-
-
-
Method Detail
-
rowCount
public final int rowCount()
Description copied from interface:IMatrixGets the number of rows in this matrix (dimension 0)- Returns:
-
columnCount
public final int columnCount()
Description copied from interface:IMatrixGets the number of columns in this matrix (dimension 1)- Returns:
-
isSquare
public final boolean isSquare()
Description copied from interface:IMatrixChecks if this is a square matrix
-
getShape
public final int[] getShape()
Description copied from interface:INDArrayReturns the shape of the array as an array of ints. WARNING: May return the internal int[] array describing the shape. Modifying this may cause undefined behaviour. If you want to guarantee a new int[] array that can be safely modified, use getShapeClone() instead
-
getShapeClone
public final int[] getShapeClone()
Description copied from interface:INDArrayReturns the shape of the array as an array of ints, guaranteed to be a new array i.e. will perform a defensive copy of any internal shape array if required.- Specified by:
getShapeClonein interfaceINDArray- Overrides:
getShapeClonein classAMatrix
-
set
public void set(int i, int j, double value)Description copied from interface:INDArraySets a value at a given position in a mutable 2D array
-
bandLength
public final int bandLength(int band)
Description copied from class:AMatrixReturns the length of a band of the matrix. Returns 0 if the band is outside the matrix.- Overrides:
bandLengthin classAMatrix- Returns:
-
getShape
public final int getShape(int dim)
Description copied from interface:INDArrayReturns the dimension size for a specific dimension in the array's shape
-
isSameShape
public final boolean isSameShape(INDArray m)
Description copied from interface:INDArrayReturns true if this array is the same shape as another array- Specified by:
isSameShapein interfaceINDArray- Overrides:
isSameShapein classAMatrix
-
checkSquare
public int checkSquare()
Description copied from class:AMatrixChecks if a matrix is square. Returns the size if true, throws an exception otherwise;- Overrides:
checkSquarein classAMatrix- Returns:
-
checkColumn
public final int checkColumn(int column)
Description copied from class:AMatrixChecks if the given column index is valid for this matrix. Throws an exception if not.- Overrides:
checkColumnin classAMatrix- Returns:
- the number of columns in this matrix
-
checkRow
public final int checkRow(int row)
Description copied from class:AMatrixChecks if the given rows index is valid for this matrix. Throws an exception if not.
-
isSameShape
public final boolean isSameShape(AMatrix m)
Description copied from class:AMatrixReturns true iff this matrix is exactly the same shape as another matrix- Overrides:
isSameShapein classAMatrix- Returns:
-
isSameShape
public final boolean isSameShape(ARectangularMatrix m)
-
elementCount
public final long elementCount()
Description copied from interface:INDArrayReturns the total number of elements in this array. Equivalent to the product of all dimension sizes.- Specified by:
elementCountin interfaceINDArray- Overrides:
elementCountin classAMatrix
-
getElement
public final double getElement(long i)
Description copied from interface:INDArrayGets a specific element of this array, indexed in row-major order- Specified by:
getElementin interfaceINDArray- Overrides:
getElementin classAMatrix- Returns:
- The element value
-
-
DMelt 3.0 © DataMelt by jWork.ORG