vkostyukov / la4j

Linear Algebra for Java
http://la4j.org
Apache License 2.0
371 stars 109 forks source link

Sparse Matrix, self additon w/ transpose #307

Open aintHuman opened 4 years ago

aintHuman commented 4 years ago

So I have a square sparse matrix:

SparseMatrix m = new CRSMatrix(n,n)

And I need to add to transpose of itself to enforce symmetry:

m = (SparseMatrix)m.add(m.transpose())

However the performance is not so good, taking several seconds to execute.

Which is the best way of achieving this operation using la4j?