public class SparseRowMatrix extends ASparseRCMatrix implements ISparse, IFastRows
datacols, rows| Modifier | Constructor and Description |
|---|---|
protected |
SparseRowMatrix(AVector... vectors) |
protected |
SparseRowMatrix(AVector[] data,
int rowCount,
int columnCount) |
protected |
SparseRowMatrix(int rowCount,
int columnCount) |
protected |
SparseRowMatrix(List<AVector> data) |
protected |
SparseRowMatrix(List<AVector> data,
int rowCount,
int columnCount) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AMatrix a)
Adds another matrix to this matrix.
|
void |
addAt(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 operation
|
void |
addToArray(double[] targetData,
int offset)
Adds all the elements of this array to a double array, in row-major order
|
AMatrix |
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.
|
int |
componentCount()
Returns the number of components of this array.
|
void |
copyColumnTo(int col,
double[] targetData,
int offset)
Copies the elements in a selected row of this matrix to a double array
|
void |
copyRowTo(int i,
double[] data,
int offset)
Copies the elements in a slected row of this matrix to a double array
|
static SparseRowMatrix |
create(AMatrix source) |
static INDArray |
create(ArrayList<INDArray> slices,
int rows,
int cols) |
static SparseRowMatrix |
create(AVector... vecs) |
static SparseRowMatrix |
create(AVector[] data,
int rows,
int cols) |
static SparseRowMatrix |
create(int rows,
int cols) |
static SparseRowMatrix |
create(List<AVector> rows) |
boolean |
equals(AMatrix m)
Returns true if this matrix is exactly equal to another matrix
|
SparseRowMatrix |
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
|
List<AVector> |
getColumns()
Gets a List of columns of a matrix.
|
AVector |
getComponent(int k)
Gets a component from the array at the specified index
Will throw an error if components are not supported, or if the component is out of bounds as defined by 0 <= k |
AVector |
getRow(int i)
Returns a row of the matrix.
|
List<AVector> |
getRows()
Gets a List of rows of a matrix.
|
AVector |
getRowView(int i)
Returns a row of the matrix as a vector view.
|
SparseColumnMatrix |
getTransposeView()
Returns a transposed view of the array.
|
AMatrix |
innerProduct(AMatrix a)
Computes the inner product of this matrix with another.
|
AVector |
innerProduct(AVector a)
Computes the inner product of this array with a vector
|
SparseRowMatrix |
innerProduct(SparseColumnMatrix a)
Specialised inner product for sparse row matrix multiplied by sparse column matrix.
|
SparseRowMatrix |
innerProduct(SparseRowMatrix a) |
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
|
protected int |
lineLength() |
AMatrix |
multiplyCopy(double a)
Returns a copy of the array with all elements multiplied by a single constant value
|
void |
multiplyRow(int i,
double value)
Multiplies a row by a constant factor
This is an elementary row operation
|
void |
replaceRow(int i,
AVector vec)
Replaces a row in a matrix, adding the row to the internal structure of the matrix.
|
double |
rowDotProduct(int i,
AVector a)
Returns the dot product of a specific row with a vector.
|
void |
set(AMatrix a)
Sets this matrix with the element values from another matrix.
|
void |
set(int i,
int j,
double value)
Sets a value at a given position in a mutable 2D array
|
void |
setRow(int i,
AVector v)
Sets a row in a matrix to the value specified by the given vector
|
AMatrix |
sparse()
Coerces this INDArray to a sparse format, without changing its element values.
|
void |
swapRows(int i,
int j)
Swaps two rows of the matrix in place
This is an elementary row operation
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
SparseColumnMatrix |
toSparseColumnMatrix() |
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 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.
|
void |
validate()
Validates the internal data structure of the INDArray.
|
static SparseRowMatrix |
wrap(AVector... vecs) |
static SparseRowMatrix |
wrap(AVector[] vecs,
int rows,
int cols) |
static SparseRowMatrix |
wrap(List<AVector> vecs) |
abs, applyOp, dense, elementMax, elementMin, elementSquaredSum, elementSum, exp, fill, getColumnClone, getRotatedData, getRowClone, isFullyMutable, isMutable, isSparse, isZero, log, nonZeroCount, pow, reciprocal, sqrt, square, unsafeGetVector, unsafeSetVecbandLength, checkColumn, checkIndex, checkRow, checkSameShape, checkSameShape, checkSquare, columnCount, elementCount, getShape, getShape, getShapeClone, isSameShape, isSameShape, isSameShape, isSquare, rowCountadd, add, add, add2, addCopy, addCopy, addCopy, addCopy, addCopy, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addMultiple, addOuterProduct, addOuterProduct, addRowMultiple, applyOp, applyOp, applyOp, applyOp, applyOp, applyOpCopy, asDoubleArray, asElementList, asVector, bandIndex, bandLength, bandPosition, bandStartColumn, bandStartRow, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, checkColumnCount, checkDimension, checkRowCount, checkShape, clamp, composeWith, copy, denseClone, determinant, diagonalProduct, dimensionality, divide, divide, divide, divide, elementIterator, elementsEqual, ensureMutable, epsilonEquals, epsilonEquals, epsilonEquals, epsilonEquals, equals, equals, equalsArray, equalsByRows, equalsTranspose, get, get, get, getBand, getBandWrapped, getColumn, getColumnView, getElements, getLeadingDiagonal, getLongShape, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isBoolean, isDiagonal, isElementConstrained, isHermitian, isIdentity, isInvertible, isLowerTriangular, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSymmetric, isView, iterator, join, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiply, mutable, negate, outerProduct, outputDimensions, rank, reduce, reduce, reduceSlices, reduceSlices, reorder, reorder, replaceColumn, reshape, reshape, rotateView, scaleAdd, scaleAdd, set, set, set, set, set, set, set, setColumn, setElements, setElements, signum, slice, slice, sliceCount, sparseClone, sub, sub, sub, subArray, subMatrix, swapColumns, toAffineTransform, toArray, toDoubleBuffer, toMatrix, toMatrixTranspose, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, trace, transform, transform, transformInPlace, transformInPlace, transposeInnerProduct, transposeInnerProduct, transposeInPlace, upperBandwidth, upperBandwidthLimitabsCopy, add, addAt, addInnerProduct, addPower, addPower, broadcastLike, checkMutable, density, divideCopy, elementAbsPowSum, elementPowSum, elementProduct, equals, equalsArray, get, get, get, get, get, getComponents, getElements, getElements, getElements, isDense, join, multiplyCopy, negateCopy, reciprocalCopy, scale, scaleCopy, setElements, setInnerProduct, setMultiple, setMultiple, signumCopy, sliceValue, squareCopy, sub, sub, subCopy, withComponentsfinalize, getClass, notify, notifyAll, wait, wait, waitadd2, addCopy, addCopy, columnCount, diagonalProduct, getBand, getColumn, getColumnClone, getColumnView, getRowClone, getTranspose, 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, asVector, broadcast, broadcastCloneLike, broadcastCopyLike, broadcastLike, broadcastLike, broadcastLike, checkMutable, clamp, copy, dense, denseClone, dimensionality, divide, divide, divideCopy, elementAbsPowSum, elementCount, elementIterator, elementMax, elementMin, elementPowSum, elementProduct, elementsEqual, elementSquaredSum, elementSum, ensureMutable, epsilonEquals, epsilonEquals, equals, equalsArray, equalsArray, exp, fill, get, get, get, get, get, get, get, get, 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, isZero, join, join, log, multiply, multiply, 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, setElements, setElements, setElements, setInnerProduct, setMultiple, setMultiple, signum, signumCopy, slice, slice, sliceCount, sliceValue, sparseClone, sqrt, square, squareCopy, sub, sub, subArray, subCopy, toArray, toDoubleBuffer, toSliceArray, toVector, withComponentsforEach, spliteratorprotected SparseRowMatrix(int rowCount,
int columnCount)
protected SparseRowMatrix(AVector[] data, int rowCount, int columnCount)
protected SparseRowMatrix(AVector... vectors)
public static SparseRowMatrix create(int rows, int cols)
public static SparseRowMatrix create(AVector[] data, int rows, int cols)
public static SparseRowMatrix create(AVector... vecs)
public static SparseRowMatrix create(List<AVector> rows)
public static SparseRowMatrix wrap(AVector[] vecs, int rows, int cols)
public static SparseRowMatrix wrap(AVector... vecs)
public static SparseRowMatrix create(AMatrix source)
public static SparseRowMatrix wrap(List<AVector> vecs)
public int componentCount()
INDArraycomponentCount in interface INDArraycomponentCount in class ASparseRCMatrixpublic AVector getComponent(int k)
INDArraygetComponent in interface INDArraygetComponent in class ASparseRCMatrixprotected int lineLength()
lineLength in class ASparseRCMatrixpublic double get(int i,
int j)
INDArraypublic void set(int i,
int j,
double value)
INDArraypublic double unsafeGet(int row,
int column)
AMatrixpublic void unsafeSet(int i,
int j,
double value)
AMatrixpublic void set(AMatrix a)
AMatrixpublic void setRow(int i,
AVector v)
AMatrixpublic void addAt(int i,
int j,
double d)
IMatrixpublic void addToArray(double[] targetData,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class AMatrixpublic List<AVector> getColumns()
IMatrixgetColumns in interface IMatrixgetColumns in class AMatrixpublic SparseColumnMatrix toSparseColumnMatrix()
public AVector getRow(int i)
IMatrixpublic List<AVector> getRows()
IMatrixpublic AVector getRowView(int i)
IMatrixgetRowView in interface IMatrixgetRowView in class AMatrixpublic boolean isUpperTriangular()
AMatrixisUpperTriangular in class AMatrixpublic void swapRows(int i,
int j)
AMatrixpublic void replaceRow(int i,
AVector vec)
AMatrixreplaceRow in class AMatrixpublic void add(AMatrix a)
AMatrixpublic void copyRowTo(int i,
double[] data,
int offset)
AMatrixcopyRowTo in class ASparseRCMatrixi - The index of the selected rowdata - Destination double[] arrayoffset - Offset into destination arraypublic void copyColumnTo(int col,
double[] targetData,
int offset)
AMatrixcopyColumnTo in class ASparseRCMatrixtargetData - Destination double[] arraypublic SparseColumnMatrix getTransposeView()
INDArraygetTransposeView in interface INDArraygetTransposeView in interface IMatrixgetTransposeView in class AMatrixpublic AMatrix multiplyCopy(double a)
INDArraymultiplyCopy in interface INDArraymultiplyCopy in class AMatrixa - A scalar factorpublic void multiplyRow(int i,
double value)
AMatrixmultiplyRow in class AMatrixpublic AVector innerProduct(AVector a)
INDArrayinnerProduct in interface INDArrayinnerProduct in interface IMatrixinnerProduct in class AMatrixa - A vectorpublic double rowDotProduct(int i,
AVector a)
AMatrixrowDotProduct in class AMatrixpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class ASparseRCMatrixpublic AMatrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic SparseRowMatrix innerProduct(SparseColumnMatrix a)
a - public SparseRowMatrix innerProduct(SparseRowMatrix a)
public SparseRowMatrix exactClone()
INDArrayexactClone in interface INDArrayexactClone in class AMatrixpublic AMatrix clone()
INDArraypublic AMatrix sparse()
INDArraysparse in interface INDArraysparse in class ASparseRCMatrixpublic void validate()
INDArrayvalidate in interface INDArrayvalidate in class ASparseRCMatrixCopyright © 2016. All rights reserved.