|
| 1 | +from typing import Any, Final, TypedDict, type_check_only |
| 2 | + |
| 3 | +import numpy as np |
| 4 | +from numpy._typing import NDArray |
| 5 | + |
| 6 | +from ._linalg import fortran_int |
| 7 | + |
| 8 | +### |
| 9 | + |
| 10 | +@type_check_only |
| 11 | +class _GELSD(TypedDict): |
| 12 | + m: int |
| 13 | + n: int |
| 14 | + nrhs: int |
| 15 | + lda: int |
| 16 | + ldb: int |
| 17 | + rank: int |
| 18 | + lwork: int |
| 19 | + info: int |
| 20 | + |
| 21 | +@type_check_only |
| 22 | +class _DGELSD(_GELSD): |
| 23 | + dgelsd_: int |
| 24 | + rcond: float |
| 25 | + |
| 26 | +@type_check_only |
| 27 | +class _ZGELSD(_GELSD): |
| 28 | + zgelsd_: int |
| 29 | + |
| 30 | +@type_check_only |
| 31 | +class _GEQRF(TypedDict): |
| 32 | + m: int |
| 33 | + n: int |
| 34 | + lda: int |
| 35 | + lwork: int |
| 36 | + info: int |
| 37 | + |
| 38 | +@type_check_only |
| 39 | +class _DGEQRF(_GEQRF): |
| 40 | + dgeqrf_: int |
| 41 | + |
| 42 | +@type_check_only |
| 43 | +class _ZGEQRF(_GEQRF): |
| 44 | + zgeqrf_: int |
| 45 | + |
| 46 | +@type_check_only |
| 47 | +class _DORGQR(TypedDict): |
| 48 | + dorgqr_: int |
| 49 | + info: int |
| 50 | + |
| 51 | +@type_check_only |
| 52 | +class _ZUNGQR(TypedDict): |
| 53 | + zungqr_: int |
| 54 | + info: int |
| 55 | + |
| 56 | +### |
| 57 | + |
| 58 | +_ilp64: Final[bool] = ... |
| 59 | + |
| 60 | +def dgelsd( |
| 61 | + m: int, |
| 62 | + n: int, |
| 63 | + nrhs: int, |
| 64 | + a: NDArray[np.float64], |
| 65 | + lda: int, |
| 66 | + b: NDArray[np.float64], |
| 67 | + ldb: int, |
| 68 | + s: NDArray[np.float64], |
| 69 | + rcond: float, |
| 70 | + rank: int, |
| 71 | + work: NDArray[np.float64], |
| 72 | + lwork: int, |
| 73 | + iwork: NDArray[fortran_int], |
| 74 | + info: int, |
| 75 | +) -> _DGELSD: ... |
| 76 | +def zgelsd( |
| 77 | + m: int, |
| 78 | + n: int, |
| 79 | + nrhs: int, |
| 80 | + a: NDArray[np.complex128], |
| 81 | + lda: int, |
| 82 | + b: NDArray[np.complex128], |
| 83 | + ldb: int, |
| 84 | + s: NDArray[np.float64], |
| 85 | + rcond: float, |
| 86 | + rank: int, |
| 87 | + work: NDArray[np.complex128], |
| 88 | + lwork: int, |
| 89 | + rwork: NDArray[np.float64], |
| 90 | + iwork: NDArray[fortran_int], |
| 91 | + info: int, |
| 92 | +) -> _ZGELSD: ... |
| 93 | + |
| 94 | +# |
| 95 | +def dgeqrf( |
| 96 | + m: int, |
| 97 | + n: int, |
| 98 | + a: NDArray[np.float64], # in/out, shape: (lda, n) |
| 99 | + lda: int, |
| 100 | + tau: NDArray[np.float64], # out, shape: (min(m, n),) |
| 101 | + work: NDArray[np.float64], # out, shape: (max(1, lwork),) |
| 102 | + lwork: int, |
| 103 | + info: int, # out |
| 104 | +) -> _DGEQRF: ... |
| 105 | +def zgeqrf( |
| 106 | + m: int, |
| 107 | + n: int, |
| 108 | + a: NDArray[np.complex128], # in/out, shape: (lda, n) |
| 109 | + lda: int, |
| 110 | + tau: NDArray[np.complex128], # out, shape: (min(m, n),) |
| 111 | + work: NDArray[np.complex128], # out, shape: (max(1, lwork),) |
| 112 | + lwork: int, |
| 113 | + info: int, # out |
| 114 | +) -> _ZGEQRF: ... |
| 115 | + |
| 116 | +# |
| 117 | +def dorgqr( |
| 118 | + m: int, # >=0 |
| 119 | + n: int, # m >= n >= 0 |
| 120 | + k: int, # n >= k >= 0 |
| 121 | + a: NDArray[np.float64], # in/out, shape: (lda, n) |
| 122 | + lda: int, # >= max(1, m) |
| 123 | + tau: NDArray[np.float64], # in, shape: (k,) |
| 124 | + work: NDArray[np.float64], # out, shape: (max(1, lwork),) |
| 125 | + lwork: int, |
| 126 | + info: int, # out |
| 127 | +) -> _DORGQR: ... |
| 128 | +def zungqr( |
| 129 | + m: int, |
| 130 | + n: int, |
| 131 | + k: int, |
| 132 | + a: NDArray[np.complex128], |
| 133 | + lda: int, |
| 134 | + tau: NDArray[np.complex128], |
| 135 | + work: NDArray[np.complex128], |
| 136 | + lwork: int, |
| 137 | + info: int, |
| 138 | +) -> _ZUNGQR: ... |
| 139 | + |
| 140 | +# |
| 141 | +def xerbla(srname: Any, info: int) -> None: ... |
0 commit comments