Registered Member
|
Hello everyone,
I am trying to use Eigen for a professional project. I need to provide an interface, because my employer wants to be able to switch between numerical library for testing purposes. I have created my own Matrix template class:
Following the Eigen documentation, I implemented:
to be able to assign Eigen objects to my new class. I also need to blend specific element-wise operations with matrix-wide operation. So I added this method to my Matrix class:
My problem is that I can not assign the object returned by this function to my Matrix class. Since Eigen::Matrix can by assigned this kind of object, I thought that adding:
would do, but the following code:
while compiling, gets me the following error at runtime: "terminate called after throwing an instance of 'std::bad_alloc'" Could you help implementing this operation into my Matrix class ? |
Registered Member
|
I guess I should use something similar to the example provided at http://eigen.tuxfamily.org/dox/TopicCustomizingEigen.html:
Maybe I should re post after more tinkering ... |
Moderator
|
yes, adding the extended API to MatrixBase/ArrayBase/DenseBase/etc through Eigen's plugin mechanism is the way to go.
|
Registered Member
|
I implemented it using:
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]