CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // $Id: 00002 // -*- C++ -*- 00003 // 00004 //----------------------Abs---------- --------------------------------------// 00005 // // 00006 // Class Abs // 00007 // Joe Boudreau, Petar Maksimovic, Nov. 1999 // 00008 // // 00009 // Abs is a function that returns the absolute value of its argument // 00010 //--------------------------------------------------------------------------// 00011 #ifndef Abs_h 00012 #define Abs_h 1 00013 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00014 namespace Genfun { 00015 class Abs : public AbsFunction { 00016 00017 FUNCTION_OBJECT_DEF(Abs) 00018 00019 public: 00020 00021 // Constructor 00022 Abs(); 00023 00024 // Copy constructor 00025 Abs(const Abs &right); 00026 00027 // Destructor 00028 virtual ~Abs(); 00029 00030 // Retrieve function value 00031 virtual double operator ()(double argument) const; 00032 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00033 00034 private: 00035 00036 // It is illegal to assign a fixed constant 00037 const Abs & operator=(const Abs &right); 00038 00039 }; 00040 } 00041 00042 #endif