def calcDocTopicCount_c(
activeDocs, docIndices, word_count,
Prior, Lik,
sumR=None, DocTopicCount=None):
if not doUseLib:
raise NotImplementedError('Library not found. Please recompile.')
A = activeDocs.size
D, K = Prior.shape
N, K2 = Lik.shape
assert K == K2
if sumR is None:
sumR = np.zeros(N)
if DocTopicCount is None:
print 'HERE!!'
DocTopicCount = np.zeros((D, K), order='F')
if not np.isfortran(DocTopicCount):
raise NotImplementedError('NEED FORTRAN ORDER')
lib.CalcDocTopicCount(N, D, K, A,
activeDocs, docIndices,
word_count, Prior, Lik,
sumR, DocTopicCount)
return sumR, DocTopicCount
评论列表
文章目录