(git:1f285aa)
mathlib.F File Reference

Go to the source code of this file.

Modules

module  mathlib
 Collection of simple mathematical functions and subroutines.
 

Functions/Subroutines

real(kind=dp) function, public mathlib::pswitch (x, a, b, order)
 Polynomial (5th degree) switching function f(a) = 1 .... f(b) = 0 with f'(a) = f"(a) = f'(b) = f"(b) = 0. More...
 
logical function, public mathlib::abnormal_value (a)
 determines if a value is not normal (e.g. for Inf and Nan) based on IO to work also under optimization. More...
 
pure real(kind=dp) function, public mathlib::angle (a, b)
 Calculation of the angle between the vectors a and b. The angle is returned in radians. More...
 
elemental real(kind=dp) function, public mathlib::binomial (n, k)
 The binomial coefficient n over k for 0 <= k <= n is calculated, otherwise zero is returned. More...
 
elemental real(kind=dp) function, public mathlib::binomial_gen (z, k)
 The generalized binomial coefficient z over k for 0 <= k <= n is calculated. (z) z*(z-1)*...*(z-k+2)*(z-k+1) ( ) = ------------------------— (k) k! More...
 
pure real(kind=dp) function, public mathlib::multinomial (n, k)
 Calculates the multinomial coefficients. More...
 
pure subroutine, public mathlib::build_rotmat (phi, a, rotmat)
 The rotation matrix rotmat which rotates a vector about a rotation axis defined by the vector a is build up. The rotation angle is phi (radians). More...
 
subroutine, public mathlib::diamat_all (a, eigval, dac)
 Diagonalize the symmetric n by n matrix a using the LAPACK library. Only the upper triangle of matrix a is used. Externals (LAPACK 3.0) More...
 
pure real(kind=dp) function, public mathlib::dihedral_angle (ab, bc, cd)
 Returns the dihedral angle, i.e. the angle between the planes defined by the vectors (-ab,bc) and (cd,-bc). The dihedral angle is returned in radians. More...
 
pure real(kind=dp) function, dimension(min(size(a, 1), size(a, 2))), public mathlib::get_diag (a)
 Return the diagonal elements of matrix a as a vector. More...
 
pure real(kind=dp) function, dimension(3, 3), public mathlib::inv_3x3 (a)
 Returns the inverse of the 3 x 3 matrix a. More...
 
subroutine, public mathlib::invmat (a, info)
 returns inverse of matrix using the lapack routines DGETRF and DGETRI More...
 
subroutine, public mathlib::invmat_symm (a, cholesky_triangle)
 returns inverse of real symmetric, positive definite matrix More...
 
subroutine, public mathlib::get_pseudo_inverse_svd (a, a_pinverse, rskip, determinant, sval)
 returns the pseudoinverse of a real, square matrix using singular value decomposition More...
 
subroutine, public mathlib::get_pseudo_inverse_diag (a, a_pinverse, rskip)
 returns the pseudoinverse of a real, symmetric and positive definite matrix using diagonalization. More...
 
pure real(kind=dp) function, dimension(3), public mathlib::reflect_vector (a, b)
 Reflection of the vector a through a mirror plane defined by the normal vector b. The reflected vector a is stored in a_mirror. More...
 
pure real(kind=dp) function, dimension(3), public mathlib::rotate_vector (a, phi, b)
 Rotation of the vector a about an rotation axis defined by the vector b. The rotation angle is phi (radians). The rotated vector a is stored in a_rot. More...
 
subroutine, public mathlib::symmetrize_matrix (a, option)
 Symmetrize the matrix a. More...
 
pure real(kind=dp) function, dimension(3), public mathlib::vector_product (a, b)
 Calculation of the vector product c = a x b. More...
 
elemental integer function, public mathlib::gcd (a, b)
 computes the greatest common divisor of two number More...
 
elemental integer function, public mathlib::lcm (a, b)
 computes the least common multiplier of two numbers More...
 
elemental impure real(dp) function, public mathlib::expint (n, x)
 computes the exponential integral En(x) = Int(exp(-x*t)/t^n,t=1..infinity) x>0, n=0,1,.. Note: Ei(-x) = -E1(x) More...
 
subroutine, public mathlib::jacobi (a, d, v)
 Jacobi matrix diagonalization. The eigenvalues are returned in vector d and the eigenvectors are returned in matrix v in ascending order. More...
 
subroutine, public mathlib::diag (n, a, d, v)
 Diagonalize matrix a. The eigenvalues are returned in vector d and the eigenvectors are returned in matrix v. More...
 
subroutine, public mathlib::erfc_cutoff (eps, omg, r_cutoff)
 
  • compute a truncation radius for the shortrange operator
More...
 
subroutine, public mathlib::complex_diag (matrix, eigenvectors, eigenvalues)
 Diagonalizes a local complex Hermitian matrix using LAPACK. Based on cp_cfm_heevd. More...