A C++ Library for Discrete Graphical Models