def test_compute_N_04(self): k = 10.0 p = np.array([0.75, 0.75], dtype=np.float32) normal_p = np.array([-np.sqrt(0.5), -np.sqrt(0.5)], dtype=np.float32) a = np.array([0.5, 1.0], dtype=np.float32) b = np.array([1.0, 0.5], dtype=np.float32) pOnElement = True zP = iops_pyx.n_rad(k, p, normal_p, a, b, pOnElement) zC = iops_cpp.n_rad(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zC, 4)
def test_compute_N_01(self): k = 0.0 p = np.array([0.3, 0.3], dtype=np.float32) a = np.array([0.5, 1.0], dtype=np.float32) b = np.array([1.0, 0.3], dtype=np.float32) normal_p = np.array([np.sqrt(0.5), np.sqrt(0.5)], dtype=np.float32) pOnElement = False zP = iops_pyx.n_rad(k, p, normal_p, a, b, pOnElement) zC = iops_cpp.n_rad(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zC)