1 #ifndef CLASSIC_FTps_HH
2 #define CLASSIC_FTps_HH
30 template <
class T>
class Array1D;
31 template <
class T,
int M,
int N>
class FMatrix;
33 template <
class T,
int N>
class FTpsRep;
34 template <
class T,
int N>
class FVector;
35 template <
class T,
int N>
class FVps;
44 template <
class T,
int N>
58 FTps(
int minOrder,
int maxOrder,
int trcOrder);
166 {
return itsRep->minOrd; }
175 {
return itsRep->maxOrd; }
184 {
return itsRep->trcOrd; }
377 std::istream &
get(std::istream &is);
380 std::ostream &
put(std::ostream &os)
const;
394 void grow(
int maxOrder,
int trcOrder);
401 static void checkOrders(
const std::string &method,
int minOrder,
int maxOrder,
int &trcOrder);
420 template <
class T,
int N>
424 template <
class T,
int N>
428 template <
class T,
int N>
432 template <
class T,
int N>
436 template <
class T,
int N>
440 template <
class T,
int N>
444 template <
class T,
int N>
448 template <
class T,
int N>
452 template <
class T,
int N>
456 template <
class T,
int N>
460 template <
class T,
int N>
464 template <
class T,
int N>
468 template <
class T,
int N>
472 template <
class T,
int N>
478 template <
class T,
int N>
484 template <
class T,
int N>
488 template <
class T,
int N>
492 template <
class T,
int N>
496 template <
class T,
int N>
bool operator==(const T &, const FTps< T, N > &)
Equality.
FTps< T, N > operator-(const FTps< T, N > &, const FTps< T, N > &)
Subtract.
FTps< T, N > operator*(const FTps< T, N > &, const FTps< T, N > &)
Multiply.
FVps< T, N > ExpMap(const FTps< T, N > &H, int trunc=FTps< T, N >::EXACT)
Build the exponential series.
std::ostream & operator<<(std::ostream &os, const FTps< T, N > &)
Insert FTps into stream [b]os[/b].
std::istream & operator>>(std::istream &is, FTps< T, N > &)
Extract FTps from stream [b]is[/b].
FTps< T, N > PoissonBracket(const FTps< T, N > &f, const FTps< T, N > &g, int trunc=FTps< T, N >::EXACT)
Poisson bracket.
FTps< T, N > operator/(const FTps< T, N > &, const FTps< T, N > &)
Divide.
bool operator!=(const T &, const FTps< T, N > &)
Inequality.
FTps< T, N > operator+(const FTps< T, N > &, const FTps< T, N > &)
Add.
Vector truncated power series in n variables.
A templated representation for matrices.
Truncated power series in N variables of type T.
static void deallocate(FTpsRep< T, N > *)
static const Array1D< int > & getProductArray(int index)
Index array for products of monomial "index".
FTps< T, N > makePower(int power) const
Multiply FTps with itself.
Array1D< int > getRepOrders() const
T * begin(int order) const
Return beginning of coefficient storage for given order.
FTps substitute(const FMatrix< T, N, N > &M, int n) const
Substitute.
const T getCoefficient(int index) const
Get coefficient.
std::list< int > getListOfNonzeroCoefficients() const
Get a list containing the indexes of non-zero coefficients of a FTps.
FTps inverse(int trunc=EXACT) const
Reciprocal, 1/(*this).
FTps taylor(const Array1D< T > &series, int order) const
Taylor series.
FTps & operator/=(const FTps &y)
Divide and assign.
void setTruncOrder(int order)
Set truncation order.
std::istream & get(std::istream &is)
Read FTps on the stream [b]is[/b].
FTps & operator+=(const FTps &y)
Add and assign.
FTps()
Default constructor.
static FTps makeVarPower(int var, int power)
Make power.
FTps integral(int var, int trunc=EXACT) const
Partial integral.
int getMinOrder() const
Get minimum order.
static FTpsRep< T, N > * allocate(int minOrder, int maxOrder, int trcOrder)
FTps truncate(int trunc)
Truncate.
int getTruncOrder() const
Get truncation order.
static void checkOrders(const std::string &method, int minOrder, int maxOrder, int &trcOrder)
FTps multiply(const FTps &y, int trunc=EXACT) const
Multiplication.
std::ostream & put(std::ostream &os) const
Write FTps on the stream [b]os[/b].
static int orderLength(int orderL, int orderH)
const T operator[](int index) const
Get coefficient.
static const int EXACT
Representation of infinite precision.
FTps & operator-=(const FTps &y)
Subtract and assign.
FTps operator+() const
Unary plus.
static FTps makeMonomial(int index, const T &t)
Make monomial.
T * begin() const
Return beginning of monomial array.
int getSize() const
Get total number of coefficients.
FTps & operator=(const FTps &y)
Assign.
static Array1D< T > evalMonoms(const FVector< T, N > &, int)
Evaluate monomials at point.
static int orderLength(int order)
FTps multiplyVariable(int var, int trunc=EXACT) const
Multiply by variable [b]var[/b].
FTps derivative(int var) const
Partial derivative.
void unique()
Make representation unique.
FVps< T, N > gradient() const
Gradient.
bool operator!=(const FTps &y) const
Inequality operator.
FTps & operator*=(const FTps &y)
Multiply and assign.
T * end() const
Return end of monomial array.
void setCoefficient(int index, const T &value)
Set coefficient.
static FTps makeVariable(int var)
Make variable.
static int getGlobalTruncOrder()
Return the global truncation order.
static int orderEnd(int order)
Get one plus index at which [b]order[/b] ends.
static int globalTruncOrder
FTps divide(const FTps &y, int trunc=EXACT) const
Division.
T evaluate(const FVector< T, N > &) const
Evaluate FTps at point.
static void setGlobalTruncOrder(int order)
Set the global truncation order.
T * end(int order) const
Return end of coefficient storage for given order.
static const Array1D< TpsSubstitution > & getSubTable()
Return the substitution table.
int getMaxOrder() const
Get maximum order.
static int getVariables()
Get number of variables.
static int orderStart(int order)
Get index at which [b]order[/b] starts.
void setMaxOrder(int order)
Set maximum order.
Array1D< int > getSubstOrders(const FVps< T, N > &rhs, int trunc=EXACT) const
Return orders {min, max, trc} of f(rhs(z)).
static const FMonomial< N > & getExponents(int index)
Get exponents for given index.
static FTpsRep< T, N > * freeList[100]
bool operator==(const FTps &y) const
Equality operator.
static const Array1D< int > & getVariableList(int index)
List of variables contained in monomial "index".
FTps scaleMonomials(const FTps &y) const
Scale monomial coefficients by coefficients in [b]y[/b].
FTps filter(int minOrder, int maxOrder, int trcOrder=EXACT) const
Extract given range of orders, with truncation.
FArray1D< int, N > extractExponents(int index) const
Extract exponents of coefficient.
FTps operator-() const
Unary minus.
static int getIndex(const FMonomial< N > &mono)
Get Giorgilli index for monomial.
void setMinOrder(int order)
Set minimum order.
void grow(int maxOrder, int trcOrder)
Representation of the exponents for a monomial with fixed dimension.
A templated representation for vectors.
static int orderEnd(int order)
static int orderLength(int order)
static int orderStart(int order)