[Numpy-svn] [numpy/numpy] 0739b6: BUG: Fix failure to return monic polynomials from ...

GitHub noreply@github....
Wed Jul 3 06:12:38 CDT 2013


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 0739b6b0379deecac18811af27966d4515c2ff7c
      https://github.com/numpy/numpy/commit/0739b6b0379deecac18811af27966d4515c2ff7c
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2013-07-02 (Tue, 02 Jul 2013)

  Changed paths:
    M numpy/polynomial/polytemplate.py
    M numpy/polynomial/tests/test_classes.py

  Log Message:
  -----------
  BUG: Fix failure to return monic polynomials from roots.

This bug affected the various polynomial class methods fromroots due to
the ability to specify both window and domain. In that circumstance the
roots are mapped from the domain to the window by the substitution
`x = off + scl*x`. The polynomial that was being generated was monic in
the window before substitution, but if scl was not one it was not monic
considered as a function of the variable x in the domain. The fix is to
divide the generated coefficients by `scl ** deg` so that the scaling of
the highest degree term after substitution is canceled.

It might be better to make the scaling optional in the future, but this
fix makes the result match the documentation.

Closes #3467.


  Commit: 79188b21dd85e4115195971522be91a2fcb1a9d2
      https://github.com/numpy/numpy/commit/79188b21dd85e4115195971522be91a2fcb1a9d2
  Author: njsmith <njs@pobox.com>
  Date:   2013-07-03 (Wed, 03 Jul 2013)

  Changed paths:
    M numpy/polynomial/polytemplate.py
    M numpy/polynomial/tests/test_classes.py

  Log Message:
  -----------
  Merge pull request #3495 from charris/make-fromroots-return-monic

BUG: Fix failure to return monic polynomials from roots.


Compare: https://github.com/numpy/numpy/compare/966fb719b711...79188b21dd85


More information about the Numpy-svn mailing list