eigen3

Eigen compilation error with gcc 8.2.1 on MSYS2

梦想的初衷 提交于 2019-12-06 05:50:39
We are facing errors compiling against Eigen 3.3.7 (and probably older versions) against the latest versions of GCC 8.2.1 supplied by MSYS2. Strangely, this only happens with the latest builds of the same package ( mingw-w64-x86_64-gcc 8.2.1): 8.2.1+20181123-1 : fine 8.2.1+20181130-1 : error 8.2.1+20181207-1 : error The error is: In file included from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/SparseCore:50, from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Sparse:26, from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Eigen:2, from src/registration/transform/search.h:21,

How to wrap Eigen::SparseMatrix over preexistant 3-standard compress row/colum arrays

一世执手 提交于 2019-12-06 05:06:17
NOTE: I allready asked this question, but it was closed because of "too broad" without much explanation. I can't see how this question could be more specific (it deals with a specific class of a specific library for a specific usage...), so I assume that it was something like a "moderator's mistake" and ask it again... I would like to perfom sparse matrix/matrix multiplication using Eigen on sparse matrices. These matrices are already defined in the code I am working on in standard 3-arrays compressed row/column strorage. Then I would like to use the Eigen::SparseMatrix class as a wrapper on

Sparse eigenvalues using eigen3/sparse

女生的网名这么多〃 提交于 2019-12-05 08:45:34
Is there an distinct and effective way of finding eigenvalues and eigenvectors of a real, symmetrical, very large, let's say 10000x10000, sparse matrix in Eigen3 ? There is an eigenvalue solver for dense matrices but that doesn't make use of the property of the matrix e.g. it's symmetry. Furthermore I don't want to store the matrix in dense. Or (alternative) is there a better (+better documented) library to do that? Armadillo will do this using eigs_sym Note that computing all the eigenvalues is a very expensive operation whatever you do, usually what is done is to find only the k largest, or

Using Eigen 3.3 in a CUDA kernel

China☆狼群 提交于 2019-12-05 05:48:50
Since Nov. 2016 it's possible to compile CUDA code which references Eigen3.3 - see this answer This answer is not what I'm looking for and may now be "outdated" in the sense that there might now be an easier way, since the following is written in the docs Starting from Eigen 3.3, it is now possible to use Eigen's objects and algorithms within CUDA kernels. However, only a subset of features are supported to make sure that no dynamic allocation is triggered within a CUDA kernel. See also here . Unfortunately, I was not able to find any example of how this might look like. My Question Is it now

Why does std::less<Eigen::VectorXd> fail to compile?

这一生的挚爱 提交于 2019-12-05 04:15:19
I implemented a comparison operator operator< for Eigen::VectorXd , and sometimes, I need to pass a compare function to another of my function, I am tired of wrapping the operator< into [](const VectorXd& v1, const VectorXd& v2)->bool{return v1 < v2} , so I think the std::less class would be useful, as, to my understanding, it can generate the lambda function as long as operator< is defined. However, I found that std::less<VectorXd> didn't work for me, for example, the below code works fine: #include "Eigen/Dense" #include <iostream> #include <functional> using namespace std; using namespace

“unsupported/Eigen/CXX11/Tensor: No such file or directory” while working with TensorFlow

£可爱£侵袭症+ 提交于 2019-12-05 02:55:47
问题 I'm trying to use tensorflow as a external library in my C++ application (mainly following this tutorial). What I done so far: I have cloned the tensorflow reporitory (let's say, that the repo root dir is $TENSORFLOW ) Run /.configure (which all settings default, so no CUDA, no OpenCL etc.). Build shared library with bazel build -c /opt //tensorflow:libtensorflow_cc.so (build completed successfully) Now I'm trying to #include "tensorflow/core/public/session.h" . But after including it (and

How to extract a subvector (of an Eigen::Vector) from a vector of indices in Eigen?

℡╲_俬逩灬. 提交于 2019-12-05 02:07:33
Suppose I have Eigen::VectorXd x; //{1,2,3,4,5,6,7,8} and Eigen::VectorXd ind_vec; //{0,2,4,5} Is there a way an easy way to extract the ind_vec elements of x? Something like: x.extract(ind_vec) returning {1, 3, 5, 6} Since the current answer was not satisfactory for me, I googled a bit and I found this tutorial in the Eigen documentation. #include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::ArrayXf v(6); v << 1, 2, 3, 4, 5, 6; cout << "v.head(3) =" << endl << v.head(3) << endl << endl; cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl; v.segment(1

Eigen unsupported Tensor to Eigen matrix

本小妞迷上赌 提交于 2019-12-04 14:50:30
I get a Eigen::Tensor<std::complex, 2> after some operations on a Tensor with more dimensions. Is there an easy way to create a Eigen::MatrixXcf from this Tensor-object or do I have to copy the values manually? I am currently using Eigen version 3.3.4, and there is no easy built-in function to cast between Eigen::Tensor types and the more familiar Matrix or Array types. It would have been handy to have something like the .matrix() or .array() methods. There is also no easy way to add such methods via the plugin mechanism , because the Tensor module doesn't seem to support plugins. If anybody

Using Eigen::VectorXd (Eigen 3.3.4) as a state type in boost::numeric::odeint (Boost 1.65.1)

时光毁灭记忆、已成空白 提交于 2019-12-04 12:06:37
During my work, it would be a requirement for me to use Eigen::VectorXcd as state type, to solve a huge linear ODE system. In that project, the matrix in the ODE system is sparse. Multiplying a it with a dense vector can be computed in parallel in a simple way using Eigen. However, I have faced some problems in that situation that I will tell in details below. Currently I am applying a not-so efficient solution, namely, I use arma::cx_vec as state type, and declare the matrix corresponding the ode arma::cx_mat, which is a dense matrix type. Unfortunately, sparse-matrix-dense vector

“unsupported/Eigen/CXX11/Tensor: No such file or directory” while working with TensorFlow

烂漫一生 提交于 2019-12-03 18:56:50
I'm trying to use tensorflow as a external library in my C++ application (mainly following this tutorial ). What I done so far: I have cloned the tensorflow reporitory (let's say, that the repo root dir is $TENSORFLOW ) Run /.configure (which all settings default, so no CUDA, no OpenCL etc.). Build shared library with bazel build -c /opt //tensorflow:libtensorflow_cc.so (build completed successfully) Now I'm trying to #include "tensorflow/core/public/session.h" . But after including it (and adding $TENSORFLOW and $TENSORFLOW/bazel-genfiles to include path), I'm receiving error: $TENSORFLOW