Contains various small functions used in the code
Compare two a and b and see if the magnitude of their difference is smaller than a tolerance, taking machine epsilon*max(|a|,|b|) for their precision as the default value
Comparre two a and b and see if magnitude of their difference is smaller than a tolerance, taking machine epsilon for their precision as the default value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | a | |||
| complex(kind=dp), | intent(in) | :: | b | |||
| real(kind=dp), | intent(in), | optional | :: | tol |
Comparre two a and b and see if magnitude of their difference is smaller than a tolerance, taking machine epsilon for their precision as the default value
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a | |||
| real(kind=dp), | intent(in) | :: | b | |||
| real(kind=dp), | intent(in), | optional | :: | tol |
!n
!n
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
!n
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | n |
ln(!n)
returns ln(n!) for integer n
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
returns ln(n!) for real n
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | n |
Returns . TODO, replace with a fast and accurate version coded natively in fortran !
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | value | :: | x |
Returns . TODO, replace with a fast and accurate version coded natively in fortran !
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | z |
Returns the logarithm of x in the base b
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | b | |||
| integer, | intent(in) | :: | x |
Returns the logarithm of x in the base b
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | b | |||
| real(kind=dp), | intent(in) | :: | x |
Returns the logarithm of x in the base b
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | b | |||
| complex(kind=dp), | intent(in) | :: | x |
Returns an array of n log-spaced values from a to b. By default, the base is 10 if omitted but can be changed by the user
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=dp), | intent(in) | :: | a | |||
| integer(kind=dp), | intent(in) | :: | b | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in), | optional | :: | base |
Logarithm base |
|
| logical, | intent(in), | optional | :: | inclast |
Whether to include the last value b |
Returns an array of n log-spaced values from a to b. By default, the base is 10 if omitted but can be changed by the user
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a | |||
| real(kind=dp), | intent(in) | :: | b | |||
| integer, | intent(in) | :: | n | |||
| real(kind=dp), | intent(in), | optional | :: | base |
Logarithm base |
|
| logical, | intent(in), | optional | :: | inclast |
Whether to include the last value b |
Check if a real/complex number is an integer
Check if x is an integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | x |
Check if z is an integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | z |
Check if a real/complex number is a natrual number
Check if x is a natural number (1, 2, 3, ...)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | x |
Check if z is a natural number (1, 2, 3, ...)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | z |
Return the phase of a complex number in (-π,π]
Return the phase of an integer (as a complex number) in (-π,π]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | z |
Return the phase of a real number (as a complex number) in (-π,π]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | z |
Return the phase of a complex number in (-π,π]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | z |
Compute 1/z
Return the real 1/i for integer i
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i |
Return 1/x
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | x |
Return 1/z for complex z. If the imaginary part of z is 0, flip its sign
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(in) | :: | z |
Return the Kronecker delta function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | m | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
returns whether the arguments satisfy the triangle inequality, assuming that they're positive quantities
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | a | |||
| integer, | intent(in) | :: | b | |||
| integer, | intent(in) | :: | c |
Returns the integer }
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i |