Celeritas 0.6.0-dev.116+3fbab5e0
|
Grid creation helpers. More...
#include <algorithm>
#include <cmath>
#include <vector>
#include "corecel/Types.hh"
#include "corecel/cont/Range.hh"
#include "corecel/cont/Span.hh"
#include "corecel/math/Algorithms.hh"
#include "corecel/math/SoftEqual.hh"
Functions | |
std::vector< double > | celeritas::linspace (double start, double stop, size_type n) |
Return evenly spaced numbers over a given interval. | |
std::vector< double > | celeritas::logspace (double start, double stop, size_type n) |
Return logarithmically spaced numbers over a given interval. | |
template<class T > | |
bool | celeritas::is_monotonic_nondecreasing (Span< T > grid) |
True if the grid values are monotonically nondecreasing. | |
template<class T > | |
bool | celeritas::is_monotonic_increasing (Span< T > grid) |
True if the grid values are monotonically increasing. | |
template<class T > | |
T | celeritas::calc_log_delta (Span< T const > grid) |
Calculate (geometric) ratio of successive grid points in a uniform log grid. | |
template<class T > | |
bool | celeritas::has_log_spacing (Span< T const > grid) |
True if the grid has logarithmic spacing. | |
Grid creation helpers.
Return logarithmically spaced numbers over a given interval.
Unlike numpy's logspace which assumes the start and stop are log-10 values (unless given another argument), the start and stop are the actual first and last values of the resulting vector.