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

How can you use googlemock on a method which takes Eigen::Tensor objects as input parameters?

I have a class as following: class MyClass{ public: void my_method(Eigen::Tensor ¶m); }; I would like to create a mock: class MockMyClass { public: MOCK_METHOD(void, my_method, (Eigen::Tensor), (override)); }; But…
Yes
  • 339
  • 3
  • 19
-1
votes
1 answer

How do I initialize a Eigen Sparse Matrix with a (values, innerIndices, outerStarts) triplet?

I'm new to working with Eigen/Sparse. I'm trying to initialize a Eigen Sparse matrix with a (values, innerIndices, outerStarts) triplet. I see that there is an option to do this through a COO style triplet but not the one I mentioned. I'm thinking…
-1
votes
2 answers

Eigen Matrix[value], what does it mean?

In C++ using Eigen library writing the following example: #include #include using namespace Eigen; using namespace std; int main() { Matrix3f mat; Matrix3f m[11]; cout << mat << endl; cout << "\n" <<…
-1
votes
1 answer

std::min_element with std::vector

I'm trying to find the min element as follows: #include #include #include #include using namespace std; template bool isLeftOf(const Eigen::Vector2& a, const…
Kerim
  • 171
  • 3
  • 10
-1
votes
1 answer

Write Eigen VectorXd in CSV format

I'm trying to write an Eigen::VectorXd to a CSV file. The vector is from a row of an Eigen::MatrixXd. My function is defined as follows: void writeMatrixToCSVwithID(fs::path path, VectorXd row, unsigned long int row_id){ const static IOFormat…
newkid
  • 1,368
  • 1
  • 11
  • 27
-1
votes
1 answer

Eigen MatrixXd pointer passed as argument to a function causes segmentation faults

The Eigen library has limitations with passing non-const Eigen variables as parameters to functions due so some issues with temporary object creation. However, they have provided several solutions and work arounds mentioned here suggesting usage of…
Akshay Kumar
  • 277
  • 2
  • 11
-1
votes
1 answer

SEG FAULT with boost::make_shared / eigen3 memory.h

I am getting a segmentation fault with the following code below. However, this only happens on my Mint 19 system running gcc 7.3 and boost 1.65, PCL 1.8.1, Eigen3.4.4 On my other system (running Ubuntu 16.04, gcc 5.4, boost 1.58, 1.8.0, Eigen3.3…
-1
votes
1 answer

Extending the functionality of Eigen::Vector2d

How would you build a Point class on top of an Eigen::Vector2f? I want to do something like... Point p0(1, 2); Point p1(3, 4); p0.x += p0.y; p1 += p0; cout << p1.transpose() << endl; I basically need to name the elements of the vector so I can…
J. Ford
  • 15
  • 3
-1
votes
1 answer

Compilation error C2664 and C2440 when constructing a template function in C++

I am using Spectra C++ library, which is built on top of the Eigen C++ library. I will need to construct a correct SymGEigsSolver object based on the given the SelectionRule and GeigsMode parameters in a method. The definition of SymGEigsSolver is…
Graviton
  • 81,782
  • 146
  • 424
  • 602
-1
votes
1 answer

Basic C++ - struct contaning object references and pass as method parameter

I'm used to C# and Matlab and I'm trying to do a simple C++ program using Eigen template library for linear algebra. Sorry but I'm struggling with the basics: Store Matrix3d Eigen in struct Pass as parameter to a method Return a struct containing…
Pedro77
  • 5,176
  • 7
  • 61
  • 91
-1
votes
1 answer

Eigen library compilation error with intel compiler on linux

I am successfully able to compile Eigen on cygwin with mingw compilers. When compiling on linux with intel C++ compiler, I get the following error. I am using the Eigen library to solve AX=B. I am using Eigen3.3-rc1. any idea how to fix…
Santosh Tiwari
  • 1,167
  • 2
  • 14
  • 26
-1
votes
1 answer

Eigen compilation procedure

I downloaded Eigen 3.2.8. (zip file) but I don't know how to compile it. I have read its documentation but they have not described it briefly. I am new into this field so I don not know where to extract files and how run it.
jahanzeb
  • 3
  • 2
-1
votes
1 answer

Project idea using Eigen

I have been reading the documentation and playing with Eigen recently: docs and would like to build something that uses it extensively to learn it well. I looked on their website and they mention various projects that use it - like Google Ceres.…
Palace Chan
  • 8,845
  • 11
  • 41
  • 93
-1
votes
1 answer

diagonal MatrixXd with concatenated repeats of a VectorXd

I need to create a diagonal MatrixXd in C++ using Eigen library in which the elements on the diagonal are N replication of a shorter VectorXd. VectorXd R; // a vector of size n VectorXd V; // a vector of size n*N corresponding to N concatenated…
user58058
  • 3
  • 3
-1
votes
1 answer

speed up performance of Eigen library in Visual studio 2010

what and where are the settings that I should change to enhance the performance of Eigen library in visual studio 2010? In other words, in gcc, there is an option to turn the optimization on -O3, how can I turn on the optimization in visual studio…
CroCo
  • 5,531
  • 9
  • 56
  • 88
1 2 3
67
68