Collection of static methods for generating evenly spaced numbers.
More...
|
template<is::realNumber ElementType> |
static Vector< ElementType > | makeVector (ElementType start, ElementType stop, size_t num, bool includeEnd=true) |
| Returns a Vector with evenly spaced numbers between start and stop.
|
|
template<is::realNumber ElementType, size_t num> |
static constexpr Array< ElementType, num > | makeArray (ElementType start, ElementType stop, bool includeEnd=true) |
| Like makeVector, but returns an Array.
|
|
template<is::realNumber ElementType> |
static Vector< ElementType > | makeVector (ElementType start, ElementType stop, bool includeEnd=true) |
| Returns a Vector with values between start and stop and a step of 1.
|
|
Collection of static methods for generating evenly spaced numbers.
◆ makeArray()
template<is::realNumber ElementType, size_t num>
static constexpr Array< ElementType, num > vctr::generators::Linspace::makeArray |
( |
ElementType |
start, |
|
|
ElementType |
stop, |
|
|
bool |
includeEnd = true |
|
) |
| |
|
inlinestaticconstexpr |
Like makeVector, but returns an Array.
◆ makeVector() [1/2]
template<is::realNumber ElementType>
static Vector< ElementType > vctr::generators::Linspace::makeVector |
( |
ElementType |
start, |
|
|
ElementType |
stop, |
|
|
bool |
includeEnd = true |
|
) |
| |
|
inlinestatic |
Returns a Vector with values between start and stop and a step of 1.
Properties:
- The number of elements is stop - start + 1.
- If start and stop are identical, the container will be filled with that value.
- Ranges can have a negative increment, i.e., start > stop is explicitly allowed.
@Note: stop - start must not be fractional.
- Template Parameters
-
ElementType | Element type contained in the vector. |
- Parameters
-
start | First value of the interval; always included. |
stop | Last value of the interval; only included if includeEnd is true. |
includeEnd | If this is true, the numbers lie on the closed interval [start, stop]; otherwise the interval is half-open [start, stop). |
◆ makeVector() [2/2]
template<is::realNumber ElementType>
static Vector< ElementType > vctr::generators::Linspace::makeVector |
( |
ElementType |
start, |
|
|
ElementType |
stop, |
|
|
size_t |
num, |
|
|
bool |
includeEnd = true |
|
) |
| |
|
inlinestatic |
Returns a Vector with evenly spaced numbers between start and stop.
Properties:
- If start and stop are identical, the container will be filled with that value.
- Ranges can have a negative increment, i.e., start > stop is explicitly allowed.
- Template Parameters
-
ElementType | Element type contained in the vector. |
- Parameters
-
start | First value of the interval; always included. |
stop | Last value of the interval; only included if includeEnd is true. |
num | Number of elements (length of the vector), must be > 0. |
includeEnd | If this is true, both start and stop are included; otherwise only start is included. |
The documentation for this struct was generated from the following file: