Special pointsets
 For special pointsets over intervals, triangles (simplex), disk, square, and polygons, see the following url.
Recent codes (last update: August 18, 2022)
» Object: UNIONOFDISKS: a software package for determining cubature rules over union of disks.
The main folder contains the following compressed folders:
 COMPARISONS, contains all the subroutines used for our numerical experiments (including previous software that is compared with the new approach); the main demo is the file demo make experiments that performs the numerical experiments presented in the paper Cubature rules with positive weights on union of disks, comparing the new rules determined by cub_uniondisks, including the compressed version, and the old routine achieved by gqmultibubble;
 demo_make_experiments: it performs the experiments presented in the paper;
 demo_cubature_uniondisk: it compares the results of new rules (including the compresse one) on integrating some functions on certain test domains;
 ROUTINES, contains all the routines necessary for cubature over disks; the main routines are
 cub_uniondiscs: implements the algorithm for determining a cubature formula on the union of disks, including the Tchakaloff rules (i.e. their compressed version);
 demo_cub_uniondiscs: demo explaining how to use the subroutines and comparing the new rules on some domains.
» Sources:
 [1] A. Sommariva and M. Vianello, Cubature rules with positive weights on union of disks, (submitted),

Last versions:
» UNIONOFDISKS.zip [MATLAB CODES],
Papers:
Codes:
» Object: INTERSECTIONOFDISKS: a software package for determining cubature rules over intersection of disks (20172022).
 The main routine for computing the intersection of disks is gqintdisk.m that requires additional routines saved in the folder;
 the demo to test the performance of the previous routine is demo_intersection.m.
Codes:
» INTERSECTIONOFDISKS_2022.zip [MATLAB CODES],
» First update: October 24, 2022. Last update: October 24, 2022.
» Object: CQMC: a software package for lowdimensional Compressed QuasiMonteCarlo cubature.
The main folder contains the following compressed folders:
 ROUTINES_2D.zip, that include many routines for computation of integrals via QMC/CQMC methods on domains obtained by set operation from two bivariate domains whose boundary is defined by piecewise NURBS;
 ROUTINES_3D.zip, that include many routines for computation of integrals via QMC/CQMC methods on domains obtained by set operation from a trivariate polyhedron and a sphere;
 README_FIRST.txt, that explains how to replicate the tests in the paper.
 make_rule, that defines a QMC rule over the domain and then extracts the CQMC rule via cqmc_01;
 cqmc_01, routine that from a sufficiently dense QMC rule computes a low cardinality CQMC rule that matches the QMC moments up to a certain total polynomial degree.
» Sources:
 [1] G. Elefante, A. Sommariva and M. Vianello, CQMC: an improved code for lowdimensional Compressed QuasiMonteCarlo cubature, (submitted),

Last versions:
» ROUTINES_2D.zip [MATLAB CODES],
» ROUTINES_3D.zip [MATLAB CODES]
Papers:
Codes:
» Object: IN_RS: Matlab routine for points indomain on NURBSshaped planar domains.
The main folder IN_RS contains:
 inRS.m, a new routine for indomain over NURBSshaped domains;
 inRS_21.m, an old routine for indomain over NURBSshaped domains;
 inRSpoly2.m, a routine for indomain over NURBSshaped domains (based on approximating the domain with a polygon, it requires inpoly2 by D. Engwirda);
 demo_nurbs_indomain_01.m, demo_nurbs_indomain_02.m, demo_nurbs_indomain_03.m are demos, useful to define the domains and to understand how to use the indomain routine.
 demo_nurbs_indomain_04.m, evaluates the performance of our two indomain routines for NURBS presented in [1] and [2], comparing them to one in which the NURBS boundary is approximated by a polygon, finally using inpoly2 by D. Engwirda. To make that comparison, please download the routine inpoly2 and save it in the IN_RS folder.
 the routine demo_nurbs_indomain_05.m shows how to define the problem when only some vertices of the curved polygon are available;
 the routine demo_nurbs_indomain_06.m considers the case of a domain whose boundary is defined only by a point cloud of possibly inexact data; this routine requires spcsp.m (cubic smoothing periodic spline), by M. Zanetti, available at the Matlab Central File Exchange;
 the routine demo_nurbs_indomain_07.m shows how to define the problem when the whole domain is defined via point cloud and NURBS use the vertices, provided by alphashape polygonal approximation of the boundary, as control points;
 the routine demo_nurbs_indomain_08.m shows how to define the problem when the whole domain is defined via point cloud and parametric cubic smoothing periodic spline are used on the data provided by alphashape polygonal approximation of the boundary; this routine requires spcsp.m, by M. Zanetti, available at the Matlab Central File Exchange;
