Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
numerics
src
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
20
21
#include "
Teuchos_Object.hpp
"
22
#include "
Teuchos_Flops.hpp
"
23
30
31
namespace
Teuchos
32
{
33
class
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
Teuchos_Flops.hpp
Object for providing basic support and consistent interfaces for counting/reporting floating-point op...
Teuchos_Object.hpp
The base Teuchos object.
Teuchos::CompObject::setFlopCounter
void setFlopCounter(const Flops &FlopCounter)
Set the internal Teuchos::Flops() pointer.
Definition
Teuchos_CompObject.hpp:54
Teuchos::CompObject::updateFlops
void updateFlops(int addflops) const
Increment Flop count for this object.
Definition
Teuchos_CompObject.hpp:78
Teuchos::CompObject::updateFlops
void updateFlops(long int addflops) const
Increment Flop count for this object.
Definition
Teuchos_CompObject.hpp:81
Teuchos::CompObject::CompObject
CompObject()
Default constructor.
Definition
Teuchos_CompObject.cpp:20
Teuchos::CompObject::unsetFlopCounter
void unsetFlopCounter()
Set the internal Teuchos::Flops() pointer to 0 (no flops counted).
Definition
Teuchos_CompObject.hpp:60
Teuchos::CompObject::getFlopCounter
Flops * getFlopCounter() const
Get the pointer to the Teuchos::Flops() object associated with this object, returns 0 if none.
Definition
Teuchos_CompObject.hpp:63
Teuchos::CompObject::updateFlops
void updateFlops(double addflops) const
Increment Flop count for this object.
Definition
Teuchos_CompObject.hpp:84
Teuchos::CompObject::resetFlops
void resetFlops() const
Resets the number of floating point operations to zero for this multi-stdvector.
Definition
Teuchos_CompObject.hpp:69
Teuchos::CompObject::getFlops
double getFlops() const
Returns the number of floating point operations with this multi-stdvector.
Definition
Teuchos_CompObject.hpp:72
Teuchos::CompObject::setFlopCounter
void setFlopCounter(const CompObject &compObject)
Set the internal Teuchos::Flops() pointer to the flop counter of another Teuchos::CompObject.
Definition
Teuchos_CompObject.hpp:57
Teuchos::CompObject::updateFlops
void updateFlops(float addflops) const
Increment Flop count for this object.
Definition
Teuchos_CompObject.hpp:87
Teuchos::Flops
The Teuchos Floating Point Operations Class.
Definition
Teuchos_Flops.hpp:35
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0