Registered Member
|
I'm working on a growing up algorithm where i have to generated vectors "theta" in a matrix "collection". "theta" is a vector of size 10, and i will update N (unknown) time the values of "theta" (optimization algorithm). I implemented this solution:
This algorithm is not working! Any solution with Eigen for that please? |
Moderator
|
For that precise purpose, better collect them in a std::vector<VectorXd>, and in case you need to need see them as a MatrixXd at the end:
typedef Matrix<double,10,1> Vec10; std::vector<Vec10> Theta_Collection; while(...) { Theta_Collection.push_back(theta); } auto view = MatrixXd::map(Theta_Collection[0].data(), 10, Theta_Collection.size()); Note that the last line won't work if you use a VectorXd instead of a fixed size object. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]