aboutsummaryrefslogtreecommitdiff
path: root/src/lapack.F90
blob: 58e64e11e37164da18bd82f856cf799d13716dfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
! $Header$

#include "cctk.h"

module lapack
  implicit none
  public
  
  ! ev: eigenvalues
  ! ge (general), gg (generalised eigenvalues), sb (symmetric banded),
  ! sp (symmetric packed), st (symmetric tridiagonal), sy (symmetric)
  
  interface geev
     subroutine sgeev (jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, &
          &            ldvr, work, lwork, info)
       character jobvl, jobvr
       integer   info, lda, ldvl, ldvr, lwork, n
       real      a(lda,n), vl(ldvl,n), vr(ldvr,n), &
            &    wi(n), work(lwork), wr(n)
     end subroutine sgeev
     subroutine dgeev (jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, &
          &            ldvr, work, lwork, info)
       character        jobvl, jobvr
       integer          info, lda, ldvl, ldvr, lwork, n
       double precision a(lda,n), vl(ldvl,n), vr(ldvr,n), &
            &           wi(n), work(lwork), wr(n)
     end subroutine dgeev
  end interface
  
  interface syev
     subroutine ssyev (jobz, uplo, n, a, lda, w, work, lwork, info)
       character jobz, uplo
       integer   info, lda, lwork, n
       real      a(lda,n), w(n), work(lwork)
     end subroutine ssyev
     subroutine dsyev (jobz, uplo, n, a, lda, w, work, lwork, info)
       character        jobz, uplo
       integer          info, lda, lwork, n
       double precision a(lda,n), w(n), work(lwork)
     end subroutine dsyev
  end interface
  
  
  
  ! sv: solve
  ! gb (general banded), ge (general), gt (general tridiagonal),
  ! pb (symmetric positive banded), po (symmetric positive),
  ! pp (symmetric positive packed), pt (symmetric positive tridiagonal),
  ! sp (symmetric packed), sy (symmetric)
  
  interface gesv
     subroutine sgesv (n, nrhs, a, lda, ipiv, b, ldb, info)
       implicit none
       integer n
       integer nrhs
       integer lda
       real    a(lda,n)
       integer ipiv(n)
       integer ldb
       real    b(ldb,nrhs)
       integer info
     end subroutine sgesv
     subroutine dgesv (n, nrhs, a, lda, ipiv, b, ldb, info)
       implicit none
       integer          n
       integer          nrhs
       integer          lda
       double precision a(lda,n)
       integer          ipiv(n)
       integer          ldb
       double precision b(ldb,nrhs)
       integer          info
     end subroutine dgesv
  end interface

  interface posv
     subroutine sposv (uplo, n, nrhs, a, lda, b, ldb, info)
       implicit none
       character uplo
       integer   n
       integer   nrhs
       integer   lda
       real      a(lda,n)
       integer   ldb
       real      b(ldb,nrhs)
       integer   info
     end subroutine sposv
     subroutine dposv (uplo, n, nrhs, a, lda, b, ldb, info)
       implicit none
       character        uplo
       integer          n
       integer          nrhs
       integer          lda
       double precision a(lda,n)
       integer          ldb
       double precision b(ldb,nrhs)
       integer          info
     end subroutine dposv
  end interface

  interface sysv
     subroutine ssysv (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
       implicit none
       character uplo
       integer   n
       integer   nrhs
       integer   lda
       real      a(lda,n)
       integer   ipiv(n)
       integer   ldb
       real      b(ldb,nrhs)
       integer   lwork
       real      work(lwork)
       integer   info
     end subroutine ssysv
     subroutine dsysv (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
       implicit none
       character        uplo
       integer          n
       integer          nrhs
       integer          lda
       double precision a(lda,n)
       integer          ipiv(n)
       integer          ldb
       double precision b(ldb,nrhs)
       integer          lwork
       double precision work(lwork)
       integer          info
     end subroutine dsysv
  end interface
  
  
  
  ! trf: LU factorisation
  ! gb (general banded), ge (general), gt (general tridiagonal),
  ! pb (symmetric positive banded), po (symmetric positive),
  ! pp (symmetric positive packed), pt (symmetric positive tridiagonal),
  ! sp (symmetric packed), sy (symmetric)
  
  interface sytrf
     subroutine ssytrf (m, n, a, lda, ipiv, info)
       implicit none
       integer m
       integer n
       integer lda
       real    a(lda,n)
       integer ipiv(n)
       integer info
     end subroutine ssytrf
     subroutine dsytrf (m, n, a, lda, ipiv, info)
       implicit none
       integer          m
       integer          n
       integer          lda
       double precision a(lda,n)
       integer          ipiv(n)
       integer          info
     end subroutine dsytrf
  end interface
  
end module lapack