def recursive_row(self, new_row=''):
stir = np.load('stirling.npy')
J = stir.shape[0]
K = stir.shape[1]
x = 0
while stir.shape[0] != stir.shape[1]:
m = K + x
new_c = np.ones((J, 1)) * np.inf
stir = np.hstack((stir, new_c))
print(m)
for n in range(K,J):
if m > n:
continue
elif m == n:
stir[n, m] = 0
else:
stir[n,m] = logsumexp( [ stir[n-1, m-1] , np.log(n-1) + stir[n-1, m] ] )
x += 1
#np.save('stirling.npy', stir)
#np.load('stirling.npy',)
return stir
评论列表
文章目录