CLHEP 2.0.4.7 Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: 00003 #ifndef _ArrayFunction_h_ 00004 #define _ArrayFunction_h_ 00005 //-------------------------------------------------------// 00006 // This one dimensional function takes its values from // 00007 // an array..which it copies in. // 00008 //-------------------------------------------------------// 00009 00010 00011 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00012 #include <vector> 00013 namespace Genfun { 00014 class ArrayFunction : public AbsFunction { 00015 00016 FUNCTION_OBJECT_DEF(ArrayFunction) 00017 00018 public: 00019 00020 // Constructor 00021 ArrayFunction(const double *begin, const double *end); 00022 00023 // Destructor 00024 virtual ~ArrayFunction(); 00025 00026 // Copy constructor 00027 ArrayFunction(const ArrayFunction &right); 00028 00029 // Retreive function value 00030 virtual double operator ()(double argument) const; 00031 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00032 00033 private: 00034 00035 // It is illegal to assign a ArrayFunction 00036 const ArrayFunction & operator=(const ArrayFunction &right); 00037 00038 std::vector<double> _values; 00039 }; 00040 } 00041 #endif