piranha  0.10
Friends | List of all members
piranha::series_operators Class Reference

Series operators. More...

#include <piranha/series.hpp>

Inheritance diagram for piranha::series_operators:
Inheritance graph
[legend]

Friends

template<typename T , typename... U>
binary_add_type< T, U... > operator+ (T &&x, U &&... y)
 Binary addition involving piranha::series. More...
 
template<typename T , typename... U, in_place_add_enabler< T, U... > = 0>
T & operator+= (T &x, U &&... y)
 In-place addition involving piranha::series. More...
 
template<typename T , typename... U>
binary_sub_type< T, U... > operator- (T &&x, U &&... y)
 Binary subtraction involving piranha::series. More...
 
template<typename T , typename... U, in_place_sub_enabler< T, U... > = 0>
T & operator-= (T &x, U &&... y)
 In-place subtraction involving piranha::series. More...
 
template<typename T , typename... U>
binary_mul_type< T, U... > operator* (T &&x, U &&... y)
 Binary multiplication involving piranha::series. More...
 
template<typename T , typename... U, in_place_mul_enabler< T, U... > = 0>
T & operator*= (T &x, U &&... y)
 In-place multiplication involving piranha::series. More...
 
template<typename T , typename... U>
binary_div_type< T, U... > operator/ (T &&x, U &&... y)
 Binary division involving piranha::series. More...
 
template<typename T , typename... U, in_place_div_enabler< T, U... > = 0>
T & operator/= (T &x, U &&... y)
 In-place division involving piranha::series. More...
 
template<typename T , typename... U, eq_enabler< T, U... > = 0>
bool operator== (const T &x, const U &... y)
 Equality operator involving piranha::series. More...
 
template<typename T , typename... U, eq_enabler< T, U... > = 0>
bool operator!= (const T &x, const U &... y)
 Inequality operator involving piranha::series. More...
 

Detailed Description

Series operators.

This class contains the arithmetic and comparison operator overloads for piranha::series instances. The operators are implemented as inline friend functions and they will be found via argument-dependent name lookup when at least one of the two operands is an instance of piranha::series.

The operators defined here, similarly to the builtin operators in C++, promote one or both operands to a common type, if necessary, before actually performing the operation. The promotion rules are dependent on the recursion indices and coefficient types of the series, and they rely on the series rebinding mechanism to promote a series as needed (see piranha::series_is_rebindable and piranha::series_recursion_index).

These are the scenarios handled by the type promotion mechanism:

If any necessary conversion is not possible, either because the series are not rebindable or they do not support the needed constructors, the operators are disabled. The operators are also disabled if any operation needed by the implementation is not supported, or if an ambiguity arises in the type promotion algorithm (e.g., two series with same recursion index, same coefficient type which does not trigger any promotion, and different key types).

A few things to note about the operators implemented within this class:

The operators are implemented using variadic templates in order to allow overriding them via non-variadic overloads.

Definition at line 539 of file series.hpp.

Friends And Related Function Documentation

◆ operator!=

template<typename T , typename... U, eq_enabler< T, U... > = 0>
bool operator!= ( const T &  x,
const U &...  y 
)
friend

Inequality operator involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
true if x != y, false otherwise.
Exceptions
unspecifiedany exception thrown by operator==().

Definition at line 1225 of file series.hpp.

◆ operator*

template<typename T , typename... U>
binary_mul_type<T, U...> operator* ( T &&  x,
U &&...  y 
)
friend

Binary multiplication involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
x * y.
Exceptions
unspecifiedany exception thrown by:

Definition at line 1124 of file series.hpp.

◆ operator*=

template<typename T , typename... U, in_place_mul_enabler< T, U... > = 0>
T& operator*= ( T &  x,
U &&...  y 
)
friend

In-place multiplication involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
reference to this.
Exceptions
unspecifiedany exception thrown by operator*().

Definition at line 1142 of file series.hpp.

◆ operator+

template<typename T , typename... U>
binary_add_type<T, U...> operator+ ( T &&  x,
U &&...  y 
)
friend

Binary addition involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
x + y.
Exceptions
unspecifiedany exception thrown by:

Definition at line 1044 of file series.hpp.

◆ operator+=

template<typename T , typename... U, in_place_add_enabler< T, U... > = 0>
T& operator+= ( T &  x,
U &&...  y 
)
friend

In-place addition involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
reference to this.
Exceptions
unspecifiedany exception thrown by operator+().

Definition at line 1062 of file series.hpp.

◆ operator-

template<typename T , typename... U>
binary_sub_type<T, U...> operator- ( T &&  x,
U &&...  y 
)
friend

Binary subtraction involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
x - y.
Exceptions
unspecifiedany exception thrown by:

Definition at line 1084 of file series.hpp.

◆ operator-=

template<typename T , typename... U, in_place_sub_enabler< T, U... > = 0>
T& operator-= ( T &  x,
U &&...  y 
)
friend

In-place subtraction involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
reference to this.
Exceptions
unspecifiedany exception thrown by operator-().

Definition at line 1102 of file series.hpp.

◆ operator/

template<typename T , typename... U>
binary_div_type<T, U...> operator/ ( T &&  x,
U &&...  y 
)
friend

Binary division involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
x / y.
Exceptions
unspecifiedany exception thrown by:

Definition at line 1164 of file series.hpp.

◆ operator/=

template<typename T , typename... U, in_place_div_enabler< T, U... > = 0>
T& operator/= ( T &  x,
U &&...  y 
)
friend

In-place division involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.
Parameters
xfirst argument.
ysecond argument.
Returns
reference to this.
Exceptions
unspecifiedany exception thrown by operator/().

Definition at line 1182 of file series.hpp.

◆ operator==

template<typename T , typename... U, eq_enabler< T, U... > = 0>
bool operator== ( const T &  x,
const U &...  y 
)
friend

Equality operator involving piranha::series.

Note
This operator is enabled only if the algorithm outlined in piranha::series_operators is supported by the arguments.

Two series are considered equal if they have the same number of terms and all terms in one series appear in the other.

Parameters
xfirst argument.
ysecond argument.
Returns
true if x == y, false otherwise.
Exceptions
unspecifiedany exception thrown by:

Definition at line 1207 of file series.hpp.


The documentation for this class was generated from the following file: