How to define Matrix<mpreal, Dynamic, Dynamic> with typedef? We usually put the defined type in a header file, but it needs mpreal::set_default_prec(256); and that’s the problem. I am quite new to MPFR, so my apology if it seems easy. So what is your idea? #include <Eigen/LU> #include <iostream> #include <Eigen/Dense> #include "mylibrary.hpp" #include <unsupported/Eigen/MPRealSupport> using ..

#### Category : eigen

I’m using nlohmann/json to read a JSON file that has an array of 3-element arrays that looks like this. {"data":[[-36,-6,0],[-36,-3,0],[-36,0,0]]} I want to load this into an std::vector of Eigen::Vector3d. std::vector<Vector3d> data = j.at("data").get<std::vector<Vector3d>>(); But I get the following compiler error No member named ‘insert’ in ‘Eigen::Matrix<double, 3, 1, 0>’ Thanks for any help. Source: ..

I have some code that uses eigen to calculate geodesic lengths on a mesh. In optimization O0 it works, however things break when optimizations are enabled. I am debugging the behaviour and found something strange. There is a gradient calculation that is performed correctly: Eigen::Matrix<float, Eigen::Dynamic, 3> gradient = CalculateSimplifiedVertexGradient<float>(mesh, heat); Then a loop iterates ..

my cmake file cmake_minimum_required (VERSION 2.8.11) project (Transformation) find_package(Eigen3 REQUIRED) include_directories(EIGEN3_INCLUDE_DIR) add_executable (Transformation main.cpp) After I run make /Users/…/main.cpp:2:9: fatal error: ‘eigen3/Eigen/Core’ file not found #include<eigen3/Eigen/Core> ^~~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [CMakeFiles/Transformation.dir/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/Transformation.dir/all] Error 2 make: *** [all] Error 2 OS: MacOS 11.2 cmake version: 3.9.16 make version: 3.81 Source: ..

can anyone help me with eigen ? I have a quaternion values (w,x,y,z) to set a rotation matrix for an Isometry3D variable. To do so I tried using the methods matrix() and toRotationMatrix () but I have the error : error: no match for ‘operator=’ (operand types are ‘const LinearMatrixType {aka const Eigen::Matrix<double, 3, 3>}’ ..

I am currently filling a vector with random numbers using Eigen::VectorXd::Random(n). Is it possible to seed Eigen’s random number generator for deterministic results? Or alternatively, pass a random number generator to Eigen? I found no mention of either in the Eigen wiki, but it seems odd that such a feature would be missing. Source: Windows ..

I was experimenting with C++20 concepts and the Eigen library, and I incurred an unexpected behavior. Specifically, consider the following concept requiring a type to be callable with either an Eigen::Matrix<double, -1, 1>> object or an Eigen::Matrix<char, -1, 1>> one: template <class FOO_CONCEPT> concept FooConcept = std::invocable<FOO_CONCEPT, Eigen::Matrix<double, -1, 1>> && std::invocable<FOO_CONCEPT, Eigen::Matrix<char, -1, 1>>; ..

I implemented a CS paper to solve for geodesics on meshes. When I disable all optimizations I get exactly what I expect. If I enable optimizations however I get either NAN’s, infinity, or any number of weird results. I have checked all the stages of the algorithm and the error seems to happen on the ..

I have written the following piece in order to test a function, which implements a logarithmic hysteretic quantizer. #include <iostream> #include <Eigen/Dense> #include <math.h> double logarithmic_hysteretic_quantizer(double u, double u_prev, double delta, double u_min); int main(int argc, const char * argv[]) { Eigen::MatrixXd control_signal = Eigen::MatrixXd::Zero(7,1); double delta = 0.1765; double u_min = 0.01; double i ..

I had asked this question a while back where the following declaration results in a run time crash on W7 machine. std::vector<Eigen::MatrixXd> inv_K_mat2(42, Eigen::MatrixXd::Zero(4, 5)); However now I am seeing this on a Win10 machine also and wondering if I can get some help figuring this out. Since Win10 is a supported platform I need ..

## Recent Comments