GiNaC  1.8.0
integration_kernel.h
Go to the documentation of this file.
1 
5 /*
6  * GiNaC Copyright (C) 1999-2020 Johannes Gutenberg University Mainz, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef GINAC_INTEGRATION_KERNEL_H
24 #define GINAC_INTEGRATION_KERNEL_H
25 
26 #include "basic.h"
27 #include "archive.h"
28 #include "numeric.h"
29 
30 #include <cln/complex.h>
31 #include <vector>
32 
33 namespace GiNaC {
34 
35 ex ifactor(const numeric & n);
36 bool is_discriminant_of_quadratic_number_field(const numeric & n);
37 numeric kronecker_symbol(const numeric & a, const numeric & n);
38 numeric primitive_dirichlet_character(const numeric & n, const numeric & a);
39 numeric dirichlet_character(const numeric & n, const numeric & a, const numeric & N);
40 numeric generalised_Bernoulli_number(const numeric & k, const numeric & b);
41 ex Bernoulli_polynomial(const numeric & k, const ex & x);
42 
54 class integration_kernel : public basic
55 {
57 
58  // ctors
59 public:
60 
61  // functions overriding virtual functions from base classes
62 public:
63  ex series(const relational & r, int order, unsigned options = 0) const override;
64 
65 protected:
66 
67  // new virtual functions which can be overridden by derived classes
68 public:
69  virtual bool has_trailing_zero(void) const;
70  virtual bool is_numeric(void) const;
71  virtual ex Laurent_series(const ex & x, int order) const;
72  virtual ex get_numerical_value(const ex & lambda, int N_trunc = 0) const;
73 
74 protected:
75  virtual bool uses_Laurent_series() const;
76  virtual cln::cl_N series_coeff_impl(int i) const;
77 
78  // non-virtual functions
79 public:
80  size_t get_cache_size(void) const;
81  void set_cache_step(int cache_steps) const;
82  ex get_series_coeff(int i) const;
83  cln::cl_N series_coeff(int i) const;
84 
85 protected:
86  ex get_numerical_value_impl(const ex & lambda, const ex & pre, int shift, int N_trunc) const;
87  void do_print(const print_context & c, unsigned level) const;
88 
89  // friends :
90 
91  // member variables :
92 
93 protected:
94  // cache is increased by steps of cache_step_size
95  mutable int cache_step_size;
96  // cache already computed series coefficients
97  mutable std::vector<cln::cl_N> series_vec;
98 
99 };
100 
102 
114 {
116 
117  // ctors
118 public:
119 
120  // functions overriding virtual functions from base classes
121 public:
122 
123 protected:
124  cln::cl_N series_coeff_impl(int i) const override;
125 
126  // new virtual functions which can be overridden by derived classes
127 public:
128 
129 protected:
130 
131  // non-virtual functions
132 public:
133 
134 protected:
135  void do_print(const print_context & c, unsigned level) const;
136 
137  // friends :
138 
139  // member variables :
140 
141 protected:
142 
143 };
144 
146 
160 {
162 
163  // ctors
164 public:
165  multiple_polylog_kernel(const ex & z);
166 
167  // functions overriding virtual functions from base classes
168 public:
169  size_t nops() const override;
170  ex op(size_t i) const override;
171  ex & let_op(size_t i) override;
172 
173  bool is_numeric(void) const override;
174 
175 protected:
176  cln::cl_N series_coeff_impl(int i) const override;
177 
178  // new virtual functions which can be overridden by derived classes
179 public:
180 
181 protected:
182 
183  // non-virtual functions
184 public:
185 
186 protected:
187  void do_print(const print_context & c, unsigned level) const;
188 
189  // friends :
190 
191  // member variables :
192 
193 protected:
194  ex z;
195 
196 };
197 
199 
211 {
213 
214  // ctors
215 public:
216  ELi_kernel(const ex & n, const ex & m, const ex & x, const ex & y);
217 
218  // functions overriding virtual functions from base classes
219 public:
220  size_t nops() const override;
221  ex op(size_t i) const override;
222  ex & let_op(size_t i) override;
223 
224  bool is_numeric(void) const override;
225  ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
226 
227 protected:
228  cln::cl_N series_coeff_impl(int i) const override;
229 
230  // new virtual functions which can be overridden by derived classes
231 public:
232 
233 protected:
234 
235  // non-virtual functions
236 public:
237 
238 protected:
239  void do_print(const print_context & c, unsigned level) const;
240 
241  // friends :
242 
243  // member variables :
244 
245 protected:
246  ex n;
247  ex m;
248  ex x;
249  ex y;
250 
251 };
252 
254 
266 {
268 
269  // ctors
270 public:
271  Ebar_kernel(const ex & n, const ex & m, const ex & x, const ex & y);
272 
273  // functions overriding virtual functions from base classes
274 public:
275  size_t nops() const override;
276  ex op(size_t i) const override;
277  ex & let_op(size_t i) override;
278 
279  bool is_numeric(void) const override;
280  ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
281 
282 protected:
283  cln::cl_N series_coeff_impl(int i) const override;
284 
285  // new virtual functions which can be overridden by derived classes
286 public:
287 
288 protected:
289 
290  // non-virtual functions
291 public:
292 
293 protected:
294  void do_print(const print_context & c, unsigned level) const;
295 
296  // friends :
297 
298  // member variables :
299 
300 protected:
301  ex n;
302  ex m;
303  ex x;
304  ex y;
305 
306 };
307 
309 
322 {
324 
325  // ctors
326 public:
327  Kronecker_dtau_kernel(const ex & n, const ex & z, const ex & K = numeric(1), const ex & C_norm = numeric(1));
328 
329  // functions overriding virtual functions from base classes
330 public:
331  size_t nops() const override;
332  ex op(size_t i) const override;
333  ex & let_op(size_t i) override;
334 
335  bool is_numeric(void) const override;
336  ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
337 
338 protected:
339  cln::cl_N series_coeff_impl(int i) const override;
340 
341  // new virtual functions which can be overridden by derived classes
342 public:
343 
344 protected:
345 
346  // non-virtual functions
347 public:
348 
349 protected:
350  void do_print(const print_context & c, unsigned level) const;
351 
352  // friends :
353 
354  // member variables :
355 
356 protected:
357  ex n;
358  ex z;
359  ex K;
361 };
362 
364 
365 
378 {
380 
381  // ctors
382 public:
383  Kronecker_dz_kernel(const ex & n, const ex & z_j, const ex & tau, const ex & K = numeric(1), const ex & C_norm = numeric(1));
384 
385  // functions overriding virtual functions from base classes
386 public:
387  size_t nops() const override;
388  ex op(size_t i) const override;
389  ex & let_op(size_t i) override;
390 
391  bool is_numeric(void) const override;
392  ex get_numerical_value(const ex & z, int N_trunc = 0) const override;
393 
394 protected:
395  cln::cl_N series_coeff_impl(int i) const override;
396 
397  // new virtual functions which can be overridden by derived classes
398 public:
399 
400 protected:
401 
402  // non-virtual functions
403 public:
404 
405 protected:
406  void do_print(const print_context & c, unsigned level) const;
407 
408  // friends :
409 
410  // member variables :
411 
412 protected:
413  ex n;
416  ex K;
418 
419 };
420 
422 
423 
442 {
444 
445  // ctors
446 public:
447  Eisenstein_kernel(const ex & k, const ex & N, const ex & a, const ex & b, const ex & K, const ex & C_norm = numeric(1));
448 
449  // functions overriding virtual functions from base classes
450 public:
451  ex series(const relational & r, int order, unsigned options = 0) const override;
452 
453  size_t nops() const override;
454  ex op(size_t i) const override;
455  ex & let_op(size_t i) override;
456 
457  bool is_numeric(void) const override;
458  ex Laurent_series(const ex & x, int order) const override;
459  ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
460 
461 protected:
462  bool uses_Laurent_series() const override;
463 
464  // new virtual functions which can be overridden by derived classes
465 public:
466 
467 protected:
468 
469  // non-virtual functions
470 public:
471  ex q_expansion_modular_form(const ex & q, int order) const;
472 
473 protected:
474  void do_print(const print_context & c, unsigned level) const;
475 
476  // friends :
477 
478  // member variables :
479 
480 protected:
481  ex k;
482  ex N;
483  ex a;
484  ex b;
485  ex K;
487 
488 };
489 
491 
492 
504 {
506 
507  // ctors
508 public:
509  Eisenstein_h_kernel(const ex & k, const ex & N, const ex & r, const ex & s, const ex & C_norm = numeric(1));
510 
511  // functions overriding virtual functions from base classes
512 public:
513  ex series(const relational & r, int order, unsigned options = 0) const override;
514 
515  size_t nops() const override;
516  ex op(size_t i) const override;
517  ex & let_op(size_t i) override;
518 
519  bool is_numeric(void) const override;
520  ex Laurent_series(const ex & x, int order) const override;
521  ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
522 
523 protected:
524  bool uses_Laurent_series() const override;
525 
526  // new virtual functions which can be overridden by derived classes
527 public:
528 
529 protected:
530 
531  // non-virtual functions
532 public:
533  ex coefficient_a0(const numeric & k, const numeric & r, const numeric & s, const numeric & N) const;
534  ex coefficient_an(const numeric & n, const numeric & k, const numeric & r, const numeric & s, const numeric & N) const;
535  ex q_expansion_modular_form(const ex & q, int order) const;
536 
537 protected:
538  void do_print(const print_context & c, unsigned level) const;
539 
540  // friends :
541 
542  // member variables :
543 
544 protected:
545  ex k;
546  ex N;
547  ex r;
548  ex s;
550 
551 };
552 
554 
555 
567 {
569 
570  // ctors
571 public:
572  modular_form_kernel(const ex & k, const ex & P, const ex & C_norm = numeric(1));
573 
574  // functions overriding virtual functions from base classes
575 public:
576  ex series(const relational & r, int order, unsigned options = 0) const override;
577 
578  size_t nops() const override;
579  ex op(size_t i) const override;
580  ex & let_op(size_t i) override;
581 
582  bool is_numeric(void) const override;
583  ex Laurent_series(const ex & qbar, int order) const override;
584  ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
585 
586 protected:
587  bool uses_Laurent_series() const override;
588 
589  // new virtual functions which can be overridden by derived classes
590 public:
591 
592 protected:
593 
594  // non-virtual functions
595 public:
596  ex q_expansion_modular_form(const ex & q, int order) const;
597 
598 protected:
599  void do_print(const print_context & c, unsigned level) const;
600 
601  // friends :
602 
603  // member variables :
604 
605 protected:
606  ex k;
607  ex P;
609 
610 };
611 
613 
614 
624 {
626 
627  // ctors
628 public:
629  user_defined_kernel(const ex & f, const ex & x);
630 
631  // functions overriding virtual functions from base classes
632 public:
633  size_t nops() const override;
634  ex op(size_t i) const override;
635  ex & let_op(size_t i) override;
636 
637  bool is_numeric(void) const override;
638  ex Laurent_series(const ex & x, int order) const override;
639 
640 protected:
641  bool uses_Laurent_series() const override;
642 
643  // new virtual functions which can be overridden by derived classes
644 public:
645 
646 protected:
647 
648  // non-virtual functions
649 public:
650 
651 protected:
652  void do_print(const print_context & c, unsigned level) const;
653 
654  // friends :
655 
656  // member variables :
657 
658 protected:
659  ex f;
660  ex x;
661 
662 };
663 
665 
666 } // namespace GiNaC
667 
668 #endif // ndef GINAC_INTEGRATION_KERNEL_H
ex op(size_t i) const override
Return operand/member at position i.
ex op(size_t i) const override
Return operand/member at position i.
Eisenstein_h_kernel(const ex &k, const ex &N, const ex &r, const ex &s, const ex &C_norm=numeric(1))
void do_print(const print_context &c, unsigned level) const
void do_print(const print_context &c, unsigned level) const
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
ex q_expansion_modular_form(const ex &q, int order) const
ex Laurent_series(const ex &x, int order) const override
Returns the Laurent series, starting possibly with the pole term.
ex op(size_t i) const override
Return operand/member at position i.
ex series(const relational &r, int order, unsigned options=0) const override
Default implementation of ex::series().
ex op(size_t i) const override
Return operand/member at position i.
ex get_numerical_value_impl(const ex &lambda, const ex &pre, int shift, int N_trunc) const
The actual implementation for computing a numerical value for the integrand.
ex Laurent_series(const ex &x, int order) const override
Returns the Laurent series, starting possibly with the pole term.
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
Definition: add.cpp:38
The integration kernel for multiple polylogarithms.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
void do_print(const print_context &c, unsigned level) const
This class holds a relation consisting of two expressions and a logical relation between them...
Definition: relational.h:34
ex get_numerical_value(const ex &z, int N_trunc=0) const override
Returns the value of the g^(n-1)(z-z_j,K*tau).
The kernel corresponding to the Eisenstein series .
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
size_t nops() const override
Number of operands/members.
Archiving of GiNaC expressions.
void do_print(const print_context &c, unsigned level) const
ex get_series_coeff(int i) const
Wrapper around series_coeff(i), converts cl_N to numeric.
The kernel corresponding to integrating the Kronecker coefficient function in (or equivalently in )...
This class is the ABC (abstract base class) of GiNaC&#39;s class hierarchy.
Definition: basic.h:104
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of Ebar_{n,m}(x,y,qbar)
void do_print(const print_context &c, unsigned level) const
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
ex Laurent_series(const ex &qbar, int order) const override
Returns the Laurent series, starting possibly with the pole term.
modular_form_kernel(const ex &k, const ex &P, const ex &C_norm=numeric(1))
ex x
Definition: factor.cpp:1641
The ELi-kernel.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
The base class for integration kernels for iterated integrals.
ex op(size_t i) const override
Return operand/member at position i.
Kronecker_dz_kernel(const ex &n, const ex &z_j, const ex &tau, const ex &K=numeric(1), const ex &C_norm=numeric(1))
size_t r
Definition: factor.cpp:770
cln::cl_N series_coeff(int i) const
Subclasses have either to implement series_coeff_impl or the two methods Laurent_series and uses_Laur...
size_t nops() const override
Number of operands/members.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
size_t nops() const override
Number of operands/members.
virtual bool is_numeric(void) const
This routine returns true, if the integration kernel can be evaluated numerically.
size_t nops() const override
Number of operands/members.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
Definition: numeric.h:81
ELi_kernel(const ex &n, const ex &m, const ex &x, const ex &y)
void do_print(const print_context &c, unsigned level) const
size_t nops() const override
Number of operands/members.
std::vector< cln::cl_N > series_vec
vector< int > k
Definition: factor.cpp:1466
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
void do_print(const print_context &c, unsigned level) const
ex op(size_t i) const override
Return operand/member at position i.
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
unsigned options
Definition: factor.cpp:2480
void do_print(const print_context &c, unsigned level) const
ex series(const relational &r, int order, unsigned options=0) const override
The series method for this class returns the qbar-expansion of the modular form, without an additiona...
size_t nops() const override
Number of operands/members.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the modular form.
numeric dirichlet_character(const numeric &n, const numeric &a, const numeric &N)
Defines a Dirichlet character through the Kronecker symbol.
ex coefficient_an(const numeric &n, const numeric &k, const numeric &r, const numeric &s, const numeric &N) const
The higher coefficients in the Fourier expansion.
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
virtual ex get_numerical_value(const ex &lambda, int N_trunc=0) const
Evaluates the integrand at lambda.
user_defined_kernel(const ex &f, const ex &x)
size_t nops() const override
Number of operands/members.
size_t nops() const override
Number of operands/members.
bool is_discriminant_of_quadratic_number_field(const numeric &n)
Returns true if the integer n is either one or the discriminant of a quadratic number field...
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
ex coefficient_a0(const numeric &k, const numeric &r, const numeric &s, const numeric &N) const
The constant coefficient in the Fourier expansion.
The basic integration kernel with a logarithmic singularity at the origin.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
virtual ex Laurent_series(const ex &x, int order) const
Returns the Laurent series, starting possibly with the pole term.
void do_print(const print_context &c, unsigned level) const
The kernel corresponding to integrating the Kronecker coefficient function in .
The kernel corresponding to the Eisenstein series .
virtual cln::cl_N series_coeff_impl(int i) const
For only the coefficient of is non-zero.
size_t n
Definition: factor.cpp:1463
ex q_expansion_modular_form(const ex &q, int order) const
ex series(const relational &r, int order, unsigned options=0) const override
The series method for this class returns the qbar-expansion of the modular form, without an additiona...
ex Bernoulli_polynomial(const numeric &k, const ex &x)
The Bernoulli polynomials.
Eisenstein_kernel(const ex &k, const ex &N, const ex &a, const ex &b, const ex &K, const ex &C_norm=numeric(1))
Base class for print_contexts.
Definition: print.h:102
Interface to GiNaC&#39;s ABC.
numeric primitive_dirichlet_character(const numeric &n, const numeric &a)
Defines a primitive Dirichlet character through the Kronecker symbol.
A kernel corresponding to a polynomial in Eisenstein series.
numeric kronecker_symbol(const numeric &a, const numeric &n)
Returns the Kronecker symbol a: integer n: integer.
void set_cache_step(int cache_steps) const
Sets the step size by which the cache is increased.
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the g^(n)(z,K*tau), where tau is given by qbar.
ex op(size_t i) const override
Return operand/member at position i.
ex op(size_t i) const override
Return operand/member at position i.
Lightweight wrapper for GiNaC&#39;s symbolic objects.
Definition: ex.h:72
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
size_t get_cache_size(void) const
Returns the current size of the cache.
numeric generalised_Bernoulli_number(const numeric &k, const numeric &b)
The generalised Bernoulli number.
int order
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
size_t nops() const override
Number of operands/members.
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Definition: registrar.h:153
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the modular form.
Makes the interface to the underlying bignum package available.
void do_print(const print_context &c, unsigned level) const
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
GINAC_DECLARE_UNARCHIVER(add)
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
void do_print(const print_context &c, unsigned level) const
size_t c
Definition: factor.cpp:770
ex ifactor(const numeric &n)
Returns the decomposition of the positive integer n into prime numbers in the form lst( lst(p1...
virtual bool uses_Laurent_series() const
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of ELi_{n,m}(x,y,qbar)
ex series(const relational &r, int order, unsigned options=0) const override
The series method for this class returns the qbar-expansion of the modular form, without an additiona...
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
ex Laurent_series(const ex &x, int order) const override
Returns the Laurent series, starting possibly with the pole term.
Kronecker_dtau_kernel(const ex &n, const ex &z, const ex &K=numeric(1), const ex &C_norm=numeric(1))
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
A user-defined integration kernel.
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the modular form.
ex q_expansion_modular_form(const ex &q, int order) const
The Ebar-kernel.
ex op(size_t i) const override
Return operand/member at position i.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
Ebar_kernel(const ex &n, const ex &m, const ex &x, const ex &y)
virtual bool has_trailing_zero(void) const
This routine returns true, if the integration kernel has a trailing zero.

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.