Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_Flops.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 // Kris
11 // 07.08.03 -- Move into Teuchos package/namespace
12 
13 #ifndef TEUCHOS_FLOPS_HPP
14 #define TEUCHOS_FLOPS_HPP
15 
32 namespace Teuchos
33 {
34 class Flops
35 {
36  public:
37 
39 
40 
42 
46  Flops();
47 
49 
51  Flops(const Flops &flops);
52 
54 
56  virtual ~Flops();
57 
59 
61 
62 
64  double flops() const { return flops_; }
65 
67 
69 
70 
72  void resetFlops() {flops_ = 0.0;}
73 
75 
76  friend class CompObject;
77 
78  protected:
79 
80  mutable double flops_;
81 
83 
84  void updateFlops(int addflops) const {flops_ += (double) addflops; }
86 
88  void updateFlops(long int addflops) const {flops_ += (double) addflops; }
89 
91  void updateFlops(double addflops) const {flops_ += (double) addflops; }
92 
94  void updateFlops(float addflops) const {flops_ += (double) addflops; }
95 
97 
98  private:
99 
100 };
101 
102  // #include "Teuchos_Flops.cpp"
103 
104 } // namespace Teuchos
105 
106 #endif // end of TEUCHOS_FLOPS_HPP
Flops()
Default Constructor.
double flops() const
Returns the number of floating point operations with this object and resets the count.
virtual ~Flops()
Destructor.
void updateFlops(int addflops) const
Increment Flop count for this object from an int.
Functionality and data that is common to all computational classes.
void resetFlops()
Resets the number of floating point operations to zero for this multi-std::vector.
void updateFlops(double addflops) const
Increment Flop count for this object from a double.
void updateFlops(long int addflops) const
Increment Flop count for this object from a long int.
void updateFlops(float addflops) const
Increment Flop count for this object from a float.
The Teuchos Floating Point Operations Class.