Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
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
32namespace Teuchos
33{
34class 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
85 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
Functionality and data that is common to all computational classes.
The Teuchos Floating Point Operations Class.
virtual ~Flops()
Destructor.
double flops() const
Returns the number of floating point operations with this object and resets the count.
Flops()
Default Constructor.
void updateFlops(int addflops) const
Increment Flop count for this object from an int.
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.
void updateFlops(double addflops) const
Increment Flop count for this object from a double.
void resetFlops()
Resets the number of floating point operations to zero for this multi-std::vector.
Smart reference counting pointer class for automatic garbage collection.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...