|
From: glen herrmannsfeldt on 30 Mar 2008 02:20 widmar wrote: > Last revised in Nov. 2006 (by UTK, Berkeley, NAG) - clf's stringing > enthusiasts are invited to scale it to a string quartet subject to the > specs therein: > > logical function lsame (ca, cb) > character ca, cb > * > * LSAME returns .TRUE. if CA is the same letter as CB > * regardless of case. > * ... lsame=.true. if(ca.eq.cb) return lsame=.false. if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return lsame=.true. return end
From: widmar on 3 Apr 2008 15:52 glen herrmannsfeldt wrote: > > > logical function lsame (ca, cb) > > character ca, cb > > * > > * LSAME returns .TRUE. if CA is the same letter as CB > > * regardless of case. > > * ... > > lsame=.true. > if(ca.eq.cb) return > lsame=.false. > if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return > if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return > if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return > lsame=.true. > return > end Very clever - a quantum improvement, however team LAPACK probably won't allow the use of "ieor" intrinsic. btw, you missed one ) in each of the last three if statements.
From: widmar on 3 Apr 2008 15:52 glen herrmannsfeldt wrote: > > > logical function lsame (ca, cb) > > character ca, cb > > * > > * LSAME returns .TRUE. if CA is the same letter as CB > > * regardless of case. > > * ... > > lsame=.true. > if(ca.eq.cb) return > lsame=.false. > if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return > if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return > if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return > lsame=.true. > return > end Very clever - a quantum improvement, however team LAPACK probably won't allow the use of "ieor" intrinsic. btw, you missed one ) in each of the last three if statements.
From: widmar on 3 Apr 2008 15:53 glen herrmannsfeldt wrote: > > > logical function lsame (ca, cb) > > character ca, cb > > * > > * LSAME returns .TRUE. if CA is the same letter as CB > > * regardless of case. > > * ... > > lsame=.true. > if(ca.eq.cb) return > lsame=.false. > if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return > if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return > if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return > lsame=.true. > return > end Very clever - a quantum improvement, however team LAPACK probably won't allow the use of "ieor" intrinsic. btw, you missed one ) in each of the last three if statements.
From: robin on 12 Apr 2008 10:45 "glen herrmannsfeldt" <gah(a)ugcs.caltech.edu> wrote in message news:c6Kdna0xMtBKsnLanZ2dnUVZ_oimnZ2d(a)comcast.com... > widmar wrote: > > > Last revised in Nov. 2006 (by UTK, Berkeley, NAG) - clf's stringing > > enthusiasts are invited to scale it to a string quartet subject to the > > specs therein: > > > > logical function lsame (ca, cb) > > character ca, cb > > * > > * LSAME returns .TRUE. if CA is the same letter as CB > > * regardless of case. > > * ... > > lsame=.true. > if(ca.eq.cb) return > lsame=.false. > if((ca.lt.'a'.or.ca.gt.'z').and.(ca.lt.'A'.or.ca.gt.'Z') return > if((cb.lt.'a'.or.cb.gt.'z').and.(cb.lt.'A'.or.cb.gt.'Z') return > if(ieor(ichar(ca),ichar(cb)).ne.ieor(ichar('z'),ichar('Z'))return > lsame=.true. > return > end That isn't portable. Nor it is correct: the test for non-alphabetic characters comes after the test for equality??!
|
Pages: 1 Prev: what is wrong with this code?can someone walk me through this? Next: data with metadata |