|
Nestedsums library
|
A basic_letter is an element of an alphabet. More...
#include <basic_letter.h>
Public Member Functions | |
| basic_letter (const GiNaC::ex &l, const GiNaC::ex &d, const GiNaC::ex &o) | |
| basic_letter (const GiNaC::ex &l, const GiNaC::ex &d, const GiNaC::ex &o, const GiNaC::ex &i) | |
| void | archive (GiNaC::archive_node &node) const override |
| void | read_archive (const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override |
| unsigned | return_type (void) const override |
| void | print (const GiNaC::print_context &c, unsigned level=0) const override |
| unsigned | precedence (void) const override |
| GiNaC::ex | eval () const override |
| GiNaC::ex | subs (const GiNaC::exmap &m, unsigned options=0) const override |
| virtual GiNaC::ex | concat (const GiNaC::ex &l) const |
| virtual GiNaC::ex | eval_explicit () const |
| virtual GiNaC::ex | expand_members (int level=0) const |
| GiNaC::ex | get_scale (void) const |
| GiNaC::ex | get_degree (void) const |
| GiNaC::ex | get_offset (void) const |
| GiNaC::ex | get_index (void) const |
| GiNaC::ex | set_index (const GiNaC::ex &i) const |
| GiNaC::ex | forget_index (void) const |
| GiNaC::ex | shift_index (const GiNaC::ex &new_index) const |
| GiNaC::ex | index_eq_one (void) const |
| GiNaC::ex | shift_plus_one (void) const |
| GiNaC::ex | shift_minus_one (void) const |
| GiNaC::ex | degree_minus_one (void) const |
| GiNaC::ex | degree_plus_one (void) const |
Protected Member Functions | |
| GiNaC::ex | eval_ncmul (const GiNaC::exvector &v) const override |
| GiNaC::ex | derivative (const GiNaC::symbol &s) const override |
| unsigned | calchash (void) const override |
| virtual GiNaC::ex | concat_speedy (const GiNaC::ex &l) const |
Protected Attributes | |
| GiNaC::ex | scale |
| GiNaC::ex | degree |
| GiNaC::ex | offset |
| GiNaC::ex | index |
Friends | |
| GiNaC::ex | concat (const basic_letter &l1, const basic_letter &l2) |
A basic_letter is an element of an alphabet.
The model for a basic_letter is
![\[
\frac{x^i}{(i+c)^m}
\]](form_15.png)
Here 




Two basic_letters can be multiplied ("concatenated") to form a new basic_letter.
|
protectedvirtual |
Same as concat, but does not perform any checking. Assumes that the indices are the same or equal to the default one.
The multiplication is performed if the two basic_letters have
![\[
\frac{x^i}{(i+c)^{m_1}} \frac{y^i}{(i+c)^{m_2}} = \frac{(xy)^i}{(i+c)^{m_1+m_2}}
\]](form_2.png)
unequal offsets, but both degrees are integers (and not symbols).
If one of the degrees is zero, we have
![\[
\frac{x^i}{(i+c)^{m}} y^i = \frac{(xy)^i}{(i+c)^{m}}
\]](form_3.png)
If both degrees are positive, we have
![\[
\frac{x^i}{(i+c_1)^{m_1}} \frac{y^i}{(i+c_2)^{m_2}}
= \frac{1}{c_2-c_1} \left[ \frac{x^i}{(i+c_1)^{m_1}} \frac{y^i}{(i+c_2)^{m_2-1}}
\mbox{} - \frac{x^i}{(i+c_1)^{m_1-1}} \frac{y^i}{(i+c_2)^{m_2}} \right]
\]](form_4.png)
If one degree is positive ( 

![\[
\frac{x^i}{(i+c_1)^{m_1}} \frac{y^i}{(i+c_2)^{m_2}}
= \frac{x^i}{(i+c_1)^{m_1-1}} \frac{y^i}{(i+c_2)^{m_2+1}}
+ (c_2-c_1) \frac{x^i}{(i+c_1)^{m_1}} \frac{y^i}{(i+c_2)^{m_2+1}}
\]](form_7.png)
Finally, if both degrees are negative, we have
![\[
\frac{x^i}{(i+c_1)^{m_1}} \frac{y^i}{(i+c_2)^{m_2}}
= \frac{x^i}{(i+c_1)^{m_1-1}} \frac{y^i}{(i+c_2)^{m_2+1}}
+ (c_2-c_1) \frac{x^i}{(i+c_1)^{m_1}} \frac{y^i}{(i+c_2)^{m_2+1}}
\]](form_7.png)
To avoid an infinite recursion in the last case, the algorithm does not commute two basic_letters.
The multiplication does not alter the offset, e.g. if we have 




The result gets the index from the first letter, if this one differs from _default_index, otherwise the result gets the index from the second letter.
The routine returns unevaluated if
Reimplemented in letter, and unit_letter.
| ex degree_minus_one | ( | void | ) | const |
Returns a basic_letter with degree-1
| ex degree_plus_one | ( | void | ) | const |
Returns a basic_letter with degree+1
|
override |
If the offset is zero, evaluation returns a letter .
If the index is an integer, the object is evaluated explicitly.
|
virtual |
Explicit evaluation.
|
overrideprotected |
A product of two basic_letter's is simplified, if
A product is also simplified if the difference between the two indices is an integer, according to
![\[
\frac{x^{i+l}}{((i+l)+c)^m} \frac{y^i}{(i+c')^{m'}}
= x^l \frac{x^{i}}{(i+(c+l))^m} \frac{y^i}{(i+c')^{m'}}
\]](form_0.png)
where 
| ex forget_index | ( | void | ) | const |
Sets the index to the default index.
|
inline |
Returns the degree
|
inline |
Returns the index
|
inline |
Returns the offset
|
inline |
Returns the scale
| ex index_eq_one | ( | void | ) | const |
Returns
![\[
\frac{x}{(1+c)^m}
\]](form_13.png)
| ex set_index | ( | const GiNaC::ex & | i | ) | const |
Sets the index to 
| ex shift_index | ( | const GiNaC::ex & | new_index | ) | const |
Adjusts the index according to
![\[
\frac{x^j}{(j+c)^m} = x^{j-i} \frac{x^i}{(i+c+(j-i))^m}
\]](form_14.png)
| ex shift_minus_one | ( | void | ) | const |
Returns a basic_letter with offset-1
| ex shift_plus_one | ( | void | ) | const |
Returns a basic_letter with offset+1
|
friend |
Concat two letters.