28 real(dp),
intent(in) :: a(:, :)
29 real(dp) :: b(size(a, dim=2), size(a, dim=1))
33 real(dp),
dimension(:, :),
allocatable :: u
34 real(dp),
dimension(:, :),
allocatable :: vt
35 real(dp),
dimension(:, :),
allocatable :: sigma
40 CALL svd(a, u, sigma, vt)
44 if (dabs(sigma(pos, pos)) <
dprec)
then
45 sigma(pos, pos) = 0.0_dp
47 sigma(pos, pos) = 1.0_dp / sigma(pos, pos)
51 b = matmul(transpose(vt), matmul(transpose(sigma), transpose(u)))
This module contains simulation constants.
real(dp), parameter dprec
real constant machine precision
This module defines variable data types.
real(dp) function, dimension(size(a, dim=2), size(a, dim=1)), public pinv(A)
pure subroutine, public svd(A, U, S, VT)
Singular Value Decomposition.