Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:34

0001 // -*- C++ -*-
0002 // $Id: 
0003 #ifndef _ArrayFunction_h_
0004 #define _ArrayFunction_h_
0005 //-------------------------------------------------------//
0006 // This one dimensional function takes its values from   //
0007 // an array..which it copies in.                         //
0008 //-------------------------------------------------------//
0009 
0010 
0011 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0012 #include <vector>
0013 namespace Genfun {
0014 class ArrayFunction : public AbsFunction  {
0015   
0016   FUNCTION_OBJECT_DEF(ArrayFunction)
0017     
0018     public:
0019   
0020   // Constructor
0021   ArrayFunction(const double *begin, const double *end);
0022   
0023   // Destructor
0024   virtual ~ArrayFunction();
0025   
0026   // Copy constructor
0027   ArrayFunction(const ArrayFunction &right);
0028   
0029   // Retreive function value
0030   virtual double operator ()(double argument) const override;
0031   virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
0032   
0033  private:
0034   
0035   // It is illegal to assign a ArrayFunction
0036   const ArrayFunction & operator=(const ArrayFunction &right);
0037 
0038   std::vector<double> _values;
0039 };
0040 }
0041 #endif