C++ implementation of DBPR