Celeritas 0.6.0-47+develop.b3cbb238
Loading...
Searching...
No Matches
Functions
VectorUtils.hh File Reference

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"
This graph shows which files directly or indirectly include this file:

Functions

std::vector< doubleceleritas::linspace (double start, double stop, size_type n)
 Return evenly spaced numbers over a given interval.
 
std::vector< doubleceleritas::geomspace (double start, double stop, size_type n)
 Return logarithmically spaced numbers over a given interval.
 
std::vector< doubleceleritas::logspace (double start, double stop, size_type n)
 Return logarithmically spaced numbers over a specific 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.
 

Detailed Description

Grid creation helpers.

Function Documentation

◆ geomspace()

std::vector< double > celeritas::geomspace ( double  start,
double  stop,
size_type  n 
)

Return logarithmically spaced numbers over a given interval.

This is a geometric progression of values, where the ratio between each neighbor is constant.

◆ logspace()

std::vector< double > celeritas::logspace ( double  start,
double  stop,
size_type  n 
)
inline

Return logarithmically spaced numbers over a specific interval.

Deprecated:
Remove in v1.0; replaced by geomspace