eigen

strange behavior of eigen::select()

烈酒焚心 提交于 2019-12-12 01:12:14
问题 in eigen, the construct: (R.array() < s).select(P,Q); works when either one or both of P,Q are vectors (of the same length as R). But as soon as both of them are scalars, I get a compilation error. My question is; is the behavior of select in the presence of two scalars a way for eigen to warn me that there are more efficient constructs? If so, what are they? 回答1: You can workaround by using VectorXd::Constant(size,value) for one argument. 来源: https://stackoverflow.com/questions/21440511

C# - Emgu CV - Face Recognition code stops execution at EigenObjectRecognizer and exit without error

若如初见. 提交于 2019-12-12 01:10:09
问题 I was working on Face Recognition and when i run the code it stops execution at the point where EigenObjectRecognizer is initialized and exits the program with out any error.Have any one else faced the same problem ever before?If you need additional codes i can post more. I have seen my code working until the point where the recognizer trained with data in the training set EigenObjectRecognizer recognizer = new EigenObjectRecognizer( trainingImages.ToArray(), NameLabless.ToArray(), 3000, ref

C++ Eigen: How to concatenate matrices dynamically (pointer issue?)

喜你入骨 提交于 2019-12-11 22:33:24
问题 I have the following problem: I have several partial (eigen) MatrixXds I want to concatenate to another, larger, MatrixXd variable I only have as a pointer. However, both the size of the smaller matrices and their number are dynamic, so I cannot use the << operator easily. So I'm trying the following (the smaller matrices are stored in list_subdiagrams, obviously, and basis->cols() defines the number of matrices), using Eigen's MatrixXd block funtionality: // sd[] contains the smaller

how to invoke IMKL functions from Eigen

拜拜、爱过 提交于 2019-12-11 21:22:42
问题 #include<iostream> #define EIGEN_USE_MKL_ALL #include"mkl.h" #include<Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m1,m2,m3; m1<<1,2,3,4; m2<<5,6,7,8; m3=m1*m2.Transpose(); std::cout<<m3; } i used IMKL11.2 Eigen 3.2.0 ubuntu 14.04 LTS intel core duo processor 64bit os g++ compiler http://eigen.tuxfamily.org/dox/TopicUsingIntelMKL.html the link says that we can use IMKL from Eigen by defining the macro. But the following error pope up in file included from Eigen/Core from Eigen

cast from Eigen::CwiseBinaryOp to MatrixXd causes segfault

烂漫一生 提交于 2019-12-11 19:40:06
问题 I am writing a library that stores Eigen expression templates as member variables to do the complicated calculations it needs to do. However, it seems like I'm not able to store or return these expression templates unless they are directly converted in MatrixXd or alike. This forces every step to be saved to a temporary, and ruins the efficiency of the whole design. Here's a short example that causes the trouble. Holder just holds an Eigen matrix, and Summer takes two holders and outputs the

Extracting some rows and columns

ぐ巨炮叔叔 提交于 2019-12-11 19:38:56
问题 I was wondering if there is a way to subset a matrix in EIGEN into another Matrix based on some condition. For example in MATLAB, one can do this: Let A be a matrix of size 5 -by- 5 . B=A(1:3,2:3) This will create a new matrix B from A with dimensions 3 -by- 2 and with elements from A at the relevant indices. 来源: https://stackoverflow.com/questions/33652497/extracting-some-rows-and-columns

How to overload/specialize template class function to handle arithmetic types and a container-class

一笑奈何 提交于 2019-12-11 17:42:27
问题 I am trying to create a template class with a memberfunction which can handle arithmetic datatypes (int, char, float ...) and a container-class like Eigen::DenseBase<> or std::vector<> Code to demonstrate my idea: template <typename T>class myClass{ ... void foo(T); ... }; template <typename T> void myClass<T>::foo(T){ //Function for arithmetic Datatypes } //Specialization does not work - What is the correct (best?) approach? template <> void myClass<T>::foo(<Eigen::DenseBase<T>){ //Function

What do the initialized Array constructors do?

耗尽温柔 提交于 2019-12-11 17:40:04
问题 In the Eigen documentation I see a lot of these: Array (const Scalar &val0, const Scalar &val1) Array (const Scalar &val0, const Scalar &val1, const Scalar &val2) Array (const Scalar &val0, const Scalar &val1, const Scalar &val2, const Scalar &val3) According to the documentation (http://eigen.tuxfamily.org/dox/classEigen_1_1Array.html) these constructors "constructs an initialized N D vector with given coefficients". What does that mean? If I do Array(1,2,3), what is the result? Specifically

Eigen vectors not initialized when cross-compiled for ARM

这一生的挚爱 提交于 2019-12-11 12:17:21
问题 I'm using Eigen3 on a cross compiled program using the arm-linux-gnueabihf-g++ (gcc version 4.8 from Linaro). The target platform is a duovero from gumstix using the Poky distribution - ARMv7. When I run the program with the Eigen code I get really strange values on the Eigen objects (see the output example at the end of this post). I've tried to turn off vectorization, I've played with all these flags -marm -mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard but always get the same behavior. If I

Turn off Eigen Alignment in the PCL build

点点圈 提交于 2019-12-11 10:50:53
问题 So I have an issue where Eigen Alignment causes serious issues with the operating system I use, QNX. Basically the OS cannot deal with the memory that way and causes very interesting seg faults. See my other question here. Any way, for this reason I wish to disable the Eigen Alignment used in PCL before I build it. I have a couple of ideas about how i might do this. EIGEN INCLUDE FILES IN PCL So PCL has the structure for most of its modules like this (this is an example of the features module