[section:polynomials Polynomials] [h4 Synopsis] `` #include `` namespace boost{ namespace math{ namespace tools{ template class polynomial { public: // typedefs: typedef typename std::vector::value_type value_type; typedef typename std::vector::size_type size_type; // construct: polynomial(){} template polynomial(const U* data, unsigned order); template polynomial(const U& point); // access: size_type size()const; size_type degree()const; value_type& operator[](size_type i); const value_type& operator[](size_type i)const; // operators: template polynomial& operator +=(const U& value); template polynomial& operator -=(const U& value); template polynomial& operator *=(const U& value); template polynomial& operator +=(const polynomial& value); template polynomial& operator -=(const polynomial& value); template polynomial& operator *=(const polynomial& value); }; template polynomial operator + (const polynomial& a, const polynomial& b); template polynomial operator - (const polynomial& a, const polynomial& b); template polynomial operator * (const polynomial& a, const polynomial& b); template polynomial operator + (const polynomial& a, const U& b); template polynomial operator - (const polynomial& a, const U& b); template polynomial operator * (const polynomial& a, const U& b); template polynomial operator + (const U& a, const polynomial& b); template polynomial operator - (const U& a, const polynomial& b); template polynomial operator * (const U& a, const polynomial& b); template std::basic_ostream& operator << (std::basic_ostream& os, const polynomial& poly); }}} // namespaces [h4 Description] This is a fairly trivial class for polynomial manipulation. Implementation is currently of the "naive" variety, with O(N^2) multiplication for example. This class should not be used in high-performance computing environments: it is intended for the simple manipulation of small polynomials, typically generated for special function approximation. Advanced manipulations: the FFT, division, GCD, factorisation etc are not currently provided. Submissions for these are of course welcome :-) [endsect][/section:polynomials Polynomials] [/ Copyright 2006 John Maddock and Paul A. Bristow. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). ]