public void convertToSparse ( ) { switch ( mat . getType ( ) ) { case DDRM : { DMatrixSparseCSC m = new DMatrixSparseCSC ( mat . getNumRows ( ) , mat . getNumCols ( ) ) ; ConvertDMatrixStruct . convert ( ( DMatrixRMaj ) mat , m , 0 ) ; setMatrix ( m ) ; } break ; case FDRM : { FMatrixSparseCSC m = new FMatrixSparseCSC ( mat . getNumRows ( ) , mat . getNumCols ( ) ) ; ConvertFMatrixStruct . convert ( ( FMatrixRMaj ) mat , m , 0 ) ; setMatrix ( m ) ; } break ; case DSCC : case FSCC : break ; default : throw new RuntimeException ( "Conversion not supported!" ) ; } }
Switches from a dense to sparse matrix