public class SparseColumnMatrix extends ASparseRCMatrix implements ISparse, IFastColumns
datacols, rows| Modifier | Constructor and Description |
|---|---|
protected |
SparseColumnMatrix(AVector... vectors) |
protected |
SparseColumnMatrix(AVector[] data,
int rowCount,
int columnCount) |
protected |
SparseColumnMatrix(int rowCount,
int columnCount) |
protected |
SparseColumnMatrix(List<AVector> data) |
protected |
SparseColumnMatrix(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
|
AMatrix |
addCopy(AMatrix m)
Adds another matrix to this matrix, returning a new matrix
|
SparseRowMatrix |
addCopy(AVector v)
Adds a vector to every row of this matrix, returning a new matrix
|
SparseColumnMatrix |
addCopy(SparseColumnMatrix m)
Adds another SparseColumnMatrix to this matrix
|
void |
addMultiple(AMatrix a,
double factor)
Adds a scalar multiple of another matrix to this matrix
|
void |
addToArray(double[] targetData,
int offset)
Adds all the elements of this array to a double array, in row-major order
|
void |
applyOp(IOperator op)
Applies a unary operator to all elements of the array (in-place)
|
void |
applyOp(Op op)
Applies a unary operator to all elements of the array (in-place)
|
void |
applyOp(Op2 op,
AMatrix b) |
void |
applyOp(Op2 op,
double b)
Applies a binary operator to this array and a double value.
|
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 i,
double[] targetData,
int offset)
Copies the elements in a selected row of this matrix to a double array
|
void |
copyRowTo(int row,
double[] targetData,
int offset)
Copies the elements in a slected row of this matrix to a double array
|
static SparseColumnMatrix |
create(AMatrix source) |
static SparseColumnMatrix |
create(AVector... vecs) |
static SparseColumnMatrix |
create(AVector[] data,
int rows,
int cols) |
static SparseColumnMatrix |
create(int rows,
int cols) |
static SparseColumnMatrix |
create(List<AVector> columns) |
boolean |
epsilonEquals(AMatrix a,
double epsilon) |
boolean |
equals(AMatrix m)
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
|
SparseColumnMatrix |
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
|
AVector |
getColumn(int j)
Returns a column of the matrix.
|
AVector |
getColumnView(int j)
Returns a column of the matrix as a vector view.
|
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 |
List<AVector> |
getRows()
Gets a List of rows of a matrix.
|
SparseRowMatrix |
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
|
Vector |
innerProduct(Vector a)
Transforms a dense source Vector using matrix multiplication (inner product).
|
boolean |
isLowerTriangular()
Returns true if a matrix is lower triangular.
|
protected int |
lineLength() |
AMatrix |
multiplyCopy(double a)
Returns a copy of the array with all elements multiplied by a single constant value
|
double |
reduce(Op2 op,
double init)
Reduces over all elements of the array in row-major order.
|
void |
replaceColumn(int i,
AVector vec)
Replaces a column in a matrix, adding the column to the internal structure of the matrix.
|
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
|
AMatrix |
sparse()
Coerces this INDArray to a sparse format, without changing its element values.
|
void |
swapColumns(int i,
int j)
Swaps two columns of the matrix in place
|
double[] |
toDoubleArray()
Copies the elements of this array to a new double[] array.
|
Matrix |
toMatrixTranspose()
Coerces the transpose of a matrix to the standard mutable Matrix type
in row major order.
|
SparseRowMatrix |
toSparseRowMatrix()
Coerces this matrix into a SparseRowMatrix format.
|
AMatrix |
transposeInnerProduct(AMatrix a) |
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 SparseColumnMatrix |
wrap(AVector... vecs) |
static SparseColumnMatrix |
wrap(AVector[] vecs,
int rows,
int cols) |
static SparseColumnMatrix |
wrap(List<AVector> vecs) |
abs, 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, addInnerProduct, addInnerProduct, addInnerProduct, addMultiple, addMultiple, addOuterProduct, addOuterProduct, addRowMultiple, 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, equals, equals, equalsByRows, equalsTranspose, get, get, get, getBand, getBandWrapped, getColumns, getElements, getLeadingDiagonal, getLongShape, getRow, getRowView, getSlices, getSlices, getSliceViews, getTranspose, getTransposeCopy, hashCode, hasOrthonormalColumns, hasOrthonormalRows, hasUncountable, immutable, innerProduct, innerProduct, innerProduct, inputDimensions, inverse, isBoolean, isDiagonal, isElementConstrained, isHermitian, isIdentity, isInvertible, isOrthogonal, isOrthogonal, isPositiveDefinite, isRectangularDiagonal, isSymmetric, isUpperTriangular, isView, iterator, join, lowerBandwidth, lowerBandwidthLimit, mul, multiply, multiply, multiply, multiply, multiplyRow, mutable, negate, outerProduct, outputDimensions, rank, reduce, reduceSlices, reduceSlices, reorder, reorder, replaceRow, reshape, reshape, rotateView, rowDotProduct, scaleAdd, scaleAdd, set, set, set, set, set, set, set, setColumn, setElements, setElements, setRow, signum, slice, slice, sliceCount, sparseClone, sub, sub, sub, subArray, subMatrix, swapRows, toAffineTransform, toArray, toDoubleBuffer, toMatrix, toMutableMatrix, toNestedDoubleArrays, toSliceArray, toString, toStringFull, toVector, trace, transform, transform, transformInPlace, transformInPlace, 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, columnCount, diagonalProduct, getBand, getColumnClone, getColumns, getRow, getRowClone, getRowView, getTranspose, 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, 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, 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, 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 SparseColumnMatrix(int rowCount,
int columnCount)
protected SparseColumnMatrix(AVector[] data, int rowCount, int columnCount)
protected SparseColumnMatrix(AVector... vectors)
public static SparseColumnMatrix create(int rows, int cols)
public static SparseColumnMatrix create(AVector[] data, int rows, int cols)
public static SparseColumnMatrix create(AVector... vecs)
public static SparseColumnMatrix create(List<AVector> columns)
public static SparseColumnMatrix wrap(AVector[] vecs, int rows, int cols)
public static SparseColumnMatrix wrap(AVector... vecs)
public static SparseColumnMatrix create(AMatrix source)
public static SparseColumnMatrix 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 addAt(int i,
int j,
double d)
IMatrixpublic void addToArray(double[] targetData,
int offset)
INDArrayaddToArray in interface INDArrayaddToArray in class AMatrixpublic void applyOp(Op2 op, double b)
INDArraypublic void applyOp(IOperator op)
INDArraypublic void applyOp(Op op)
INDArrayapplyOp in interface INDArrayapplyOp in class ASparseRCMatrixpublic double reduce(Op2 op, double init)
INDArraypublic List<AVector> getRows()
IMatrixpublic SparseRowMatrix toSparseRowMatrix()
public AVector getColumn(int j)
IMatrixpublic AVector getColumnView(int j)
IMatrixgetColumnView in interface IMatrixgetColumnView in class AMatrixpublic boolean isLowerTriangular()
AMatrixisLowerTriangular in class AMatrixpublic void swapColumns(int i,
int j)
AMatrixswapColumns in class AMatrixpublic void replaceColumn(int i,
AVector vec)
AMatrixreplaceColumn in class AMatrixpublic void add(AMatrix a)
AMatrixpublic void addMultiple(AMatrix a, double factor)
AMatrixaddMultiple in class AMatrixpublic AMatrix addCopy(AMatrix m)
IMatrixpublic SparseRowMatrix addCopy(AVector v)
IMatrixpublic SparseColumnMatrix addCopy(SparseColumnMatrix m)
m - public void copyColumnTo(int i,
double[] targetData,
int offset)
AMatrixcopyColumnTo in class ASparseRCMatrixtargetData - Destination double[] arraypublic void copyRowTo(int row,
double[] targetData,
int offset)
AMatrixcopyRowTo in class ASparseRCMatrixrow - The index of the selected rowtargetData - Destination double[] arrayoffset - Offset into destination arraypublic SparseRowMatrix 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 AMatrix innerProduct(AMatrix a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic AVector innerProduct(AVector a)
INDArrayinnerProduct in interface INDArrayinnerProduct in interface IMatrixinnerProduct in class AMatrixa - A vectorpublic Vector innerProduct(Vector a)
IMatrixinnerProduct in interface IMatrixinnerProduct in class AMatrixpublic Matrix toMatrixTranspose()
AMatrixtoMatrixTranspose in class AMatrixpublic double[] toDoubleArray()
INDArraytoDoubleArray in interface INDArraytoDoubleArray in class ASparseRCMatrixpublic AMatrix transposeInnerProduct(AMatrix a)
transposeInnerProduct in class AMatrixpublic SparseColumnMatrix 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 ASparseRCMatrixpublic boolean epsilonEquals(AMatrix a, double epsilon)
epsilonEquals in class AMatrixpublic boolean equals(AMatrix m)
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 arrayCopyright © 2016. All rights reserved.