Registered Member
|
Hello,
What would be the fastest and most elegant way to implement the Rosenbrock function using Eigen in vectorized form ofc? The Rosenbrock function can be seen here (it is the third one): https://en.wikipedia.org/wiki/Test_func ... timization or here (second sum formula the one that has "A more involved variant is") https://en.wikipedia.org/wiki/Rosenbroc ... alisations My implementation is this but maybe there is a better gymnastic?
Many TIA, Best regards, Giovanni |
Moderator
|
Use head/tail for vectors, .square instead of calling pow2, and Ref<> to avoid copies, e.g.:
|
Registered Member
|
impressive! I get a 2x speed up with your version. Thank you so much! Best regards, Giovanni |
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar