**************************************************************************** * * * SPEEDING UP THE LEGPTS-COMMAND IN CHEBFUN: * * * **************************************************************************** The following files are included: -alg1_leg4.cpp: the fast core-algorithm for the nodes and weights of the Gauss quadrature (by Glaser, Liu, Rohklin 2007) -legpts4.m: the Matlab file which calls the compiled version of the C++-source file -example.m: Example benchmarks between the CHEBFUN functions and legpts4 -speedinguplegpts.pdf: a short paper about speeding up the legpts-command in CHEBFUN **************************************************************************** Installation: -copy alg1_leg4.cpp and legpts4.m in a directory of your choice. -open Matlab and change to the directory path containing these files (optionally you can add it to the search path of Matlab) -setup MEX by typing the following into Matlab's cLI: >> mex -setup -choose a suitable compiler (if the list is empty, install a compatible one). you'll find more infos in the product support section on mathworks.com -compile the C++-code by typing: >> mex alg1_leg4.cpp -after successfully compiling you can use the new algorithm like the old one (using 'legpts4' instead of 'legpts') **************************************************************************** Example calls: This will return the 500 nodes and weights of the Gauss quadrature: >> [nodes weights] = legpts4(500); You can also choose the Golub&Welsch algorithm (based on solving the eigenvalue problem) by adding 'GW' to the arguments: >> [nodes weights] = legpts4(10,'GW'); but be carful: only for small n the computing time is reasonable... **************************************************************************** License: Free to use but WITHOUT ANY WARRANTY Lukas Fath student @ KIT, Germany, 2012