當前位置: 首頁>>代碼示例>>Python>>正文


Python numpy.longcomplex方法代碼示例

本文整理匯總了Python中numpy.longcomplex方法的典型用法代碼示例。如果您正苦於以下問題:Python numpy.longcomplex方法的具體用法?Python numpy.longcomplex怎麽用?Python numpy.longcomplex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy的用法示例。


在下文中一共展示了numpy.longcomplex方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: is_longdouble_finfo_bogus

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:5,代碼來源:test_umath.py

示例2: test_loss_of_precision_longcomplex

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:4,代碼來源:test_umath.py

示例3: test_complex

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def test_complex(self):
        if np.dtype(np.longcomplex).itemsize == np.dtype(np.complex).itemsize:
            # longdouble == double; so fft is supported
            return

        x = np.random.randn(10).astype(np.longdouble) + \
                1j * np.random.randn(10).astype(np.longdouble)

        for f in [fft, ifft]:
            try:
                f(x)
                raise AssertionError("Type %r not supported but does not fail" %
                                     np.longcomplex)
            except ValueError:
                pass 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:17,代碼來源:test_basic.py

示例4: test_real

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def test_real(self):
        if np.dtype(np.longdouble).itemsize == np.dtype(np.double).itemsize:
            # longdouble == double; so fft is supported
            return

        x = np.random.randn(10).astype(np.longcomplex)

        for f in [fft, ifft]:
            try:
                f(x)
                raise AssertionError("Type %r not supported but does not fail" %
                                     np.longcomplex)
            except ValueError:
                pass 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:16,代碼來源:test_basic.py

示例5: test_get_blas_funcs

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def test_get_blas_funcs():
    # check that it returns Fortran code for arrays that are
    # fortran-ordered
    f1, f2, f3 = get_blas_funcs(
        ('axpy', 'axpy', 'axpy'),
        (np.empty((2,2), dtype=np.complex64, order='F'),
         np.empty((2,2), dtype=np.complex128, order='C'))
        )

    # get_blas_funcs will choose libraries depending on most generic
    # array
    assert_equal(f1.typecode, 'z')
    assert_equal(f2.typecode, 'z')
    if cblas is not None:
        assert_equal(f1.module_name, 'cblas')
        assert_equal(f2.module_name, 'cblas')

    # check defaults.
    f1 = get_blas_funcs('rotg')
    assert_equal(f1.typecode, 'd')

    # check also dtype interface
    f1 = get_blas_funcs('gemm', dtype=np.complex64)
    assert_equal(f1.typecode, 'c')
    f1 = get_blas_funcs('gemm', dtype='F')
    assert_equal(f1.typecode, 'c')

    # extended precision complex
    f1 = get_blas_funcs('gemm', dtype=np.longcomplex)
    assert_equal(f1.typecode, 'z')

    # check safe complex upcasting
    f1 = get_blas_funcs('axpy',
                        (np.empty((2,2), dtype=np.float64),
                         np.empty((2,2), dtype=np.complex64))
                        )
    assert_equal(f1.typecode, 'z') 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:39,代碼來源:test_blas.py

示例6: test_complex

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def test_complex(self):
        if np.dtype(np.longcomplex).itemsize == np.dtype(complex).itemsize:
            # longdouble == double; so fft is supported
            return

        x = np.random.randn(10).astype(np.longdouble) + \
                1j * np.random.randn(10).astype(np.longdouble)

        for f in [fft, ifft]:
            try:
                f(x)
                raise AssertionError("Type %r not supported but does not fail" %
                                     np.longcomplex)
            except ValueError:
                pass 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:17,代碼來源:test_basic.py

示例7: test_get_blas_funcs

# 需要導入模塊: import numpy [as 別名]
# 或者: from numpy import longcomplex [as 別名]
def test_get_blas_funcs():
    # check that it returns Fortran code for arrays that are
    # fortran-ordered
    f1, f2, f3 = get_blas_funcs(
        ('axpy', 'axpy', 'axpy'),
        (np.empty((2, 2), dtype=np.complex64, order='F'),
         np.empty((2, 2), dtype=np.complex128, order='C'))
        )

    # get_blas_funcs will choose libraries depending on most generic
    # array
    assert_equal(f1.typecode, 'z')
    assert_equal(f2.typecode, 'z')
    if cblas is not None:
        assert_equal(f1.module_name, 'cblas')
        assert_equal(f2.module_name, 'cblas')

    # check defaults.
    f1 = get_blas_funcs('rotg')
    assert_equal(f1.typecode, 'd')

    # check also dtype interface
    f1 = get_blas_funcs('gemm', dtype=np.complex64)
    assert_equal(f1.typecode, 'c')
    f1 = get_blas_funcs('gemm', dtype='F')
    assert_equal(f1.typecode, 'c')

    # extended precision complex
    f1 = get_blas_funcs('gemm', dtype=np.longcomplex)
    assert_equal(f1.typecode, 'z')

    # check safe complex upcasting
    f1 = get_blas_funcs('axpy',
                        (np.empty((2, 2), dtype=np.float64),
                         np.empty((2, 2), dtype=np.complex64))
                        )
    assert_equal(f1.typecode, 'z') 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:39,代碼來源:test_blas.py


注:本文中的numpy.longcomplex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。