C++ library for field algebra