Files Classes Functions Hierarchy
00001 #include <print.h> 00002 00003 #include <powerseries.h> 00004 00005 00006 void powerseries::operator()(double & val, doublec t) const 00007 { 00008 // ai[0] + t(ai[1] + t(ai[2] + t(... 00009 val = 0.0; 00010 for (uint i=0; i<N; ++i) 00011 { 00012 val *= t; 00013 val += ai[N-1-i]; 00014 } 00015 } 00016 00017 doublec powerseries::operator()(doublec t) const 00018 { 00019 // ai[0] + t(ai[1] + t(ai[2] + t(... 00020 double val = 0.0; 00021 for (uint i=0; i<N; ++i) 00022 { 00023 val *= t; 00024 val += ai[N-1-i]; 00025 } 00026 00027 return val; 00028 } 00029 00030 void powerseries::differentiate() 00031 { 00032 for (uint i=1; i<N; ++i) 00033 { 00034 ai[i]*=i; 00035 ai[i-1] = ai[i]; 00036 } 00037 ai[N-1] = 0.0; 00038 } 00039 00040
1.5.8