numpy/numpy — pull request #3999 by WarrenWeckesser (2013-11-02 17:01:10+00:00)
Title: ENH: lib: Rewrite vander

This PR improves the speed of `vander`, and adds an option to specify the order (increasing or decreasing) of the powers of the columns.

Before:

```
In [1]: x = np.arange(10)

In [2]: %timeit vander(x)
10000 loops, best of 3: 38.3 µs per loop
```

After:

```
In [1]: x = np.arange(10)

In [2]: %timeit vander(x)
100000 loops, best of 3: 12.6 µs per loop
```

`order` option:

```
In [3]: vander([2, 3, 4], N=4)
Out[3]:
array([[ 8, 4, 2, 1],
[27, 9, 3, 1],
[64, 16, 4, 1]])

In [4]: vander([2, 3, 4], N=4, order='increasing')
Out[4]:
array([[ 1, 2, 4, 8],
[ 1, 3, 9, 27],
[ 1, 4, 16, 64]])
```
Note that the "increasing" option is probably the more common convention; see, for example, http://en.wikipedia.org/wiki/Vandermonde_matrix and http://mathworld.wolfram.com/VandermondeMatrix.html