Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/scipy/linalg/lapack.py: 55%

64 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-12-12 06:31 +0000

1""" 

2Low-level LAPACK functions (:mod:`scipy.linalg.lapack`) 

3======================================================= 

4 

5This module contains low-level functions from the LAPACK library. 

6 

7.. versionadded:: 0.12.0 

8 

9.. note:: 

10 

11 The common ``overwrite_<>`` option in many routines, allows the 

12 input arrays to be overwritten to avoid extra memory allocation. 

13 However this requires the array to satisfy two conditions 

14 which are memory order and the data type to match exactly the 

15 order and the type expected by the routine. 

16 

17 As an example, if you pass a double precision float array to any 

18 ``S....`` routine which expects single precision arguments, f2py 

19 will create an intermediate array to match the argument types and 

20 overwriting will be performed on that intermediate array. 

21 

22 Similarly, if a C-contiguous array is passed, f2py will pass a 

23 FORTRAN-contiguous array internally. Please make sure that these 

24 details are satisfied. More information can be found in the f2py 

25 documentation. 

26 

27.. warning:: 

28 

29 These functions do little to no error checking. 

30 It is possible to cause crashes by mis-using them, 

31 so prefer using the higher-level routines in `scipy.linalg`. 

32 

33Finding functions 

34----------------- 

35 

36.. autosummary:: 

37 :toctree: generated/ 

38 

39 get_lapack_funcs 

40 

41All functions 

42------------- 

43 

44.. autosummary:: 

45 :toctree: generated/ 

46 

47 sgbsv 

48 dgbsv 

49 cgbsv 

50 zgbsv 

51 

52 sgbtrf 

53 dgbtrf 

54 cgbtrf 

55 zgbtrf 

56 

57 sgbtrs 

58 dgbtrs 

59 cgbtrs 

60 zgbtrs 

61 

62 sgebal 

63 dgebal 

64 cgebal 

65 zgebal 

66 

67 sgecon 

68 dgecon 

69 cgecon 

70 zgecon 

71 

72 sgeequ 

73 dgeequ 

74 cgeequ 

75 zgeequ 

76 

77 sgeequb 

78 dgeequb 

79 cgeequb 

80 zgeequb 

81 

82 sgees 

83 dgees 

84 cgees 

85 zgees 

86 

87 sgeev 

88 dgeev 

89 cgeev 

90 zgeev 

91 

92 sgeev_lwork 

93 dgeev_lwork 

94 cgeev_lwork 

95 zgeev_lwork 

96 

97 sgehrd 

98 dgehrd 

99 cgehrd 

100 zgehrd 

101 

102 sgehrd_lwork 

103 dgehrd_lwork 

104 cgehrd_lwork 

105 zgehrd_lwork 

106 

107 sgejsv 

108 dgejsv 

109 

110 sgels 

111 dgels 

112 cgels 

113 zgels 

114 

115 sgels_lwork 

116 dgels_lwork 

117 cgels_lwork 

118 zgels_lwork 

119 

120 sgelsd 

121 dgelsd 

122 cgelsd 

123 zgelsd 

124 

125 sgelsd_lwork 

126 dgelsd_lwork 

127 cgelsd_lwork 

128 zgelsd_lwork 

129 

130 sgelss 

131 dgelss 

132 cgelss 

133 zgelss 

134 

135 sgelss_lwork 

136 dgelss_lwork 

137 cgelss_lwork 

138 zgelss_lwork 

139 

140 sgelsy 

141 dgelsy 

142 cgelsy 

143 zgelsy 

144 

145 sgelsy_lwork 

146 dgelsy_lwork 

147 cgelsy_lwork 

148 zgelsy_lwork 

149 

150 sgeqp3 

151 dgeqp3 

152 cgeqp3 

153 zgeqp3 

154 

155 sgeqrf 

156 dgeqrf 

157 cgeqrf 

158 zgeqrf 

159 

160 sgeqrf_lwork 

161 dgeqrf_lwork 

162 cgeqrf_lwork 

163 zgeqrf_lwork 

164 

165 sgeqrfp 

166 dgeqrfp 

167 cgeqrfp 

168 zgeqrfp 

169 

170 sgeqrfp_lwork 

171 dgeqrfp_lwork 

172 cgeqrfp_lwork 

173 zgeqrfp_lwork 

174 

175 sgerqf 

176 dgerqf 

177 cgerqf 

178 zgerqf 

179 

180 sgesdd 

181 dgesdd 

182 cgesdd 

183 zgesdd 

184 

185 sgesdd_lwork 

186 dgesdd_lwork 

187 cgesdd_lwork 

188 zgesdd_lwork 

189 

190 sgesv 

191 dgesv 

192 cgesv 

193 zgesv 

194 

195 sgesvd 

196 dgesvd 

197 cgesvd 

198 zgesvd 

199 

200 sgesvd_lwork 

201 dgesvd_lwork 

202 cgesvd_lwork 

203 zgesvd_lwork 

204 

205 sgesvx 

206 dgesvx 

207 cgesvx 

208 zgesvx 

209 

210 sgetrf 

211 dgetrf 

212 cgetrf 

213 zgetrf 

214 

215 sgetc2 

216 dgetc2 

217 cgetc2 

218 zgetc2 

219 

220 sgetri 

221 dgetri 

222 cgetri 

223 zgetri 

224 

225 sgetri_lwork 

226 dgetri_lwork 

227 cgetri_lwork 

228 zgetri_lwork 

229 

230 sgetrs 

231 dgetrs 

232 cgetrs 

233 zgetrs 

234 

235 sgesc2 

236 dgesc2 

237 cgesc2 

238 zgesc2 

239 

240 sgges 

241 dgges 

242 cgges 

243 zgges 

244 

245 sggev 

246 dggev 

247 cggev 

248 zggev 

249 

250 sgglse 

251 dgglse 

252 cgglse 

253 zgglse 

254 

255 sgglse_lwork 

256 dgglse_lwork 

257 cgglse_lwork 

258 zgglse_lwork 

259 

260 sgtsv 

261 dgtsv 

262 cgtsv 

263 zgtsv 

264 

265 sgtsvx 

266 dgtsvx 

267 cgtsvx 

268 zgtsvx 

269 

270 chbevd 

271 zhbevd 

272 

273 chbevx 

274 zhbevx 

275 

276 checon 

277 zhecon 

278 

279 cheequb 

280 zheequb 

281 

282 cheev 

283 zheev 

284 

285 cheev_lwork 

286 zheev_lwork 

287 

288 cheevd 

289 zheevd 

290 

291 cheevd_lwork 

292 zheevd_lwork 

293 

294 cheevr 

295 zheevr 

296 

297 cheevr_lwork 

298 zheevr_lwork 

299 

300 cheevx 

301 zheevx 

302 

303 cheevx_lwork 

304 zheevx_lwork 

305 

306 chegst 

307 zhegst 

308 

309 chegv 

310 zhegv 

311 

312 chegv_lwork 

313 zhegv_lwork 

314 

315 chegvd 

316 zhegvd 

317 

318 chegvx 

319 zhegvx 

320 

321 chegvx_lwork 

322 zhegvx_lwork 

323 

324 chesv 

325 zhesv 

326 

327 chesv_lwork 

328 zhesv_lwork 

329 

330 chesvx 

331 zhesvx 

332 

333 chesvx_lwork 

334 zhesvx_lwork 

335 

336 chetrd 

337 zhetrd 

338 

339 chetrd_lwork 

340 zhetrd_lwork 

341 

342 chetrf 

343 zhetrf 

344 

345 chetrf_lwork 

346 zhetrf_lwork 

347 

348 chfrk 

349 zhfrk 

350 

351 slamch 

352 dlamch 

353 

354 slange 

355 dlange 

356 clange 

357 zlange 

358 

359 slarf 

360 dlarf 

361 clarf 

362 zlarf 

363 

364 slarfg 

365 dlarfg 

366 clarfg 

367 zlarfg 

368 

369 slartg 

370 dlartg 

371 clartg 

372 zlartg 

373 

374 slasd4 

375 dlasd4 

376 

377 slaswp 

378 dlaswp 

379 claswp 

380 zlaswp 

381 

382 slauum 

383 dlauum 

384 clauum 

385 zlauum 

386 

387 sorcsd 

388 dorcsd 

389 sorcsd_lwork 

390 dorcsd_lwork 

391 

392 sorghr 

393 dorghr 

394 sorghr_lwork 

395 dorghr_lwork 

396 

397 sorgqr 

398 dorgqr 

399 

400 sorgrq 

401 dorgrq 

402 

403 sormqr 

404 dormqr 

405 

406 sormrz 

407 dormrz 

408 

409 sormrz_lwork 

410 dormrz_lwork 

411 

412 spbsv 

413 dpbsv 

414 cpbsv 

415 zpbsv 

416 

417 spbtrf 

418 dpbtrf 

419 cpbtrf 

420 zpbtrf 

421 

422 spbtrs 

423 dpbtrs 

424 cpbtrs 

425 zpbtrs 

426 

427 spftrf 

428 dpftrf 

429 cpftrf 

430 zpftrf 

431 

432 spftri 

433 dpftri 

434 cpftri 

435 zpftri 

436 

437 spftrs 

438 dpftrs 

439 cpftrs 

440 zpftrs 

441 

442 spocon 

443 dpocon 

444 cpocon 

445 zpocon 

446 

447 spstrf 

448 dpstrf 

449 cpstrf 

450 zpstrf 

451 

452 spstf2 

453 dpstf2 

454 cpstf2 

455 zpstf2 

456 

457 sposv 

458 dposv 

459 cposv 

460 zposv 

461 

462 sposvx 

463 dposvx 

464 cposvx 

465 zposvx 

466 

467 spotrf 

468 dpotrf 

469 cpotrf 

470 zpotrf 

471 

472 spotri 

473 dpotri 

474 cpotri 

475 zpotri 

476 

477 spotrs 

478 dpotrs 

479 cpotrs 

480 zpotrs 

481 

482 sppcon 

483 dppcon 

484 cppcon 

485 zppcon 

486 

487 sppsv 

488 dppsv 

489 cppsv 

490 zppsv 

491 

492 spptrf 

493 dpptrf 

494 cpptrf 

495 zpptrf 

496 

497 spptri 

498 dpptri 

499 cpptri 

500 zpptri 

501 

502 spptrs 

503 dpptrs 

504 cpptrs 

505 zpptrs 

506 

507 sptsv 

508 dptsv 

509 cptsv 

510 zptsv 

511 

512 sptsvx 

513 dptsvx 

514 cptsvx 

515 zptsvx 

516 

517 spttrf 

518 dpttrf 

519 cpttrf 

520 zpttrf 

521 

522 spttrs 

523 dpttrs 

524 cpttrs 

525 zpttrs 

526 

527 spteqr 

528 dpteqr 

529 cpteqr 

530 zpteqr 

531 

532 crot 

533 zrot 

534 

535 ssbev 

536 dsbev 

537 

538 ssbevd 

539 dsbevd 

540 

541 ssbevx 

542 dsbevx 

543 

544 ssfrk 

545 dsfrk 

546 

547 sstebz 

548 dstebz 

549 

550 sstein 

551 dstein 

552 

553 sstemr 

554 dstemr 

555 

556 sstemr_lwork 

557 dstemr_lwork 

558 

559 ssterf 

560 dsterf 

561 

562 sstev 

563 dstev 

564 

565 ssycon 

566 dsycon 

567 csycon 

568 zsycon 

569 

570 ssyconv 

571 dsyconv 

572 csyconv 

573 zsyconv 

574 

575 ssyequb 

576 dsyequb 

577 csyequb 

578 zsyequb 

579 

580 ssyev 

581 dsyev 

582 

583 ssyev_lwork 

584 dsyev_lwork 

585 

586 ssyevd 

587 dsyevd 

588 

589 ssyevd_lwork 

590 dsyevd_lwork 

591 

592 ssyevr 

593 dsyevr 

594 

595 ssyevr_lwork 

596 dsyevr_lwork 

597 

598 ssyevx 

599 dsyevx 

600 

601 ssyevx_lwork 

602 dsyevx_lwork 

603 

604 ssygst 

605 dsygst 

606 

607 ssygv 

608 dsygv 

609 

610 ssygv_lwork 

611 dsygv_lwork 

612 

613 ssygvd 

614 dsygvd 

615 

616 ssygvx 

617 dsygvx 

618 

619 ssygvx_lwork 

620 dsygvx_lwork 

621 

622 ssysv 

623 dsysv 

624 csysv 

625 zsysv 

626 

627 ssysv_lwork 

628 dsysv_lwork 

629 csysv_lwork 

630 zsysv_lwork 

631 

632 ssysvx 

633 dsysvx 

634 csysvx 

635 zsysvx 

636 

637 ssysvx_lwork 

638 dsysvx_lwork 

639 csysvx_lwork 

640 zsysvx_lwork 

641 

642 ssytf2 

643 dsytf2 

644 csytf2 

645 zsytf2 

646 

647 ssytrd 

648 dsytrd 

649 

650 ssytrd_lwork 

651 dsytrd_lwork 

652 

653 ssytrf 

654 dsytrf 

655 csytrf 

656 zsytrf 

657 

658 ssytrf_lwork 

659 dsytrf_lwork 

660 csytrf_lwork 

661 zsytrf_lwork 

662 

663 stbtrs 

664 dtbtrs 

665 ctbtrs 

666 ztbtrs 

667 

668 stfsm 

669 dtfsm 

670 ctfsm 

671 ztfsm 

672 

673 stfttp 

674 dtfttp 

675 ctfttp 

676 ztfttp 

677 

678 stfttr 

679 dtfttr 

680 ctfttr 

681 ztfttr 

682 

683 stgexc 

684 dtgexc 

685 ctgexc 

686 ztgexc 

687 

688 stgsen 

689 dtgsen 

690 ctgsen 

691 ztgsen 

692 

693 stgsen_lwork 

694 dtgsen_lwork 

695 ctgsen_lwork 

696 ztgsen_lwork 

697 

698 stpttf 

699 dtpttf 

700 ctpttf 

701 ztpttf 

702 

703 stpttr 

704 dtpttr 

705 ctpttr 

706 ztpttr 

707 

708 strexc 

709 dtrexc 

710 ctrexc 

711 ztrexc 

712 

713 strsen 

714 dtrsen 

715 ctrsen 

716 ztrsen 

717 

718 strsen_lwork 

719 dtrsen_lwork 

720 ctrsen_lwork 

721 ztrsen_lwork 

722 

723 strsyl 

724 dtrsyl 

725 ctrsyl 

726 ztrsyl 

727 

728 strtri 

729 dtrtri 

730 ctrtri 

731 ztrtri 

732 

733 strtrs 

734 dtrtrs 

735 ctrtrs 

736 ztrtrs 

737 

738 strttf 

739 dtrttf 

740 ctrttf 

741 ztrttf 

742 

743 strttp 

744 dtrttp 

745 ctrttp 

746 ztrttp 

747 

748 stzrzf 

749 dtzrzf 

750 ctzrzf 

751 ztzrzf 

752 

753 stzrzf_lwork 

754 dtzrzf_lwork 

755 ctzrzf_lwork 

756 ztzrzf_lwork 

757 

758 cunghr 

759 zunghr 

760 

761 cunghr_lwork 

762 zunghr_lwork 

763 

764 cungqr 

765 zungqr 

766 

767 cungrq 

768 zungrq 

769 

770 cunmqr 

771 zunmqr 

772 

773 sgeqrt 

774 dgeqrt 

775 cgeqrt 

776 zgeqrt 

777 

778 sgemqrt 

779 dgemqrt 

780 cgemqrt 

781 zgemqrt 

782 

783 sgttrf 

784 dgttrf 

785 cgttrf 

786 zgttrf 

787 

788 sgttrs 

789 dgttrs 

790 cgttrs 

791 zgttrs 

792 

793 stpqrt 

794 dtpqrt 

795 ctpqrt 

796 ztpqrt 

797 

798 stpmqrt 

799 dtpmqrt 

800 ctpmqrt 

801 ztpmqrt 

802 

803 cuncsd 

804 zuncsd 

805 

806 cuncsd_lwork 

807 zuncsd_lwork 

808 

809 cunmrz 

810 zunmrz 

811 

812 cunmrz_lwork 

813 zunmrz_lwork 

814 

815 ilaver 

816 

817""" 

