Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
scipy
/
linalg
/
File Content:
_testutils.py
from __future__ import division, print_function, absolute_import import numpy as np class _FakeMatrix(object): def __init__(self, data): self._data = data self.__array_interface__ = data.__array_interface__ class _FakeMatrix2(object): def __init__(self, data): self._data = data def __array__(self): return self._data def _get_array(shape, dtype): """ Get a test array of given shape and data type. Returned NxN matrices are posdef, and 2xN are banded-posdef. """ if len(shape) == 2 and shape[0] == 2: # yield a banded positive definite one x = np.zeros(shape, dtype=dtype) x[0, 1:] = -1 x[1] = 2 return x elif len(shape) == 2 and shape[0] == shape[1]: # always yield a positive definite matrix x = np.zeros(shape, dtype=dtype) j = np.arange(shape[0]) x[j, j] = 2 x[j[:-1], j[:-1]+1] = -1 x[j[:-1]+1, j[:-1]] = -1 return x else: np.random.seed(1234) return np.random.randn(*shape).astype(dtype) def _id(x): return x def assert_no_overwrite(call, shapes, dtypes=None): """ Test that a call does not overwrite its input arguments """ if dtypes is None: dtypes = [np.float32, np.float64, np.complex64, np.complex128] for dtype in dtypes: for order in ["C", "F"]: for faker in [_id, _FakeMatrix, _FakeMatrix2]: orig_inputs = [_get_array(s, dtype) for s in shapes] inputs = [faker(x.copy(order)) for x in orig_inputs] call(*inputs) msg = "call modified inputs [%r, %r]" % (dtype, faker) for a, b in zip(inputs, orig_inputs): np.testing.assert_equal(a, b, err_msg=msg)
Submit
FILE
FOLDER
Name
Size
Permission
Action
__pycache__
---
0755
tests
---
0755
__init__.py
6351 bytes
0644
_calc_lwork.cpython-35m-x86_64-linux-gnu.so
56296 bytes
0755
_cblas.cpython-35m-x86_64-linux-gnu.so
41224 bytes
0755
_clapack.cpython-35m-x86_64-linux-gnu.so
68984 bytes
0755
_cython_signature_generator.py
8369 bytes
0644
_cython_wrapper_generators.py
23463 bytes
0644
_decomp_polar.py
3623 bytes
0644
_decomp_qz.py
12986 bytes
0644
_decomp_update.cpython-35m-x86_64-linux-gnu.so
307856 bytes
0755
_expm_frechet.py
12182 bytes
0644
_fblas.cpython-35m-x86_64-linux-gnu.so
388576 bytes
0755
_flapack.cpython-35m-x86_64-linux-gnu.so
934896 bytes
0755
_flinalg.cpython-35m-x86_64-linux-gnu.so
70744 bytes
0755
_interpolative.cpython-35m-x86_64-linux-gnu.so
584544 bytes
0755
_interpolative_backend.py
44935 bytes
0644
_matfuncs_inv_ssq.py
28050 bytes
0644
_matfuncs_sqrtm.py
5867 bytes
0644
_procrustes.py
2375 bytes
0644
_solve_toeplitz.cpython-35m-x86_64-linux-gnu.so
183728 bytes
0755
_solvers.py
10185 bytes
0644
_testutils.py
1814 bytes
0644
basic.py
39332 bytes
0644
blas.py
6855 bytes
0644
calc_lwork.py
666 bytes
0644
cython_blas.cpython-35m-x86_64-linux-gnu.so
204424 bytes
0755
cython_blas.pxd
14416 bytes
0644
cython_lapack.cpython-35m-x86_64-linux-gnu.so
574600 bytes
0755
cython_lapack.pxd
169411 bytes
0644
decomp.py
31223 bytes
0644
decomp_cholesky.py
9601 bytes
0644
decomp_lu.py
5796 bytes
0644
decomp_qr.py
12675 bytes
0644
decomp_schur.py
8375 bytes
0644
decomp_svd.py
7226 bytes
0644
flinalg.py
1727 bytes
0644
interpolative.py
31146 bytes
0644
lapack.py
8103 bytes
0644
linalg_version.py
159 bytes
0644
matfuncs.py
19939 bytes
0644
misc.py
5881 bytes
0644
setup.py
5888 bytes
0644
special_matrices.py
29225 bytes
0644
N4ST4R_ID | Naxtarrr