Hi, I have submitted a PR (https://github.com/numpy/numpy/pull/4568) that speeds up `np.vander` by using accumulated multiplication instead of exponentiation to compute the Vandermonde matrix. For largish matrices the speed-ups can be quite dramatic, over an order of magnitude.
Julian has raised concerns on numerical stability and loss of precision, which don't seem to be all that relevant. Do speak up if you think otherwise. We are also discussing replacing a recently added kwarg, "order", which now accepts a string, either "increasing" or "decreasing", to indicate the ordering of the matrix columns. This was not present in 1.8, so can still be modified. The proposal is to replace it with a "reversed" boolean flag. Unfortunately, the return of np.vander in 1.8 and before is the opposite (i.e. its reversed) from the standard definition, which has powers increasing from left to right. So it is not clear what the reversed keyword should refer to: 1. If it refers to the standard definition, then it would default to False for backwards compatibility, but be consistent with the conventional definition. 2. If it refers to the existing behavior of numpy's vander, then it would default to True, and not be consistent with the conventional definition. I prefer option 1, but would like to hear other's opinions. Which could of course include naming the boolean flag more ingeniously, or keeping the string flag. If he's reading, I'd specially like to hear Warren Weckesser's thoughts, as he is the one who added the "order" kwarg. Jaime -- (\__/) ( O.o) ( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes de dominación mundial.
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion