V3FIT
Main Page
Related Pages
Modules
Modules List
Module Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions/Subroutines
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Data Types List
Data Types List
Data Types
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
~
Functions/Subroutines
a
b
c
d
e
f
g
i
l
m
n
p
r
s
t
u
v
x
y
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Files
File List
File Members
All
b
c
g
i
l
m
n
p
t
v
w
Functions/Subroutines
b
c
g
i
m
p
t
v
w
Variables
Enumerations
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Macros
Pages
LIBSTELL
Sources
SVDpack
svdinv2.f
1
SUBROUTINE
svdinv2 (amat, u, vt, w, m)
2
!
3
! Computes PSEUDO-INVERSE of AMAT, Given SVD matrices u,v and
4
! weight array w
5
!
6
! MIMICS svdinv, but uses u, vt, w computed from Lapack
7
! IT IS ASSUMED THAT THE ORDERED WEIGHT ARRAY w HAS BEEN SET
8
! (EXTERNALLY) TO ZERO WHERE THE WEIGHTS ARE TO BE NEGLECTED
9
!
10
!
11
USE
stel_kinds
12
IMPLICIT NONE
13
!-----------------------------------------------
14
! D u m m y A r g u m e n t s
15
!C-----------------------------------------------
16
INTEGER
,
INTENT(in)
:: m
17
REAL
(rprec),
DIMENSION(m,m)
,
INTENT(out)
:: amat
18
REAL
(rprec),
DIMENSION(m,m)
,
INTENT(inout)
:: u, vt
19
REAL
(rprec),
DIMENSION(m)
:: w
20
!-----------------------------------------------
21
! L o c a l P a r a m e t e r s
22
!-----------------------------------------------
23
REAL
(rprec) :: zero = 0
24
!-----------------------------------------------
25
! L o c a l V a r i a b l e s
26
!-----------------------------------------------
27
INTEGER
:: i, j
28
!-----------------------------------------------
29
!
30
! APEUDO-INV = V * WINV * UT
31
! RECALL, VT = TRANSPOSE(V)
32
!
33
34
DO
i = 1, m
35
IF
(w(i) .gt. zero)
THEN
36
!divide ith row of Utr by w(i)
37
u(:m,i) = u(:m,i)/w(i)
38
ELSE
39
!zero the infinite 1/weights
40
u(:m,i) = zero
!1.E-10_dp*u(:m,i)
41
END IF
42
END DO
43
44
45
amat = matmul(transpose(vt), transpose(u))
46
47
END SUBROUTINE
svdinv2
Generated on Thu Mar 5 2020 15:49:25 for V3FIT by
1.8.17