Merge pull request #2 from fAndreuzzi/patch-1
Use `np.polynomial.chebyshev.chebroots` instead of `np.roots`
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
from mpmath import chebyt, chop, taylor
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
def chebyshev_roots(n):
|
def chebyshev_roots(n):
|
||||||
""" Return the roots of *n* Chebyshev polynomials (between [-1, 1]) """
|
""" Return the roots of *n* Chebyshev polynomials (between [-1, 1]) """
|
||||||
return np.roots(chop(taylor(lambda x: chebyt(n, x), 0, n))[::-1])
|
coefficents = np.zeros(n+1)
|
||||||
|
coefficents[-1] = 1
|
||||||
|
return np.polynomial.chebyshev.chebroots(coefficents)
|
||||||
|
|
||||||
|
|||||||
3
setup.py
3
setup.py
@@ -14,8 +14,7 @@ VERSION = meta['__version__']
|
|||||||
KEYWORDS = 'physics-informed neural-network'
|
KEYWORDS = 'physics-informed neural-network'
|
||||||
|
|
||||||
REQUIRED = [
|
REQUIRED = [
|
||||||
'future', 'numpy', 'matplotlib', 'torch', 'mpmath'
|
'future', 'numpy', 'matplotlib', 'torch'
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
EXTRAS = {
|
EXTRAS = {
|
||||||
|
|||||||
Reference in New Issue
Block a user