Re: [eigen] How to return an Eigen matrix |

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

*To*: "eigen@xxxxxxxxxxxxxxxxxxx" <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] How to return an Eigen matrix*From*: Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx>*Date*: Sat, 1 Oct 2011 15:03:47 +0100 (BST)

On Sat, 1 Oct 2011, Hung Dang wrote:

I am new to Eigen so I am sorry for my naive question. I am trying to write a function which will return an Eigen template matrix (see code below). In my code func2 works fine, however, func1 does not. The g++ compiler complain that there is no matching function for call to func1. [...] template <class T> inline Matrix<T, Dynamic, Dynamic> & func1(){ // Do something then return a matrix Matrix<T, 3, 5> A; return A; } [...] Matrix<double, Dynamic, Dynamic> A = func1();

Matrix<double,Dynamic,Dynamic> A = func1<double>(); A book on C++ template should point you in the right direction. Jitse

**Follow-Ups**:**Re: [eigen] How to return an Eigen matrix***From:*Hung Dang

**References**:**[eigen] How to return an Eigen matrix***From:*Hung Dang

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] How to return an Eigen matrix** - Next by Date:
**RE: [eigen] New release?** - Previous by thread:
**Re: [eigen] How to return an Eigen matrix** - Next by thread:
**Re: [eigen] How to return an Eigen matrix**

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