Skip to content

addition of wrapper for mb03rd #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

addition of wrapper for mb03rd #73

wants to merge 2 commits into from

Conversation

repagh
Copy link
Member

@repagh repagh commented Aug 2, 2019

as requested in python-control list

@roryyorke
Copy link
Collaborator

I haven't looked at the test cases in detail, but otherwise this looks fine to me.

We can wait a few days to see if anyone will look over the test cases, otherwise go ahead and merge.

I think I'll mark all the OSX builds as being allowed to fail; they're unfortunately not currently useful :(. I'll open an issue for that.

@bnavigator
Copy link
Collaborator

How about testing for jobx='N' as well? It calls a different wrapper function and has a different return structure.

@repagh
Copy link
Member Author

repagh commented Sep 4, 2019

I haven't been able to locate a meaningful test case for that yet. Will try to do some more digging for that, any pointers are appreciated.

@bnavigator
Copy link
Collaborator

Shouldn't this go into math.py instead of transform.py?

@@ -528,3 +528,40 @@ subroutine tg01fd_uu(compq,compz,joba,l,n,m,p,a,lda,e,lde,b,ldb,c,ldc,q,ldq,z,ld
integer required intent(in) :: ldwork
integer intent(out) :: info
end subroutine tg01fd_uu
subroutine mb03rd_n(jobx,sort,n,pmax,a,lda,x,ldx,nblcks,blsize,wr,wi,tol,dwork,info) ! in MB03RD.f
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be just my personal opinion, but I don't think it is a good idea to introduce a specific wrapper for different job options with different parameter and return signatures when there is no use case and no unit test for it. Why not just keep one wrapper for the function, test that with the default job='U' and deal with 'N' as soon as it becomes relevant?

@bnavigator bnavigator mentioned this pull request Feb 1, 2020
If JOBX = 'N', this array is not referenced, and not returned
blksize : output rank-1 array('i') with bounds (n)
The orders of the resulting diagonal blocks of the matrix Ar.
W : output rank-1 array('c') size (n)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not fit the variable names in the call signature blcks,EIG

@@ -1353,4 +1353,110 @@ def tg01fd(l,n,m,p,A,E,B,C,Q=None,Z=None,compq='N',compz='N',joba='N',tol=0.0,ld

return A,E,B,C,ranke,rnka22,Q,Z

def mb03rd(n,A,X=None,jobx='U',sort='N',pmax=1.0,tol=0.0):
""" A,X,blcks,EIG = mb03rd(n,A,[X,job,sort,pmax,tol]) -- if jobx='U'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually returns _,_,_,Wr,Wi not one EIG. Would suggest converting to complex array as in #88

@@ -1353,4 +1353,110 @@ def tg01fd(l,n,m,p,A,E,B,C,Q=None,Z=None,compq='N',compz='N',joba='N',tol=0.0,ld

return A,E,B,C,ranke,rnka22,Q,Z

def mb03rd(n,A,X=None,jobx='U',sort='N',pmax=1.0,tol=0.0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Belongs into math.py

@@ -528,3 +528,40 @@ subroutine tg01fd_uu(compq,compz,joba,l,n,m,p,a,lda,e,lde,b,ldb,c,ldc,q,ldq,z,ld
integer required intent(in) :: ldwork
integer intent(out) :: info
end subroutine tg01fd_uu
subroutine mb03rd_n(jobx,sort,n,pmax,a,lda,x,ldx,nblcks,blsize,wr,wi,tol,dwork,info) ! in MB03RD.f
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to math.pyf?

@@ -150,12 +150,12 @@ script:
# Local unit tests
# TODO: replace with nose?
- cd ..
# Additional packages required for testing
- conda install scipy matplotlib
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adressed in #93

A, X = schur(test1_A)
Ah, Xh = np.copy(A), np.copy(X)
# on this basis, get the transform
Ar, Xr, blks, eig = transform.mb03rd(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert correct eig as well (complex?)

bnavigator added a commit to bnavigator/Slycot that referenced this pull request May 3, 2020
Based on PR python-control#73 by @repagh

Moved from transform to math
single wrapper for all jobx parameter valies
docstring in numpydoc (python-control#100)
run all jobx and sort parameter values in test
check the returned complex eigenvalues in test
bnavigator added a commit to bnavigator/Slycot that referenced this pull request May 3, 2020
Based on PR python-control#73 by @repagh

Moved from transform to math
single wrapper for all jobx parameter valies
docstring in numpydoc (python-control#100)
run all jobx and sort parameter values in test
check the returned complex eigenvalues in test
bnavigator added a commit to bnavigator/Slycot that referenced this pull request May 3, 2020
Based on PR python-control#73 by @repagh

Moved from transform to math
single wrapper for all jobx parameter valies
docstring in numpydoc (python-control#100)
run all jobx and sort parameter values in test
check the returned complex eigenvalues in test
bnavigator added a commit to bnavigator/Slycot that referenced this pull request May 3, 2020
Based on PR python-control#73 by @repagh

Moved from transform to math
single wrapper for all jobx parameter valies
docstring in numpydoc (python-control#100)
run all jobx and sort parameter values in test
check the returned complex eigenvalues in test
@repagh
Copy link
Member Author

repagh commented May 3, 2020

Superseded by #116

@repagh repagh closed this May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants