GiNaC 1.8.7
integration_kernel.h
Go to the documentation of this file.
1
5/*
6 * GiNaC Copyright (C) 1999-2023 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#include "lst.h"
30
31#include <cln/complex.h>
32#include <vector>
33
34namespace GiNaC {
35
36ex ifactor(const numeric & n);
38numeric kronecker_symbol(const numeric & a, const numeric & n);
39numeric primitive_dirichlet_character(const numeric & n, const numeric & a);
40numeric dirichlet_character(const numeric & n, const numeric & a, const numeric & N);
41numeric generalised_Bernoulli_number(const numeric & k, const numeric & b);
42ex Bernoulli_polynomial(const numeric & k, const ex & x);
43
56{
58
59 // ctors
60public:
61
62 // functions overriding virtual functions from base classes
63public:
64 ex series(const relational & r, int order, unsigned options = 0) const override;
65
66protected:
67
68 // new virtual functions which can be overridden by derived classes
69public:
70 virtual bool has_trailing_zero(void) const;
71 virtual bool is_numeric(void) const;
72 virtual ex Laurent_series(const ex & x, int order) const;
73 virtual ex get_numerical_value(const ex & lambda, int N_trunc = 0) const;
74
75protected:
76 virtual bool uses_Laurent_series() const;
77 virtual cln::cl_N series_coeff_impl(int i) const;
78
79 // non-virtual functions
80public:
81 size_t get_cache_size(void) const;
82 void set_cache_step(int cache_steps) const;
83 ex get_series_coeff(int i) const;
84 cln::cl_N series_coeff(int i) const;
85
86protected:
87 ex get_numerical_value_impl(const ex & lambda, const ex & pre, int shift, int N_trunc) const;
88 void do_print(const print_context & c, unsigned level) const;
89
90 // friends :
91
92 // member variables :
93
94protected:
95 // cache is increased by steps of cache_step_size
96 mutable int cache_step_size;
97 // cache already computed series coefficients
98 mutable std::vector<cln::cl_N> series_vec;
99
100};
101
103
115{
117
118 // ctors
119public:
120
121 // functions overriding virtual functions from base classes
122public:
123
124protected:
125 cln::cl_N series_coeff_impl(int i) const override;
126
127 // new virtual functions which can be overridden by derived classes
128public:
129
130protected:
131
132 // non-virtual functions
133public:
134
135protected:
136 void do_print(const print_context & c, unsigned level) const;
137
138 // friends :
139
140 // member variables :
141
142protected:
143
144};
145
147
161{
163
164 // ctors
165public:
167
168 // functions overriding virtual functions from base classes
169public:
170 size_t nops() const override;
171 ex op(size_t i) const override;
172 ex & let_op(size_t i) override;
173
174 bool is_numeric(void) const override;
175
176protected:
177 cln::cl_N series_coeff_impl(int i) const override;
178
179 // new virtual functions which can be overridden by derived classes
180public:
181
182protected:
183
184 // non-virtual functions
185public:
186
187protected:
188 void do_print(const print_context & c, unsigned level) const;
189
190 // friends :
191
192 // member variables :
193
194protected:
196
197};
198
200
212{
214
215 // ctors
216public:
217 ELi_kernel(const ex & n, const ex & m, const ex & x, const ex & y);
218
219 // functions overriding virtual functions from base classes
220public:
221 size_t nops() const override;
222 ex op(size_t i) const override;
223 ex & let_op(size_t i) override;
224
225 bool is_numeric(void) const override;
226 ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
227
228protected:
229 cln::cl_N series_coeff_impl(int i) const override;
230
231 // new virtual functions which can be overridden by derived classes
232public:
233
234protected:
235
236 // non-virtual functions
237public:
238
239protected:
240 void do_print(const print_context & c, unsigned level) const;
241
242 // friends :
243
244 // member variables :
245
246protected:
251
252};
253
255
267{
269
270 // ctors
271public:
272 Ebar_kernel(const ex & n, const ex & m, const ex & x, const ex & y);
273
274 // functions overriding virtual functions from base classes
275public:
276 size_t nops() const override;
277 ex op(size_t i) const override;
278 ex & let_op(size_t i) override;
279
280 bool is_numeric(void) const override;
281 ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
282
283protected:
284 cln::cl_N series_coeff_impl(int i) const override;
285
286 // new virtual functions which can be overridden by derived classes
287public:
288
289protected:
290
291 // non-virtual functions
292public:
293
294protected:
295 void do_print(const print_context & c, unsigned level) const;
296
297 // friends :
298
299 // member variables :
300
301protected:
306
307};
308
310
323{
325
326 // ctors
327public:
328 Kronecker_dtau_kernel(const ex & n, const ex & z, const ex & K = numeric(1), const ex & C_norm = numeric(1));
329
330 // functions overriding virtual functions from base classes
331public:
332 size_t nops() const override;
333 ex op(size_t i) const override;
334 ex & let_op(size_t i) override;
335
336 bool is_numeric(void) const override;
337 ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
338
339protected:
340 cln::cl_N series_coeff_impl(int i) const override;
341
342 // new virtual functions which can be overridden by derived classes
343public:
344
345protected:
346
347 // non-virtual functions
348public:
349
350protected:
351 void do_print(const print_context & c, unsigned level) const;
352
353 // friends :
354
355 // member variables :
356
357protected:
362};
363
365
366
379{
381
382 // ctors
383public:
384 Kronecker_dz_kernel(const ex & n, const ex & z_j, const ex & tau, const ex & K = numeric(1), const ex & C_norm = numeric(1));
385
386 // functions overriding virtual functions from base classes
387public:
388 size_t nops() const override;
389 ex op(size_t i) const override;
390 ex & let_op(size_t i) override;
391
392 bool is_numeric(void) const override;
393 ex get_numerical_value(const ex & z, int N_trunc = 0) const override;
394
395protected:
396 cln::cl_N series_coeff_impl(int i) const override;
397
398 // new virtual functions which can be overridden by derived classes
399public:
400
401protected:
402
403 // non-virtual functions
404public:
405
406protected:
407 void do_print(const print_context & c, unsigned level) const;
408
409 // friends :
410
411 // member variables :
412
413protected:
419
420};
421
423
424
443{
445
446 // ctors
447public:
448 Eisenstein_kernel(const ex & k, const ex & N, const ex & a, const ex & b, const ex & K, const ex & C_norm = numeric(1));
449
450 // functions overriding virtual functions from base classes
451public:
452 ex series(const relational & r, int order, unsigned options = 0) const override;
453
454 size_t nops() const override;
455 ex op(size_t i) const override;
456 ex & let_op(size_t i) override;
457
458 bool is_numeric(void) const override;
459 ex Laurent_series(const ex & x, int order) const override;
460 ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
461
462protected:
463 bool uses_Laurent_series() const override;
464
465 // new virtual functions which can be overridden by derived classes
466public:
467
468protected:
469
470 // non-virtual functions
471public:
472 ex q_expansion_modular_form(const ex & q, int order) const;
473
474protected:
475 void do_print(const print_context & c, unsigned level) const;
476
477 // friends :
478
479 // member variables :
480
481protected:
488
489};
490
492
493
505{
507
508 // ctors
509public:
510 Eisenstein_h_kernel(const ex & k, const ex & N, const ex & r, const ex & s, const ex & C_norm = numeric(1));
511
512 // functions overriding virtual functions from base classes
513public:
514 ex series(const relational & r, int order, unsigned options = 0) const override;
515
516 size_t nops() const override;
517 ex op(size_t i) const override;
518 ex & let_op(size_t i) override;
519
520 bool is_numeric(void) const override;
521 ex Laurent_series(const ex & x, int order) const override;
522 ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
523
524protected:
525 bool uses_Laurent_series() const override;
526
527 // new virtual functions which can be overridden by derived classes
528public:
529
530protected:
531
532 // non-virtual functions
533public:
534 ex coefficient_a0(const numeric & k, const numeric & r, const numeric & s, const numeric & N) const;
535 ex coefficient_an(const numeric & n, const numeric & k, const numeric & r, const numeric & s, const numeric & N) const;
536 ex q_expansion_modular_form(const ex & q, int order) const;
537
538protected:
539 void do_print(const print_context & c, unsigned level) const;
540
541 // friends :
542
543 // member variables :
544
545protected:
551
552};
553
555
556
568{
570
571 // ctors
572public:
573 modular_form_kernel(const ex & k, const ex & P, const ex & C_norm = numeric(1));
574
575 // functions overriding virtual functions from base classes
576public:
577 ex series(const relational & r, int order, unsigned options = 0) const override;
578
579 size_t nops() const override;
580 ex op(size_t i) const override;
581 ex & let_op(size_t i) override;
582
583 bool is_numeric(void) const override;
584 ex Laurent_series(const ex & qbar, int order) const override;
585 ex get_numerical_value(const ex & qbar, int N_trunc = 0) const override;
586
587protected:
588 bool uses_Laurent_series() const override;
589
590 // new virtual functions which can be overridden by derived classes
591public:
592
593protected:
594
595 // non-virtual functions
596public:
597 ex q_expansion_modular_form(const ex & q, int order) const;
598
599protected:
600 void do_print(const print_context & c, unsigned level) const;
601
602 // friends :
603
604 // member variables :
605
606protected:
610
611};
612
614
615
625{
627
628 // ctors
629public:
630 user_defined_kernel(const ex & f, const ex & x);
631
632 // functions overriding virtual functions from base classes
633public:
634 size_t nops() const override;
635 ex op(size_t i) const override;
636 ex & let_op(size_t i) override;
637
638 bool is_numeric(void) const override;
639 ex Laurent_series(const ex & x, int order) const override;
640
641protected:
642 bool uses_Laurent_series() const override;
643
644 // new virtual functions which can be overridden by derived classes
645public:
646
647protected:
648
649 // non-virtual functions
650public:
651
652protected:
653 void do_print(const print_context & c, unsigned level) const;
654
655 // friends :
656
657 // member variables :
658
659protected:
662
663};
664
666
667} // namespace GiNaC
668
669#endif // ndef GINAC_INTEGRATION_KERNEL_H
Archiving of GiNaC expressions.
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.
ELi_kernel(const ex &n, const ex &m, const ex &x, const ex &y)
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)
The Ebar-kernel.
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.
Ebar_kernel(const ex &n, const ex &m, const ex &x, const ex &y)
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.
Eisenstein_h_kernel(const ex &k, const ex &N, const ex &r, const ex &s, const ex &C_norm=numeric(1))
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.
Eisenstein_kernel(const ex &k, const ex &N, const ex &a, const ex &b, const ex &K, const ex &C_norm=numeric(1))
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.
Kronecker_dtau_kernel(const ex &n, const ex &z, const ex &K=numeric(1), const ex &C_norm=numeric(1))
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 .
Kronecker_dz_kernel(const ex &n, const ex &z_j, const ex &tau, const ex &K=numeric(1), const ex &C_norm=numeric(1))
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:105
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.
modular_form_kernel(const ex &k, const ex &P, const ex &C_norm=numeric(1))
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:82
Base class for print_contexts.
Definition: print.h:103
This class holds a relation consisting of two expressions and a logical relation between them.
Definition: relational.h:35
A user-defined integration kernel.
user_defined_kernel(const ex &f, const ex &x)
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:2475
vector< int > k
Definition: factor.cpp:1435
size_t n
Definition: factor.cpp:1432
size_t c
Definition: factor.cpp:757
ex x
Definition: factor.cpp:1610
size_t r
Definition: factor.cpp:757
int order
Definition of GiNaC's lst.
Definition: add.cpp:38
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.
GINAC_DECLARE_UNARCHIVER(add)
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:153

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