|
|
@ -30,6 +30,7 @@ void Polynomial::init() { |
|
|
|
KernelBasicParameter::resetNumberOfParameters(number); |
|
|
|
} |
|
|
|
|
|
|
|
// i want to has constexpr, so the ctor can be clean :]
|
|
|
|
unsigned int Polynomial::calculateNumberOfParameters() { |
|
|
|
double n_coef = orde + 1; |
|
|
|
for (unsigned int i = 2; i <= myDimension; i++) { |
|
|
@ -46,10 +47,6 @@ void Polynomial::operator()() { |
|
|
|
unsigned int m = 0; |
|
|
|
for ( unsigned int i = 0; i < myDimension; i++ ) { |
|
|
|
|
|
|
|
#ifdef HARDDEBUG |
|
|
|
cout << "Entering new dimension: " << i << " With m = " << m << endl; |
|
|
|
#endif |
|
|
|
|
|
|
|
vectorNew[i] = parameters[m]; |
|
|
|
m++; |
|
|
|
recur(i, 0, 1, m); |
|
|
@ -61,12 +58,6 @@ void Polynomial::recur(unsigned int curr_dimension, unsigned int prev_i, unsigne |
|
|
|
double product; |
|
|
|
for (unsigned int i = prev_i; i < myDimension; i++) { |
|
|
|
|
|
|
|
#ifdef HARDDEBUG |
|
|
|
for ( unsigned int j = 0; j < n; j++ ) |
|
|
|
cout << " "; |
|
|
|
cout << "Calculation in dimension: " << i << " With m = " << m << " And depth = " << n << endl; |
|
|
|
#endif |
|
|
|
|
|
|
|
product = prev_product * vectorOld[i]; |
|
|
|
vectorNew[curr_dimension] += parameters[m] * product; |
|
|
|
m++; |
|
|
|