GiNaC 1.8.10
integration_kernel.h
Go to the documentation of this file.
1
5/*
6 * GiNaC Copyright (C) 1999-2026 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef GINAC_INTEGRATION_KERNEL_H
23#define GINAC_INTEGRATION_KERNEL_H
24
25#include "basic.h"
26#include "archive.h"
27#include "numeric.h"
28#include "lst.h"
29
30#include <cln/complex.h>
31#include <vector>
32
33namespace GiNaC {
34
35ex ifactor(const numeric & n);
37numeric kronecker_symbol(const numeric & a, const numeric & n);
38numeric primitive_dirichlet_character(const numeric & n, const numeric & a);
39numeric dirichlet_character(const numeric & n, const numeric & a, const numeric & N);
40numeric generalised_Bernoulli_number(const numeric & k, const numeric & b);
41ex Bernoulli_polynomial(const numeric & k, const ex & x);
42
55{
57
58 // ctors
59public:
60
61 // functions overriding virtual functions from base classes
62public:
63 ex series(const relational & r, int order, unsigned options = 0) const override;
64
65protected:
66
67 // new virtual functions which can be overridden by derived classes
68public:
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
74protected:
75 virtual bool uses_Laurent_series() const;
76 virtual cln::cl_N series_coeff_impl(int i) const;
77
78 // non-virtual functions
79public:
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
85protected:
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
93protected:
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
118public:
119
120 // functions overriding virtual functions from base classes
121public:
122
123protected:
124 cln::cl_N series_coeff_impl(int i) const override;
125
126 // new virtual functions which can be overridden by derived classes
127public:
128
129protected:
130
131 // non-virtual functions
132public:
133
134protected:
135 void do_print(const print_context & c, unsigned level) const;
136
137 // friends :
138
139 // member variables :
140
141protected:
142
143};
144
146
160{
162
163 // ctors
164public:
166
167 // functions overriding virtual functions from base classes
168public:
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
175protected:
176 cln::cl_N series_coeff_impl(int i) const override;
177
178 // new virtual functions which can be overridden by derived classes
179public:
180
181protected:
182
183 // non-virtual functions
184public:
185
186protected:
187 void do_print(const print_context & c, unsigned level) const;
188
189 // friends :
190
191 // member variables :
192
193protected:
195
196};
197
199
211{
213
214 // ctors
215public:
216 ELi_kernel(const ex & n, const ex & m, const ex & x, const ex & y);
217
218 // functions overriding virtual functions from base classes
219public:
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
227protected:
228 cln::cl_N series_coeff_impl(int i) const override;
229
230 // new virtual functions which can be overridden by derived classes
231public:
232
233protected:
234
235 // non-virtual functions
236public:
237
238protected:
239 void do_print(const print_context & c, unsigned level) const;
240
241 // friends :
242
243 // member variables :
244
245protected:
250
251};
252
254
266{
268
269 // ctors
270public:
271 Ebar_kernel(const ex & n, const ex & m, const ex & x, const ex & y);
272
273 // functions overriding virtual functions from base classes
274public:
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
282protected:
283 cln::cl_N series_coeff_impl(int i) const override;
284
285 // new virtual functions which can be overridden by derived classes
286public:
287
288protected:
289
290 // non-virtual functions
291public:
292
293protected:
294 void do_print(const print_context & c, unsigned level) const;
295
296 // friends :
297
298 // member variables :
299
300protected:
305
306};
307
309
322{
324
325 // ctors
326public:
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
330public:
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
338protected:
339 cln::cl_N series_coeff_impl(int i) const override;
340
341 // new virtual functions which can be overridden by derived classes
342public:
343
344protected:
345
346 // non-virtual functions
347public:
348
349protected:
350 void do_print(const print_context & c, unsigned level) const;
351
352 // friends :
353
354 // member variables :
355
356protected:
361};
362
364
365
378{
380
381 // ctors
382public:
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
386public:
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
394protected:
395 cln::cl_N series_coeff_impl(int i) const override;
396
397 // new virtual functions which can be overridden by derived classes
398public:
399
400protected:
401
402 // non-virtual functions
403public:
404
405protected:
406 void do_print(const print_context & c, unsigned level) const;
407
408 // friends :
409
410 // member variables :
411
412protected:
418
419};
420
422
423
442{
444
445 // ctors
446public:
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
450public:
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
461protected:
462 bool uses_Laurent_series() const override;
463
464 // new virtual functions which can be overridden by derived classes
465public:
466
467protected:
468
469 // non-virtual functions
470public:
471 ex q_expansion_modular_form(const ex & q, int order) const;
472
473protected:
474 void do_print(const print_context & c, unsigned level) const;
475
476 // friends :
477
478 // member variables :
479
480protected:
487
488};
489
491
492
504{
506
507 // ctors
508public:
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
512public:
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
523protected:
524 bool uses_Laurent_series() const override;
525
526 // new virtual functions which can be overridden by derived classes
527public:
528
529protected:
530
531 // non-virtual functions
532public:
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
537protected:
538 void do_print(const print_context & c, unsigned level) const;
539
540 // friends :
541
542 // member variables :
543
544protected:
550
551};
552
554
555
567{
569
570 // ctors
571public:
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
575public:
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
586protected:
587 bool uses_Laurent_series() const override;
588
589 // new virtual functions which can be overridden by derived classes
590public:
591
592protected:
593
594 // non-virtual functions
595public:
596 ex q_expansion_modular_form(const ex & q, int order) const;
597
598protected:
599 void do_print(const print_context & c, unsigned level) const;
600
601 // friends :
602
603 // member variables :
604
605protected:
609
610};
611
613
614
624{
626
627 // ctors
628public:
629 user_defined_kernel(const ex & f, const ex & x);
630
631 // functions overriding virtual functions from base classes
632public:
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
640protected:
641 bool uses_Laurent_series() const override;
642
643 // new virtual functions which can be overridden by derived classes
644public:
645
646protected:
647
648 // non-virtual functions
649public:
650
651protected:
652 void do_print(const print_context & c, unsigned level) const;
653
654 // friends :
655
656 // member variables :
657
658protected:
661
662};
663
665
666} // namespace GiNaC
667
668#endif // ndef GINAC_INTEGRATION_KERNEL_H
Archiving of GiNaC expressions.
#define GINAC_DECLARE_UNARCHIVER(classname)
Helper macros to register a class with (un)archiving (a.k.a.
Definition archive.h:218
Interface to GiNaC's ABC.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
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.
size_t nops() const override
Number of operands/members.
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.
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of ELi_{n,m}(x,y,qbar)
size_t nops() const override
Number of operands/members.
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 op(size_t i) const override
Return operand/member at position i.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
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 Ebar_{n,m}(x,y,qbar)
The kernel corresponding to the Eisenstein series .
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the modular form.
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.
ex op(size_t i) const override
Return operand/member at position i.
void do_print(const print_context &c, unsigned level) const
ex q_expansion_modular_form(const ex &q, int order) const
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.
ex coefficient_a0(const numeric &k, const numeric &r, const numeric &s, const numeric &N) const
The constant coefficient in the Fourier expansion.
ex Laurent_series(const ex &x, int order) const override
Returns the Laurent series, starting possibly with the pole term.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
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...
The kernel corresponding to the Eisenstein series .
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the modular form.
ex Laurent_series(const ex &x, int order) const override
Returns the Laurent series, starting possibly with the pole term.
void do_print(const print_context &c, unsigned level) const
ex op(size_t i) const override
Return operand/member at position i.
ex q_expansion_modular_form(const ex &q, int order) const
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
size_t nops() const override
Number of operands/members.
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
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...
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
The kernel corresponding to integrating the Kronecker coefficient function in (or equivalently in )...
size_t nops() const override
Number of operands/members.
ex op(size_t i) const override
Return operand/member at position i.
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.
void do_print(const print_context &c, unsigned level) const
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.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
The kernel corresponding to integrating the Kronecker coefficient function in .
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.
void do_print(const print_context &c, unsigned level) const
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
ex op(size_t i) const override
Return operand/member at position i.
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).
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
The basic integration kernel with a logarithmic singularity at the origin.
void do_print(const print_context &c, unsigned level) const
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Definition basic.h:104
Lightweight wrapper for GiNaC's symbolic objects.
Definition ex.h:72
The base class for integration kernels for iterated integrals.
ex get_series_coeff(int i) const
Wrapper around series_coeff(i), converts cl_N to numeric.
size_t get_cache_size(void) const
Returns the current size of the cache.
virtual bool is_numeric(void) const
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.
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...
void do_print(const print_context &c, unsigned level) const
std::vector< cln::cl_N > series_vec
ex series(const relational &r, int order, unsigned options=0) const override
Default implementation of ex::series().
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.
virtual cln::cl_N series_coeff_impl(int i) const
For only the coefficient of is non-zero.
void set_cache_step(int cache_steps) const
Sets the step size by which the cache is increased.
virtual bool has_trailing_zero(void) const
This routine returns true, if the integration kernel has a trailing zero.
virtual ex Laurent_series(const ex &x, int order) const
Returns the Laurent series, starting possibly with the pole term.
virtual bool uses_Laurent_series() const
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
A kernel corresponding to a polynomial in Eisenstein series.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
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...
void do_print(const print_context &c, unsigned level) const
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 op(size_t i) const override
Return operand/member at position i.
ex get_numerical_value(const ex &qbar, int N_trunc=0) const override
Returns the value of the modular form.
ex Laurent_series(const ex &qbar, int order) const override
Returns the Laurent series, starting possibly with the pole term.
bool uses_Laurent_series() const override
Returns true, if the coefficients are computed from the Laurent series (in which case the method Laur...
ex q_expansion_modular_form(const ex &q, int order) const
The integration kernel for multiple polylogarithms.
cln::cl_N series_coeff_impl(int i) const override
For only the coefficient of is non-zero.
ex & let_op(size_t i) override
Return modifiable operand/member at position i.
size_t nops() const override
Number of operands/members.
void do_print(const print_context &c, unsigned level) const
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.
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
Definition numeric.h:81
Base class for print_contexts.
Definition print.h:101
This class holds a relation consisting of two expressions and a logical relation between them.
Definition relational.h:34
A user-defined integration kernel.
ex Laurent_series(const ex &x, int order) const override
Returns the Laurent series, starting possibly with the pole term.
bool is_numeric(void) const override
This routine returns true, if the integration kernel can be evaluated numerically.
ex op(size_t i) const override
Return operand/member at position i.
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 & let_op(size_t i) override
Return modifiable operand/member at position i.
size_t nops() const override
Number of operands/members.
unsigned options
Definition factor.cpp:2473
vector< int > k
Definition factor.cpp:1434
size_t n
Definition factor.cpp:1431
size_t c
Definition factor.cpp:756
ex x
Definition factor.cpp:1609
size_t r
Definition factor.cpp:756
Definition of GiNaC's lst.
Definition add.cpp:35
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.
numeric dirichlet_character(const numeric &n, const numeric &a, const numeric &N)
Defines a Dirichlet character through the Kronecker symbol.
numeric kronecker_symbol(const numeric &a, const numeric &n)
Returns the Kronecker symbol a: integer n: integer.
ex Bernoulli_polynomial(const numeric &k, const ex &x)
The Bernoulli polynomials.
numeric primitive_dirichlet_character(const numeric &n, const numeric &a)
Defines a primitive Dirichlet character through the Kronecker symbol.
ex ifactor(const numeric &n)
Returns the decomposition of the positive integer n into prime numbers in the form lst( lst(p1,...
numeric generalised_Bernoulli_number(const numeric &k, const numeric &b)
The generalised Bernoulli number.
Makes the interface to the underlying bignum package available.
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Definition registrar.h:151

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