00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef TEUCHOS_POLYNOMIAL_DECL_HPP
00030 #define TEUCHOS_POLYNOMIAL_DECL_HPP
00031
00032 #include "Teuchos_Describable.hpp"
00033 #include "Teuchos_RefCountPtr.hpp"
00034 #include "Teuchos_PolynomialTraits.hpp"
00035
00036 namespace Teuchos {
00037
00039
00055 template <typename CoeffT>
00056 class Polynomial : virtual public Teuchos::Describable {
00057 public:
00058
00060 typedef CoeffT coeff_type;
00061
00063 typedef typename Teuchos::PolynomialTraits<coeff_type>::scalar_type scalar_type;
00064
00066
00072 Polynomial(unsigned int deg, const CoeffT& cloneCoeff,
00073 unsigned int reserve = 0);
00074
00076
00083 Polynomial(unsigned int deg, unsigned int reserve = 0);
00084
00086 ~Polynomial();
00087
00089 unsigned int degree() const { return d; }
00090
00092 void setDegree(unsigned int deg);
00093
00095 Teuchos::RefCountPtr<CoeffT>
00096 getCoefficient(unsigned int i);
00097
00099 Teuchos::RefCountPtr<const CoeffT>
00100 getCoefficient(unsigned int i) const;
00101
00103 void setCoefficient(unsigned int i, const CoeffT& v);
00104
00106
00112 void setCoefficientPtr(unsigned int i,
00113 const Teuchos::RefCountPtr<CoeffT>& c_ptr);
00114
00116
00124 void evaluate(typename Teuchos::Polynomial<CoeffT>::scalar_type t,
00125 CoeffT* x, CoeffT* xdot = NULL) const;
00126
00127 private:
00128
00130 Polynomial(const Polynomial&);
00131
00133 Polynomial& operator=(const Polynomial&);
00134
00135 protected:
00136
00138 unsigned int d;
00139
00141 unsigned int sz;
00142
00144
00147 std::vector< Teuchos::RefCountPtr<CoeffT> > coeff;
00148
00149 };
00150
00151 }
00152
00153 #endif // TEUCHOS_POLYNOMIAL_DECL_HPP