818# 

819# Author: Pearu Peterson, March 2002 

820# 

821 

822import numpy as _np 

823from .blas import _get_funcs, _memoize_get_funcs 

824from scipy.linalg import _flapack 

825from re import compile as regex_compile 

826try: 

827 from scipy.linalg import _clapack 

828except ImportError: 

829 _clapack = None 

830 

831try: 

832 from scipy.linalg import _flapack_64 

833 HAS_ILP64 = True 

834except ImportError: 

835 HAS_ILP64 = False 

836 _flapack_64 = None 

837 

838 

839# Expose all functions (only flapack --- clapack is an implementation detail) 

840empty_module = None 

841from scipy.linalg._flapack import * 

842del empty_module 

843 

844__all__ = ['get_lapack_funcs'] 

845 

846# some convenience alias for complex functions 

847_lapack_alias = { 

848 'corghr': 'cunghr', 'zorghr': 'zunghr', 

849 'corghr_lwork': 'cunghr_lwork', 'zorghr_lwork': 'zunghr_lwork', 

850 'corgqr': 'cungqr', 'zorgqr': 'zungqr', 

851 'cormqr': 'cunmqr', 'zormqr': 'zunmqr', 

852 'corgrq': 'cungrq', 'zorgrq': 'zungrq', 

853} 

