This file provides a common interface to a large library of mathematical functions and subroutines. See the documentation of individual interfaces below for more information about the contents of the mathematical library.
Public interface for functions that calculate a matrix trace.
Calculate the trace of a general complex matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=wp), | intent(in), | dimension(:,:) | :: | A | Matrix [n×m] |
r = Tr(A)
Public interface for functions that calculate a matrix inverse.
Wrapper for matrix_inverse_cx that allows the procedure to be used for real matrices.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:,:) | :: | A | Matrix A [n×n] |
Matrix R=A¯¹
Invert a square n×n matrix using Gauss-Jordan elimination with partial pivoting. In the special case n=2, the inverse is evaluated using a cofactoring algorithm. [This implementation is based on Algorithm #2 in "Efficient matrix inversion via Gauss-Jordan elimination and its parallelization" by E.S. Quintana et al. (1998)]
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=wp), | intent(in), | dimension(:,:) | :: | A | Matrix A [n×n] |
Matrix R=A¯¹
Public interface for functions that deal with matrix diagonals.
Construct a block-diagonal matrix R from two general matrices A and B.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=wp), | intent(in), | dimension(:,:) | :: | A | Left matrix [n×m] |
|
complex(kind=wp), | intent(in), | dimension(:,:) | :: | B | Right matrix [p×q] |
R = Diag(A,B)
Extract the diagonal of a general complex matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=wp), | intent(in), | dimension(:,:) | :: | A | Matrix [n×m] |
r = Diag(A)
Public interface for routines that calculate the mean value.
Calculates the mean value of a real-valued array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Real-valued array |
Mean value
Calculates the mean value of a complex-valued array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=wp), | intent(in), | dimension(:) | :: | x | Complex-valued array |
Mean value
Public interface for various differentiation routines.
This function calculates the numerical derivative of an array y with respect to x, using a central difference approximation at the interior points and forward/backward difference approximations at the exterior points. Note that since all the three approaches yield two-point approximations of the derivative, the mesh spacing of x does not necessarily have to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
real(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
Derivative dy/dx
Complex version of differentiate_array_re.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
complex(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
Derivative dy/dx
Public interface for various integration routines.
This function calculates the integral of an array y with respect to x using a trapezoid approximation. Note that the mesh spacing of x does not necessarily have to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
real(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
Integral ∫y(x)·dx
Complex version of integrate_array_re.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
complex(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
Integral ∫y(x)·dx
This function constructs a piecewise hermitian cubic interpolation of an array y(x) based on discrete numerical data, and subsequently evaluates the integral of the interpolation in the range (a,b). Note that the mesh spacing of x does not necessarily have to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
real(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in) | :: | a | Left endpoint |
||
real(kind=wp), | intent(in) | :: | b | Right endpoint |
Integral ∫y(x)·dx
Complex version of integrate_range_re.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
complex(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in) | :: | a | Left endpoint |
||
real(kind=wp), | intent(in) | :: | b | Right endpoint |
Integral ∫y(x)·dx
Public interface for various interpolation routines.
Wrapper for interpolate_array_re that accepts scalar arguments.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
real(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in) | :: | p | Interpolation point p |
Interpolation result y(p)
Complex version of interpolate_point_re.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
complex(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in) | :: | p | Interpolation point p |
Interpolation result y(p)
This function constructs a piecewise hermitian cubic interpolation of an array y(x) based on discrete numerical data, and evaluates the interpolation at points p. Note that the mesh spacing of x does not necessarily have to be uniform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
real(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in), | dimension(:) | :: | p | Interpolation domain p |
Interpolation result y(p)
Complex version of interpolate_array_re.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
complex(kind=wp), | intent(in), | dimension(size(x)) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in), | dimension(:) | :: | p | Interpolation domain p |
Interpolation result y(p)
Perform a Piecewise Cubic Hermitian Interpolation of a matrix function using Catmull-Rom splines.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | x | Variable x |
|
real(kind=wp), | intent(in), | dimension(:,:,:) | :: | y | Function y(x) |
|
real(kind=wp), | intent(in) | :: | p | Interpolation point p |
Interpolation result y(p)
Public interface for routines that initialize arrays.
Populates an existing array with elements from first
to last
, inclusive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(out), | dimension(:) | :: | array | Output array to populate |
|
real(kind=wp), | intent(in) | :: | first | Value of first element |
||
real(kind=wp), | intent(in) | :: | last | Value of last element |