Epetra_CompObject.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_COMPOBJECT_H
00033 #define EPETRA_COMPOBJECT_H
00034 
00036 
00041 #include "Epetra_Object.h"
00042 #include "Epetra_Flops.h"
00043 //==========================================================================
00044 class Epetra_CompObject {
00045 
00046   public:
00047 
00049 
00050 
00051   Epetra_CompObject();
00052 
00054   
00055   Epetra_CompObject(const Epetra_CompObject& Source);
00056   
00057   
00059   virtual ~Epetra_CompObject();
00061 
00063 
00064 
00065   void SetFlopCounter(const Epetra_Flops & FlopCounter) {FlopCounter_= (Epetra_Flops *) &FlopCounter; return;}
00067   void SetFlopCounter(const Epetra_CompObject & CompObject) {FlopCounter_= (Epetra_Flops *) (CompObject.GetFlopCounter()); return;}
00069   void UnsetFlopCounter() {FlopCounter_= 0; return;}
00071   Epetra_Flops * GetFlopCounter() const {return(FlopCounter_);}
00073 
00075 
00076 
00077   void ResetFlops() const {if (FlopCounter_!=0) FlopCounter_->ResetFlops(); return;}
00078 
00080   double Flops() const {if (FlopCounter_!=0) return(FlopCounter_->Flops()); else return(0.0);}
00082 
00084 
00085 
00086   void UpdateFlops(int Flops) const {if (FlopCounter_!=0) FlopCounter_->UpdateFlops(Flops); return;}
00087 
00089   void UpdateFlops(long int Flops) const {if (FlopCounter_!=0) FlopCounter_->UpdateFlops(Flops); return;}
00090 
00092   void UpdateFlops(double Flops) const {if (FlopCounter_!=0) FlopCounter_->UpdateFlops(Flops); return;}
00093 
00095   void UpdateFlops(float Flops) const {if (FlopCounter_!=0) FlopCounter_->UpdateFlops(Flops); return;}
00097 
00098   Epetra_CompObject& operator=(const Epetra_CompObject& src)
00099     {
00100       FlopCounter_ = src.FlopCounter_;
00101       return(*this);
00102     }
00103 
00104  protected:
00105 
00106 
00107   Epetra_Flops * FlopCounter_;
00108 
00109 };
00110 
00111 #endif /* EPETRA_COMPOBJECT_H */

Generated on Thu Sep 18 12:37:57 2008 for Epetra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1