Registered Member
|
Hi everybody,
I'm currently debugging my mex file and i'm still facing an issue which is related with the coefficient wise product. As I am not completely comfortable with Eigen, I cannot find the solution. Here is my simplified function (it's a part of a Runge-Kutta algorithm) :
Par_mat.Ouv is a structure variable of type MatrixXd (size (N x 1) ). Par_geo.heq is a structure variable of type double. Par_geo.Nutiles is a structure variable of type int. I believe that the problem is due to the coefficient wise product. I do not understand the reason because both left and right hands are matrix when is use
Moreover, the crash is not systematic. Sometimes the code works, and sometimes I have a popup window in Matlab ('Assertion failed ! Program: d:\...\eigen\CwiseBinaryOp.h Line:131 Expression : lhs.rows()==rhs.rows() && lhrs.cols()==rhs.cols()). I guess it is related to a problem of dimension but I checked all my variables and I still do not understand. Thank you for your help I hope i'm near the end... |
Moderator
|
yes this means that Ouv and Deplacement do not have the same size. Two suggestions though: (unrelated to your issue)
- Ouv should be a VectorXf - you can write your expression like this (simpler and better):
|
Registered Member
|
Yes it was a really sneaky problem of size....
It took two hours to find out the solution. Thank you! |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]