Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add an explicit return of ZERO in functions that have alternative
return locations where result value was not set
  • Loading branch information
repagh committed Jun 10, 2017
commit c1cb581c4e098aceaccfa40a706b24c806b1cdb0
5 changes: 4 additions & 1 deletion slycot/src/AB13AD.f
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ DOUBLE PRECISION FUNCTION AB13AD( DICO, EQUIL, N, M, P, ALPHA, A,
C Nov. 1998, V. Sima, Research Institute for Informatics, Bucharest.
C Dec. 1998, V. Sima, Katholieke Univ. Leuven, Leuven.
C Oct. 2001, V. Sima, Research Institute for Informatics, Bucharest.
C Jun. 2017, RvP, made 1st error return value zero
C
C KEYWORDS
C
Expand Down Expand Up @@ -260,8 +261,10 @@ DOUBLE PRECISION FUNCTION AB13AD( DICO, EQUIL, N, M, P, ALPHA, A,
C
IF( INFO.NE.0 ) THEN
C
C Error return.
C Error return.
C
C
AB13AD = ZERO
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this related to the deprecated LAPACK functions? If not, could we maybe do these in a separate PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, this was just to get the warnings out.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I didn't do that in a separate branch though. Would be some work to split it off.

CALL XERBLA( 'AB13AD', -INFO )
RETURN
END IF
Expand Down
1 change: 1 addition & 0 deletions slycot/src/AB13AX.f
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ DOUBLE PRECISION FUNCTION AB13AX( DICO, N, M, P, A, LDA, B, LDB,
C
C Error return.
C
AB13AX = ZERO
CALL XERBLA( 'AB13AX', -INFO )
RETURN
END IF
Expand Down
2 changes: 2 additions & 0 deletions slycot/src/AB13BD.f
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ DOUBLE PRECISION FUNCTION AB13BD( DICO, JOBN, N, M, P, A, LDA,
C
C Error return.
C
AB13BD = ZERO
CALL XERBLA( 'AB13BD', -INFO )
RETURN
END IF
Expand All @@ -300,6 +301,7 @@ DOUBLE PRECISION FUNCTION AB13BD( DICO, JOBN, N, M, P, A, LDA,
C
S2NORM = DLANGE( 'Frobenius', P, M, D, LDD, DWORK )
IF( .NOT.DISCR .AND. S2NORM.NE.ZERO ) THEN
AB13BD = ZERO
INFO = 5
RETURN
END IF
Expand Down
7 changes: 6 additions & 1 deletion slycot/src/AB13CD.f
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,17 @@ DOUBLE PRECISION FUNCTION AB13CD( N, M, NP, A, LDA, B, LDB, C,
INFO = -17
END IF
IF( INFO.NE.0 ) THEN
AB13CD = ZERO
CALL XERBLA( 'AB13CD', -INFO )
RETURN
END IF
C
C Quick return if possible.
C
IF( M.EQ.0 .OR. NP.EQ.0 ) RETURN
IF( M.EQ.0 .OR. NP.EQ.0 ) THEN
AB13CD = ZERO
RETURN
END IF
C
C Workspace usage.
C
Expand All @@ -262,6 +266,7 @@ DOUBLE PRECISION FUNCTION AB13CD( N, M, NP, A, LDA, B, LDB, C,
$ INFO2 )
IF( INFO2.GT.0 ) THEN
INFO = 4
AB13CD = ZERO
RETURN
END IF
GAMMAL = DWORK( IW6+1 )
Expand Down
5 changes: 5 additions & 0 deletions slycot/src/AB13DX.f
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ DOUBLE PRECISION FUNCTION AB13DX( DICO, JOBE, JOBD, N, M, P,
END IF
C
IF( INFO.NE.0 ) THEN
AB13DX = ZERO
CALL XERBLA( 'AB13DX', -INFO )
RETURN
END IF
Expand Down Expand Up @@ -360,6 +361,7 @@ DOUBLE PRECISION FUNCTION AB13DX( DICO, JOBE, JOBD, N, M, P,
$ LDWORK-IWRK+1, IERR )
IF( IERR.GT.0 ) THEN
INFO = N + 1
AB13DX = ZERO
RETURN
END IF
AB13DX = DWORK( IS )
Expand Down Expand Up @@ -391,6 +393,7 @@ DOUBLE PRECISION FUNCTION AB13DX( DICO, JOBE, JOBD, N, M, P,
INFO = IERR
DWORK( 1 ) = ONE
CWORK( 1 ) = ONE
AB13DX = ZERO
RETURN
END IF
CALL MB02RD( 'No Transpose', N, M, A, LDA, IWORK, B, LDB,
Expand All @@ -415,6 +418,7 @@ DOUBLE PRECISION FUNCTION AB13DX( DICO, JOBE, JOBD, N, M, P,
END IF
IF( IERR.GT.0 ) THEN
INFO = N + 1
AB13DX = ZERO
RETURN
END IF
C
Expand Down Expand Up @@ -515,6 +519,7 @@ DOUBLE PRECISION FUNCTION AB13DX( DICO, JOBE, JOBD, N, M, P,
INFO = IERR
DWORK( 1 ) = ONE
CWORK( 1 ) = ICWK - 1
AB13DX = ZERO
RETURN
END IF
CALL MB02RZ( 'No Transpose', N, M, CWORK, N, IWORK,
Expand Down
1 change: 1 addition & 0 deletions slycot/src/MB03ND.f
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ INTEGER FUNCTION MB03ND( N, THETA, Q2, E2, PIVMIN, INFO )
C
C Error return.
C
MB03ND = ZERO
CALL XERBLA( 'MB03ND', -INFO )
RETURN
END IF
Expand Down
3 changes: 3 additions & 0 deletions slycot/src/MB03NY.f
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ DOUBLE PRECISION FUNCTION MB03NY( N, OMEGA, A, LDA, S, DWORK,
C
C Error return.
C
MB03NY = ZERO
CALL XERBLA( 'MB03NY', -INFO )
RETURN
END IF
Expand All @@ -177,6 +178,7 @@ DOUBLE PRECISION FUNCTION MB03NY( N, OMEGA, A, LDA, S, DWORK,
$ 1, DUMMY, 1, DWORK, LDWORK, INFO )
IF ( INFO.NE.0 ) THEN
INFO = 2
MB03NY = ZERO
RETURN
END IF
ELSE
Expand All @@ -196,6 +198,7 @@ DOUBLE PRECISION FUNCTION MB03NY( N, OMEGA, A, LDA, S, DWORK,
$ DWORK, INFO )
IF ( INFO.NE.0 ) THEN
INFO = 2
MB03NY = ZERO
RETURN
END IF
CWORK(1) = CWORK(N*N+1) + DBLE( N*N ) * CONE
Expand Down