CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
ACos.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: ACos.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
3#include "CLHEP/GenericFunctions/ACos.hh"
4#include "CLHEP/GenericFunctions/Sqrt.hh"
5#include "CLHEP/GenericFunctions/Square.hh"
6#include <assert.h>
7#include <cmath> // for acos()
8
9namespace Genfun {
11
13{}
14
16}
17
18ACos::ACos(const ACos & right) : AbsFunction(right)
19{ }
20
21
22double ACos::operator() (double x) const {
23 return acos(x);
24}
25
26// don't generate warnings about unused parameter inside assert
27#if defined __GNUC__
28 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
29 #pragma GCC diagnostic push
30 #pragma GCC diagnostic ignored "-Wunused-parameter"
31 #endif
32#endif
33#ifdef __clang__
34 #pragma clang diagnostic push
35 #pragma clang diagnostic ignored "-Wunused-parameter"
36#endif
37Derivative ACos::partial(unsigned int index) const {
38 assert(index==0);
39
40 Square square;
41 Sqrt root;
42
43 const AbsFunction & fPrime = - 1.0/root(1.0-square) ;
44 return Derivative(& fPrime);
45}
46#if defined __GNUC__
47 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
48 #pragma GCC diagnostic pop
49 #endif
50#endif
51#ifdef __clang__
52 #pragma clang diagnostic pop
53#endif
54
55} // end namespace Genfun
56
57
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual double operator()(double argument) const override
Definition: ACos.cc:22
virtual ~ACos()
Definition: ACos.cc:15
Derivative partial(unsigned int) const override
Definition: ACos.cc:37
Definition: Abs.hh:14
FunctionNoop Derivative
Definition: AbsFunction.hh:42