Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
constants.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file numeric/constants.hh
11 /// @brief Common numeric constants in varying precisions
12 /// @author Frank M. D'Ippolito (Objexx@objexx.com)
13 /// @author Stuart G. Mentzer (Stuart_Mentzer@objexx.com)
14 /// @note The 'constants' namespace and the namespaces within it
15 // do not correspond to any package
16 
17 
18 #ifndef INCLUDED_numeric_constants_hh
19 #define INCLUDED_numeric_constants_hh
20 
21 
22 #include <numeric/types.hh>
23 
24 
25 namespace numeric {
26 namespace constants {
27 
28 
29 // float
30 namespace f {
31 
32 typedef float Type;
33 
34 extern Type const zero;
35 extern Type const one;
36 extern Type const two;
37 extern Type const pi;
38 extern Type const pi_2; // 2 * pi
39 extern Type const pi_over_2; // pi / 2
40 extern Type const pi_over_3; // pi / 3
41 extern Type const pi_2_over_3; // ( 2 * pi ) / 3
42 extern Type const pi_over_180; // pi / 180
43 extern Type const degrees_to_radians;
44 extern Type const deg2rad;
45 extern Type const radians_to_degrees;
46 extern Type const rad2deg;
47 
48 } // namespace f
49 
50 
51 // double
52 namespace d {
53 
54 typedef double Type;
55 
56 extern Type const zero;
57 extern Type const one;
58 extern Type const two;
59 extern Type const pi;
60 extern Type const pi_2; // 2 * pi
61 extern Type const pi_over_2; // pi / 2
62 extern Type const pi_over_3; // pi / 3
63 extern Type const pi_2_over_3; // ( 2 * pi ) / 3
64 extern Type const pi_over_180; // pi / 180
65 extern Type const degrees_to_radians;
66 extern Type const deg2rad;
67 extern Type const radians_to_degrees;
68 extern Type const rad2deg;
69 
70 } // namespace d
71 
72 
73 // long double
74 namespace ld {
75 
76 typedef long double Type;
77 
78 extern Type const zero;
79 extern Type const one;
80 extern Type const two;
81 extern Type const pi;
82 extern Type const pi_2; // 2 * pi
83 extern Type const pi_over_2; // pi / 2
84 extern Type const pi_over_3; // pi / 3
85 extern Type const pi_2_over_3; // ( 2 * pi ) / 3
86 extern Type const pi_over_180; // pi / 180
87 extern Type const degrees_to_radians;
88 extern Type const deg2rad;
89 extern Type const radians_to_degrees;
90 extern Type const rad2deg;
91 
92 } // namespace ld
93 
94 
95 // Real
96 namespace r {
97 
98 typedef Real Type;
99 
100 extern Type const zero;
101 extern Type const one;
102 extern Type const two;
103 extern Type const pi;
104 extern Type const pi_2; // 2 * pi
105 extern Type const pi_over_2; // pi / 2
106 extern Type const pi_over_3; // pi / 3
107 extern Type const pi_2_over_3; // ( 2 * pi ) / 3
108 extern Type const pi_over_180; // pi / 180
109 extern Type const degrees_to_radians;
110 extern Type const deg2rad;
111 extern Type const radians_to_degrees;
112 extern Type const rad2deg;
113 
114 } // namespace r
115 
116 
117 } // namespace constants
118 } // namespace numeric
119 
120 
121 #endif // INCLUDED_numeric_constants_HH
Type const pi_over_2
Definition: constants.cc:37
Type const pi_over_180
Definition: constants.cc:62
Type const pi_over_180
Definition: constants.cc:40
Type const pi_over_2
Definition: constants.cc:103
Type const deg2rad
Definition: constants.cc:42
Type const pi_over_3
Definition: constants.cc:38
Type const pi_over_3
Definition: constants.cc:82
Type const pi_2_over_3
Definition: constants.cc:61
Type const pi_over_180
Definition: constants.cc:106
Type const radians_to_degrees
Definition: constants.cc:65
Type const radians_to_degrees
Definition: constants.cc:87
Type const pi_2_over_3
Definition: constants.cc:39
Type const degrees_to_radians
Definition: constants.cc:41
Type const degrees_to_radians
Definition: constants.cc:107
Type const rad2deg
Definition: constants.cc:66
Type const radians_to_degrees
Definition: constants.cc:43
Type const radians_to_degrees
Definition: constants.cc:109
Type const rad2deg
Definition: constants.cc:44
Type const pi_2_over_3
Definition: constants.cc:83
Type const pi_over_2
Definition: constants.cc:81
Type const pi_2_over_3
Definition: constants.cc:105
rosetta project type declarations. Should be kept updated with core/types.hh. This exists because num...
Type const pi_over_2
Definition: constants.cc:59
Type const degrees_to_radians
Definition: constants.cc:63
Type const pi_over_3
Definition: constants.cc:60
Type const deg2rad
Definition: constants.cc:64
Type const degrees_to_radians
Definition: constants.cc:85
Type const pi_over_180
Definition: constants.cc:84
Type const pi_over_3
Definition: constants.cc:104