numba support for numpy.roots

2 views
Skip to first unread message

Chan Y. Park

unread,
Aug 24, 2016, 3:50:25 PM8/24/16
to Numba Public Discussion - Public
Hi,

I wonder if numba supports numpy.roots or any other root-finding method. What I want to do is finding a root of a complex-valued polynomial p(x) near a starting point x_0. If numpy.roots are supported then it's even better, but something like Newton's method would be good enough for now.

Thanks,
Chan

stuart

unread,
Aug 26, 2016, 4:29:09 AM8/26/16
to Numba Public Discussion - Public
Hi,

Thanks for your enquiry. Unfortunately, at present, numba does not support `numpy.roots` out of the box, I've added an issue for the request https://github.com/numba/numba/issues/2062.

The dependencies for implementing this function are present, so you could just create a local implementation for now. The
basic method is to simply create the companion matrix of the polynomial and then compute its eigenvalues.

Hope this helps,

--
stuart

Chan Y. Park

unread,
Aug 26, 2016, 12:07:06 PM8/26/16
to Numba Public Discussion - Public, sarch...@continuum.io
Thank you for the help!

stuart

unread,
Sep 30, 2016, 8:27:45 AM9/30/16
to Numba Public Discussion - Public, sarch...@continuum.io
Hi,

Just to let you know, the next release of Numba will have support for `numpy.roots` https://github.com/numba/numba/pull/2135

Thanks,

--
stuart

phyg...@gmail.com

unread,
Sep 30, 2016, 11:55:54 AM9/30/16
to Numba Public Discussion - Public, sarch...@continuum.io
Great, thanks!
Reply all
Reply to author
Forward
0 new messages