本文整理汇总了Python中numpy.core.umath._arg方法的典型用法代码示例。如果您正苦于以下问题:Python umath._arg方法的具体用法?Python umath._arg怎么用?Python umath._arg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类numpy.core.umath
的用法示例。
在下文中一共展示了umath._arg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_simple
# 需要导入模块: from numpy.core import umath [as 别名]
# 或者: from numpy.core.umath import _arg [as 别名]
def test_simple(self):
check_real_value(ncu._arg, 1, 0, 0, False)
check_real_value(ncu._arg, 0, 1, 0.5*np.pi, False)
check_real_value(ncu._arg, 1, 1, 0.25*np.pi, False)
check_real_value(ncu._arg, np.PZERO, np.PZERO, np.PZERO)
# TODO This can be xfail when the generator functions are got rid of.
示例2: test_zero
# 需要导入模块: from numpy.core import umath [as 别名]
# 或者: from numpy.core.umath import _arg [as 别名]
def test_zero(self):
# carg(-0 +- 0i) returns +- pi
check_real_value(ncu._arg, np.NZERO, np.PZERO, np.pi, False)
check_real_value(ncu._arg, np.NZERO, np.NZERO, -np.pi, False)
# carg(+0 +- 0i) returns +- 0
check_real_value(ncu._arg, np.PZERO, np.PZERO, np.PZERO)
check_real_value(ncu._arg, np.PZERO, np.NZERO, np.NZERO)
# carg(x +- 0i) returns +- 0 for x > 0
check_real_value(ncu._arg, 1, np.PZERO, np.PZERO, False)
check_real_value(ncu._arg, 1, np.NZERO, np.NZERO, False)
# carg(x +- 0i) returns +- pi for x < 0
check_real_value(ncu._arg, -1, np.PZERO, np.pi, False)
check_real_value(ncu._arg, -1, np.NZERO, -np.pi, False)
# carg(+- 0 + yi) returns pi/2 for y > 0
check_real_value(ncu._arg, np.PZERO, 1, 0.5 * np.pi, False)
check_real_value(ncu._arg, np.NZERO, 1, 0.5 * np.pi, False)
# carg(+- 0 + yi) returns -pi/2 for y < 0
check_real_value(ncu._arg, np.PZERO, -1, 0.5 * np.pi, False)
check_real_value(ncu._arg, np.NZERO, -1, -0.5 * np.pi, False)
#def test_branch_cuts(self):
# _check_branch_cut(ncu._arg, -1, 1j, -1, 1)
示例3: test_special_values
# 需要导入模块: from numpy.core import umath [as 别名]
# 或者: from numpy.core.umath import _arg [as 别名]
def test_special_values(self):
# carg(-np.inf +- yi) returns +-pi for finite y > 0
check_real_value(ncu._arg, -np.inf, 1, np.pi, False)
check_real_value(ncu._arg, -np.inf, -1, -np.pi, False)
# carg(np.inf +- yi) returns +-0 for finite y > 0
check_real_value(ncu._arg, np.inf, 1, np.PZERO, False)
check_real_value(ncu._arg, np.inf, -1, np.NZERO, False)
# carg(x +- np.infi) returns +-pi/2 for finite x
check_real_value(ncu._arg, 1, np.inf, 0.5 * np.pi, False)
check_real_value(ncu._arg, 1, -np.inf, -0.5 * np.pi, False)
# carg(-np.inf +- np.infi) returns +-3pi/4
check_real_value(ncu._arg, -np.inf, np.inf, 0.75 * np.pi, False)
check_real_value(ncu._arg, -np.inf, -np.inf, -0.75 * np.pi, False)
# carg(np.inf +- np.infi) returns +-pi/4
check_real_value(ncu._arg, np.inf, np.inf, 0.25 * np.pi, False)
check_real_value(ncu._arg, np.inf, -np.inf, -0.25 * np.pi, False)
# carg(x + yi) returns np.nan if x or y is nan
check_real_value(ncu._arg, np.nan, 0, np.nan, False)
check_real_value(ncu._arg, 0, np.nan, np.nan, False)
check_real_value(ncu._arg, np.nan, np.inf, np.nan, False)
check_real_value(ncu._arg, np.inf, np.nan, np.nan, False)
示例4: test_simple
# 需要导入模块: from numpy.core import umath [as 别名]
# 或者: from numpy.core.umath import _arg [as 别名]
def test_simple(self):
check_real_value(ncu._arg, 1, 0, 0, False)
check_real_value(ncu._arg, 0, 1, 0.5*np.pi, False)
check_real_value(ncu._arg, 1, 1, 0.25*np.pi, False)
check_real_value(ncu._arg, np.PZERO, np.PZERO, np.PZERO)
示例5: test_zero
# 需要导入模块: from numpy.core import umath [as 别名]
# 或者: from numpy.core.umath import _arg [as 别名]
def test_zero(self):
# carg(-0 +- 0i) returns +- pi
yield check_real_value, ncu._arg, np.NZERO, np.PZERO, np.pi, False
yield check_real_value, ncu._arg, np.NZERO, np.NZERO, -np.pi, False
# carg(+0 +- 0i) returns +- 0
yield check_real_value, ncu._arg, np.PZERO, np.PZERO, np.PZERO
yield check_real_value, ncu._arg, np.PZERO, np.NZERO, np.NZERO
# carg(x +- 0i) returns +- 0 for x > 0
yield check_real_value, ncu._arg, 1, np.PZERO, np.PZERO, False
yield check_real_value, ncu._arg, 1, np.NZERO, np.NZERO, False
# carg(x +- 0i) returns +- pi for x < 0
yield check_real_value, ncu._arg, -1, np.PZERO, np.pi, False
yield check_real_value, ncu._arg, -1, np.NZERO, -np.pi, False
# carg(+- 0 + yi) returns pi/2 for y > 0
yield check_real_value, ncu._arg, np.PZERO, 1, 0.5 * np.pi, False
yield check_real_value, ncu._arg, np.NZERO, 1, 0.5 * np.pi, False
# carg(+- 0 + yi) returns -pi/2 for y < 0
yield check_real_value, ncu._arg, np.PZERO, -1, 0.5 * np.pi, False
yield check_real_value, ncu._arg, np.NZERO, -1, -0.5 * np.pi, False
#def test_branch_cuts(self):
# _check_branch_cut(ncu._arg, -1, 1j, -1, 1)
示例6: test_special_values
# 需要导入模块: from numpy.core import umath [as 别名]
# 或者: from numpy.core.umath import _arg [as 别名]
def test_special_values(self):
# carg(-np.inf +- yi) returns +-pi for finite y > 0
yield check_real_value, ncu._arg, -np.inf, 1, np.pi, False
yield check_real_value, ncu._arg, -np.inf, -1, -np.pi, False
# carg(np.inf +- yi) returns +-0 for finite y > 0
yield check_real_value, ncu._arg, np.inf, 1, np.PZERO, False
yield check_real_value, ncu._arg, np.inf, -1, np.NZERO, False
# carg(x +- np.infi) returns +-pi/2 for finite x
yield check_real_value, ncu._arg, 1, np.inf, 0.5 * np.pi, False
yield check_real_value, ncu._arg, 1, -np.inf, -0.5 * np.pi, False
# carg(-np.inf +- np.infi) returns +-3pi/4
yield check_real_value, ncu._arg, -np.inf, np.inf, 0.75 * np.pi, False
yield check_real_value, ncu._arg, -np.inf, -np.inf, -0.75 * np.pi, False
# carg(np.inf +- np.infi) returns +-pi/4
yield check_real_value, ncu._arg, np.inf, np.inf, 0.25 * np.pi, False
yield check_real_value, ncu._arg, np.inf, -np.inf, -0.25 * np.pi, False
# carg(x + yi) returns np.nan if x or y is nan
yield check_real_value, ncu._arg, np.nan, 0, np.nan, False
yield check_real_value, ncu._arg, 0, np.nan, np.nan, False
yield check_real_value, ncu._arg, np.nan, np.inf, np.nan, False
yield check_real_value, ncu._arg, np.inf, np.nan, np.nan, False