» Sources:
 [1] A. Sommariva and M. Vianello, Lowcardinality Positive Interior cubature on NURBSshaped domains, [PDF] (submitted),
 [2] A. Sommariva and M. Vianello, inRS: implementing the indicator function for NURBSshaped planar domains (submitted).
 Last version: [MATLAB CODES (zip file)],
 Presentation at SA 2022: [PDF (Beamer)]
Papers:
Codes:
Presentation:
» Object: CUB_RS: Matlab toolbox for algebraic cubature on NURBSshaped domains.
The main folder CUB_RS contains:
 PAPER_EXPERIMENTS that includes all the Matlab routines useful for reproducing the experiments described in the work [1] and [2] (see references below);
 BEZIER_ROUTINES that includes all the Matlab routines useful for integration over domains whose boundary is defined by composite Bezier arcs;
 NURBS_ROUTINES that includes all the Matlab routines useful for integration over domains whose boundary is defined by NURBS;
 SPLINE_ROUTINES that includes all the Matlab routines useful for integration over domains whose boundary is defined by general parametric splines.
The main routines are:
 inRS that implements a fast indomain algorithm for these instances; the last update presents a faster indomain algorithm inRS, presented in [2]; the older version introduced in [1] is present in the file inRS_21;
 cubRS that determines an algebraic cubature formula of the desired degree of exactness, with low cardinality, internal nodes and positive weights.
» Sources:
 [1] A. Sommariva and M. Vianello, Lowcardinality Positive Interior cubature on NURBSshaped domains, [PDF] (submitted),
 [2] A. Sommariva and M. Vianello, inRS: implementing the indicator function for NURBSshaped planar domains (submitted).
 Last version: [MATLAB CODES (zip file)],
Paper:
Codes:
Presentation:
» Object: Cubature on a domain defined by the union/difference of a disk with a polygon..
The main routine is
The software includes the demo file:
» Sources:
 E. Artioli, A. Sommariva and M. Vianello, Algebraic cubature on polygonal elements with a circular edge, [PDF],
 Last version: [MATLAB CODES (zip file)],
Paper:
Codes:
» Object: Cubature on a domain defined by the union/difference of a disk with a polygon..
The main routine is
The software includes the demo file:
» Sources:
 Papers: E. Artioli, A. Sommariva and M. Vianello, Algebraic cubature on polygonal elements with a circular edge, [PDF],
 Last version: [MATLAB CODES (zip file)],
» Object: Basic adaptive code for quadrature of an integrand over polygonal regions.
The main routine is
The software includes the demos file:
» Sources:
 Last version: [MATLAB CODES (zip file)],
» Object: RBF cubature on polygonal regions (with almost optimal shape parameter).
The main routines are:
The software includes several demos:
For the demos of the previous version published in RBF moment computation and meshless cubature on general polygonal regions, see:
» Source:
 Papers:
 R. Cavoretto, A. De Rossi, A. Sommariva and M. Vianello, RBFCUB: a numerical package for nearoptimal meshless cubature on general polygons;
 A. Sommariva and M. Vianello, RBF moment computation and meshless cubature on general polygonal regions
 Latest version: [MATLAB CODES (zip file)] [MATLAB CODES (zip file at GitHub)]
» Object: Nearalgebraic quadrature rules on spherical polygons..
The main routines are
The software includes the demos files:
» Object: Polynomial hyperinterpolation on spherical polygons.
The software includes the demos files:
» Sources:
 Papers:
 Last version: [MATLAB CODES (zip file)]
» Object: Approximation/Interpolation on spherical triangles.
The zip file contains three folders:
 BASIC_USAGE: here we have introduced a demo demo_am_00.m on the norming mesh and its properties as well as the main routine am_sphtri.m for the determination of the norming mesh, depending on a spherical triangle contained in a certain hemisphere.
 ADVANCED_USAGE: here there are two demos for the computation of norming meshes on spherical triangle T, as well as a set of Approximate Fekete Points, useful for polynomial interpolation.
 demo_am_01.m demo on using "dPOLYFIT", "dPOLYVAL", "dLEB" for algebraic polynomial interpolation/least squares approximation on spherical triangle. The approximation points are taken from AMs on the spherical triangle; the new routine introduced here is "am_sphtri" that determines an Admissible Mesh over a spherical triangle.
 demo_am_02.m this routine computes a AM on a spherical triangle and extracts AFEK pointset; next it determines its main features and plots AM and AFEK.
 FIGURES: it contains all the Matlab files useful for determining the figures and their experiments, as cited in the reference paper ChebyshevDubiner norming grids and Feketelike interpolation on spherical triangles.
 Papers:
 Software:
