A uniformly-spaced sequence of values over some interval. More...
#include <Linspace.h>
Public Member Functions | |
CUDA_HOSTDEV constexpr | Linspace (T first, T spacing, int size) |
Constructor. More... | |
template<typename U > | |
CUDA_HOSTDEV constexpr | Linspace (const Linspace< U > &) |
template<typename U > | |
CUDA_HOSTDEV constexpr Linspace< T > & | operator= (const Linspace< U > &) |
CUDA_HOSTDEV constexpr T | operator[] (int pos) const |
Return sample at the specified position. More... | |
CUDA_HOSTDEV constexpr T | first () const |
First sample. | |
CUDA_HOSTDEV constexpr void | first (T first) |
Set first sample. | |
CUDA_HOSTDEV constexpr T | last () const |
Last sample. | |
CUDA_HOSTDEV constexpr T | spacing () const |
Sample spacing. | |
CUDA_HOSTDEV constexpr void | spacing (T spacing) |
Set Sample Spacing. | |
CUDA_HOSTDEV constexpr int | size () const |
Number of samples. | |
CUDA_HOSTDEV constexpr void | resize (int size) |
Change the number of samples in the sequence. More... | |
CUDA_HOSTDEV constexpr Linspace< T > | subinterval (int start, int stop) const |
Return a sub-Linspace over the half-open interval [start , stop ). More... | |
CUDA_HOSTDEV constexpr bool | empty () const |
Check if the sequence contains no samples. More... | |
template<typename U > | |
CUDA_HOSTDEV constexpr int | search (U) const |
Return the position where the specified value would be inserted in the sequence in order to maintain sorted order. | |
Static Public Member Functions | |
CUDA_HOSTDEV static constexpr Linspace< T > | from_interval (T first, T last, int size) |
Construct a Linspace over the closed interval [first , last ]. More... | |
A uniformly-spaced sequence of values over some interval.
CUDA_HOSTDEV constexpr isce3::core::Linspace< T >::Linspace | ( | T | first, |
T | spacing, | ||
int | size | ||
) |
Constructor.
[in] | first | first sample |
[in] | spacing | sample spacing |
[in] | size | number of samples |
|
inline |
Check if the sequence contains no samples.
|
static |
Construct a Linspace over the closed interval [first
, last
].
The behavior is undefined if size
<= 1.
[in] | first | first sample in interval |
[in] | last | last sample in interval |
[in] | size | number of samples |
|
inline |
Return sample at the specified position.
The behavior is undefined if pos
is out of range.
CUDA_HOSTDEV constexpr void isce3::core::Linspace< T >::resize | ( | int | size | ) |
Change the number of samples in the sequence.
[in] | size | new size |
CUDA_HOSTDEV constexpr Linspace< T > isce3::core::Linspace< T >::subinterval | ( | int | start, |
int | stop | ||
) | const |
Return a sub-Linspace over the half-open interval [start
, stop
).
The behavior is undefined if start
or stop
are out-of-range
[in] | start | start position |
[in] | stop | end position |