Package org.ejml.data
Interface DMatrixSparse
- All Superinterfaces:
DMatrix
,Matrix
,MatrixSparse
,ReshapeMatrix
,Serializable
- All Known Implementing Classes:
DMatrixSparseCSC
,DMatrixSparseTriplet
High level interface for sparse matrices double types.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Value of an element in a sparse matrix -
Method Summary
Modifier and TypeMethodDescriptionCreates an iterator which will go through each non-zero value in the sparse matrix.double
get
(int row, int col, double fallBackValue) Returns the value of value of the specified matrix element.double
unsafe_get
(int row, int col, double fallBackValue) Same asget(int, int, double)
but does not perform bounds check on input parameters.Methods inherited from interface org.ejml.data.DMatrix
get, getNumElements, set, unsafe_get, unsafe_set
Methods inherited from interface org.ejml.data.Matrix
copy, create, createLike, getNumCols, getNumRows, getType, print, print, setTo
Methods inherited from interface org.ejml.data.MatrixSparse
getNonZeroLength, isAssigned, printNonZero, remove, reshape, reshape, shrinkArrays, zero
-
Method Details
-
get
double get(int row, int col, double fallBackValue) Returns the value of value of the specified matrix element.- Parameters:
row
- Matrix element's row index..col
- Matrix element's column index.fallBackValue
- Value to return, if the matrix element is not assigned- Returns:
- The specified element's value.
-
unsafe_get
double unsafe_get(int row, int col, double fallBackValue) Same asget(int, int, double)
but does not perform bounds check on input parameters. This results in about a 25% speed increase but potentially sacrifices stability and makes it more difficult to track down simple errors. It is not recommended that this function be used, except in highly optimized code where the bounds are implicitly being checked.- Parameters:
row
- Matrix element's row index..col
- Matrix element's column index.fallBackValue
- Value to return, if the matrix element is not assigned- Returns:
- The specified element's value or the fallBackValue, if the element is not assigned.
-
createCoordinateIterator
Iterator<DMatrixSparse.CoordinateRealValue> createCoordinateIterator()Creates an iterator which will go through each non-zero value in the sparse matrix. Order is not defined and is implementation specific
-