I want to calculate the centralizer of a subgroup of $\mathrm{GL}(n, \mathbb{Z})$ when its generators $G_i$ (whose number is finite) are known.
For any matrix $S$ that commutes with the group: $G_iS$ = $SG_i$, and I get a system of linear equations. Any commuting element then can be written as $S = \sum_k x_k S_k, x_k \in \mathbb{Z} $, where $S_k$ are matrices with integer entries, and the commuting matrices form a ring with a finite basis.
But how do I calculate from these equations the group of invertible matrices? Particularly since the centralizer can have infinite elements.
Some special cases for $n=4$ are addressed here:
https://www.ams.org/mcom/1973-27-121/S0025-5718-1973-0333025-7/S0025-5718-1973-0333025-7.pdf
but is there a general method of solving the problem?