Simpatico  v1.10
Constants.cpp
1 /*
2 * Util Package - C++ Utilities for Scientific Computation
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "Constants.h"
9 #include <cmath>
10 
11 namespace Util
12 {
13 
14  const double Constants::Pi = 2.0*acos(0.0);
15  const std::complex<double> Constants::Im = std::complex<double>(0.0, 1.0);
16 
17  /*
18  * This function exists to guarantee initialization of static constants.
19  * Calling it guarantees that the contents of this file will be linked,
20  * rather than optimized away. It may only be called once.
21  */
23  {
24  // This method may only be called once.
25  static int nCall = 0;
26  ++nCall;
27  }
28 
29 }
Utility classes for scientific computation.
Definition: accumulators.mod:1
static void initStatic()
Initialize static constants.
Definition: Constants.cpp:22
static const double Pi
Trigonometric constant Pi.
Definition: Constants.h:35
static const std::complex< double > Im
Square root of -1.
Definition: Constants.h:40