Re: [eigen] Created Java wrapper for Eigen

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


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.
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/