repeats the m x n matrix A p times along the diagonal of B
function repmatDiag input Real[:, :] A; input Integer m; input Integer n; input Integer p; output Real[p*m, p*n] B; end repmatDiag;