Python numpy.longcomplex() Examples

The following are 28 code examples for showing how to use numpy.longcomplex(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module numpy , or try the search function .

Example 1
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 2
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 3
Project: vnpy_crypto   Author: birforce   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 4
Project: vnpy_crypto   Author: birforce   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 5
Project: Computable   Author: ktraunmueller   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 6
Project: Computable   Author: ktraunmueller   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 7
Project: Computable   Author: ktraunmueller   File: test_basic.py    License: MIT License 5 votes vote down vote up
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 
Example 8
Project: Computable   Author: ktraunmueller   File: test_basic.py    License: MIT License 5 votes vote down vote up
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 
Example 9
Project: Computable   Author: ktraunmueller   File: test_blas.py    License: MIT License 5 votes vote down vote up
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') 
Example 10
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 11
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 12
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_basic.py    License: MIT License 5 votes vote down vote up
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 
Example 13
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_basic.py    License: MIT License 5 votes vote down vote up
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 
Example 14
Project: GraphicDesignPatternByPython   Author: Relph1119   File: test_blas.py    License: MIT License 5 votes vote down vote up
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') 
Example 15
Project: pySINDy   Author: luckystarufo   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 16
Project: pySINDy   Author: luckystarufo   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 17
Project: mxnet-lambda   Author: awslabs   File: test_umath.py    License: Apache License 2.0 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 18
Project: mxnet-lambda   Author: awslabs   File: test_umath.py    License: Apache License 2.0 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 19
Project: ImageFusion   Author: pfchai   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 20
Project: ImageFusion   Author: pfchai   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 21
Project: elasticintel   Author: securityclippy   File: test_umath.py    License: GNU General Public License v3.0 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 22
Project: elasticintel   Author: securityclippy   File: test_umath.py    License: GNU General Public License v3.0 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 23
Project: Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda   Author: PacktPublishing   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 24
Project: Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda   Author: PacktPublishing   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 25
Project: twitter-stock-recommendation   Author: alvarobartt   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 26
Project: twitter-stock-recommendation   Author: alvarobartt   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex) 
Example 27
Project: keras-lambda   Author: sunilmallya   File: test_umath.py    License: MIT License 5 votes vote down vote up
def is_longdouble_finfo_bogus():
    info = np.finfo(np.longcomplex)
    return not np.isfinite(np.log10(info.tiny/info.eps)) 
Example 28
Project: keras-lambda   Author: sunilmallya   File: test_umath.py    License: MIT License 5 votes vote down vote up
def test_loss_of_precision_longcomplex(self):
        self.check_loss_of_precision(np.longcomplex)