22# Integration Rules
33# ###############################################################################
44
5+ function _kwargs_to_string (kwargs)
6+ return join ([string (k) * " = " * string (v) for (k, v) in pairs (kwargs)], " , " )
7+ end
8+
59abstract type IntegrationRule end
610
711"""
@@ -18,6 +22,10 @@ struct GaussKronrod <: IntegrationRule
1822 GaussKronrod (; kwargs... ) = new (kwargs)
1923end
2024
25+ function Base. show (io:: IO , rule:: GaussKronrod )
26+ print (io, " GaussKronrod(; " , _kwargs_to_string (rule. kwargs), " )" )
27+ end
28+
2129"""
2230 GaussLegendre(n)
2331
@@ -39,6 +47,10 @@ struct GaussLegendre <: IntegrationRule
3947 GaussLegendre (n:: Int64 ) = new (n, FastGaussQuadrature. gausslegendre (n)... )
4048end
4149
50+ function Base. show (io:: IO , rule:: GaussLegendre )
51+ print (io, " GaussLegendre(" , rule. n, " )" )
52+ end
53+
4254"""
4355 HAdaptiveCubature(kwargs...)
4456
@@ -50,3 +62,7 @@ struct HAdaptiveCubature <: IntegrationRule
5062 kwargs:: Base.Pairs
5163 HAdaptiveCubature (; kwargs... ) = new (kwargs)
5264end
65+
66+ function Base. show (io:: IO , rule:: HAdaptiveCubature )
67+ print (io, " HAdaptiveCubature(; " , _kwargs_to_string (rule. kwargs), " )" )
68+ end
0 commit comments