Beispiel #1
0
def test_set_randstate():
    from hmc2 import get_state, set_state
    import nose
    state = get_state()
    rand = np.random.rand()
    set_state(state)
    nose.tools.assert_equal(np.random.rand(),rand)
Beispiel #2
0
def test_set_momentum():
    import hmc2
    from hmc2 import get_state, set_state
    hmc2.HMC_MOM = np.ones(3)
    state = get_state()
    hmc2.HMC_MOM = np.zeros(3)
    set_state(state)
    np.testing.assert_array_equal(np.ones(3),hmc2.HMC_MOM)