public class CacheMatrix<K,V> extends AbstractMatrix
Matrix.Element
Constructor and Description |
---|
CacheMatrix() |
CacheMatrix(int rows,
int cols,
IgniteCache<K,V> cache,
MatrixKeyMapper<K> keyMapper,
ValueMapper<V> valMapper)
Creates new matrix over existing cache.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
assign(double val)
Assigns given value to all elements of this matrix.
|
Matrix |
copy()
Clones this matrix.
|
Matrix |
divide(double d)
Return the same matrix with updates values (broken contract).
|
Matrix |
like(int rows,
int cols)
Creates new empty matrix of the same underlying class but of different size.
|
Vector |
likeVector(int crd)
Creates new empty vector of compatible properties (similar or the same flavor) to this matrix.
|
Matrix |
map(IgniteDoubleFunction<Double> fun)
Maps all values in this matrix through a given function.
|
double |
maxValue()
Gets the maximum value in this matrix.
|
double |
minValue()
Gets the minimum value in this matrix.
|
Matrix |
plus(double x)
Return the same matrix with updates values (broken contract).
|
double |
sum()
Gets sum of all elements in the matrix.
|
Matrix |
times(double x)
Return the same matrix with updates values (broken contract).
|
allSpliterator, assign, assign, assign, assignColumn, assignRow, columnSize, compute, density, destroy, determinant, equals, foldColumns, foldMap, foldRows, get, getCol, getElement, getMaxAmountOfColumns, getMetaStorage, getRow, getStorage, getX, guid, hashCode, inverse, isArrayBased, isDense, isDistributed, isRandomAccess, isSequentialAccess, likeIdentity, map, maxAbsRowSumNorm, maxElement, minElement, minus, nonZeroElements, nonZeroSpliterator, plus, readExternal, rowSize, set, setColumn, setRow, setStorage, setX, storageGet, storageSet, swapColumns, swapRows, times, times, toString, transpose, viewColumn, viewDiagonal, viewPart, viewPart, viewRow, writeExternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAttribute, hasAttribute, removeAttribute, setAttribute
public CacheMatrix()
public CacheMatrix(int rows, int cols, IgniteCache<K,V> cache, MatrixKeyMapper<K> keyMapper, ValueMapper<V> valMapper)
rows
- Amount of rows in matrix.cols
- Amount of columns in matrix.cache
- Ignite cache.keyMapper
- MatrixKeyMapper
to validate cache key.valMapper
- ValueMapper
to obtain value for given cache key.public Matrix copy()
NOTE: new matrix will have the same flavor as the this matrix but a different ID.
copy
in interface Matrix
copy
in class AbstractMatrix
public Matrix like(int rows, int cols)
NOTE: new matrix will have the same flavor as the this matrix but a different ID.
rows
- Number of rows for new matrix.cols
- Number of columns for new matrix.public Vector likeVector(int crd)
crd
- Cardinality of the vector.public Matrix divide(double d)
divide
in interface Matrix
divide
in class AbstractMatrix
d
- Value to divide to.public Matrix plus(double x)
plus
in interface Matrix
plus
in class AbstractMatrix
x
- Value to add.public Matrix times(double x)
times
in interface Matrix
times
in class AbstractMatrix
x
- Value to multiply to.public Matrix assign(double val)
assign
in interface Matrix
assign
in class AbstractMatrix
val
- Value to assign to all elements.public Matrix map(IgniteDoubleFunction<Double> fun)
map
in interface Matrix
map
in class AbstractMatrix
fun
- Mapping function.public double sum()
sum
in interface Matrix
sum
in class AbstractMatrix
public double maxValue()
maxValue
in interface Matrix
maxValue
in class AbstractMatrix
public double minValue()
minValue
in interface Matrix
minValue
in class AbstractMatrix
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018