Registered Member
|
Hi,
Eigen::Map<Eigen::MatrixXd> matA((double*)A.getDataPointer(), (Eigen::Index)A.getDimensions().getRows(), (Eigen::Index)A.getDimensions().getColumns()); Eigen::Map<Eigen::MatrixXd> matR((double*)R.getDataPointer(), (Eigen::Index)R.getDimensions().getRows(), (Eigen::Index)R.getDimensions().getColumns()); tic(); matR = matA.inverse(); toc(); On my pc (VS 2015 release) with a matrix 1000x1000 Elapsed time is 0.590442 seconds With a pure lapack code based on DLANGE, DGETRF, DGECON, DGETRI with same matrix 1000x1000 Elapsed time is 0.378 seconds. Maybe, inverse could use lapacke ? Thanks for your great work about eigen |
Moderator
|
The problem might come from your compiler or compiling options. Here, using either gcc or clang, it takes 0.1s on a 2.6GHz i7 (haswell) and Eigen 3.3. If I disable AVX/FMA, it takes, as expected, 0.25s. So unless your computer is 10 years old, 0.59s seems indeed too slow.
compiled with:
Moreover, do you really need to explicitly compute the inverse? It is usually much faster and more accurate to only factorize the matrix and call solve to apply the inverse:
|
Registered Member
|
Hi,
I tested this on Windows with a core i7 4 cores 8 threads @ 1.87Ghz Compiled with VS 2015 /GS /GL /W3 /Gy /Gd /Oi /MD /openmp I will try with intel compilers to see if there is a better bench. Thanks |
Moderator
|
|
Registered Member
|
Thanks I checked on dual boot linux and bench are really better It is a problem of flags on VS project Thanks |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]