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
7
votes
2 answers

C++ Eigen Matrix clarifications

I have only recently started exploring C++ Eigen library and a little puzzled with some of the documentation. It would be great if someone can clarify this. In the common pitfalls (https://eigen.tuxfamily.org/dox-devel/TopicPitfalls.html) Alignment…
cplusplusrat
  • 1,435
  • 12
  • 27
7
votes
2 answers

CMake find_package not working for Eigen?

I'm currently developing a Kalman Filtering library using Eigen and I've successfully gotten it working on my development Mac. Now I'm trying to set it up with Travis CI and CMake is having trouble with finding the package. First I sudo apt install…
A Tyshka
  • 3,830
  • 7
  • 24
  • 46
7
votes
1 answer

Exponential Averaging using Eigen

Consider the following code. const int N = 100; const float alpha = 0.9; Eigen::MatrixXf myVec = Eigen::MatrixXf::Random(N,1); Eigen::MatrixXf symmetricMatrix(N, N); for(int i=0; i
Soo
  • 885
  • 7
  • 26
7
votes
3 answers

Eigen and huge dense 2D arrays

I am using 2D Eigen::Arrays for a project, and I like to keep using them in the case of huge 2D arrays. For avoiding memory issues, I thought to use memory mapped files to manage (read/modify/write) these arrays, but I cannot find working examples.…
gmas80
  • 1,218
  • 1
  • 14
  • 44
7
votes
2 answers

Column wise initialization and calculation of standard deviation in eigen library

I did a MATLAB code and I am trying to do it in C++ using Eigen library.In my MATLAB code I had to do a particular function like this M=10; s1 = zeros(20,M); for i=1:M s1(:,i) = i*i;%some function s1(:,i) = s1(:,i)/std(s1(:,i)); end I am…
Ema
  • 79
  • 1
  • 6
7
votes
1 answer

Does there exist information relating to Eigen::Matrix<> constexpr constructor?

I would like to know if it is possible to automatically construct/initialize at compilation a static const Eigen::Matrix ? I guess this mandatorily requires a constexpr CTOR for all Eigen::Matrix types, among other things. However, I found in the…
picµ
  • 103
  • 5
7
votes
1 answer

Why does std::less fail to compile?

I implemented a comparison operator operator< for Eigen::VectorXd, and sometimes, I need to pass a compare function to another of my function, I am tired of wrapping the operator< into [](const VectorXd& v1, const VectorXd& v2)->bool{return v1 <…
Alaya
  • 3,287
  • 4
  • 27
  • 39
7
votes
3 answers

"unsupported/Eigen/CXX11/Tensor: No such file or directory" while working with TensorFlow

I'm trying to use tensorflow as a external library in my C++ application (mainly following this tutorial). What I done so far: I have cloned the tensorflow reporitory (let's say, that the repo root dir is $TENSORFLOW) Run /.configure (which all…
Szał Pał
  • 81
  • 2
  • 4
7
votes
0 answers

Eigen3 Sparse Solver noncopyable

iam working on a numerical code and want to evaluate how Sparse and Dense Matrix-LU decomposition (and later others as well) differ for the usecase of the code. Eigens Dense Decomposition Objects can be copyable, and that is used to cache these,…
jonas_toth
  • 872
  • 5
  • 8
7
votes
1 answer

how to change 2D Eigen::Tensor to Eigen::Matrix

Seems simple enough. I would have thought some kind of casting would be possible, but I can't seem to find any documentation for it. While I have found ways in my application to avoid using the Eigen::Matrix class, TensorFlow only works with…
7
votes
2 answers

Rotation and Transformation of a plane to XY plane and origin in PointCloud

I have a point cloud that is known to contain the floor. This is oriented in some unknown direction and is not at the origin (0,0,0). I have to move the floor_plane to XY plane, so that the floor_plane lies on XY plane move the centroid of…
pr4n
  • 2,918
  • 3
  • 30
  • 42
7
votes
1 answer

Issue casting C++ Eigen::Matrix types via templates

I'm writing a C++ function that is templated on type (either float or double), and uses Eigen::Matrix internally. The function will be using a combination of float, double, and templated type Eigen:Matrix objects. Eigen::Matrix<>::cast() works…
vpradeep
  • 746
  • 1
  • 6
  • 14
7
votes
1 answer

Why are "const Eigen::Matrix<>&" and "const Ref >" apparently incompatible?

Here is my example code: (Please note the section surrounded by #if ENABLE_MY_COMPILE_ERROR) #include #include #define ENABLE_MY_COMPILE_ERROR 1 void f1(const Eigen::Ref a, const…
arr_sea
  • 841
  • 10
  • 16
7
votes
2 answers

bool multiplication with exclusive-or, not or (with Eigen Matrix Library)

I'm trying to implement hamming error correcting codes, and to do this I need to take a bool Vector (the data) and multiply it with a bool Matrix(hamming generator matrix), performing XOR operations (instead of what looks like OR as Eigen's default…
keith gould
  • 403
  • 1
  • 4
  • 10
6
votes
1 answer

Unable to compile the example for Eigen SVD

I am trying to compile the example provided for Eigen::JacobiSVD and I am getting the following error, /usr/local/include/eigen3/Eigen/src/SVD/JacobiSVD.h: In instantiation of ‘Eigen::JacobiSVD&…
Some_Guy
  • 169
  • 11
1 2
3
67 68