diff --git a/CommonLib/CommonLib.vcxproj b/CommonLib/CommonLib.vcxproj index 4faace8..321cf13 100644 --- a/CommonLib/CommonLib.vcxproj +++ b/CommonLib/CommonLib.vcxproj @@ -113,6 +113,7 @@ + diff --git a/CommonLib/CommonLib.vcxproj.filters b/CommonLib/CommonLib.vcxproj.filters index 907f8e8..20334ba 100644 --- a/CommonLib/CommonLib.vcxproj.filters +++ b/CommonLib/CommonLib.vcxproj.filters @@ -25,6 +25,9 @@ Header Files + + Header Files + diff --git a/CommonLib/matlab_io.cpp b/CommonLib/matlab_io.cpp index 955713d..4831c3b 100644 --- a/CommonLib/matlab_io.cpp +++ b/CommonLib/matlab_io.cpp @@ -44,6 +44,8 @@ bool ReadMtxString(const string& filePath, const string& mtxName, vStr[i * colNum + j] = strBuf; } } + *pRowNum = rowNum; + *pColNum = colNum; return true; } diff --git a/GMM/thread_pool.h b/CommonLib/thread_pool.h similarity index 100% rename from GMM/thread_pool.h rename to CommonLib/thread_pool.h diff --git a/CppRun/CppRun.vcxproj b/CppRun/CppRun.vcxproj index 7daefea..63d4327 100644 --- a/CppRun/CppRun.vcxproj +++ b/CppRun/CppRun.vcxproj @@ -120,6 +120,7 @@ + Create diff --git a/CppRun/CppRun.vcxproj.filters b/CppRun/CppRun.vcxproj.filters index 5387728..e5360c6 100644 --- a/CppRun/CppRun.vcxproj.filters +++ b/CppRun/CppRun.vcxproj.filters @@ -26,6 +26,9 @@ Source Files + + Source Files + diff --git a/CppRun/calc_entropy.cpp b/CppRun/calc_entropy.cpp new file mode 100644 index 0000000..404c3e9 --- /dev/null +++ b/CppRun/calc_entropy.cpp @@ -0,0 +1,301 @@ +/********************************************************************************************* + Description: 检查每个文献的摘要部分是否包含设定的高频词汇,并用这些高频词汇计算摘要的信息熵 + + Copyright : All right reserved by ZheYuan.BJ + + Author : Zhang Zhonghai + Date : 2023/09/20 +***********************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#include +#define F_OK 0 +#else +#include +#endif +#include +#include "common.h" +#include "CommonLib/thread_pool.h" +#include "CommonLib/matlab_io.h" +using namespace std; +using std::cout; +using std::vector; +namespace fs = std::filesystem; +#include "common.h" +#include "CommonLib/matlab_io.h" +using namespace std; + +// 遍历知识颗粒,循环处理 +#define FOREACH_PARTICLE_START \ + for (auto &childDir : fs::directory_iterator(parrentDir)) { \ + for (auto &file : fs::directory_iterator(childDir)) { \ + const string &fileName = file.path().filename().string(); \ + auto rPos = fileName.rfind(wordMatSuffix); \ + if (rPos != string::npos && fileName.size() - rPos == wordMatSuffix.size()) { + +#define FOREACH_PARTICLE_END \ + } \ + } \ + } + +/* 读取二层cell包裹的字符串,和数值,ds,fr */ +#define OUTER_FOR_BEGIN \ + rowNum = (int)mxGetM(pMxArray); \ + colNum = (int)mxGetN(pMxArray); \ + for (int i = 0; i < rowNum; ++i) { \ + for (int j = 0; j < colNum; ++j) { \ + pCell = mxGetCell(pMxArray, j * rowNum + i); \ + int childRowNum = (int)mxGetM(pCell); \ + int childColNum = (int)mxGetN(pCell); + +#define OUTER_FOR_END \ + } \ + } \ + mxDestroyArray(pMxArray); + +#define INNTER_FOR_BEGIN \ + for (int ii = 0; ii < childRowNum; ii++) { \ + for (int jj = 0; jj < childColNum; jj++) { \ + mxArray *pChildCell = mxGetCell(pCell, jj * childRowNum + ii); +#define INNTER_FOR_END \ + } \ + } +// 将matlab存储方式转换成c存储方式 +#define TRANS_ROW_COL(dst, src, rowNum, colNum) \ + for (int rowI = 0; rowI < rowNum; ++rowI) { \ + for (int colJ = 0; colJ < colNum; ++colJ) { \ + dst[rowI * colNum + colJ] = src[colJ * rowNum + rowI]; \ + } \ + } + +// 读取ds和fr信息 +bool ReadInfoFromMat(const string & filePath, vector >&vvDs, vector >&vvFr) { + + MATFile* pMatFile = nullptr; + mxArray* pMxArray = nullptr; + mxArray* pCell = nullptr; + int rowNum, colNum; + char strBuf[STRING_BUF_SIZE]; + const string& parrentName = "G"; + const string& firstChildName = "ds"; + const string& secondChildName = "fr"; + + pMatFile = matOpen(filePath.c_str(), "r"); //打开.mat文件 + if (pMatFile == nullptr) { + cout << "filePath is error!" << endl; + return false; + } + mxArray* pMxG = matGetVariable(pMatFile, parrentName.c_str()); //获取G变量 + + // 读取ds字符串 + pMxArray = mxGetField(pMxG, 0, firstChildName.c_str()); // ds + OUTER_FOR_BEGIN + // cout << childRowNum << '\t' << childColNum << endl; + vvDs.push_back(vector()); + vvDs.back().resize(childRowNum * childColNum); + INNTER_FOR_BEGIN + if (mxGetString(pChildCell, strBuf, STRING_BUF_SIZE) != 0) { + cout << "String is too large to fit in the buffer! " << i + 1 << '\t' << j + 1 << endl; + return false; + } + vvDs.back()[ii * childColNum + jj] = strBuf; + auto& lastStr = vvDs.back()[ii * childColNum + jj]; + transform(lastStr.begin(), lastStr.end(), lastStr.begin(), ::toupper); // 转成大写 + INNTER_FOR_END + OUTER_FOR_END + + // 读取fr数值 + pMxArray = mxGetField(pMxG, 0, secondChildName.c_str()); // fr + OUTER_FOR_BEGIN + vvFr.push_back(vector()); + vvFr.back().resize(childRowNum * childColNum); + double *pVal = (double*)mxGetData(pCell); //获取指针 + TRANS_ROW_COL(vvFr.back(), pVal, childRowNum, childColNum); // 行列存储方式转换 + OUTER_FOR_END + + // 没考虑完全哪些数据需要mxDestroyArray,可能会有内存泄漏 + return true; +} + +/* 处理一个知识颗粒 */ +struct EntropyResult { // 存放每个文献对应的结果 + vector > vvEntropy; // 信息熵 + vector > vvTransEntropy; // 转置的信息熵 +}; +struct ThreadParam { // 线程参数 + fs::path matFilePath; + vector >* pvusWord; + EntropyResult* pRes; +}; +void ThreadProcessData(const ThreadParam& param) { + const fs::path& matFilePath = param.matFilePath; + EntropyResult& res = *param.pRes; + vector >& vusWord = *param.pvusWord; + + // 存放结果 + auto& hs = res.vvEntropy; + auto& hr = res.vvTransEntropy; + + vector > vvDs; // 每个知识颗粒的ds矩阵(词汇矩阵) + vector > vvFr; // 词汇对应的频率 + + // cout << matFilePath.string() << endl; + // 读取G结构体中的ds和fr信息 + ReadInfoFromMat(matFilePath.string(), vvDs, vvFr); + // res.vvEntropy.push_back(vvFr[0]); + // cout << vvDs.size() << '\t' << vvDs[0].size() << endl; + const int numLiterature = vusWord.size(); // pubmed 文件中包含的文献数量 + const int numGroup = vvDs.size(); // ds包含的组数 + hs.resize(numGroup); + hr.resize(numLiterature); + for (int i = 0; i < numGroup; ++i) hs[i].resize(numLiterature); // resize会自动初始化 + for (int i = 0; i < numLiterature; ++i) hr[i].resize(numGroup); + for (int groupIdx = 0; groupIdx < vvDs.size(); ++groupIdx) { // 遍历知识颗粒中的每一组 + vector& vDs = vvDs[groupIdx]; // 这一组ds + vector& vFr = vvFr[groupIdx]; // frequency + const int numWord = vDs.size(); // 这一组数据中包含的单词数量 + vector > vX(numLiterature, vector(numWord, 0)); + // 检查知识颗粒中的词语是否出现在pubmed摘要的词语中 + for (int i= 0; i < numLiterature; ++i) { + for (int j = 0; j < numWord; ++j) { + if (vusWord[i].find(vDs[j]) != vusWord[i].end()) { // 这一组单词中的j索引位置的单词在第i个文献中出现过 + vX[i][j] = 1; + // 对每个知识颗粒每一组数据,计算信息熵 + hs[groupIdx][i] -= vFr[j] * log2(vFr[j]); + } + } + } + // cout << vX[0][0] << endl; + + + + for (int i = 0; i < numLiterature; ++i) { + + if (vX[groupIdx][i] == 1) { + + } + } + + // 找最高频词汇所在的索引位置 + } +} + +/* 程序入口 */ +void CalcEntropy(int argc, const char** argv) { + // argv + // 1. 知识颗粒的父目录名称 + // 2. 包含高频词汇信息的mat文件的后缀 + // 3. 包含处理后的pubmed文献信息的mat文件路径 + // 4. 存放输出结果的mat文件的后缀(每个知识颗粒目录中生成一个结果文件) + // 5. 线程数量(可选) + if (argc < 5) { + cout << "This program should take at least 4 arguments(1.parrent Dir; 2. mat file suffix; 3. pubmed mat file; 4. out mat filename; [5. thread number])!" << endl; + return; + } + clock_t begin, finish; + string parrentDir(argv[1]); // 知识颗粒的父目录名称 + string wordMatSuffix(argv[2]); // 高频词汇矩阵对应的mat文件的后缀名(可以是全文件名,可以是文件名后缀,必须保证唯一) + int numThread = 1; + if (argc >= 5) numThread = atoi(argv[5]); + if (numThread < 1) numThread = 1; + // cout << "thread num: " << numThread << endl; + + /* 读入处理后的pubmed文献信息的mat文件,只读入摘要信息,即变量abs1 */ + vector vAbstract; + int rowNum, colNum; + ReadMtxString(argv[3], "abs1", vAbstract, &rowNum, &colNum); + if (vAbstract.size() == 0) { // 摘要信息为空,出错 + cout << "PubMed Abstract info is null!" << endl; + return; + } + // 将摘要信息分割成一个一个的词汇 + begin = clock(); + unordered_set usWordChars; // 能组成单词的字符,要不要考虑数字?原版matlab是提取了数字的 + for (int i = 65; i <= 90; i++) usWordChars.insert(char(i)); // A - Z + for (int i = 97; i <= 122; i++) usWordChars.insert(char(i)); // a - z + vector > vvWordMtx(vAbstract.size()); // 初始大小为文章的个数 + vector > vusAbsWord(vAbstract.size()); // 将每篇文章摘要的单词放入hash表 + for (int i = 0; i < vAbstract.size(); i++) { + auto& strAbs = vAbstract[i]; + // 遍历摘要字符串的每一个字符,取出每一个单词 + vector& vWord = vvWordMtx[i]; + if (strAbs.size() == 0) continue; // 摘要信息为空,跳过(一般不会出现这个情况) + int wordStartPos = 0; + while (wordStartPos < strAbs.size() && usWordChars.find(strAbs[wordStartPos]) == usWordChars.end()) + wordStartPos++; + for (int curPos = wordStartPos + 1; curPos < strAbs.size(); ++curPos) { + if (usWordChars.find(strAbs[curPos]) == usWordChars.end()) { // 找到了分割符 + vWord.push_back(strAbs.substr(wordStartPos, curPos - wordStartPos)); + wordStartPos = curPos + 1; // 找下一个词语起始位置 + while (wordStartPos < strAbs.size() && usWordChars.find(strAbs[wordStartPos]) == usWordChars.end()) + wordStartPos++; + curPos = wordStartPos; // 循环会自动加1 + } + } + // 将处理摘要之后的每个词语放入hash表 + for (auto& word : vWord) { + string upWord(word); + transform(upWord.begin(), upWord.end(), upWord.begin(), ::toupper); + // cout << upWord << endl; + vusAbsWord[i].insert(upWord); + } + } + finish = clock(); + cout << "abstract time: " << (double)(finish - begin) / CLOCKS_PER_SEC << " s" << endl; + //auto & vTest = vvWordMtx[0]; + //cout << vTest.size() << endl; + //for (auto& str : vTest) cout << str << endl; + + + /* 遍历所有的知识颗粒目录,逐一进行处理 */ + begin = clock(); + // ThreadPool thPool(numThread); + ThreadPool thPool(24); + // 查看知识颗粒数量 + int numKnowledgeParticle = 0; + FOREACH_PARTICLE_START + numKnowledgeParticle++; + FOREACH_PARTICLE_END + + vector vEntropyResult(numKnowledgeParticle); // 存放所有结果 + // 遍历每个知识颗粒,逐一进行处理 + for (int round = 0; round < 1; ++round) { // 测试用 + int i = 0; + FOREACH_PARTICLE_START + ThreadParam tParam = { file, &vusAbsWord, &vEntropyResult[i] }; + thPool.enqueue(ThreadProcessData, tParam); + i++; + FOREACH_PARTICLE_END + } + + // synchronize + thPool.~ThreadPool(); + finish = clock(); + + cout << "thread pool time: " << (double)(finish - begin) / CLOCKS_PER_SEC << " s" << endl; + /* 合并处理结果 */ + //ofstream ofs("test_out.txt"); + //for (auto& item : vEntropyResult) { + // auto& vvEntropy = item.vvEntropy; + // auto& vVal = vvEntropy[0]; + // for (auto& val : vVal) ofs << val << ' '; + // ofs << endl; + //} + //ofs.close(); +} \ No newline at end of file diff --git a/CppRun/common.h b/CppRun/common.h index 3be7e19..55e314f 100644 --- a/CppRun/common.h +++ b/CppRun/common.h @@ -13,5 +13,7 @@ /* 澶勭悊pubmed txt鏂囦欢锛岀粨鏋滀繚瀛樺湪mat鏂囦欢涓 */ void ProcessPubmedTxt(int argc, const char** argv); +/* 鑾峰彇pubmed鏂囩尞涓憳瑕佹墍鍖呭惈鐨勯珮棰戣瘝姹囦俊鎭紝骞舵嵁姝よ绠椾俊鎭喌 */ +void CalcEntropy(int argc, const char** argv); #endif // !__COMMON_H \ No newline at end of file diff --git a/CppRun/main.cpp b/CppRun/main.cpp index 0e63f65..c4eeece 100644 --- a/CppRun/main.cpp +++ b/CppRun/main.cpp @@ -21,12 +21,13 @@ int main(int argc, const char** argv) { return 1; } - /* process pubmed txt file */ if (string(argv[1]) == "ProcessPubmedTxt") { + /* process pubmed txt file */ ProcessPubmedTxt(argc - 1, argv + 1); } - else if (string(argv[1]) == "ProcessPubmedTxt") { - + else if (string(argv[1]) == "CalcEntropy") { + /* 璁$畻淇℃伅鐔 */ + CalcEntropy(argc - 1, argv + 1); } finish = clock(); cout << argv[1] << " time: " << (double)(finish - begin) / CLOCKS_PER_SEC << " s" << endl; diff --git a/CppRun/process_pubmed_txt.cpp b/CppRun/process_pubmed_txt.cpp index a789e28..8eb630c 100644 --- a/CppRun/process_pubmed_txt.cpp +++ b/CppRun/process_pubmed_txt.cpp @@ -69,6 +69,8 @@ bool SavePubmed(const string& matPath, return true; } +// 鍛戒护琛屽弬鏁扮ず渚 +// ProcessPubmedTxt d:\Twirls\gat1\literatures\pubmed_tag.mat D:\Twirls\runtime\negatives\pubmed-multiplesc-set.txt d:\pubmed_txt.mat /* pubmed txt鏂囦欢涓寘鍚涓枃绔犵殑鎽樿淇℃伅锛屾瘡涓俊鎭渶鍓嶈竟鏈変竴涓猼ag锛屾瘡涓猼ag瀵瑰簲鐨勪俊鎭彲鑳芥湁涓琛岋紝涔熷彲鑳藉琛岋紝姣忎釜鏂囩珷涓棿鐢变竴涓┖琛岄殧寮 1. 璇诲彇棰勫厛鎻愬彇鐨刾ubmed tags, 骞跺皢tags涓殑'-'鍜' '瀛楃鍘绘帀锛屽彧鐣欎笅绾瓧绗︿覆鍋歵ag @@ -79,11 +81,14 @@ bool SavePubmed(const string& matPath, void ProcessPubmedTxt(int argc, const char** argv) { // argv 1.pubmed tag.mat鏂囦欢; 2.pubmed article.txt鏂囦欢; 3.pubmed out.mat杈撳嚭鏂囦欢 // - // cout << argc << '\t' << argv[1] << endl; + if (argc != 4) { + cout << "This program should take 3 arguments(1.pubmed tag.mat; 2. pubmed article.txt; 3. pubmed out.mat)!" << endl; + return; + } + int rowNum, colNum; vector vTg; vector vTgName; - // unordered_map > umTagVal; vector > vumPaperTagVal; unordered_map umFullTagToTag; // 瀹屾暣tag涓巘ag鐨勬槧灏勶紝濡傗淧MID- 鈥濓細鈥淧MID鈥 /* 璇诲彇pubmed tags */ @@ -91,7 +96,6 @@ void ProcessPubmedTxt(int argc, const char** argv) { /* 1. 鍘绘帀tags閲岀殑'-'鍜' '瀛楃锛屽緱鍒扮函鍑鐨則ag */ vTgName = vTg; for (int i = 0; i < vTg.size(); ++i) { - // cout << vTg[i] << '\t'; int pos = 0; for (int j = 0; j < vTg[i].size(); ++j) { if (vTg[i][j] != ' ' && vTg[i][j] != '-') { // 鍘绘帀tag涓殑绌烘牸鍜'-'瀛楃锛岀敓鎴恡ag name @@ -100,7 +104,6 @@ void ProcessPubmedTxt(int argc, const char** argv) { } vTgName[i].resize(pos); umFullTagToTag[vTg[i]] = vTgName[i]; - // cout << vTg[i].size() << '\t' << vTgName[i].size() << endl; } /* 2. 璇诲彇pubmed txt鏂囦欢锛屽厛璇诲叆鍚庡鐞 */ @@ -130,13 +133,10 @@ void ProcessPubmedTxt(int argc, const char** argv) { vLineTag.push_back(fullTag); curPos++; } - // cout << strLine << endl; } - // cout << vStrPubmedTxt.size() << endl; vPaperStartIdx.push_back(curPos); // 姣旀枃绔犲1锛屾渶鍚庝竴涓褰曠粨鏉熶綅缃 /* 澶勭悊姣忎竴绡囨枃绔 */ - ofstream testOfs("pubmed_test-1.txt"); for (int i = 0; i < vPaperStartIdx.size() - 1; ++i) { int startIdx = vPaperStartIdx[i]; int endIdx = vPaperStartIdx[i + 1]; @@ -191,17 +191,6 @@ void ProcessPubmedTxt(int argc, const char** argv) { abstractStr = (*itr)[titleTag] + " " + abstractStr; // 鍙兘浼氭湁鎬ц兘鎹熷け锛屼笉杩囧奖鍝嶄笉澶 } - //for (int tgIdx = 0; tgIdx < vTgName.size(); ++tgIdx) { - // for (int i = 0; i < vumPaperTagVal.size(); ++i) { - // testOfs << vumPaperTagVal[i][vTgName[tgIdx]] << endl; - // } - //} - for (int i = 0; i < vumPaperTagVal.size(); ++i) { - testOfs << vumPaperTagVal[i][abstractTag] << endl; - } - testOfs.close(); - // cout << "鏂囦欢涓暟锛" << vumPaperTagVal.size() << endl; - // for (auto num : vPaperStartIdx) cout << num << endl; ifsPubmedTxt.close(); /* 灏嗗鐞嗗悗鐨勬暟鎹啓鍏at鏂囦欢锛宮at涓殑鍙橀噺鍚嶇О鍒嗗埆涓篢x鍜宎bs1 */ diff --git a/CppRun/test_out-1.txt b/CppRun/test_out-1.txt new file mode 100644 index 0000000..d65d5df --- /dev/null +++ b/CppRun/test_out-1.txt @@ -0,0 +1,21 @@ +0.1 0.1 0.1 0.2 0.7 0.1 0.8 0.4 0.1 0.1 0.1 0.2 0.1 0.6 0.5 0.1 0.1 0.1 0.3 0.3 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.2 0.1 0.1 0.2 0.2 0.2 0.2 0.1 0.1 0.1 0.1 0.5 0.1 0.1 0.1 0.1 0.1 0.1 0.4 0.1 0.1 0.1 0.2 0.2 0.2 0.2 0.3 0.4 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.2 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.1 0.1 0.5 0.1 0.1 0.2 0.1 0.1 0.1 0.2 0.1 0.3 0.1 0.1 0.5 0.4 0.5 0.2 0.1 0.2 0.8 0.1 0.2 0.8 0.3 +0.1 0.1 0.1 0.9 0.7 0.1 0.1 0.4 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.1 0.1 0.1 0.1 0.1 0.1 0.7 0.1 0.1 0.1 0.2 0.1 0.1 +0.1 0.1 0.2 0.1 0.3 0.1 0.1 0.2 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.5 0.1 0.1 0.3 0.1 0.2 0.1 0.1 0.1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.1 0.1 0.1 0.2 0.2 0.3 0.1 0.2 0.1 0.1 0.2 0.8 0.3 0.2 0.1 0.1 0.2 0.1 0.2 0.2 0.3 0.1 0.2 0.1 0.1 0.3 0.1 0.2 0.2 0.2 0.2 0.4 0.2 0.5 0.1 0.1 0.1 0.2 0.1 0.9 0.1 0.3 0.4 0.1 0.1 0.2 0.1 0.1 0.8 0.4 0.1 0.1 0.2 0.3 0.9 +0.1 0.1 0.1 0.1 0.2 0.4 0.2 0.2 0.2 0.2 0.2 0.1 0.1 0.7 0.2 0.1 0.1 0.1 0.1 0.2 0.1 0.2 0.4 0.2 0.1 0.6 0.1 0.1 0.2 0.2 0.1 0.2 diff --git a/GMM/GMM.vcxproj b/GMM/GMM.vcxproj index 3dc996d..abfb3da 100644 --- a/GMM/GMM.vcxproj +++ b/GMM/GMM.vcxproj @@ -118,7 +118,6 @@ - diff --git a/GMM/GMM.vcxproj.filters b/GMM/GMM.vcxproj.filters index 49c0664..c29d2e2 100644 --- a/GMM/GMM.vcxproj.filters +++ b/GMM/GMM.vcxproj.filters @@ -21,9 +21,6 @@ Header Files - - Header Files - diff --git a/GMM/main.cpp b/GMM/main.cpp index 27576ec..4f254cf 100644 --- a/GMM/main.cpp +++ b/GMM/main.cpp @@ -30,7 +30,7 @@ #endif #include #include "gmm.h" -#include "thread_pool.h" +#include "CommonLib/thread_pool.h" #include "CommonLib/matlab_io.h" using namespace std; using std::cout; @@ -182,14 +182,17 @@ void ThreadProcessData(const ThreadParam& param) { /* 程序入口 */ int main(int argc, const char** argv) { - if (argc != 5) { - cout << "This program should take 4 arguments(1.parrent Dir; 2. mat file suffix; 3. out mat filename; 4. thread number)!" << endl; + if (argc < 4) { + cout << "This program take at least 3 arguments(1.parrent Dir; 2. mat file suffix; 3. out mat filename; [4. thread number])!" << endl; return 1; } string parrentDir(argv[1]); // 知识颗粒的父目录名称 string hsMatSuffix(argv[2]); // hs矩阵对应的mat文件的后缀名(可以是全文件名,可以是文件名后缀,必须保证唯一) fs::path outFileName(argv[3]); - ThreadPool thPool(8); + int numThread = 1; + if (argc >= 4) numThread = atoi(argv[4]); + if (numThread < 1) numThread = 1; + ThreadPool thPool(numThread); clock_t begin, finish; begin = clock();