scipy/scipy — pull request #2428 by andyfaff (2013-04-28 23:03:03+00:00)
Title: Adding startiter keyword to scipy.integrate.quadrature

For some numerical integrations it is known that a minimum number of Gaussian quadrature points is required. Adding the startiter keyword to the scipy.integrate.quadrature function will allow the starting order of the Gaussian quadrature to be specified. This will save the lower orders being evaluated unnecessarily.
For example, one may know that the integration may require between 14 and 20 points. Let us take the worst case scenario of 20 points. If you start from 1 point the function to be integrated will have to be called 20 times (assuming that it can be vectorized), but the total number of evaluations within the function will be 210. This number is the sum of the arithmetic sequence - order 1 requires 1 evaluation, order 2 requires 2 evaluations, etc.
On the other hand if you start from 14 then the total number of evaluations within the function will be 119. This is a computational saving of 43%, significant if the evaluated function is somewhat expensive.