开发者

Concurrent Access Sparse Matrix in Java

I'm looking for a matrix / linear algebra library in Java that provides a spar开发者_如何学Gose matrix that can be written to concurrently from different threads. Most of the libraries I've come across either do not provide sparse matrices at all, or 1.) back them with an open addressed hash map, or 2.) store then in CSR or CSC format which is not at all amenable to multithreaded construction. Right now I'm gather the entries in parallel using a concurrent hash map and them populating the sparse matrix from a single thread, but this seems like a waste of resources (space to store the concurrent hash map, and time to essentially fill in the matrix twice).


You can't just magically make sparse matrix algebra routines scalably parallel. Tackling these issues involves some of the most complex numerical analysis algorithms around and is still the subject of intense research.

You don't say what you want to do with these matrices but I imagine that you want solution to systems of linear equations. If you want that in parallel then you'll need a 3rd party library, very large matrices, and likely some money.

The most common way to assemble sparse matrices is to assemble them in triplet format and convert to compressed row or column format. The assembly can be expensive but it is easy to do in parallel. Just let each thread have its own list of triplets and splice them together before converting to compressed format.


I remember the matrices in parallel colt being thread safe. The library is a multithreaded version of colt.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