def test_compute_Mt_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.mt_rad(k, p, normal_p, a, b, pOnElement) zC = iops_cpp.mt_rad(k, p, normal_p, a, b, pOnElement) self.assertAlmostEqual(zP, zC)
def test_compute_Mt_02(self): k = 10.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.mt_rad(k, self.p_off, self.n_p_off, self.a, self.b, pOnElement) zC = iops_cpp.mt_rad(k, self.p_off, self.n_p_off, self.a, self.b, pOnElement) self.assertAlmostEqual(zP, zC, 6)