Questions tagged [eigen3]

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

Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. Homepage: http://eigen.tuxfamily.org

Please use eigen3 tag specifically for questions related to version 3 of the library.

1014 questions
5
votes
1 answer

Eigen Package Iterate over Row Major Sparse Matrix

I was trying to iterate over the non zero elements of a row major sparse matrix, such as shown below: Eigen::SparseMatrix Test(2, 3); Test.insert(0, 1) = 34; Test.insert(1, 2) = 56; for (int k = 0; k < Test.outerSize();…
akd
  • 53
  • 1
  • 4
5
votes
3 answers

cv::Mat conversion to Eigen-Matrix and back

I have several feature vectors stored in a cv::Mat where, each row is a feature vector (several rows like this one here: [ x1 y1 x2 y2 x3 y3.... ]). I have to apply SVD on each feature vector and for that I use Eigen library. But, before applying…
learner
  • 1,197
  • 6
  • 22
  • 34
4
votes
3 answers

Error: This compiler appears to be too old to be supported by Eigen

I am trying to compile a project that includes the eigen library and I get this error: In file included from /home/--/--/--/Eigen/Core:19, from /home/--/--/--/Eigen/Geometry:11, from…
ErnestPC98
  • 101
  • 1
  • 6
4
votes
1 answer

Return Eigen complex matrix to MATLAB in MEX function without extra copy

This question shows how to return a double matrix to MATLAB using a map object. The following works for non-complex data: double *outputPtr; plhs[0] = mxCreateDoubleMatrix((mwSize)n, (mwSize)m, mxREAL); outputPtr = mxGetPr(plhs[0]); Map
4
votes
0 answers

Check is eigen matrix is empty (Eigen library C++)

Usually vectors and matrix in many libraries have method like isEmpty() that returns true if matrix's size is zero and false if it has some elements (no matter zero or non-zero elements). But in Eigen library I cannot find such thing. Am I missing…
Kerim
  • 171
  • 3
  • 10
4
votes
2 answers

Eigen3 and Clion: How to display matrix contents in Clion ide?

I have followed the instructions for updating my GDB for use with Eigen3. However, the CLion IDE is unable to load the contents of eigen matrices in the debug panel. What should be a quick validation and debug process of results is turning into a…
Chris
  • 28,822
  • 27
  • 83
  • 158
4
votes
0 answers

Extracting elements from vector/matrix in Eigen

Is there an operator or function in Eigen to read the elements of a vector or matrix into separate variables? For example I imagine the converse of the comma-initializer: Eigen::Vector5d v; v << a, b, c, d, e; // ... do something with v ... v >> a,…
Museful
  • 6,711
  • 5
  • 42
  • 68
4
votes
1 answer

Why Eigen does not resolve built-in symbols? (all, last, seq, etc...)

I have this piece of code form the Eigen documentation site about slicing and inexing: #include #include #include using namespace std; using namespace Eigen; int main() { std::vector ind{4,2,5,5,3}; …
Maverick
  • 420
  • 5
  • 16
4
votes
2 answers

For Eigen SparseMatrix, what does innerIndexPtr() and outerIndexPtr() exactly represent?

I am working with Eigen::SparseMatrix and I am having trouble understanding the meaning of innerIndexPtr and outerIndexPtr. The explanation at the official page is very vague to me. Intuitively, I thought innerIndexPtr is the row indices for non…
user3667089
  • 2,996
  • 5
  • 30
  • 56
4
votes
1 answer

Confused about Eigen QR decomposition

I am confused about Eigen's QR decomposition. My understanding is that the matrix Q is stored implicitly as a sequence of Householder transformations, and that the matrix R is stored as an upper triangular matrix, and that the diagonal of R contains…
user14717
  • 4,757
  • 2
  • 44
  • 68
4
votes
1 answer

Function taking Eigen::Tensor - template argument deduction fails

I'm trying to write a templated function taking an Eigen::Tensor as an argument. The same approach that works for Eigen::Matrix etc. does not work here. Eigen recommends writing functions using a common base class.…
4
votes
1 answer

Eigen with -O3 warning: argument 1 value ‘X’ exceeds maximum object size Y

What happens When I try to add an Eigen::Vector3f into an std::vector following the tutorial on Eigen website like this: #include #include #include template using EigenStdVector =…
niosus
  • 738
  • 8
  • 22
4
votes
0 answers

How does Eigen work as a header-only library?

Recently I am using Eigen library for a project. I’m curious why there’s no binary file to link, but only a header. I don’t really understand how Eigen works behind the scene to make this possible.
jackxujh
  • 983
  • 10
  • 31
4
votes
1 answer

ORB SLAM2 build error with eigen3

I am trying to build ORBSLAM2 but i always get some errors. I don't know the reason. I am pasting command line output. How can I solve the errors? has someone done this before? orbslam@essafius-Latitude-E6430:~$ cd…
4
votes
1 answer

How to instantiate an InnerIterator over a Sparse Block in Eigen 3.3.4?

I have a piece of code that works fine in Eigen 3.2 but is not valid in Eigen 3.3.4 anymore. Here is the code: // Temporary Eigen blocks Eigen::Block > tmpAPotentialBlock(A.block(startPotential, startPotential,…
barry845
  • 43
  • 3