-
Notifications
You must be signed in to change notification settings - Fork 15
/
commonFunctions.h
33 lines (29 loc) · 864 Bytes
/
commonFunctions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*******************************************************-/
* This source code is subject to the terms of the GNU -/
* Lesser Public License. If a copy of the LGPL was not -/
* distributed with this file, you can obtain one at -/
* https://www.gnu.org/licenses/lgpl.html. -/
********************************************************/
/** \file commonFunctions.h
*
* \author Joey Dumont <[email protected]>
*
* \since 2014-07-10
*
* \brief Defines some common functions to the C++ and Fortran code.
*
* We define some functions that will be of use in both the C++ and Fortran
* parts of this library.
*
*/
namespace WignerSymbols {
template <typename T>
double sgn(T val)
{
int sgn = (T(0) < val) - (val < T(0));
if (sgn == 0)
return 1.0;
else
return (double)sgn;
}
} // namespace WignerSymbols