eigen

Can eigen matrix solver use multi threads and how?

Deadly 提交于 2020-07-10 10:22:11
问题 When factorize a 34918 x 34918 sparse matrix, it takes about 1'20" to factorize it (only a few sec to build the sparse matrix). Can sparse matrix be factorized with multi threads? (visual studio) Here is the code: Eigen::SparseMatrix<double> laplacian(verticesNum, verticesNum); // reserve space for non-zero elements in sparse matrix laplacian.reserve(Eigen::VectorXi::Constant(verticesNum, 20)); // build matrix operator for (int i = 0; i < vertices->size(); i++) { // ... some algorithm } //

Eigen: convert Matrix3d rotation to Quaternion

本小妞迷上赌 提交于 2020-07-03 05:49:20
问题 I'm trying to convert a Matrix3d rotation to a Quaternion<double> , but I got only weird compiler errors so far. The code I'm using is: Quaternion<double> getQuaternionFromRotationMatrix(const Matrix3d& mat) { AngleAxisd aa; aa = mat; Quaternion<double> q = aa;// conversion error return q; } And the compiler errors: path/src/Utils.cpp: In function ‘Eigen::Quaternion<double> Utils::getQuaternionFromRotationMatrix(const Matrix3d&)’: path/src/Utils.cpp:55:26: error: conversion from ‘Eigen:

Eigen: convert Matrix3d rotation to Quaternion

混江龙づ霸主 提交于 2020-07-03 05:46:25
问题 I'm trying to convert a Matrix3d rotation to a Quaternion<double> , but I got only weird compiler errors so far. The code I'm using is: Quaternion<double> getQuaternionFromRotationMatrix(const Matrix3d& mat) { AngleAxisd aa; aa = mat; Quaternion<double> q = aa;// conversion error return q; } And the compiler errors: path/src/Utils.cpp: In function ‘Eigen::Quaternion<double> Utils::getQuaternionFromRotationMatrix(const Matrix3d&)’: path/src/Utils.cpp:55:26: error: conversion from ‘Eigen:

function pointer with Eigen

為{幸葍}努か 提交于 2020-06-29 03:38:17
问题 I am pretty competent with Python, but I'm pretty new to C++ and things like pointers. I try to write some codes for solving ODE with the Eigen package for linear algebra (I will need to deal with lots of matrices later, so I plan to start with it). I have the following code for RK4 and they work: #include "../eigen-eigen-b3f3d4950030/Eigen/Dense" using namespace Eigen; VectorXd Func(const VectorXd& a) { // equations for solving simple harmonic oscillator Vector2d ans; ans(0) = a(1); // dy/dt

function pointer with Eigen

大城市里の小女人 提交于 2020-06-29 03:37:49
问题 I am pretty competent with Python, but I'm pretty new to C++ and things like pointers. I try to write some codes for solving ODE with the Eigen package for linear algebra (I will need to deal with lots of matrices later, so I plan to start with it). I have the following code for RK4 and they work: #include "../eigen-eigen-b3f3d4950030/Eigen/Dense" using namespace Eigen; VectorXd Func(const VectorXd& a) { // equations for solving simple harmonic oscillator Vector2d ans; ans(0) = a(1); // dy/dt

Why was Eigen chosen for TensorFlow? [closed]

依然范特西╮ 提交于 2020-06-24 06:16:20
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Improve this question The TensorFlow white paper mentions that Eigen is used. Are there public explanations for how Eigen was chosen, and are they motivation for using Eigen in TensorFlow C++ op kernels? 回答1: I think that one of the key feature that drove the use of Eigen in the first

Benchmarking matrix multiplication performance: C++ (eigen) is much slower than Python

五迷三道 提交于 2020-06-24 05:25:18
问题 I am trying to estimate how good is Python performance comparing to C++. Here is my Python code: a=np.random.rand(1000,1000) #type is automaically float64 b=np.random.rand(1000,1000) c=np.empty((1000,1000),dtype='float64') %timeit a.dot(b,out=c) #15.5 ms ± 560 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) And here is my C++ code that I compile with Xcode in release regime: #include <iostream> #include <Dense> #include <time.h> using namespace Eigen; using namespace std; int main

Implementing the Bartels–Stewart algorithm in Eigen3 — real matrices only?

核能气质少年 提交于 2020-05-31 04:41:06
问题 The bounty expires in 5 days . Answers to this question are eligible for a +50 reputation bounty. Charlie wants to draw more attention to this question. Based off this question and solution -- Implementing the Bartels–Stewart algorithm in Eigen3? -- I am trying to solve Lyapunov equations (AX + XA^T = C) using the Eigen library, but am limited to real matrices. The R (with c++) code below works, but involves complex numbers. It can definitely be simplified (since in this framing, there is no

How does one install pygalmesh (which depends on Eigen) on a Windows PC?

一个人想着一个人 提交于 2020-05-17 06:05:39
问题 Edit: For those interested, the creator is currently working on this here. I am trying to install pygalmesh using pip install pygalmesh , which depends on Eigen. I have downloaded Eigen, but the pip installer does not "know" this. It returns the following error message: ERROR: Could not build wheels for pygalmesh which use PEP 517 and cannot be installed directly more specifically: fatal error C1083: Cannot open include file: 'Eigen/Dense': Pygalmesh's github has a file for setup.py which I

How does one install pygalmesh (which depends on Eigen) on a Windows PC?

做~自己de王妃 提交于 2020-05-17 06:05:32
问题 Edit: For those interested, the creator is currently working on this here. I am trying to install pygalmesh using pip install pygalmesh , which depends on Eigen. I have downloaded Eigen, but the pip installer does not "know" this. It returns the following error message: ERROR: Could not build wheels for pygalmesh which use PEP 517 and cannot be installed directly more specifically: fatal error C1083: Cannot open include file: 'Eigen/Dense': Pygalmesh's github has a file for setup.py which I