27 template <
class T>
class Tps;
29 template <
class T>
class Matrix;
52 Tps(
int maxOrder,
int nVar);
233 std::istream &
get(std::istream &
is);
236 std::ostream &
put(std::ostream &os)
const;
327 template <
class T> std::ostream &operator<<(std::ostream &, const Tps<T> &x);
334 {
Tps<T> z(x);
return z += y; }
337 {
Tps<T> z(x);
return z -= y; }
339 template <
class T>
inline
341 {
Tps<T> z(x);
return z += y; }
343 template <
class T>
inline
345 {
Tps<T> z(x);
return z -= y; }
347 template <
class T>
inline
349 {
Tps<T> z(y);
return z += x; }
353 {
Tps<T> z(- y);
return z += x; }
356 {
Tps<T> z(x);
return z *= y; }
359 {
Tps<T> z(x);
return z /= y; }
362 {
Tps<T> z(x);
return z *= y; }
365 {
Tps<T> z(x);
return z /= y; }
368 {
Tps<T> z(y);
return z *= x; }
377 {
return x.
get(is); }
379 template <
class T> std::ostream &operator<<(std::ostream &os, const Tps<T> &x)
380 {
return x.put(os); }
382 #endif // CLASSIC_Tps_HH
const T operator[](int index) const
Get coefficient.
Tps< T > multiply(const Tps< T > &y, int trunc) const
Truncated multiplication.
Tps< T > operator+() const
Unary plus.
Tps< T > operator-() const
Unary minus.
Tps< T > filter(int lowOrder, int highOrder) const
Extract orders.
static Tps< T > makeVariable(int nVar, int var)
Make variable.
const TpsMonomial & getExponents(int index) const
Get exponents.
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
Tps< T > derivative(int var) const
Partial derivative.
Tps< T > & operator+=(const Tps< T > &y)
Add and assign.
void setCoefficient(int index, const T &value)
Set coefficient.
std::istream & get(std::istream &is)
Get Tps from the stream is.
bool operator==(const TwoPolynomial &left, const TwoPolynomial &right)
const T getCoefficient(int index) const
Get coefficient.
Matrix< T > operator*(const Matrix< T > &, const Matrix< T > &)
Matrix multiply.
bool isConstant() const
Test for constant.
Tps< T > inverse(int order=truncOrder) const
Reciprocal value.
Tps< T > multiplyVariable(int var) const
Multiply by variable [b]var[/b].
int getVariables() const
Get number of variables.
Tps< T > Taylor(const T series[], int n) const
Taylor series.
bool operator==(const Tps< T > &y) const
Equality operator.
int getOrder(int index) const
Get order.
Tps< T > scaleMonomials(const Tps< T > &y) const
Multiply monomial-wise.
std::ostream & put(std::ostream &os) const
Put Tps to the stream is.
Tps< T > & operator-=(const Tps< T > &y)
Subtract and assign.
Tps< T > truncate(int trunc)
Truncate.
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
int getTruncOrder() const
Get truncation order.
static void setGlobalTruncOrder(int order)
Set global truncation order.
bool operator!=(const Tps< T > &y) const
Inequality operator.
Tps< T > & operator=(const Tps< T > &y)
Tps< T > & operator*=(const Tps< T > &y)
Multiply and assign.
Truncate power series map.
int getSize() const
Get number of coefficients.
Exponent array for Tps<T>.
static Tps< T > makeVarPower(int nVar, int var, int power)
Make power.
b mention the algorithm in the References section The appropriate citation is
static int getGlobalTruncOrder()
Get global truncation order.
T evaluate(const Vector< T > &v) const
Substitute.
std::istream & operator>>(std::istream &, Tps< T > &x)
Extract from stream.
static Tps< T > makeMonomial(const TpsMonomial &m, const T &t)
Make monomial.
Tps< T > & operator/=(const Tps< T > &y)
Divide and assign.
static const int EXACT
Representation of infinite precision.
Tps< T > integral(int var) const
Partial integral.
Tps< T > substitute(const Matrix< T > &M) const
Substitute.
Matrix< T > operator/(const Matrix< T > &, const T &)
Matrix divided by scalar.
int getMaxOrder() const
Get maximal order.