Registered Member
|
Dear all,
I am trying to get my head around a result that I have seen in my code. In short, I have a snippet of code:
Which produces the following result:
Note the extremely large values I have highlighted. When using the same in MATLAB:
Which is about what I expect. Both are passed into the function as fixed-size matricies:
Where:
So I'm not sure why these values are produced. Is anyone able to shed light as to what may be going wrong? -- Damien |
Registered Member
|
I am convinced it is *not* the inverse itself. I have just added some instrumentation with the following result:
Which is "pretty close" to MATLAB's inv()
But nowhere near the actual result (note the factor of 10^240):
So, is there something wrong with the multiplcation and/or the assignment? -- Damien |
Moderator
|
I'm surprised this program even compile or run without assertions. The statement:
is invalid. A MatrixBase<> has no storage, you cannot create such an object. Use:
Moreover, you'll get faster and more accurate result without explicitly inverting the matrix, e.g.:
In the future, Eigen will do this rewriting for you. Currently avoid .inverse() unless you really want it! |
Registered Member
|
So was I
Agreed, but I was trying to find the problem that has now been tracked to the storage... thanks! |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]