piranha
0.10
|
Power series toolbox. More...
#include <piranha/power_series.hpp>
Inherits Series, and power_series_tag.
Public Member Functions | |
power_series ()=default | |
Defaulted default constructor. | |
power_series (const power_series &)=default | |
Defaulted copy constructor. | |
power_series (power_series &&)=default | |
Defaulted move constructor. | |
power_series & | operator= (const power_series &other)=default |
Copy assignment operator. More... | |
power_series & | operator= (power_series &&other)=default |
Move assignment operator. More... | |
~power_series () | |
Trivial destructor. | |
template<typename T = power_series> | |
degree_type< T > | degree () const |
Total degree. More... | |
template<typename T = power_series> | |
ldegree_type< T > | ldegree () const |
Total low degree. More... | |
template<typename T = power_series> | |
pdegree_type< T > | degree (const symbol_fset &names) const |
Partial degree. More... | |
template<typename T = power_series> | |
pldegree_type< T > | ldegree (const symbol_fset &names) const |
Partial low degree. More... | |
template<typename T , truncate_degree_enabler< T > = 0> | |
Derived | truncate_degree (const T &max_degree) const |
Total degree truncation. More... | |
template<typename T , truncate_pdegree_enabler< T > = 0> | |
Derived | truncate_degree (const T &max_degree, const symbol_fset &names) const |
Partial degree truncation. More... | |
Power series toolbox.
This toolbox is intended to extend the Series
type with properties of formal power series.
Specifically, the toolbox will conditionally augment a Series
type by adding methods to query the total and partial (low) degree * of a Series
object. Such augmentation takes place if the series' coefficient and/or key types expose methods to query their degree properties (as established by the piranha::has_degree, piranha::key_has_degree and similar type traits), and if the necessary arithmetic operations are supported by the involved types. As an additional requirement, the types returned when querying the degree must be constructible from int
, less-than comparable and they must satisfy piranha::is_container_element. If the computation of the degree of a single term involves only C++ integral types, then the computation will be checked for overflow.
This toolbox provides also support for truncation based on the total or partial degree. In addition to the requirements of the degree-querying methods, the truncation methods also require the supplied degree limit to be comparable to the type returned by the degree-querying methods. The truncation methods will recursively truncate the coefficients of the series via the piranha::math::truncate_degree() function.
If the requirements outlined above are not satisfied, the degree-querying and the truncation methods will be disabled.
This class satisfies the piranha::is_series type trait.
Series
must satisfy the piranha::is_series type trait,Derived
must derive from power_series of Series
and Derived
.This class provides the same guarantee as Series
. The auto-truncation methods offer the basic exception safety guarantee.
Move semantics is equivalent to the move semantics of Series
.
Definition at line 314 of file power_series.hpp.
|
inline |
Total degree.
The degree of the series is the maximum degree of its terms. If the series is empty, zero will be returned.
std::overflow_error | if the computation results in an overflow. |
unspecified | any exception thrown by:
|
Definition at line 390 of file power_series.hpp.
|
inline |
Partial degree.
The partial degree of the series is the maximum partial degree of its terms. If the series is empty, zero will be returned.
names | names of the variables to be considered in the computation of the degree. |
std::overflow_error | if the computation results in an overflow. |
unspecified | any exception thrown by:
|
Definition at line 444 of file power_series.hpp.
|
inline |
Total low degree.
The low degree of the series is the minimum low degree of its terms. If the series is empty, zero will be returned.
std::overflow_error | if the computation results in an overflow. |
unspecified | any exception thrown by:
|
Definition at line 416 of file power_series.hpp.
|
inline |
Partial low degree.
The partial low degree of the series is the minimum partial low degree of its terms. If the series is empty, zero will be returned.
names | names of the variables to be considered in the computation of the low degree. |
std::overflow_error | if the computation results in an overflow. |
unspecified | any exception thrown by:
|
Definition at line 475 of file power_series.hpp.
|
default |
Copy assignment operator.
other | the assignment argument. |
this
.unspecified | any exception thrown by the assignment operator of the base class. |
|
default |
Move assignment operator.
other | the assignment argument. |
this
.
|
inline |
Total degree truncation.
This method can be used to eliminate the parts of a series whose degree is greater than max_degree
. This includes the elimination of whole terms, but also the recursive truncation of coefficients via the piranha::math::truncate_degree() function, if supported by the coefficient. It must be noted that, in general, this method is not guaranteed to eliminate all the parts whose degree is greater than max_degree
(in particular, in the current implementation there is no truncation implemented for keys - a key is kept as-is or completely eliminated).
max_degree | maximum allowed total degree. |
this
.unspecified | any exception thrown by:
|
Definition at line 510 of file power_series.hpp.
|
inline |
Partial degree truncation.
This method is equivalent to the other overload, the only difference being that the partial degree is considered in the computation.
max_degree | maximum allowed partial degree. |
names | names of the variables to be considered in the computation of the partial degree. |
this
.unspecified | any exception thrown by:
|
Definition at line 543 of file power_series.hpp.