» Object: Nearalgebraic quadrature rules on spherical triangles..
The main routine is
The software includes the demos files:
» Object: Polynomial hyperinterpolation on spherical triangles.
The software includes the demos files:
» Sources:
 Papers:
 Last version: [MATLAB CODES (zip file)], [MATLAB CODES (zip file), at Github]
 Older version: [MATLAB CODES (zip file)]
» Object: RBF moments and cubature rules on polygonal regions.
The main routine are
The software includes several demos that test moments as well as the cubature rules. In particular the tests in the paper can be obtained by means of demo_RBF_moms.m and demo_RBF_cub.m.
» Source:
 Paper: RBF moment computation and meshless cubature on general polygonal regions
 Latest version: [MATLAB CODES (zip file)]
» Object: cubature rules on spherical rectangles of the 2sphere.
The main routine is cub_sphrect.m that computes rules with a fixed algebraic degree of precision on a spherical rectangle.
Another relevant function is cub_sphrect_adaptive_2020.m that is a basic adaptive code for cubature on a spherical rectangle.
The software includes two demos, on integration of a general function as well as test on the algebraic degree of precision of the rule.
» Source:
 Paper: Polynomial approximation and quadrature on geographic rectangles
 New version: [MATLAB CODES (zip file)]
 Old version: [MATLAB CODES (zip file), interpolation], [MATLAB CODES (zip file), cubature]
Incurvpolygon_cheb: indomain routine on bivariate Jordan domains whose boundary is defined by chebfuns. The files are stored in the compressed folder, that contains:
» incurvpolygon_cheb.m: it is an indomain routine on domains defined whose boundary is defined by chebfuns;
» in the folder there is a demo demo_incurvpolygon_cheb.m, that tests the provided software.
» Source:
 Last Version: [INCURVPOLYGON_CHEB_2020.zip]
» Last update: October 10, 2020.
ChebfunGauss: a Matlab code for cubature on Jordan bivariate domains defined analytically and approximated by Chebfuns. The files are stored in the compressed folder, that contains:
» chebcub_2019.m: it is a more stable version of the previous software and quickly produces a rule with many points, of the choosen degree of precision;
» chebfuncub_compression.m: by this routine one can compress the previous rule to one with the same degree of precision but fewer nodes; first it tries to compute one with internal nodes and positive weights, then one with internal nodes and possible negative weights, then one with possible external nodes and positive weights and finally one with possible external nodes and possible negative weights;
» chebcub_2020.m: it is a version that produces a rule with few points, of the choosen degree of precision (the rule has internal nodes and usually positive weights);
» incurvpolygon_cheb.m: it is an indomain routine on bivariate Jordan domains defined whose boundary is defined by chebfuns;
» in the folder there are several demo,
 demo_2019.m,
 demo_2020.m,
 demo_random_polynomials.m,
 demo_19vs20.m,
 demo_incurvpolygon_cheb.m,
» Source:
 New Version: [CHEBFUNGAUSS_2020.zip]
 Old Version: [CHEBFUNGAUSS_2011.zip]
