File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33"""
44
55from functools import lru_cache
6- from math import comb , factorial
6+ import math
77import warnings
88
99import numpy as np
@@ -22,7 +22,7 @@ def _get_coeff_matrix(n):
2222 coefficient.
2323 """
2424 def _comb (n , k ):
25- return np .vectorize (comb )(n , k )
25+ return np .vectorize (math . comb )(n , k )
2626
2727 j = np .arange (n + 1 )[:, None ]
2828 i = np .arange (n + 1 )[None , :] # _comb is non-zero for i <= j
@@ -211,8 +211,8 @@ def __init__(self, control_points):
211211 self ._cpoints = np .asarray (control_points )
212212 self ._N , self ._d = self ._cpoints .shape
213213 self ._orders = np .arange (self ._N )
214- coeff = [factorial (self ._N - 1 )
215- // (factorial (i ) * factorial (self ._N - 1 - i ))
214+ coeff = [math . factorial (self ._N - 1 )
215+ // (math . factorial (i ) * math . factorial (self ._N - 1 - i ))
216216 for i in range (self ._N )]
217217 self ._px = (self ._cpoints .T * coeff ).T
218218
You can’t perform that action at this time.
0 commit comments