Utility helper functions and classes. More...
Classes | |
class | RandomGenerator |
A class for (pseudo) random number generation. More... | |
struct | Range |
POD type that represents a range of values, for classes requiring a min and a max. More... | |
class | SmoothedValue |
A utility class to smooth discrete values over a given period. More... | |
Typedefs | |
using | Random = RandomGenerator<std::mt19937> |
Enumerations | |
enum class | SmoothingType { Linear , Exponential } |
Enum to configure SmoothedValue to either use linear smoothing, or exponential (lowpass) smoothing. More... | |
Functions | |
template<typename T> | |
void | writeToCsv (const std::string &path, std::span< T > data) |
std::optional< std::string > | getCurrentExecutablePath () |
bool | readBinaryFile (const std::string &path, std::vector< char > &data) |
template<NumericType T> | |
bool | operator== (const Range< T > &lhs, const Range< T > &rhs) |
template<NumericType T> | |
bool | operator!= (const Range< T > &lhs, const Range< T > &rhs) |
template<NumericType T> | |
Range< T > | operator+ (const Range< T > &other, T constant) |
template<NumericType T> | |
Range< T > | operator- (const Range< T > &other, T constant) |
template<NumericType T> | |
Range< T > | operator* (const Range< T > &other, T constant) |
template<NumericType T> | |
Range< T > | operator/ (const Range< T > &other, T constant) |
Utility helper functions and classes.
using marvin::utils::Random = RandomGenerator<std::mt19937> |
|
strong |
Enum to configure SmoothedValue to either use linear smoothing, or exponential (lowpass) smoothing.
Enumerator | |
---|---|
Linear | |
Exponential |
|
nodiscard |
Attemps to retrieve the full path to the current executable file.
Range< T > marvin::utils::operator* | ( | const Range< T > & | other, |
T | constant ) |
Range< T > marvin::utils::operator+ | ( | const Range< T > & | other, |
T | constant ) |
Range< T > marvin::utils::operator- | ( | const Range< T > & | other, |
T | constant ) |
Range< T > marvin::utils::operator/ | ( | const Range< T > & | other, |
T | constant ) |
bool marvin::utils::readBinaryFile | ( | const std::string & | path, |
std::vector< char > & | data ) |
void marvin::utils::writeToCsv | ( | const std::string & | path, |
std::span< T > | data ) |
Writes the contents of an array-like to a CSV file. The resulting CSV will be single dimensional, with each element as a column.
path | The full path to the destination file. |
data | The data to write to the destination file. |