State estimation for hybrid dynamical systems Code accompanying the paper Offline state estimation for hybrid systems via nonsmooth variable projection