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