28 for (
unsigned int degree=0 ; degree<10 ; ++degree) {
35 unsigned int degree = 10;
37 for (
unsigned int d=0 ; d <= degree ; ++d) {
40 for (
unsigned int d=0 ; d <= degree ; ++d) {
46 unsigned int degree = 10;
48 for (
unsigned int d=0 ; d <= degree ; ++d) {
52 for (
unsigned int d=0 ; d <= degree ; ++d) {
60 for (
int d=0 ; d <= degree ; ++d) {
81 for (
int i=0 ; i<numTests ; ++i) {
82 testValues[i] = (i-5);
86 for (
int i=0 ; i<numTests ; ++i) {
87 polyValues[i] = pow(testValues[i],2.0)-1.0;
88 polyDotValues[i] = 2*testValues[i];
90 for (
int i=0 ; i<numTests ; ++i ) {
93 P.
evaluate(testValues[i], &x_out, &x_dot_out );
102 unsigned int degree = 2;
105 TEST_THROW( constCoeff = constP.getCoefficient(3), std::out_of_range );
108 unsigned int degree = 2;
111 TEST_THROW( coeff = P.getCoefficient(3), std::out_of_range );
114 unsigned int degree = 2;
117 const double coeff = 5.0;
118 TEST_THROW( P.setCoefficient(i,coeff), std::out_of_range );
121 unsigned int degree = 2;
124 const double coeff = 5.0;
125 TEST_THROW( P.setCoefficient(i,coeff), std::runtime_error );
128 unsigned int degree = 2;
132 TEST_THROW( P.setCoefficientPtr(i,coeff), std::out_of_range );
135 unsigned int degree = 2;
140 TEST_THROW( P.evaluate(t,&x,&x_dot), std::runtime_error );
143 #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.
#define TEST_THROW(code, ExceptType)
Assert that the statement 'code' throws the exception 'ExceptType' (otherwise the test fails)...
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
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.
void evaluate(typename Teuchos::Polynomial< CoeffT >::scalar_type &t, CoeffT *x, CoeffT *xdot=NULL) const
Evaluate polynomial and possibly its derivative at time t.
unsigned int degree() const
Return degree of polynomial.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes...