public final class Matrix extends ADenseArrayMatrix
cols, data, rows| Modifier and Type | Method and Description |
|---|---|
void |
abs()
Replaces all elements of this array with their absolute values, according to Math.abs(double)
|
void |
add(AMatrix m)
Adds another matrix to this matrix.
|
void |
add(double d)
Adds a double value to all elements in this array
|
void |
add(Matrix m) |
void |
addMultiple(AMatrix m,
double factor) |
void |
addMultiple(Matrix m,
double factor) |
void |
addRowMultiple(int src,
int dst,
double factor)
Adds a multiple of a source row to a destination row
This is an elementary row operation
|
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
double[] |
asDoubleArray()
Returns the underlying double array representing the packed elements of this array
Returns nil if there is no such underlying array
|
Vector |
asVector()
Returns the matrix values as a single reference Vector in the form [row0
row1 row2....]
|
void |
clamp(double min,
double max)
Clamps all the elments of this array within the specified [min,max] range
|
Matrix |
clone()
Clones the transform, performing a deep copy where needed
|
Vector |
cloneRow(int row) |
void |
copyColumnTo(int col,
double[] dest,
int destOffset) |
void |
copyRowTo(int row,
double[] dest,
int destOffset) |
static Matrix |
create(AMatrix m) |
static Matrix |
create(INDArray m) |
static Matrix |
create(int rowCount,
int columnCount)
Creates a new zero-filled matrix of the specified shape.
|
static Matrix |
create(Object... rowVectors) |
Iterator<Double> |
elementIterator()
Returns an iterator over all elements in this array.
|
double |
elementSum()
Returns the sum of all elements in the matrix
|
Matrix |
exactClone()
Returns an exact deep clone of an array (i.e.
|
void |
exp()
Computes the function e^x (in-place) for all array elements
|
double |
get(int row,
int column)
Returns a specified element in the matrix
|
double[] |
getArray() |
int |
getArrayOffset() |
StridedVector |
getBand(int band)
Gets a specific band of the matrix, as a view vector.
|
AStridedVector |
getColumn(int col)
Returns a column of the matrix as a vector view
|
void |
getElements(double[] dest,
int offset)
Gets all elements of the array, copying them into a double array
|
ArraySubVector |
getRow(int row)
Returns a row of the matrix as a vector view
|
StridedMatrix |
getTranspose()
Returns a transposed version of this matrix.
|
StridedMatrix |
getTransposeView()
Returns a transposed view of the array.
|
protected int |
index(int row,
int col)
Computes the index into the data array for a given position in the matrix
|
Matrix |
innerProduct(AMatrix a) |
Vector |
innerProduct(AVector a) |
Matrix |
innerProduct(Matrix a) |
boolean |
isBoolean()
Returns true if the array is boolean (contains only 0.0 or 1.0 values)
|
boolean |
isPackedArray()
Returns true if the data array is fully packed by this matrix in row-major order
|
boolean |
isView()
Return true if this array is a view type
|
boolean |
isZero()
Returns true if the matrix is the zero matrix (all components zero)
|
void |
log()
Computes the natural logarithm (in-place) for all array elements
|
void |
multiply(double factor)
Multiplies all elements of the array by a given double value
|
void |
multiplyRow(int i,
double factor)
Multiplies a row by a constant factor
This is an elementary row operation
|
long |
nonZeroCount()
Returns the number of non-zero elements in the array.
|
void |
reciprocal()
Replaces all elements in the array with their reciprocal
|
void |
set(AMatrix a) |
void |
set(double value)
Sets all elements of an array to a specific double value
|
void |
set(int row,
int column,
double value)
Sets a specified element in the matrix
|
void |
setColumn(int j,
AVector col) |
void |
setRow(int i,
AVector row) |
void |
signum()
Calculates the signum of all elements of the array
|
void |
square()
Squares all elements of the array
|
AStridedMatrix |
subMatrix(int rowStart,
int rows,
int colStart,
int cols) |
void |
swapColumns(int i,
int j)
Swaps two columns of the matrix in place
|
void |
swapRows(int i,
int j)
Swaps two rows of the matrix in place
This is an elementary row operation
|
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()
Converts the matrix to a single flattened vector
in row major order.
|
Vector |
transform(AVector a)
Transforms a vector, returning a new transformed vector
|
void |
transform(AVector source,
AVector dest)
Transforms the source vector, storing the result in the given destination vector
|
Vector |
transform(Vector a)
Transforms a vector, returning a new transformed vector
|
void |
transform(Vector source,
Vector dest) |
double |
unsafeGet(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.
|
void |
unsafeSet(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 Matrix |
wrap(int rowCount,
int columnCount,
double[] data) |
columnStride, rowStridegetStride, getStridescolumnCount, rowCountadd, add, add, addAt, applyOp, asElementList, bandIndex, bandLength, bandLength, bandPosition, broadcast, broadcastCloneLike, broadcastLike, broadcastLike, calculateElement, calculateElement, compose, compose, composeWith, composeWith, copyOfMatrix, copyOfTranslationVector, copyTo, determinant, dimensionality, divide, divide, elementCount, elementDiv, elementMul, elementSquaredSum, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equals, equals, fill, get, get, get, getBandWrapped, getLeadingDiagonal, getLongShape, getMatrixComponent, getShape, getShape, getSlices, getSliceViews, getTransposeCopy, hashCode, hasOrthonormalColumns, hassOrthonormalRows, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isDiagonal, isElementConstrained, isFullyMutable, isHermitian, isIdentity, isInvertible, isLowerTriangular, isMutable, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSameShape, isSameShape, isSquare, isSymmetric, isUpperTriangular, iterator, lowerBandwidth, lowerBandwidthLimit, mul, multiply, negate, outerProduct, outputDimensions, pow, reshape, reshape, scale, scaleAdd, set, set, set, set, setElements, setElements, slice, slice, sliceCount, sqrt, sub, sub, sub, sub, sub, toAffineTransform, toArray, toDoubleArray, toMutableMatrix, toString, trace, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, upperBandwidth, upperBandwidthLimit, validategetTranslationComponent, isLinearcompose, transformNormaltakeComponents, takeComponents, takeComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitgetShapeadd, applyOp, asElementList, broadcast, broadcastCloneLike, broadcastLike, copyTo, dimensionality, divide, divide, elementCount, elementSquaredSum, ensureMutable, epsilonEquals, epsilonEquals, equals, fill, get, get, get, getLongShape, getShape, getSlices, getSliceViews, getTransposeCopy, innerProduct, isElementConstrained, isFullyMutable, isMutable, isSameShape, multiply, negate, outerProduct, pow, reshape, scale, scaleAdd, set, set, set, set, setElements, setElements, slice, slice, sliceCount, sqrt, sub, sub, toArray, toDoubleArray, validatepublic Matrix(AMatrix m)
public static Matrix create(int rowCount, int columnCount)
public boolean isView()
INDArraypublic boolean isBoolean()
INDArraypublic boolean isZero()
AMatrixisZero in interface INDArrayisZero in class ADenseArrayMatrixpublic boolean isPackedArray()
AArrayMatrixisPackedArray in interface IStridedArrayisPackedArray in class ADenseArrayMatrixpublic static Matrix wrap(int rowCount, int columnCount, double[] data)
public AStridedMatrix subMatrix(int rowStart, int rows, int colStart, int cols)
subMatrix in class AStridedMatrixpublic Vector innerProduct(AVector a)
innerProduct in class AMatrixpublic Matrix innerProduct(Matrix a)
innerProduct in class AMatrixpublic Matrix innerProduct(AMatrix a)
innerProduct in class AMatrixpublic double elementSum()
AMatrixelementSum in interface INDArrayelementSum in class AMatrixpublic void abs()
INDArraypublic void signum()
INDArraypublic void square()
INDArraypublic void exp()
INDArraypublic void log()
INDArraypublic long nonZeroCount()
INDArraynonZeroCount in interface INDArraynonZeroCount in class AMatrixpublic Matrix clone()
ATransformpublic final void copyRowTo(int row,
double[] dest,
int destOffset)
copyRowTo in class ADenseArrayMatrixpublic final void copyColumnTo(int col,
double[] dest,
int destOffset)
copyColumnTo in class AStridedMatrixpublic Vector transform(AVector a)
ATransformpublic Vector transform(Vector a)
ATransformpublic void transform(AVector source, AVector dest)
ATransformtransform in interface ITransformtransform in class AMatrixpublic ArraySubVector getRow(int row)
AMatrixgetRow in class AStridedMatrixpublic AStridedVector getColumn(int col)
AMatrixgetColumn in class AStridedMatrixpublic void swapRows(int i,
int j)
AMatrixpublic void swapColumns(int i,
int j)
AMatrixswapColumns in class AMatrixpublic void multiplyRow(int i,
double factor)
AMatrixmultiplyRow in class AMatrixpublic void addRowMultiple(int src,
int dst,
double factor)
AMatrixaddRowMultiple in class AMatrixpublic Vector asVector()
AMatrixpublic Vector toVector()
AMatrixpublic final Matrix toMatrix()
AMatrixpublic Matrix toMatrixTranspose()
AMatrixtoMatrixTranspose in class AMatrixpublic void toDoubleBuffer(DoubleBuffer dest)
INDArraytoDoubleBuffer in interface INDArraytoDoubleBuffer in class AMatrixpublic double[] asDoubleArray()
INDArrayasDoubleArray in interface INDArrayasDoubleArray in class AStridedMatrixpublic double get(int row,
int column)
AMatrixpublic void unsafeSet(int row,
int column,
double value)
AMatrixunsafeSet in class ADenseArrayMatrixpublic double unsafeGet(int row,
int column)
AMatrixunsafeGet in class ADenseArrayMatrixpublic void set(int row,
int column,
double value)
AMatrixpublic void applyOp(Op op)
INDArraypublic void addMultiple(Matrix m, double factor)
public void add(Matrix m)
public void addMultiple(AMatrix m, double factor)
addMultiple in class AMatrixpublic void add(double d)
INDArraypublic void add(AMatrix m)
AMatrixpublic void multiply(double factor)
INDArraypublic void getElements(double[] dest,
int offset)
INDArraygetElements in interface INDArraygetElements in class AMatrixpublic Iterator<Double> elementIterator()
INDArrayelementIterator in interface INDArrayelementIterator in class AMatrixpublic StridedMatrix getTranspose()
AMatrixgetTranspose in interface INDArraygetTranspose in class AMatrixpublic StridedMatrix getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in class AStridedMatrixpublic void set(double value)
INDArraypublic void reciprocal()
INDArrayreciprocal in interface INDArrayreciprocal in class AMatrixpublic void clamp(double min,
double max)
INDArraypublic Matrix exactClone()
INDArrayexactClone in interface INDArrayexactClone in class AMatrixpublic StridedVector getBand(int band)
AMatrixprotected final int index(int row,
int col)
AArrayMatrixindex in class ADenseArrayMatrixpublic int getArrayOffset()
getArrayOffset in interface IStridedArraygetArrayOffset in class ADenseArrayMatrixpublic double[] getArray()
getArray in interface IStridedArraygetArray in class AArrayMatrixCopyright © 2013. All Rights Reserved.