To keep track of it along iteration. This has been superseded by the probe system. 
BTW this function is never called in the current code, because the stopping criterion relies on something else now. 
However, before dropping this function altogether, it may be interesting to know if the duality gap computation can be useful to someone.