scipy 1.16.2__cp311-cp311-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scipy/__config__.py +161 -0
- scipy/__init__.py +150 -0
- scipy/_cyutility.cp311-win_arm64.lib +0 -0
- scipy/_cyutility.cp311-win_arm64.pyd +0 -0
- scipy/_distributor_init.py +18 -0
- scipy/_lib/__init__.py +14 -0
- scipy/_lib/_array_api.py +931 -0
- scipy/_lib/_array_api_compat_vendor.py +9 -0
- scipy/_lib/_array_api_no_0d.py +103 -0
- scipy/_lib/_bunch.py +229 -0
- scipy/_lib/_ccallback.py +251 -0
- scipy/_lib/_ccallback_c.cp311-win_arm64.lib +0 -0
- scipy/_lib/_ccallback_c.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_disjoint_set.py +254 -0
- scipy/_lib/_docscrape.py +761 -0
- scipy/_lib/_elementwise_iterative_method.py +346 -0
- scipy/_lib/_fpumode.cp311-win_arm64.lib +0 -0
- scipy/_lib/_fpumode.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_gcutils.py +105 -0
- scipy/_lib/_pep440.py +487 -0
- scipy/_lib/_sparse.py +41 -0
- scipy/_lib/_test_ccallback.cp311-win_arm64.lib +0 -0
- scipy/_lib/_test_ccallback.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_call.cp311-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_call.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_test_deprecation_def.cp311-win_arm64.lib +0 -0
- scipy/_lib/_test_deprecation_def.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_testutils.py +373 -0
- scipy/_lib/_threadsafety.py +58 -0
- scipy/_lib/_tmpdirs.py +86 -0
- scipy/_lib/_uarray/LICENSE +29 -0
- scipy/_lib/_uarray/__init__.py +116 -0
- scipy/_lib/_uarray/_backend.py +707 -0
- scipy/_lib/_uarray/_uarray.cp311-win_arm64.lib +0 -0
- scipy/_lib/_uarray/_uarray.cp311-win_arm64.pyd +0 -0
- scipy/_lib/_util.py +1283 -0
- scipy/_lib/array_api_compat/__init__.py +22 -0
- scipy/_lib/array_api_compat/_internal.py +59 -0
- scipy/_lib/array_api_compat/common/__init__.py +1 -0
- scipy/_lib/array_api_compat/common/_aliases.py +727 -0
- scipy/_lib/array_api_compat/common/_fft.py +213 -0
- scipy/_lib/array_api_compat/common/_helpers.py +1058 -0
- scipy/_lib/array_api_compat/common/_linalg.py +232 -0
- scipy/_lib/array_api_compat/common/_typing.py +192 -0
- scipy/_lib/array_api_compat/cupy/__init__.py +13 -0
- scipy/_lib/array_api_compat/cupy/_aliases.py +156 -0
- scipy/_lib/array_api_compat/cupy/_info.py +336 -0
- scipy/_lib/array_api_compat/cupy/_typing.py +31 -0
- scipy/_lib/array_api_compat/cupy/fft.py +36 -0
- scipy/_lib/array_api_compat/cupy/linalg.py +49 -0
- scipy/_lib/array_api_compat/dask/__init__.py +0 -0
- scipy/_lib/array_api_compat/dask/array/__init__.py +12 -0
- scipy/_lib/array_api_compat/dask/array/_aliases.py +376 -0
- scipy/_lib/array_api_compat/dask/array/_info.py +416 -0
- scipy/_lib/array_api_compat/dask/array/fft.py +21 -0
- scipy/_lib/array_api_compat/dask/array/linalg.py +72 -0
- scipy/_lib/array_api_compat/numpy/__init__.py +28 -0
- scipy/_lib/array_api_compat/numpy/_aliases.py +190 -0
- scipy/_lib/array_api_compat/numpy/_info.py +366 -0
- scipy/_lib/array_api_compat/numpy/_typing.py +30 -0
- scipy/_lib/array_api_compat/numpy/fft.py +35 -0
- scipy/_lib/array_api_compat/numpy/linalg.py +143 -0
- scipy/_lib/array_api_compat/torch/__init__.py +22 -0
- scipy/_lib/array_api_compat/torch/_aliases.py +855 -0
- scipy/_lib/array_api_compat/torch/_info.py +369 -0
- scipy/_lib/array_api_compat/torch/_typing.py +3 -0
- scipy/_lib/array_api_compat/torch/fft.py +85 -0
- scipy/_lib/array_api_compat/torch/linalg.py +121 -0
- scipy/_lib/array_api_extra/__init__.py +38 -0
- scipy/_lib/array_api_extra/_delegation.py +171 -0
- scipy/_lib/array_api_extra/_lib/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_at.py +463 -0
- scipy/_lib/array_api_extra/_lib/_backends.py +46 -0
- scipy/_lib/array_api_extra/_lib/_funcs.py +937 -0
- scipy/_lib/array_api_extra/_lib/_lazy.py +357 -0
- scipy/_lib/array_api_extra/_lib/_testing.py +278 -0
- scipy/_lib/array_api_extra/_lib/_utils/__init__.py +1 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.py +74 -0
- scipy/_lib/array_api_extra/_lib/_utils/_compat.pyi +45 -0
- scipy/_lib/array_api_extra/_lib/_utils/_helpers.py +559 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.py +10 -0
- scipy/_lib/array_api_extra/_lib/_utils/_typing.pyi +105 -0
- scipy/_lib/array_api_extra/testing.py +359 -0
- scipy/_lib/cobyqa/__init__.py +20 -0
- scipy/_lib/cobyqa/framework.py +1240 -0
- scipy/_lib/cobyqa/main.py +1506 -0
- scipy/_lib/cobyqa/models.py +1529 -0
- scipy/_lib/cobyqa/problem.py +1296 -0
- scipy/_lib/cobyqa/settings.py +132 -0
- scipy/_lib/cobyqa/subsolvers/__init__.py +14 -0
- scipy/_lib/cobyqa/subsolvers/geometry.py +387 -0
- scipy/_lib/cobyqa/subsolvers/optim.py +1203 -0
- scipy/_lib/cobyqa/utils/__init__.py +18 -0
- scipy/_lib/cobyqa/utils/exceptions.py +22 -0
- scipy/_lib/cobyqa/utils/math.py +77 -0
- scipy/_lib/cobyqa/utils/versions.py +67 -0
- scipy/_lib/decorator.py +399 -0
- scipy/_lib/deprecation.py +274 -0
- scipy/_lib/doccer.py +366 -0
- scipy/_lib/messagestream.cp311-win_arm64.lib +0 -0
- scipy/_lib/messagestream.cp311-win_arm64.pyd +0 -0
- scipy/_lib/pyprima/__init__.py +212 -0
- scipy/_lib/pyprima/cobyla/__init__.py +0 -0
- scipy/_lib/pyprima/cobyla/cobyla.py +559 -0
- scipy/_lib/pyprima/cobyla/cobylb.py +714 -0
- scipy/_lib/pyprima/cobyla/geometry.py +226 -0
- scipy/_lib/pyprima/cobyla/initialize.py +215 -0
- scipy/_lib/pyprima/cobyla/trustregion.py +492 -0
- scipy/_lib/pyprima/cobyla/update.py +289 -0
- scipy/_lib/pyprima/common/__init__.py +0 -0
- scipy/_lib/pyprima/common/_bounds.py +34 -0
- scipy/_lib/pyprima/common/_linear_constraints.py +46 -0
- scipy/_lib/pyprima/common/_nonlinear_constraints.py +54 -0
- scipy/_lib/pyprima/common/_project.py +173 -0
- scipy/_lib/pyprima/common/checkbreak.py +93 -0
- scipy/_lib/pyprima/common/consts.py +47 -0
- scipy/_lib/pyprima/common/evaluate.py +99 -0
- scipy/_lib/pyprima/common/history.py +38 -0
- scipy/_lib/pyprima/common/infos.py +30 -0
- scipy/_lib/pyprima/common/linalg.py +435 -0
- scipy/_lib/pyprima/common/message.py +290 -0
- scipy/_lib/pyprima/common/powalg.py +131 -0
- scipy/_lib/pyprima/common/preproc.py +277 -0
- scipy/_lib/pyprima/common/present.py +5 -0
- scipy/_lib/pyprima/common/ratio.py +54 -0
- scipy/_lib/pyprima/common/redrho.py +47 -0
- scipy/_lib/pyprima/common/selectx.py +296 -0
- scipy/_lib/tests/__init__.py +0 -0
- scipy/_lib/tests/test__gcutils.py +110 -0
- scipy/_lib/tests/test__pep440.py +67 -0
- scipy/_lib/tests/test__testutils.py +32 -0
- scipy/_lib/tests/test__threadsafety.py +51 -0
- scipy/_lib/tests/test__util.py +641 -0
- scipy/_lib/tests/test_array_api.py +322 -0
- scipy/_lib/tests/test_bunch.py +169 -0
- scipy/_lib/tests/test_ccallback.py +196 -0
- scipy/_lib/tests/test_config.py +45 -0
- scipy/_lib/tests/test_deprecation.py +10 -0
- scipy/_lib/tests/test_doccer.py +143 -0
- scipy/_lib/tests/test_import_cycles.py +18 -0
- scipy/_lib/tests/test_public_api.py +482 -0
- scipy/_lib/tests/test_scipy_version.py +28 -0
- scipy/_lib/tests/test_tmpdirs.py +48 -0
- scipy/_lib/tests/test_warnings.py +137 -0
- scipy/_lib/uarray.py +31 -0
- scipy/cluster/__init__.py +31 -0
- scipy/cluster/_hierarchy.cp311-win_arm64.lib +0 -0
- scipy/cluster/_hierarchy.cp311-win_arm64.pyd +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp311-win_arm64.lib +0 -0
- scipy/cluster/_optimal_leaf_ordering.cp311-win_arm64.pyd +0 -0
- scipy/cluster/_vq.cp311-win_arm64.lib +0 -0
- scipy/cluster/_vq.cp311-win_arm64.pyd +0 -0
- scipy/cluster/hierarchy.py +4348 -0
- scipy/cluster/tests/__init__.py +0 -0
- scipy/cluster/tests/hierarchy_test_data.py +145 -0
- scipy/cluster/tests/test_disjoint_set.py +202 -0
- scipy/cluster/tests/test_hierarchy.py +1238 -0
- scipy/cluster/tests/test_vq.py +434 -0
- scipy/cluster/vq.py +832 -0
- scipy/conftest.py +683 -0
- scipy/constants/__init__.py +358 -0
- scipy/constants/_codata.py +2266 -0
- scipy/constants/_constants.py +369 -0
- scipy/constants/codata.py +21 -0
- scipy/constants/constants.py +53 -0
- scipy/constants/tests/__init__.py +0 -0
- scipy/constants/tests/test_codata.py +78 -0
- scipy/constants/tests/test_constants.py +83 -0
- scipy/datasets/__init__.py +90 -0
- scipy/datasets/_download_all.py +71 -0
- scipy/datasets/_fetchers.py +225 -0
- scipy/datasets/_registry.py +26 -0
- scipy/datasets/_utils.py +81 -0
- scipy/datasets/tests/__init__.py +0 -0
- scipy/datasets/tests/test_data.py +128 -0
- scipy/differentiate/__init__.py +27 -0
- scipy/differentiate/_differentiate.py +1129 -0
- scipy/differentiate/tests/__init__.py +0 -0
- scipy/differentiate/tests/test_differentiate.py +694 -0
- scipy/fft/__init__.py +114 -0
- scipy/fft/_backend.py +196 -0
- scipy/fft/_basic.py +1650 -0
- scipy/fft/_basic_backend.py +197 -0
- scipy/fft/_debug_backends.py +22 -0
- scipy/fft/_fftlog.py +223 -0
- scipy/fft/_fftlog_backend.py +200 -0
- scipy/fft/_helper.py +348 -0
- scipy/fft/_pocketfft/LICENSE.md +25 -0
- scipy/fft/_pocketfft/__init__.py +9 -0
- scipy/fft/_pocketfft/basic.py +251 -0
- scipy/fft/_pocketfft/helper.py +249 -0
- scipy/fft/_pocketfft/pypocketfft.cp311-win_arm64.lib +0 -0
- scipy/fft/_pocketfft/pypocketfft.cp311-win_arm64.pyd +0 -0
- scipy/fft/_pocketfft/realtransforms.py +109 -0
- scipy/fft/_pocketfft/tests/__init__.py +0 -0
- scipy/fft/_pocketfft/tests/test_basic.py +1011 -0
- scipy/fft/_pocketfft/tests/test_real_transforms.py +505 -0
- scipy/fft/_realtransforms.py +706 -0
- scipy/fft/_realtransforms_backend.py +63 -0
- scipy/fft/tests/__init__.py +0 -0
- scipy/fft/tests/mock_backend.py +96 -0
- scipy/fft/tests/test_backend.py +98 -0
- scipy/fft/tests/test_basic.py +504 -0
- scipy/fft/tests/test_fftlog.py +215 -0
- scipy/fft/tests/test_helper.py +558 -0
- scipy/fft/tests/test_multithreading.py +84 -0
- scipy/fft/tests/test_real_transforms.py +247 -0
- scipy/fftpack/__init__.py +103 -0
- scipy/fftpack/_basic.py +428 -0
- scipy/fftpack/_helper.py +115 -0
- scipy/fftpack/_pseudo_diffs.py +554 -0
- scipy/fftpack/_realtransforms.py +598 -0
- scipy/fftpack/basic.py +20 -0
- scipy/fftpack/convolve.cp311-win_arm64.lib +0 -0
- scipy/fftpack/convolve.cp311-win_arm64.pyd +0 -0
- scipy/fftpack/helper.py +19 -0
- scipy/fftpack/pseudo_diffs.py +22 -0
- scipy/fftpack/realtransforms.py +19 -0
- scipy/fftpack/tests/__init__.py +0 -0
- scipy/fftpack/tests/fftw_double_ref.npz +0 -0
- scipy/fftpack/tests/fftw_longdouble_ref.npz +0 -0
- scipy/fftpack/tests/fftw_single_ref.npz +0 -0
- scipy/fftpack/tests/test.npz +0 -0
- scipy/fftpack/tests/test_basic.py +877 -0
- scipy/fftpack/tests/test_helper.py +54 -0
- scipy/fftpack/tests/test_import.py +33 -0
- scipy/fftpack/tests/test_pseudo_diffs.py +388 -0
- scipy/fftpack/tests/test_real_transforms.py +836 -0
- scipy/integrate/__init__.py +122 -0
- scipy/integrate/_bvp.py +1160 -0
- scipy/integrate/_cubature.py +729 -0
- scipy/integrate/_dop.cp311-win_arm64.lib +0 -0
- scipy/integrate/_dop.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_ivp/__init__.py +8 -0
- scipy/integrate/_ivp/base.py +290 -0
- scipy/integrate/_ivp/bdf.py +478 -0
- scipy/integrate/_ivp/common.py +451 -0
- scipy/integrate/_ivp/dop853_coefficients.py +193 -0
- scipy/integrate/_ivp/ivp.py +755 -0
- scipy/integrate/_ivp/lsoda.py +224 -0
- scipy/integrate/_ivp/radau.py +572 -0
- scipy/integrate/_ivp/rk.py +601 -0
- scipy/integrate/_ivp/tests/__init__.py +0 -0
- scipy/integrate/_ivp/tests/test_ivp.py +1287 -0
- scipy/integrate/_ivp/tests/test_rk.py +37 -0
- scipy/integrate/_lebedev.py +5450 -0
- scipy/integrate/_lsoda.cp311-win_arm64.lib +0 -0
- scipy/integrate/_lsoda.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_ode.py +1395 -0
- scipy/integrate/_odepack.cp311-win_arm64.lib +0 -0
- scipy/integrate/_odepack.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_odepack_py.py +273 -0
- scipy/integrate/_quad_vec.py +674 -0
- scipy/integrate/_quadpack.cp311-win_arm64.lib +0 -0
- scipy/integrate/_quadpack.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_quadpack_py.py +1283 -0
- scipy/integrate/_quadrature.py +1336 -0
- scipy/integrate/_rules/__init__.py +12 -0
- scipy/integrate/_rules/_base.py +518 -0
- scipy/integrate/_rules/_gauss_kronrod.py +202 -0
- scipy/integrate/_rules/_gauss_legendre.py +62 -0
- scipy/integrate/_rules/_genz_malik.py +210 -0
- scipy/integrate/_tanhsinh.py +1385 -0
- scipy/integrate/_test_multivariate.cp311-win_arm64.lib +0 -0
- scipy/integrate/_test_multivariate.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_test_odeint_banded.cp311-win_arm64.lib +0 -0
- scipy/integrate/_test_odeint_banded.cp311-win_arm64.pyd +0 -0
- scipy/integrate/_vode.cp311-win_arm64.lib +0 -0
- scipy/integrate/_vode.cp311-win_arm64.pyd +0 -0
- scipy/integrate/dop.py +15 -0
- scipy/integrate/lsoda.py +15 -0
- scipy/integrate/odepack.py +17 -0
- scipy/integrate/quadpack.py +23 -0
- scipy/integrate/tests/__init__.py +0 -0
- scipy/integrate/tests/test__quad_vec.py +211 -0
- scipy/integrate/tests/test_banded_ode_solvers.py +305 -0
- scipy/integrate/tests/test_bvp.py +714 -0
- scipy/integrate/tests/test_cubature.py +1375 -0
- scipy/integrate/tests/test_integrate.py +840 -0
- scipy/integrate/tests/test_odeint_jac.py +74 -0
- scipy/integrate/tests/test_quadpack.py +680 -0
- scipy/integrate/tests/test_quadrature.py +730 -0
- scipy/integrate/tests/test_tanhsinh.py +1171 -0
- scipy/integrate/vode.py +15 -0
- scipy/interpolate/__init__.py +228 -0
- scipy/interpolate/_bary_rational.py +715 -0
- scipy/interpolate/_bsplines.py +2469 -0
- scipy/interpolate/_cubic.py +973 -0
- scipy/interpolate/_dfitpack.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_dfitpack.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_dierckx.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_dierckx.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_fitpack.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_fitpack2.py +2397 -0
- scipy/interpolate/_fitpack_impl.py +811 -0
- scipy/interpolate/_fitpack_py.py +898 -0
- scipy/interpolate/_fitpack_repro.py +996 -0
- scipy/interpolate/_interpnd.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_interpnd.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_interpolate.py +2266 -0
- scipy/interpolate/_ndbspline.py +415 -0
- scipy/interpolate/_ndgriddata.py +329 -0
- scipy/interpolate/_pade.py +67 -0
- scipy/interpolate/_polyint.py +1025 -0
- scipy/interpolate/_ppoly.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_ppoly.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_rbf.py +290 -0
- scipy/interpolate/_rbfinterp.py +550 -0
- scipy/interpolate/_rbfinterp_pythran.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_rbfinterp_pythran.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/_rgi.py +764 -0
- scipy/interpolate/_rgi_cython.cp311-win_arm64.lib +0 -0
- scipy/interpolate/_rgi_cython.cp311-win_arm64.pyd +0 -0
- scipy/interpolate/dfitpack.py +24 -0
- scipy/interpolate/fitpack.py +31 -0
- scipy/interpolate/fitpack2.py +29 -0
- scipy/interpolate/interpnd.py +24 -0
- scipy/interpolate/interpolate.py +30 -0
- scipy/interpolate/ndgriddata.py +23 -0
- scipy/interpolate/polyint.py +24 -0
- scipy/interpolate/rbf.py +18 -0
- scipy/interpolate/tests/__init__.py +0 -0
- scipy/interpolate/tests/data/bug-1310.npz +0 -0
- scipy/interpolate/tests/data/estimate_gradients_hang.npy +0 -0
- scipy/interpolate/tests/data/gcvspl.npz +0 -0
- scipy/interpolate/tests/test_bary_rational.py +368 -0
- scipy/interpolate/tests/test_bsplines.py +3754 -0
- scipy/interpolate/tests/test_fitpack.py +519 -0
- scipy/interpolate/tests/test_fitpack2.py +1431 -0
- scipy/interpolate/tests/test_gil.py +64 -0
- scipy/interpolate/tests/test_interpnd.py +452 -0
- scipy/interpolate/tests/test_interpolate.py +2630 -0
- scipy/interpolate/tests/test_ndgriddata.py +308 -0
- scipy/interpolate/tests/test_pade.py +107 -0
- scipy/interpolate/tests/test_polyint.py +972 -0
- scipy/interpolate/tests/test_rbf.py +246 -0
- scipy/interpolate/tests/test_rbfinterp.py +534 -0
- scipy/interpolate/tests/test_rgi.py +1151 -0
- scipy/io/__init__.py +116 -0
- scipy/io/_fast_matrix_market/__init__.py +600 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp311-win_arm64.lib +0 -0
- scipy/io/_fast_matrix_market/_fmm_core.cp311-win_arm64.pyd +0 -0
- scipy/io/_fortran.py +354 -0
- scipy/io/_harwell_boeing/__init__.py +7 -0
- scipy/io/_harwell_boeing/_fortran_format_parser.py +316 -0
- scipy/io/_harwell_boeing/hb.py +571 -0
- scipy/io/_harwell_boeing/tests/__init__.py +0 -0
- scipy/io/_harwell_boeing/tests/test_fortran_format.py +74 -0
- scipy/io/_harwell_boeing/tests/test_hb.py +70 -0
- scipy/io/_idl.py +917 -0
- scipy/io/_mmio.py +968 -0
- scipy/io/_netcdf.py +1104 -0
- scipy/io/_test_fortran.cp311-win_arm64.lib +0 -0
- scipy/io/_test_fortran.cp311-win_arm64.pyd +0 -0
- scipy/io/arff/__init__.py +28 -0
- scipy/io/arff/_arffread.py +873 -0
- scipy/io/arff/arffread.py +19 -0
- scipy/io/arff/tests/__init__.py +0 -0
- scipy/io/arff/tests/data/iris.arff +225 -0
- scipy/io/arff/tests/data/missing.arff +8 -0
- scipy/io/arff/tests/data/nodata.arff +11 -0
- scipy/io/arff/tests/data/quoted_nominal.arff +13 -0
- scipy/io/arff/tests/data/quoted_nominal_spaces.arff +13 -0
- scipy/io/arff/tests/data/test1.arff +10 -0
- scipy/io/arff/tests/data/test10.arff +8 -0
- scipy/io/arff/tests/data/test11.arff +11 -0
- scipy/io/arff/tests/data/test2.arff +15 -0
- scipy/io/arff/tests/data/test3.arff +6 -0
- scipy/io/arff/tests/data/test4.arff +11 -0
- scipy/io/arff/tests/data/test5.arff +26 -0
- scipy/io/arff/tests/data/test6.arff +12 -0
- scipy/io/arff/tests/data/test7.arff +15 -0
- scipy/io/arff/tests/data/test8.arff +12 -0
- scipy/io/arff/tests/data/test9.arff +14 -0
- scipy/io/arff/tests/test_arffread.py +421 -0
- scipy/io/harwell_boeing.py +17 -0
- scipy/io/idl.py +17 -0
- scipy/io/matlab/__init__.py +66 -0
- scipy/io/matlab/_byteordercodes.py +75 -0
- scipy/io/matlab/_mio.py +375 -0
- scipy/io/matlab/_mio4.py +632 -0
- scipy/io/matlab/_mio5.py +901 -0
- scipy/io/matlab/_mio5_params.py +281 -0
- scipy/io/matlab/_mio5_utils.cp311-win_arm64.lib +0 -0
- scipy/io/matlab/_mio5_utils.cp311-win_arm64.pyd +0 -0
- scipy/io/matlab/_mio_utils.cp311-win_arm64.lib +0 -0
- scipy/io/matlab/_mio_utils.cp311-win_arm64.pyd +0 -0
- scipy/io/matlab/_miobase.py +435 -0
- scipy/io/matlab/_streams.cp311-win_arm64.lib +0 -0
- scipy/io/matlab/_streams.cp311-win_arm64.pyd +0 -0
- scipy/io/matlab/byteordercodes.py +17 -0
- scipy/io/matlab/mio.py +16 -0
- scipy/io/matlab/mio4.py +17 -0
- scipy/io/matlab/mio5.py +19 -0
- scipy/io/matlab/mio5_params.py +18 -0
- scipy/io/matlab/mio5_utils.py +17 -0
- scipy/io/matlab/mio_utils.py +17 -0
- scipy/io/matlab/miobase.py +16 -0
- scipy/io/matlab/streams.py +16 -0
- scipy/io/matlab/tests/__init__.py +0 -0
- scipy/io/matlab/tests/data/bad_miuint32.mat +0 -0
- scipy/io/matlab/tests/data/bad_miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/big_endian.mat +0 -0
- scipy/io/matlab/tests/data/broken_utf8.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_checksum.mat +0 -0
- scipy/io/matlab/tests/data/corrupted_zlib_data.mat +0 -0
- scipy/io/matlab/tests/data/debigged_m4.mat +0 -0
- scipy/io/matlab/tests/data/japanese_utf8.txt +5 -0
- scipy/io/matlab/tests/data/little_endian.mat +0 -0
- scipy/io/matlab/tests/data/logical_sparse.mat +0 -0
- scipy/io/matlab/tests/data/malformed1.mat +0 -0
- scipy/io/matlab/tests/data/miuint32_for_miint32.mat +0 -0
- scipy/io/matlab/tests/data/miutf8_array_name.mat +0 -0
- scipy/io/matlab/tests/data/nasty_duplicate_fieldnames.mat +0 -0
- scipy/io/matlab/tests/data/one_by_zero_char.mat +0 -0
- scipy/io/matlab/tests/data/parabola.mat +0 -0
- scipy/io/matlab/tests/data/single_empty_string.mat +0 -0
- scipy/io/matlab/tests/data/some_functions.mat +0 -0
- scipy/io/matlab/tests/data/sqr.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test3dmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/test_empty_struct.mat +0 -0
- scipy/io/matlab/tests/data/test_mat4_le_floats.mat +0 -0
- scipy/io/matlab/tests/data/test_skip_variable.mat +0 -0
- scipy/io/matlab/tests/data/testbool_8_WIN64.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcellnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testcomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testdouble_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_5.3_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testemptycell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testfunc_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testhdf5_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmatrix_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testminus_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testminus_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testmulti_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testobject_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testobject_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testonechar_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testscalarcell_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsimplecell.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparse_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsecomplex_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testsparsefloat_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststring_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststring_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_4.2c_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststringarray_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststruct_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructarr_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.1_SOL2.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_6.5.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/teststructnest_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.1_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testunicode_7.4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/data/testvec_4_GLNX86.mat +0 -0
- scipy/io/matlab/tests/test_byteordercodes.py +29 -0
- scipy/io/matlab/tests/test_mio.py +1399 -0
- scipy/io/matlab/tests/test_mio5_utils.py +179 -0
- scipy/io/matlab/tests/test_mio_funcs.py +51 -0
- scipy/io/matlab/tests/test_mio_utils.py +45 -0
- scipy/io/matlab/tests/test_miobase.py +32 -0
- scipy/io/matlab/tests/test_pathological.py +33 -0
- scipy/io/matlab/tests/test_streams.py +241 -0
- scipy/io/mmio.py +17 -0
- scipy/io/netcdf.py +17 -0
- scipy/io/tests/__init__.py +0 -0
- scipy/io/tests/data/Transparent Busy.ani +0 -0
- scipy/io/tests/data/array_float32_1d.sav +0 -0
- scipy/io/tests/data/array_float32_2d.sav +0 -0
- scipy/io/tests/data/array_float32_3d.sav +0 -0
- scipy/io/tests/data/array_float32_4d.sav +0 -0
- scipy/io/tests/data/array_float32_5d.sav +0 -0
- scipy/io/tests/data/array_float32_6d.sav +0 -0
- scipy/io/tests/data/array_float32_7d.sav +0 -0
- scipy/io/tests/data/array_float32_8d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_1d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_2d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_3d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_4d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_5d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_6d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_7d.sav +0 -0
- scipy/io/tests/data/array_float32_pointer_8d.sav +0 -0
- scipy/io/tests/data/example_1.nc +0 -0
- scipy/io/tests/data/example_2.nc +0 -0
- scipy/io/tests/data/example_3_maskedvals.nc +0 -0
- scipy/io/tests/data/fortran-3x3d-2i.dat +0 -0
- scipy/io/tests/data/fortran-mixed.dat +0 -0
- scipy/io/tests/data/fortran-sf8-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-sf8-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-sf8-1x3x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-11x1x10.dat +0 -0
- scipy/io/tests/data/fortran-si4-15x10x22.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x1.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x5.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x1x7.dat +0 -0
- scipy/io/tests/data/fortran-si4-1x3x5.dat +0 -0
- scipy/io/tests/data/invalid_pointer.sav +0 -0
- scipy/io/tests/data/null_pointer.sav +0 -0
- scipy/io/tests/data/scalar_byte.sav +0 -0
- scipy/io/tests/data/scalar_byte_descr.sav +0 -0
- scipy/io/tests/data/scalar_complex32.sav +0 -0
- scipy/io/tests/data/scalar_complex64.sav +0 -0
- scipy/io/tests/data/scalar_float32.sav +0 -0
- scipy/io/tests/data/scalar_float64.sav +0 -0
- scipy/io/tests/data/scalar_heap_pointer.sav +0 -0
- scipy/io/tests/data/scalar_int16.sav +0 -0
- scipy/io/tests/data/scalar_int32.sav +0 -0
- scipy/io/tests/data/scalar_int64.sav +0 -0
- scipy/io/tests/data/scalar_string.sav +0 -0
- scipy/io/tests/data/scalar_uint16.sav +0 -0
- scipy/io/tests/data/scalar_uint32.sav +0 -0
- scipy/io/tests/data/scalar_uint64.sav +0 -0
- scipy/io/tests/data/struct_arrays.sav +0 -0
- scipy/io/tests/data/struct_arrays_byte_idl80.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_inherit.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointer_arrays_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_pointers.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated.sav +0 -0
- scipy/io/tests/data/struct_pointers_replicated_3d.sav +0 -0
- scipy/io/tests/data/struct_scalars.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated.sav +0 -0
- scipy/io/tests/data/struct_scalars_replicated_3d.sav +0 -0
- scipy/io/tests/data/test-1234Hz-le-1ch-10S-20bit-extra.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-be.wav +0 -0
- scipy/io/tests/data/test-44100Hz-2ch-32bit-float-le.wav +0 -0
- scipy/io/tests/data/test-44100Hz-be-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof-no-data.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-early-eof.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-incomplete-chunk.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes-rf64.wav +0 -0
- scipy/io/tests/data/test-44100Hz-le-1ch-4bytes.wav +0 -0
- scipy/io/tests/data/test-48000Hz-2ch-64bit-float-le-wavex.wav +0 -0
- scipy/io/tests/data/test-8000Hz-be-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-1ch-1byte-ulaw.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-2ch-1byteu.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-inconsistent.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit-rf64.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-24bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-36bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-45bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-53bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-3ch-5S-64bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-4ch-9S-12bit.wav +0 -0
- scipy/io/tests/data/test-8000Hz-le-5ch-9S-5bit.wav +0 -0
- scipy/io/tests/data/various_compressed.sav +0 -0
- scipy/io/tests/test_fortran.py +264 -0
- scipy/io/tests/test_idl.py +483 -0
- scipy/io/tests/test_mmio.py +831 -0
- scipy/io/tests/test_netcdf.py +550 -0
- scipy/io/tests/test_paths.py +93 -0
- scipy/io/tests/test_wavfile.py +501 -0
- scipy/io/wavfile.py +938 -0
- scipy/linalg/__init__.pxd +1 -0
- scipy/linalg/__init__.py +236 -0
- scipy/linalg/_basic.py +2146 -0
- scipy/linalg/_blas_subroutines.h +164 -0
- scipy/linalg/_cythonized_array_utils.cp311-win_arm64.lib +0 -0
- scipy/linalg/_cythonized_array_utils.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_cythonized_array_utils.pxd +40 -0
- scipy/linalg/_cythonized_array_utils.pyi +16 -0
- scipy/linalg/_decomp.py +1645 -0
- scipy/linalg/_decomp_cholesky.py +413 -0
- scipy/linalg/_decomp_cossin.py +236 -0
- scipy/linalg/_decomp_interpolative.cp311-win_arm64.lib +0 -0
- scipy/linalg/_decomp_interpolative.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_ldl.py +356 -0
- scipy/linalg/_decomp_lu.py +401 -0
- scipy/linalg/_decomp_lu_cython.cp311-win_arm64.lib +0 -0
- scipy/linalg/_decomp_lu_cython.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_decomp_lu_cython.pyi +6 -0
- scipy/linalg/_decomp_polar.py +113 -0
- scipy/linalg/_decomp_qr.py +494 -0
- scipy/linalg/_decomp_qz.py +452 -0
- scipy/linalg/_decomp_schur.py +336 -0
- scipy/linalg/_decomp_svd.py +545 -0
- scipy/linalg/_decomp_update.cp311-win_arm64.lib +0 -0
- scipy/linalg/_decomp_update.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_expm_frechet.py +417 -0
- scipy/linalg/_fblas.cp311-win_arm64.lib +0 -0
- scipy/linalg/_fblas.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_flapack.cp311-win_arm64.lib +0 -0
- scipy/linalg/_flapack.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_lapack_subroutines.h +1521 -0
- scipy/linalg/_linalg_pythran.cp311-win_arm64.lib +0 -0
- scipy/linalg/_linalg_pythran.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs.py +1050 -0
- scipy/linalg/_matfuncs_expm.cp311-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_expm.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_expm.pyi +6 -0
- scipy/linalg/_matfuncs_inv_ssq.py +886 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp311-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_schur_sqrtm.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_matfuncs_sqrtm.py +107 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp311-win_arm64.lib +0 -0
- scipy/linalg/_matfuncs_sqrtm_triu.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_misc.py +191 -0
- scipy/linalg/_procrustes.py +113 -0
- scipy/linalg/_sketches.py +189 -0
- scipy/linalg/_solve_toeplitz.cp311-win_arm64.lib +0 -0
- scipy/linalg/_solve_toeplitz.cp311-win_arm64.pyd +0 -0
- scipy/linalg/_solvers.py +862 -0
- scipy/linalg/_special_matrices.py +1322 -0
- scipy/linalg/_testutils.py +65 -0
- scipy/linalg/basic.py +23 -0
- scipy/linalg/blas.py +495 -0
- scipy/linalg/cython_blas.cp311-win_arm64.lib +0 -0
- scipy/linalg/cython_blas.cp311-win_arm64.pyd +0 -0
- scipy/linalg/cython_blas.pxd +169 -0
- scipy/linalg/cython_blas.pyx +1432 -0
- scipy/linalg/cython_lapack.cp311-win_arm64.lib +0 -0
- scipy/linalg/cython_lapack.cp311-win_arm64.pyd +0 -0
- scipy/linalg/cython_lapack.pxd +1528 -0
- scipy/linalg/cython_lapack.pyx +12045 -0
- scipy/linalg/decomp.py +23 -0
- scipy/linalg/decomp_cholesky.py +21 -0
- scipy/linalg/decomp_lu.py +21 -0
- scipy/linalg/decomp_qr.py +20 -0
- scipy/linalg/decomp_schur.py +21 -0
- scipy/linalg/decomp_svd.py +21 -0
- scipy/linalg/interpolative.py +989 -0
- scipy/linalg/lapack.py +1081 -0
- scipy/linalg/matfuncs.py +23 -0
- scipy/linalg/misc.py +21 -0
- scipy/linalg/special_matrices.py +22 -0
- scipy/linalg/tests/__init__.py +0 -0
- scipy/linalg/tests/_cython_examples/extending.pyx +23 -0
- scipy/linalg/tests/_cython_examples/meson.build +34 -0
- scipy/linalg/tests/data/carex_15_data.npz +0 -0
- scipy/linalg/tests/data/carex_18_data.npz +0 -0
- scipy/linalg/tests/data/carex_19_data.npz +0 -0
- scipy/linalg/tests/data/carex_20_data.npz +0 -0
- scipy/linalg/tests/data/carex_6_data.npz +0 -0
- scipy/linalg/tests/data/gendare_20170120_data.npz +0 -0
- scipy/linalg/tests/test_basic.py +2074 -0
- scipy/linalg/tests/test_batch.py +588 -0
- scipy/linalg/tests/test_blas.py +1127 -0
- scipy/linalg/tests/test_cython_blas.py +118 -0
- scipy/linalg/tests/test_cython_lapack.py +22 -0
- scipy/linalg/tests/test_cythonized_array_utils.py +130 -0
- scipy/linalg/tests/test_decomp.py +3189 -0
- scipy/linalg/tests/test_decomp_cholesky.py +268 -0
- scipy/linalg/tests/test_decomp_cossin.py +314 -0
- scipy/linalg/tests/test_decomp_ldl.py +137 -0
- scipy/linalg/tests/test_decomp_lu.py +308 -0
- scipy/linalg/tests/test_decomp_polar.py +110 -0
- scipy/linalg/tests/test_decomp_update.py +1701 -0
- scipy/linalg/tests/test_extending.py +46 -0
- scipy/linalg/tests/test_fblas.py +607 -0
- scipy/linalg/tests/test_interpolative.py +232 -0
- scipy/linalg/tests/test_lapack.py +3620 -0
- scipy/linalg/tests/test_matfuncs.py +1125 -0
- scipy/linalg/tests/test_matmul_toeplitz.py +136 -0
- scipy/linalg/tests/test_procrustes.py +214 -0
- scipy/linalg/tests/test_sketches.py +118 -0
- scipy/linalg/tests/test_solve_toeplitz.py +150 -0
- scipy/linalg/tests/test_solvers.py +844 -0
- scipy/linalg/tests/test_special_matrices.py +636 -0
- scipy/misc/__init__.py +6 -0
- scipy/misc/common.py +6 -0
- scipy/misc/doccer.py +6 -0
- scipy/ndimage/__init__.py +174 -0
- scipy/ndimage/_ctest.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_ctest.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_cytest.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_cytest.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_delegators.py +303 -0
- scipy/ndimage/_filters.py +2422 -0
- scipy/ndimage/_fourier.py +306 -0
- scipy/ndimage/_interpolation.py +1033 -0
- scipy/ndimage/_measurements.py +1689 -0
- scipy/ndimage/_morphology.py +2634 -0
- scipy/ndimage/_nd_image.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_nd_image.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_ndimage_api.py +16 -0
- scipy/ndimage/_ni_docstrings.py +214 -0
- scipy/ndimage/_ni_label.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_ni_label.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_ni_support.py +139 -0
- scipy/ndimage/_rank_filter_1d.cp311-win_arm64.lib +0 -0
- scipy/ndimage/_rank_filter_1d.cp311-win_arm64.pyd +0 -0
- scipy/ndimage/_support_alternative_backends.py +84 -0
- scipy/ndimage/filters.py +27 -0
- scipy/ndimage/fourier.py +21 -0
- scipy/ndimage/interpolation.py +22 -0
- scipy/ndimage/measurements.py +24 -0
- scipy/ndimage/morphology.py +27 -0
- scipy/ndimage/tests/__init__.py +12 -0
- scipy/ndimage/tests/data/label_inputs.txt +21 -0
- scipy/ndimage/tests/data/label_results.txt +294 -0
- scipy/ndimage/tests/data/label_strels.txt +42 -0
- scipy/ndimage/tests/dots.png +0 -0
- scipy/ndimage/tests/test_c_api.py +102 -0
- scipy/ndimage/tests/test_datatypes.py +67 -0
- scipy/ndimage/tests/test_filters.py +3083 -0
- scipy/ndimage/tests/test_fourier.py +187 -0
- scipy/ndimage/tests/test_interpolation.py +1491 -0
- scipy/ndimage/tests/test_measurements.py +1592 -0
- scipy/ndimage/tests/test_morphology.py +2950 -0
- scipy/ndimage/tests/test_ni_support.py +78 -0
- scipy/ndimage/tests/test_splines.py +70 -0
- scipy/odr/__init__.py +131 -0
- scipy/odr/__odrpack.cp311-win_arm64.lib +0 -0
- scipy/odr/__odrpack.cp311-win_arm64.pyd +0 -0
- scipy/odr/_add_newdocs.py +34 -0
- scipy/odr/_models.py +315 -0
- scipy/odr/_odrpack.py +1154 -0
- scipy/odr/models.py +20 -0
- scipy/odr/odrpack.py +21 -0
- scipy/odr/tests/__init__.py +0 -0
- scipy/odr/tests/test_odr.py +607 -0
- scipy/optimize/__init__.pxd +1 -0
- scipy/optimize/__init__.py +460 -0
- scipy/optimize/_basinhopping.py +741 -0
- scipy/optimize/_bglu_dense.cp311-win_arm64.lib +0 -0
- scipy/optimize/_bglu_dense.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_bracket.py +706 -0
- scipy/optimize/_chandrupatla.py +551 -0
- scipy/optimize/_cobyla_py.py +297 -0
- scipy/optimize/_cobyqa_py.py +72 -0
- scipy/optimize/_constraints.py +598 -0
- scipy/optimize/_dcsrch.py +728 -0
- scipy/optimize/_differentiable_functions.py +835 -0
- scipy/optimize/_differentialevolution.py +1970 -0
- scipy/optimize/_direct.cp311-win_arm64.lib +0 -0
- scipy/optimize/_direct.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_direct_py.py +280 -0
- scipy/optimize/_dual_annealing.py +732 -0
- scipy/optimize/_elementwise.py +798 -0
- scipy/optimize/_group_columns.cp311-win_arm64.lib +0 -0
- scipy/optimize/_group_columns.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_hessian_update_strategy.py +479 -0
- scipy/optimize/_highspy/__init__.py +0 -0
- scipy/optimize/_highspy/_core.cp311-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_core.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_options.cp311-win_arm64.lib +0 -0
- scipy/optimize/_highspy/_highs_options.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_highspy/_highs_wrapper.py +338 -0
- scipy/optimize/_isotonic.py +157 -0
- scipy/optimize/_lbfgsb.cp311-win_arm64.lib +0 -0
- scipy/optimize/_lbfgsb.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_lbfgsb_py.py +634 -0
- scipy/optimize/_linesearch.py +896 -0
- scipy/optimize/_linprog.py +733 -0
- scipy/optimize/_linprog_doc.py +1434 -0
- scipy/optimize/_linprog_highs.py +422 -0
- scipy/optimize/_linprog_ip.py +1141 -0
- scipy/optimize/_linprog_rs.py +572 -0
- scipy/optimize/_linprog_simplex.py +663 -0
- scipy/optimize/_linprog_util.py +1521 -0
- scipy/optimize/_lsap.cp311-win_arm64.lib +0 -0
- scipy/optimize/_lsap.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/__init__.py +5 -0
- scipy/optimize/_lsq/bvls.py +183 -0
- scipy/optimize/_lsq/common.py +731 -0
- scipy/optimize/_lsq/dogbox.py +345 -0
- scipy/optimize/_lsq/givens_elimination.cp311-win_arm64.lib +0 -0
- scipy/optimize/_lsq/givens_elimination.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_lsq/least_squares.py +1044 -0
- scipy/optimize/_lsq/lsq_linear.py +361 -0
- scipy/optimize/_lsq/trf.py +587 -0
- scipy/optimize/_lsq/trf_linear.py +249 -0
- scipy/optimize/_milp.py +394 -0
- scipy/optimize/_minimize.py +1199 -0
- scipy/optimize/_minpack.cp311-win_arm64.lib +0 -0
- scipy/optimize/_minpack.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_minpack_py.py +1178 -0
- scipy/optimize/_moduleTNC.cp311-win_arm64.lib +0 -0
- scipy/optimize/_moduleTNC.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_nnls.py +96 -0
- scipy/optimize/_nonlin.py +1634 -0
- scipy/optimize/_numdiff.py +963 -0
- scipy/optimize/_optimize.py +4169 -0
- scipy/optimize/_pava_pybind.cp311-win_arm64.lib +0 -0
- scipy/optimize/_pava_pybind.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_qap.py +760 -0
- scipy/optimize/_remove_redundancy.py +522 -0
- scipy/optimize/_root.py +732 -0
- scipy/optimize/_root_scalar.py +538 -0
- scipy/optimize/_shgo.py +1606 -0
- scipy/optimize/_shgo_lib/__init__.py +0 -0
- scipy/optimize/_shgo_lib/_complex.py +1225 -0
- scipy/optimize/_shgo_lib/_vertex.py +460 -0
- scipy/optimize/_slsqp_py.py +603 -0
- scipy/optimize/_slsqplib.cp311-win_arm64.lib +0 -0
- scipy/optimize/_slsqplib.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_spectral.py +260 -0
- scipy/optimize/_tnc.py +438 -0
- scipy/optimize/_trlib/__init__.py +12 -0
- scipy/optimize/_trlib/_trlib.cp311-win_arm64.lib +0 -0
- scipy/optimize/_trlib/_trlib.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_trustregion.py +318 -0
- scipy/optimize/_trustregion_constr/__init__.py +6 -0
- scipy/optimize/_trustregion_constr/canonical_constraint.py +390 -0
- scipy/optimize/_trustregion_constr/equality_constrained_sqp.py +231 -0
- scipy/optimize/_trustregion_constr/minimize_trustregion_constr.py +584 -0
- scipy/optimize/_trustregion_constr/projections.py +411 -0
- scipy/optimize/_trustregion_constr/qp_subproblem.py +637 -0
- scipy/optimize/_trustregion_constr/report.py +49 -0
- scipy/optimize/_trustregion_constr/tests/__init__.py +0 -0
- scipy/optimize/_trustregion_constr/tests/test_canonical_constraint.py +296 -0
- scipy/optimize/_trustregion_constr/tests/test_nested_minimize.py +39 -0
- scipy/optimize/_trustregion_constr/tests/test_projections.py +214 -0
- scipy/optimize/_trustregion_constr/tests/test_qp_subproblem.py +645 -0
- scipy/optimize/_trustregion_constr/tests/test_report.py +34 -0
- scipy/optimize/_trustregion_constr/tr_interior_point.py +361 -0
- scipy/optimize/_trustregion_dogleg.py +122 -0
- scipy/optimize/_trustregion_exact.py +437 -0
- scipy/optimize/_trustregion_krylov.py +65 -0
- scipy/optimize/_trustregion_ncg.py +126 -0
- scipy/optimize/_tstutils.py +972 -0
- scipy/optimize/_zeros.cp311-win_arm64.lib +0 -0
- scipy/optimize/_zeros.cp311-win_arm64.pyd +0 -0
- scipy/optimize/_zeros_py.py +1475 -0
- scipy/optimize/cobyla.py +19 -0
- scipy/optimize/cython_optimize/__init__.py +133 -0
- scipy/optimize/cython_optimize/_zeros.cp311-win_arm64.lib +0 -0
- scipy/optimize/cython_optimize/_zeros.cp311-win_arm64.pyd +0 -0
- scipy/optimize/cython_optimize/_zeros.pxd +33 -0
- scipy/optimize/cython_optimize/c_zeros.pxd +26 -0
- scipy/optimize/cython_optimize.pxd +11 -0
- scipy/optimize/elementwise.py +38 -0
- scipy/optimize/lbfgsb.py +23 -0
- scipy/optimize/linesearch.py +18 -0
- scipy/optimize/minpack.py +27 -0
- scipy/optimize/minpack2.py +17 -0
- scipy/optimize/moduleTNC.py +19 -0
- scipy/optimize/nonlin.py +29 -0
- scipy/optimize/optimize.py +40 -0
- scipy/optimize/slsqp.py +22 -0
- scipy/optimize/tests/__init__.py +0 -0
- scipy/optimize/tests/_cython_examples/extending.pyx +43 -0
- scipy/optimize/tests/_cython_examples/meson.build +32 -0
- scipy/optimize/tests/test__basinhopping.py +535 -0
- scipy/optimize/tests/test__differential_evolution.py +1703 -0
- scipy/optimize/tests/test__dual_annealing.py +416 -0
- scipy/optimize/tests/test__linprog_clean_inputs.py +312 -0
- scipy/optimize/tests/test__numdiff.py +885 -0
- scipy/optimize/tests/test__remove_redundancy.py +228 -0
- scipy/optimize/tests/test__root.py +124 -0
- scipy/optimize/tests/test__shgo.py +1164 -0
- scipy/optimize/tests/test__spectral.py +226 -0
- scipy/optimize/tests/test_bracket.py +896 -0
- scipy/optimize/tests/test_chandrupatla.py +982 -0
- scipy/optimize/tests/test_cobyla.py +195 -0
- scipy/optimize/tests/test_cobyqa.py +252 -0
- scipy/optimize/tests/test_constraint_conversion.py +286 -0
- scipy/optimize/tests/test_constraints.py +255 -0
- scipy/optimize/tests/test_cython_optimize.py +92 -0
- scipy/optimize/tests/test_differentiable_functions.py +1025 -0
- scipy/optimize/tests/test_direct.py +321 -0
- scipy/optimize/tests/test_extending.py +28 -0
- scipy/optimize/tests/test_hessian_update_strategy.py +300 -0
- scipy/optimize/tests/test_isotonic_regression.py +167 -0
- scipy/optimize/tests/test_lbfgsb_hessinv.py +65 -0
- scipy/optimize/tests/test_lbfgsb_setulb.py +122 -0
- scipy/optimize/tests/test_least_squares.py +986 -0
- scipy/optimize/tests/test_linear_assignment.py +116 -0
- scipy/optimize/tests/test_linesearch.py +328 -0
- scipy/optimize/tests/test_linprog.py +2577 -0
- scipy/optimize/tests/test_lsq_common.py +297 -0
- scipy/optimize/tests/test_lsq_linear.py +287 -0
- scipy/optimize/tests/test_milp.py +459 -0
- scipy/optimize/tests/test_minimize_constrained.py +845 -0
- scipy/optimize/tests/test_minpack.py +1194 -0
- scipy/optimize/tests/test_nnls.py +469 -0
- scipy/optimize/tests/test_nonlin.py +572 -0
- scipy/optimize/tests/test_optimize.py +3344 -0
- scipy/optimize/tests/test_quadratic_assignment.py +455 -0
- scipy/optimize/tests/test_regression.py +40 -0
- scipy/optimize/tests/test_slsqp.py +645 -0
- scipy/optimize/tests/test_tnc.py +345 -0
- scipy/optimize/tests/test_trustregion.py +110 -0
- scipy/optimize/tests/test_trustregion_exact.py +351 -0
- scipy/optimize/tests/test_trustregion_krylov.py +170 -0
- scipy/optimize/tests/test_zeros.py +998 -0
- scipy/optimize/tnc.py +22 -0
- scipy/optimize/zeros.py +26 -0
- scipy/signal/__init__.py +316 -0
- scipy/signal/_arraytools.py +264 -0
- scipy/signal/_czt.py +575 -0
- scipy/signal/_delegators.py +568 -0
- scipy/signal/_filter_design.py +5893 -0
- scipy/signal/_fir_filter_design.py +1458 -0
- scipy/signal/_lti_conversion.py +534 -0
- scipy/signal/_ltisys.py +3546 -0
- scipy/signal/_max_len_seq.py +139 -0
- scipy/signal/_max_len_seq_inner.cp311-win_arm64.lib +0 -0
- scipy/signal/_max_len_seq_inner.cp311-win_arm64.pyd +0 -0
- scipy/signal/_peak_finding.py +1310 -0
- scipy/signal/_peak_finding_utils.cp311-win_arm64.lib +0 -0
- scipy/signal/_peak_finding_utils.cp311-win_arm64.pyd +0 -0
- scipy/signal/_polyutils.py +172 -0
- scipy/signal/_savitzky_golay.py +357 -0
- scipy/signal/_short_time_fft.py +2228 -0
- scipy/signal/_signal_api.py +30 -0
- scipy/signal/_signaltools.py +5309 -0
- scipy/signal/_sigtools.cp311-win_arm64.lib +0 -0
- scipy/signal/_sigtools.cp311-win_arm64.pyd +0 -0
- scipy/signal/_sosfilt.cp311-win_arm64.lib +0 -0
- scipy/signal/_sosfilt.cp311-win_arm64.pyd +0 -0
- scipy/signal/_spectral_py.py +2471 -0
- scipy/signal/_spline.cp311-win_arm64.lib +0 -0
- scipy/signal/_spline.cp311-win_arm64.pyd +0 -0
- scipy/signal/_spline.pyi +34 -0
- scipy/signal/_spline_filters.py +848 -0
- scipy/signal/_support_alternative_backends.py +73 -0
- scipy/signal/_upfirdn.py +219 -0
- scipy/signal/_upfirdn_apply.cp311-win_arm64.lib +0 -0
- scipy/signal/_upfirdn_apply.cp311-win_arm64.pyd +0 -0
- scipy/signal/_waveforms.py +687 -0
- scipy/signal/_wavelets.py +29 -0
- scipy/signal/bsplines.py +21 -0
- scipy/signal/filter_design.py +28 -0
- scipy/signal/fir_filter_design.py +21 -0
- scipy/signal/lti_conversion.py +20 -0
- scipy/signal/ltisys.py +25 -0
- scipy/signal/signaltools.py +27 -0
- scipy/signal/spectral.py +21 -0
- scipy/signal/spline.py +18 -0
- scipy/signal/tests/__init__.py +0 -0
- scipy/signal/tests/_scipy_spectral_test_shim.py +311 -0
- scipy/signal/tests/mpsig.py +122 -0
- scipy/signal/tests/test_array_tools.py +111 -0
- scipy/signal/tests/test_bsplines.py +365 -0
- scipy/signal/tests/test_cont2discrete.py +424 -0
- scipy/signal/tests/test_czt.py +221 -0
- scipy/signal/tests/test_dltisys.py +599 -0
- scipy/signal/tests/test_filter_design.py +4744 -0
- scipy/signal/tests/test_fir_filter_design.py +851 -0
- scipy/signal/tests/test_ltisys.py +1225 -0
- scipy/signal/tests/test_max_len_seq.py +71 -0
- scipy/signal/tests/test_peak_finding.py +915 -0
- scipy/signal/tests/test_result_type.py +51 -0
- scipy/signal/tests/test_savitzky_golay.py +363 -0
- scipy/signal/tests/test_short_time_fft.py +1107 -0
- scipy/signal/tests/test_signaltools.py +4735 -0
- scipy/signal/tests/test_spectral.py +2141 -0
- scipy/signal/tests/test_splines.py +427 -0
- scipy/signal/tests/test_upfirdn.py +322 -0
- scipy/signal/tests/test_waveforms.py +400 -0
- scipy/signal/tests/test_wavelets.py +59 -0
- scipy/signal/tests/test_windows.py +987 -0
- scipy/signal/waveforms.py +20 -0
- scipy/signal/wavelets.py +17 -0
- scipy/signal/windows/__init__.py +52 -0
- scipy/signal/windows/_windows.py +2513 -0
- scipy/signal/windows/windows.py +23 -0
- scipy/sparse/__init__.py +350 -0
- scipy/sparse/_base.py +1613 -0
- scipy/sparse/_bsr.py +880 -0
- scipy/sparse/_compressed.py +1328 -0
- scipy/sparse/_construct.py +1454 -0
- scipy/sparse/_coo.py +1581 -0
- scipy/sparse/_csc.py +367 -0
- scipy/sparse/_csparsetools.cp311-win_arm64.lib +0 -0
- scipy/sparse/_csparsetools.cp311-win_arm64.pyd +0 -0
- scipy/sparse/_csr.py +558 -0
- scipy/sparse/_data.py +569 -0
- scipy/sparse/_dia.py +677 -0
- scipy/sparse/_dok.py +669 -0
- scipy/sparse/_extract.py +178 -0
- scipy/sparse/_index.py +444 -0
- scipy/sparse/_lil.py +632 -0
- scipy/sparse/_matrix.py +169 -0
- scipy/sparse/_matrix_io.py +167 -0
- scipy/sparse/_sparsetools.cp311-win_arm64.lib +0 -0
- scipy/sparse/_sparsetools.cp311-win_arm64.pyd +0 -0
- scipy/sparse/_spfuncs.py +76 -0
- scipy/sparse/_sputils.py +632 -0
- scipy/sparse/base.py +24 -0
- scipy/sparse/bsr.py +22 -0
- scipy/sparse/compressed.py +20 -0
- scipy/sparse/construct.py +38 -0
- scipy/sparse/coo.py +23 -0
- scipy/sparse/csc.py +22 -0
- scipy/sparse/csgraph/__init__.py +210 -0
- scipy/sparse/csgraph/_flow.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_flow.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_laplacian.py +563 -0
- scipy/sparse/csgraph/_matching.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_matching.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_min_spanning_tree.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_reordering.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_reordering.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_shortest_path.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_shortest_path.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_tools.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_tools.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_traversal.cp311-win_arm64.lib +0 -0
- scipy/sparse/csgraph/_traversal.cp311-win_arm64.pyd +0 -0
- scipy/sparse/csgraph/_validation.py +66 -0
- scipy/sparse/csgraph/tests/__init__.py +0 -0
- scipy/sparse/csgraph/tests/test_connected_components.py +119 -0
- scipy/sparse/csgraph/tests/test_conversions.py +61 -0
- scipy/sparse/csgraph/tests/test_flow.py +209 -0
- scipy/sparse/csgraph/tests/test_graph_laplacian.py +368 -0
- scipy/sparse/csgraph/tests/test_matching.py +307 -0
- scipy/sparse/csgraph/tests/test_pydata_sparse.py +197 -0
- scipy/sparse/csgraph/tests/test_reordering.py +70 -0
- scipy/sparse/csgraph/tests/test_shortest_path.py +540 -0
- scipy/sparse/csgraph/tests/test_spanning_tree.py +66 -0
- scipy/sparse/csgraph/tests/test_traversal.py +148 -0
- scipy/sparse/csr.py +22 -0
- scipy/sparse/data.py +18 -0
- scipy/sparse/dia.py +22 -0
- scipy/sparse/dok.py +22 -0
- scipy/sparse/extract.py +23 -0
- scipy/sparse/lil.py +22 -0
- scipy/sparse/linalg/__init__.py +148 -0
- scipy/sparse/linalg/_dsolve/__init__.py +71 -0
- scipy/sparse/linalg/_dsolve/_add_newdocs.py +147 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_dsolve/_superlu.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_dsolve/linsolve.py +882 -0
- scipy/sparse/linalg/_dsolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_dsolve/tests/test_linsolve.py +928 -0
- scipy/sparse/linalg/_eigen/__init__.py +22 -0
- scipy/sparse/linalg/_eigen/_svds.py +540 -0
- scipy/sparse/linalg/_eigen/_svds_doc.py +382 -0
- scipy/sparse/linalg/_eigen/arpack/COPYING +45 -0
- scipy/sparse/linalg/_eigen/arpack/__init__.py +20 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_eigen/arpack/_arpack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_eigen/arpack/arpack.py +1706 -0
- scipy/sparse/linalg/_eigen/arpack/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py +717 -0
- scipy/sparse/linalg/_eigen/lobpcg/__init__.py +16 -0
- scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py +1110 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py +725 -0
- scipy/sparse/linalg/_eigen/tests/__init__.py +0 -0
- scipy/sparse/linalg/_eigen/tests/test_svds.py +886 -0
- scipy/sparse/linalg/_expm_multiply.py +816 -0
- scipy/sparse/linalg/_interface.py +920 -0
- scipy/sparse/linalg/_isolve/__init__.py +20 -0
- scipy/sparse/linalg/_isolve/_gcrotmk.py +503 -0
- scipy/sparse/linalg/_isolve/iterative.py +1051 -0
- scipy/sparse/linalg/_isolve/lgmres.py +230 -0
- scipy/sparse/linalg/_isolve/lsmr.py +486 -0
- scipy/sparse/linalg/_isolve/lsqr.py +589 -0
- scipy/sparse/linalg/_isolve/minres.py +372 -0
- scipy/sparse/linalg/_isolve/tests/__init__.py +0 -0
- scipy/sparse/linalg/_isolve/tests/test_gcrotmk.py +183 -0
- scipy/sparse/linalg/_isolve/tests/test_iterative.py +809 -0
- scipy/sparse/linalg/_isolve/tests/test_lgmres.py +225 -0
- scipy/sparse/linalg/_isolve/tests/test_lsmr.py +185 -0
- scipy/sparse/linalg/_isolve/tests/test_lsqr.py +120 -0
- scipy/sparse/linalg/_isolve/tests/test_minres.py +97 -0
- scipy/sparse/linalg/_isolve/tests/test_utils.py +9 -0
- scipy/sparse/linalg/_isolve/tfqmr.py +179 -0
- scipy/sparse/linalg/_isolve/utils.py +121 -0
- scipy/sparse/linalg/_matfuncs.py +940 -0
- scipy/sparse/linalg/_norm.py +195 -0
- scipy/sparse/linalg/_onenormest.py +467 -0
- scipy/sparse/linalg/_propack/_cpropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_cpropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_dpropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_spropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp311-win_arm64.lib +0 -0
- scipy/sparse/linalg/_propack/_zpropack.cp311-win_arm64.pyd +0 -0
- scipy/sparse/linalg/_special_sparse_arrays.py +949 -0
- scipy/sparse/linalg/_svdp.py +309 -0
- scipy/sparse/linalg/dsolve.py +22 -0
- scipy/sparse/linalg/eigen.py +21 -0
- scipy/sparse/linalg/interface.py +20 -0
- scipy/sparse/linalg/isolve.py +22 -0
- scipy/sparse/linalg/matfuncs.py +18 -0
- scipy/sparse/linalg/tests/__init__.py +0 -0
- scipy/sparse/linalg/tests/propack_test_data.npz +0 -0
- scipy/sparse/linalg/tests/test_expm_multiply.py +367 -0
- scipy/sparse/linalg/tests/test_interface.py +561 -0
- scipy/sparse/linalg/tests/test_matfuncs.py +592 -0
- scipy/sparse/linalg/tests/test_norm.py +154 -0
- scipy/sparse/linalg/tests/test_onenormest.py +252 -0
- scipy/sparse/linalg/tests/test_propack.py +165 -0
- scipy/sparse/linalg/tests/test_pydata_sparse.py +272 -0
- scipy/sparse/linalg/tests/test_special_sparse_arrays.py +337 -0
- scipy/sparse/sparsetools.py +17 -0
- scipy/sparse/spfuncs.py +17 -0
- scipy/sparse/sputils.py +17 -0
- scipy/sparse/tests/__init__.py +0 -0
- scipy/sparse/tests/data/csc_py2.npz +0 -0
- scipy/sparse/tests/data/csc_py3.npz +0 -0
- scipy/sparse/tests/test_arithmetic1d.py +341 -0
- scipy/sparse/tests/test_array_api.py +561 -0
- scipy/sparse/tests/test_base.py +5870 -0
- scipy/sparse/tests/test_common1d.py +447 -0
- scipy/sparse/tests/test_construct.py +872 -0
- scipy/sparse/tests/test_coo.py +1119 -0
- scipy/sparse/tests/test_csc.py +98 -0
- scipy/sparse/tests/test_csr.py +214 -0
- scipy/sparse/tests/test_dok.py +209 -0
- scipy/sparse/tests/test_extract.py +51 -0
- scipy/sparse/tests/test_indexing1d.py +603 -0
- scipy/sparse/tests/test_matrix_io.py +109 -0
- scipy/sparse/tests/test_minmax1d.py +128 -0
- scipy/sparse/tests/test_sparsetools.py +344 -0
- scipy/sparse/tests/test_spfuncs.py +97 -0
- scipy/sparse/tests/test_sputils.py +424 -0
- scipy/spatial/__init__.py +129 -0
- scipy/spatial/_ckdtree.cp311-win_arm64.lib +0 -0
- scipy/spatial/_ckdtree.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_distance_pybind.cp311-win_arm64.lib +0 -0
- scipy/spatial/_distance_pybind.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_distance_wrap.cp311-win_arm64.lib +0 -0
- scipy/spatial/_distance_wrap.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_geometric_slerp.py +238 -0
- scipy/spatial/_hausdorff.cp311-win_arm64.lib +0 -0
- scipy/spatial/_hausdorff.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_kdtree.py +920 -0
- scipy/spatial/_plotutils.py +274 -0
- scipy/spatial/_procrustes.py +132 -0
- scipy/spatial/_qhull.cp311-win_arm64.lib +0 -0
- scipy/spatial/_qhull.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_qhull.pyi +213 -0
- scipy/spatial/_spherical_voronoi.py +341 -0
- scipy/spatial/_voronoi.cp311-win_arm64.lib +0 -0
- scipy/spatial/_voronoi.cp311-win_arm64.pyd +0 -0
- scipy/spatial/_voronoi.pyi +4 -0
- scipy/spatial/ckdtree.py +18 -0
- scipy/spatial/distance.py +3147 -0
- scipy/spatial/distance.pyi +210 -0
- scipy/spatial/kdtree.py +25 -0
- scipy/spatial/qhull.py +25 -0
- scipy/spatial/qhull_src/COPYING_QHULL.txt +39 -0
- scipy/spatial/tests/__init__.py +0 -0
- scipy/spatial/tests/data/cdist-X1.txt +10 -0
- scipy/spatial/tests/data/cdist-X2.txt +20 -0
- scipy/spatial/tests/data/degenerate_pointset.npz +0 -0
- scipy/spatial/tests/data/iris.txt +150 -0
- scipy/spatial/tests/data/pdist-boolean-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-chebyshev-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cityblock-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-correlation-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-cosine-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-double-inp.txt +20 -0
- scipy/spatial/tests/data/pdist-euclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-euclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-hamming-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jaccard-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-jensenshannon-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-3.2-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-minkowski-5.8-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml-iris.txt +1 -0
- scipy/spatial/tests/data/pdist-seuclidean-ml.txt +1 -0
- scipy/spatial/tests/data/pdist-spearman-ml.txt +1 -0
- scipy/spatial/tests/data/random-bool-data.txt +100 -0
- scipy/spatial/tests/data/random-double-data.txt +100 -0
- scipy/spatial/tests/data/random-int-data.txt +100 -0
- scipy/spatial/tests/data/random-uint-data.txt +100 -0
- scipy/spatial/tests/data/selfdual-4d-polytope.txt +27 -0
- scipy/spatial/tests/test__plotutils.py +91 -0
- scipy/spatial/tests/test__procrustes.py +116 -0
- scipy/spatial/tests/test_distance.py +2389 -0
- scipy/spatial/tests/test_hausdorff.py +199 -0
- scipy/spatial/tests/test_kdtree.py +1536 -0
- scipy/spatial/tests/test_qhull.py +1313 -0
- scipy/spatial/tests/test_slerp.py +417 -0
- scipy/spatial/tests/test_spherical_voronoi.py +358 -0
- scipy/spatial/transform/__init__.py +31 -0
- scipy/spatial/transform/_rigid_transform.cp311-win_arm64.lib +0 -0
- scipy/spatial/transform/_rigid_transform.cp311-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation.cp311-win_arm64.lib +0 -0
- scipy/spatial/transform/_rotation.cp311-win_arm64.pyd +0 -0
- scipy/spatial/transform/_rotation_groups.py +140 -0
- scipy/spatial/transform/_rotation_spline.py +460 -0
- scipy/spatial/transform/rotation.py +21 -0
- scipy/spatial/transform/tests/__init__.py +0 -0
- scipy/spatial/transform/tests/test_rigid_transform.py +1221 -0
- scipy/spatial/transform/tests/test_rotation.py +2569 -0
- scipy/spatial/transform/tests/test_rotation_groups.py +169 -0
- scipy/spatial/transform/tests/test_rotation_spline.py +183 -0
- scipy/special/__init__.pxd +1 -0
- scipy/special/__init__.py +841 -0
- scipy/special/_add_newdocs.py +9961 -0
- scipy/special/_basic.py +3576 -0
- scipy/special/_comb.cp311-win_arm64.lib +0 -0
- scipy/special/_comb.cp311-win_arm64.pyd +0 -0
- scipy/special/_ellip_harm.py +214 -0
- scipy/special/_ellip_harm_2.cp311-win_arm64.lib +0 -0
- scipy/special/_ellip_harm_2.cp311-win_arm64.pyd +0 -0
- scipy/special/_gufuncs.cp311-win_arm64.lib +0 -0
- scipy/special/_gufuncs.cp311-win_arm64.pyd +0 -0
- scipy/special/_input_validation.py +17 -0
- scipy/special/_lambertw.py +149 -0
- scipy/special/_logsumexp.py +426 -0
- scipy/special/_mptestutils.py +453 -0
- scipy/special/_multiufuncs.py +610 -0
- scipy/special/_orthogonal.py +2592 -0
- scipy/special/_orthogonal.pyi +330 -0
- scipy/special/_precompute/__init__.py +0 -0
- scipy/special/_precompute/cosine_cdf.py +17 -0
- scipy/special/_precompute/expn_asy.py +54 -0
- scipy/special/_precompute/gammainc_asy.py +116 -0
- scipy/special/_precompute/gammainc_data.py +124 -0
- scipy/special/_precompute/hyp2f1_data.py +484 -0
- scipy/special/_precompute/lambertw.py +68 -0
- scipy/special/_precompute/loggamma.py +43 -0
- scipy/special/_precompute/struve_convergence.py +131 -0
- scipy/special/_precompute/utils.py +38 -0
- scipy/special/_precompute/wright_bessel.py +342 -0
- scipy/special/_precompute/wright_bessel_data.py +152 -0
- scipy/special/_precompute/wrightomega.py +41 -0
- scipy/special/_precompute/zetac.py +27 -0
- scipy/special/_sf_error.py +15 -0
- scipy/special/_specfun.cp311-win_arm64.lib +0 -0
- scipy/special/_specfun.cp311-win_arm64.pyd +0 -0
- scipy/special/_special_ufuncs.cp311-win_arm64.lib +0 -0
- scipy/special/_special_ufuncs.cp311-win_arm64.pyd +0 -0
- scipy/special/_spfun_stats.py +106 -0
- scipy/special/_spherical_bessel.py +397 -0
- scipy/special/_support_alternative_backends.py +295 -0
- scipy/special/_test_internal.cp311-win_arm64.lib +0 -0
- scipy/special/_test_internal.cp311-win_arm64.pyd +0 -0
- scipy/special/_test_internal.pyi +9 -0
- scipy/special/_testutils.py +321 -0
- scipy/special/_ufuncs.cp311-win_arm64.lib +0 -0
- scipy/special/_ufuncs.cp311-win_arm64.pyd +0 -0
- scipy/special/_ufuncs.pyi +522 -0
- scipy/special/_ufuncs.pyx +13173 -0
- scipy/special/_ufuncs_cxx.cp311-win_arm64.lib +0 -0
- scipy/special/_ufuncs_cxx.cp311-win_arm64.pyd +0 -0
- scipy/special/_ufuncs_cxx.pxd +142 -0
- scipy/special/_ufuncs_cxx.pyx +427 -0
- scipy/special/_ufuncs_cxx_defs.h +147 -0
- scipy/special/_ufuncs_defs.h +57 -0
- scipy/special/add_newdocs.py +15 -0
- scipy/special/basic.py +87 -0
- scipy/special/cython_special.cp311-win_arm64.lib +0 -0
- scipy/special/cython_special.cp311-win_arm64.pyd +0 -0
- scipy/special/cython_special.pxd +259 -0
- scipy/special/cython_special.pyi +3 -0
- scipy/special/orthogonal.py +45 -0
- scipy/special/sf_error.py +20 -0
- scipy/special/specfun.py +24 -0
- scipy/special/spfun_stats.py +17 -0
- scipy/special/tests/__init__.py +0 -0
- scipy/special/tests/_cython_examples/extending.pyx +12 -0
- scipy/special/tests/_cython_examples/meson.build +34 -0
- scipy/special/tests/data/__init__.py +0 -0
- scipy/special/tests/data/boost.npz +0 -0
- scipy/special/tests/data/gsl.npz +0 -0
- scipy/special/tests/data/local.npz +0 -0
- scipy/special/tests/test_basic.py +4815 -0
- scipy/special/tests/test_bdtr.py +112 -0
- scipy/special/tests/test_boost_ufuncs.py +64 -0
- scipy/special/tests/test_boxcox.py +125 -0
- scipy/special/tests/test_cdflib.py +712 -0
- scipy/special/tests/test_cdft_asymptotic.py +49 -0
- scipy/special/tests/test_cephes_intp_cast.py +29 -0
- scipy/special/tests/test_cosine_distr.py +83 -0
- scipy/special/tests/test_cython_special.py +363 -0
- scipy/special/tests/test_data.py +719 -0
- scipy/special/tests/test_dd.py +42 -0
- scipy/special/tests/test_digamma.py +45 -0
- scipy/special/tests/test_ellip_harm.py +278 -0
- scipy/special/tests/test_erfinv.py +89 -0
- scipy/special/tests/test_exponential_integrals.py +118 -0
- scipy/special/tests/test_extending.py +28 -0
- scipy/special/tests/test_faddeeva.py +85 -0
- scipy/special/tests/test_gamma.py +12 -0
- scipy/special/tests/test_gammainc.py +152 -0
- scipy/special/tests/test_hyp2f1.py +2566 -0
- scipy/special/tests/test_hypergeometric.py +234 -0
- scipy/special/tests/test_iv_ratio.py +249 -0
- scipy/special/tests/test_kolmogorov.py +491 -0
- scipy/special/tests/test_lambertw.py +109 -0
- scipy/special/tests/test_legendre.py +1518 -0
- scipy/special/tests/test_log1mexp.py +85 -0
- scipy/special/tests/test_loggamma.py +70 -0
- scipy/special/tests/test_logit.py +162 -0
- scipy/special/tests/test_logsumexp.py +469 -0
- scipy/special/tests/test_mpmath.py +2293 -0
- scipy/special/tests/test_nan_inputs.py +65 -0
- scipy/special/tests/test_ndtr.py +77 -0
- scipy/special/tests/test_ndtri_exp.py +94 -0
- scipy/special/tests/test_orthogonal.py +821 -0
- scipy/special/tests/test_orthogonal_eval.py +275 -0
- scipy/special/tests/test_owens_t.py +53 -0
- scipy/special/tests/test_pcf.py +24 -0
- scipy/special/tests/test_pdtr.py +48 -0
- scipy/special/tests/test_powm1.py +65 -0
- scipy/special/tests/test_precompute_expn_asy.py +24 -0
- scipy/special/tests/test_precompute_gammainc.py +108 -0
- scipy/special/tests/test_precompute_utils.py +36 -0
- scipy/special/tests/test_round.py +18 -0
- scipy/special/tests/test_sf_error.py +146 -0
- scipy/special/tests/test_sici.py +36 -0
- scipy/special/tests/test_specfun.py +48 -0
- scipy/special/tests/test_spence.py +32 -0
- scipy/special/tests/test_spfun_stats.py +61 -0
- scipy/special/tests/test_sph_harm.py +85 -0
- scipy/special/tests/test_spherical_bessel.py +400 -0
- scipy/special/tests/test_support_alternative_backends.py +248 -0
- scipy/special/tests/test_trig.py +72 -0
- scipy/special/tests/test_ufunc_signatures.py +46 -0
- scipy/special/tests/test_wright_bessel.py +205 -0
- scipy/special/tests/test_wrightomega.py +117 -0
- scipy/special/tests/test_zeta.py +301 -0
- scipy/stats/__init__.py +670 -0
- scipy/stats/_ansari_swilk_statistics.cp311-win_arm64.lib +0 -0
- scipy/stats/_ansari_swilk_statistics.cp311-win_arm64.pyd +0 -0
- scipy/stats/_axis_nan_policy.py +692 -0
- scipy/stats/_biasedurn.cp311-win_arm64.lib +0 -0
- scipy/stats/_biasedurn.cp311-win_arm64.pyd +0 -0
- scipy/stats/_biasedurn.pxd +27 -0
- scipy/stats/_binned_statistic.py +795 -0
- scipy/stats/_binomtest.py +375 -0
- scipy/stats/_bws_test.py +177 -0
- scipy/stats/_censored_data.py +459 -0
- scipy/stats/_common.py +5 -0
- scipy/stats/_constants.py +42 -0
- scipy/stats/_continued_fraction.py +387 -0
- scipy/stats/_continuous_distns.py +12486 -0
- scipy/stats/_correlation.py +210 -0
- scipy/stats/_covariance.py +636 -0
- scipy/stats/_crosstab.py +204 -0
- scipy/stats/_discrete_distns.py +2098 -0
- scipy/stats/_distn_infrastructure.py +4201 -0
- scipy/stats/_distr_params.py +299 -0
- scipy/stats/_distribution_infrastructure.py +5750 -0
- scipy/stats/_entropy.py +428 -0
- scipy/stats/_finite_differences.py +145 -0
- scipy/stats/_fit.py +1351 -0
- scipy/stats/_hypotests.py +2060 -0
- scipy/stats/_kde.py +732 -0
- scipy/stats/_ksstats.py +600 -0
- scipy/stats/_levy_stable/__init__.py +1231 -0
- scipy/stats/_levy_stable/levyst.cp311-win_arm64.lib +0 -0
- scipy/stats/_levy_stable/levyst.cp311-win_arm64.pyd +0 -0
- scipy/stats/_mannwhitneyu.py +492 -0
- scipy/stats/_mgc.py +550 -0
- scipy/stats/_morestats.py +4626 -0
- scipy/stats/_mstats_basic.py +3658 -0
- scipy/stats/_mstats_extras.py +521 -0
- scipy/stats/_multicomp.py +449 -0
- scipy/stats/_multivariate.py +7281 -0
- scipy/stats/_new_distributions.py +452 -0
- scipy/stats/_odds_ratio.py +466 -0
- scipy/stats/_page_trend_test.py +486 -0
- scipy/stats/_probability_distribution.py +1964 -0
- scipy/stats/_qmc.py +2956 -0
- scipy/stats/_qmc_cy.cp311-win_arm64.lib +0 -0
- scipy/stats/_qmc_cy.cp311-win_arm64.pyd +0 -0
- scipy/stats/_qmc_cy.pyi +54 -0
- scipy/stats/_qmvnt.py +454 -0
- scipy/stats/_qmvnt_cy.cp311-win_arm64.lib +0 -0
- scipy/stats/_qmvnt_cy.cp311-win_arm64.pyd +0 -0
- scipy/stats/_quantile.py +335 -0
- scipy/stats/_rcont/__init__.py +4 -0
- scipy/stats/_rcont/rcont.cp311-win_arm64.lib +0 -0
- scipy/stats/_rcont/rcont.cp311-win_arm64.pyd +0 -0
- scipy/stats/_relative_risk.py +263 -0
- scipy/stats/_resampling.py +2352 -0
- scipy/stats/_result_classes.py +40 -0
- scipy/stats/_sampling.py +1314 -0
- scipy/stats/_sensitivity_analysis.py +713 -0
- scipy/stats/_sobol.cp311-win_arm64.lib +0 -0
- scipy/stats/_sobol.cp311-win_arm64.pyd +0 -0
- scipy/stats/_sobol.pyi +54 -0
- scipy/stats/_sobol_direction_numbers.npz +0 -0
- scipy/stats/_stats.cp311-win_arm64.lib +0 -0
- scipy/stats/_stats.cp311-win_arm64.pyd +0 -0
- scipy/stats/_stats.pxd +10 -0
- scipy/stats/_stats_mstats_common.py +322 -0
- scipy/stats/_stats_py.py +11089 -0
- scipy/stats/_stats_pythran.cp311-win_arm64.lib +0 -0
- scipy/stats/_stats_pythran.cp311-win_arm64.pyd +0 -0
- scipy/stats/_survival.py +683 -0
- scipy/stats/_tukeylambda_stats.py +199 -0
- scipy/stats/_unuran/__init__.py +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp311-win_arm64.lib +0 -0
- scipy/stats/_unuran/unuran_wrapper.cp311-win_arm64.pyd +0 -0
- scipy/stats/_unuran/unuran_wrapper.pyi +179 -0
- scipy/stats/_variation.py +126 -0
- scipy/stats/_warnings_errors.py +38 -0
- scipy/stats/_wilcoxon.py +265 -0
- scipy/stats/biasedurn.py +16 -0
- scipy/stats/contingency.py +521 -0
- scipy/stats/distributions.py +24 -0
- scipy/stats/kde.py +18 -0
- scipy/stats/morestats.py +27 -0
- scipy/stats/mstats.py +140 -0
- scipy/stats/mstats_basic.py +42 -0
- scipy/stats/mstats_extras.py +25 -0
- scipy/stats/mvn.py +17 -0
- scipy/stats/qmc.py +236 -0
- scipy/stats/sampling.py +73 -0
- scipy/stats/stats.py +41 -0
- scipy/stats/tests/__init__.py +0 -0
- scipy/stats/tests/common_tests.py +356 -0
- scipy/stats/tests/data/_mvt.py +171 -0
- scipy/stats/tests/data/fisher_exact_results_from_r.py +607 -0
- scipy/stats/tests/data/jf_skew_t_gamlss_pdf_data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-cdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-Z1-pdf-sample-data.npy +0 -0
- scipy/stats/tests/data/levy_stable/stable-loc-scale-sample-data.npy +0 -0
- scipy/stats/tests/data/nist_anova/AtmWtAg.dat +108 -0
- scipy/stats/tests/data/nist_anova/SiRstv.dat +85 -0
- scipy/stats/tests/data/nist_anova/SmLs01.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs02.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs03.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs04.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs05.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs06.dat +18069 -0
- scipy/stats/tests/data/nist_anova/SmLs07.dat +249 -0
- scipy/stats/tests/data/nist_anova/SmLs08.dat +1869 -0
- scipy/stats/tests/data/nist_anova/SmLs09.dat +18069 -0
- scipy/stats/tests/data/nist_linregress/Norris.dat +97 -0
- scipy/stats/tests/data/rel_breitwigner_pdf_sample_data_ROOT.npy +0 -0
- scipy/stats/tests/data/studentized_range_mpmath_ref.json +1499 -0
- scipy/stats/tests/test_axis_nan_policy.py +1388 -0
- scipy/stats/tests/test_binned_statistic.py +568 -0
- scipy/stats/tests/test_censored_data.py +152 -0
- scipy/stats/tests/test_contingency.py +294 -0
- scipy/stats/tests/test_continued_fraction.py +173 -0
- scipy/stats/tests/test_continuous.py +2198 -0
- scipy/stats/tests/test_continuous_basic.py +1053 -0
- scipy/stats/tests/test_continuous_fit_censored.py +683 -0
- scipy/stats/tests/test_correlation.py +80 -0
- scipy/stats/tests/test_crosstab.py +115 -0
- scipy/stats/tests/test_discrete_basic.py +580 -0
- scipy/stats/tests/test_discrete_distns.py +700 -0
- scipy/stats/tests/test_distributions.py +10413 -0
- scipy/stats/tests/test_entropy.py +322 -0
- scipy/stats/tests/test_fast_gen_inversion.py +435 -0
- scipy/stats/tests/test_fit.py +1090 -0
- scipy/stats/tests/test_hypotests.py +1991 -0
- scipy/stats/tests/test_kdeoth.py +676 -0
- scipy/stats/tests/test_marray.py +289 -0
- scipy/stats/tests/test_mgc.py +217 -0
- scipy/stats/tests/test_morestats.py +3259 -0
- scipy/stats/tests/test_mstats_basic.py +2071 -0
- scipy/stats/tests/test_mstats_extras.py +172 -0
- scipy/stats/tests/test_multicomp.py +405 -0
- scipy/stats/tests/test_multivariate.py +4381 -0
- scipy/stats/tests/test_odds_ratio.py +148 -0
- scipy/stats/tests/test_qmc.py +1492 -0
- scipy/stats/tests/test_quantile.py +199 -0
- scipy/stats/tests/test_rank.py +345 -0
- scipy/stats/tests/test_relative_risk.py +95 -0
- scipy/stats/tests/test_resampling.py +2000 -0
- scipy/stats/tests/test_sampling.py +1450 -0
- scipy/stats/tests/test_sensitivity_analysis.py +310 -0
- scipy/stats/tests/test_stats.py +9707 -0
- scipy/stats/tests/test_survival.py +466 -0
- scipy/stats/tests/test_tukeylambda_stats.py +85 -0
- scipy/stats/tests/test_variation.py +216 -0
- scipy/version.py +12 -0
- scipy-1.16.2.dist-info/DELVEWHEEL +2 -0
- scipy-1.16.2.dist-info/LICENSE.txt +912 -0
- scipy-1.16.2.dist-info/METADATA +1061 -0
- scipy-1.16.2.dist-info/RECORD +1530 -0
- scipy-1.16.2.dist-info/WHEEL +4 -0
- scipy.libs/msvcp140-5f1c5dd31916990d94181e07bc3afb32.dll +0 -0
- scipy.libs/scipy_openblas-f3ac85b1f412f7e86514c923dc4058d1.dll +0 -0
@@ -0,0 +1,1706 @@
|
|
1
|
+
"""
|
2
|
+
Find a few eigenvectors and eigenvalues of a matrix.
|
3
|
+
|
4
|
+
|
5
|
+
Uses ARPACK: https://github.com/opencollab/arpack-ng
|
6
|
+
|
7
|
+
"""
|
8
|
+
# Wrapper implementation notes
|
9
|
+
#
|
10
|
+
# ARPACK Entry Points
|
11
|
+
# -------------------
|
12
|
+
# The entry points to ARPACK are
|
13
|
+
# - (s,d)seupd : single and double precision symmetric matrix
|
14
|
+
# - (s,d,c,z)neupd: single,double,complex,double complex general matrix
|
15
|
+
# This wrapper puts the *neupd (general matrix) interfaces in eigs()
|
16
|
+
# and the *seupd (symmetric matrix) in eigsh().
|
17
|
+
# There is no specialized interface for complex Hermitian matrices.
|
18
|
+
# To find eigenvalues of a complex Hermitian matrix you
|
19
|
+
# may use eigsh(), but eigsh() will simply call eigs()
|
20
|
+
# and return the real part of the eigenvalues thus obtained.
|
21
|
+
|
22
|
+
# Number of eigenvalues returned and complex eigenvalues
|
23
|
+
# ------------------------------------------------------
|
24
|
+
# The ARPACK nonsymmetric real and double interface (s,d)naupd return
|
25
|
+
# eigenvalues and eigenvectors in real (float,double) arrays.
|
26
|
+
# Since the eigenvalues and eigenvectors are, in general, complex
|
27
|
+
# ARPACK puts the real and imaginary parts in consecutive entries
|
28
|
+
# in real-valued arrays. This wrapper puts the real entries
|
29
|
+
# into complex data types and attempts to return the requested eigenvalues
|
30
|
+
# and eigenvectors.
|
31
|
+
|
32
|
+
|
33
|
+
# Solver modes
|
34
|
+
# ------------
|
35
|
+
# ARPACK and handle shifted and shift-inverse computations
|
36
|
+
# for eigenvalues by providing a shift (sigma) and a solver.
|
37
|
+
|
38
|
+
import numpy as np
|
39
|
+
import warnings
|
40
|
+
from scipy.sparse.linalg._interface import aslinearoperator, LinearOperator
|
41
|
+
from scipy.sparse import eye, issparse
|
42
|
+
from scipy.linalg import eig, eigh, lu_factor, lu_solve
|
43
|
+
from scipy.sparse._sputils import (
|
44
|
+
convert_pydata_sparse_to_scipy, isdense, is_pydata_spmatrix,
|
45
|
+
)
|
46
|
+
from scipy.sparse.linalg import gmres, splu
|
47
|
+
from scipy._lib._util import _aligned_zeros
|
48
|
+
from scipy._lib._threadsafety import ReentrancyLock
|
49
|
+
from . import _arpack
|
50
|
+
arpack_int = _arpack.timing.nbx.dtype
|
51
|
+
|
52
|
+
__docformat__ = "restructuredtext en"
|
53
|
+
|
54
|
+
__all__ = ['eigs', 'eigsh', 'ArpackError', 'ArpackNoConvergence']
|
55
|
+
|
56
|
+
|
57
|
+
_type_conv = {'f': 's', 'd': 'd', 'F': 'c', 'D': 'z'}
|
58
|
+
_ndigits = {'f': 5, 'd': 12, 'F': 5, 'D': 12}
|
59
|
+
|
60
|
+
DNAUPD_ERRORS = {
|
61
|
+
0: "Normal exit.",
|
62
|
+
1: "Maximum number of iterations taken. "
|
63
|
+
"All possible eigenvalues of OP has been found. IPARAM(5) "
|
64
|
+
"returns the number of wanted converged Ritz values.",
|
65
|
+
2: "No longer an informational error. Deprecated starting "
|
66
|
+
"with release 2 of ARPACK.",
|
67
|
+
3: "No shifts could be applied during a cycle of the "
|
68
|
+
"Implicitly restarted Arnoldi iteration. One possibility "
|
69
|
+
"is to increase the size of NCV relative to NEV. ",
|
70
|
+
-1: "N must be positive.",
|
71
|
+
-2: "NEV must be positive.",
|
72
|
+
-3: "NCV-NEV >= 2 and less than or equal to N.",
|
73
|
+
-4: "The maximum number of Arnoldi update iterations allowed "
|
74
|
+
"must be greater than zero.",
|
75
|
+
-5: " WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'",
|
76
|
+
-6: "BMAT must be one of 'I' or 'G'.",
|
77
|
+
-7: "Length of private work array WORKL is not sufficient.",
|
78
|
+
-8: "Error return from LAPACK eigenvalue calculation;",
|
79
|
+
-9: "Starting vector is zero.",
|
80
|
+
-10: "IPARAM(7) must be 1,2,3,4.",
|
81
|
+
-11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
|
82
|
+
-12: "IPARAM(1) must be equal to 0 or 1.",
|
83
|
+
-13: "NEV and WHICH = 'BE' are incompatible.",
|
84
|
+
-9999: "Could not build an Arnoldi factorization. "
|
85
|
+
"IPARAM(5) returns the size of the current Arnoldi "
|
86
|
+
"factorization. The user is advised to check that "
|
87
|
+
"enough workspace and array storage has been allocated."
|
88
|
+
}
|
89
|
+
|
90
|
+
SNAUPD_ERRORS = DNAUPD_ERRORS
|
91
|
+
|
92
|
+
ZNAUPD_ERRORS = DNAUPD_ERRORS.copy()
|
93
|
+
ZNAUPD_ERRORS[-10] = "IPARAM(7) must be 1,2,3."
|
94
|
+
|
95
|
+
CNAUPD_ERRORS = ZNAUPD_ERRORS
|
96
|
+
|
97
|
+
DSAUPD_ERRORS = {
|
98
|
+
0: "Normal exit.",
|
99
|
+
1: "Maximum number of iterations taken. "
|
100
|
+
"All possible eigenvalues of OP has been found.",
|
101
|
+
2: "No longer an informational error. Deprecated starting with "
|
102
|
+
"release 2 of ARPACK.",
|
103
|
+
3: "No shifts could be applied during a cycle of the Implicitly "
|
104
|
+
"restarted Arnoldi iteration. One possibility is to increase "
|
105
|
+
"the size of NCV relative to NEV. ",
|
106
|
+
-1: "N must be positive.",
|
107
|
+
-2: "NEV must be positive.",
|
108
|
+
-3: "NCV must be greater than NEV and less than or equal to N.",
|
109
|
+
-4: "The maximum number of Arnoldi update iterations allowed "
|
110
|
+
"must be greater than zero.",
|
111
|
+
-5: "WHICH must be one of 'LM', 'SM', 'LA', 'SA' or 'BE'.",
|
112
|
+
-6: "BMAT must be one of 'I' or 'G'.",
|
113
|
+
-7: "Length of private work array WORKL is not sufficient.",
|
114
|
+
-8: "Error return from trid. eigenvalue calculation; "
|
115
|
+
"Informational error from LAPACK routine dsteqr .",
|
116
|
+
-9: "Starting vector is zero.",
|
117
|
+
-10: "IPARAM(7) must be 1,2,3,4,5.",
|
118
|
+
-11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
|
119
|
+
-12: "IPARAM(1) must be equal to 0 or 1.",
|
120
|
+
-13: "NEV and WHICH = 'BE' are incompatible. ",
|
121
|
+
-9999: "Could not build an Arnoldi factorization. "
|
122
|
+
"IPARAM(5) returns the size of the current Arnoldi "
|
123
|
+
"factorization. The user is advised to check that "
|
124
|
+
"enough workspace and array storage has been allocated.",
|
125
|
+
}
|
126
|
+
|
127
|
+
SSAUPD_ERRORS = DSAUPD_ERRORS
|
128
|
+
|
129
|
+
DNEUPD_ERRORS = {
|
130
|
+
0: "Normal exit.",
|
131
|
+
1: "The Schur form computed by LAPACK routine dlahqr "
|
132
|
+
"could not be reordered by LAPACK routine dtrsen. "
|
133
|
+
"Re-enter subroutine dneupd with IPARAM(5)NCV and "
|
134
|
+
"increase the size of the arrays DR and DI to have "
|
135
|
+
"dimension at least dimension NCV and allocate at least NCV "
|
136
|
+
"columns for Z. NOTE: Not necessary if Z and V share "
|
137
|
+
"the same space. Please notify the authors if this error"
|
138
|
+
"occurs.",
|
139
|
+
-1: "N must be positive.",
|
140
|
+
-2: "NEV must be positive.",
|
141
|
+
-3: "NCV-NEV >= 2 and less than or equal to N.",
|
142
|
+
-5: "WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'",
|
143
|
+
-6: "BMAT must be one of 'I' or 'G'.",
|
144
|
+
-7: "Length of private work WORKL array is not sufficient.",
|
145
|
+
-8: "Error return from calculation of a real Schur form. "
|
146
|
+
"Informational error from LAPACK routine dlahqr .",
|
147
|
+
-9: "Error return from calculation of eigenvectors. "
|
148
|
+
"Informational error from LAPACK routine dtrevc.",
|
149
|
+
-10: "IPARAM(7) must be 1,2,3,4.",
|
150
|
+
-11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
|
151
|
+
-12: "HOWMNY = 'S' not yet implemented",
|
152
|
+
-13: "HOWMNY must be one of 'A' or 'P' if RVEC = .true.",
|
153
|
+
-14: "DNAUPD did not find any eigenvalues to sufficient "
|
154
|
+
"accuracy.",
|
155
|
+
-15: "DNEUPD got a different count of the number of converged "
|
156
|
+
"Ritz values than DNAUPD got. This indicates the user "
|
157
|
+
"probably made an error in passing data from DNAUPD to "
|
158
|
+
"DNEUPD or that the data was modified before entering "
|
159
|
+
"DNEUPD",
|
160
|
+
}
|
161
|
+
|
162
|
+
SNEUPD_ERRORS = DNEUPD_ERRORS.copy()
|
163
|
+
SNEUPD_ERRORS[1] = ("The Schur form computed by LAPACK routine slahqr "
|
164
|
+
"could not be reordered by LAPACK routine strsen . "
|
165
|
+
"Re-enter subroutine dneupd with IPARAM(5)=NCV and "
|
166
|
+
"increase the size of the arrays DR and DI to have "
|
167
|
+
"dimension at least dimension NCV and allocate at least "
|
168
|
+
"NCV columns for Z. NOTE: Not necessary if Z and V share "
|
169
|
+
"the same space. Please notify the authors if this error "
|
170
|
+
"occurs.")
|
171
|
+
SNEUPD_ERRORS[-14] = ("SNAUPD did not find any eigenvalues to sufficient "
|
172
|
+
"accuracy.")
|
173
|
+
SNEUPD_ERRORS[-15] = ("SNEUPD got a different count of the number of "
|
174
|
+
"converged Ritz values than SNAUPD got. This indicates "
|
175
|
+
"the user probably made an error in passing data from "
|
176
|
+
"SNAUPD to SNEUPD or that the data was modified before "
|
177
|
+
"entering SNEUPD")
|
178
|
+
|
179
|
+
ZNEUPD_ERRORS = {0: "Normal exit.",
|
180
|
+
1: "The Schur form computed by LAPACK routine csheqr "
|
181
|
+
"could not be reordered by LAPACK routine ztrsen. "
|
182
|
+
"Re-enter subroutine zneupd with IPARAM(5)=NCV and "
|
183
|
+
"increase the size of the array D to have "
|
184
|
+
"dimension at least dimension NCV and allocate at least "
|
185
|
+
"NCV columns for Z. NOTE: Not necessary if Z and V share "
|
186
|
+
"the same space. Please notify the authors if this error "
|
187
|
+
"occurs.",
|
188
|
+
-1: "N must be positive.",
|
189
|
+
-2: "NEV must be positive.",
|
190
|
+
-3: "NCV-NEV >= 1 and less than or equal to N.",
|
191
|
+
-5: "WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'",
|
192
|
+
-6: "BMAT must be one of 'I' or 'G'.",
|
193
|
+
-7: "Length of private work WORKL array is not sufficient.",
|
194
|
+
-8: "Error return from LAPACK eigenvalue calculation. "
|
195
|
+
"This should never happened.",
|
196
|
+
-9: "Error return from calculation of eigenvectors. "
|
197
|
+
"Informational error from LAPACK routine ztrevc.",
|
198
|
+
-10: "IPARAM(7) must be 1,2,3",
|
199
|
+
-11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
|
200
|
+
-12: "HOWMNY = 'S' not yet implemented",
|
201
|
+
-13: "HOWMNY must be one of 'A' or 'P' if RVEC = .true.",
|
202
|
+
-14: "ZNAUPD did not find any eigenvalues to sufficient "
|
203
|
+
"accuracy.",
|
204
|
+
-15: "ZNEUPD got a different count of the number of "
|
205
|
+
"converged Ritz values than ZNAUPD got. This "
|
206
|
+
"indicates the user probably made an error in passing "
|
207
|
+
"data from ZNAUPD to ZNEUPD or that the data was "
|
208
|
+
"modified before entering ZNEUPD"
|
209
|
+
}
|
210
|
+
|
211
|
+
CNEUPD_ERRORS = ZNEUPD_ERRORS.copy()
|
212
|
+
CNEUPD_ERRORS[-14] = ("CNAUPD did not find any eigenvalues to sufficient "
|
213
|
+
"accuracy.")
|
214
|
+
CNEUPD_ERRORS[-15] = ("CNEUPD got a different count of the number of "
|
215
|
+
"converged Ritz values than CNAUPD got. This indicates "
|
216
|
+
"the user probably made an error in passing data from "
|
217
|
+
"CNAUPD to CNEUPD or that the data was modified before "
|
218
|
+
"entering CNEUPD")
|
219
|
+
|
220
|
+
DSEUPD_ERRORS = {
|
221
|
+
0: "Normal exit.",
|
222
|
+
-1: "N must be positive.",
|
223
|
+
-2: "NEV must be positive.",
|
224
|
+
-3: "NCV must be greater than NEV and less than or equal to N.",
|
225
|
+
-5: "WHICH must be one of 'LM', 'SM', 'LA', 'SA' or 'BE'.",
|
226
|
+
-6: "BMAT must be one of 'I' or 'G'.",
|
227
|
+
-7: "Length of private work WORKL array is not sufficient.",
|
228
|
+
-8: ("Error return from trid. eigenvalue calculation; "
|
229
|
+
"Information error from LAPACK routine dsteqr."),
|
230
|
+
-9: "Starting vector is zero.",
|
231
|
+
-10: "IPARAM(7) must be 1,2,3,4,5.",
|
232
|
+
-11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
|
233
|
+
-12: "NEV and WHICH = 'BE' are incompatible.",
|
234
|
+
-14: "DSAUPD did not find any eigenvalues to sufficient accuracy.",
|
235
|
+
-15: "HOWMNY must be one of 'A' or 'S' if RVEC = .true.",
|
236
|
+
-16: "HOWMNY = 'S' not yet implemented",
|
237
|
+
-17: ("DSEUPD got a different count of the number of converged "
|
238
|
+
"Ritz values than DSAUPD got. This indicates the user "
|
239
|
+
"probably made an error in passing data from DSAUPD to "
|
240
|
+
"DSEUPD or that the data was modified before entering "
|
241
|
+
"DSEUPD.")
|
242
|
+
}
|
243
|
+
|
244
|
+
SSEUPD_ERRORS = DSEUPD_ERRORS.copy()
|
245
|
+
SSEUPD_ERRORS[-14] = ("SSAUPD did not find any eigenvalues "
|
246
|
+
"to sufficient accuracy.")
|
247
|
+
SSEUPD_ERRORS[-17] = ("SSEUPD got a different count of the number of "
|
248
|
+
"converged "
|
249
|
+
"Ritz values than SSAUPD got. This indicates the user "
|
250
|
+
"probably made an error in passing data from SSAUPD to "
|
251
|
+
"SSEUPD or that the data was modified before entering "
|
252
|
+
"SSEUPD.")
|
253
|
+
|
254
|
+
_SAUPD_ERRORS = {'d': DSAUPD_ERRORS,
|
255
|
+
's': SSAUPD_ERRORS}
|
256
|
+
_NAUPD_ERRORS = {'d': DNAUPD_ERRORS,
|
257
|
+
's': SNAUPD_ERRORS,
|
258
|
+
'z': ZNAUPD_ERRORS,
|
259
|
+
'c': CNAUPD_ERRORS}
|
260
|
+
_SEUPD_ERRORS = {'d': DSEUPD_ERRORS,
|
261
|
+
's': SSEUPD_ERRORS}
|
262
|
+
_NEUPD_ERRORS = {'d': DNEUPD_ERRORS,
|
263
|
+
's': SNEUPD_ERRORS,
|
264
|
+
'z': ZNEUPD_ERRORS,
|
265
|
+
'c': CNEUPD_ERRORS}
|
266
|
+
|
267
|
+
# accepted values of parameter WHICH in _SEUPD
|
268
|
+
_SEUPD_WHICH = ['LM', 'SM', 'LA', 'SA', 'BE']
|
269
|
+
|
270
|
+
# accepted values of parameter WHICH in _NAUPD
|
271
|
+
_NEUPD_WHICH = ['LM', 'SM', 'LR', 'SR', 'LI', 'SI']
|
272
|
+
|
273
|
+
|
274
|
+
class ArpackError(RuntimeError):
|
275
|
+
"""
|
276
|
+
ARPACK error
|
277
|
+
"""
|
278
|
+
|
279
|
+
def __init__(self, info, infodict=None):
|
280
|
+
if infodict is None:
|
281
|
+
infodict = _NAUPD_ERRORS
|
282
|
+
|
283
|
+
msg = infodict.get(info, "Unknown error")
|
284
|
+
super().__init__(f"ARPACK error {info}: {msg}")
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
class ArpackNoConvergence(ArpackError):
|
289
|
+
"""
|
290
|
+
ARPACK iteration did not converge
|
291
|
+
|
292
|
+
Attributes
|
293
|
+
----------
|
294
|
+
eigenvalues : ndarray
|
295
|
+
Partial result. Converged eigenvalues.
|
296
|
+
eigenvectors : ndarray
|
297
|
+
Partial result. Converged eigenvectors.
|
298
|
+
|
299
|
+
"""
|
300
|
+
|
301
|
+
def __init__(self, msg, eigenvalues, eigenvectors):
|
302
|
+
ArpackError.__init__(self, -1, {-1: msg})
|
303
|
+
self.eigenvalues = eigenvalues
|
304
|
+
self.eigenvectors = eigenvectors
|
305
|
+
|
306
|
+
|
307
|
+
def choose_ncv(k):
|
308
|
+
"""
|
309
|
+
Choose number of lanczos vectors based on target number
|
310
|
+
of singular/eigen values and vectors to compute, k.
|
311
|
+
"""
|
312
|
+
return max(2 * k + 1, 20)
|
313
|
+
|
314
|
+
|
315
|
+
class _ArpackParams:
|
316
|
+
def __init__(self, n, k, tp, mode=1, sigma=None,
|
317
|
+
ncv=None, v0=None, maxiter=None, which="LM", tol=0):
|
318
|
+
if k <= 0:
|
319
|
+
raise ValueError(f"k must be positive, k={k}")
|
320
|
+
|
321
|
+
if maxiter is None:
|
322
|
+
maxiter = n * 10
|
323
|
+
if maxiter <= 0:
|
324
|
+
raise ValueError(f"maxiter must be positive, maxiter={maxiter}")
|
325
|
+
|
326
|
+
if tp not in 'fdFD':
|
327
|
+
# Use `float64` libraries from integer dtypes.
|
328
|
+
if np.can_cast(tp, 'd'):
|
329
|
+
tp = 'd'
|
330
|
+
else:
|
331
|
+
raise ValueError("matrix type must be 'f', 'd', 'F', or 'D'")
|
332
|
+
|
333
|
+
if v0 is not None:
|
334
|
+
# ARPACK overwrites its initial resid, make a copy
|
335
|
+
self.resid = np.array(v0, copy=True)
|
336
|
+
info = 1
|
337
|
+
else:
|
338
|
+
# ARPACK will use a random initial vector.
|
339
|
+
self.resid = np.zeros(n, tp)
|
340
|
+
info = 0
|
341
|
+
|
342
|
+
if sigma is None:
|
343
|
+
#sigma not used
|
344
|
+
self.sigma = 0
|
345
|
+
else:
|
346
|
+
self.sigma = sigma
|
347
|
+
|
348
|
+
if ncv is None:
|
349
|
+
ncv = choose_ncv(k)
|
350
|
+
ncv = min(ncv, n)
|
351
|
+
|
352
|
+
self.v = np.zeros((n, ncv), tp) # holds Ritz vectors
|
353
|
+
self.iparam = np.zeros(11, arpack_int)
|
354
|
+
|
355
|
+
# set solver mode and parameters
|
356
|
+
ishfts = 1
|
357
|
+
self.mode = mode
|
358
|
+
self.iparam[0] = ishfts
|
359
|
+
self.iparam[2] = maxiter
|
360
|
+
self.iparam[3] = 1
|
361
|
+
self.iparam[6] = mode
|
362
|
+
|
363
|
+
self.n = n
|
364
|
+
self.tol = tol
|
365
|
+
self.k = k
|
366
|
+
self.maxiter = maxiter
|
367
|
+
self.ncv = ncv
|
368
|
+
self.which = which
|
369
|
+
self.tp = tp
|
370
|
+
self.info = info
|
371
|
+
|
372
|
+
self.converged = False
|
373
|
+
self.ido = 0
|
374
|
+
|
375
|
+
def _raise_no_convergence(self):
|
376
|
+
msg = "No convergence (%d iterations, %d/%d eigenvectors converged)"
|
377
|
+
k_ok = self.iparam[4]
|
378
|
+
num_iter = self.iparam[2]
|
379
|
+
try:
|
380
|
+
ev, vec = self.extract(True)
|
381
|
+
except ArpackError as err:
|
382
|
+
msg = f"{msg} [{err}]"
|
383
|
+
ev = np.zeros((0,))
|
384
|
+
vec = np.zeros((self.n, 0))
|
385
|
+
k_ok = 0
|
386
|
+
raise ArpackNoConvergence(msg % (num_iter, k_ok, self.k), ev, vec)
|
387
|
+
|
388
|
+
|
389
|
+
class _SymmetricArpackParams(_ArpackParams):
|
390
|
+
def __init__(self, n, k, tp, matvec, mode=1, M_matvec=None,
|
391
|
+
Minv_matvec=None, sigma=None,
|
392
|
+
ncv=None, v0=None, maxiter=None, which="LM", tol=0):
|
393
|
+
# The following modes are supported:
|
394
|
+
# mode = 1:
|
395
|
+
# Solve the standard eigenvalue problem:
|
396
|
+
# A*x = lambda*x :
|
397
|
+
# A - symmetric
|
398
|
+
# Arguments should be
|
399
|
+
# matvec = left multiplication by A
|
400
|
+
# M_matvec = None [not used]
|
401
|
+
# Minv_matvec = None [not used]
|
402
|
+
#
|
403
|
+
# mode = 2:
|
404
|
+
# Solve the general eigenvalue problem:
|
405
|
+
# A*x = lambda*M*x
|
406
|
+
# A - symmetric
|
407
|
+
# M - symmetric positive definite
|
408
|
+
# Arguments should be
|
409
|
+
# matvec = left multiplication by A
|
410
|
+
# M_matvec = left multiplication by M
|
411
|
+
# Minv_matvec = left multiplication by M^-1
|
412
|
+
#
|
413
|
+
# mode = 3:
|
414
|
+
# Solve the general eigenvalue problem in shift-invert mode:
|
415
|
+
# A*x = lambda*M*x
|
416
|
+
# A - symmetric
|
417
|
+
# M - symmetric positive semi-definite
|
418
|
+
# Arguments should be
|
419
|
+
# matvec = None [not used]
|
420
|
+
# M_matvec = left multiplication by M
|
421
|
+
# or None, if M is the identity
|
422
|
+
# Minv_matvec = left multiplication by [A-sigma*M]^-1
|
423
|
+
#
|
424
|
+
# mode = 4:
|
425
|
+
# Solve the general eigenvalue problem in Buckling mode:
|
426
|
+
# A*x = lambda*AG*x
|
427
|
+
# A - symmetric positive semi-definite
|
428
|
+
# AG - symmetric indefinite
|
429
|
+
# Arguments should be
|
430
|
+
# matvec = left multiplication by A
|
431
|
+
# M_matvec = None [not used]
|
432
|
+
# Minv_matvec = left multiplication by [A-sigma*AG]^-1
|
433
|
+
#
|
434
|
+
# mode = 5:
|
435
|
+
# Solve the general eigenvalue problem in Cayley-transformed mode:
|
436
|
+
# A*x = lambda*M*x
|
437
|
+
# A - symmetric
|
438
|
+
# M - symmetric positive semi-definite
|
439
|
+
# Arguments should be
|
440
|
+
# matvec = left multiplication by A
|
441
|
+
# M_matvec = left multiplication by M
|
442
|
+
# or None, if M is the identity
|
443
|
+
# Minv_matvec = left multiplication by [A-sigma*M]^-1
|
444
|
+
if mode == 1:
|
445
|
+
if matvec is None:
|
446
|
+
raise ValueError("matvec must be specified for mode=1")
|
447
|
+
if M_matvec is not None:
|
448
|
+
raise ValueError("M_matvec cannot be specified for mode=1")
|
449
|
+
if Minv_matvec is not None:
|
450
|
+
raise ValueError("Minv_matvec cannot be specified for mode=1")
|
451
|
+
|
452
|
+
self.OP = matvec
|
453
|
+
self.B = lambda x: x
|
454
|
+
self.bmat = 'I'
|
455
|
+
elif mode == 2:
|
456
|
+
if matvec is None:
|
457
|
+
raise ValueError("matvec must be specified for mode=2")
|
458
|
+
if M_matvec is None:
|
459
|
+
raise ValueError("M_matvec must be specified for mode=2")
|
460
|
+
if Minv_matvec is None:
|
461
|
+
raise ValueError("Minv_matvec must be specified for mode=2")
|
462
|
+
|
463
|
+
self.OP = lambda x: Minv_matvec(matvec(x))
|
464
|
+
self.OPa = Minv_matvec
|
465
|
+
self.OPb = matvec
|
466
|
+
self.B = M_matvec
|
467
|
+
self.bmat = 'G'
|
468
|
+
elif mode == 3:
|
469
|
+
if matvec is not None:
|
470
|
+
raise ValueError("matvec must not be specified for mode=3")
|
471
|
+
if Minv_matvec is None:
|
472
|
+
raise ValueError("Minv_matvec must be specified for mode=3")
|
473
|
+
|
474
|
+
if M_matvec is None:
|
475
|
+
self.OP = Minv_matvec
|
476
|
+
self.OPa = Minv_matvec
|
477
|
+
self.B = lambda x: x
|
478
|
+
self.bmat = 'I'
|
479
|
+
else:
|
480
|
+
self.OP = lambda x: Minv_matvec(M_matvec(x))
|
481
|
+
self.OPa = Minv_matvec
|
482
|
+
self.B = M_matvec
|
483
|
+
self.bmat = 'G'
|
484
|
+
elif mode == 4:
|
485
|
+
if matvec is None:
|
486
|
+
raise ValueError("matvec must be specified for mode=4")
|
487
|
+
if M_matvec is not None:
|
488
|
+
raise ValueError("M_matvec must not be specified for mode=4")
|
489
|
+
if Minv_matvec is None:
|
490
|
+
raise ValueError("Minv_matvec must be specified for mode=4")
|
491
|
+
self.OPa = Minv_matvec
|
492
|
+
self.OP = lambda x: self.OPa(matvec(x))
|
493
|
+
self.B = matvec
|
494
|
+
self.bmat = 'G'
|
495
|
+
elif mode == 5:
|
496
|
+
if matvec is None:
|
497
|
+
raise ValueError("matvec must be specified for mode=5")
|
498
|
+
if Minv_matvec is None:
|
499
|
+
raise ValueError("Minv_matvec must be specified for mode=5")
|
500
|
+
|
501
|
+
self.OPa = Minv_matvec
|
502
|
+
self.A_matvec = matvec
|
503
|
+
|
504
|
+
if M_matvec is None:
|
505
|
+
self.OP = lambda x: Minv_matvec(matvec(x) + sigma * x)
|
506
|
+
self.B = lambda x: x
|
507
|
+
self.bmat = 'I'
|
508
|
+
else:
|
509
|
+
self.OP = lambda x: Minv_matvec(matvec(x)
|
510
|
+
+ sigma * M_matvec(x))
|
511
|
+
self.B = M_matvec
|
512
|
+
self.bmat = 'G'
|
513
|
+
else:
|
514
|
+
raise ValueError(f"mode={mode} not implemented")
|
515
|
+
|
516
|
+
if which not in _SEUPD_WHICH:
|
517
|
+
raise ValueError(f"which must be one of {' '.join(_SEUPD_WHICH)}")
|
518
|
+
if k >= n:
|
519
|
+
raise ValueError(f"k must be less than ndim(A), k={k}")
|
520
|
+
|
521
|
+
_ArpackParams.__init__(self, n, k, tp, mode, sigma,
|
522
|
+
ncv, v0, maxiter, which, tol)
|
523
|
+
|
524
|
+
if self.ncv > n or self.ncv <= k:
|
525
|
+
raise ValueError(f"ncv must be k<ncv<=n, ncv={self.ncv}")
|
526
|
+
|
527
|
+
# Use _aligned_zeros to work around a f2py bug in Numpy 1.9.1
|
528
|
+
self.workd = _aligned_zeros(3 * n, self.tp)
|
529
|
+
self.workl = _aligned_zeros(self.ncv * (self.ncv + 8), self.tp)
|
530
|
+
|
531
|
+
ltr = _type_conv[self.tp]
|
532
|
+
if ltr not in ["s", "d"]:
|
533
|
+
raise ValueError("Input matrix is not real-valued.")
|
534
|
+
|
535
|
+
self._arpack_solver = _arpack.__dict__[ltr + 'saupd']
|
536
|
+
self._arpack_extract = _arpack.__dict__[ltr + 'seupd']
|
537
|
+
|
538
|
+
self.iterate_infodict = _SAUPD_ERRORS[ltr]
|
539
|
+
self.extract_infodict = _SEUPD_ERRORS[ltr]
|
540
|
+
|
541
|
+
self.ipntr = np.zeros(11, arpack_int)
|
542
|
+
|
543
|
+
def iterate(self):
|
544
|
+
self.ido, self.tol, self.resid, self.v, self.iparam, self.ipntr, self.info = \
|
545
|
+
self._arpack_solver(self.ido, self.bmat, self.which, self.k,
|
546
|
+
self.tol, self.resid, self.v, self.iparam,
|
547
|
+
self.ipntr, self.workd, self.workl, self.info)
|
548
|
+
|
549
|
+
xslice = slice(self.ipntr[0] - 1, self.ipntr[0] - 1 + self.n)
|
550
|
+
yslice = slice(self.ipntr[1] - 1, self.ipntr[1] - 1 + self.n)
|
551
|
+
if self.ido == -1:
|
552
|
+
# initialization
|
553
|
+
self.workd[yslice] = self.OP(self.workd[xslice])
|
554
|
+
elif self.ido == 1:
|
555
|
+
# compute y = Op*x
|
556
|
+
if self.mode == 1:
|
557
|
+
self.workd[yslice] = self.OP(self.workd[xslice])
|
558
|
+
elif self.mode == 2:
|
559
|
+
self.workd[xslice] = self.OPb(self.workd[xslice])
|
560
|
+
self.workd[yslice] = self.OPa(self.workd[xslice])
|
561
|
+
elif self.mode == 5:
|
562
|
+
Bxslice = slice(self.ipntr[2] - 1, self.ipntr[2] - 1 + self.n)
|
563
|
+
Ax = self.A_matvec(self.workd[xslice])
|
564
|
+
self.workd[yslice] = self.OPa(Ax + (self.sigma *
|
565
|
+
self.workd[Bxslice]))
|
566
|
+
else:
|
567
|
+
Bxslice = slice(self.ipntr[2] - 1, self.ipntr[2] - 1 + self.n)
|
568
|
+
self.workd[yslice] = self.OPa(self.workd[Bxslice])
|
569
|
+
elif self.ido == 2:
|
570
|
+
self.workd[yslice] = self.B(self.workd[xslice])
|
571
|
+
elif self.ido == 3:
|
572
|
+
raise ValueError("ARPACK requested user shifts. Assure ISHIFT==0")
|
573
|
+
else:
|
574
|
+
self.converged = True
|
575
|
+
|
576
|
+
if self.info == 0:
|
577
|
+
pass
|
578
|
+
elif self.info == 1:
|
579
|
+
self._raise_no_convergence()
|
580
|
+
else:
|
581
|
+
raise ArpackError(self.info, infodict=self.iterate_infodict)
|
582
|
+
|
583
|
+
def extract(self, return_eigenvectors):
|
584
|
+
rvec = return_eigenvectors
|
585
|
+
ierr = 0
|
586
|
+
howmny = 'A' # return all eigenvectors
|
587
|
+
sselect = np.zeros(self.ncv, 'int') # unused
|
588
|
+
d, z, ierr = self._arpack_extract(rvec, howmny, sselect, self.sigma,
|
589
|
+
self.bmat, self.which, self.k,
|
590
|
+
self.tol, self.resid, self.v,
|
591
|
+
self.iparam[0:7], self.ipntr,
|
592
|
+
self.workd[0:2 * self.n],
|
593
|
+
self.workl, ierr)
|
594
|
+
if ierr != 0:
|
595
|
+
raise ArpackError(ierr, infodict=self.extract_infodict)
|
596
|
+
k_ok = self.iparam[4]
|
597
|
+
d = d[:k_ok]
|
598
|
+
z = z[:, :k_ok]
|
599
|
+
|
600
|
+
if return_eigenvectors:
|
601
|
+
return d, z
|
602
|
+
else:
|
603
|
+
return d
|
604
|
+
|
605
|
+
|
606
|
+
class _UnsymmetricArpackParams(_ArpackParams):
|
607
|
+
def __init__(self, n, k, tp, matvec, mode=1, M_matvec=None,
|
608
|
+
Minv_matvec=None, sigma=None,
|
609
|
+
ncv=None, v0=None, maxiter=None, which="LM", tol=0):
|
610
|
+
# The following modes are supported:
|
611
|
+
# mode = 1:
|
612
|
+
# Solve the standard eigenvalue problem:
|
613
|
+
# A*x = lambda*x
|
614
|
+
# A - square matrix
|
615
|
+
# Arguments should be
|
616
|
+
# matvec = left multiplication by A
|
617
|
+
# M_matvec = None [not used]
|
618
|
+
# Minv_matvec = None [not used]
|
619
|
+
#
|
620
|
+
# mode = 2:
|
621
|
+
# Solve the generalized eigenvalue problem:
|
622
|
+
# A*x = lambda*M*x
|
623
|
+
# A - square matrix
|
624
|
+
# M - symmetric, positive semi-definite
|
625
|
+
# Arguments should be
|
626
|
+
# matvec = left multiplication by A
|
627
|
+
# M_matvec = left multiplication by M
|
628
|
+
# Minv_matvec = left multiplication by M^-1
|
629
|
+
#
|
630
|
+
# mode = 3,4:
|
631
|
+
# Solve the general eigenvalue problem in shift-invert mode:
|
632
|
+
# A*x = lambda*M*x
|
633
|
+
# A - square matrix
|
634
|
+
# M - symmetric, positive semi-definite
|
635
|
+
# Arguments should be
|
636
|
+
# matvec = None [not used]
|
637
|
+
# M_matvec = left multiplication by M
|
638
|
+
# or None, if M is the identity
|
639
|
+
# Minv_matvec = left multiplication by [A-sigma*M]^-1
|
640
|
+
# if A is real and mode==3, use the real part of Minv_matvec
|
641
|
+
# if A is real and mode==4, use the imag part of Minv_matvec
|
642
|
+
# if A is complex and mode==3,
|
643
|
+
# use real and imag parts of Minv_matvec
|
644
|
+
if mode == 1:
|
645
|
+
if matvec is None:
|
646
|
+
raise ValueError("matvec must be specified for mode=1")
|
647
|
+
if M_matvec is not None:
|
648
|
+
raise ValueError("M_matvec cannot be specified for mode=1")
|
649
|
+
if Minv_matvec is not None:
|
650
|
+
raise ValueError("Minv_matvec cannot be specified for mode=1")
|
651
|
+
|
652
|
+
self.OP = matvec
|
653
|
+
self.B = lambda x: x
|
654
|
+
self.bmat = 'I'
|
655
|
+
elif mode == 2:
|
656
|
+
if matvec is None:
|
657
|
+
raise ValueError("matvec must be specified for mode=2")
|
658
|
+
if M_matvec is None:
|
659
|
+
raise ValueError("M_matvec must be specified for mode=2")
|
660
|
+
if Minv_matvec is None:
|
661
|
+
raise ValueError("Minv_matvec must be specified for mode=2")
|
662
|
+
|
663
|
+
self.OP = lambda x: Minv_matvec(matvec(x))
|
664
|
+
self.OPa = Minv_matvec
|
665
|
+
self.OPb = matvec
|
666
|
+
self.B = M_matvec
|
667
|
+
self.bmat = 'G'
|
668
|
+
elif mode in (3, 4):
|
669
|
+
if matvec is None:
|
670
|
+
raise ValueError("matvec must be specified "
|
671
|
+
"for mode in (3,4)")
|
672
|
+
if Minv_matvec is None:
|
673
|
+
raise ValueError("Minv_matvec must be specified "
|
674
|
+
"for mode in (3,4)")
|
675
|
+
|
676
|
+
self.matvec = matvec
|
677
|
+
if tp in 'DF': # complex type
|
678
|
+
if mode == 3:
|
679
|
+
self.OPa = Minv_matvec
|
680
|
+
else:
|
681
|
+
raise ValueError("mode=4 invalid for complex A")
|
682
|
+
else: # real type
|
683
|
+
if mode == 3:
|
684
|
+
self.OPa = lambda x: np.real(Minv_matvec(x))
|
685
|
+
else:
|
686
|
+
self.OPa = lambda x: np.imag(Minv_matvec(x))
|
687
|
+
if M_matvec is None:
|
688
|
+
self.B = lambda x: x
|
689
|
+
self.bmat = 'I'
|
690
|
+
self.OP = self.OPa
|
691
|
+
else:
|
692
|
+
self.B = M_matvec
|
693
|
+
self.bmat = 'G'
|
694
|
+
self.OP = lambda x: self.OPa(M_matvec(x))
|
695
|
+
else:
|
696
|
+
raise ValueError(f"mode={mode} not implemented")
|
697
|
+
|
698
|
+
if which not in _NEUPD_WHICH:
|
699
|
+
raise ValueError(f"Parameter which must be one of {' '.join(_NEUPD_WHICH)}")
|
700
|
+
if k >= n - 1:
|
701
|
+
raise ValueError(f"k must be less than ndim(A)-1, k={k}")
|
702
|
+
|
703
|
+
_ArpackParams.__init__(self, n, k, tp, mode, sigma,
|
704
|
+
ncv, v0, maxiter, which, tol)
|
705
|
+
|
706
|
+
if self.ncv > n or self.ncv <= k + 1:
|
707
|
+
raise ValueError(f"ncv must be k+1<ncv<=n, ncv={self.ncv}")
|
708
|
+
|
709
|
+
# Use _aligned_zeros to work around a f2py bug in Numpy 1.9.1
|
710
|
+
self.workd = _aligned_zeros(3 * n, self.tp)
|
711
|
+
self.workl = _aligned_zeros(3 * self.ncv * (self.ncv + 2), self.tp)
|
712
|
+
|
713
|
+
ltr = _type_conv[self.tp]
|
714
|
+
self._arpack_solver = _arpack.__dict__[ltr + 'naupd']
|
715
|
+
self._arpack_extract = _arpack.__dict__[ltr + 'neupd']
|
716
|
+
|
717
|
+
self.iterate_infodict = _NAUPD_ERRORS[ltr]
|
718
|
+
self.extract_infodict = _NEUPD_ERRORS[ltr]
|
719
|
+
|
720
|
+
self.ipntr = np.zeros(14, arpack_int)
|
721
|
+
|
722
|
+
if self.tp in 'FD':
|
723
|
+
# Use _aligned_zeros to work around a f2py bug in Numpy 1.9.1
|
724
|
+
self.rwork = _aligned_zeros(self.ncv, self.tp.lower())
|
725
|
+
else:
|
726
|
+
self.rwork = None
|
727
|
+
|
728
|
+
def iterate(self):
|
729
|
+
if self.tp in 'fd':
|
730
|
+
results = self._arpack_solver(self.ido, self.bmat, self.which, self.k,
|
731
|
+
self.tol, self.resid, self.v, self.iparam,
|
732
|
+
self.ipntr, self.workd, self.workl, self.info)
|
733
|
+
self.ido, self.tol, self.resid, self.v, \
|
734
|
+
self.iparam, self.ipntr, self.info = results
|
735
|
+
|
736
|
+
else:
|
737
|
+
results = self._arpack_solver(self.ido, self.bmat, self.which, self.k,
|
738
|
+
self.tol, self.resid, self.v, self.iparam,
|
739
|
+
self.ipntr, self.workd, self.workl,
|
740
|
+
self.rwork, self.info)
|
741
|
+
self.ido, self.tol, self.resid, self.v, \
|
742
|
+
self.iparam, self.ipntr, self.info = results
|
743
|
+
|
744
|
+
|
745
|
+
xslice = slice(self.ipntr[0] - 1, self.ipntr[0] - 1 + self.n)
|
746
|
+
yslice = slice(self.ipntr[1] - 1, self.ipntr[1] - 1 + self.n)
|
747
|
+
if self.ido == -1:
|
748
|
+
# initialization
|
749
|
+
self.workd[yslice] = self.OP(self.workd[xslice])
|
750
|
+
elif self.ido == 1:
|
751
|
+
# compute y = Op*x
|
752
|
+
if self.mode in (1, 2):
|
753
|
+
self.workd[yslice] = self.OP(self.workd[xslice])
|
754
|
+
else:
|
755
|
+
Bxslice = slice(self.ipntr[2] - 1, self.ipntr[2] - 1 + self.n)
|
756
|
+
self.workd[yslice] = self.OPa(self.workd[Bxslice])
|
757
|
+
elif self.ido == 2:
|
758
|
+
self.workd[yslice] = self.B(self.workd[xslice])
|
759
|
+
elif self.ido == 3:
|
760
|
+
raise ValueError("ARPACK requested user shifts. Assure ISHIFT==0")
|
761
|
+
else:
|
762
|
+
self.converged = True
|
763
|
+
|
764
|
+
if self.info == 0:
|
765
|
+
pass
|
766
|
+
elif self.info == 1:
|
767
|
+
self._raise_no_convergence()
|
768
|
+
else:
|
769
|
+
raise ArpackError(self.info, infodict=self.iterate_infodict)
|
770
|
+
|
771
|
+
def extract(self, return_eigenvectors):
|
772
|
+
k, n = self.k, self.n
|
773
|
+
|
774
|
+
ierr = 0
|
775
|
+
howmny = 'A' # return all eigenvectors
|
776
|
+
sselect = np.zeros(self.ncv, 'int') # unused
|
777
|
+
sigmar = np.real(self.sigma)
|
778
|
+
sigmai = np.imag(self.sigma)
|
779
|
+
workev = np.zeros(3 * self.ncv, self.tp)
|
780
|
+
|
781
|
+
if self.tp in 'fd':
|
782
|
+
dr = np.zeros(k + 1, self.tp)
|
783
|
+
di = np.zeros(k + 1, self.tp)
|
784
|
+
zr = np.zeros((n, k + 1), self.tp)
|
785
|
+
dr, di, zr, ierr = \
|
786
|
+
self._arpack_extract(return_eigenvectors,
|
787
|
+
howmny, sselect, sigmar, sigmai, workev,
|
788
|
+
self.bmat, self.which, k, self.tol, self.resid,
|
789
|
+
self.v, self.iparam, self.ipntr,
|
790
|
+
self.workd, self.workl, self.info)
|
791
|
+
if ierr != 0:
|
792
|
+
raise ArpackError(ierr, infodict=self.extract_infodict)
|
793
|
+
nreturned = self.iparam[4] # number of good eigenvalues returned
|
794
|
+
|
795
|
+
# Build complex eigenvalues from real and imaginary parts
|
796
|
+
d = dr + 1.0j * di
|
797
|
+
|
798
|
+
# Arrange the eigenvectors: complex eigenvectors are stored as
|
799
|
+
# real,imaginary in consecutive columns
|
800
|
+
z = zr.astype(self.tp.upper())
|
801
|
+
|
802
|
+
# The ARPACK nonsymmetric real and double interface (s,d)naupd
|
803
|
+
# return eigenvalues and eigenvectors in real (float,double)
|
804
|
+
# arrays.
|
805
|
+
|
806
|
+
# Efficiency: this should check that return_eigenvectors == True
|
807
|
+
# before going through this construction.
|
808
|
+
if sigmai == 0:
|
809
|
+
i = 0
|
810
|
+
while i <= k:
|
811
|
+
# check if complex
|
812
|
+
if abs(d[i].imag) != 0:
|
813
|
+
# this is a complex conjugate pair with eigenvalues
|
814
|
+
# in consecutive columns
|
815
|
+
if i < k:
|
816
|
+
z[:, i] = zr[:, i] + 1.0j * zr[:, i + 1]
|
817
|
+
z[:, i + 1] = z[:, i].conjugate()
|
818
|
+
i += 1
|
819
|
+
else:
|
820
|
+
#last eigenvalue is complex: the imaginary part of
|
821
|
+
# the eigenvector has not been returned
|
822
|
+
#this can only happen if nreturned > k, so we'll
|
823
|
+
# throw out this case.
|
824
|
+
nreturned -= 1
|
825
|
+
i += 1
|
826
|
+
|
827
|
+
else:
|
828
|
+
# real matrix, mode 3 or 4, imag(sigma) is nonzero:
|
829
|
+
# see remark 3 in <s,d>neupd.f
|
830
|
+
# Build complex eigenvalues from real and imaginary parts
|
831
|
+
i = 0
|
832
|
+
while i <= k:
|
833
|
+
if abs(d[i].imag) == 0:
|
834
|
+
d[i] = np.dot(zr[:, i], self.matvec(zr[:, i]))
|
835
|
+
else:
|
836
|
+
if i < k:
|
837
|
+
z[:, i] = zr[:, i] + 1.0j * zr[:, i + 1]
|
838
|
+
z[:, i + 1] = z[:, i].conjugate()
|
839
|
+
d[i] = ((np.dot(zr[:, i],
|
840
|
+
self.matvec(zr[:, i]))
|
841
|
+
+ np.dot(zr[:, i + 1],
|
842
|
+
self.matvec(zr[:, i + 1])))
|
843
|
+
+ 1j * (np.dot(zr[:, i],
|
844
|
+
self.matvec(zr[:, i + 1]))
|
845
|
+
- np.dot(zr[:, i + 1],
|
846
|
+
self.matvec(zr[:, i]))))
|
847
|
+
d[i + 1] = d[i].conj()
|
848
|
+
i += 1
|
849
|
+
else:
|
850
|
+
#last eigenvalue is complex: the imaginary part of
|
851
|
+
# the eigenvector has not been returned
|
852
|
+
#this can only happen if nreturned > k, so we'll
|
853
|
+
# throw out this case.
|
854
|
+
nreturned -= 1
|
855
|
+
i += 1
|
856
|
+
|
857
|
+
# Now we have k+1 possible eigenvalues and eigenvectors
|
858
|
+
# Return the ones specified by the keyword "which"
|
859
|
+
|
860
|
+
if nreturned <= k:
|
861
|
+
# we got less or equal as many eigenvalues we wanted
|
862
|
+
d = d[:nreturned]
|
863
|
+
z = z[:, :nreturned]
|
864
|
+
else:
|
865
|
+
# we got one extra eigenvalue (likely a cc pair, but which?)
|
866
|
+
if self.mode in (1, 2):
|
867
|
+
rd = d
|
868
|
+
elif self.mode in (3, 4):
|
869
|
+
rd = 1 / (d - self.sigma)
|
870
|
+
|
871
|
+
if self.which in ['LR', 'SR']:
|
872
|
+
ind = np.argsort(rd.real)
|
873
|
+
elif self.which in ['LI', 'SI']:
|
874
|
+
# for LI,SI ARPACK returns largest,smallest
|
875
|
+
# abs(imaginary) (complex pairs come together)
|
876
|
+
ind = np.argsort(abs(rd.imag))
|
877
|
+
else:
|
878
|
+
ind = np.argsort(abs(rd))
|
879
|
+
|
880
|
+
if self.which in ['LR', 'LM', 'LI']:
|
881
|
+
ind = ind[-k:][::-1]
|
882
|
+
elif self.which in ['SR', 'SM', 'SI']:
|
883
|
+
ind = ind[:k]
|
884
|
+
|
885
|
+
d = d[ind]
|
886
|
+
z = z[:, ind]
|
887
|
+
else:
|
888
|
+
# complex is so much simpler...
|
889
|
+
d, z, ierr =\
|
890
|
+
self._arpack_extract(return_eigenvectors,
|
891
|
+
howmny, sselect, self.sigma, workev,
|
892
|
+
self.bmat, self.which, k, self.tol, self.resid,
|
893
|
+
self.v, self.iparam, self.ipntr,
|
894
|
+
self.workd, self.workl, self.rwork, ierr)
|
895
|
+
|
896
|
+
if ierr != 0:
|
897
|
+
raise ArpackError(ierr, infodict=self.extract_infodict)
|
898
|
+
|
899
|
+
k_ok = self.iparam[4]
|
900
|
+
d = d[:k_ok]
|
901
|
+
z = z[:, :k_ok]
|
902
|
+
|
903
|
+
if return_eigenvectors:
|
904
|
+
return d, z
|
905
|
+
else:
|
906
|
+
return d
|
907
|
+
|
908
|
+
class SpLuInv(LinearOperator):
|
909
|
+
"""
|
910
|
+
SpLuInv:
|
911
|
+
helper class to repeatedly solve M*x=b
|
912
|
+
using a sparse LU-decomposition of M
|
913
|
+
"""
|
914
|
+
|
915
|
+
def __init__(self, M):
|
916
|
+
self.M_lu = splu(M)
|
917
|
+
self.shape = M.shape
|
918
|
+
self.dtype = M.dtype
|
919
|
+
self.isreal = not np.issubdtype(self.dtype, np.complexfloating)
|
920
|
+
|
921
|
+
def _matvec(self, x):
|
922
|
+
# careful here: splu.solve will throw away imaginary
|
923
|
+
# part of x if M is real
|
924
|
+
x = np.asarray(x)
|
925
|
+
if self.isreal and np.issubdtype(x.dtype, np.complexfloating):
|
926
|
+
return (self.M_lu.solve(np.real(x).astype(self.dtype))
|
927
|
+
+ 1j * self.M_lu.solve(np.imag(x).astype(self.dtype)))
|
928
|
+
else:
|
929
|
+
return self.M_lu.solve(x.astype(self.dtype))
|
930
|
+
|
931
|
+
|
932
|
+
class LuInv(LinearOperator):
|
933
|
+
"""
|
934
|
+
LuInv:
|
935
|
+
helper class to repeatedly solve M*x=b
|
936
|
+
using an LU-decomposition of M
|
937
|
+
"""
|
938
|
+
|
939
|
+
def __init__(self, M):
|
940
|
+
self.M_lu = lu_factor(M)
|
941
|
+
self.shape = M.shape
|
942
|
+
self.dtype = M.dtype
|
943
|
+
|
944
|
+
def _matvec(self, x):
|
945
|
+
return lu_solve(self.M_lu, x)
|
946
|
+
|
947
|
+
|
948
|
+
def gmres_loose(A, b, tol):
|
949
|
+
"""
|
950
|
+
gmres with looser termination condition.
|
951
|
+
"""
|
952
|
+
b = np.asarray(b)
|
953
|
+
min_tol = 1000 * np.sqrt(b.size) * np.finfo(b.dtype).eps
|
954
|
+
return gmres(A, b, rtol=max(tol, min_tol), atol=0)
|
955
|
+
|
956
|
+
|
957
|
+
class IterInv(LinearOperator):
|
958
|
+
"""
|
959
|
+
IterInv:
|
960
|
+
helper class to repeatedly solve M*x=b
|
961
|
+
using an iterative method.
|
962
|
+
"""
|
963
|
+
|
964
|
+
def __init__(self, M, ifunc=gmres_loose, tol=0):
|
965
|
+
self.M = M
|
966
|
+
if hasattr(M, 'dtype'):
|
967
|
+
self.dtype = M.dtype
|
968
|
+
else:
|
969
|
+
x = np.zeros(M.shape[1])
|
970
|
+
self.dtype = (M * x).dtype
|
971
|
+
self.shape = M.shape
|
972
|
+
|
973
|
+
if tol <= 0:
|
974
|
+
# when tol=0, ARPACK uses machine tolerance as calculated
|
975
|
+
# by LAPACK's _LAMCH function. We should match this
|
976
|
+
tol = 2 * np.finfo(self.dtype).eps
|
977
|
+
self.ifunc = ifunc
|
978
|
+
self.tol = tol
|
979
|
+
|
980
|
+
def _matvec(self, x):
|
981
|
+
b, info = self.ifunc(self.M, x, tol=self.tol)
|
982
|
+
if info != 0:
|
983
|
+
raise ValueError(
|
984
|
+
f"Error in inverting M: function {self.ifunc.__name__} "
|
985
|
+
f"did not converge (info = {info})."
|
986
|
+
)
|
987
|
+
return b
|
988
|
+
|
989
|
+
|
990
|
+
class IterOpInv(LinearOperator):
|
991
|
+
"""
|
992
|
+
IterOpInv:
|
993
|
+
helper class to repeatedly solve [A-sigma*M]*x = b
|
994
|
+
using an iterative method
|
995
|
+
"""
|
996
|
+
|
997
|
+
def __init__(self, A, M, sigma, ifunc=gmres_loose, tol=0):
|
998
|
+
self.A = A
|
999
|
+
self.M = M
|
1000
|
+
self.sigma = sigma
|
1001
|
+
|
1002
|
+
def mult_func(x):
|
1003
|
+
return A.matvec(x) - sigma * M.matvec(x)
|
1004
|
+
|
1005
|
+
def mult_func_M_None(x):
|
1006
|
+
return A.matvec(x) - sigma * x
|
1007
|
+
|
1008
|
+
x = np.zeros(A.shape[1])
|
1009
|
+
if M is None:
|
1010
|
+
dtype = mult_func_M_None(x).dtype
|
1011
|
+
self.OP = LinearOperator(self.A.shape,
|
1012
|
+
mult_func_M_None,
|
1013
|
+
dtype=dtype)
|
1014
|
+
else:
|
1015
|
+
dtype = mult_func(x).dtype
|
1016
|
+
self.OP = LinearOperator(self.A.shape,
|
1017
|
+
mult_func,
|
1018
|
+
dtype=dtype)
|
1019
|
+
self.shape = A.shape
|
1020
|
+
|
1021
|
+
if tol <= 0:
|
1022
|
+
# when tol=0, ARPACK uses machine tolerance as calculated
|
1023
|
+
# by LAPACK's _LAMCH function. We should match this
|
1024
|
+
tol = 2 * np.finfo(self.OP.dtype).eps
|
1025
|
+
self.ifunc = ifunc
|
1026
|
+
self.tol = tol
|
1027
|
+
|
1028
|
+
def _matvec(self, x):
|
1029
|
+
b, info = self.ifunc(self.OP, x, tol=self.tol)
|
1030
|
+
if info != 0:
|
1031
|
+
raise ValueError(
|
1032
|
+
f"Error in inverting [A-sigma*M]: function {self.ifunc.__name__} "
|
1033
|
+
f"did not converge (info = {info})."
|
1034
|
+
)
|
1035
|
+
return b
|
1036
|
+
|
1037
|
+
@property
|
1038
|
+
def dtype(self):
|
1039
|
+
return self.OP.dtype
|
1040
|
+
|
1041
|
+
|
1042
|
+
def _fast_spmatrix_to_csc(A, hermitian=False):
|
1043
|
+
"""Convert sparse matrix to CSC (by transposing, if possible)"""
|
1044
|
+
if (A.format == "csr" and hermitian
|
1045
|
+
and not np.issubdtype(A.dtype, np.complexfloating)):
|
1046
|
+
return A.T
|
1047
|
+
elif is_pydata_spmatrix(A):
|
1048
|
+
# No need to convert
|
1049
|
+
return A
|
1050
|
+
else:
|
1051
|
+
return A.tocsc()
|
1052
|
+
|
1053
|
+
|
1054
|
+
def get_inv_matvec(M, hermitian=False, tol=0):
|
1055
|
+
if isdense(M):
|
1056
|
+
return LuInv(M).matvec
|
1057
|
+
elif issparse(M) or is_pydata_spmatrix(M):
|
1058
|
+
M = _fast_spmatrix_to_csc(M, hermitian=hermitian)
|
1059
|
+
return SpLuInv(M).matvec
|
1060
|
+
else:
|
1061
|
+
return IterInv(M, tol=tol).matvec
|
1062
|
+
|
1063
|
+
|
1064
|
+
def get_OPinv_matvec(A, M, sigma, hermitian=False, tol=0):
|
1065
|
+
if sigma == 0:
|
1066
|
+
return get_inv_matvec(A, hermitian=hermitian, tol=tol)
|
1067
|
+
|
1068
|
+
if M is None:
|
1069
|
+
#M is the identity matrix
|
1070
|
+
if isdense(A):
|
1071
|
+
if (np.issubdtype(A.dtype, np.complexfloating)
|
1072
|
+
or np.imag(sigma) == 0):
|
1073
|
+
A = np.copy(A)
|
1074
|
+
else:
|
1075
|
+
A = A + 0j
|
1076
|
+
A.flat[::A.shape[1] + 1] -= sigma
|
1077
|
+
return LuInv(A).matvec
|
1078
|
+
elif issparse(A) or is_pydata_spmatrix(A):
|
1079
|
+
A = A - sigma * eye(A.shape[0])
|
1080
|
+
A = _fast_spmatrix_to_csc(A, hermitian=hermitian)
|
1081
|
+
return SpLuInv(A).matvec
|
1082
|
+
else:
|
1083
|
+
return IterOpInv(aslinearoperator(A),
|
1084
|
+
M, sigma, tol=tol).matvec
|
1085
|
+
else:
|
1086
|
+
if ((not isdense(A) and not issparse(A) and not is_pydata_spmatrix(A)) or
|
1087
|
+
(not isdense(M) and not issparse(M) and not is_pydata_spmatrix(A))):
|
1088
|
+
return IterOpInv(aslinearoperator(A),
|
1089
|
+
aslinearoperator(M),
|
1090
|
+
sigma, tol=tol).matvec
|
1091
|
+
elif isdense(A) or isdense(M):
|
1092
|
+
return LuInv(A - sigma * M).matvec
|
1093
|
+
else:
|
1094
|
+
OP = A - sigma * M
|
1095
|
+
OP = _fast_spmatrix_to_csc(OP, hermitian=hermitian)
|
1096
|
+
return SpLuInv(OP).matvec
|
1097
|
+
|
1098
|
+
|
1099
|
+
# ARPACK is not threadsafe or reentrant (SAVE variables), so we need a
|
1100
|
+
# lock and a re-entering check.
|
1101
|
+
_ARPACK_LOCK = ReentrancyLock("Nested calls to eigs/eighs not allowed: "
|
1102
|
+
"ARPACK is not re-entrant")
|
1103
|
+
|
1104
|
+
|
1105
|
+
def eigs(A, k=6, M=None, sigma=None, which='LM', v0=None,
|
1106
|
+
ncv=None, maxiter=None, tol=0, return_eigenvectors=True,
|
1107
|
+
Minv=None, OPinv=None, OPpart=None):
|
1108
|
+
"""
|
1109
|
+
Find k eigenvalues and eigenvectors of the square matrix A.
|
1110
|
+
|
1111
|
+
Solves ``A @ x[i] = w[i] * x[i]``, the standard eigenvalue problem
|
1112
|
+
for w[i] eigenvalues with corresponding eigenvectors x[i].
|
1113
|
+
|
1114
|
+
If M is specified, solves ``A @ x[i] = w[i] * M @ x[i]``, the
|
1115
|
+
generalized eigenvalue problem for w[i] eigenvalues
|
1116
|
+
with corresponding eigenvectors x[i]
|
1117
|
+
|
1118
|
+
Parameters
|
1119
|
+
----------
|
1120
|
+
A : ndarray, sparse matrix or LinearOperator
|
1121
|
+
An array, sparse matrix, or LinearOperator representing
|
1122
|
+
the operation ``A @ x``, where A is a real or complex square matrix.
|
1123
|
+
k : int, optional
|
1124
|
+
The number of eigenvalues and eigenvectors desired.
|
1125
|
+
`k` must be smaller than N-1. It is not possible to compute all
|
1126
|
+
eigenvectors of a matrix.
|
1127
|
+
M : ndarray, sparse matrix or LinearOperator, optional
|
1128
|
+
An array, sparse matrix, or LinearOperator representing
|
1129
|
+
the operation M@x for the generalized eigenvalue problem
|
1130
|
+
|
1131
|
+
A @ x = w * M @ x.
|
1132
|
+
|
1133
|
+
M must represent a real symmetric matrix if A is real, and must
|
1134
|
+
represent a complex Hermitian matrix if A is complex. For best
|
1135
|
+
results, the data type of M should be the same as that of A.
|
1136
|
+
Additionally:
|
1137
|
+
|
1138
|
+
If `sigma` is None, M is positive definite
|
1139
|
+
|
1140
|
+
If sigma is specified, M is positive semi-definite
|
1141
|
+
|
1142
|
+
If sigma is None, eigs requires an operator to compute the solution
|
1143
|
+
of the linear equation ``M @ x = b``. This is done internally via a
|
1144
|
+
(sparse) LU decomposition for an explicit matrix M, or via an
|
1145
|
+
iterative solver for a general linear operator. Alternatively,
|
1146
|
+
the user can supply the matrix or operator Minv, which gives
|
1147
|
+
``x = Minv @ b = M^-1 @ b``.
|
1148
|
+
sigma : real or complex, optional
|
1149
|
+
Find eigenvalues near sigma using shift-invert mode. This requires
|
1150
|
+
an operator to compute the solution of the linear system
|
1151
|
+
``[A - sigma * M] @ x = b``, where M is the identity matrix if
|
1152
|
+
unspecified. This is computed internally via a (sparse) LU
|
1153
|
+
decomposition for explicit matrices A & M, or via an iterative
|
1154
|
+
solver if either A or M is a general linear operator.
|
1155
|
+
Alternatively, the user can supply the matrix or operator OPinv,
|
1156
|
+
which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
|
1157
|
+
For a real matrix A, shift-invert can either be done in imaginary
|
1158
|
+
mode or real mode, specified by the parameter OPpart ('r' or 'i').
|
1159
|
+
Note that when sigma is specified, the keyword 'which' (below)
|
1160
|
+
refers to the shifted eigenvalues ``w'[i]`` where:
|
1161
|
+
|
1162
|
+
If A is real and OPpart == 'r' (default),
|
1163
|
+
``w'[i] = 1/2 * [1/(w[i]-sigma) + 1/(w[i]-conj(sigma))]``.
|
1164
|
+
|
1165
|
+
If A is real and OPpart == 'i',
|
1166
|
+
``w'[i] = 1/2i * [1/(w[i]-sigma) - 1/(w[i]-conj(sigma))]``.
|
1167
|
+
|
1168
|
+
If A is complex, ``w'[i] = 1/(w[i]-sigma)``.
|
1169
|
+
|
1170
|
+
v0 : ndarray, optional
|
1171
|
+
Starting vector for iteration.
|
1172
|
+
Default: random
|
1173
|
+
ncv : int, optional
|
1174
|
+
The number of Lanczos vectors generated
|
1175
|
+
`ncv` must be greater than `k`; it is recommended that ``ncv > 2*k``.
|
1176
|
+
Default: ``min(n, max(2*k + 1, 20))``
|
1177
|
+
which : str, ['LM' | 'SM' | 'LR' | 'SR' | 'LI' | 'SI'], optional
|
1178
|
+
Which `k` eigenvectors and eigenvalues to find:
|
1179
|
+
|
1180
|
+
'LM' : largest magnitude
|
1181
|
+
|
1182
|
+
'SM' : smallest magnitude
|
1183
|
+
|
1184
|
+
'LR' : largest real part
|
1185
|
+
|
1186
|
+
'SR' : smallest real part
|
1187
|
+
|
1188
|
+
'LI' : largest imaginary part
|
1189
|
+
|
1190
|
+
'SI' : smallest imaginary part
|
1191
|
+
|
1192
|
+
When sigma != None, 'which' refers to the shifted eigenvalues w'[i]
|
1193
|
+
(see discussion in 'sigma', above). ARPACK is generally better
|
1194
|
+
at finding large values than small values. If small eigenvalues are
|
1195
|
+
desired, consider using shift-invert mode for better performance.
|
1196
|
+
maxiter : int, optional
|
1197
|
+
Maximum number of Arnoldi update iterations allowed
|
1198
|
+
Default: ``n*10``
|
1199
|
+
tol : float, optional
|
1200
|
+
Relative accuracy for eigenvalues (stopping criterion)
|
1201
|
+
The default value of 0 implies machine precision.
|
1202
|
+
return_eigenvectors : bool, optional
|
1203
|
+
Return eigenvectors (True) in addition to eigenvalues
|
1204
|
+
Minv : ndarray, sparse matrix or LinearOperator, optional
|
1205
|
+
See notes in M, above.
|
1206
|
+
OPinv : ndarray, sparse matrix or LinearOperator, optional
|
1207
|
+
See notes in sigma, above.
|
1208
|
+
OPpart : {'r' or 'i'}, optional
|
1209
|
+
See notes in sigma, above
|
1210
|
+
|
1211
|
+
Returns
|
1212
|
+
-------
|
1213
|
+
w : ndarray
|
1214
|
+
Array of k eigenvalues.
|
1215
|
+
v : ndarray
|
1216
|
+
An array of `k` eigenvectors.
|
1217
|
+
``v[:, i]`` is the eigenvector corresponding to the eigenvalue w[i].
|
1218
|
+
|
1219
|
+
Raises
|
1220
|
+
------
|
1221
|
+
ArpackNoConvergence
|
1222
|
+
When the requested convergence is not obtained.
|
1223
|
+
The currently converged eigenvalues and eigenvectors can be found
|
1224
|
+
as ``eigenvalues`` and ``eigenvectors`` attributes of the exception
|
1225
|
+
object.
|
1226
|
+
|
1227
|
+
See Also
|
1228
|
+
--------
|
1229
|
+
eigsh : eigenvalues and eigenvectors for symmetric matrix A
|
1230
|
+
svds : singular value decomposition for a matrix A
|
1231
|
+
|
1232
|
+
Notes
|
1233
|
+
-----
|
1234
|
+
This function is a wrapper to the ARPACK [1]_ SNEUPD, DNEUPD, CNEUPD,
|
1235
|
+
ZNEUPD, functions which use the Implicitly Restarted Arnoldi Method to
|
1236
|
+
find the eigenvalues and eigenvectors [2]_.
|
1237
|
+
|
1238
|
+
References
|
1239
|
+
----------
|
1240
|
+
.. [1] ARPACK Software, https://github.com/opencollab/arpack-ng
|
1241
|
+
.. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang, ARPACK USERS GUIDE:
|
1242
|
+
Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
|
1243
|
+
Arnoldi Methods. SIAM, Philadelphia, PA, 1998.
|
1244
|
+
|
1245
|
+
Examples
|
1246
|
+
--------
|
1247
|
+
Find 6 eigenvectors of the identity matrix:
|
1248
|
+
|
1249
|
+
>>> import numpy as np
|
1250
|
+
>>> from scipy.sparse.linalg import eigs
|
1251
|
+
>>> id = np.eye(13)
|
1252
|
+
>>> vals, vecs = eigs(id, k=6)
|
1253
|
+
>>> vals
|
1254
|
+
array([ 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j])
|
1255
|
+
>>> vecs.shape
|
1256
|
+
(13, 6)
|
1257
|
+
|
1258
|
+
"""
|
1259
|
+
A = convert_pydata_sparse_to_scipy(A)
|
1260
|
+
M = convert_pydata_sparse_to_scipy(M)
|
1261
|
+
if A.shape[0] != A.shape[1]:
|
1262
|
+
raise ValueError(f'expected square matrix (shape={A.shape})')
|
1263
|
+
if M is not None:
|
1264
|
+
if M.shape != A.shape:
|
1265
|
+
raise ValueError(f'wrong M dimensions {M.shape}, should be {A.shape}')
|
1266
|
+
if np.dtype(M.dtype).char.lower() != np.dtype(A.dtype).char.lower():
|
1267
|
+
warnings.warn('M does not have the same type precision as A. '
|
1268
|
+
'This may adversely affect ARPACK convergence',
|
1269
|
+
stacklevel=2)
|
1270
|
+
|
1271
|
+
n = A.shape[0]
|
1272
|
+
|
1273
|
+
if k <= 0:
|
1274
|
+
raise ValueError(f"k={k} must be greater than 0.")
|
1275
|
+
|
1276
|
+
if k >= n - 1:
|
1277
|
+
warnings.warn("k >= N - 1 for N * N square matrix. "
|
1278
|
+
"Attempting to use scipy.linalg.eig instead.",
|
1279
|
+
RuntimeWarning, stacklevel=2)
|
1280
|
+
|
1281
|
+
if issparse(A):
|
1282
|
+
raise TypeError("Cannot use scipy.linalg.eig for sparse A with "
|
1283
|
+
"k >= N - 1. Use scipy.linalg.eig(A.toarray()) or"
|
1284
|
+
" reduce k.")
|
1285
|
+
if isinstance(A, LinearOperator):
|
1286
|
+
raise TypeError("Cannot use scipy.linalg.eig for LinearOperator "
|
1287
|
+
"A with k >= N - 1.")
|
1288
|
+
if isinstance(M, LinearOperator):
|
1289
|
+
raise TypeError("Cannot use scipy.linalg.eig for LinearOperator "
|
1290
|
+
"M with k >= N - 1.")
|
1291
|
+
|
1292
|
+
return eig(A, b=M, right=return_eigenvectors)
|
1293
|
+
|
1294
|
+
if sigma is None:
|
1295
|
+
matvec = aslinearoperator(A).matvec
|
1296
|
+
|
1297
|
+
if OPinv is not None:
|
1298
|
+
raise ValueError("OPinv should not be specified "
|
1299
|
+
"with sigma = None.")
|
1300
|
+
if OPpart is not None:
|
1301
|
+
raise ValueError("OPpart should not be specified with "
|
1302
|
+
"sigma = None or complex A")
|
1303
|
+
|
1304
|
+
if M is None:
|
1305
|
+
#standard eigenvalue problem
|
1306
|
+
mode = 1
|
1307
|
+
M_matvec = None
|
1308
|
+
Minv_matvec = None
|
1309
|
+
if Minv is not None:
|
1310
|
+
raise ValueError("Minv should not be "
|
1311
|
+
"specified with M = None.")
|
1312
|
+
else:
|
1313
|
+
#general eigenvalue problem
|
1314
|
+
mode = 2
|
1315
|
+
if Minv is None:
|
1316
|
+
Minv_matvec = get_inv_matvec(M, hermitian=True, tol=tol)
|
1317
|
+
else:
|
1318
|
+
Minv = aslinearoperator(Minv)
|
1319
|
+
Minv_matvec = Minv.matvec
|
1320
|
+
M_matvec = aslinearoperator(M).matvec
|
1321
|
+
else:
|
1322
|
+
#sigma is not None: shift-invert mode
|
1323
|
+
if np.issubdtype(A.dtype, np.complexfloating):
|
1324
|
+
if OPpart is not None:
|
1325
|
+
raise ValueError("OPpart should not be specified "
|
1326
|
+
"with sigma=None or complex A")
|
1327
|
+
mode = 3
|
1328
|
+
elif OPpart is None or OPpart.lower() == 'r':
|
1329
|
+
mode = 3
|
1330
|
+
elif OPpart.lower() == 'i':
|
1331
|
+
if np.imag(sigma) == 0:
|
1332
|
+
raise ValueError("OPpart cannot be 'i' if sigma is real")
|
1333
|
+
mode = 4
|
1334
|
+
else:
|
1335
|
+
raise ValueError("OPpart must be one of ('r','i')")
|
1336
|
+
|
1337
|
+
matvec = aslinearoperator(A).matvec
|
1338
|
+
if Minv is not None:
|
1339
|
+
raise ValueError("Minv should not be specified when sigma is")
|
1340
|
+
if OPinv is None:
|
1341
|
+
Minv_matvec = get_OPinv_matvec(A, M, sigma,
|
1342
|
+
hermitian=False, tol=tol)
|
1343
|
+
else:
|
1344
|
+
OPinv = aslinearoperator(OPinv)
|
1345
|
+
Minv_matvec = OPinv.matvec
|
1346
|
+
if M is None:
|
1347
|
+
M_matvec = None
|
1348
|
+
else:
|
1349
|
+
M_matvec = aslinearoperator(M).matvec
|
1350
|
+
|
1351
|
+
params = _UnsymmetricArpackParams(n, k, A.dtype.char, matvec, mode,
|
1352
|
+
M_matvec, Minv_matvec, sigma,
|
1353
|
+
ncv, v0, maxiter, which, tol)
|
1354
|
+
|
1355
|
+
with _ARPACK_LOCK:
|
1356
|
+
while not params.converged:
|
1357
|
+
params.iterate()
|
1358
|
+
|
1359
|
+
return params.extract(return_eigenvectors)
|
1360
|
+
|
1361
|
+
|
1362
|
+
def eigsh(A, k=6, M=None, sigma=None, which='LM', v0=None,
|
1363
|
+
ncv=None, maxiter=None, tol=0, return_eigenvectors=True,
|
1364
|
+
Minv=None, OPinv=None, mode='normal'):
|
1365
|
+
"""
|
1366
|
+
Find k eigenvalues and eigenvectors of the real symmetric square matrix
|
1367
|
+
or complex Hermitian matrix A.
|
1368
|
+
|
1369
|
+
Solves ``A @ x[i] = w[i] * x[i]``, the standard eigenvalue problem for
|
1370
|
+
w[i] eigenvalues with corresponding eigenvectors x[i].
|
1371
|
+
|
1372
|
+
If M is specified, solves ``A @ x[i] = w[i] * M @ x[i]``, the
|
1373
|
+
generalized eigenvalue problem for w[i] eigenvalues
|
1374
|
+
with corresponding eigenvectors x[i].
|
1375
|
+
|
1376
|
+
Note that there is no specialized routine for the case when A is a complex
|
1377
|
+
Hermitian matrix. In this case, ``eigsh()`` will call ``eigs()`` and return the
|
1378
|
+
real parts of the eigenvalues thus obtained.
|
1379
|
+
|
1380
|
+
Parameters
|
1381
|
+
----------
|
1382
|
+
A : ndarray, sparse matrix or LinearOperator
|
1383
|
+
A square operator representing the operation ``A @ x``, where ``A`` is
|
1384
|
+
real symmetric or complex Hermitian. For buckling mode (see below)
|
1385
|
+
``A`` must additionally be positive-definite.
|
1386
|
+
k : int, optional
|
1387
|
+
The number of eigenvalues and eigenvectors desired.
|
1388
|
+
`k` must be smaller than N. It is not possible to compute all
|
1389
|
+
eigenvectors of a matrix.
|
1390
|
+
|
1391
|
+
Returns
|
1392
|
+
-------
|
1393
|
+
w : array
|
1394
|
+
Array of k eigenvalues.
|
1395
|
+
v : array
|
1396
|
+
An array representing the `k` eigenvectors. The column ``v[:, i]`` is
|
1397
|
+
the eigenvector corresponding to the eigenvalue ``w[i]``.
|
1398
|
+
|
1399
|
+
Other Parameters
|
1400
|
+
----------------
|
1401
|
+
M : An N x N matrix, array, sparse matrix, or linear operator representing
|
1402
|
+
the operation ``M @ x`` for the generalized eigenvalue problem
|
1403
|
+
|
1404
|
+
A @ x = w * M @ x.
|
1405
|
+
|
1406
|
+
M must represent a real symmetric matrix if A is real, and must
|
1407
|
+
represent a complex Hermitian matrix if A is complex. For best
|
1408
|
+
results, the data type of M should be the same as that of A.
|
1409
|
+
Additionally:
|
1410
|
+
|
1411
|
+
If sigma is None, M is symmetric positive definite.
|
1412
|
+
|
1413
|
+
If sigma is specified, M is symmetric positive semi-definite.
|
1414
|
+
|
1415
|
+
In buckling mode, M is symmetric indefinite.
|
1416
|
+
|
1417
|
+
If sigma is None, eigsh requires an operator to compute the solution
|
1418
|
+
of the linear equation ``M @ x = b``. This is done internally via a
|
1419
|
+
(sparse) LU decomposition for an explicit matrix M, or via an
|
1420
|
+
iterative solver for a general linear operator. Alternatively,
|
1421
|
+
the user can supply the matrix or operator Minv, which gives
|
1422
|
+
``x = Minv @ b = M^-1 @ b``.
|
1423
|
+
sigma : real
|
1424
|
+
Find eigenvalues near sigma using shift-invert mode. This requires
|
1425
|
+
an operator to compute the solution of the linear system
|
1426
|
+
``[A - sigma * M] x = b``, where M is the identity matrix if
|
1427
|
+
unspecified. This is computed internally via a (sparse) LU
|
1428
|
+
decomposition for explicit matrices A & M, or via an iterative
|
1429
|
+
solver if either A or M is a general linear operator.
|
1430
|
+
Alternatively, the user can supply the matrix or operator `OPinv`,
|
1431
|
+
which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
|
1432
|
+
Regardless of the selected mode (normal, cayley, or buckling),
|
1433
|
+
`OPinv` should always be supplied as ``OPinv = [A - sigma * M]^-1``.
|
1434
|
+
|
1435
|
+
Note that when sigma is specified, the keyword 'which' refers to
|
1436
|
+
the shifted eigenvalues ``w'[i]`` where:
|
1437
|
+
|
1438
|
+
if ``mode == 'normal'``: ``w'[i] = 1 / (w[i] - sigma)``.
|
1439
|
+
|
1440
|
+
if ``mode == 'cayley'``: ``w'[i] = (w[i] + sigma) / (w[i] - sigma)``.
|
1441
|
+
|
1442
|
+
if ``mode == 'buckling'``: ``w'[i] = w[i] / (w[i] - sigma)``.
|
1443
|
+
|
1444
|
+
(see further discussion in 'mode' below)
|
1445
|
+
v0 : ndarray, optional
|
1446
|
+
Starting vector for iteration.
|
1447
|
+
Default: random
|
1448
|
+
ncv : int, optional
|
1449
|
+
The number of Lanczos vectors generated ncv must be greater than k and
|
1450
|
+
smaller than n; it is recommended that ``ncv > 2*k``.
|
1451
|
+
Default: ``min(n, max(2*k + 1, 20))``
|
1452
|
+
which : str ['LM' | 'SM' | 'LA' | 'SA' | 'BE']
|
1453
|
+
If A is a complex Hermitian matrix, 'BE' is invalid.
|
1454
|
+
Which `k` eigenvectors and eigenvalues to find:
|
1455
|
+
|
1456
|
+
'LM' : Largest (in magnitude) eigenvalues.
|
1457
|
+
|
1458
|
+
'SM' : Smallest (in magnitude) eigenvalues.
|
1459
|
+
|
1460
|
+
'LA' : Largest (algebraic) eigenvalues.
|
1461
|
+
|
1462
|
+
'SA' : Smallest (algebraic) eigenvalues.
|
1463
|
+
|
1464
|
+
'BE' : Half (k/2) from each end of the spectrum.
|
1465
|
+
|
1466
|
+
When k is odd, return one more (k/2+1) from the high end.
|
1467
|
+
When sigma != None, 'which' refers to the shifted eigenvalues ``w'[i]``
|
1468
|
+
(see discussion in 'sigma', above). ARPACK is generally better
|
1469
|
+
at finding large values than small values. If small eigenvalues are
|
1470
|
+
desired, consider using shift-invert mode for better performance.
|
1471
|
+
maxiter : int, optional
|
1472
|
+
Maximum number of Arnoldi update iterations allowed.
|
1473
|
+
Default: ``n*10``
|
1474
|
+
tol : float
|
1475
|
+
Relative accuracy for eigenvalues (stopping criterion).
|
1476
|
+
The default value of 0 implies machine precision.
|
1477
|
+
Minv : N x N matrix, array, sparse matrix, or LinearOperator
|
1478
|
+
See notes in M, above.
|
1479
|
+
OPinv : N x N matrix, array, sparse matrix, or LinearOperator
|
1480
|
+
See notes in sigma, above.
|
1481
|
+
return_eigenvectors : bool
|
1482
|
+
Return eigenvectors (True) in addition to eigenvalues.
|
1483
|
+
This value determines the order in which eigenvalues are sorted.
|
1484
|
+
The sort order is also dependent on the `which` variable.
|
1485
|
+
|
1486
|
+
For which = 'LM' or 'SA':
|
1487
|
+
If `return_eigenvectors` is True, eigenvalues are sorted by
|
1488
|
+
algebraic value.
|
1489
|
+
|
1490
|
+
If `return_eigenvectors` is False, eigenvalues are sorted by
|
1491
|
+
absolute value.
|
1492
|
+
|
1493
|
+
For which = 'BE' or 'LA':
|
1494
|
+
eigenvalues are always sorted by algebraic value.
|
1495
|
+
|
1496
|
+
For which = 'SM':
|
1497
|
+
If `return_eigenvectors` is True, eigenvalues are sorted by
|
1498
|
+
algebraic value.
|
1499
|
+
|
1500
|
+
If `return_eigenvectors` is False, eigenvalues are sorted by
|
1501
|
+
decreasing absolute value.
|
1502
|
+
|
1503
|
+
mode : string ['normal' | 'buckling' | 'cayley']
|
1504
|
+
Specify strategy to use for shift-invert mode. This argument applies
|
1505
|
+
only for real-valued A and sigma != None. For shift-invert mode,
|
1506
|
+
ARPACK internally solves the eigenvalue problem
|
1507
|
+
``OP @ x'[i] = w'[i] * B @ x'[i]``
|
1508
|
+
and transforms the resulting Ritz vectors x'[i] and Ritz values w'[i]
|
1509
|
+
into the desired eigenvectors and eigenvalues of the problem
|
1510
|
+
``A @ x[i] = w[i] * M @ x[i]``.
|
1511
|
+
The modes are as follows:
|
1512
|
+
|
1513
|
+
'normal' :
|
1514
|
+
OP = [A - sigma * M]^-1 @ M,
|
1515
|
+
B = M,
|
1516
|
+
w'[i] = 1 / (w[i] - sigma)
|
1517
|
+
|
1518
|
+
'buckling' :
|
1519
|
+
OP = [A - sigma * M]^-1 @ A,
|
1520
|
+
B = A,
|
1521
|
+
w'[i] = w[i] / (w[i] - sigma)
|
1522
|
+
|
1523
|
+
'cayley' :
|
1524
|
+
OP = [A - sigma * M]^-1 @ [A + sigma * M],
|
1525
|
+
B = M,
|
1526
|
+
w'[i] = (w[i] + sigma) / (w[i] - sigma)
|
1527
|
+
|
1528
|
+
The choice of mode will affect which eigenvalues are selected by
|
1529
|
+
the keyword 'which', and can also impact the stability of
|
1530
|
+
convergence (see [2] for a discussion).
|
1531
|
+
|
1532
|
+
Raises
|
1533
|
+
------
|
1534
|
+
ArpackNoConvergence
|
1535
|
+
When the requested convergence is not obtained.
|
1536
|
+
|
1537
|
+
The currently converged eigenvalues and eigenvectors can be found
|
1538
|
+
as ``eigenvalues`` and ``eigenvectors`` attributes of the exception
|
1539
|
+
object.
|
1540
|
+
|
1541
|
+
See Also
|
1542
|
+
--------
|
1543
|
+
eigs : eigenvalues and eigenvectors for a general (nonsymmetric) matrix A
|
1544
|
+
svds : singular value decomposition for a matrix A
|
1545
|
+
|
1546
|
+
Notes
|
1547
|
+
-----
|
1548
|
+
This function is a wrapper to the ARPACK [1]_ SSEUPD and DSEUPD
|
1549
|
+
functions which use the Implicitly Restarted Lanczos Method to
|
1550
|
+
find the eigenvalues and eigenvectors [2]_.
|
1551
|
+
|
1552
|
+
References
|
1553
|
+
----------
|
1554
|
+
.. [1] ARPACK Software, https://github.com/opencollab/arpack-ng
|
1555
|
+
.. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang, ARPACK USERS GUIDE:
|
1556
|
+
Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
|
1557
|
+
Arnoldi Methods. SIAM, Philadelphia, PA, 1998.
|
1558
|
+
|
1559
|
+
Examples
|
1560
|
+
--------
|
1561
|
+
>>> import numpy as np
|
1562
|
+
>>> from scipy.sparse.linalg import eigsh
|
1563
|
+
>>> identity = np.eye(13)
|
1564
|
+
>>> eigenvalues, eigenvectors = eigsh(identity, k=6)
|
1565
|
+
>>> eigenvalues
|
1566
|
+
array([1., 1., 1., 1., 1., 1.])
|
1567
|
+
>>> eigenvectors.shape
|
1568
|
+
(13, 6)
|
1569
|
+
|
1570
|
+
"""
|
1571
|
+
# complex Hermitian matrices should be solved with eigs
|
1572
|
+
if np.issubdtype(A.dtype, np.complexfloating):
|
1573
|
+
if mode != 'normal':
|
1574
|
+
raise ValueError(f"mode={mode} cannot be used with complex matrix A")
|
1575
|
+
if which == 'BE':
|
1576
|
+
raise ValueError("which='BE' cannot be used with complex matrix A")
|
1577
|
+
elif which == 'LA':
|
1578
|
+
which = 'LR'
|
1579
|
+
elif which == 'SA':
|
1580
|
+
which = 'SR'
|
1581
|
+
ret = eigs(A, k, M=M, sigma=sigma, which=which, v0=v0,
|
1582
|
+
ncv=ncv, maxiter=maxiter, tol=tol,
|
1583
|
+
return_eigenvectors=return_eigenvectors, Minv=Minv,
|
1584
|
+
OPinv=OPinv)
|
1585
|
+
|
1586
|
+
if return_eigenvectors:
|
1587
|
+
return ret[0].real, ret[1]
|
1588
|
+
else:
|
1589
|
+
return ret.real
|
1590
|
+
|
1591
|
+
if A.shape[0] != A.shape[1]:
|
1592
|
+
raise ValueError(f'expected square matrix (shape={A.shape})')
|
1593
|
+
if M is not None:
|
1594
|
+
if M.shape != A.shape:
|
1595
|
+
raise ValueError(f'wrong M dimensions {M.shape}, should be {A.shape}')
|
1596
|
+
if np.dtype(M.dtype).char.lower() != np.dtype(A.dtype).char.lower():
|
1597
|
+
warnings.warn('M does not have the same type precision as A. '
|
1598
|
+
'This may adversely affect ARPACK convergence',
|
1599
|
+
stacklevel=2)
|
1600
|
+
|
1601
|
+
n = A.shape[0]
|
1602
|
+
|
1603
|
+
if k <= 0:
|
1604
|
+
raise ValueError("k must be greater than 0.")
|
1605
|
+
|
1606
|
+
if k >= n:
|
1607
|
+
warnings.warn("k >= N for N * N square matrix. "
|
1608
|
+
"Attempting to use scipy.linalg.eigh instead.",
|
1609
|
+
RuntimeWarning, stacklevel=2)
|
1610
|
+
|
1611
|
+
if issparse(A):
|
1612
|
+
raise TypeError("Cannot use scipy.linalg.eigh for sparse A with "
|
1613
|
+
"k >= N. Use scipy.linalg.eigh(A.toarray()) or"
|
1614
|
+
" reduce k.")
|
1615
|
+
if isinstance(A, LinearOperator):
|
1616
|
+
raise TypeError("Cannot use scipy.linalg.eigh for LinearOperator "
|
1617
|
+
"A with k >= N.")
|
1618
|
+
if isinstance(M, LinearOperator):
|
1619
|
+
raise TypeError("Cannot use scipy.linalg.eigh for LinearOperator "
|
1620
|
+
"M with k >= N.")
|
1621
|
+
|
1622
|
+
return eigh(A, b=M, eigvals_only=not return_eigenvectors)
|
1623
|
+
|
1624
|
+
if sigma is None:
|
1625
|
+
A = aslinearoperator(A)
|
1626
|
+
matvec = A.matvec
|
1627
|
+
|
1628
|
+
if OPinv is not None:
|
1629
|
+
raise ValueError("OPinv should not be specified "
|
1630
|
+
"with sigma = None.")
|
1631
|
+
if M is None:
|
1632
|
+
#standard eigenvalue problem
|
1633
|
+
mode = 1
|
1634
|
+
M_matvec = None
|
1635
|
+
Minv_matvec = None
|
1636
|
+
if Minv is not None:
|
1637
|
+
raise ValueError("Minv should not be "
|
1638
|
+
"specified with M = None.")
|
1639
|
+
else:
|
1640
|
+
#general eigenvalue problem
|
1641
|
+
mode = 2
|
1642
|
+
if Minv is None:
|
1643
|
+
Minv_matvec = get_inv_matvec(M, hermitian=True, tol=tol)
|
1644
|
+
else:
|
1645
|
+
Minv = aslinearoperator(Minv)
|
1646
|
+
Minv_matvec = Minv.matvec
|
1647
|
+
M_matvec = aslinearoperator(M).matvec
|
1648
|
+
else:
|
1649
|
+
# sigma is not None: shift-invert mode
|
1650
|
+
if Minv is not None:
|
1651
|
+
raise ValueError("Minv should not be specified when sigma is")
|
1652
|
+
|
1653
|
+
# normal mode
|
1654
|
+
if mode == 'normal':
|
1655
|
+
mode = 3
|
1656
|
+
matvec = None
|
1657
|
+
if OPinv is None:
|
1658
|
+
Minv_matvec = get_OPinv_matvec(A, M, sigma,
|
1659
|
+
hermitian=True, tol=tol)
|
1660
|
+
else:
|
1661
|
+
OPinv = aslinearoperator(OPinv)
|
1662
|
+
Minv_matvec = OPinv.matvec
|
1663
|
+
if M is None:
|
1664
|
+
M_matvec = None
|
1665
|
+
else:
|
1666
|
+
M = aslinearoperator(M)
|
1667
|
+
M_matvec = M.matvec
|
1668
|
+
|
1669
|
+
# buckling mode
|
1670
|
+
elif mode == 'buckling':
|
1671
|
+
mode = 4
|
1672
|
+
if OPinv is None:
|
1673
|
+
Minv_matvec = get_OPinv_matvec(A, M, sigma,
|
1674
|
+
hermitian=True, tol=tol)
|
1675
|
+
else:
|
1676
|
+
Minv_matvec = aslinearoperator(OPinv).matvec
|
1677
|
+
matvec = aslinearoperator(A).matvec
|
1678
|
+
M_matvec = None
|
1679
|
+
|
1680
|
+
# cayley-transform mode
|
1681
|
+
elif mode == 'cayley':
|
1682
|
+
mode = 5
|
1683
|
+
matvec = aslinearoperator(A).matvec
|
1684
|
+
if OPinv is None:
|
1685
|
+
Minv_matvec = get_OPinv_matvec(A, M, sigma,
|
1686
|
+
hermitian=True, tol=tol)
|
1687
|
+
else:
|
1688
|
+
Minv_matvec = aslinearoperator(OPinv).matvec
|
1689
|
+
if M is None:
|
1690
|
+
M_matvec = None
|
1691
|
+
else:
|
1692
|
+
M_matvec = aslinearoperator(M).matvec
|
1693
|
+
|
1694
|
+
# unrecognized mode
|
1695
|
+
else:
|
1696
|
+
raise ValueError(f"unrecognized mode '{mode}'")
|
1697
|
+
|
1698
|
+
params = _SymmetricArpackParams(n, k, A.dtype.char, matvec, mode,
|
1699
|
+
M_matvec, Minv_matvec, sigma,
|
1700
|
+
ncv, v0, maxiter, which, tol)
|
1701
|
+
|
1702
|
+
with _ARPACK_LOCK:
|
1703
|
+
while not params.converged:
|
1704
|
+
params.iterate()
|
1705
|
+
|
1706
|
+
return params.extract(return_eigenvectors)
|