1 [section:polynomials Polynomials]
6 #include <boost/math/tools/polynomial.hpp>
9 namespace boost{ namespace math{ namespace tools{
16 typedef typename std::vector<T>::value_type value_type;
17 typedef typename std::vector<T>::size_type size_type;
22 polynomial(const U* data, unsigned order);
24 polynomial(const U& point);
27 size_type size()const;
28 size_type degree()const;
29 value_type& operator[](size_type i);
30 const value_type& operator[](size_type i)const;
34 polynomial& operator +=(const U& value);
36 polynomial& operator -=(const U& value);
38 polynomial& operator *=(const U& value);
40 polynomial& operator +=(const polynomial<U>& value);
42 polynomial& operator -=(const polynomial<U>& value);
44 polynomial& operator *=(const polynomial<U>& value);
48 polynomial<T> operator + (const polynomial<T>& a, const polynomial<T>& b);
50 polynomial<T> operator - (const polynomial<T>& a, const polynomial<T>& b);
52 polynomial<T> operator * (const polynomial<T>& a, const polynomial<T>& b);
54 template <class T, class U>
55 polynomial<T> operator + (const polynomial<T>& a, const U& b);
56 template <class T, class U>
57 polynomial<T> operator - (const polynomial<T>& a, const U& b);
58 template <class T, class U>
59 polynomial<T> operator * (const polynomial<T>& a, const U& b);
61 template <class U, class T>
62 polynomial<T> operator + (const U& a, const polynomial<T>& b);
63 template <class U, class T>
64 polynomial<T> operator - (const U& a, const polynomial<T>& b);
65 template <class U, class T>
66 polynomial<T> operator * (const U& a, const polynomial<T>& b);
68 template <class charT, class traits, class T>
69 std::basic_ostream<charT, traits>& operator <<
70 (std::basic_ostream<charT, traits>& os, const polynomial<T>& poly);
76 This is a fairly trivial class for polynomial manipulation.
78 Implementation is currently of the "naive" variety, with O(N^2)
79 multiplication for example. This class should not be used in
80 high-performance computing environments: it is intended for the
81 simple manipulation of small polynomials, typically generated
82 for special function approximation.
84 Advanced manipulations: the FFT, division, GCD, factorisation etc are
85 not currently provided. Submissions for these are of course welcome :-)
87 [endsect][/section:polynomials Polynomials]
90 Copyright 2006 John Maddock and Paul A. Bristow.
91 Distributed under the Boost Software License, Version 1.0.
92 (See accompanying file LICENSE_1_0.txt or copy at
93 http://www.boost.org/LICENSE_1_0.txt).