Could someone please tell me how on earth I can iterate an Eigen::RowVectorXf?
I have looked for 3 hours through the web and documentation, and all I could find is from this link that I can access it by:
vector(i)
vector[i]
I have a:
auto vec = std::make_shared<Eigen::RowVectorXf>( rowIndex.size() );
Which I wanna populate with word frequencies.
Eigen::RowVectorXf::InnerIterator it(vec); it; ++it
Doesn't work, and
Eigen::RowVectorXf::Iterator it(vec); it; ++it
Doesn't exist.
The only thing that seems to work is:
for ( int i = 0; i < vec->row( 0 ).size(); i++ )
{
std::cout << vec->row( 0 )[i] << std::endl;
}
Which IMHO seems bizzare, as I shouldn't have to explicitly point to row( 0 ) since this is a RowVector.
Isn't there a cleaner, faster or more elegant way?