def test_compute_N_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.n_2d(k, p, normal_p, a, b, pOnElement) zC = iops_cpp.n_2d(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zC, 3) zS = iops_sci.n_2d(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zS, 6)
def test_compute_N_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.n_2d(k, p, normal_p, a, b, pOnElement) zC = iops_cpp.n_2d(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zC, 6) zS = iops_sci.n_2d(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zS)
def test_compute_N_04(self): gld = -.40622369223044E+00 + 0.85946767167784E+01j k = 16.0 p_on_element = True pyx = iops_pyx.n_2d(k, self.p_on, self.n_p_on, self.a, self.b, p_on_element) self.assertAlmostEqual(pyx, gld, 4) cpp = iops_cpp.n_2d(k, self.p_on, self.n_p_on, self.a, self.b, p_on_element) self.assertAlmostEqual(cpp, gld, 4) cpp = iops_cpp.n_2d_on(k, self.p_on, self.n_p_on, self.a, self.b) self.assertAlmostEqual(cpp, gld, 4) sci = iops_sci.n_2d(k, self.p_on, self.n_p_on, self.a, self.b, p_on_element) self.assertAlmostEqual(sci, gld, 4) sci = iops_sci.n_2d_on(k, self.p_on, self.n_p_on, self.a, self.b) self.assertAlmostEqual(sci, gld, 4)
def test_compute_N_03(self): gld = -.11388200377769E+01 + 0.00000000000000E+00j k = 0.0 p_on_element = True pyx = iops_pyx.n_2d(k, self.p_on, self.n_p_on, self.a, self.b, p_on_element) self.assertAlmostEqual(pyx, gld) cpp = iops_cpp.n_2d(k, self.p_on, self.n_p_on, self.a, self.b, p_on_element) self.assertAlmostEqual(cpp, gld) cpp = iops_cpp.n_2d_on_k0(self.a, self.b) self.assertAlmostEqual(cpp, gld) sci = iops_sci.n_2d(k, self.p_on, self.n_p_on, self.a, self.b, p_on_element) self.assertAlmostEqual(sci, gld) sci = iops_sci.n_2d_on_k0(self.a, self.b) self.assertAlmostEqual(sci, gld)
def test_compute_N_02(self): gld = -.99612499996911E+00 + 0.43379540259270E+01j k = 16.0 p_on_element = False pyx = iops_pyx.n_2d(k, self.p_off, self.n_p_off, self.a, self.b, p_on_element) self.assertAlmostEqual(pyx, gld, 5) cpp = iops_cpp.n_2d(k, self.p_off, self.n_p_off, self.a, self.b, p_on_element) self.assertAlmostEqual(cpp, gld, 5) cpp = iops_cpp.n_2d_off(k, self.p_off, self.n_p_off, self.a, self.b) self.assertAlmostEqual(cpp, gld, 5) sci = iops_sci.n_2d(k, self.p_off, self.n_p_off, self.a, self.b, p_on_element) self.assertAlmostEqual(sci, gld, 5) sci = iops_sci.n_2d_off(k, self.p_off, self.n_p_off, self.a, self.b) self.assertAlmostEqual(sci, gld, 5)
def test_compute_N_01(self): gld = -.18943306616838E-01 + 0.00000000000000E+00j k = 0.0 p_on_element = False pyx = iops_pyx.n_2d(k, self.p_off, self.n_p_off, self.a, self.b, p_on_element) self.assertAlmostEqual(pyx, gld) cpp = iops_cpp.n_2d(k, self.p_off, self.n_p_off, self.a, self.b, p_on_element) self.assertAlmostEqual(cpp, gld) cpp = iops_cpp.n_2d_off_k0(self.p_off, self.n_p_off, self.a, self.b) self.assertAlmostEqual(cpp, gld) sci = iops_sci.n_2d(k, self.p_off, self.n_p_off, self.a, self.b, p_on_element) self.assertAlmostEqual(sci, gld) sci = iops_sci.n_2d_off_k0(self.p_off, self.n_p_off, self.a, self.b) self.assertAlmostEqual(sci, gld)