eigen Questions

0

I have the following issue when compiling in release mode using MSVC 19.31.31106.2 (and C++17, as far as I understand the eigen page, alignment should be not an issue anymore) that I get a segfault...
Buddhi asked 30/5, 2022 at 7:35

2

Solved

To inialize for example Eigen::Matrix3i we can use syntax: Eigen::Matrix3i T; T << 1, 0, 0, 0, 2, 0, 0, 0, 3; However, when using clang-format (3.6 in my case) with Google style this nic...
Arianna asked 13/4, 2016 at 10:24

4

Suppose you have a matrix A: 1 2 3 4 There are two flattenings: 1 2 3 4 and 1 3 2 4 If the default (ColMajor) storage type is used, we can get the latter as VectorXd v = Map<const Vect...
Gastight asked 10/10, 2016 at 5:3

1

Solved

I am rewriting some c++ code (originally written in Matlab as a MEX function) in codeblocks so that I can use debugging and profiling tools designed for c++. The code I am rewriting uses Eigen and ...
Inculpable asked 13/4, 2022 at 15:23

3

Solved

I'm implementing a spectral clustering algorithm and I have to ensure that a matrix (laplacian) is positive semi-definite. A check if the matrix is positive definite (PD) is enough, since the "se...
Argentinaargentine asked 5/2, 2016 at 14:58

4

Solved

I'm doing a good amount of scientific programming and made very good experiences with both Boost.Units, which provides compile-time dimensional analysis for quantities (i.e. tags quantities with un...
Cannery asked 14/11, 2011 at 10:21

2

Solved

I am trying to return a block of a matrix as an lvalue of a function. Let's say my function looks like this: Block<Derived> getBlock(MatrixXd & m, int i, int j, int row, int column) { r...
Entrenchment asked 25/11, 2012 at 4:23

2

Solved

Here it is written that std::ranges::size should return an unsigned integer. However, when I use it on an Eigen vector (with Eigen 3.4) the following compiles: Eigen::VectorXd x; static_assert(std:...
Nostalgia asked 22/12, 2021 at 18:26

8

Solved

My question is how to initialize an eigen Matrix, but NOT this way: matrix << 1,0,1,0, 1,0,1,0, 1,0,1,0, I have a Matrix that looks like the above one ( commas or no commas doesnt matter...
Underthrust asked 26/12, 2013 at 14:6

3

Solved

When trying to initialize a Vector using the result of some operation in Eigen, the result seems to be different depending on what syntax is used, i.e., on my machine, the assertion at the end of t...
Dish asked 5/10, 2021 at 12:5

1

I recently was trying to compare different python and C++ matrix libraries against each other for their linear algebra performance in order to see which one(s) to use in an upcoming project. While ...
Girandole asked 10/5, 2021 at 2:12

2

Solved

I have an array of doubles, and I want to create a 4-by-4 matrix using the Eigen library. I also want to specify that the data is stored in row-major order. How can I do this? I have tried the fol...
Welltimed asked 25/2, 2015 at 15:27

2

Solved

I have an Eigen::Matrix<double, Dynamic, Dynamic>, and I need to check if any of its elements is different from 0. I tried the following code: Matrix<double, Dynamic, Dynamic> m; bool...
Demonolater asked 2/12, 2015 at 15:28

2

Solved

Maybe someone knows, is it possible in the Eigen to forward declare types MatrixXd & VectorXd? While compiling, I get the following error: /usr/include/eigen3/Eigen/src/Core/Matrix.h:372:34: ...
Goatsucker asked 3/1, 2015 at 21:52

5

Solved

I have a question about Eigen library in C++. Actually, I want to calculate inverse matrix of sparse matrix. When I used Dense matrix in Eigen, I can use .inverse() operation to calculate inverse ...
Latterly asked 19/9, 2014 at 8:14

2

Solved

I decided to use Eigen library in my project. But it is not clear from documentation how the most efficiently one should specify an array of 3d vectors. As I suggest, the first way is Eigen::Mat...
Zampardi asked 21/10, 2012 at 13:51

2

Do the memory alignment issues with Eigen listed in the documentation still apply with C++11? It seems that C++11 can already take care of properly aligning objects on the stack and on the heap, wi...
Adeliaadelice asked 9/4, 2015 at 10:44

3

Suppose I have a double Eigen matrix and I want to write it to a csv file. I find the way of writing into a file in raw format but I need commas between entries. Here is the code I foudn for simple...
Underbrush asked 23/8, 2013 at 10:30

0

I'm trying to compile eigen 3.3.9 fron the github mirror with VS2019, /std:c++latest and /Zc:__cplusplus What i get is a eigen\Eigen\src\Core\util\Meta.h(320,25): error C2039: 'result_of': is not a...
Regiment asked 28/2, 2021 at 21:24

3

Solved

This question might be stupid, but I am am a beginner. When I create an Eigen::MatrixXd in a local scope like this: void foo(){ Eigen::MatrixXd m(rows,cols); // do stuff } Will the object b...
Pompous asked 3/5, 2019 at 8:31

2

Solved

I'm using Eigen::Map to get access to create an object from a C-array. I would like to save that object as a member variable of type MatrixXf. How do I do that? I couldn't find a way to convert th...
Corcyra asked 31/1, 2014 at 23:23

3

Solved

What I would like to do essentially is implement this function: template<typename T> Matrix<T, Dynamic, Dynamic, ColMajor>* dataToEigen(T* const data, const int rows, const int cols); ...
Mccalla asked 4/6, 2013 at 18:46

2

Solved

I just started using Eigen library and can't understand how to add a scalar value to all matrix's members? Let's suppose that I have a matrix: Eigen::Matrix3Xf mtx = Eigen::Matrix3Xf::Ones(3,4); mt...
Tokharian asked 26/12, 2020 at 10:47

4

Solved

I have some code that is heavily dependent on Eigen. I would like to optimize it with CUDA, but when I am compiling I get: [tcai4@golubh4 Try1]$ nvcc conv_parallel.cu -I /home/tcai4/project-cse/Tr...
Este asked 30/3, 2017 at 9:18

2

I would like to implement a C++ class that has a vector of tensors as member. The dimensions of the tensors are not predefined but will take values according to some input data. Moreover, the ranks...
Demean asked 26/2, 2017 at 22:50

© 2022 - 2024 — McMap. All rights reserved.