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