60 for (
unsigned int degree=0 ; degree<10 ; ++degree) {
67 unsigned int degree = 10;
69 for (
unsigned int d=0 ; d <= degree ; ++d) {
72 for (
unsigned int d=0 ; d <= degree ; ++d) {
78 unsigned int degree = 10;
80 for (
unsigned int d=0 ; d <= degree ; ++d) {
84 for (
unsigned int d=0 ; d <= degree ; ++d) {
92 for (
int d=0 ; d <= degree ; ++d) {
113 for (
int i=0 ; i<numTests ; ++i) {
114 testValues[i] = (i-5);
118 for (
int i=0 ; i<numTests ; ++i) {
119 polyValues[i] = pow(testValues[i],2.0)-1.0;
120 polyDotValues[i] = 2*testValues[i];
122 for (
int i=0 ; i<numTests ; ++i ) {
125 P.
evaluate(testValues[i], &x_out, &x_dot_out );
134 unsigned int degree = 2;
140 unsigned int degree = 2;
146 unsigned int degree = 2;
149 const double coeff = 5.0;
153 unsigned int degree = 2;
156 const double coeff = 5.0;
160 unsigned int degree = 2;
167 unsigned int degree = 2;
175 #endif // TEUCHOS_DEBUG RCP< T > rcp(const boost::shared_ptr< T > &sptr)
Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object...
#define TEST_EQUALITY(v1, v2)
Assert the equality of v1 and v2.
TEUCHOS_UNIT_TEST(Teuchos_Polynomial, create)
void setCoefficient(unsigned int i, const CoeffT &v)
Set coefficient i to c.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
void setCoefficientPtr(unsigned int i, const Teuchos::RCP< CoeffT > &c_ptr)
Set pointer for coefficient i to c_ptr. DANGEROUS!
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
Lightweight container class to represent a simple polynomial.
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
Templated array class derived from the STL std::vector.
Teuchos::RCP< CoeffT > getCoefficient(unsigned int i)
Return ref-count pointer to coefficient i.
Smart reference counting pointer class for automatic garbage collection.
unsigned int degree() const
Return degree of polynomial.
#define TEST_THROW(code, ExceptType )
Assert that the statement 'code' throws the exception 'ExceptType' (otherwise the test fails)...
void evaluate(typename Teuchos::Polynomial< CoeffT >::scalar_type t, CoeffT *x, CoeffT *xdot=NULL) const
Evaluate polynomial and possibly its derivative at time t.
Memory-safe templated array class that encapsulates std::vector.