diff --git a/CppRun/calc_entropy.cpp b/CppRun/calc_entropy.cpp index 4e507c6..ded1596 100644 --- a/CppRun/calc_entropy.cpp +++ b/CppRun/calc_entropy.cpp @@ -139,12 +139,12 @@ inline int Get1DIndex(int colNum, int row, int col) { } /* 处理一个知识颗粒 */ -struct ThreadParam { // 线程参数 +struct ThreadParamEntropy { // 线程参数 fs::path matFilePath; fs::path outFilePath; vector >* pvusWord; }; -void ThreadProcessData(ThreadParam& param) { +void ThreadProcessEntropy(ThreadParamEntropy& param) { const fs::path& matFilePath = param.matFilePath; const fs::path& outFilePath = param.outFilePath; vector >& vusWord = *param.pvusWord; @@ -309,7 +309,7 @@ void CalcEntropy(int argc, const char** argv) { FOREACH_PARTICLE_END // 遍历每个知识颗粒,逐一进行处理 - vector vTP; + vector vTP; for (int round = 0; round < 1; ++round) { // 测试用 int i = 0; FOREACH_PARTICLE_START @@ -319,7 +319,7 @@ void CalcEntropy(int argc, const char** argv) { i++; FOREACH_PARTICLE_END } - kt_for(numThread, ThreadProcessData, vTP); + kt_for(numThread, ThreadProcessEntropy, vTP); // synchronize //thPool.~ThreadPool(); diff --git a/GMM/main.cpp b/GMM/main.cpp index cd93d62..4f5b4e2 100644 --- a/GMM/main.cpp +++ b/GMM/main.cpp @@ -141,12 +141,12 @@ double CorrelationDistance(vector& vX, vector& vY) { } /* 处理一个知识颗粒 */ -struct ThreadParam { +struct ThreadParamKP { fs::path matFilePath; fs::path outFilePath; }; //void ThreadProcessData(vector& vTP, long idx, int tid) { -void ThreadProcessData(ThreadParam& param) { +void ThreadProcessKP(ThreadParamKP& param) { //const ThreadParam& param = vTP[idx]; const fs::path& matFilePath = param.matFilePath; const fs::path& outFilePath = param.outFilePath; @@ -198,7 +198,7 @@ int main(int argc, const char** argv) { //ThreadPool thPool(numThread); clock_t begin, finish; begin = clock(); - vector vTP; + vector vTP; /* 遍历所有的知识颗粒目录,逐一进行处理 */ for (auto& childDir : fs::directory_iterator(parrentDir)) { fs::path outFilePath = childDir / outFileName; @@ -212,7 +212,7 @@ int main(int argc, const char** argv) { } } } - kt_for(numThread, ThreadProcessData, vTP); + kt_for(numThread, ThreadProcessKP, vTP); //thPool.~ThreadPool(); finish = clock(); cout << "GMM Total time: " << (double)(finish - begin) / CLOCKS_PER_SEC << " s" << endl;