CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

AbsFunction.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: AbsFunction.cc,v 1.4 2007/01/21 20:20:41 boudreau Exp $
21 #include <assert.h>
22 namespace Genfun {
24 }
25 
27 }
28 
30 }
31 
33  return FunctionComposition(this, &function);
34 }
35 
37  return ParameterComposition(this, &p);
38 }
39 
40 Derivative AbsFunction::partial(unsigned int index) const {
41  FunctionNumDeriv fPrime(this,index);
42  return Derivative(&fPrime);
43 }
44 
45 
47  return partial(v.index());
48 }
49 
51  assert(dimensionality()==1);
52  return partial(0);
53 }
54 
56  return FunctionSum(&a,&b);
57 }
58 
60  return FunctionDifference(&a,&b);
61 }
62 
64  return FunctionProduct(&a,&b);
65 }
66 
68  return FunctionQuotient(&a,&b);
69 }
70 
71 FunctionConvolution convolve (const AbsFunction & a, const AbsFunction & b, double x0, double x1) {
72  return FunctionConvolution(&a,&b, x0, x1);
73 }
74 
76  return FunctionNegation(&a);
77 }
78 
79 unsigned int AbsFunction::dimensionality() const {
80  return 1;
81 }
82 
84  return FunctionDirectProduct(&a,&b);
85 }
86 
88  return ConstTimesFunction(c, &op2);
89 }
90 
91 ConstPlusFunction operator + (const AbsFunction &op2, double c) {
92  return ConstPlusFunction(c,&op2);
93 }
94 
95 ConstPlusFunction operator - (const AbsFunction &op2, double c) {
96  return ConstPlusFunction(-c, &op2);
97 }
98 
100  return ConstTimesFunction(1/c,&op2);
101 }
102 
103 
105  return ConstTimesFunction(c,&op2);
106 }
107 
109  return ConstPlusFunction(c,&op2);
110 }
111 
113  return ConstMinusFunction(c,&op2);
114 }
115 
117  return ConstOverFunction(c,&op2);
118 }
119 
120 
122  return FunctionTimesParameter(&p, &f);
123 }
124 
126  return FunctionPlusParameter(&p, &f);
127 }
128 
130  GENPARAMETER MinusP = -p;
131  return FunctionPlusParameter(&MinusP, &f);
132 
133 }
134 
136  GENPARAMETER oneOverP = 1.0/p;
137  return FunctionTimesParameter(&oneOverP, &f);
138 }
139 
141  return FunctionTimesParameter(&p, &f);
142 }
143 
145  return FunctionPlusParameter(&p, &f);
146 }
147 
149  GENFUNCTION MinusF = -f;
150  return FunctionPlusParameter(&p, &MinusF);
151 }
152 
154  GENFUNCTION oneOverF = 1.0/f;
155  return FunctionTimesParameter(&p, &oneOverF);
156 }
157 } // namespace Genfun