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.
Calculates 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 operates on real matrices.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:, :) | :: | A |
Matrix A [n×n] |
Matrix R=A¯¹
Inverts a square matrix via Gauss-Jordan elimination with partial pivot (general) or a cofactoring algorithm (2x2 matrices). The 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.
Constructs 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)
Extracts 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.
Calculates the numerical derivative of an array y wrt. x using central differences at the interior points and forward/backward differences at the exterior points. All three approaches yield two-point approximations of the derivatives, thus the mesh spacing does not 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.
Calculates the integral of an array y wrt. x using the trapezoid method. The mesh spacing 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
Constructs a piecewise hermitian cubic interpolation of an array y(x) from discrete numerical data, and then integrates the interpolation in the range (a, b). The mesh spacing does not 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 |
Single point p |
Interpolation 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 |
Single point p |
Interpolation y(p)
Constructs a piecewise hermitian cubic interpolation of an array y(x) based on discrete numerical data and evaluates the interpolation at p. Note that the mesh spacing 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 |
Point array p |
Interpolation 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 |
Point array p |
Interpolation y(p)
Interpolates 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 |
Single point p |
Interpolation y(p)
Public interface for routines that initialize arrays.
Populates an 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 |