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

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -