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