854 

855 

856# Place guards against docstring rendering issues with special characters 

857p1 = regex_compile(r'with bounds (?P<b>.*?)( and (?P<s>.*?) storage){0,1}\n') 

858p2 = regex_compile(r'Default: (?P<d>.*?)\n') 

859 

860 

861def backtickrepl(m): 

862 if m.group('s'): 

863 return ('with bounds ``{}`` with ``{}`` storage\n' 

864 ''.format(m.group('b'), m.group('s'))) 

865 else: 

866 return 'with bounds ``{}``\n'.format(m.group('b')) 

867 

868 

869for routine in [ssyevr, dsyevr, cheevr, zheevr, 

870 ssyevx, dsyevx, cheevx, zheevx, 

871 ssygvd, dsygvd, chegvd, zhegvd]: 

872 if routine.__doc__: 

873 routine.__doc__ = p1.sub(backtickrepl, routine.__doc__) 

874 routine.__doc__ = p2.sub('Default ``\\1``\n', routine.__doc__) 

875 else: 

876 continue 

877 

878del regex_compile, p1, p2, backtickrepl 

879 

880 

881@_memoize_get_funcs 

882def get_lapack_funcs(names, arrays=(), dtype=None, ilp64=False): 

883 """Return available LAPACK function objects from names. 

884 

885 Arrays are used to determine the optimal prefix of LAPACK routines. 

886 

887 Parameters 

888 ---------- 

889 names : str or sequence of str 

890 Name(s) of LAPACK functions without type prefix. 

891 

892 arrays : sequence of ndarrays, optional 

893 Arrays can be given to determine optimal prefix of LAPACK 

894 routines. If not given, double-precision routines will be 

895 used, otherwise the most generic type in arrays will be used. 

896 

897 dtype : str or dtype, optional 

898 Data-type specifier. Not used if `arrays` is non-empty. 

899 

900 ilp64 : {True, False, 'preferred'}, optional 

901 Whether to return ILP64 routine variant. 

902 Choosing 'preferred' returns ILP64 routine if available, and 

903 otherwise the 32-bit routine. Default: False 

904 

905 Returns 

906 ------- 

907 funcs : list 

908 List containing the found function(s). 

909 

910 Notes 

911 ----- 

912 This routine automatically chooses between Fortran/C 

913 interfaces. Fortran code is used whenever possible for arrays with 

914 column major order. In all other cases, C code is preferred. 

915 

916 In LAPACK, the naming convention is that all functions start with a 

917 type prefix, which depends on the type of the principal 

918 matrix. These can be one of {'s', 'd', 'c', 'z'} for the NumPy 

919 types {float32, float64, complex64, complex128} respectively, and 

920 are stored in attribute ``typecode`` of the returned functions. 

921 

922 Examples 

923 -------- 

924 Suppose we would like to use '?lange' routine which computes the selected 

925 norm of an array. We pass our array in order to get the correct 'lange' 

926 flavor. 

927 

928 >>> import numpy as np 

929 >>> import scipy.linalg as LA 

930 >>> rng = np.random.default_rng() 

931 

932 >>> a = rng.random((3,2)) 

933 >>> x_lange = LA.get_lapack_funcs('lange', (a,)) 

934 >>> x_lange.typecode 

935 'd' 

936 >>> x_lange = LA.get_lapack_funcs('lange',(a*1j,)) 

937 >>> x_lange.typecode 

938 'z' 

939 

940 Several LAPACK routines work best when its internal WORK array has 

941 the optimal size (big enough for fast computation and small enough to 

942 avoid waste of memory). This size is determined also by a dedicated query 

943 to the function which is often wrapped as a standalone function and 

944 commonly denoted as ``###_lwork``. Below is an example for ``?sysv`` 

945 

946 >>> a = rng.random((1000, 1000)) 

947 >>> b = rng.random((1000, 1)) * 1j 

948 >>> # We pick up zsysv and zsysv_lwork due to b array 

949 ... xsysv, xlwork = LA.get_lapack_funcs(('sysv', 'sysv_lwork'), (a, b)) 

950 >>> opt_lwork, _ = xlwork(a.shape[0]) # returns a complex for 'z' prefix 

951 >>> udut, ipiv, x, info = xsysv(a, b, lwork=int(opt_lwork.real)) 

952 

953 """ 

