Re: [eigen] Created Java wrapper for Eigen |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Created Java wrapper for Eigen
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 5 Oct 2012 08:48:24 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Km6Vp7w2DYQYx9uUZkGUl8T26VnwNSy5BZNMaE2Mgik=; b=siHSwA5lhUoqL8rRKIJwFWQkruQsjf6CZtXMMmGefv6q9ibSHdnro4RZBEbxEzNh/c whyVcfClxUlb24b33q1v1HyC0aQ+kp0pQOArj8jYuSMCTOTQKpumO7L4FcJ0SL4DEHB7 vkWdAFYRRDczzUHtjy8vm8csU1IyHmquIeIeK5vKTMYNZr4/DDaBFTyygF0I6tVDLXBR E5KjH8V+DL222V6ultEjrQs+0zXn+CjMXQHMdbXV4hMzjTYsRSzP5Z8haABQk8YLkeKr 2w9qB08fL4VtSRizEeThknmb1zmrDV6HqoPGU8iyY1th8SzfuULWJ5MDdmU88IysxKGL a3tg==
Hi,
thank you for the information. I'll add a link in our project list.
Just one comment regarding the benchmark, I think the N and K values
of the code example are the ones used to produce the reported timings,
because here I get:
time 0.187964s 10.6403GFlops
(64bits system, SSE2 only, single threaded)
cheers,
gael
For the record, I used the following piece of code:
#include <Eigen/Core>
#include <iostream>
#include <bench/BenchTimer.h>
using namespace Eigen;
int main()
{
int K = 100;
int N = 100000;
BenchTimer t;
MatrixXd A = MatrixXd::Random(N, K);
MatrixXd B = MatrixXd::Random(K, N);
MatrixXd C;
BENCH(t, 10, 1, C = B * A);
std::cout << "time " << t.best() << "s " << 1e-9*2.*N*K*K/t.best()
<< "GFlops\n";
}
On Thu, Oct 4, 2012 at 9:58 AM, Hugh Perkins <hughperkins2@xxxxxxxxx> wrote:
> 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.
>
>
>