» Last update: October 10, 2020.
In this software, we define a Matlab code for establishing numerically if a point is inside or on the boundary of a splinecurvilinear polygon (the so called "in domain" algorithms). The main routine is incurvpolygon.m. Several demos are available, that show how to use incurvpolygon.m.
» Paper: Tchakalofflike cubature rules on spline curvilinear polygons with M. Vianello.
» Source: [.zip],
» First Version: April 2019, Last update: September 29, 2020.
Fast Matlab codes for computing algebraic cubature rules on splinecurvilinear polygons. In general the cubature formula may have points outside the domain as well as negative weights.
The main routine is the m. file splinegauss_2020.m that performs cubature over domains with spline curvilinear boundaries. In case one wants to recover rules with less points (possibly with points in the domain and positive weights) one can try to achieve such rule by the routine splinegauss_compression.m.
Several demos are available, that show how to use splinegauss_2020.m and splinegauss_compression.m to produce cubature rules over splinecurvilinear polygons.
» Paper: GaussGreen cubature and moment computation over arbitrary geometries, with M. Vianello.
» Source: [.zip],
» First Version: March 2009, Last update: September 20, 2020.
Object: this software computes algebraic cubature rules with fixed degree of precision over splinecurvilinear polygons. It includes an indomain routine incurvpolygon.m that determines if a point is inside one of such regions.
The cubature formula has all points inside the domain as well as positive weights.
» Paper: Tchakalofflike cubature rules on spline curvilinear polygons with M. Vianello.
» Source: [.zip],
» First Version: May 2020, Last update: May 2020.
Object: this software computes algebraic cubature rules with fixed degree of precision over general polygons (convex or not convex, connected or disconnected, simply or not simply connected). It needs Matlabbuilt in polyshape environment.
Applications to optics are given.
» Paper: Compressed cubature over polygons with applications to optical design
» Source: [.zip]
» Last update: May 12, 2019.
Object: this software computes cubature rules over the sphere, via Radial Basis Functions and Spherical Radial Basis Functions. We point out that as described in demoRBFweights.m and demoSRBFweights.m , cubature weights are obtained, without the need of the RBF interpolant (though via moments and transpose of Vandermonde matrix).
» Paper: Integration by RBF over the sphere
» Source: [.zip],
» First Version: May 2005, Last update: September 26, 2019.
Object: this software computes cubature rules over disks and annular sectors, via Radial Basis Functions. We point out that as described in demoRBFweights.m, cubature weights are obtained, without the need of the RBF interpolant (though via moments and transpose of Vandermonde matrix).
» Paper: Meshless cubature over the disk by ThinPlates Splines
» Source: [.zip],
» Old sources: [GreenDisk_v1_0.zip], [GreenDisk_v1_0a.zip]
» First Version: 2008, Last update: September 24, 2019.
Object: this software computes cubature rules over rectangles, via Radial Basis Functions. The first .zip file considers RBF with the same scale for all the centers, the second zip file manages the variable scale case. We point out that as described in demo_2019_weights.m, cubature weights can be obtained, without the need of the RBF interpolant.
» Paper: Numerical cubature on scattered datas by Radial Basis Functions
» Source: [.zip], [.zip]
» First Version: May 2004, Last update: September 23, 2019.
Object: this software computes cubature rules over polygons (convex or not convex), via Radial Basis Functions (Thin Plate Splines)
» Paper: Meshless cubature by Green's formula.
» Source: [.zip]
» First Version: May 2006, Last update: September 11, 2019.
» Object: The MULTIVOP_220816.zip suite allows to compute hyperinterpolants over general regions. Here we show examples on some circular regions or polygons. The more important routine is multivop.m (see the paper http://www.math.unipd.it/~marcov/pdf/multivop.pdf) that allows the numerical computation of orthogonal polynomials over general regions.
» Source: Matlab code for Gausslike cubature over polygons [MULTIVOP_220816]
» Last update: August 25, 2016.
» Object: The routine trigauss.m computes a quadrature rule over an interval, exact for trigonometric polynomial degree N. Several versions, including the GaussKronrod version (it is not known if they always exist!), are available.
» Source:
 New version: [MATLAB CODES (zip file)]
 Old version: [ZIP] [MATLAB CODES (zip file), cubature]
» Object: Software for 1D trigonometric hyperinterpolation and hyperinterpolation over spherical rectangles. HYPERTRIG is based on trigonometric tensorial hyperinterpolation, while HYPERPOL consists in polynomial hyperinterpolation over spherical rectangles (of total degree). For details, see the paper G. Da Fies, A. Sommariva and M. Vianello, Subperiodic trigonometric hyperinterpolation.
» Source:
 HYPERTRIG: [MATLAB CODES (zip file)]
 HYPERPOL: [MATLAB CODES (zip file)]
» Object: Demo of least squares on a 2D mesh and least squares on a compressed mesh. Examples on union of disks and polygons. For details, see the paper F. Piazzon, A. Sommariva and M. Vianello, CaratheodoryTchakaloff Subsampling.
» Source:
 CATCH: [MATLAB CODES (zip file)]
» Object: Computation of optimal meshes on sphere, ball and torus. For details, see the paper A. Sommariva and M. Vianello, Discrete norming inequalities on sections of sphere, ball and torus.
» Source:
 Actual version: [MATLAB CODES (zip file)]
» Object: Computation of nested cubature rules on polygons, from bivariate data. For details, see the paper A. Sommariva and M. Vianello, Nearly optimal nested sensors location for polynomial regression on complex geometriess.
» Source:
 Actual version: [MATLAB CODES (zip file)]
Matlab code for cubature over a square [Padua_CC.zip] (using non tensorial Padua and MorrowPatterson Xu points). The main routine is the m. file main.m that performs cubature over a square using different formulas. All numerical experiments have been tested on Intel Centrino Duo T2400, with Windows XP, Matlab 6.1.0.450 Release 12.1 and GNU Octave 2.1.73. [Last update: October 09, 2007]
Some routines that can be used to make experiments with WAMs can be found in the following compressed files:
 [WAM_2D_280210.zip]: a complete version that works on several bivariate domains, not easily adaptable to add own WAMs but right for experiments on general 2D domains.
 [WAM_2De_010310.zip]: a simple version that does not work on many bivariate domains, but that is easily adaptable to add 2D WAMs.
 [WAM_3D_010310.zip]: a simple version that does not work on many trivariate domains, but that is easily adaptable to add 3D WAMs.
Old versions of our software
ChebfunGauss: a Matlab code for GaussGreen cubature by the Chebfun package: Matlab code that uses a suitable version of Splinegauss for bivariate domains defined analytically and approximated by Chebfuns. The files are stored in the compressed folder [CHEBFUNGAUSS_2017.zip]. For a demo use the file demo.m, for plotting cubature points plot_pts.m.
» Source:
 New Version: [CHEBFUNGAUSS_2017.zip]
 Old Version: [CHEBFUNGAUSS_2011.zip]
» Last update: November 26, 2017.
» Object: The polygauss.m routine allows the computation of cubature rules with a certain degree of exactness on a polygon (without selfintersections). The new routine works via quadrangles panelling or triangularization. Some new demos show its usage. We point out that these rules can be compressed, providing a rule with less nodes/weights but the same algebraic degree of exactness (see comprexcub.m).
» Source:
 New version: [POLYGAUSS_230816.zip]
 Old version: [POLYGAUSS_2013_300413.zip]
Matlab code for Gausslike cubature over polygons [POLYGAUSS_2013_300413.zip]
Previous version: Matlab code for Gausslike cubature over polygons [GAUSSCUB_2013.zip]. The main routine is the m. file polygauss.m. As demo, please use demo_gausscub.m. A different version, that uses less points but is more time expensive is polygaussj.m. We point out that the routines work in the GNU Octave version 2.1.73 (i686pccygwin) environment. For some numerical experiments in Matlab/Octave see [readme_polygauss.pdf].
Matlab code for Gausslike cubature over spline curvilinear polygons [SPLINEGAUSS_2009.zip]. The main routine is the m. file splinegauss_2009b that performs cubature over domains with spline curvilinear boundaries.. As demo, please use demo.m for computing cubature over spline curvilinear polygons. In addition, try demo_splinegauss_moments.m for tests on computing moments w.r.t. some specific bases on such domains. All numerical experiments have been done on MAC Book, with MAC OS X, Matlab 7.6.0.324 Release 2008a. [Latest update: November 19, 2009].
If you are interested in this software, see the more recent routine in SPLINEGAUSS_2020.zip. [Last update: March 27, 2009]
[POLYGINT_010411.zip] contains several Matlab files for cubature/interpolation over polygons based on AFP (Approximate Fekete Points) and DLP (Discrete Leja Points). The zip file contains also Matlab routines for a minimal triangulation of a polygon and a quadrangulation of a polygon using few quadrangles and triangles. [Last Update: April 01, 2011]
LEBFEK: Matlab codes and data sets for bivariate Lebesgue and Fekete interpolation.
In M. Briani, A. Sommariva, M. Vianello, Computing Fekete and Lebesgue points: simplex, square, disk we have described some algorithms for computing (quasi)Lebesgue and (quasi)Fekete points on the unit simplex, a square and on the unit disk. The respective codes and sets for these domains can be found in the links below. [Last Update: February 14, 2011]
Computation of (almost)minimal rules on the square.
Matlab codes for computing (almost)minimal cubature rules on the square. [Last Update: December 11, 2011]
Gaussian Rules for Symmetric weight functions.
Matlab codes for computing Gaussian Rules for Symmetric weight functions. [Last Update: July 27, 2012]
Matlab codes for computing Fejer and ClenshawCurtis rules for general weight functions. [Last Update: July 27, 2012]
Matlab codes for computing trigonometric quadrature rules.
Matlab codes for computing trigonometric quadrature rules. A comparison. [Last Update: February 27, 2013]
Matlab codes for computing good interpolation points or quadrature rules on geographic subregions of the sphere. [Last Update: November 20, 2013]