954 if isinstance(ilp64, str): 

955 if ilp64 == 'preferred': 

956 ilp64 = HAS_ILP64 

957 else: 

958 raise ValueError("Invalid value for 'ilp64'") 

959 

960 if not ilp64: 

961 return _get_funcs(names, arrays, dtype, 

962 "LAPACK", _flapack, _clapack, 

963 "flapack", "clapack", _lapack_alias, 

964 ilp64=False) 

965 else: 

966 if not HAS_ILP64: 

967 raise RuntimeError("LAPACK ILP64 routine requested, but Scipy " 

968 "compiled only with 32-bit BLAS") 

969 return _get_funcs(names, arrays, dtype, 

970 "LAPACK", _flapack_64, None, 

971 "flapack_64", None, _lapack_alias, 

972 ilp64=True) 

973 

974 

975_int32_max = _np.iinfo(_np.int32).max 

976_int64_max = _np.iinfo(_np.int64).max 

977 

978 

979def _compute_lwork(routine, *args, **kwargs): 

980 """ 

981 Round floating-point lwork returned by lapack to integer. 

982 

983 Several LAPACK routines compute optimal values for LWORK, which 

984 they return in a floating-point variable. However, for large 

985 values of LWORK, single-precision floating point is not sufficient 

986 to hold the exact value --- some LAPACK versions (<= 3.5.0 at 

987 least) truncate the returned integer to single precision and in 

988 some cases this can be smaller than the required value. 

989 

990 Examples 

991 -------- 

992 >>> from scipy.linalg import lapack 

993 >>> n = 5000 

994 >>> s_r, s_lw = lapack.get_lapack_funcs(('sysvx', 'sysvx_lwork')) 

995 >>> lwork = lapack._compute_lwork(s_lw, n) 

996 >>> lwork 

997 32000 

998 

999 """ 

