/* * fast_functions.hpp * * Created on: Apr 1, 2010 * Author: crueger */ #ifndef FAST_FUNCTIONS_HPP_ #define FAST_FUNCTIONS_HPP_ /** * !@file * This file contains several functions that need to be very fast and which are inlined for this * reason. * * Warning: do not forget inline keyword for functions in this file to avoid multiple definitions! */ /********************************* Functions ************************************************/ /*************************** Templatized functions ************************************/ /** Flips two values. * \param x first value * \param y second value */ template inline void flip(T &x, T &y) { T tmp; tmp = x; x = y; y = tmp; }; #endif /* FAST_FUNCTIONS_HPP_ */