GeoModel - GeoModelCore
ATan.cpp
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 #include "GeoGenericFunctions/ATan.h"
7 #include "GeoGenericFunctions/Square.h"
8 #include <assert.h>
9 #include <cmath> // for atan()
10 
11 namespace GeoGenfun {
12 FUNCTION_OBJECT_IMP(ATan)
13 
14 ATan::ATan()
15 {}
16 
17 ATan::~ATan() {
18 }
19 
20 ATan::ATan(const ATan & right) : AbsFunction(right)
21 { }
22 
23 
24 double ATan::operator() (double x) const {
25  return atan(x);
26 }
27 
28 // don't generate warnings about unused parameter inside assert
29 #if defined __GNUC__
30  #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
31  #pragma GCC diagnostic push
32  #pragma GCC diagnostic ignored "-Wunused-parameter"
33  #endif
34 #endif
35 #ifdef __clang__
36  #pragma clang diagnostic push
37  #pragma clang diagnostic ignored "-Wunused-parameter"
38 #endif
39 Derivative ATan::partial(unsigned int index) const {
40  assert(index==0);
41 
42  Square square;
43 
44  const AbsFunction & fPrime=1.0/(1.0+square);;
45  return Derivative(& fPrime);
46 }
47 #if defined __GNUC__
48  #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
49  #pragma GCC diagnostic pop
50  #endif
51 #endif
52 #ifdef __clang__
53  #pragma clang diagnostic pop
54 #endif
55 
56 } // end namespace Genfun
Definition: Abs.h:15