Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

corrfunc.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------
00002 //
00003 // corrfunc.h
00004 //
00005 // Header file for the CorrFunc class 
00006 // 
00007 // April 2001
00008 //
00009 // Kostas Orginos
00010 //
00011 //------------------------------------------------------------------
00012 
00013 
00014 #ifndef INCLUDED_CORRFUNC_H
00015 #define INCLUDED_CORRFUNC_H
00016 
00017 #include <stdlib.h> 
00018 #include <stdio.h>
00019 #include <util/data_types.h>
00020 #include <comms/glb.h>
00021 #include <util/gjp.h>
00022 #include <util/verbose.h>
00023 #include <util/error.h>
00024 #include <util/qcdio.h>
00025 
00026 CPS_START_NAMESPACE
00027 
00028 class CorrFunc {
00029   Complex *func ;
00030   int Nt ;
00031   
00032  public:
00033   CorrFunc() ;
00034   // copy constructor
00035   CorrFunc(const CorrFunc& rhs) ;
00036   ~CorrFunc(){ sfree(func);}
00037   // "equal" operator for CorrFunc 
00038   CorrFunc& operator=(const CorrFunc& rhs) ;
00039   CorrFunc& operator*=(const CorrFunc& rhs) ;
00040   CorrFunc& operator+=(const CorrFunc& rhs) ;
00041   CorrFunc& operator-=(const CorrFunc& rhs) ;
00042   CorrFunc& operator*=(const Float& r) ;
00043   CorrFunc& operator*=(const Complex& c) ;
00044   
00045   int TimeSize() const  {return Nt;} 
00046 
00047   // Output functions
00048   void print(FILE *fp) const 
00049     {
00050       for(int t=0; t<Nt; t++)
00051         Fprintf(fp,"%i  %e  %e\n", t,func[t].real(),func[t].imag());
00052     }
00053   
00054   void print(FILE *fp,int t) const
00055     {
00056       Fprintf(fp," %e  %e ",func[t].real(),func[t].imag());
00057     }
00058 
00059   void GlobalSum(void)
00060     {
00061 #if TARGET == QCDOC
00062       slice_sum((Float*)func, 2*Nt, 99);
00063 #endif
00064     }
00065 
00066   Complex& operator[](int i) { return func[i] ; }
00067 
00068   void Zero(){ for(int t = 0 ; t<Nt; t++) func[t] = 0.0 ;}
00069 
00070 };
00071 
00072 CPS_END_NAMESPACE
00073 
00074 #endif 
00075 
00076 

Generated on Sat Oct 10 14:11:10 2009 for Columbia Physics System by  doxygen 1.3.9.1