G4tgrEvaluator.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4tgrEvaluator.cc 69803 2013-05-15 15:24:50Z gcosmo $
00028 //
00029 //
00030 // class G4tgrEvaluator
00031 
00032 // History:
00033 // - Created.                                 P.Arce, CIEMAT (November 2007)
00034 // -------------------------------------------------------------------------
00035 
00036 #include "G4tgrEvaluator.hh"
00037 
00038 #include <cmath>
00039 
00040 // -------------------------------------------------------------------------
00041 G4tgrEvaluator::G4tgrEvaluator()
00042 {
00043   AddCommonFunctions();
00044 }
00045 
00046 
00047 // -------------------------------------------------------------------------
00048 G4tgrEvaluator::~G4tgrEvaluator()
00049 {
00050 }
00051 
00052 
00053 // -------------------------------------------------------------------------
00054 void G4tgrEvaluator::print_error( G4int estatus ) const
00055 {
00056   switch (estatus)
00057   {
00058     case ERROR_SYNTAX_ERROR:
00059       G4cerr << "G4tgrEvaluator: syntax error!" << G4endl;
00060       return;
00061     default:
00062       G4Evaluator::print_error();    
00063     return;
00064   }
00065 } 
00066  
00067 G4double fsin( G4double arg ){  return std::sin(arg); }
00068 G4double fcos( G4double arg ){  return std::cos(arg); }
00069 G4double ftan( G4double arg ){  return std::tan(arg); }
00070 G4double fasin( G4double arg ){  return std::asin(arg); }
00071 G4double facos( G4double arg ){  return std::acos(arg); }
00072 G4double fatan( G4double arg ){  return std::atan(arg); }
00073 G4double fatan2( G4double arg1, G4double arg2 ){ return std::atan2(arg1,arg2); }
00074 G4double fsinh( G4double arg ){  return std::sinh(arg); }
00075 G4double fcosh( G4double arg ){  return std::cosh(arg); }
00076 G4double ftanh( G4double arg ){  return std::tanh(arg); }
00077 // G4double fasinh( G4double arg ){  return std::asinh(arg); }
00078 // G4double facosh( G4double arg ){  return std::acosh(arg); }
00079 // G4double fatanh( G4double arg ){  return std::atanh(arg); }
00080 G4double fsqrt( G4double arg ){  return std::sqrt(arg); }
00081 G4double fexp( G4double arg ){  return std::exp(arg); }
00082 G4double flog( G4double arg ){  return std::log(arg); }
00083 G4double flog10( G4double arg ){  return std::log10(arg); }
00084 G4double fpow( G4double arg1, G4double arg2 ){  return std::pow(arg1,arg2); }
00085 
00086 
00087 //--------------------------------------------------------------------
00088 void G4tgrEvaluator::AddCommonFunctions()
00089 {
00090   setFunction("sin", (*fsin));
00091   setFunction("cos", (*fcos));
00092   setFunction("tan", (*ftan));
00093   setFunction("asin", (*fasin));
00094   setFunction("acos", (*facos));
00095   setFunction("atan", (*fatan));
00096   setFunction("atan2", (*fatan2));
00097   setFunction("sinh", (*fsinh));
00098   setFunction("cosh", (*fcosh));
00099   setFunction("tanh", (*ftanh));
00100 //  setFunction("asinh", (*fasinh));
00101 //  setFunction("acosh", (*facosh));
00102 //  setFunction("atanh", (*fatanh));
00103   setFunction("sqrt", (*fsqrt));
00104   setFunction("exp", (*fexp));
00105   setFunction("log", (*flog));
00106   setFunction("log10", (*flog10));
00107   setFunction("pow", (*fpow));
00108 }

Generated on Mon May 27 17:49:58 2013 for Geant4 by  doxygen 1.4.7