1000 dtype = getattr(routine, 'dtype', None) 

1001 int_dtype = getattr(routine, 'int_dtype', None) 

1002 ret = routine(*args, **kwargs) 

1003 if ret[-1] != 0: 

1004 raise ValueError("Internal work array size computation failed: " 

1005 "%d" % (ret[-1],)) 

1006 

1007 if len(ret) == 2: 

1008 return _check_work_float(ret[0].real, dtype, int_dtype) 

1009 else: 

1010 return tuple(_check_work_float(x.real, dtype, int_dtype) 

1011 for x in ret[:-1]) 

1012 

1013 

1014def _check_work_float(value, dtype, int_dtype): 

1015 """ 

1016 Convert LAPACK-returned work array size float to integer, 

1017 carefully for single-precision types. 

1018 """ 

1019 

1020 if dtype == _np.float32 or dtype == _np.complex64: 

1021 # Single-precision routine -- take next fp value to work 

1022 # around possible truncation in LAPACK code 

1023 value = _np.nextafter(value, _np.inf, dtype=_np.float32) 

1024 

1025 value = int(value) 

1026 if int_dtype.itemsize == 4: 

1027 if value < 0 or value > _int32_max: 

1028 raise ValueError("Too large work array required -- computation " 

1029 "cannot be performed with standard 32-bit" 

1030 " LAPACK.") 

1031 elif int_dtype.itemsize == 8: 

1032 if value < 0 or value > _int64_max: 

1033 raise ValueError("Too large work array required -- computation" 

1034 " cannot be performed with standard 64-bit" 

1035 " LAPACK.") 

1036 return value