Ocean
base/Utilities.h File Reference

Go to the source code of this file.

Data Structures

class  Ocean::Utilities
 This class implements basic utility functions. More...
 

Namespaces

 Ocean
 The namespace covering the entire Ocean framework.
 

Functions

template<typename T >
Ocean::minmax (const T &lowerBoundary, const T &value, const T &upperBoundary)
 This function fits a given parameter into a specified value range. More...
 
template<typename T >
Ocean::modulo (const T &value, const T &ring)
 Returns the modulo value of a given parameter within a ring allowing positive and negative parameters. More...
 
template<typename T >
Ocean::ringDistance (const T &value0, const T &value1, const T &ring)
 Returns the distance between two values inside defined ring. More...
 
unsigned int Ocean::sqr (const char value)
 Returns the square value of a given value. More...
 
unsigned int Ocean::sqr (const unsigned char value)
 Returns the square value of a given value. More...
 
unsigned int Ocean::sqr (const short value)
 Returns the square value of a given value. More...
 
unsigned int Ocean::sqr (const unsigned short value)
 Returns the square value of a given value. More...
 
unsigned int Ocean::sqr (const int value)
 Returns the square value of a given value. More...
 
unsigned int Ocean::sqr (const unsigned int value)
 Returns the square value of a given value. More...
 
unsigned long Ocean::sqr (const long value)
 Returns the square value of a given value. More...
 
unsigned long Ocean::sqr (const unsigned long value)
 Returns the square value of a given value. More...
 
unsigned long long Ocean::sqr (const long long value)
 Returns the square value of a given value. More...
 
unsigned long long Ocean::sqr (const unsigned long long value)
 Returns the square value of a given value. More...
 
float Ocean::sqr (const float value)
 Returns the square value of a given value. More...
 
double Ocean::sqr (const double value)
 Returns the square value of a given value. More...
 
unsigned int Ocean::sqrDistance (const char first, const char second)
 Returns the square distance between two values. More...
 
unsigned int Ocean::sqrDistance (const unsigned char first, const unsigned char second)
 Returns the square distance between two values. More...
 
unsigned int Ocean::sqrDistance (const short first, const short second)
 Returns the square distance between two values. More...
 
unsigned int Ocean::sqrDistance (const unsigned short first, const unsigned short second)
 Returns the square distance between two values. More...
 
unsigned int Ocean::sqrDistance (const int first, const int second)
 Returns the square distance between two values. More...
 
unsigned int Ocean::sqrDistance (const unsigned int first, const unsigned int second)
 Returns the square distance between two values. More...
 
unsigned long long Ocean::sqrDistance (const long long first, const long long second)
 Returns the square distance between two values. More...
 
unsigned long long Ocean::sqrDistance (const unsigned long long first, const unsigned long long second)
 Returns the square distance between two values. More...
 
float Ocean::sqrDistance (const float first, const float second)
 Returns the square distance between two values. More...
 
double Ocean::sqrDistance (const double first, const double second)
 Returns the square distance between two values. More...
 
unsigned char Ocean::absDistance (const char first, const char second)
 Returns the absolute distance between two values. More...
 
unsigned char Ocean::absDistance (const unsigned char first, const unsigned char second)
 Returns the absolute distance between two values. More...
 
unsigned short Ocean::absDistance (const short first, const short second)
 Returns the absolute distance between two values. More...
 
unsigned short Ocean::absDistance (const unsigned short first, const unsigned short second)
 Returns the absolute distance between two values. More...
 
unsigned int Ocean::absDistance (const int first, const int second)
 Returns the absolute distance between two values. More...
 
unsigned int Ocean::absDistance (const unsigned int first, const unsigned int second)
 Returns the absolute distance between two values. More...
 
unsigned long long Ocean::absDistance (const long long first, const long long second)
 Returns the absolute distance between two values. More...
 
unsigned long long Ocean::absDistance (const unsigned long long first, const unsigned long long second)
 Returns the absolute distance between two values. More...
 
static unsigned int Ocean::mirrorValue (const int value, const unsigned int size)
 Mirrors a given value if necessary. More...
 
template<typename T >
static size_t Ocean::countElements (const std::vector< std::vector< T >> &vectors)
 Determines the entire number of elements that are stored in a vector holding a vector of elements. More...
 
template<typename T >
static bool Ocean::hasElement (const std::vector< T > &elements, const T &element)
 Returns whether a vector holds a specified element. More...
 
template<typename T >
static std::vector< T > Ocean::concatenate (const std::vector< std::vector< T >> &vectors)
 Concatenates a given set of vectors to one vector. More...
 
template<typename T >
static void Ocean::createIndices (const size_t numberIndices, const T &startIndex, std::vector< T > &indices)
 Fills a vector with increasing index values. More...
 
template<typename T >
static std::vector< T > Ocean::createIndices (const size_t numberIndices, const T &startIndex)
 Returns a vector with increasing index values. More...
 
template<>
unsigned char Ocean::modulo (const unsigned char &value, const unsigned char &ring)
 
template<>
unsigned short Ocean::modulo (const unsigned short &value, const unsigned short &ring)
 
template<>
unsigned int Ocean::modulo (const unsigned int &value, const unsigned int &ring)
 
template<>
unsigned long long Ocean::modulo (const unsigned long long &value, const unsigned long long &ring)
 
template<>
double Ocean::modulo (const double &value, const double &ring)
 
template<>
float Ocean::modulo (const float &value, const float &ring)
 
template<typename T >
size_t Ocean::countElements (const std::vector< std::vector< T >> &vectors)
 Determines the entire number of elements that are stored in a vector holding a vector of elements. More...
 
template<typename T >
bool Ocean::hasElement (const std::vector< T > &elements, const T &element)
 Returns whether a vector holds a specified element. More...
 
template<typename T >
std::vector< T > Ocean::concatenate (const std::vector< std::vector< T >> &vectors)
 Concatenates a given set of vectors to one vector. More...
 
template<typename T >
void Ocean::createIndices (const size_t numberIndices, const T &startIndex, std::vector< T > &indices)
 Fills a vector with increasing index values. More...
 
template<typename T >
std::vector< T > Ocean::createIndices (const size_t numberIndices, const T &startIndex)
 Returns a vector with increasing index values. More...