1 # ifndef CPPAD_UTILITY_CHECK_NUMERIC_TYPE_HPP
2 # define CPPAD_UTILITY_CHECK_NUMERIC_TYPE_HPP
73 template <
class NumericType>
77 template <
class NumericType>
82 static size_t count[CPPAD_MAX_NUM_THREADS];
84 if( count[thread] > 0 )
85 return NumericType(0);
90 NumericType check_NumericType_default_constructor;
91 NumericType check_NumericType_constructor_from_int(1);
93 const NumericType x(1);
95 NumericType check_NumericType_copy_constructor(x);
98 NumericType check_NumericType_assignment;
99 check_NumericType_assignment = x;
104 const NumericType check_NumericType_unary_plus(1);
105 NumericType check_NumericType_unary_plus_result =
106 + check_NumericType_unary_plus;
108 const NumericType check_NumericType_unary_minus(1);
109 NumericType check_NumericType_unary_minus_result =
110 - check_NumericType_unary_minus;
115 const NumericType check_NumericType_binary_addition(1);
116 NumericType check_NumericType_binary_addition_result =
117 check_NumericType_binary_addition + x;
119 const NumericType check_NumericType_binary_subtraction(1);
120 NumericType check_NumericType_binary_subtraction_result =
121 check_NumericType_binary_subtraction - x;
123 const NumericType check_NumericType_binary_multiplication(1);
124 NumericType check_NumericType_binary_multiplication_result =
125 check_NumericType_binary_multiplication * x;
127 const NumericType check_NumericType_binary_division(1);
128 NumericType check_NumericType_binary_division_result =
129 check_NumericType_binary_division / x;
135 check_NumericType_computed_assignment_addition(1);
136 check_NumericType_computed_assignment_addition += x;
139 check_NumericType_computed_assignment_subtraction(1);
140 check_NumericType_computed_assignment_subtraction -= x;
143 check_NumericType_computed_assignment_multiplication(1);
144 check_NumericType_computed_assignment_multiplication *= x;
147 check_NumericType_computed_assignment_division(1);
148 check_NumericType_computed_assignment_division /= x;
153 check_NumericType_default_constructor = x;
155 + check_NumericType_default_constructor
156 + check_NumericType_constructor_from_int
157 + check_NumericType_copy_constructor
158 + check_NumericType_assignment
159 + check_NumericType_unary_plus_result
160 + check_NumericType_unary_minus_result
161 + check_NumericType_binary_addition_result
162 + check_NumericType_binary_subtraction_result
163 + check_NumericType_binary_multiplication_result
164 + check_NumericType_binary_division_result
165 + check_NumericType_computed_assignment_addition
166 + check_NumericType_computed_assignment_subtraction
167 + check_NumericType_computed_assignment_multiplication
168 + check_NumericType_computed_assignment_division
NumericType CheckNumericType(void)
static size_t thread_num(void)
Get current thread number.
File used to define the CppAD multi-threading allocator class.