[eigen] Created Java wrapper for Eigen |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Created Java wrapper for Eigen
- From: Hugh Perkins <hughperkins2@xxxxxxxxx>
- Date: Thu, 04 Oct 2012 15:58:56 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=y3+kl329CuS7hrZCssEUapgt98fCC548I9scApZntds=; b=hTXA9Ru75lMfDcsqvJUM8LEbY+zKbgyfKIEw2gPBdZpVJsTx3A8IOIEgX1bot1v2v6 80bX1tyhHuWf+TaqOshEue0KOlHLcKxz56HjRcla3qbrl7VieRWDSnvn9cdDgKgRlnCi FoRXAXblGBK+A9VY5OkCkbkwQQJmCvCZM5CcuOveXJMx2qc6RZPgw5rhD4zMyZbwYwZN a4HXBdn76B465SFg/S3v/+KzAXgH+Z1tvQi9evby7D7SPPJu7BmAmNqhVt1iCaF9d/5S fUa8ftk9utXygiblLSBYnneTJOaiHX34THU2PIDnqec/A6H28m5sFyIXHpKC7NAcI2Pe S4gw==
Hi,
There is a java wrapper for eigen now at:
https://github.com/hughperkins/jeigen
It uses Eigen for the underlying matrix multiplications and for the
linear matrix solver. It has no other dependencies.
The wrapper uses jna native, which is both relatively fast, and fairly
easy to maintain.
Here is a comparison with other java libraries. Example test implementation:
int K = 100;
int N = 100000;
DenseMatrix A = rand(N, K);
DenseMatrix B = rand(K, N);
Timer timer = new Timer();
DenseMatrix C = B.mmul(A);
timer.printTimeCheckMilliseconds();
Jama: 4090 ms
Jblas: 1594 ms
ojalgo: 2381 ms (using two threads)
Jeigen: 2514 ms
- Compared to jama, everything is faster :-P
- Compared to jblas, Jeigen is not quite as fast, but Jeigen can handle
sparse matrices.
- Compared to ojalgo, Jeigen takes about the same amount of elapsed
time, but only using one core, so the total cpu time is about half.