8000 Add ab04md wrapper · python-control/Slycot@0b3dc1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b3dc1a

Browse files
committed
Add ab04md wrapper
1 parent d844e7b commit 0b3dc1a

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

slycot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# import slycot.examples
1414

1515
# Analysis routines (15/40 wrapped)
16-
from .analysis import ab01nd, ab05md, ab05nd, ab07nd, ab08nd, ab08nz
16+
from .analysis import ab01nd, ab04md, ab05md, ab05nd, ab07nd, ab08nd, ab08nz
1717
from .analysis import ab09ad, ab09ax, ab09bd, ab09md, ab09nd
1818
from .analysis import ab13bd, ab13dd, ab13ed, ab13fd, ab13md
1919

slycot/analysis.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,23 @@ def ab01nd(n, m, A, B, jobz='N', tol=0, ldwork=None):
139139
Z = None
140140
return Ac, Bc, ncont, indcon, nblk, Z, tau
141141

142+
def ab04md(type_bn, n, m, p, A, B, C, D, alpha=1.0, beta=1.0, ldwork=None):
143+
""" a,b,c,d = ab04md()
144+
"""
145+
146+
hidden = ' (hidden by the wrapper)'
147+
arg_list = ['type_bn', 'n', 'm', 'p', 'alpha', 'beta',
148+
'A', 'LDA'+hidden, 'B', 'LDB'+hidden, 'C', 'LDC'+hidden, 'D', 'LDD'+hidden,
149+
'IWORK'+hidden, 'DWORK'+hidden, 'ldwork', 'info'+hidden]
150+
151+
if ldwork is None:
152+
ldwork = max(n, 3*m)
153+
154+
out = _wrapper.ab04md(type_bn, n, m, p, alpha, beta, A, B, C, D, ldwork=ldwork)
155+
info=out[-1]
156+
raise_if_slycot_error(info, arg_list)
157+
158+
return out[:-1]
142159

143160
def ab05md(n1,m1,p1,n2,p2,A1,B1,C1,D1,A2,B2,C2,D2,uplo='U'):
144161
""" n,a,b,c,d = ab05md(n1,m1,p1,n2,p2,a1,b1,c1,d1,a2,b2,c2,d2,[uplo])

slycot/src/analysis.pyf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,26 @@ subroutine ab01nd(jobz,n,m,a,lda,b,ldb,ncont,indcon,nblk,z,ldz,tau,tol,iwork,dwo
1919
integer :: ldwork = max(n,3*m)
2020
integer intent(out) :: info
2121
end subroutine ab01nd
22+
subroutine ab04md(type_bn,n,m,p,alpha,beta,a,lda,b,ldb,c,ldc,d,ldd,iwork,dwork,ldwork,info) ! in AB04MD.f
23+
character :: type_bn
24+
integer check(n>=0) :: n
25+
integer check(m>=0) :: m
26+
integer check(p>=0) :: p
27+
double precision intent(in) :: alpha
28+
double precision intent(in) :: beta
29+
double precision intent(in,out,copy), dimension(n,n),depend(n) :: a
30+
integer intent(hide),depend(a) :: lda = shape(a,0)
31+
double precision intent(in,out,copy), dimension(n,m),depend(n,m) :: b
32+
integer intent(hide),depend(b) :: ldb = shape(b,0)
33+
double precision intent(in,out,copy), dimension(p,n),depend(n,p) :: c
34+
integer intent(hide),depend(c) :: ldc = shape(c,0)
35+
double precision intent(in,out,copy), dimension(p,m),depend(m,p) :: d
36+
integer intent(hide),depend(d) :: ldd = shape(d,0)
37+
integer intent(hide,cache),dimension(n),depend(n) :: iwork
38+
double precision intent(hide,cache),dimension(ldwork),depend(ldwork) :: dwork
39+
integer :: ldwork = max(1,n)
40+
integer intent(out) :: info
41+
end subroutine ab04md
2242
subroutine ab05md(uplo,over,n1,m1,p1,n2,p2,a1,lda1,b1,ldb1,c1,ldc1,d1,ldd1,a2,lda2,b2,ldb2,c2,ldc2,d2,ldd2,n,a,lda,b,ldb,c,ldc,d,ldd,dwork,ldwork,info) ! in AB05MD.f
2343
character :: uplo = 'U'
2444
character intent(hide) :: over = 'N' ! not sure how the overlap works

0 commit comments

Comments
 (0)
0