trying to debug c++ generalised sparse grid