OpenMD
3.2
Molecular Dynamics in the Open
Toggle main menu visibility
Loading...
Searching...
No Matches
Wigner3jm.hpp
1
/*
2
* Matpack Wigner3jm special function imported and modified for use in
3
* OpenMD
4
*
5
* Matpack Library Release 1.9.0
6
* Copyright (C) 1991-2003 by Berndt M. Gammel. All rights reserved.
7
*
8
* Permission to use, copy, and distribute Matpack in its entirety
9
* and its documentation for non-commercial purpose and without fee
10
* is hereby granted, provided that this license information and
11
* copyright notice appear unmodified in all copies. This software
12
* is provided 'as is' without express or implied warranty. In no
13
* event will the author be held liable for any damages arising from
14
* the use of this software.
15
*
16
* Note that distributing Matpack 'bundled' in with any product is
17
* considered to be a 'commercial purpose'.
18
*
19
* The software may be modified for your own purposes, but modified
20
* versions may not be distributed without prior consent of the
21
* author.
22
*
23
* Read the COPYRIGHT and README files in this distribution about
24
* registration and installation of Matpack.
25
*/
26
27
#ifndef MATH_WIGNER3JM_HPP
28
#define MATH_WIGNER3JM_HPP
29
30
#include <config.h>
31
32
namespace
MATPACK {
33
34
/// return sign of number
35
template
<
class
T>
36
inline
int
sign(T x) {
37
return
(x > 0) ? 1 : (x < 0) ? -1 : 0;
38
}
39
40
/*
41
* MpMin(), MpMin(): min and max templates for 2 arguments (all that
42
* is required for Wigner3jm )
43
*/
44
template
<
class
T>
45
inline
T MpMin(T x, T y) {
46
return
(x < y) ? x : y;
47
}
48
template
<
class
T>
49
inline
T MpMax(T x, T y) {
50
return
(x > y) ? x : y;
51
}
52
53
// even and odd
54
55
inline
int
even(
int
x) {
return
!(x & 1); }
56
inline
int
odd(
int
x) {
return
(x & 1); }
57
58
void
Wigner3jm(RealType l1, RealType l2, RealType l3, RealType m1,
59
RealType& m2min, RealType& m2max, RealType* thrcof,
int
ndim,
60
int
& errflag);
61
}
// namespace MATPACK
62
63
#endif
math
Wigner3jm.hpp
Generated on
for OpenMD by
1.17.0