I want to obtain the same result given by AffineTransform but use ArrayFlatten. I tried the following example, but it didn't produce the desired results:
In[81]:= aa = {IdentityMatrix[3], {2, 3, 4}};
AffineTransform[{aa[[1]], aa[[2]]}] // TransformationMatrix
ArrayFlatten[{{aa[[1]], {{0, 0, 0}}}, {{aa[[2]]} // Transpose, 1}}]
Out[82]= {{1, 0, 0, 2}, {0, 1, 0, 3}, {0, 0, 1, 4}, {0, 0, 0, 1}}
During evaluation of In[81]:= ArrayFlatten::match: ArrayFlatten[{{{{1,0,0},{0,1,0},{0,0,1}},{{0,0,0}}},{{{2},{3},{4}},1}}] fails the matching condition for ArrayFlatten[a,n]: if b = a[[i_1,i_2,...,i_n]], c = a[[j_1,j_2,...,j_n]], Head[a] == Head[b] == Head[c], Length[Dimensions[b]] >= n, Length[Dimensions[c]] >= n, and i_k = j_k, then Dimensions[b][[k]] must equal Dimensions[c][[k]]. Here the condition fails for k = 1 and i_k = j_k = 1.
Out[83]= ArrayFlatten[{{{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, {{0, 0,
0}}}, {{{2}, {3}, {4}}, 1}}]
Any hints for solving this problem?
Regards, Zhao