KronLinInv  0.3
Kronecker-product-based linear inversion

◆ solvels()

subroutine, private ompi_kronlininv::solvels ( real(dp), dimension(:,:), intent(in)  A,
real(dp), dimension(:,:), intent(in)  B,
real(dp), dimension(:,:), intent(out)  sol 
)
private

Solves a linear system AX = B, real numbers

Parameters
[in]Acoefficients matrix (linear operator)
[in]Bmatrix
[out]solsolution to the linear system (matrix)
Date
5/8/2016 - Initial Version

Definition at line 1207 of file ompi_kronlininv.f08.

1207  real(dp),intent(in) :: a(:,:),b(:,:)
1208  real(dp),intent(out) :: sol(:,:)
1209  integer,allocatable :: ipiv(:)
1210  integer :: n,nrhs,lda,ldb
1211  integer :: info
1212  real(dp),allocatable :: a2(:,:)
1213  ! External procedures defined in LAPACK
1214  external dgesv
1215  n = size(a,1)
1216  nrhs = size(b,2)
1217  allocate(a2(n,n))
1218  a2 = a
1219  lda = size(a,1)
1220  allocate(ipiv(n))
1221  ldb = size(b,1)
1222  sol = b
1223  call dgesv(n,nrhs,a2,lda,ipiv,sol,ldb,info)
1224  if (info/=0) then
1225  write(*,*) "linear system solver failed...'"
1226  print*,'info: ',info
1227  stop
1228  end if
Here is the caller graph for this function: