Maybe I made a mistake in my computations, anyway, your trasnformation migh be written
d'r,b = dr,b - Sr(dr,b)/Sr + Srb(dr,b)/Srb
where
- Sr is sum on index r
- Srb is sum on indices r,b.
The formula maybe re-written as
d'r,b = dr,b - F(b) + G
If you apply again the transformation, then you obtain (after some calculations)
d"r,b = dr,b - 2 F(b) + 2 G
and so on.
BTW there are some programming mistakes in the posted code (for instance, you forgot to free some allocated memory and you used
C++
's
delete
for memory allocated with
C
's
malloc
).