The Makefile can generate 5 useful programs:
quadrature
by callingmake quadrature
kes
by callingmake kes
ekes
by callingmake ekes
rekes
by callingmake rekes
genzkeister
by callingmake genzkeister
There are also two test programs generated by make test
and make enumtest
. Just type make
without arguments to build all.
The polynomial type can be specified as argument to make via POLY=P
where P
is one of:
LEGENDRE
Legendre polynomialsCHEBYSHEVT
Chebyshev polynomials of the first kindCHEBYSHEVU
Chebyshev polynomials of the second kindLAGUERRE
Laguerre polynomialsHERMITE
physicists' Hermite polynomialsHERMITEPRO
probabilists' Hermite polynomials
and the default is LEGENDRE
if nothing else is provided.
All code can be compiled to produce minimal output by setting PRINTLOG=0
. For detailed help, run the programs without any arguments.
The program quadrature
computes quadrature nodes and weights for Gauss-Legendre, Gauss-Laguerre, Gauss-Hermite or Gauss-Chebyshev quadrature rules. Computation works by root-finding and an explicit formula for the weights given the nodes.
The program kes
computes nested Kronrod extensions from an initial rule and a list of polynomial extension degrees. Output contains the defining polynomials and optionally the nodes and weights for for each quadrature extension.
Example:
-
Compute the nodes and weights for a
K = (1,2,4,8,16)
Kronrod extension:./kes -cn -cw 1 2 4 8 16 > rule.txt
-
Plot nodes and weights of this rule:
python plot_weights.py rule.txt
The program ekes
computes single higher-order Kronrod-Patterson extensions for a given polynomial type and arbitrary values of order n
and extension degree p
.
-
Call
ekes
like:./ekes n p > map.txt
for specific values of
n
andp
. -
Plot the map:
python plot_map.py map.txt
-
Call
rekes
like:./rekes n pmax recmax > recs_n_pmax_recmax.dat
for all interesting values of
n
,pmax
andrecmax
. -
Call
graph_rules.py
to generate a dot file:python graph_rules.py recs_n_pmax_recmax.dat
This will give a file called
graph_n_pmax_recmax.dot
-
Make a figure by calling
dot
either of:circo graph_n_pmax_recmax.dot -Tpng -o graph_n_pmax_recmax.png dot graph_n_pmax_recmax.dot -Tpng -o graph_n_pmax_recmax.png
-
Call
get_all_rules.sh
in a directory withrecs_*.dat
files. This will give a file calledall_rules.dat
containing line by line the extension tower. -
Call
build_rulecomputer.py
like:python build_rulecomputer.py all_rules.dat
This will give a file called
compute_all_rules.sh
containing shell commands to compute nodes and weights of all rules.
The program genzkeister
builds multivariate sparse quadrature rules by applying the Genz-Keister construction. This works for all symmetric quadratures (Legendre, Chebyshev, Hermite). The number of dimensions is a compile-time argument given to make
by the DIMENSION=D
. The default is POLY=LEGENDRE
polynomials in DIMENSION=1
dimensions.
The research report "Exhaustive search for higher-order Kronrod-Patterson Extensions" 1 describes the mathematical theory and implementation details that stand behind this code.
This project is covered by the GNU Public License, version 2 or above.
This repository contains source code for published scientific work. The usual citation requirements apply. For citation of this project please use the following bibtex snippet:
@misc{kes,
author = {R. Bourquin},
title = {Exhaustive search for higher-order Kronrod-Patterson Extensions},
year = {2014, 2015, 2016, 2017},
url = {https://github.com/Kronrod-Extensions-Library/kes}
}