NuMFor 9f2ab49 (2024-04-08)
Numerical (Modern) Fortran. Library for Simple Numerical computing
|
This module provides convenience routines to create grids Description: Submodule Arrays. More...
Functions/Subroutines | |
real(dp) function, dimension(num), public | linspace (start, end, num, endpoint, retstep) |
real(dp) function, dimension(num), public | logspace (start, end, num, endpoint, base) |
Makes a grid with numbers spaced evenly on a log scale. | |
real(dp) function, dimension(num), public | geomspace (start, end, num, endpoint) |
Makes a grid with numbers spaced evenly on a log scale. | |
real(dp) function, dimension(num), public | loglinspace (start, end, num, step, ratio) |
loglinspace Computes a grid that may behave as linearly or logarithmically spaced | |
integer function, dimension(:), allocatable, public | arange (start, end, step) |
arange: Return evenly spaced integer values within a given interval | |
This module provides convenience routines to create grids Description: Submodule Arrays.
integer function, dimension(:), allocatable, public arange | ( | integer, intent(in) | start, |
integer, intent(in) | end, | ||
integer, intent(in), optional | step ) |
arange: Return evenly spaced integer values within a given interval
Values are generated within the half-open interval [start, end)
(in other words, the interval including start
but excluding end
).
[in] | start | the starting value of the interval. |
[in] | end | the final value of the interval (not included) |
[in] | step | Spacing between values. |
real(dp) function, dimension(num), public geomspace | ( | real(dp), intent(in) | start, |
real(dp), intent(in) | end, | ||
integer, intent(in) | num, | ||
logical, intent(in), optional | endpoint ) |
Makes a grid with numbers spaced evenly on a log scale.
start
and end
[in] | start | start is the starting value |
[in] | end | end is the final value of |
[in] | num | Number of samples to generate. Must |
[in] | endpoint | If True, end is |
References logspace().
real(dp) function, dimension(num), public linspace | ( | real(dp), intent(in) | start, |
real(dp), intent(in) | end, | ||
integer, intent(in) | num, | ||
logical, intent(in), optional | endpoint, | ||
real(dp), intent(out), optional | retstep ) |
[in] | start | The starting value of the |
[in] | end | The end value of the sequence, |
[in] | num | Number of samples to generate. Must |
[in] | endpoint | If True, end is |
[out] | retstep | If present, return |
References basic::zero.
Referenced by histograms::histogram(), and logspace().
real(dp) function, dimension(num), public loglinspace | ( | real(dp), intent(in) | start, |
real(dp), intent(in) | end, | ||
integer, intent(in) | num, | ||
real(dp), intent(in), optional | step, | ||
real(dp), intent(in), optional | ratio ) |
loglinspace Computes a grid that may behave as linearly or logarithmically spaced
From package RADIAL by Salvat et al 1995 Computer Physics Communications. The grid is such that:
[in] | start | Starting value |
[in] | end | Final value of the sequence |
[in] | num | Number of points |
[in] | step | Approximated step in the linear region |
[in] | ratio | quotient between consecutive points in the logarithmic region |
num
real(dp) function, dimension(num), public logspace | ( | real(dp), intent(in) | start, |
real(dp), intent(in) | end, | ||
integer, intent(in) | num, | ||
logical, intent(in), optional | endpoint, | ||
real(dp), intent(in), optional | base ) |
Makes a grid with numbers spaced evenly on a log scale.
In linear space, the sequence starts at base**start
(base
to the power of start
) and ends with base**end
[in] | start | base**start is the starting value of the sequence. |
[in] | end | base**end is the final value of the sequence. |
[in] | num | Number of samples to generate. Must be positive. |
[in] | endpoint | If True, end is the last sample. Otherwise, it is not included. Default is True |
[in] | base | The base of the log space. Default is 10. |
References linspace().
Referenced by geomspace().