コード例 #1
0
ファイル: odefiltsmooth.py プロジェクト: ralfrost/probnum
def _string2ibm(ivp, which_prior, precond_step, **kwargs):

    if "diffconst" in kwargs.keys():
        diffconst = kwargs["diffconst"]
    else:
        diffconst = 1.0
    if which_prior == "ibm1":
        return prior.IBM(1, ivp.ndim, diffconst, precond_step)
    elif which_prior == "ibm2":
        return prior.IBM(2, ivp.ndim, diffconst, precond_step)
    elif which_prior == "ibm3":
        return prior.IBM(3, ivp.ndim, diffconst, precond_step)
    elif which_prior == "ibm4":
        return prior.IBM(4, ivp.ndim, diffconst, precond_step)
    else:
        raise RuntimeError(
            "It should have been impossible to reach this point.")
コード例 #2
0
ファイル: test_prior.py プロジェクト: ralfrost/probnum
 def test_asymptotically_ibm(self):
     """
     Checks that for driftspeed==0, it coincides with the IBM prior.
     """
     ioup_speed0 = prior.IOUP(2, 3, driftspeed=0, diffconst=1.2345)
     ibm = prior.IBM(2, 3, diffconst=1.2345)
     self.assertAllClose(ioup_speed0.driftmatrix, ibm.driftmatrix)
     self.assertAllClose(ioup_speed0.dispersionmatrix, ibm.dispersionmatrix)
     self.assertAllClose(ioup_speed0.diffusionmatrix, ibm.diffusionmatrix)
コード例 #3
0
ファイル: test_prior.py プロジェクト: ralfrost/probnum
 def setUp(self):
     self.prior = prior.IBM(ordint=2,
                            spatialdim=1,
                            diffconst=DIFFCONST,
                            precond_step=STEP)
コード例 #4
0
ファイル: test_prior.py プロジェクト: ralfrost/probnum
 def setUp(self):
     self.prior = prior.IBM(2, 2, DIFFCONST)