2
2
# Integration Rules
3
3
# ###############################################################################
4
4
5
+ function _kwargs_to_string (kwargs)
6
+ return join ([string (k) * " = " * string (v) for (k, v) in pairs (kwargs)], " , " )
7
+ end
8
+
5
9
abstract type IntegrationRule end
6
10
7
11
"""
@@ -18,6 +22,10 @@ struct GaussKronrod <: IntegrationRule
18
22
GaussKronrod (; kwargs... ) = new (kwargs)
19
23
end
20
24
25
+ function Base. show (io:: IO , rule:: GaussKronrod )
26
+ print (io, " GaussKronrod(; " , _kwargs_to_string (rule. kwargs), " )" )
27
+ end
28
+
21
29
"""
22
30
GaussLegendre(n)
23
31
@@ -39,6 +47,10 @@ struct GaussLegendre <: IntegrationRule
39
47
GaussLegendre (n:: Int64 ) = new (n, FastGaussQuadrature. gausslegendre (n)... )
40
48
end
41
49
50
+ function Base. show (io:: IO , rule:: GaussLegendre )
51
+ print (io, " GaussLegendre(" , rule. n, " )" )
52
+ end
53
+
42
54
"""
43
55
HAdaptiveCubature(kwargs...)
44
56
@@ -50,3 +62,7 @@ struct HAdaptiveCubature <: IntegrationRule
50
62
kwargs:: Base.Pairs
51
63
HAdaptiveCubature (; kwargs... ) = new (kwargs)
52
64
end
65
+
66
+ function Base. show (io:: IO , rule:: HAdaptiveCubature )
67
+ print (io, " HAdaptiveCubature(; " , _kwargs_to_string (rule. kwargs), " )" )
68
+ end
0 commit comments