62 |
|
typedef int ExponentType; |
63 |
|
typedef ElemType CoefficientType; |
64 |
|
typedef std::map<ExponentType, CoefficientType> PolynomialPairMap; |
65 |
< |
typedef PolynomialPairMap::iterator iterator; |
66 |
< |
typedef PolynomialPairMap::const_iterator const_iterator; |
65 |
> |
typedef typename PolynomialPairMap::iterator iterator; |
66 |
> |
typedef typename PolynomialPairMap::const_iterator const_iterator; |
67 |
|
/** |
68 |
|
* Calculates the value of this Polynomial evaluated at the given x value. |
69 |
|
* @return The value of this Polynomial evaluates at the given x value |
71 |
|
*/ |
72 |
|
ElemType evaluate(const ElemType& x) { |
73 |
|
ElemType result = ElemType(); |
74 |
< |
double exponent; |
75 |
< |
double coefficient; |
74 |
> |
ExponentType exponent; |
75 |
> |
CoefficientType coefficient; |
76 |
|
|
77 |
|
for (iterator i = polyPairMap_.begin(); i != polyPairMap_.end(); ++i) { |
78 |
|
exponent = i->first; |
90 |
|
*/ |
91 |
|
ElemType evaluateDerivative(const ElemType& x) { |
92 |
|
ElemType result = ElemType(); |
93 |
< |
double exponent; |
94 |
< |
double coefficient; |
93 |
> |
ExponentType exponent; |
94 |
> |
CoefficientType coefficient; |
95 |
|
|
96 |
|
for (iterator i = polyPairMap_.begin(); i != polyPairMap_.end(); ++i) { |
97 |
|
exponent = i->first; |