#### Category : eigen

I’ve been going through the Eigen documentation for using noalias to avoid unnecessary temporary allocations when doing Matrix-Matrix products, but I was wondering if it’s possible to use noalias in the following situation: Eigen::VectorXf x(3); x << 1, 2, 3; Eigen::MatrixXf A(3, 3); A << 1, 2, 3, 4, 5, 6, 7, 8, 9; // ..

In matlab, I can use A(1:5,2:4)to visit elements of 1-5 row &2-4 columns in a matrix. In c++ eigen library, how i can visit part of the elements like in matlab? Source: Windows Que..

I am trying to use the CppAD scalar type with Eigen. The following fails to compile: #include <Eigen/Dense> #include <cppad/cppad.hpp> #include <cppad/example/cppad_eigen.hpp> int main() { using Scalar = CppAD::AD<double>; //using Scalar = double; Eigen::Matrix<Scalar, 1,4> row; Eigen::Matrix<Scalar, 4,1> col; Scalar scalar = 5; Scalar res2 = row * col + scalar; //fails return 0; } .. I’m writing a toy code with eigen. But unfortunatly when I try to print the matrix I meet the segment fault when cout. int main(int argc, char const *argv[]) { Matrix3d m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9; cout << m << endl; m = m * m; cout << ..

I would like to ask a question about slicing in an efficient manner in eigen. I would like to slice the matrix in a way that permits me to take n rows then skipping m rows and repeating the procedure till the end index. For example if A is 1000 * 20 matrix, I would ..

I tried to write my own method to save a Eigen::MatrixXd object in a textfile. However, the file is empty after running this method. While debugging, I saw that the file does not open as I want. Can anyone tell me why? #include<EigenDense> #include<iostream> #include<fstream> #include<string> using namespace std; void savematrix(Eigen::MatrixXd matrix, string filename) { .. Let’s say I have three referencials (A,B and C) I know the following values: the position of B in A (as an Eigen::Vector3d) the orientation of B in A (as an Eigen::Quaterniond) the position of C in B (as an Eigen::Vector3d) the orientation of C in B (as an Eigen::Quaterniond) How can I find the .. Let’s say I have 5 Coordinate systems A,B,C,D and W, represented on the following image (this is a view from the top): We know the following values: p_B_in_A: the position (as an Eigen::Vector3d) of B in A q_B_in_A: the orientation (as an Eigen::Quaterniond) of B in the A frame p_C_in_B: the position of C in ..