C++ Implementation of DFG