Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_StandardFunctionObjects.hpp
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#ifndef Teuchos_STANDARD_FUNCTION_OBJECTS_H
11#define Teuchos_STANDARD_FUNCTION_OBJECTS_H
12
18
19
20namespace Teuchos{
21
26template<class OperandType>
28{
29public:
30
32
33
40
50
52
61
63
64
69 return _modifyingOperand;
70 }
71
79 _modifyingOperand = newOperand;
80 }
81
83
84private:
86
87
91 OperandType _modifyingOperand;
92
94};
95
104template<class OperandType>
106 public SimpleFunctionObject<OperandType>
107{
108public:
110
111
116
125
127
129
130
138
140
142
143
145 std::string getTypeAttributeValue() const{
146 return
147 "SubtractionFunction("
149 +")";
150 }
151
153};
154
163template<class OperandType>
165 public SimpleFunctionObject<OperandType>
166{
167public:
169
170
175
184
186
188
189
197
199
201
202
204 std::string getTypeAttributeValue() const{
205 return
206 "AdditionFunction("
208 +")";
209 }
210
212};
213
222template<class OperandType>
224 public SimpleFunctionObject<OperandType>
225{
226public:
228
229
235
245
247
249
250
258
260
262
263
265 std::string getTypeAttributeValue() const{
266 return "MultiplicationFunction(" +
268 +")";
269 }
270
272};
273
282template<class OperandType>
284 public SimpleFunctionObject<OperandType>
285{
286public:
287
289
290
296
306
308
310
311
319
321
323
324
326 std::string getTypeAttributeValue() const{
327 return
328 "DivisionFunction("
330 +")";
331 }
332
334
335};
336
337} // namespace Teuchos
338
339
340#endif
An object representation of a function.
A simple function object that adds a specififed value from the given arguement in the runFunction fun...
AdditionFunction(OperandType amountToAdd)
Constructs a AdditionFunction.
OperandType runFunction(OperandType arguement) const
AdditionFunction()
Constructs a AdditionFunction.
A simple function object that divides a specififed value from the given arguement in the runFunction ...
DivisionFunction(OperandType amountToDivideBy)
Constructs a DivisionFunction.
OperandType runFunction(OperandType arguement) const
DivisionFunction()
Constructs a DivisionFunction.
A function object represents an arbitrary function.
A simple function object that multiplys a specififed value from the given arguement in the runFunctio...
MultiplicationFunction(OperandType amountToMultiplyBy)
Constructs a MultiplicationFunction.
OperandType runFunction(OperandType arguement) const
MultiplicationFunction()
Constructs a MultiplicationFunction.
Smart reference counting pointer class for automatic garbage collection.
A simple function object that applies a given operand to a spcified arguement using a specific operat...
virtual OperandType runFunction(OperandType arguement) const =0
SimpleFunctionObject()
Constructs a SimpleFunctionObject.
OperandType getModifiyingOperand() const
Returns the modifying operand.
OperandType setModifyingOperand(OperandType newOperand)
Sets the modifyingOperand.
SimpleFunctionObject(OperandType modifyingOperand)
Constructs a SimpleFunctionObject.
A simple function object that subtracts a specififed value from the given arguement in the runFunctio...
SubtractionFunction()
Constructs a SubtractionFunction.
SubtractionFunction(OperandType amountToSubtract)
Constructs a SubtractionFunction.
OperandType runFunction(OperandType arguement) const
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...