Registered Member
|
Hi all,
I'd like to create a dynamic matrix storage class that stores a matrix either in full or in compressed form. It will mostly be used for products of the forms newMatrix = leftMatrix * compressedMatrix * rightMatrix newMatrix = leftMatrix * compressedMatrix newMatrix = compressedMatrix * rightMatrix Here's the constructor I have so far:
but I'm not sure which would be the best way to implement the matrix products, especially when I wish to keep using the * operator. Could you point me in the right direction? Best, MrMage |
Moderator
|
The simplest way is to forget about expression templates and simply add operator* members for products with a template MatrixBase<Derived> object that will return a MatrixXd object by value. The implementation of operator* will have to perform a "if" do decide between the two variants.
|
Registered Member
|
Thanks, that's the way I did it. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]