Scala Breeze DenseMatrix to SparseMatrix conversion -


im struggeling find way convert densematrix sparsematrix.

i tried flattening densematrix array, converting sparse matrix , reshaping not possible since there no reshape function..

val dm = densematrix((1,2,3),(0,0,0),(0,0,0)) val sm =cscmatrix(dm.toarray) sm.reshape(3,3) 

error: value reshape not member of breeze.linalg.cscmatrix[int]

how this:

val dm = densematrix((1,2,3),(0,0,0),(0,0,0)) val sm = cscmatrix.tabulate(dm.rows, dm.cols)(dm(_, _)) 

Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -