API Documentation
Loading...
Searching...
No Matches
BaseFunctions.hpp File Reference
#include <NDEVR/BaseValues.h>
#include <NDEVR/LibAssert.h>
Include dependency graph for BaseFunctions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  NDEVR
 

Functions

template<typename t_type >
constexpr t_type clip (const t_type &value, const t_type &lower_bound, const t_type &upper_bound)
 Clips the value given so that that the returned value falls between upper and lower bound.
 
template<>
constexpr sint01 getMax (const sint01 &left, const sint01 &right)
 
template<>
constexpr sint02 getMax (const sint02 &left, const sint02 &right)
 
template<>
constexpr sint04 getMax (const sint04 &left, const sint04 &right)
 
template<>
constexpr sint08 getMax (const sint08 &left, const sint08 &right)
 
template<typename t_type >
constexpr t_type getMax (const t_type &left, const t_type &middle, const t_type &right)
 
template<typename t_type >
constexpr t_type getMax (const t_type &left, const t_type &right)
 Finds the max of the given arguments using the > operator The only requirement is that t_type have > operator defined.
 
template<>
constexpr uint01 getMax (const uint01 &left, const uint01 &right)
 
template<>
constexpr uint02 getMax (const uint02 &left, const uint02 &right)
 
template<>
constexpr uint04 getMax (const uint04 &left, const uint04 &right)
 
template<>
constexpr uint08 getMax (const uint08 &left, const uint08 &right)
 
template<>
constexpr sint01 getMin (const sint01 &left, const sint01 &right)
 
template<>
constexpr sint02 getMin (const sint02 &left, const sint02 &right)
 
template<>
constexpr sint04 getMin (const sint04 &left, const sint04 &right)
 
template<>
constexpr sint08 getMin (const sint08 &left, const sint08 &right)
 
template<typename t_type >
constexpr t_type getMin (const t_type &left, const t_type &middle, const t_type &right)
 
template<typename t_type >
constexpr t_type getMin (const t_type &left, const t_type &right)
 Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05.
 
template<>
constexpr uint01 getMin (const uint01 &left, const uint01 &right)
 
template<>
constexpr uint02 getMin (const uint02 &left, const uint02 &right)
 
template<>
constexpr uint04 getMin (const uint04 &left, const uint04 &right)
 
template<>
constexpr uint08 getMin (const uint08 &left, const uint08 &right)
 
template<>
constexpr bool IsInvalid (const fltp04 &value)
 
template<>
constexpr bool IsInvalid (const fltp08 &value)
 
template<class t_type >
constexpr bool IsInvalid (const t_type &value)
 Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations or false for operator checks, when possible.
 
template<typename t_type >
constexpr t_type quantize (t_type value, t_type d=cast< t_type >(1))
 Rounds the value to the nearest multiple given and returns that value.
 
template<typename t_type >
constexpr t_type sign (t_type value)
 A simple function that returns 1 for all values greater than or equal to 0 and -1 for all values less than 0.