mikera.matrixx.impl
Class RowMatrix
- java.lang.Object
-
- mikera.arrayz.impl.AbstractArray<AVector>
-
- mikera.matrixx.AMatrix
-
- mikera.matrixx.impl.ARectangularMatrix
-
- mikera.matrixx.impl.AVectorAsMatrixView
-
- mikera.matrixx.impl.RowMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<INDArray>, java.lang.Iterable<AVector>, INDArray, IMatrix, IFastColumns, IFastRows
public class RowMatrix extends AVectorAsMatrixView implements IFastColumns, IFastRows
Matrix class that wraps an arbitrary vector as a single-row matrix- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddAt(int i, int j, double d)Adds a value at a specific position in the matrix, mutating the matrix Does not perform bounds checking - this in an unsafe operationvoidaddToArray(double[] data, int offset)Adds all the elements of this array to a double array at the specified offset, in row-major ordervoidcopyColumnTo(int col, double[] dest, int destOffset)Copies the elements in a selected row of this matrix to a double arrayvoidcopyRowTo(int row, double[] dest, int destOffset)Copies the elements in a selected row of this matrix to a double arrayRowMatrixexactClone()Creates a deep clone of an array, using the same class implementation as the original arraydoubleget(int row, int column)Returns the double value at the specified position in a 2D matrixAVectorgetColumnView(int i)Returns a column of the matrix as a vector view.AVectorgetRowView(int i)Returns a row of the matrix as a vector view.ColumnMatrixgetTranspose()Returns the transpose of this array.ColumnMatrixgetTransposeView()Returns a transposed view of the array.voidset(int row, int column, double value)Sets a value at a given position in a mutable 2D arrayMatrixtransposeInnerProduct(Matrix s)doubleunsafeGet(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.voidunsafeSet(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.static RowMatrixwrap(AVector v)-
Methods inherited from class mikera.matrixx.impl.AVectorAsMatrixView
applyOp, asVector, elementAbsPowSum, elementMax, elementMin, elementPowSum, elementSquaredSum, elementSum, equalsArray, getElements, isFullyMutable, isMutable, isZero, multiply, nonZeroCount, reduce, setSparse, toVector
-
Methods inherited from class mikera.matrixx.impl.ARectangularMatrix
bandLength, checkColumn, checkRow, checkSquare, columnCount, elementCount, getElement, getShape, getShape, getShapeClone, isSameShape, isSameShape, isSameShape, isSquare, rowCount
-
Methods inherited from class mikera.matrixx.AMatrix
abs, add, add, add, add, add2, addCopy, addCopy, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addOuterProduct, addOuterProduct, addOuterProductSparse, addOuterProductSparse, addRowMultiple, addSparse, addSparse, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, bandIndex, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, clamp, clone, composeWith, copy, dense, denseClone, determinant, diagonalProduct, dimensionality, divide, divide, divide, divide, divideCopy, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equalsTranspose, exp, fill, get, get, get, get, getBand, getBandWrapped, getColumn, getColumnClone, getColumns, getLeadingDiagonal, getLongShape, getRow, getRowClone, getRows, getSlices, getSlices, getSliceViews, getTransposeCopy, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isBoolean, isDiagonal, isElementConstrained, isHermitian, isIdentity, isInvertible, isLowerTriangular, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSymmetric, isUpperTriangular, isView, iterator, join, log, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiplyCopy, multiplyRow, mutable, negate, outerProduct, outputDimensions, pow, rank, reciprocal, 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, trace, transform, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInPlace, 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, elementMaxAbs, elementProduct, epsilonEquals, equals, equalsArray, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponents
-
Methods inherited from interface mikera.matrixx.impl.IFastColumns
getColumn
-
Methods inherited from interface mikera.matrixx.IMatrix
add2, addCopy, addCopy, columnCount, diagonalProduct, getBand, getColumnClone, getColumns, getRowClone, getRows, innerProduct, innerProduct, innerProduct, inverse, isDiagonal, isIdentity, isInvertible, isRectangularDiagonal, isSquare, isSymmetric, rowCount, subMatrix, toNestedDoubleArrays, trace, transform, transformInPlace, transposeInPlace
-
Methods inherited from interface mikera.arrayz.INDArray
abs, absCopy, absDiff, absDiffCopy, add, add, addApplyOp, addAt, addCopy, addCopy, addInnerProduct, addInnerProduct, addMultiple, addMultipleSparse, addOuterProduct, addOuterProductSparse, addPower, addPower, addSparse, addSparse, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, clamp, clone, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementMax, elementMaxAbs, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, equalsArray, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElement, getElements, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTransposeCopy, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, isBoolean, isDense, isElementConstrained, isFullyMutable, isMutable, isSameShape, isSparse, isView, isZero, join, join, log, multiply, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonZeroCount, outerProduct, pow, reciprocal, reciprocalCopy, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setApplyOp, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, setSparse, setSparse, signum, signumCopy, slice, slice, sliceCount, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toDoubleArray, toDoubleBuffer, toSliceArray, toVector, validate, withComponents
-
-
-
-
Constructor Detail
-
RowMatrix
public RowMatrix(AVector v)
-
-
Method Detail
-
get
public double get(int row, int column)Description copied from interface:INDArrayReturns the double value at the specified position in a 2D matrix
-
set
public void set(int row, int column, double value)Description copied from interface:INDArraySets a value at a given position in a mutable 2D array
-
unsafeGet
public double unsafeGet(int row, int column)Description copied from class:AMatrixGets 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.
-
unsafeSet
public void unsafeSet(int row, int column, double value)Description copied from class:AMatrixSets 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.
-
getRowView
public AVector getRowView(int i)
Description copied from interface:IMatrixReturns a row of the matrix as a vector view. May be used to modify the original matrix.- Specified by:
getRowViewin interfaceIMatrix- Overrides:
getRowViewin classAMatrix
-
getColumnView
public AVector getColumnView(int i)
Description copied from interface:IMatrixReturns a column of the matrix as a vector view. May be used to modify the original matrix.- Specified by:
getColumnViewin interfaceIMatrix- Overrides:
getColumnViewin classAMatrix
-
addAt
public void addAt(int i, int j, double d)Description copied from interface:IMatrixAdds a value at a specific position in the matrix, mutating the matrix Does not perform bounds checking - this in an unsafe operation
-
addToArray
public void addToArray(double[] data, int offset)Description copied from interface:INDArrayAdds all the elements of this array to a double array at the specified offset, in row-major order- Specified by:
addToArrayin interfaceINDArray- Overrides:
addToArrayin classAMatrix
-
getTranspose
public ColumnMatrix getTranspose()
Description copied from interface:INDArrayReturns the transpose of this array. A transpose of an array is equivalent to reversing the order of dimensions. May or may not return a view depending on the array type.- Specified by:
getTransposein interfaceINDArray- Specified by:
getTransposein interfaceIMatrix- Overrides:
getTransposein classAMatrix- Returns:
- the transpose of this matrix
-
getTransposeView
public ColumnMatrix getTransposeView()
Description copied from interface:INDArrayReturns a transposed view of the array. May throw UnsupportedOperationException if the array type does not support this capability- Specified by:
getTransposeViewin interfaceINDArray- Specified by:
getTransposeViewin interfaceIMatrix- Overrides:
getTransposeViewin classAMatrix- Returns:
- the transpose of this matrix, as a view
-
exactClone
public RowMatrix exactClone()
Description copied from interface:INDArrayCreates a deep clone of an array, using the same class implementation as the original array- Specified by:
exactClonein interfaceINDArray- Specified by:
exactClonein classAMatrix- Returns:
- A clone of the original array
-
copyRowTo
public void copyRowTo(int row, double[] dest, int destOffset)Description copied from class:AMatrixCopies the elements in a selected row of this matrix to a double array
-
copyColumnTo
public void copyColumnTo(int col, double[] dest, int destOffset)Description copied from class:AMatrixCopies the elements in a selected row of this matrix to a double array- Overrides:
copyColumnToin classAMatrixdest- Destination double[] array
-
transposeInnerProduct
public Matrix transposeInnerProduct(Matrix s)
- Overrides:
transposeInnerProductin classAMatrix
-
-
DMelt 3.0 © DataMelt by jWork.ORG