source: src/fast_functions.hpp@ 8931ef

Last change on this file since 8931ef was a80f419, checked in by Frederik Heber <heber@…>, 15 years ago

First version.

Everything was extracted from project MoleCuilder and adapted such that it
runs on its own (i.e. new configure.ac, Makefile.am structure, stuff for
libtool versioning, ...)

  • Property mode set to 100644
File size: 762 bytes
Line 
1/*
2 * fast_functions.hpp
3 *
4 * Created on: Apr 1, 2010
5 * Author: crueger
6 */
7
8#ifndef FAST_FUNCTIONS_HPP_
9#define FAST_FUNCTIONS_HPP_
10
11/**
12 * !@file
13 * This file contains several functions that need to be very fast and which are inlined for this
14 * reason.
15 *
16 * Warning: do not forget inline keyword for functions in this file to avoid multiple definitions!
17 */
18
19/********************************* Functions ************************************************/
20
21/*************************** Templatized functions ************************************/
22
23/** Flips two values.
24 * \param x first value
25 * \param y second value
26 */
27template <typename T>
28inline void flip(T &x, T &y)
29{
30 T tmp;
31 tmp = x;
32 x = y;
33 y = tmp;
34};
35
36#endif /* FAST_FUNCTIONS_HPP_ */
Note: See TracBrowser for help on using the repository browser.