summaryrefslogtreecommitdiff
path: root/SRC/ilaclr.f
diff options
context:
space:
mode:
authorjason <jason@8a072113-8704-0410-8d35-dd094bca7971>2008-12-30 21:27:12 +0000
committerjason <jason@8a072113-8704-0410-8d35-dd094bca7971>2008-12-30 21:27:12 +0000
commit61e82a389d6bdbdb610d200153937c38c6f6051a (patch)
tree2c16705f27176c833e640589fae73d93af3ffb0b /SRC/ilaclr.f
parentff981f106bde4ce6a74aa4f4a572c943f5a395b2 (diff)
downloadlapack-61e82a389d6bdbdb610d200153937c38c6f6051a.tar.gz
lapack-61e82a389d6bdbdb610d200153937c38c6f6051a.tar.bz2
lapack-61e82a389d6bdbdb610d200153937c38c6f6051a.zip
Merged revisions 609-614 via svnmerge from
https://jason@icl.cs.utk.edu/svn/lapack-dev/lapack/branches/SC08-release ........ r609 | julie | 2008-12-16 17:17:52 -0500 (Tue, 16 Dec 2008) | 1 line Polish routines to fit the LAPACK framework and allow manpages generation ........ r610 | langou | 2008-12-19 12:12:38 -0500 (Fri, 19 Dec 2008) | 30 lines bug reported on the forum https://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=854 the complete thread is available at http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/635192e11beadb93# Tobias Burnus also sent us an email: > Hello, > > this was reported at > http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/635192e11beadb93# > > The problem is the line 47: > > 47: IF( M.EQ.0 .OR. A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN > > If M == 0 the one accesses A(0,1) which is invalid as the lower bound is 1 > and not 0. > > Note: Contrary to C there is no left-to-right evaluation of expressions in > Fortran; the order is left to the compiler. One might assume that a smart > compiler does not evaluate "A(M,1)" if "M==0", however, there is nothing in > the standard guarantees this. > > If bounds checks are turned on (see post at the URL above), gfortran aborts > with an out-of-bounds error. ........ r611 | julie | 2008-12-19 15:00:58 -0500 (Fri, 19 Dec 2008) | 5 lines Modify the formatting of the comments. Replace Note and Notes section by Further Details This allow the manpages to be generated corectly. ........ r612 | julie | 2008-12-19 16:29:21 -0500 (Fri, 19 Dec 2008) | 3 lines Reformat the xblas routines comments to be able to generate the manpages ........ r613 | julie | 2008-12-19 16:30:31 -0500 (Fri, 19 Dec 2008) | 1 line Update version number ........ r614 | jason | 2008-12-27 09:44:45 -0500 (Sat, 27 Dec 2008) | 13 lines Fix non-short-circuited tests in ILAxL{C,R}. Fortran doesn't short-circuit logical operators, so the check that the leading dimension /= 0 may not prevent indexing into a 0-length array. Reported by "hes selex" in http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/635192e11beadb93 and forwarded to the LAPACK maintainers by Tobias Burnus <burnus@net-b.de>. Chalk up more bugs found by gfortran's diagnostics! Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu> Cc: Tobias Burnus <burnus@net-b.de> ........
Diffstat (limited to 'SRC/ilaclr.f')
-rw-r--r--SRC/ilaclr.f84
1 files changed, 43 insertions, 41 deletions
diff --git a/SRC/ilaclr.f b/SRC/ilaclr.f
index 2a9f9803..fed0653c 100644
--- a/SRC/ilaclr.f
+++ b/SRC/ilaclr.f
@@ -1,53 +1,55 @@
INTEGER FUNCTION ILACLR(M, N, A, LDA)
IMPLICIT NONE
-!
-! -- LAPACK auxiliary routine (version 3.2) --
-! Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
-! December 2007
-!
-! .. Scalar Arguments ..
+*
+* -- LAPACK auxiliary routine (version 3.2) --
+* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
+* December 2007
+*
+* .. Scalar Arguments ..
INTEGER M, N, LDA
-! ..
-! .. Array Arguments ..
+* ..
+* .. Array Arguments ..
COMPLEX A( LDA, * )
-! ..
-!
-! Purpose
-! =======
-!
-! ILACLR scans A for its last non-zero row.
-!
-! Arguments
-! =========
-!
-! M (input) INTEGER
-! The number of rows of the matrix A.
-!
-! N (input) INTEGER
-! The number of columns of the matrix A.
-!
-! A (input) COMPLEX array, dimension (LDA,N)
-! The m by n matrix A.
-!
-! LDA (input) INTEGER
-! The leading dimension of the array A. LDA >= max(1,M).
-!
-! =====================================================================
-!
-! .. Parameters ..
+* ..
+*
+* Purpose
+* =======
+*
+* ILACLR scans A for its last non-zero row.
+*
+* Arguments
+* =========
+*
+* M (input) INTEGER
+* The number of rows of the matrix A.
+*
+* N (input) INTEGER
+* The number of columns of the matrix A.
+*
+* A (input) COMPLEX array, dimension (LDA,N)
+* The m by n matrix A.
+*
+* LDA (input) INTEGER
+* The leading dimension of the array A. LDA >= max(1,M).
+*
+* =====================================================================
+*
+* .. Parameters ..
COMPLEX ZERO
PARAMETER ( ZERO = (0.0E+0, 0.0E+0) )
-! ..
-! .. Local Scalars ..
+* ..
+* .. Local Scalars ..
INTEGER I, J
-! ..
-! .. Executable Statements ..
-!
-! Quick test for the common case where one corner is non-zero.
- IF( M.EQ.0 .OR. A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
+* ..
+* .. Executable Statements ..
+*
+* Quick test for the common case where one corner is non-zero.
+ IF( M.EQ.0 ) THEN
+ ILACLR = M
+ ELSE IF( A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
ILACLR = M
ELSE
-! Scan up each column tracking the last zero row seen.
+* Scan up each column tracking the last zero row seen.
ILACLR = 0
DO J = 1, N
DO I = M, 1, -1