eigen

Eigen::aligned_allocator fails with std::unordered_multimap

烂漫一生 提交于 2021-02-19 00:37:55
问题 I am trying to compile this code in XCode 6: std::unordered_multimap< Frame*, Sim3, std::hash<Frame*>, std::equal_to<Frame*>, Eigen::aligned_allocator< std::pair<const Frame*,Sim3> > > trackingFailed; It fails with: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:1461:5: Static_assert failed "Invalid allocator::value_type" Is it still necessary to use aligned_allocator in Eigen 3.2.2? Why is it failing with C++11/C++14 and libc++

Eigen linear algebra solvers seem slow

血红的双手。 提交于 2021-02-18 12:17:26
问题 I want to solve a linear algebraic equation Ax = b using Eigen solvers. In my case, A is a complex sparse matrix(26410*26410), b is a real vector (26410*1). I use mex file in MATLAB to map the sparse matrix A and vector b to Eigen accepted format. The reason why I use Eigen solver is to hope it would be faster than solving directly in MATLAB using x = A\b . However, after tried LDLT, SparseLU, CG and BiCGSTAB, I found the results are not very satisfying: LDLT takes 1.462s with norm(A*x - b)

C++ use of Eigen in tensorflow

試著忘記壹切 提交于 2021-02-18 10:54:16
问题 What is the relation between tensorflow and Eigen, particularly regarding the tensor datastructures? There are some older quotations (e.g. here) which state that tensorflow is using Eigen extensively (afaik a tensorflow guy has extended the Eigen code). More recent tensorflow documentation, however, seems to not explicitly refer to Eigen. Are the two tensor structures identical? Are they being updated concurrently? Is there any (possibly future) disadvantage in using the Eigen::tensor over

Typedef in traits vs typedef in class

本小妞迷上赌 提交于 2021-02-15 11:45:39
问题 I'm looking through the Eigen source code for educational purposes. I've noticed that for each concrete class template X in the hierarchy, there is an internal::traits<X> defined. A typical example can be found in Matrix.h: namespace internal { template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > { typedef _Scalar Scalar; typedef Dense StorageKind; typedef DenseIndex Index;

Local install Eigen in CMAKE not finding target

梦想的初衷 提交于 2021-02-11 15:14:12
问题 I'm trying to build and use a local version of Eigen that I've downloaded directly from the CMake file of my project. I have those line to build it: include(FetchContent) FetchContent_Declare( eigen URL ${CMAKE_CURRENT_SOURCE_DIR}/external/eigen-3.3.8.tar.gz ) FetchContent_MakeAvailable(eigen) set(EIGEN3_INCLUDE_DIR ${eigen_SOURCE_DIR}) But then I got errors like Target "XXX_LIBRARIES" links to target "Eigen3::Eigen" but the target was not found. Perhaps a find_package() call is missing for

Popup on Eigen web page blocks content

徘徊边缘 提交于 2021-02-11 12:32:32
问题 For some reason the Eigen web page now has a popup blocking content. If you go to http://eigen.tuxfamily.org/dox/, the popup in the upper-left corner of the page doesn't want to go away. Help please! Seems to fail with both the latest Firefox and on Chrome. 回答1: Looks like the Eigen developers are aware of this (Issue 1918) and they just merged a fix about 5 minutes ago. I'm not sure how long it takes to update the website, but the documentation bug causing the issue should be fixed.

Eigen Vector3d as state vector with odeint's symplectic_rkn_sb3a_mclachlan

岁酱吖の 提交于 2021-02-11 08:42:44
问题 I'm implementing an n-body simulation by defining individual "particles" with variable (particle to particle, time independent) properties that affect the dynamics, and then defining a "System" of these particles as a vector which defines various operations on them including time evolution of the System by iterating over the vector: symplectic_rkn_sb3a_mclachlan <Vector3d> rkn; class Particle { public: // state.first - position, state.second - velocity std::pair <Vector3d, Vector3d> state; //

Eigen Vector3d as state vector with odeint's symplectic_rkn_sb3a_mclachlan

≡放荡痞女 提交于 2021-02-11 08:42:26
问题 I'm implementing an n-body simulation by defining individual "particles" with variable (particle to particle, time independent) properties that affect the dynamics, and then defining a "System" of these particles as a vector which defines various operations on them including time evolution of the System by iterating over the vector: symplectic_rkn_sb3a_mclachlan <Vector3d> rkn; class Particle { public: // state.first - position, state.second - velocity std::pair <Vector3d, Vector3d> state; //

Storing 3D data with Eigen library

早过忘川 提交于 2021-02-10 18:01:42
问题 How can I store a 3D data using Eigen C++ library? Vector is for 1D data, Matrix is for 2D data but what is for a 3D data? Or is it possible to create a vector of matrix? 回答1: You could use the Tensor module. It is not yet stable though. Eigen::Tensor<double, 3> epsilon(4,5,6); // 3 dimensions (4x5x6) epsilon.setZero(); epsilon(0,1,2) = 1; epsilon(0,2,1) = -1; http://eigen.tuxfamily.org/index.php?title=Tensor_support 来源: https://stackoverflow.com/questions/47704691/storing-3d-data-with-eigen

Eigen indexing, update all column of a specific row

谁说我不能喝 提交于 2021-02-10 17:49:19
问题 Let say I have an ArrayXXf (or MatrixXf ) m . In each iteration of a for loop, I want to fill m row-wise with a VectorXf . Eigen::ArrayXXf m(5, 5); for (int i = 0; i < 5; i++) { Eigen::VectorXf vec(5); vec << i, i + 1, i + 2, i+3, i+4; //fill m row wise // in matlab I will do something like m(i,:) = vec; // in numpy this will looks like m[i:] = vec; // that means when i is 0 m looks like // [ 0 1 2 3 4 5 // - - - - - - // - - - - - - // - - - - - - // - - - - - -] } How can I achieve that in