Statistics
| Branch: | Revision:

root / synthbench / euroben-dm / mod2ci / .svn / text-base / rotf.f.svn-base @ 0:839f52ef7657

History | View | Annotate | Download (873 Bytes)

1
      Subroutine rotf( arg, c, s )
2
! ----------------------------------------------------------------------
3
! --- Recovers rotation factors c & s from 'arg' for the Givens
4
!     transformation (used in rgmres).
5
! ----------------------------------------------------------------------
6
      Use         numerics
7
      Use         floptime
8
      Implicit    None
9

    
10
      Real(l_) :: arg, c, s
11
! ----------------------------------------------------------------------
12
      If ( arg == 0.0_l_ ) Then
13
         c = 0.0_l_
14
         s = 1.0_l_
15
      Else If ( Abs( arg ) < 1.0_l_ ) Then
16
         s = 2.0_l_*arg
17
         c = Sqrt( 1.0_l_ - s*s )
18
         flops = flops + 12
19
      Else
20
         c = 2.0_l_/arg
21
         s = Sqrt( 1.0_l_ - c*c )
22
         flops = flops + 12
23
      End If
24
! ----------------------------------------------------------------------
25
      End Subroutine rotf