00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef TEUCHOS_COMPOBJECT_HPP
00033 #define TEUCHOS_COMPOBJECT_HPP
00034
00040 #include "Teuchos_Object.hpp"
00041 #include "Teuchos_Flops.hpp"
00042
00050 namespace Teuchos
00051 {
00052 class TEUCHOS_LIB_DLL_EXPORT CompObject
00053 {
00054
00055 public:
00056
00058
00059
00061 CompObject();
00062
00064 CompObject(const CompObject &source);
00065
00067 virtual ~CompObject();
00069
00071
00072
00073 void setFlopCounter(const Flops &FlopCounter) {flopCounter_= (Flops *) &FlopCounter; return;}
00074
00076 void setFlopCounter(const CompObject &compObject) {flopCounter_= (Flops *) (compObject.getFlopCounter()); return;}
00077
00079 void unsetFlopCounter() {flopCounter_=0; return;}
00080
00082 Flops * getFlopCounter() const {return(flopCounter_);}
00084
00086
00087
00088 void resetFlops() const {if (flopCounter_!=0) flopCounter_->resetFlops(); return;}
00089
00091 double getFlops() const {if (flopCounter_!=0) return(flopCounter_->flops()); else return(0.0);}
00093
00095
00096
00097 void updateFlops(int addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
00098
00100 void updateFlops(long int addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
00101
00103 void updateFlops(double addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
00104
00106 void updateFlops(float addflops) const {if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
00108
00109 protected:
00110
00111 Flops *flopCounter_;
00112
00113 };
00114
00115
00116
00117 }
00118
00119 #endif // end of TEUCHOS_COMPOBJECT_HPP