-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning #8
Conversation
src/Harmony.cpp
Outdated
assert(i < (result.size() - 1) && "Index must be smaller than number of columns"); | ||
//result.fill(2); //default is 2 | ||
for (int i = 0; i < col_idx.length(); ++i) { | ||
assert( 0 < col_idx[i] && col_idx[i] <= (result.size()) && "Index must be smaller than number of columns"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lỗi của anh. Nên throw exception ra chứ không nên assert, ngó qua bên API của anh Hoà nhé.
src/Harmony.cpp
Outdated
for (c_it = mtx.begin_col(i); c_it != mtx.end_col(i); ++c_it) { | ||
if (cluster[i] != cid) | ||
continue; | ||
assert(bin_cnt > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
như trên
src/Harmony.cpp
Outdated
//res[i].first += count[i][j].first * (prob[j]); | ||
//res[i].second += count[i][j].second * (prob[j]); | ||
if (cnt_both >= thres) { | ||
std::get<0>(res[i]) += HarmonicMean((double)cnt_in/total_in, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dùng ngoặc vuông cho index thứ hai luôn đươc không em?
src/Harmony.cpp
Outdated
for (int i = 0; i < mtx.n_cols; ++i) | ||
if (cluster[i] == cid) | ||
++total_in; | ||
for (int i = 0; i < mtx.n_cols; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chỗ này total_in bằng với col_idx.size() mà em.
(cherry picked from commit 05d4ac4ec9f959de500fd1126b78ef5d25a833b3)
(cherry picked from commit 69770a6a0856304a6a035b357511a4b076ab1a68)
No description provided.