![]() Registered Member ![]()
|
Is there an example of using DynamicMatrix anywhere? I would like to get something equivalent to
DynamicMatrixXd mat(Nrows) but everything I have tried, e.g., DynamicMatrix<double, Dynamic> mat(Nrows) complains that there should only be one template argument. [in Xcode] Thanks. |
![]() Registered Member ![]()
|
I guess by DynamicMatrix you meant DiagonalMatrix?
I don't know if we have many examples, but basically this is mostly used as the return type of asDiagonal(). Vector3f v(1,2,3); cout << v.asDiagonal(); In Eigen2, that was about it. In Eigen3, DiagonalMatrix is fully usable as a special matrix class so you can do: DiagonalMatrix<float, Dynamic> d(100); // 100x100 float diagonal matrix d.diagonal() = some_vector; // initialize the diagonal coeffs; MatrixXf othermatrix(100,100); othermatrix = d * othermatrix; // diagonal products are well supported See: http://eigen.tuxfamily.org/dox-devel/cl ... atrix.html
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]