public abstract class BaseSparseNDArrayCSR extends BaseSparseNDArray
Modifier and Type | Field and Description |
---|---|
protected DataBuffer |
columnsPointers |
protected static SparseFormat |
format |
protected DataBuffer |
pointerB |
protected DataBuffer |
pointerE |
protected DataBuffer |
values |
columns, isMatrix, isScalar, isSparse, isVector, javaShapeInformation, length, rank, rows, shape, shapeInformation, sparseInformation, stride, THRESHOLD_MEMORY_ALLOCATION
Constructor and Description |
---|
BaseSparseNDArrayCSR(DataBuffer data,
int[] columnsPointers,
int[] pointerB,
int[] pointerE,
int[] shape) |
BaseSparseNDArrayCSR(double[] data,
int[] columnsPointers,
int[] pointerB,
int[] pointerE,
int[] shape)
The length of the values and columns arrays is equal to the number of non-zero elements in A.
|
BaseSparseNDArrayCSR(float[] data,
int[] columnsPointers,
int[] pointerB,
int[] pointerE,
int[] shape) |
Modifier and Type | Method and Description |
---|---|
DataBuffer |
data()
Returns a linear double array representation of this ndarray
|
boolean |
equals(Object o) |
INDArray |
get(INDArrayIndex... indexes)
Returns a subset of this array based on the specified
indexes
|
double[] |
getColumns() |
double[] |
getDoubleValues() |
SparseFormat |
getFormat()
Return the sparse format (i.e COO, CSR, ...)
|
DataBuffer |
getPointerB() |
int[] |
getPointerBArray() |
DataBuffer |
getPointerE() |
int[] |
getPointerEArray() |
DataBuffer |
getVectorCoordinates()
Return the minor pointers.
|
boolean |
isView()
Returns true if this array is a view or not
|
INDArray |
putiColumnVector(INDArray columnVector)
In place assignment of a column vector
|
INDArray |
putiRowVector(INDArray rowVector)
in place assignment of row vector, to each row of this array
|
INDArray |
putScalar(int row,
int col,
double value)
Insert the value at the specified indices, in a 2d (rank 2) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
DataBuffer |
shapeInfoDataBuffer()
Shape info
|
INDArray |
subArray(long[] offsets,
int[] shape,
int[] stride) |
INDArray |
subArray(ShapeOffsetResolution resolution)
Sub array based on the
pre calculated shape,strides, offsets
|
INDArray |
toDense()
Return a dense representation of the sparse ndarray
|
int |
underlyingRank() |
add, add, add, add, add, add, addColumnVector, addi, addi, addi, addi, addi, addi, addiColumnVector, addiRowVector, addRowVector, amax, amaxNumber, amean, ameanNumber, amin, aminNumber, argMax, assign, assign, assignIf, broadcast, checkDimensions, cleanup, columns, cond, condi, cumsum, cumsumi, detach, dimShuffle, distance1, distance2, div, div, div, div, div, div, divColumnVector, divi, divi, divi, divi, divi, divi, diviColumnVector, diviRowVector, divRowVector, dup, dup, element, elementStride, elementWiseStride, entropy, entropyNumber, eps, eps, epsi, epsi, eq, eq, eqi, eqi, equalsWithEps, flags, fmod, fmod, fmod, fmod, fmodi, fmodi, get, get, getColumn, getColumns, getDouble, getDouble, getDouble, getDoubleUnsafe, getFloat, getFloat, getFloat, getInt, getLeadingOnes, getPercentile, getRow, getRows, getScalar, getScalar, getScalar, getTrailingOnes, getWhere, getWhere, gt, gt, gte, gtei, gti, gti, hiddenDimensions, index, init, innerMostStride, isAttached, isCleanedUp, isColumnVector, isCompressed, isInScope, isMatrix, isRowVector, isScalar, isSparse, isSquare, isVector, isWrapAround, javaTensorAlongDimension, length, lengthLong, leverage, leverageOrDetach, leverageTo, leverageTo, linearIndex, linearView, linearViewColumnOrder, logEntropy, logEntropyNumber, lt, lt, lte, ltei, lti, lti, majorStride, markAsCompressed, match, match, max, maxComplex, maxNumber, mean, mean, meanComplex, meanNumber, median, medianNumber, migrate, migrate, min, minComplex, minNumber, mmul, mmul, mmuli, mmuli, mul, mul, mul, mul, mul, mul, mulColumnVector, muli, muli, muli, muli, muli, muli, muliColumnVector, muliRowVector, mulRowVector, neg, negi, neq, neq, neqi, neqi, nnz, norm1, norm1Complex, norm1Number, norm2, norm2Complex, norm2Number, normmax, normmaxComplex, normmaxNumber, offset, ordering, originalOffset, percentile, percentileNumber, permute, permutei, prod, prodComplex, prodNumber, put, put, put, put, put, put, put, put, putColumn, putRow, putScalar, putScalar, putScalar, putScalar, putScalar, putScalar, putScalar, putScalar, putScalarUnsafe, putSlice, putWhere, putWhere, putWhere, putWhereWithMask, putWhereWithMask, rank, ravel, ravel, rdiv, rdiv, rdiv, rdiv, rdiv, rdiv, rdivColumnVector, rdivi, rdivi, rdivi, rdivi, rdivi, rdivi, rdiviColumnVector, rdiviRowVector, rdivRowVector, reallocate, remainder, remainder, remainder, remainder, remainderi, remainderi, repeat, replaceWhere, repmat, resetLinearView, reshape, reshape, reshape, reshape, rows, rsub, rsub, rsub, rsub, rsub, rsub, rsubColumnVector, rsubi, rsubi, rsubi, rsubi, rsubi, rsubi, rsubiColumnVector, rsubiRowVector, rsubRowVector, scan, secondaryStride, setData, setOrder, setShape, setShapeAndStride, setShapeInformation, setStride, setWrapAround, shannonEntropy, shannonEntropyNumber, shape, shapeInfo, shapeInfoToString, shapeOf, size, slice, slice, slices, sliceVectors, sparseInfoDataBuffer, sparseOffsets, squaredDistance, std, std, stdComplex, stdNumber, stdNumber, stride, stride, strideOf, sub, sub, sub, sub, sub, sub, subColumnVector, subi, subi, subi, subi, subi, subi, subiColumnVector, subiRowVector, subRowVector, sum, sum, sumComplex, sumNumber, swapAxes, tensorAlongDimension, tensorssAlongDimension, toDoubleMatrix, toDoubleVector, toFloatMatrix, toFloatVector, toIntMatrix, toIntVector, transpose, transposei, unsafeDuplication, unsafeDuplication, var, var, varComplex, varNumber, vectorAlongDimension, vectorsAlongDimension
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertToDoubles, convertToFloats, mmul, mmul, mmuli, mmuli, toFlatArray
protected static final SparseFormat format
protected transient volatile DataBuffer values
protected transient volatile DataBuffer columnsPointers
protected transient volatile DataBuffer pointerB
protected transient volatile DataBuffer pointerE
public BaseSparseNDArrayCSR(double[] data, int[] columnsPointers, int[] pointerB, int[] pointerE, int[] shape)
data
- a double array that contains the non-zero element of the sparse matrix AcolumnsPointers
- Element i of the integer array columns is the number of the column in A that contains the i-th value
in the values array.pointerB
- Element j of this integer array gives the index of the element in the values array that is first
non-zero element in a row j of A. Note that this index is equal to pointerB(j) - pointerB(1)+1 .pointerE
- An integer array that contains row indices, such that pointerE(j)-pointerB(1) is the index of the
element in the values array that is last non-zero element in a row j of A.shape
- Shape of the matrix Apublic BaseSparseNDArrayCSR(float[] data, int[] columnsPointers, int[] pointerB, int[] pointerE, int[] shape)
public BaseSparseNDArrayCSR(DataBuffer data, int[] columnsPointers, int[] pointerB, int[] pointerE, int[] shape)
public INDArray putScalar(int row, int col, double value)
INDArray
INDArray.putScalar(int[], double)
but avoids int[] creationputScalar
in interface INDArray
putScalar
in class BaseSparseNDArray
row
- Row (dimension 0) indexcol
- Column (dimension 1) indexvalue
- Value to putpublic INDArray get(INDArrayIndex... indexes)
get
in interface INDArray
get
in class BaseSparseNDArray
indexes
- the indexes in to the arraypublic DataBuffer getVectorCoordinates()
public double[] getDoubleValues()
public double[] getColumns()
public int[] getPointerBArray()
public int[] getPointerEArray()
public SparseFormat getFormat()
ISparseNDArray
SparseFormat
public DataBuffer getPointerB()
public DataBuffer getPointerE()
public DataBuffer data()
INDArray
public INDArray toDense()
ISparseNDArray
toDense
in interface INDArray
toDense
in interface ISparseNDArray
toDense
in class BaseSparseNDArray
public DataBuffer shapeInfoDataBuffer()
INDArray
shapeInfoDataBuffer
in interface INDArray
shapeInfoDataBuffer
in class BaseSparseNDArray
public INDArray subArray(ShapeOffsetResolution resolution)
INDArray
subArray
in interface INDArray
subArray
in class BaseSparseNDArray
resolution
- the resolution to usepublic INDArray subArray(long[] offsets, int[] shape, int[] stride)
subArray
in interface INDArray
subArray
in class BaseSparseNDArray
public boolean equals(Object o)
equals
in class BaseSparseNDArray
public boolean isView()
INDArray
public int underlyingRank()
public INDArray putiColumnVector(INDArray columnVector)
INDArray
columnVector
- the column vector to addCopyright © 2018. All rights reserved.