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;
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>
497 std::ostream &operator<<(std::ostream &os, const FTps<T, N> &);
504 #endif // CLASSIC_FTps_HH
FTps filter(int minOrder, int maxOrder, int trcOrder=EXACT) const
Extract given range of orders, with truncation.
A templated representation for vectors.
T evaluate(const FVector< T, N > &) const
Evaluate FTps at point.
Substitution for Tps<T>.
static int orderEnd(int order)
static int orderLength(int orderL, int orderH)
static FTps makeVarPower(int var, int power)
Make power.
static const Array1D< int > & getProductArray(int index)
Index array for products of monomial "index".
const T operator[](int index) const
Get coefficient.
FTps & operator*=(const FTps &y)
Multiply and assign.
static int orderLength(int order)
bool operator!=(const Offset &off1, const Offset &off2)
FTps operator+() const
Unary plus.
Array1D< int > getSubstOrders(const FVps< T, N > &rhs, int trunc=EXACT) const
Return orders {min, max, trc} of f(rhs(z)).
void setTruncOrder(int order)
Set truncation order.
static void checkOrders(const std::string &method, int minOrder, int maxOrder, int &trcOrder)
static int orderLength(int order)
Truncated power series in N variables of type T.
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
static int orderStart(int order)
T * begin() const
Return beginning of monomial array.
bool operator==(const TwoPolynomial &left, const TwoPolynomial &right)
static int getIndex(const FMonomial< N > &mono)
Get Giorgilli index for monomial.
T * end() const
Return end of monomial array.
T * begin(int order) const
Return beginning of coefficient storage for given order.
FTps multiply(const FTps &y, int trunc=EXACT) const
Multiplication.
static int getGlobalTruncOrder()
Return the global truncation order.
FTps & operator-=(const FTps &y)
Subtract and assign.
std::list< int > getListOfNonzeroCoefficients() const
Get a list containing the indexes of non-zero coefficients of a FTps.
const T getCoefficient(int index) const
Get coefficient.
Matrix< T > operator*(const Matrix< T > &, const Matrix< T > &)
Matrix multiply.
T * end(int order) const
Return end of coefficient storage for given order.
int getTruncOrder() const
Get truncation order.
FTps & operator=(const FTps &y)
Assign.
static Array1D< T > evalMonoms(const FVector< T, N > &, int)
Evaluate monomials at point.
FTps truncate(int trunc)
Truncate.
FTps inverse(int trunc=EXACT) const
Reciprocal, 1/(*this).
FVps< T, N > gradient() const
Gradient.
FTps & operator/=(const FTps &y)
Divide and assign.
static int orderStart(int order)
Get index at which [b]order[/b] starts.
FTps divide(const FTps &y, int trunc=EXACT) const
Division.
Array1D< int > getRepOrders() const
bool operator==(const FTps &y) const
Equality operator.
static const int EXACT
Representation of infinite precision.
void grow(int maxOrder, int trcOrder)
void unique()
Make representation unique.
void setMinOrder(int order)
Set minimum order.
FTps()
Default constructor.
FVps< T, N > ExpMap(const FTps< T, N > &H, int trunc=FTps< T, N >::EXACT)
Build the exponential series.
int getMinOrder() const
Get minimum order.
static const Array1D< int > & getVariableList(int index)
List of variables contained in monomial "index".
FTps multiplyVariable(int var, int trunc=EXACT) const
Multiply by variable [b]var[/b].
A templated representation for matrices.
static int getVariables()
Get number of variables.
FTps scaleMonomials(const FTps &y) const
Scale monomial coefficients by coefficients in [b]y[/b].
std::ostream & put(std::ostream &os) const
Write FTps on the stream [b]os[/b].
static void deallocate(FTpsRep< T, N > *)
static FTpsRep< T, N > * allocate(int minOrder, int maxOrder, int trcOrder)
FTps & operator+=(const FTps &y)
Add and assign.
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
FTps< T, N > makePower(int power) const
Multiply FTps with itself.
int getSize() const
Get total number of coefficients.
static int globalTruncOrder
Vector truncated power series in n variables.
FTps derivative(int var) const
Partial derivative.
FTps integral(int var, int trunc=EXACT) const
Partial integral.
bool operator!=(const FTps &y) const
Inequality operator.
FTps operator-() const
Unary minus.
static const FMonomial< N > & getExponents(int index)
Get exponents for given index.
static void setGlobalTruncOrder(int order)
Set the global truncation order.
static FTpsRep< T, N > * freeList[100]
FArray1D< int, N > extractExponents(int index) const
Extract exponents of coefficient.
b mention the algorithm in the References section The appropriate citation is
FLieGenerator< T, N > PoissonBracket(const FLieGenerator< T, N > &, const FLieGenerator< T, N > &)
Poisson bracket of two Lie generators.
FTps taylor(const Array1D< T > &series, int order) const
Taylor series.
int getMaxOrder() const
Get maximum order.
std::istream & operator>>(std::istream &, Tps< T > &x)
Extract from stream.
static int orderEnd(int order)
Get one plus index at which [b]order[/b] ends.
Matrix< T > operator/(const Matrix< T > &, const T &)
Matrix divided by scalar.
void setMaxOrder(int order)
Set maximum order.
FTps substitute(const FMatrix< T, N, N > &M, int n) const
Substitute.
static const Array1D< TpsSubstitution > & getSubTable()
Return the substitution table.
Representation of the exponents for a monomial with fixed dimension.
static FTps makeMonomial(int index, const T &t)
Make monomial.
static FTps makeVariable(int var)
Make variable.
void setCoefficient(int index, const T &value)
Set coefficient.