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
3
votes
1 answer

How to change version of Eigen

In my ROS package I would like to use a last stable version of Eigen which is 3.3.4. However when I check my version into package by EIGEN_MAJOR_VERSION, EIGEN_WORLD_VERSION, EIGEN_MINOR_VERSION I have got a 3.3.90. In my…
MichalSzczep
  • 345
  • 1
  • 4
  • 15
3
votes
1 answer

Eigen: function signature which accepts general matrix expression of fixed size and type

The Eigen documentation is filled with examples illustrating how one should write a general function accepting a matrix: template void print_cond(const MatrixBase& a) The reason to use MatrixBase as opposed to Matrix is…
bremen_matt
  • 6,902
  • 7
  • 42
  • 90
3
votes
1 answer

How to efficiently assemble a FEM sparse matrix

Deal all, Thank you for your time to read my question. I'm using Eigen3.3.4(http://eigen.tuxfamily.org/index.php?title=Main_Page) to write some FEM code. I read the Eigen3.3.4 document, and in this…
3
votes
0 answers

Using Eigen::VectorXd (Eigen 3.3.4) as a state type in boost::numeric::odeint (Boost 1.65.1)

During my work, it would be a requirement for me to use Eigen::VectorXcd as state type, to solve a huge linear ODE system. In that project, the matrix in the ODE system is sparse. Multiplying a it with a dense vector can be computed in parallel in a…
3
votes
1 answer

Workaround for resizing Eigen::Ref

I want to use Eigen::Ref to have non-template functions using Eigen::Matrix arguments. My problem is that in these functions, I may have to resize the matrices referenced by the Eigen::Ref. I understand that for generality an Eigen::Ref should not…
janou195
  • 1,175
  • 2
  • 10
  • 25
3
votes
1 answer

Set sparsity pattern of Eigen::SparseMatrix without memory overhead

I need to set sparsity pattern of Eigen::SparseMatrix which I already know (I have unique sorted column indices and row offsets). Obviously it's possible via setFromTriplets but unfortunately setFromTriplets requires a lot of additional memory (at…
Daiver
  • 1,488
  • 3
  • 18
  • 47
3
votes
2 answers

Wrong results using Eigen 3 linear system solvers

I am porting a MATLAB code to C++ with Eigen 3 and I decided to construct my linear solver, rather then calling it from the matrix object, so I can reuse it. Unfortunately it is not producing the expected results. After several tests, I traced the…
Caian
  • 440
  • 4
  • 15
3
votes
2 answers

data types used in C++ shared library API

I am writing a C++ shared library (.so) whose main function will be to process features from images processed by OpenCV. However, the algorithm in this shared library is not specifically for vision -- it could receive measurements from RADAR, LiDAR,…
Parker Lusk
  • 159
  • 1
  • 8
3
votes
1 answer

Vector of Eigen tensors with different ranks

My question: Is it possible to create a vector of Eigen tensors with different ranks? My goal is to be able to create a vector that contains objects whose types take values among Eigen::MatrixXd, Tensor3d, Tensor4d,..., Tensor10d (defined below).…
f10w
  • 1,524
  • 4
  • 24
  • 39
3
votes
1 answer

Re-use Eigen::SimplicialLLT's symbolic decomposition

I am struggling a bit with the API of the Eigen Library, namely the SimplicialLLT class for Cholesky factorization of sparse matrices. I have three matrices that I need to factor and later use to solve many equation systems (changing only the right…
tomj
  • 1,089
  • 7
  • 17
3
votes
1 answer

Eigen norm() with Boost.Units

I am trying to use Boost.Units with Eigen 3.3.1, but after following the instructions here, and some pieces of informations found around, I still cannot figure out how to make norm() work. Here is what I have so far (sorry for the long code…
matpen
  • 281
  • 2
  • 15
3
votes
1 answer

Mixing Scalar Types in Eigen

#include #include namespace Eigen { // float op double -> double template struct ScalarBinaryOpTraits { enum { Defined = 1 }; typedef double ReturnType; }; // double op…
Soonho Kong
  • 365
  • 1
  • 9
3
votes
3 answers

Increase precision in SelfAdjointEigenSolver in Eigen

I am trying to determine the eigenvalues and eigenvectors of a sparse array in Eigen. Since I need to compute all the eigenvectors and eigenvalues, and I could not get this done using the unsupported ArpackSupport module working, I chose to convert…
jcarvalho
  • 115
  • 2
  • 11
3
votes
1 answer

Translating Matlab's bsxfun to Eigen

Say we have a matrix A of dimension MxN and a vector a of dimension Mx1. In Matlab, to multiply 'a' with all columns of 'A', we can do bsxfun(@times, a, A) Is there an equivalent approach in Eigen, without having to loop over the columns of the…
bendervader
  • 2,619
  • 2
  • 19
  • 22
3
votes
0 answers

Arduino Matrix Multiplication with Eigen

I am using Eigen library with Arduino Mega 2560. I am creating dynamic matrices using Eigen library but it either returns nothing or the matrix itself. #include #include #include #include…