Question

I have downloaded and included UJMP (Universal Java Matrix Package) library to my project for generating sparse matrix. But I could not find any documentation about functions of the library, how to create a sparse matrix, adding element to matrix etc. Is there anyone experienced about it or have a documentation about the library? Thank you for all.

No correct solution

OTHER TIPS

There is a la4j library that supports sparse matrices and vectors. Follow the examples given at official site. la4j supports CRS (Compressed Row Storage) as well as CCS (Compressed Column Storage) for sparse matrices. More importantly, the its actually taking the advantages from sparse data in computations due to easy-to-use composable iterators. For example, multiplication of two sparse matrices of shape 10k x 10k with just 1% of non-zero values will take a few microseconds on a modern laptop.

Here is the example:

Matrix a = CRSMatrix.random(10000, 10000, 0.25 /* density */, new Random());
Matrix b = CCSMatrix.random(10000, 10000, 0.25 /* density */, new Random());
Matrix c = a.multiply(b);

The la4j is actively developed. The current version 0.5.0 has released in Jan 2015.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top