Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7449a3a

Browse files
author
Jonathan Chang
committed
Initial commit of the topics code.
1 parent 67ff67e commit 7449a3a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

MatrixBackedTopicCounts.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class MatrixBackedTopicCounts : public TopicCounts {
2+
Rcpp::Matrix<INTSXP> topic_word_counts_;
3+
Rcpp::Vector<INTSXP> topic_counts_;
4+
public:
5+
virtual int getTopicWordCount(const int topic, const int word) const {
6+
return topic_word_counts_(topic, word);
7+
}
8+
9+
virtual int getTopicCount(const int topic) const {
10+
return topic_counts_[topic];
11+
}
12+
13+
virtual void update(const int topic, const int word, const int count) {
14+
15+
}
16+
};

TopicCounts.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class TopicCounts {
2+
public:
3+
virtual int getTopicWordCount(const int topic, const int word) const = 0;
4+
virtual int getTopicCount(const int topic) const = 0;
5+
virtual void update(const int topic, const int word, const int count) = 0;
6+
};

0 commit comments

Comments
 (0)