Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_CompObject.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_COMPOBJECT_HPP
14#define TEUCHOS_COMPOBJECT_HPP
15
21#include "Teuchos_Object.hpp"
22#include "Teuchos_Flops.hpp"
23
31namespace Teuchos
32{
33class TEUCHOSNUMERICS_LIB_DLL_EXPORT CompObject
34{
35
36 public:
37
39
40
42 CompObject();
43
45 CompObject(const CompObject &source);
46
48 virtual ~CompObject();
50
52
53
54 void setFlopCounter(const Flops &FlopCounter) {flopCounter_= (Flops *) &FlopCounter; return;}
55
57 void setFlopCounter(const CompObject &compObject) {flopCounter_= (Flops *) (compObject.getFlopCounter()); return;}
58
60 void unsetFlopCounter() {flopCounter_=0; return;}
61
63 Flops * getFlopCounter() const {return(flopCounter_);}
65
67
68
69 void resetFlops() const {if (flopCounter_!=0) flopCounter_->resetFlops(); return;}
70
72 double getFlops() const {if (flopCounter_!=0) return(flopCounter_->flops()); else return(0.0);}
74
76
77
78 void updateFlops(int addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
79
81 void updateFlops(long int addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
82
84 void updateFlops(double addflops) const { if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
85
87 void updateFlops(float addflops) const {if (flopCounter_!=0) flopCounter_->updateFlops(addflops); return;}
89
90 protected:
91
92 Flops *flopCounter_;
93
94};
95
96 // #include "Teuchos_CompObject.cpp"
97
98} // namespace Teuchos
99
100#endif // end of TEUCHOS_COMPOBJECT_HPP
Object for providing basic support and consistent interfaces for counting/reporting floating-point op...
The base Teuchos object.
Functionality and data that is common to all computational classes.
void setFlopCounter(const Flops &FlopCounter)
Set the internal Teuchos::Flops() pointer.
void updateFlops(int addflops) const
Increment Flop count for this object.
void updateFlops(long int addflops) const
Increment Flop count for this object.
void unsetFlopCounter()
Set the internal Teuchos::Flops() pointer to 0 (no flops counted).
Flops * getFlopCounter() const
Get the pointer to the Teuchos::Flops() object associated with this object, returns 0 if none.
void updateFlops(double addflops) const
Increment Flop count for this object.
void resetFlops() const
Resets the number of floating point operations to zero for this multi-std::vector.
double getFlops() const
Returns the number of floating point operations with this multi-std::vector.
void setFlopCounter(const CompObject &compObject)
Set the internal Teuchos::Flops() pointer to the flop counter of another Teuchos::CompObject.
void updateFlops(float addflops) const
Increment Flop count for this object.
The Teuchos Floating Point Operations Class.
Smart reference counting pointer class for automatic garbage collection.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...