ENH: Improve cryptic error messages for invalid FFT sizes

fft([]) used to produce "error: (n>0&&n<=size(x)) failed for 1st keyword n: zrfft:n=0".  Now it says "ValueError: Invalid number of FFT data points (0) specified."

BUG: Also fix my previous error message for fftn that would raise TypeError if s were a tuple.
TST: Add tests for invalid fft sizes
DEP: stats: Deprecate randwppf and randwcdf
DEP: stats: use np.deprecate to emit a warning
Fix small issues and improve formatting in optimize tutorial
Add Result class to optimize API docs
implemented choice of cuts in Legendre function P
Merge remote-tracking branch 'upstream/master' into clpmn
fixing signs in the derivative of LegendreP
DOC: optimize: Jacobian vs. gradient

Use the more common (at least where I come from) term "gradient" in
favor of "Jacobian" in the optimize.minimize docstring. The two are
synonymous here, since minimize only does scalar optimization.
hyp1f1: evaluate ratio of gammas via log(gamma)
BUG: make ndimage.label properly merge adjacent objects (fixes #3025)

ndimage.label() uses a table of label values that should be merged in
a postprocess.  The logic updating this table was faulty.  In
particular, if objects A and B were to be marked for mergin, having
already been marked to merge to C and D, respectively, the implied
merge of C and D was not being inferred.
ENH: linalg: Add a function to compute the DFT matrix.
BUG: stats.entropy broken (issue #3030)

stats.entropy will fail when calculate relative entropy of arrays have
ndim > 1. (issue #3030)
DOC:Add freqz magnitude plotting example

Mention a callable that produces the expected plot
assign -inf to vec after call to xlogy
pep8 fix
Merge pull request #3015 from gertingold/clpmn

ENH: special: choice of cuts in Legendre P function
set the term to be 0 when p[k]=q[k]=0
Merge pull request #3041 from richardtsai/fix_relative_entropy_ndim

BUG: stats.entropy broken (issue #3030)