Celeritas  0.5.0-86+4a8eea4
Functions
VectorUtils.hh File Reference

Grid creation helpers. More...

#include <algorithm>
#include <vector>
#include "corecel/Types.hh"
#include "corecel/cont/Span.hh"
#include "corecel/math/Algorithms.hh"
This graph shows which files directly or indirectly include this file:

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. More...
 
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.
 

Detailed Description

Grid creation helpers.

Function Documentation

◆ logspace()

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

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.