Registered Member
|
I was looking to get some feedback on this ~20 line MLE loop. Since moving to the new Eigen 3 trunk, I had to switch from cwise to array and I didn't know if there was a better way to do this.
I'm only running 20-50 iterations max, on 1-12GB "A" matricies Thanks for your time. JM |
Moderator
|
It is already pretty good. Here is a slightly optimized version:
for my curiosity could you tell us what does this solver solve? |
Registered Member
|
it solves for activity distributions
Thanks a ton. I need to keep improving my linear algebra skills. I feel like with a good mastery of linear algebra you can solve anything. EDIT: My compiler is telling me that noalias() is valid on Eigen::VectorXf's but not on Eigen::ArrayXf's 2> error C2039: 'noalias' : is not a member of 'Eigen::Array<_Scalar,_Rows,_Cols>' 2> with 2> [ 2> _Scalar=float, 2> _Rows=-1, 2> _Cols=1 2> ] Namely, this line temp.noalias() = A->transpose() * curr_estimate; // ^^ the temporary object needed for the product will be allocated only once Should temp be a VectorXf and not an ArrayXf? I'm using Eigen trunk latest, I just pull'd 5 minutes ago. I think temp should be a vector and then it should be temp.noalias() = A->transpose() * curr_estimate; x.array() *= temp.array() / column_sums; Thoughts? |
Moderator
|
yes that's probably simpler. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient