25  use, 
intrinsic :: iso_fortran_env
 
  132    real(real64), 
intent(in) :: x, y
 
  133    real(real64), 
optional, 
intent(in) :: rtol
 
  134    real(real64), 
optional, 
intent(in) :: atol
 
  135    real(real64) :: atol_, rtol_
 
  145    complex(real64), 
intent(in) :: x, y
 
  146    real(real64), 
optional, 
intent(in) :: rtol
 
  147    real(real64), 
optional, 
intent(in) :: atol
 
  148    real(real64) :: atol_, rtol_
 
  161    integer, 
intent(in) :: dim
 
  162    integer, 
intent(in) :: diag
 
  163    integer :: matrix(dim, dim)
 
  169      matrix(ii, ii) = diag
 
  176    integer, 
intent(in) :: n
 
  177    real(real64),   
intent(in) :: x
 
  195  recursive function factorial (n) 
RESULT (fac)
 
  196    integer, 
intent(in) :: n
 
  212    real(real64),   
intent(in) :: xx(3)
 
  213    integer, 
intent(in) :: li, mi
 
  214    complex(real64),   
intent(out) :: ylm
 
  217    real(real64) :: dx, dy, dz, r, plm, cosm, sinm, cosmm1, sinmm1, cosphi, sinphi
 
  218    real(real64),   
parameter :: tiny = 1.e-15_real64
 
  228    r = 
sqrt(xx(1)**2 + xx(2)**2 + xx(3)**2)
 
  245    r = 
sqrt(dx*dx + dy*dy)
 
  259      cosm = cosmm1*cosphi - sinmm1*sinphi
 
  260      sinm = cosmm1*sinphi + sinmm1*cosphi
 
  264    ylm = plm*cmplx(cosm, sinm, real64)
 
  283    real(real64),    
intent(in)  :: xx(3)
 
  284    integer,         
intent(in)  :: li, mi
 
  285    real(real64),    
intent(out) :: ylm
 
  287    integer, 
parameter :: lmaxd = 20
 
  288    real(real64),   
parameter :: tiny = 1.e-15_real64
 
  289    integer :: i, ilm0, l, m, mabs
 
  290    integer, 
save :: lmax = -1
 
  292    real(real64) :: cmi, cosm, cosmm1, cosphi, dphase, dplg, fac, &
 
  293      fourpi, plgndr, phase, pll, pmm, pmmp1, sinm, &
 
  294      sinmm1, sinphi, rsize, rx, ry, rz, xysize
 
  295    real(real64), 
save :: c(0:(lmaxd+1)*(lmaxd+1))
 
  306          do i = l - m + 1, l + m
 
  309          c(ilm0 + m) = 
sqrt(fac)
 
  311          if (m /= 0) c(ilm0 + m) = c(ilm0 + m)*
sqrt(
m_two)
 
  312          c(ilm0 - m) = c(ilm0 + m)
 
  325    rsize = 
sqrt(xx(1)**2 + xx(2)**2 + xx(3)**2)
 
  326    if (rsize < tiny) 
then 
  351        ylm = c(4)*6.0_real64*rx*ry
 
  359        ylm = c(8)*
m_three*(rx*rx - ry*ry)
 
  366    xysize = 
sqrt(max(rx*rx + ry*ry, tiny))
 
  374      cosm = cosmm1*cosphi - sinmm1*sinphi
 
  375      sinm = cosmm1*sinphi + sinmm1*cosphi
 
  383      dphase = (-mabs)*sinm
 
  391        pmm = (-pmm)*fac*xysize
 
  398      dplg = (-li)*rz*pmm/(xysize**2)
 
  400      pmmp1 = rz*(2*mabs + 1)*pmm
 
  401      if (li == mabs + 1) 
then 
  403        dplg = -((li*rz*pmmp1 - (mabs + li)*pmm)/(xysize**2))
 
  406          pll = (rz*(2*l - 1)*pmmp1 - (l + mabs - 1)*pmm)/(l - mabs)
 
  411        dplg = -((li*rz*pll - (l + mabs - 1)*pmm)/(xysize**2))
 
  417    ylm = cmi*plgndr*phase
 
  432  subroutine weights(N, M, cc, side)
 
  433    integer,           
intent(in)  :: n, m
 
  434    real(real64),      
intent(out) :: cc(0:,0:,0:)
 
  435    integer, 
optional, 
intent(in)  :: side
 
  437    integer :: i, j, k, mn, side_
 
  438    real(real64) :: c1, c2, c3, c4, c5, xi
 
  439    real(real64), 
allocatable :: x(:)
 
  443    safe_allocate(x(0:m))
 
  445    if (
present(side)) 
then 
  455      x(:) = (/(-i,i=0,mn)/)
 
  459      x(:) = (/(i,i=0,mn)/)
 
  463      x(:) = (/0,(-i,i,i=1,mn)/)
 
  486        if (j <= n) cc(k, j - 1, j) = 
m_zero 
  487        cc(k, j, 0) = c4*cc(k, j - 1, 0)/c3
 
  490          cc(k, j, i) = (c4*cc(k, j - 1, i) - i*cc(k, j - 1, i - 1))/c3
 
  493        cc(j, j, 0) = -c1*c5*cc(j - 1, j - 1, 0) / c2
 
  497        cc(j, j, i) = c1*(i*cc(j - 1, j - 1, i - 1) - c5*cc(j - 1, j - 1, i))/c2
 
  508  real(real64) 
pure function 
ddelta(i, j)
 
  509    integer, 
intent(in) :: i
 
  510    integer, 
intent(in) :: j
 
  527    integer,              
intent(in)  :: n
 
  528    integer, 
allocatable, 
intent(out) :: out(:)
 
  529    integer,              
intent(out) :: length
 
  530    integer, 
optional,    
intent(in)  :: in(:)
 
  536    if (
present(in)) 
then 
  537      length = ubound(in, 1)
 
  538      safe_allocate(out(1:length))
 
  542      safe_allocate(out(1:length))
 
  555  logical function member(n, a)
 
  556    integer, 
intent(in) :: n
 
  557    integer, 
intent(in) :: a(:)
 
  565    do i = 1, ubound(a, 1)
 
  577    integer, 
intent(in)  :: nn
 
  578    real(real64),   
intent(in)  :: xa(:)
 
  579    real(real64),   
intent(in)  :: xx
 
  580    real(real64),   
intent(out) :: cc(:)
 
  590        cc(ii) = cc(ii)*(xx - xa(kk))/(xa(ii) - xa(kk))
 
  599  logical pure function 
even(n)
 
  600    integer, 
intent(in) :: n
 
  602    even = (mod(n, 2) == 0)
 
  609  logical pure function 
odd(n)
 
  610    integer, 
intent(in) :: n
 
  620    real(real64), 
intent(in)  :: x(:)
 
  621    real(real64), 
intent(out) :: u(:)
 
  624    real(real64) :: sumx2
 
  625    real(real64), 
allocatable :: xx(:)
 
  631    assert(
size(u) == n-1)
 
  634    safe_allocate(xx(1:n))
 
  636      if (abs(x(j))<1.0e-8_real64) 
then 
  647        sumx2 = sumx2 + xx(j)**2
 
  649      if (abs(sumx2) <= m_epsilon .and. abs(xx(k)) <= m_epsilon) 
exit 
  653        u(n-1) = 
atan2(xx(n), xx(n-1))
 
  667    real(real64), 
intent(in)  :: u(:)
 
  668    real(real64), 
intent(out) :: x(:)
 
  676    assert(
size(u) == n-1)
 
  683      x(2) = 
sin(u(1))*
cos(u(2))
 
  684      x(3) = 
sin(u(1))*
sin(u(2))
 
  687      x(2) = 
sin(u(1))*
cos(u(2))
 
  692          x(j) = x(j) * 
sin(u(k))
 
  698        x(n) = x(n) * 
sin(u(k))
 
  700      x(n) = x(n) * 
sin(u(n-1))
 
  713    real(real64), 
intent(out)  :: grad_matrix(:,:)
 
  714    real(real64), 
intent(in)   :: r
 
  715    real(real64), 
intent(in)   :: x(:)
 
  725    grad_matrix(1,1) = -r*
sin(x(1))
 
  727      grad_matrix(m,1) = m_zero
 
  734          grad_matrix(m,l) = -r*grad_matrix(m,l)*product(
sin(x(1:l)))
 
  736          grad_matrix(m,l) = grad_matrix(m,l)*r*
cos(x(m))*
cos(x(l))*product(
sin(x(1:m-1)))*product(
sin(x(m+1:l-1)))
 
  738          grad_matrix(m,l) = m_zero
 
  745      grad_matrix(m,n) = r*
cos(x(m))*grad_matrix(m,n)*product(
sin(x(1:m-1)))*product(
sin(x(m+1:n-1)))
 
  752  integer(int64) pure function 
pad88(size, blk)
 
  753    integer(int64), 
intent(in) :: size
 
  754    integer(int64), 
intent(in) :: blk
 
  762      pad88 = 
size + blk - mm
 
  767  integer(int64) pure function 
pad48(size, blk)
 
  768    integer,     
intent(in) :: size
 
  769    integer(int64), 
intent(in) :: blk
 
  775  integer(int64) pure function 
pad8(size, blk)
 
  776    integer(int64), 
intent(in) :: size
 
  777    integer, 
intent(in) :: blk
 
  783  integer pure function 
pad4(size, blk)
 
  784    integer, 
intent(in) :: size
 
  785    integer, 
intent(in) :: blk
 
  787    pad4 = int(
pad88(int(
size, int64), int(blk, int64)), int32)
 
  796  integer pure function 
pad_pow2(size)
 
  797    integer, 
intent(in) :: size
 
  805    if (
size == 0) 
return 
  811      if (mm - 2*mm2 /= 0) 
exit 
  825  real(real64) 
pure function 
dlog2(xx)
 
  826    real(real64), 
intent(in) :: xx
 
  833  integer pure function 
ilog2(xx)
 
  834    integer, 
intent(in) :: xx
 
  841  integer(int64) pure function 
llog2(xx)
 
  842    integer(int64), 
intent(in) :: xx
 
  844    llog2 = nint(
log2(real(xx, real64) ), kind=int64)
 
  850    complex(real64), 
intent(in) :: z
 
  861  complex(real64) pure function 
phi1(z)
 
  862    complex(real64), 
intent(in) :: z
 
  864    real(real64), 
parameter :: cut = 0.002_real64
 
  866    if (abs(z) < cut) 
then 
  867      phi1 = m_one + m_half*z*(m_one + z/m_three*(m_one + m_fourth*z*(m_one + z/m_five)))
 
  880  complex(real64) pure function 
phi2(z)
 
  881    complex(real64), 
intent(in) :: z
 
  883    real(real64), 
parameter :: cut = 0.002_real64
 
  885    if (abs(z) < cut) 
then 
  886      phi2 = m_half + z/6.0_real64*(m_one + m_fourth*z*(m_one + z/m_five*(m_one + z/6.0_real64)))
 
  888      phi2 = (
exp(z) - z - m_z1)/z**2
 
  895    real(real64), 
intent(in) :: x
 
  903    integer, 
intent(in) :: n
 
  910      message(1) = 
"Internal error: is_prime does not take negative numbers." 
  911      call messages_fatal(1)
 
  919    root = nint(
sqrt(real(n, real64) ))
 
  921      if (mod(n,i) == 0) 
then 
  938    real(real64),   
intent(out)  :: r(:,:)
 
  939    real(real64),   
intent(in)   :: ff(:)
 
  940    real(real64),   
intent(in)   :: tt(:)
 
  943    real(real64)       :: th, uv, uu, vv, ft
 
  944    real(real64), 
allocatable :: axis(:), u(:), v(:), 
f(:), t(:), p(:)
 
  950    assert((dim < 3) .or. (dim > 2))
 
  951    assert(
size(tt,1) == dim)
 
  952    assert((
size(r,1) == dim) .and. (
size(r,2) == dim))
 
  954    safe_allocate(u(1:dim))
 
  955    safe_allocate(v(1:dim))
 
  956    safe_allocate(
f(1:dim))
 
  957    safe_allocate(t(1:dim))
 
  964    ft = dot_product(
f,t)
 
  966    if (abs(ft) < m_one) 
then 
  979          safe_allocate(axis(1:dim))
 
  982          u = 
f / dot_product(
f,
f)
 
  983          v = t /dot_product(t,t)
 
  986          axis = axis / norm2(axis)
 
  988          r(1,1) = 
cos(th) + axis(1)**2 * (1 - 
cos(th))
 
  989          r(1,2) = axis(1)*axis(2)*(1-
cos(th)) + axis(3)*
sin(th)
 
  990          r(1,3) = axis(1)*axis(3)*(1-
cos(th)) - axis(2)*
sin(th)
 
  992          r(2,1) = axis(2)*axis(1)*(1-
cos(th)) - axis(3)*
sin(th)
 
  993          r(2,2) = 
cos(th) + axis(2)**2 * (1 - 
cos(th))
 
  994          r(2,3) = axis(2)*axis(3)*(1-
cos(th)) + axis(1)*
sin(th)
 
  996          r(3,1) = axis(3)*axis(1)*(1-
cos(th)) + axis(2)*
sin(th)
 
  997          r(3,2) = axis(3)*axis(2)*(1-
cos(th)) - axis(1)*
sin(th)
 
  998          r(3,3) = 
cos(th) + axis(3)**2 * (1 - 
cos(th))
 
 1000          safe_deallocate_a(axis)
 
 1009          r(1,1) = u(1)**2 + (1-u(1)**2)*
cos(th)
 
 1010          r(1,2) = u(1)*u(2)*(1-
cos(th)) - u(3)*
sin(th)
 
 1011          r(1,3) = u(1)*u(3) + u(2)*
sin(th)
 
 1013          r(2,1) = u(1)*u(2)*(1-
cos(th)) + u(3)*
sin(th)
 
 1014          r(2,2) = u(2)**2 + (1-u(2)**2)*
cos(th)
 
 1015          r(2,3) = u(2)*u(3)*(1-
cos(th)) - u(1)*
sin(th)
 
 1017          r(3,1) = u(1)*u(3)*(1-
cos(th)) - u(2)*
sin(th)
 
 1018          r(3,2) = u(2)*u(3)*(1-
cos(th)) + u(1)*
sin(th)
 
 1019          r(3,3) = u(3)**2 + (1-u(3)**2)*
cos(th)
 
 1024          safe_allocate(p(1:dim))
 
 1026          if (abs(
f(1)) <= abs(
f(2)) .and. abs(
f(1)) < abs(
f(3))) 
then 
 1027            p = (/m_one, m_zero, m_zero/)
 
 1028          else if (abs(
f(2)) < abs(
f(1)) .and. abs(
f(2)) <= abs(
f(3))) 
then 
 1029            p = (/m_zero, m_one, m_zero/)
 
 1030          else if (abs(
f(3)) <= abs(
f(1)) .and. abs(
f(3)) < abs(
f(2))) 
then 
 1031            p = (/m_zero, m_zero, m_one/)
 
 1037          uu = dot_product(u,u)
 
 1038          vv = dot_product(v,v)
 
 1039          uv = dot_product(u,v)
 
 1044              r(i,j) = 
ddelta(i,j) - m_two * u(i)*u(j)/uu - m_two * v(i)*v(j)/vv &
 
 1045                + 4_real64*uv * v(i)*u(j) /(uu*vv)
 
 1050          safe_deallocate_a(p)
 
 1066    safe_deallocate_a(u)
 
 1067    safe_deallocate_a(v)
 
 1083    real(real64), 
intent(in)  :: x, h
 
 1084    real(real64), 
intent(out) :: res, err
 
 1087        use, 
intrinsic :: iso_fortran_env
 
 1089        real(real64), 
intent(in)    :: x
 
 1090        real(real64), 
intent(inout) :: fx
 
 1094    real(real64), 
parameter :: con = 1.4_real64, big = 1.0e30_real64, safe = m_two
 
 1095    integer, 
parameter :: ntab = 20
 
 1097    real(real64) :: errt, fac, hh, fx1, fx2
 
 1098    real(real64), 
allocatable :: a(:, :)
 
 1102    if (abs(h) <= m_epsilon) 
then 
 1103      message(1) = 
"h must be nonzero in numder_ridders" 
 1104      call messages_fatal(1)
 
 1107    safe_allocate(a(1:ntab, 1:ntab))
 
 1112    a(1,1) = (fx1-fx2) / (m_two*hh)
 
 1118      a(1,i) = (fx1-fx2) / (m_two*hh)
 
 1121        a(j,i) = (a(j-1,i)*fac-a(j-1,i-1)) / (fac-m_one)
 
 1123        errt = max(abs(a(j,i)-a(j-1,i)),abs(a(j,i)-a(j-1,i-1)))
 
 1124        if (errt .le. err) 
then 
 1129      if (abs(a(i,i)-a(i-1,i-1)) .ge. safe*err) 
return 
 1132    safe_deallocate_a(a)
 
 1138    real(real64), 
intent(in) :: a(:)
 
 1139    complex(real64), 
intent(in) :: b(:)
 
 1141    complex(real64) :: c(1:3)
 
 1143    c(1) = a(2)*b(3) - a(3)*b(2)
 
 1144    c(2) = a(3)*b(1) - a(1)*b(3)
 
 1145    c(3) = a(1)*b(2) - a(2)*b(1)
 
 1151    complex(real64), 
intent(in) :: a(:)
 
 1152    real(real64), 
intent(in) :: b(:)
 
 1154    complex(real64) :: c(1:3)
 
 1156    c(1) = a(2)*b(3) - a(3)*b(2)
 
 1157    c(2) = a(3)*b(1) - a(1)*b(3)
 
 1158    c(3) = a(1)*b(2) - a(2)*b(1)
 
 1264    integer, 
intent(in)  :: np
 
 1265    integer, 
intent(in)  :: nn, mm
 
 1266    real(real64),   
intent(in)  :: xx(np)
 
 1267    real(real64),   
intent(out) :: cx(np)
 
 1270    real(real64), 
allocatable :: cx_tmp(:,:)
 
 1274    safe_allocate(cx_tmp(1:np, 0:nn))
 
 1286    cx_tmp(1:np,0) = m_one
 
 1287    cx_tmp(1:np,1) = real(mm + 1, real64)  - xx(1:np)
 
 1290      cx_tmp(1:np, ii) = &
 
 1291        (( real(mm + 2*ii - 1, real64)  - xx(1:np)) * cx_tmp(1:np,ii-1)   &
 
 1292        + real(-mm    -ii + 1, real64)              * cx_tmp(1:np,ii-2)) / real(ii, real64)
 
 1295    cx(1:np) = cx_tmp(1:np, nn)
 
 1297    safe_deallocate_a(cx_tmp)
 
 1302    integer, 
intent(in)     :: nn
 
 1303    real(real64),   
intent(inout)  :: aa(:, :)
 
 1309        aa(jj, ii) = aa(ii, jj)
 
 1315    integer, 
intent(in)     :: nn
 
 1316    complex(real64),   
intent(inout)  :: aa(:, :)
 
 1322        aa(jj, ii) = conjg(aa(ii, jj))
 
 1324      aa(jj, jj) = real(aa(jj, jj), real64)
 
 1329    integer, 
intent(in)     :: nn
 
 1330    real(real64),   
intent(inout)  :: aa(:, :)
 
 1336        aa(ii, jj) = aa(jj, ii)
 
 1342    integer, 
intent(in)     :: nn
 
 1343    complex(real64),   
intent(inout)  :: aa(:, :)
 
 1349        aa(ii, jj) = conjg(aa(jj, ii))
 
 1351      aa(jj, jj) = real(aa(jj, jj), real64)
 
 1357    integer,       
intent(in)     :: nn
 
 1358    real(real64),  
intent(inout)  :: aa(:, :)
 
 1364        aa(ii, jj) = m_half * (aa(ii, jj) + aa(jj, ii))
 
 1365        aa(jj, ii) = aa(ii, jj)
 
 1372    integer,          
intent(in)     :: n
 
 1373    complex(real64),  
intent(inout)  :: a(:, :)
 
 1379        a(i, j) = m_half * (a(i, j) + conjg(a(j, i)))
 
 1380        a(j, i) = conjg(a(i, j))
 
 1387    real(real64),   
intent(inout)  :: aa(:, :)
 
 1397    real(real64),           
intent(in)  :: a(:, :)
 
 1398    real(real64), 
optional, 
intent(in)  :: tol
 
 1400    real(real64)              :: tolerance
 
 1404    tolerance = optional_default(tol, 1.0e-8_real64)
 
 1406    assert(
size(a, 1) == 
size(a, 2))
 
 1415  logical pure function is_diagonal(dim, matrix, tol)
 
 1416    integer,        
intent(in)    :: dim
 
 1417    real(real64),   
intent(in)    :: matrix(:, :)
 
 1418    real(real64),   
intent(in)    :: tol
 
 1421    real(real64) :: max_diag
 
 1425      max_diag = max(abs(matrix(ii, ii)), max_diag)
 
 1432        if (abs(matrix(ii, jj)) > tol*max_diag) 
is_diagonal = .false.
 
 1440    integer, 
intent(in) :: num
 
 1441    integer, 
intent(in) :: base
 
 1442    integer, 
intent(out) :: converted(:)
 
 1444    integer :: i, num_, length
 
 1452      assert(
size(converted) >= length)
 
 1456      do i = 1, 
size(converted)
 
 1457        converted(i) = mod(num_, base)
 
 1466    integer, 
intent(in) :: converted(:)
 
 1467    integer, 
intent(in) :: base
 
 1468    integer, 
intent(out) :: num
 
 1475    do i = 1, 
size(converted)
 
 1476      num = num + converted(i) * base**(i-1)
 
 1482#include "complex.F90" 
 1483#include "math_inc.F90" 
 1487#include "math_inc.F90" 
This is the common interface to a simple-minded polynomical interpolation procedure (simple use of th...
double acos(double __x) __attribute__((__nothrow__
double log(double __x) __attribute__((__nothrow__
double exp(double __x) __attribute__((__nothrow__
double sin(double __x) __attribute__((__nothrow__
double sqrt(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
double atan2(double __y, double __x) __attribute__((__nothrow__
double floor(double __x) __attribute__((__nothrow__
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_four
real(real64), parameter, public m_pi
some mathematical constants
complex(real64), parameter, public m_z0
real(real64), parameter, public m_half
real(real64), parameter, public m_one
real(real64), parameter, public m_three
This module is intended to contain "only mathematical" functions and procedures.
subroutine zsymmetrize_matrix(n, a)
make a complex matrix Hermitian
complex(real64) pure function, public phi2(z)
Compute phi2(z) = (phi1(z)-1)/z = (exp(z) - z - 1)/z^2.
integer pure function ilog2(xx)
logical pure function, public even(n)
Returns if n is even.
pure real(real64) function, dimension(dim, dim) ddiagonal_matrix(dim, diag)
Currently only returns a matrix whose diagonal elements are all the same. Note that the integer versi...
subroutine, public generalized_laguerre_polynomial(np, nn, mm, xx, cx)
complex(real64) pure function, public exponential(z)
Wrapper for exponential.
subroutine dinterpolate_0(xa, ya, x, y)
subroutine, public ylmr_cmplx(xx, li, mi, ylm)
Computes spherical harmonics ylm at position (x, y, z)
subroutine zinterpolate_0(xa, ya, x, y)
subroutine, public convert_to_base(num, base, converted)
convert an integer in base 10 to a different base
subroutine dinterpolate_1(xa, ya, x, y)
real(real64) pure function dlog2(xx)
integer(int64) pure function pad88(size, blk)
real(real64) pure function, public square_root(x)
Wrapper for sqrt.
logical function, public member(n, a)
Considers a(1:ubound(a, 1)) as an integer set and checks if n is a member of it.
integer pure function pad4(size, blk)
subroutine dlower_triangular_to_hermitian(nn, aa)
pure complex(real64) function, dimension(1:3), public dzcross_product(a, b)
subroutine, public cartesian2hyperspherical(x, u)
Performs a transformation of an n-dimensional vector from Cartesian coordinates to hyperspherical coo...
integer pure function, public pad_pow2(size)
create array size, which is padded to powers of 2
subroutine, public dzero_small_elements_matrix(aa, tol)
subroutine zinterpolate_1(xa, ya, x, y)
pure real(real64) function, dimension(1:3), public dcross_product(a, b)
integer(int64) pure function pad48(size, blk)
subroutine dsymmetrize_matrix(nn, aa)
symmetrize a real matrix
subroutine, public ylmr_real(xx, li, mi, ylm)
This is a Numerical Recipes-based subroutine computes real spherical harmonics ylm at position (x,...
subroutine dupper_triangular_to_hermitian(nn, aa)
subroutine, public interpolation_coefficients(nn, xa, xx, cc)
logical function, public is_symmetric(a, tol)
Check if a 2D array is symmetric.
subroutine, public generate_rotation_matrix(R, ff, tt)
Generates a rotation matrix R to rotate a vector f to t.
elemental logical function zis_close_scalar(x, y, rtol, atol)
Same as dis_close_scalar for complex numbers.
logical pure function, public odd(n)
Returns if n is odd.
real(real64) pure function, public ddelta(i, j)
subroutine, public make_idx_set(n, out, length, in)
Construct out(1:length) = (/1, ..., n/) if in is not present, out(1:length) = in otherwise.
logical function, public is_prime(n)
complex(real64) pure function, public phi1(z)
Compute phi1(z) = (exp(z)-1)/z.
pure complex(real64) function, dimension(1:3), public zcross_product(a, b)
subroutine, public weights(N, M, cc, side)
Compute the weights for finite-difference calculations:
subroutine zinterpolate_2(xa, ya, x, y)
pure complex(real64) function, dimension(dim, dim) zdiagonal_matrix(dim, diag)
Currently only returns a matrix whose diagonal elements are all the same. Note that the integer versi...
subroutine zlower_triangular_to_hermitian(nn, aa)
logical pure function, public is_diagonal(dim, matrix, tol)
Returns true is the matrix of size dim x dim is diagonal, given a relative tolerance.
subroutine zupper_triangular_to_hermitian(nn, aa)
pure integer function, dimension(dim, dim) idiagonal_matrix(dim, diag)
Currently only returns a matrix whose diagonal elements are all the same. Note that the real and comp...
integer(int64) pure function pad8(size, blk)
subroutine dinterpolate_2(xa, ya, x, y)
subroutine, public numder_ridders(x, h, res, err, f)
Numerical derivative (Ridder`s algorithm).
integer(int64) pure function llog2(xx)
recursive real(real64) function, public hermite(n, x)
elemental logical function dis_close_scalar(x, y, rtol, atol)
Are  and  equal within a tolerance.
pure complex(real64) function, dimension(1:3), public zdcross_product(a, b)
subroutine, public convert_from_base(converted, base, num)
convert an integer to base 10 from a different base
subroutine, public hyperspherical2cartesian(u, x)
Performs the inverse transformation of cartesian2hyperspherical.
subroutine, public hypersphere_grad_matrix(grad_matrix, r, x)
Gives the hyperspherical gradient matrix, which contains the derivatives of the Cartesian coordinates...
recursive integer function, public factorial(n)
static double f(double w, void *p)