public final class ImmutableMatrix extends ARectangularMatrix implements IDenseArray, IFastRows
cols, rows| Constructor and Description |
|---|
ImmutableMatrix(AMatrix m) |
| 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
|
ImmutableVector |
asVector()
Returns the matrix values as a single reference Vector in the form [row0
row1 row2....]
|
Matrix |
clone()
Returns a clone of the array data, as a new array which will be fully mutable
and may be of a different class to the original.
|
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 ImmutableMatrix |
create(AMatrix a) |
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 |
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
|
AMatrix |
exactClone()
Creates a deep clone of an array, using the same class implementation as the original array
|
double |
get(int i,
int j)
Returns the double value at the specified position in a 2D matrix
|
double[] |
getArray() |
int |
getArrayOffset() |
void |
getElements(double[] dest,
int offset)
Gets all elements of the array, copying them into a double array at the specified offset
|
double[] |
getInternalData()
Unsafe method that returns the internal data array
|
ImmutableVector |
getRowView(int row)
Returns a row of the matrix as a vector view.
|
Matrix |
innerProduct(AMatrix a)
Computes the inner product of this matrix with another.
|
Vector |
innerProduct(AVector a)
Computes the inner product of this array with a vector
|
boolean |
isBoolean()
Returns true if the array is boolean (contains only 0.0 or 1.0 values)
|
boolean |
isFullyMutable()
If this method returns true, the INDArray is guaranteed to be fully mutable
in all positions i.e.
|
boolean |
isMutable()
Returns true if the INDArray is mutable (at least partially)
|
boolean |
isView()
Return true if this array is considered as a view type.
|
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.
|
void |
set(int row,
int column,
double value)
Sets a value at a given position in a mutable 2D array
|
void |
toDoubleBuffer(DoubleBuffer dest)
Copies the elements of this INDArray to the specified double buffer
|
Matrix |
toMatrix()
Coerces the matrix to the standard mutable Matrix type
in row major order.
|
Matrix |
toMatrixTranspose()
Coerces the transpose of a matrix to the standard mutable Matrix type
in row major order.
|
Vector |
toVector()
Coerces the array into a flattened dense Vector, in row-major order
May return the same array if it is already a Vector instance
|
void |
transform(Vector source,
Vector dest) |
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.
|
static ImmutableMatrix |
wrap(int rows,
int cols,
double[] data)
Creates a new ImmutableMatrix wrapping the specified source array
WARNING: does not take a defensive copy.
|
static ImmutableMatrix |
wrap(Matrix source)
Creates a new ImmutableMatrix wrapping the data array of a given Matrix
WARNING: does not take a defensive copy.
|
bandLength, 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, bandIndex, bandLength, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumnCount, checkDimension, checkRowCount, checkShape, clamp, composeWith, copy, dense, denseClone, determinant, diagonalProduct, dimensionality, divide, divide, divide, divide, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equalsByRows, equalsTranspose, exp, fill, get, get, get, getBand, getBandWrapped, getColumn, getColumnClone, getColumns, getColumnView, getLeadingDiagonal, getLongShape, getRow, getRowClone, getRows, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, getTransposeView, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isDiagonal, isElementConstrained, isHermitian, isIdentity, isInvertible, isLowerTriangular, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSymmetric, isUpperTriangular, iterator, join, log, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiply, multiplyCopy, multiplyRow, mutable, negate, 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, setColumn, setElements, setElements, setRow, signum, slice, slice, sliceCount, sparse, sparseClone, sqrt, square, sub, sub, sub, subArray, subMatrix, swapColumns, swapRows, toAffineTransform, toArray, toDoubleArray, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, trace, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, unsafeSet, upperBandwidth, upperBandwidthLimit, validateabsCopy, add, addAt, addInnerProduct, addPower, addPower, broadcastLike, checkMutable, componentCount, density, divideCopy, elementAbsPowSum, elementMax, elementMin, elementPowSum, 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, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitadd2, addAt, addCopy, addCopy, columnCount, diagonalProduct, getBand, getColumn, getColumnClone, getColumns, getColumnView, getRowClone, getRows, getTranspose, getTransposeView, innerProduct, inverse, isDiagonal, isIdentity, isInvertible, isRectangularDiagonal, isSquare, isSymmetric, rowCount, subMatrix, toNestedDoubleArrays, trace, transform, 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, componentCount, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementMax, elementMin, elementPowSum, elementProduct, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, exp, fill, get, get, get, get, get, get, get, get, getComponent, getComponents, getElements, getElements, getElements, getLongShape, getShape, getShape, getShapeClone, getSlices, getSlices, getSliceViews, getTransposeCopy, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, isDense, isElementConstrained, isSameShape, isSparse, 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, toSliceArray, validate, withComponentsforEach, spliteratorpublic ImmutableMatrix(AMatrix m)
public static ImmutableMatrix wrap(Matrix source)
public static ImmutableMatrix wrap(int rows, int cols, double[] data)
public boolean isMutable()
INDArraypublic boolean isFullyMutable()
INDArrayisFullyMutable in interface INDArrayisFullyMutable in class AMatrixpublic boolean isView()
INDArraypublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AMatrixpublic boolean isBoolean()
INDArraypublic boolean isZero()
AMatrixpublic double get(int i,
int j)
INDArraypublic ImmutableVector getRowView(int row)
IMatrixgetRowView in interface IMatrixgetRowView in class AMatrixpublic double unsafeGet(int i,
int j)
AMatrixpublic void set(int row,
int column,
double value)
INDArraypublic final void copyRowTo(int row,
double[] dest,
int destOffset)
AMatrixpublic Vector innerProduct(AVector a)
INDArrayinnerProduct in interface INDArrayinnerProduct in interface IMatrixinnerProduct in class AMatrixa - A vectorpublic Matrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic final void copyColumnTo(int col,
double[] dest,
int destOffset)
AMatrixcopyColumnTo in class AMatrixdest - Destination double[] arraypublic double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class AMatrixpublic double elementSquaredSum()
AMatrixelementSquaredSum in interface INDArrayelementSquaredSum in class AMatrixpublic Vector toVector()
INDArraypublic ImmutableVector asVector()
AMatrixpublic Matrix toMatrix()
AMatrixpublic Matrix toMatrixTranspose()
AMatrixtoMatrixTranspose in class AMatrixpublic void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AMatrixpublic void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AMatrixpublic void addToArray(double[] data,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class AMatrixpublic Matrix clone()
INDArraypublic AMatrix exactClone()
INDArrayexactClone in interface INDArrayexactClone in class AMatrixpublic boolean equals(AMatrix a)
AMatrixpublic 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 arraypublic double[] getInternalData()
public static ImmutableMatrix create(AMatrix a)
public double[] getArray()
getArray in interface IDenseArraypublic int getArrayOffset()
getArrayOffset in interface IDenseArrayCopyright © 2016. All rights reserved.