Registered Member
|
Dear all,
I have been reading the documentation at http://eigen.tuxfamily.org/dox-devel/To ... Types.html but there is a topic that is missing. I would like to create a temporay matrix inside a templated function of a size different to any of which that are passed in. For example:
Previously, I have been passing in matricies of specific sizes, but I would like to use the generic functionality. Thanks in advance, Damien. |
Registered Member
|
Every Eigen type has constants RowsAtCompileTime and ColsAtCompileTime, which are set to the number of rows and columns (or to Dynamic for types with a dynamic size). Similarly, there is a typedef Scalar which is the type of the entries that make up the matrix. Thus, if B should have the same entries as A, you can use you can use
|
Registered Member
|
This works, very nicely, but one comment: change
To:
Thanks! |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]