Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank your for your answer. If I understand correctly you rewrite the matrix in a permutation of the canonical basis for $\mathbb{R}^{rd+r}$ so as to make $B$ appear in the upper left corner of size $r\times r$. If that is the case your idea is very similar to the idea in the post indicated by Robert Israel where no recurrence is needed.
@Denis Serre thank you for your answer, I was not aware of the theorem you mentioned and I am happy to discover it. The post indicated by Robert Israel is also a solution for a more general problem.