Skip to content

Commit

Permalink
Replace roots module with scipy.special functions
Browse files Browse the repository at this point in the history
  • Loading branch information
amorison committed Feb 25, 2023
1 parent a65875e commit 19c9373
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 78 deletions.
7 changes: 3 additions & 4 deletions dmsuite/poly_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
import numpy as np
from numpy.typing import NDArray
from scipy.linalg import toeplitz

from .roots import herroots, lagroots
from scipy.special import roots_hermite, roots_laguerre


class DiffMatrices(ABC):
Expand Down Expand Up @@ -255,7 +254,7 @@ def max_order(self) -> int:

@cached_property
def nodes(self) -> NDArray:
return herroots(self.degree)
return roots_hermite(self.degree)[0]

@cached_property
def _dmat(self) -> GeneralPoly:
Expand Down Expand Up @@ -296,7 +295,7 @@ def max_order(self) -> int:
@cached_property
def nodes(self) -> NDArray:
nodes = np.zeros(self.degree + 1)
nodes[1:] = lagroots(self.degree)
nodes[1:] = roots_laguerre(self.degree)[0]
return nodes

@cached_property
Expand Down
44 changes: 0 additions & 44 deletions dmsuite/roots.py

This file was deleted.

Binary file removed tests/data/herroots10.npy
Binary file not shown.
Binary file removed tests/data/lagroots10.npy
Binary file not shown.
Binary file removed tests/data/legroots10.npy
Binary file not shown.
10 changes: 0 additions & 10 deletions tests/test_herroots.py

This file was deleted.

10 changes: 0 additions & 10 deletions tests/test_lagroots.py

This file was deleted.

10 changes: 0 additions & 10 deletions tests/test_legroots.py

This file was deleted.

0 comments on commit 19c9373

Please sign in to comment.