ECF
1.5
D:
Projekt
ECF_trunk
ECF
cartesian
Cos.h
1
#ifndef Cos_h
2
#define Cos_h
3
#include "Function.h"
4
#include <cmath>
5
6
namespace
cart
7
{
8
template
<
class
T>
9
class
Cos
:
public
Function
10
{
11
public
:
12
Cos
();
13
~Cos
();
14
15
void
evaluate
(voidP inputs,
void
* result);
16
};
17
18
typedef
Cos<double>
CosDouble
;
19
typedef
Cos<int>
CosInt
;
20
21
template
<
class
T>
22
Cos<T>::Cos
()
23
{
24
name_ =
"cos"
;
25
numOfArgs_ = 1;
26
}
27
28
template
<
class
T>
29
Cos<T>::~Cos()
30
{
31
}
32
33
template
<
class
T>
34
void
Cos<T>::evaluate
(voidP inputs,
void
* result)
35
{
36
T& data = *(T*) result;
37
stringstream ss;
38
ss << *((
string
*) inputs.get());
39
vector<T> readInputs;
40
T input;
41
uint i = 0;
42
while
(ss >> input)
43
{
44
readInputs.push_back(input);
45
++i;
46
if
(i == numOfArgs_)
47
{
48
break
;
49
}
50
}
51
52
data = (T)cos((
double
)readInputs.at(0));
53
}
54
55
}
56
57
#endif
/* Cos_h */
cart::Cos
Definition:
Cos.h:10
cart::Cos::evaluate
void evaluate(voidP inputs, void *result)
Definition:
Cos.h:34
cart::Function
Definition:
Function.h:9
Generated on Wed Aug 3 2022 17:50:41 for ECF by
1.9.4