Shorthand indexing for vectors
Submitted by Darcy
Assigned to Nobody
Suppose we have an array of indices which correspond to indices in a numerical array (gather type operation). It would be cool if I could write:
// Indices values_i_want (e.g. 0, 2, 3)
// Values of global vector (0.0, 1.1, 2.2, 3.3, 4.4, ...)
Eigen::VectorXd values_i_have = all_my_values(values_i_want);
// values_i_have (0.0, 2.2, 3.3)
I think Matlab does something similar.
Would this be possible? It could take advantage of some newer SIMD gather instructions on newer Intel CPUs if they are any good (I haven't tried them yet though).