C++ library for constructing an algebraic multigrid hierarchy