> > > Could you explain this more by adding some small examples? > > Since you are considering implementing all-at-once (four nested loops, right?) I'll give you my old code.
This code is hardwired for two AMG and for a geometric-AMG, where the blocks of the R (and hence P) matrices are scaled identities and I only store the scale. So you ignore those branches. This code also does equivalent real form complex, so more branches to ignore.
prom_mat_prod.C
Description: Binary data