The problem of sparse matrix java

I have a two-dimensional matrix. My matrix is ​​sparse. I ran into a performance issue. Can any body answer the question of what api or class can I use in java to process a sparse matrix in order to improve the performance of my program.

For example, I want

it take 100x100 matrix handle sparse stuff do the multiplication return me my matrix same as 100x100 with 0 ( mean sparse matrix ) 
+4
source share
4 answers

Jama is terrible for large sparse matrices.

Look at the Colt linear algebra library.


Another option for sparse linear algebra is the apache library . It may be a little easier than Colt, but the difference from the appearance of Jama may be a little more.

+6
source

SuanShu contains a large set of sparse matrices. You can simply use them instead of writing your own.

They currently support these formats: CSR, DOK, LIL

+1
source

Have you tried using Jama? http://math.nist.gov/javanumerics/jama/ - they do not support the direct matrix, but it is a widely used package.

Also, the printton seems to have a rare matrix implementation so you can take a look at http://www.cs.princeton.edu/introcs/44st/SparseMatrix.java.html

0
source

You can look at la4j (linear algebra for Java). La4j supports sparse matrices as well as dense ones. The following is a list of supported matrix types: 1D array (dense), 2D array (dense), CRS - compressed row storage (sparse), CCS - compressed column storage (sparse).

0
source

Source: https://habr.com/ru/post/1302061/


All Articles