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;
137 TEST_THROW( constCoeff = constP.getCoefficient(3), std::out_of_range );
140 unsigned int degree = 2;
143 TEST_THROW( coeff = P.getCoefficient(3), std::out_of_range );
146 unsigned int degree = 2;
149 const double coeff = 5.0;
150 TEST_THROW( P.setCoefficient(i,coeff), std::out_of_range );
153 unsigned int degree = 2;
156 const double coeff = 5.0;
157 TEST_THROW( P.setCoefficient(i,coeff), std::runtime_error );
160 unsigned int degree = 2;
164 TEST_THROW( P.setCoefficientPtr(i,coeff), std::out_of_range );
167 unsigned int degree = 2;
172 TEST_THROW( P.evaluate(t,&x,&x_dot), std::runtime_error );
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.
#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...