Extracting submatrices in Eigen (C++), dynamic version.27 Feb 2022
In a previous post, I mentioned Eigen’s
block function, which allows you to extract submatrices. But, in that post I was only aware and only wrote about the fixed-size version,
which returns a block of size (p,q), starting at (i,j) Eigen docs, Block operations. Using the fixed-size version,
q cannot be variables, instead they have to be constants.
There is a dynamic version,
which allows for the case when the size(s) of the block are variables.