Registered Member
|
Hallo everybody!
I'm writing a little library using Eigen and most of my functions take Eigen matrices as input. As I discovered while programming, a method using Eigen::Matrix as input type, does not accept the results of general expression, e.g. matrix blocks, as arguments; you need to use MatrixBase<Derived>. However, I'm confused: some methods only make sense when the matrix has some specific dimensions, e.g. 3x3 or 3x1. If I just write MatrixBase<Derived>, I have no way of specifying that the argument must be 3x3 or 3x1 or whatever. Is there I way I can do it? Thanks! |
Moderator
|
Within Eigen, we use static assertion for that purpose. Other options include enable_if mechanism or using Eigen::Ref<Matrix<double,3,3> > (http://eigen.tuxfamily.org/dox-devel/cl ... _1Ref.html).
|
Registered Member
|
Great! Now I'll try, but apparently my problem is solved. Thanks!
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]