add state updating functions to pdmat & mvgauss (tested)