public abstract class ADenseArrayMatrix extends AStridedMatrix implements IFastRows, IDenseArray
datacols, rows| Modifier | Constructor and Description |
|---|---|
protected |
ADenseArrayMatrix(double[] data,
int rows,
int cols) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ADenseArrayMatrix a,
ADenseArrayMatrix b) |
void |
add(AMatrix a)
Adds another matrix to this matrix.
|
void |
add(AVector v)
Adds a vector to every row of this matrix.
|
void |
addOuterProduct(AVector a,
AVector b)
Adds the outer product of two vectors to this matrix
|
void |
addToArray(double[] data,
int offset)
Adds all the elements of this array to a double array, in row-major order
|
ADenseArrayVector |
asVector()
Returns the matrix values as a single reference Vector in the form [row0
row1 row2....]
|
int |
columnStride()
Gets the column stride for this strided matrix.
|
void |
copyRowTo(int row,
double[] dest,
int destOffset)
Copies the elements in a slected row of this matrix to a double array
|
double |
elementMax()
Returns the maximum element value in this array.
|
double |
elementMin()
Returns the maximum element value in this array.
|
double |
elementSquaredSum()
Returns the squared sum of all elements in this matrix
|
double |
elementSum()
Returns the sum of all elements in this matrix
|
boolean |
equals(AMatrix a)
Returns true if this matrix is exactly equal to another matrix
|
boolean |
equals(INDArray a)
Checks if two arrays are equal exactly in terms of both value and shape
|
boolean |
equalsArray(double[] data,
int offset)
Returns true if the elements in this array exactly match the elements in the given array, in
row-major order
|
abstract int |
getArrayOffset()
Gets the data array offset for the first element of this strided array
|
AStridedVector |
getColumn(int i)
Returns a column of the matrix.
|
ADenseArrayVector |
getRow(int i)
Returns a row of the matrix.
|
protected int |
index(int row,
int col)
Computes the index into the underlying data array for a given position in this array-backed matrix
|
boolean |
isLowerTriangular()
Returns true if a matrix is lower triangular.
|
boolean |
isPackedArray()
Returns true if the data array is fully packed by this matrix in row-major order
|
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)
|
double |
reduce(Op2 op,
double init)
Reduces over all elements of the array in row-major order.
|
double |
rowDotProduct(int i,
AVector a)
Returns the dot product of a specific row with a vector.
|
int |
rowStride()
Gets the row stride for this strided matrix.
|
void |
set(AMatrix m)
Sets this matrix with the element values from another matrix.
|
void |
set(AVector v)
Sets every row of this matrix with the element values from a vector.
|
void |
setElements(double[] values,
int offset)
Sets all elements in an array using the given double values
|
void |
setElements(int pos,
double[] values,
int offset,
int length)
Sets elements in an array using the given double values.
|
void |
setRow(int i,
AVector row)
Sets a row in a matrix to the value specified by the given vector
|
void |
transform(AVector source,
AVector dest)
Transforms a source vector into a destination vector, using matrix multiplication (inner product).
|
double |
unsafeGet(int i,
int j)
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 i,
int j,
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.
|
applyOp, applyOpCopy, asDoubleArray, clone, copyColumnTo, diagonalProduct, elementIterator, getBand, getColumnView, getRowView, getStride, getStrides, getTranspose, getTransposeView, subMatrix, traceget, getArray, getTransposeCopy, setbandLength, checkColumn, checkIndex, checkRow, checkSameShape, checkSameShape, checkSquare, columnCount, elementCount, getShape, getShape, getShapeClone, isSameShape, isSameShape, isSameShape, isSquare, rowCountabs, add, add, add2, addAt, addCopy, addCopy, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addOuterProduct, addRowMultiple, applyOp, applyOp, applyOp, applyOp, applyOp, asElementList, bandIndex, bandLength, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumnCount, checkDimension, checkRowCount, checkShape, clamp, composeWith, copy, dense, denseClone, determinant, dimensionality, divide, divide, divide, divide, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equalsByRows, equalsTranspose, exactClone, exp, fill, get, get, get, getBandWrapped, getColumnClone, getColumns, getElements, getLeadingDiagonal, getLongShape, getRowClone, getRows, getSlices, getSlices, getSliceViews, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isBoolean, isDiagonal, isElementConstrained, isFullyMutable, isHermitian, isIdentity, isInvertible, isMutable, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSymmetric, isView, iterator, join, log, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiply, multiplyCopy, multiplyRow, mutable, negate, nonZeroCount, outerProduct, outputDimensions, pow, rank, reciprocal, reduce, reduceSlices, reduceSlices, reorder, reorder, replaceColumn, replaceRow, reshape, reshape, rotateView, scaleAdd, scaleAdd, set, set, set, set, set, set, setColumn, setElements, signum, slice, slice, sliceCount, sparse, sparseClone, sqrt, square, sub, sub, sub, subArray, swapColumns, swapRows, toAffineTransform, toArray, toDoubleArray, toDoubleBuffer, toMatrix, toMatrixTranspose, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, upperBandwidth, upperBandwidthLimit, validateabsCopy, add, addAt, addInnerProduct, addPower, addPower, broadcastLike, checkMutable, componentCount, density, divideCopy, elementAbsPowSum, elementPowSum, elementProduct, equals, equalsArray, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, isDense, isSparse, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setInnerProduct, setMultiple, setMultiple, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitadd2, addAt, addCopy, addCopy, columnCount, diagonalProduct, get, getBand, getColumnClone, getColumns, getColumnView, getRowClone, getRows, getRowView, getTranspose, getTransposeView, innerProduct, innerProduct, innerProduct, inverse, isDiagonal, isIdentity, isInvertible, isRectangularDiagonal, isSquare, isSymmetric, rowCount, set, subMatrix, toNestedDoubleArrays, trace, transformInPlace, transposeInPlaceabs, absCopy, add, add, addAt, addCopy, addCopy, addInnerProduct, addMultiple, addOuterProduct, addPower, addPower, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, clone, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementPowSum, elementProduct, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, equalsArray, exactClone, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, 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, join, join, log, multiply, multiply, multiplyCopy, multiplyCopy, mutable, negate, negateCopy, nonZeroCount, outerProduct, pow, reciprocal, reciprocalCopy, reduce, reduceSlices, reduceSlices, reorder, reorder, reshape, rotateView, scale, scaleAdd, scaleAdd, scaleCopy, set, set, set, set, set, set, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, slice, sliceCount, sliceValue, sparse, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleArray, toDoubleBuffer, toSliceArray, toVector, validate, withComponentsgetArraygetArrayforEach, spliteratorpublic abstract int getArrayOffset()
IStridedArraygetArrayOffset in interface IDenseArraygetArrayOffset in interface IStridedArraygetArrayOffset in class AStridedMatrixpublic boolean isPackedArray()
AArrayMatrixisPackedArray in interface IStridedArrayisPackedArray in class AStridedMatrixpublic boolean isZero()
AMatrixisZero in interface INDArrayisZero in class AStridedMatrixpublic boolean isUpperTriangular()
AMatrixisUpperTriangular in class AMatrixpublic boolean isLowerTriangular()
AMatrixisLowerTriangular in class AMatrixpublic int rowStride()
AStridedMatrixrowStride in class AStridedMatrixpublic int columnStride()
AStridedMatrixcolumnStride in class AStridedMatrixpublic double unsafeGet(int i,
int j)
AMatrixunsafeGet in class AArrayMatrixpublic void set(AVector v)
AMatrixpublic void set(AMatrix m)
AMatrixpublic void setElements(double[] values,
int offset)
INDArraysetElements in interface INDArraysetElements in class AMatrixvalues - Element values in a double[] array. There must be at least as many element values as elements in this array.offset - Position in the values array from which to start taking values.public void setElements(int pos,
double[] values,
int offset,
int length)
INDArraysetElements in interface INDArraysetElements in class AbstractArray<AVector>pos - Offset into this array, expressed in terms of number of elements in row major ordervalues - Element values in a double[] array. There must be at least as many element values as elements in this array.offset - Position in the values array from which to start taking values.length - Number of elements to set.public ADenseArrayVector getRow(int i)
IMatrixpublic AStridedVector getColumn(int i)
IMatrixgetColumn in interface IMatrixgetColumn in class AStridedMatrixpublic void setRow(int i,
AVector row)
AMatrixpublic double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class AMatrixpublic double elementSquaredSum()
AMatrixelementSquaredSum in interface INDArrayelementSquaredSum in class AMatrixpublic double elementMax()
INDArrayelementMax in interface INDArrayelementMax in class AbstractArray<AVector>public double elementMin()
INDArrayelementMin in interface INDArrayelementMin in class AbstractArray<AVector>public void copyRowTo(int row,
double[] dest,
int destOffset)
AMatrixcopyRowTo in class AStridedMatrixrow - The index of the selected rowdest - Destination double[] arraydestOffset - Offset into destination arraypublic void unsafeSet(int i,
int j,
double value)
AMatrixunsafeSet in class AArrayMatrixprotected int index(int row,
int col)
AArrayMatrixindex in class AArrayMatrixpublic void transform(AVector source, AVector dest)
IMatrixpublic void add(AVector v)
AMatrixadd in class AStridedMatrixpublic void add(AMatrix a)
AMatrixadd in class AStridedMatrixpublic void add(ADenseArrayMatrix a, ADenseArrayMatrix b)
public void addToArray(double[] data,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class AStridedMatrixpublic void addOuterProduct(AVector a, AVector b)
AMatrixaddOuterProduct in class AMatrixpublic double reduce(Op2 op, double init)
INDArrayreduce in interface INDArrayreduce in class AStridedMatrixpublic double rowDotProduct(int i,
AVector a)
AMatrixrowDotProduct in class AStridedMatrixpublic boolean equals(AMatrix a)
AMatrixpublic boolean equals(INDArray a)
INDArraypublic boolean equalsArray(double[] data,
int offset)
INDArrayequalsArray in interface INDArrayequalsArray in class AMatrixdata - Array of double element values to check for equalityoffset - Offset into the data arrayCopyright © 2016. All rights reserved.