diff --git a/Math/PolyEval.hh b/Math/PolyEval.hh index 588abd0..adbde2b 100644 --- a/Math/PolyEval.hh +++ b/Math/PolyEval.hh @@ -73,15 +73,6 @@ public: template void addPolynomial(const P& p, vector& v) { for(auto& m: p) addMonomial(m,v); } - /// Comparison simple algorithm - template - void addSimple(const P& p, vector& v, const Cvec& c) const { - if(!v.size()) v.resize(c.size()); - assert(v.size() <= c.size()); - size_t i = 0; - for(auto& y: v) y += p(c[i++]); - } - protected: vector> Xs; ///< loaded coordinate vectors vector>> Ps; /// Powers by variable diff --git a/Math/PowerSeriesEval.hh b/Math/PowerSeriesEval.hh index 7f1d83d..914d117 100644 --- a/Math/PowerSeriesEval.hh +++ b/Math/PowerSeriesEval.hh @@ -25,7 +25,7 @@ template class PowerSeriesEval { public: - + /// return value, deduced from vector type typedef typename std::remove_reference()[0])>::type T; /// set x^1 values @@ -41,7 +41,7 @@ public: } } - /// multiply by x^n + /// multiply vector by x^n void mul(Vec& v0, size_t n) { if(!n) return; auto& x = pow(n); diff --git a/Test/testPolynomial.cc b/Test/testPolynomial.cc index 9cdda33..89ae867 100644 --- a/Test/testPolynomial.cc +++ b/Test/testPolynomial.cc @@ -9,6 +9,15 @@ using std::chrono::steady_clock; typedef Monomial_t<3> Mxyz; typedef Polynomial_t<3> Pxyz; +/// Comparison simple algorithm +template +void addSimple(const P& p, vector& v, const Cvec& c) { + if(!v.size()) v.resize(c.size()); + assert(v.size() <= c.size()); + size_t i = 0; + for(auto& y: v) y += p(c[i++]); +} + int main(int, char**) { std::vector x(3); @@ -47,7 +56,7 @@ int main(int, char**) { auto t1 = steady_clock::now(); - for(int i=0; i