[eigen] create a class that use Eigen

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hallo,

i wont to create a class that take in input two matrix and a bool:

#ifndef FOO_H_
#define FOO_H_

#include "Eigen/Core"

template<class T>
class Foo{
private:
protected:
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>* p0;
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>* p1;
bool flag;

public:

Foo(Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>* 
p0,Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>* p1,bool flag){
this->p0=p0;
this->p1=p0;
this->flag=flag;
};


};

#endif



int main(){
Matrix<double,Eigen::Dynamic,Eigen::Dynamic> mat(3,5);

mat << -0.0646, 0.4789, 0.2792, -0.1968, 0.3125,
-0.1694, 0.2017, -0.0151, -0.2112, 0.1629,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000;

Foo<double> f(&mat,&mat,false);
return 0;
}

The error is:

src/main.cpp: In function ‘int main()’:
src/main.cpp:33: error: no matching function for call to 
‘Foo<double>::Foo(Eigen::Matrix<double, -0x00000000000000001, 
-0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>&, 
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0, 
-0x00000000000000001, -0x00000000000000001>&, bool)’
inc/arlab_math/geometry/foo.h:16: note: candidates are: 
Foo<T>::Foo(Eigen::Matrix<LhsScalar, -0x00000000000000001, 
-0x00000000000000001, 0, -0x00000000000000001, -0x00000000000000001>*, 
Eigen::Matrix<LhsScalar, -0x00000000000000001, -0x00000000000000001, 0, 
-0x00000000000000001, -0x00000000000000001>*, bool) [with T = double]
inc/arlab_math/geometry/foo.h:7: note: Foo<double>::Foo(const Foo<double>&)
make: *** [i686/debug/objs/main.o] Error 1

Thanks for the help Paolo


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/