<div dir="ltr">Hello, <div><br></div><div>I have parallel matrix, let's say </div><div><br></div><div>a b</div><div>c d</div><div><br></div><div>I would like to extend it to block matrix with structure as (bs = 3):</div><div><br></div><div>a 0 0 b 0 0</div><div>0 a 0 0 b 0</div><div>0 0 a 0 0 b</div><div><div>c 0 0 d 0 0</div><div>0 c 0 0 d 0</div><div>0 0 c 0 0 d</div></div><div><br></div><div>Result is basically kron. product with ident. </div><div>At the moment, I am just creating new mat with size bs-times bigger than initial and MatSetValues to proper places. It seems, that this is very inefficient and time consuming. </div><div>I wonder, is there any trick, how to perform assembly efficiently? </div><div><br></div><div>thanks for suggestions. </div></div>