define temporary c++ Eigen variables for convenience

65 Views Asked by At

I have some Eigen vectors which are concatenated from parts which I want to access. For this I use the block method. However, I need to access the same part over and over in different parts of the function. Therefore, I defined a temporary Eigen vector but I am not sure if this adds too much overhead or is optimized out anyway?

auto vec_part = vec.block<NUM_ELEMS,1>(start,0);

Any suggestions for an efficient implementation?

Regards Max

0

There are 0 best solutions below