KronLinInv  0.3
Kronecker-product-based linear inversion

◆ solvels()

subroutine, private 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 857 of file kronlininv.f08.

857  real(dp),intent(in) :: a(:,:),b(:,:)
858  real(dp),intent(out) :: sol(:,:)
859  integer,allocatable :: ipiv(:)
860  integer :: n,nrhs,lda,ldb
861  integer :: info
862  real(dp),allocatable :: a2(:,:)
863  ! External procedures defined in LAPACK
864  external dgesv
865  n = size(a,1)
866  nrhs = size(b,2)
867  allocate(a2(n,n))
868  a2 = a
869  lda = size(a,1)
870  allocate(ipiv(n))
871  ldb = size(b,1)
872  sol = b
873  call dgesv(n,nrhs,a2,lda,ipiv,sol,ldb,info)
874  if (info/=0) then
875  write(*,*) "linear system solver failed...'"
876  print*,'info: ',info
877  stop
878  end if
Here is the caller graph for this function: