예제 #1
0
def test_llvm_diff_function_simple(ms1):
    m1 = Model(ms1, use_llvm=True)
    cm1 = m1.generate_compiled_model(0, 100)
    m2 = Model(ms1, use_llvm=False)
    cm2 = m2.generate_compiled_model(0, 100)

    assert approx(cm1.func(0, np.array([1.0, 1.0, 1.0, 1.0])), rel=0.01) == cm2.func(0, np.array([1.0, 1.0, 1.0, 1.0]))
예제 #2
0
def test_model_without_update(ms3):
    m1 = Model(ms3)
    n_m = m1.generate_compiled_model(0, 1)
    assert n_m.path_variables["S3_nm.1.t1.R"] == 10
    assert n_m.path_variables["S3_nm.2.t1.R"] == 5
    assert n_m.path_variables["S3_nm.3.t1.R"] == 3
    assert n_m.path_variables["S3_nm.4.t1.R"] == 2