稀疏矩阵的UJMP Java库 [英] UJMP Java library for sparse matrix

查看:109
本文介绍了稀疏矩阵的UJMP Java库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了UJMP(通用Java矩阵包)库并将其包含到我的项目中,用于生成稀疏矩阵.但是我找不到关于库功能,如何创建稀疏矩阵,将元素添加到矩阵等的任何文档.是否有人对此有经验或有关于该库的文档?谢谢大家.

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.

推荐答案

有一个支持稀疏矩阵的 la4j库和向量.请遵循官方站点上给出的示例. la4j支持 CRS(压缩行存储)

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.

这里是示例:

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);

la4j是积极开发的.当前版本 0.5.0 已于2015年1月发布.

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

这篇关于稀疏矩阵的UJMP Java库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