示例#1
0
 def test_compute_Mt_04(self):
     k = 10.0
     p = np.array([0.0, 0.05], dtype=np.float32)
     normal_p = np.array([-1, 0], dtype=np.float32)
     a = np.array([0.0, 0.00], dtype=np.float32)
     b = np.array([0.0, 0.10], dtype=np.float32)
     pOnElement = True
     zP = iops_pyx.mt_2d(k, p, normal_p, a, b, pOnElement)
     zC = iops_cpp.mt_2d(k, p, normal_p, a, b, pOnElement)
     self.assertAlmostEqual(zP, zC)
     zS = iops_sci.mt_2d(k, p, normal_p, a, b, pOnElement)
     self.assertAlmostEqual(zP, zS, 5)
示例#2
0
 def test_compute_Mt_02(self):
     k = 10.0
     p = np.array([0.5, 0.75], dtype=np.float32)
     normal_p = np.array([-np.sqrt(0.5), -np.sqrt(0.5)], dtype=np.float32)
     a = np.array([0.0, 0.00], dtype=np.float32)
     b = np.array([0.0, 0.10], dtype=np.float32)
     pOnElement = False
     zP = iops_pyx.mt_2d(k, p, normal_p, a, b, pOnElement)
     zC = iops_cpp.mt_2d(k, p, normal_p, a, b, pOnElement)
     self.assertAlmostEqual(zP, zC)
     zS = iops_sci.mt_2d(k, p, normal_p, a, b, pOnElement)
     self.assertAlmostEqual(zP, zS)
示例#3
0
 def test_compute_Mt_04(self):
     gld = 0.00000000000000E+00 + 0.00000000000000E+00j
     k = 16.0
     p_on_element = True
     pyx = iops_pyx.mt_2d(k, self.p_on, self.n_p_on, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(pyx, gld)
     cpp = iops_cpp.mt_2d(k, self.p_on, self.n_p_on, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(cpp, gld)
     sci = iops_sci.mt_2d(k, self.p_on, self.n_p_on, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(sci, gld, 5)
示例#4
0
 def test_compute_Mt_02(self):
     gld = 0.27354006901263E+00 + 0.59196279619442E-01j
     k = 16.0
     p_on_element = False
     pyx = iops_pyx.mt_2d(k, self.p_off, self.n_p_off, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(pyx, gld, 6)
     cpp = iops_cpp.mt_2d(k, self.p_off, self.n_p_off, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(cpp, gld, 6)
     cpp = iops_cpp.mt_2d_off(k, self.p_off, self.n_p_off, self.a, self.b)
     self.assertAlmostEqual(cpp, gld, 6)
     sci = iops_sci.mt_2d(k, self.p_off, self.n_p_off, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(sci, gld, 6)
     sci = iops_sci.mt_2d_off(k, self.p_off, self.n_p_off, self.a, self.b)
     self.assertAlmostEqual(sci, gld, 6)
示例#5
0
 def test_compute_Mt_01(self):
     gld = 0.40260455651453E-01 + 0.00000000000000E+00j
     k = 0.0
     p_on_element = False
     pyx = iops_pyx.mt_2d(k, self.p_off, self.n_p_off, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(pyx, gld)
     cpp = iops_cpp.mt_2d(k, self.p_off, self.n_p_off, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(cpp, gld)
     cpp = iops_cpp.mt_2d_off_k0(self.p_off, self.n_p_off, self.a, self.b)
     self.assertAlmostEqual(cpp, gld)
     sci = iops_sci.mt_2d(k, self.p_off, self.n_p_off, self.a, self.b,
                          p_on_element)
     self.assertAlmostEqual(sci, gld)
     sci = iops_sci.mt_2d_off_k0(self.p_off, self.n_p_off, self.a, self.b)
     self.assertAlmostEqual(sci, gld)