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 CompObject
00053 {
00054
00055 public:
00056
00058
00060 CompObject();
00061
00063 CompObject(const CompObject &source);
00064
00066 virtual ~CompObject();
00068
00070
00071 void setFlopCounter(const Flops &FlopCounter) {flopCounter_= (Flops *) &FlopCounter; return;};
00072
00074 void setFlopCounter(const CompObject &compObject) {flopCounter_= (Flops *) (compObject.getFlopCounter()); return;};
00075
00077 void unsetFlopCounter() {flopCounter_=0; return;};
00078
00080 Flops * getFlopCounter() const {return(flopCounter_);};
00082
00084
00085 void resetFlops() const {if (flopCounter_!=0) flopCounter_->resetFlops(); return;};
00086
00088 double getFlops() const {if (flopCounter_!=0) return(flopCounter_->flops()); else return(0.0);};
00090
00092
00093 void updateFlops(int addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;};
00094
00096 void updateFlops(long int addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;};
00097
00099 void updateFlops(double addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;};
00100
00102 void updateFlops(float addflops) const {if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;};
00104
00105 protected:
00106
00107 Flops *flopCounter_;
00108
00109 };
00110
00111
00112
00113 }
00114
00115 #endif // end of TEUCHOS_COMPOBJECT_HPP