1 #ifndef CLASSIC_Taylor_CC
2 #define CLASSIC_Taylor_CC
49 itsCoeffs(rhs.itsCoeffs)
67 template<
class T>
inline
70 return itsCoeffs.begin();
74 template<
class T>
inline
77 return itsCoeffs.begin();
81 template<
class T>
inline
84 return itsCoeffs.end();
88 template<
class T>
inline
91 return itsCoeffs.end();
95 template<
class T>
inline
101 template<
class T>
inline
110 std::transform(
begin(),
end(), result.
begin(), std::negate<T>());
118 std::bind(std::multiplies<T>(), std::placeholders::_2, val));
126 std::bind(std::divides<T>(), std::placeholders::_2, val));
175 for(
const T *x = x1; x < x2; ++x, ++z) {
187 return std::accumulate(
begin(),
end(),
T(0));
191 template <
class T>
inline
194 return itsCoeffs.size() - 1;
208 while(x != lhs.
end() && y != rhs.
end()) {
211 while(x != lhs.
end()) *z++ = *x++;
212 while(y != rhs.
end()) *z++ = *y++;
224 while(x != lhs.
end() && y != rhs.
end()) {
227 while(x != lhs.
end()) *z++ = *x++;
228 while(y != rhs.
end()) *z++ = - *y++;
239 while(x != lhs.
end()) {
252 while(x != rhs.
end()) {
265 while(x != lhs.
end()) {
276 for(
int i = 0; i <= lhs.
getOrder(); ++i) {
277 if(! lhs[i].isZero()) {
278 for(
int j = 0; j <= rhs.
getOrder(); ++j) {
279 if(! rhs[j].isZero()) {
290 std::ostream &operator<<(std::ostream &os, const Taylor<T> &series) {
291 os <<
"Taylor" << std::setw(4) << series.getOrder() <<
std::endl;
293 for(
int i = 0; i <= series.getOrder(); ++i) {
294 os <<
"Terms of order" << std::setw(4) << i <<
" " << series[i];
Taylor & operator-=(const Taylor &)
Subtract series and assign.
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a copy
Taylor operator-() const
Change sign of series.
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
T & operator[](int n)
Get coefficient.
Matrix< T > operator*(const Matrix< T > &, const Matrix< T > &)
Matrix multiply.
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
Inform & endl(Inform &inf)
A representation for a Taylor series in one variable,.
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
void clear()
Clear all coefficients.
Taylor & operator/=(const T &)
Divide by scalar and assign.
Taylor integrate() const
Integrate with respect to the variable.
T * end()
Get pointer to end of series (one beyond highest term).
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
int getOrder() const
Return order of this series.
Taylor & operator+=(const Taylor &)
Add series and assign.
Taylor & operator*=(const T &)
Multiply by scalar and assign.
FLieGenerator< T, N > PoissonBracket(const FLieGenerator< T, N > &, const FLieGenerator< T, N > &)
Poisson bracket of two Lie generators.
const Taylor & operator=(const Taylor &)
T sum() const
Return sum of series.
Matrix< T > operator/(const Matrix< T > &, const T &)
Matrix divided by scalar.
T * begin()
Get pointer to beginning of series (zero-order term).