(self, outevent, inevent)
Propagate function time ratio allong the function calls.

        Must be called after finding the cycles.

        See also:
        - http://citeseer.ist.psu.edu/graham82gprof.html
Propagate function time ratio allong the function calls.
Propagate function time ratio allong the function calls .
def integrate(self, outevent, inevent):
        """Propagate function time ratio allong the function calls.

        Must be called after finding the cycles.

        See also:
        - http://citeseer.ist.psu.edu/graham82gprof.html
        """

        # Sanity checking
        assert outevent not in self
        for function in self.functions.itervalues():
            assert outevent not in function
            assert inevent in function
            for call in function.calls.itervalues():
                assert outevent not in call
                if call.callee_id != function.id:
                    assert call.ratio is not None

        # Aggregate the input for each cycle 
        for cycle in self.cycles:
            total = inevent.null()
            for function in self.functions.itervalues():
                total = inevent.aggregate(total, function[inevent])
            self[inevent] = total

        # Integrate along the edges
        total = inevent.null()
        for function in self.functions.itervalues():
            total = inevent.aggregate(total, function[inevent])
            self._integrate_function(function, outevent, inevent)
        self[outevent] = total
def integrate ( self , outevent , inevent ) : # Sanity checking assert outevent not in self for function in self . functions . itervalues ( ) : assert outevent not in function assert inevent in function for call in function . calls . itervalues ( ) : assert outevent not in call if call . callee_id != function . id : assert call . ratio is not None # Aggregate the input for each cycle  for cycle in self . cycles : total = inevent . null ( ) for function in self . functions . itervalues ( ) : total = inevent . aggregate ( total , function [ inevent ] ) self [ inevent ] = total # Integrate along the edges total = inevent . null ( ) for function in self . functions . itervalues ( ) : total = inevent . aggregate ( total , function [ inevent ] ) self . _integrate_function ( function , outevent , inevent ) self [ outevent ] = total