Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
numerics
src
Teuchos_PolynomialDecl.hpp
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef TEUCHOS_POLYNOMIAL_DECL_HPP
11
#define TEUCHOS_POLYNOMIAL_DECL_HPP
12
13
#include "Teuchos_Describable.hpp"
14
#include "
Teuchos_RCP.hpp
"
15
#include "Teuchos_PolynomialTraits.hpp"
16
17
namespace
Teuchos
{
18
20
36
template
<
typename
CoeffT>
37
class
Polynomial
:
virtual
public
Teuchos::Describable
{
38
public
:
39
41
typedef
CoeffT
coeff_type
;
42
44
typedef
typename
Teuchos::PolynomialTraits<coeff_type>::scalar_type
scalar_type
;
45
47
53
Polynomial
(
unsigned
int
deg,
const
CoeffT& cloneCoeff,
54
unsigned
int
reserve = 0);
55
57
64
Polynomial
(
unsigned
int
deg,
unsigned
int
reserve = 0);
65
67
~Polynomial
();
68
70
unsigned
int
degree
()
const
{
return
d
; }
71
73
void
setDegree
(
unsigned
int
deg);
74
76
Teuchos::RCP<CoeffT>
77
getCoefficient
(
unsigned
int
i);
78
80
Teuchos::RCP<const CoeffT>
81
getCoefficient
(
unsigned
int
i)
const
;
82
84
void
setCoefficient
(
unsigned
int
i,
const
CoeffT& v);
85
87
93
void
setCoefficientPtr
(
unsigned
int
i,
94
const
Teuchos::RCP<CoeffT>
& c_ptr);
95
97
105
void
evaluate
(
typename
Teuchos::Polynomial<CoeffT>::scalar_type
& t,
106
CoeffT* x, CoeffT* xdot = NULL)
const
;
107
108
private
:
109
111
Polynomial
(
const
Polynomial
&);
112
114
Polynomial
& operator=(
const
Polynomial
&);
115
116
protected
:
117
119
unsigned
int
d
;
120
122
unsigned
int
sz
;
123
125
128
std::vector< Teuchos::RCP<CoeffT> >
coeff
;
129
130
};
// class Polynomial
131
132
}
// end namespace Teuchos
133
134
#endif
// TEUCHOS_POLYNOMIAL_DECL_HPP
Teuchos_RCP.hpp
Reference-counted pointer class and non-member templated function implementations.
Teuchos::Describable
Base class for all objects that can describe themselves.
Definition
Teuchos_Describable.hpp:44
Teuchos::Polynomial
Lightweight container class to represent a simple polynomial.
Definition
Teuchos_PolynomialDecl.hpp:37
Teuchos::Polynomial::setCoefficient
void setCoefficient(unsigned int i, const CoeffT &v)
Set coefficient i to c.
Definition
Teuchos_Polynomial.hpp:95
Teuchos::Polynomial::getCoefficient
Teuchos::RCP< CoeffT > getCoefficient(unsigned int i)
Return ref-count pointer to coefficient i.
Definition
Teuchos_Polynomial.hpp:67
Teuchos::Polynomial::scalar_type
Teuchos::PolynomialTraits< coeff_type >::scalar_type scalar_type
Typename of scalars.
Definition
Teuchos_PolynomialDecl.hpp:44
Teuchos::Polynomial::sz
unsigned int sz
Size of polynomial (may be > d).
Definition
Teuchos_PolynomialDecl.hpp:122
Teuchos::Polynomial::degree
unsigned int degree() const
Return degree of polynomial.
Definition
Teuchos_PolynomialDecl.hpp:70
Teuchos::Polynomial::~Polynomial
~Polynomial()
Destructor.
Definition
Teuchos_Polynomial.hpp:46
Teuchos::Polynomial::coeff_type
CoeffT coeff_type
Typename of coefficients.
Definition
Teuchos_PolynomialDecl.hpp:41
Teuchos::Polynomial::evaluate
void evaluate(typename Teuchos::Polynomial< CoeffT >::scalar_type &t, CoeffT *x, CoeffT *xdot=NULL) const
Evaluate polynomial and possibly its derivative at time t.
Definition
Teuchos_Polynomial.hpp:129
Teuchos::Polynomial::setDegree
void setDegree(unsigned int deg)
Set degree of polynomial to deg.
Definition
Teuchos_Polynomial.hpp:52
Teuchos::Polynomial::coeff
std::vector< Teuchos::RCP< CoeffT > > coeff
Vector of polynomial coefficients.
Definition
Teuchos_PolynomialDecl.hpp:128
Teuchos::Polynomial::d
unsigned int d
Degree of polynomial.
Definition
Teuchos_PolynomialDecl.hpp:119
Teuchos::Polynomial::Polynomial
Polynomial(unsigned int deg, const CoeffT &cloneCoeff, unsigned int reserve=0)
Create a polynomial of degree deg.
Definition
Teuchos_Polynomial.hpp:17
Teuchos::Polynomial::setCoefficientPtr
void setCoefficientPtr(unsigned int i, const Teuchos::RCP< CoeffT > &c_ptr)
Set pointer for coefficient i to c_ptr. DANGEROUS!
Definition
Teuchos_Polynomial.hpp:113
Teuchos::PolynomialTraits::scalar_type
Scalar scalar_type
Typename of scalars.
Definition
Teuchos_PolynomialTraits.hpp:33
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0