CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
ArrayFunction.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id:
3
#include "
CLHEP/GenericFunctions/ArrayFunction.hh
"
4
5
namespace
Genfun {
6
7
FUNCTION_OBJECT_IMP
(ArrayFunction)
8
9
// Constructor
10
ArrayFunction
::
ArrayFunction
(const
double
*begin, const
double
*end) :
11
_values(begin,end) {}
12
13
// Destructor
14
ArrayFunction::~ArrayFunction
(){}
15
16
// Copy constructor
17
ArrayFunction::ArrayFunction
(
const
ArrayFunction
&right):
18
AbsFunction
(right), _values(right._values) {}
19
20
// Retreive function value
21
double
ArrayFunction::operator ()
(
double
argument)
const
{
22
int
i = int (argument+0.5);
23
if
(i<0 || i>=
int
(_values.size()))
return
0;
24
else
return
_values[i];
25
}
26
27
}
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2