Questions tagged [eigen]

Eigen is a C++ template library for linear algebra: matrices, vectors, and related algorithms.

Eigen is a C++ template library for linear algebra: matrices, numerical solvers, and related algorithms.

Despite its name, this tag should not be mistaken with the and ones.

Eigen covers a large set of features through an easy to use unified API. Here is quick and incomplete overview:

  • Dense algebra:
    • array/matrix manipulation
    • linear solvers and factorizations (Cholesky, LU, QR, SVD, EVD)
  • Sparse algebra:
    • compressed sparse representation
    • direct solvers and factorizations (Cholesky, LU, QR)
    • Krylov subspace methods (CG, BiCGSTAB, GMRES) with preconditioners (Jacobi, ILLT, ILUT)
  • Geometry:
    • space transformation and subspace primitives

Find more on Eigen's home page and its online documentation.

3438 questions
8
votes
1 answer

Eigen sum(), colwise().sum().sum() and rowwise().sum().sum() all give different answers

I have this example code: #include #include int main() { Eigen::MatrixXf M = Eigen::MatrixXf::Random(1000, 1000); std::cout.precision(17); std::cout << M.colwise().sum().sum() << std::endl; std::cout <<…
Doktor Schrott
  • 616
  • 1
  • 7
  • 14
8
votes
1 answer

Conflict between Boost, OpenCV and Eigen libraries?

my question is somewhat related to Static linking of Boost and OpenCV libs with Eclipse CDR. errors, whereas I'm trying to do a bit more than described here: How to create a program that can read all the images in folder using Boost and OpenCV?,…
vkotor
  • 287
  • 1
  • 4
  • 8
8
votes
1 answer

Eigen + MKL slower than Matlab for matrix multiplication

I am doing a lot of matrix multiplications in a C++ program and I use Eigen (3.3.5) linked with Intel's MKL (2018.3.222). I use the sequential version of the MKL and OpenMP is disabled. The problem is that it is slower than Matlab. Some example…
8
votes
1 answer

Benchmarking matrix multiplication performance: C++ (eigen) is much slower than Python

I am trying to estimate how good is Python performance comparing to C++. Here is my Python code: a=np.random.rand(1000,1000) #type is automaically float64 b=np.random.rand(1000,1000) c=np.empty((1000,1000),dtype='float64') %timeit…
Mikhail Genkin
  • 3,247
  • 4
  • 27
  • 47
8
votes
1 answer

Eigen Linear Solver for very small square matrix

I am using Eigen on a C++ program for solving linear equation for very small square matrix(4X4). My test code is like template