27 std::cout <<
"Terminating.\n";
41 std::ifstream* importFile;
53 std::ifstream* datasetFile;
55 std::ifstream newFile(filename);
57 datasetFile = &newFile;
68 auto start = std::chrono::high_resolution_clock::now();
70 std::vector<std::thread*> threadsV;
71 for(
int i=0;i<threads;i++){
75 for(
int i=0;i<threads;i++){
79 auto finish = std::chrono::high_resolution_clock::now();
80 std::chrono::duration<
double> elapsed = finish - start;
81 std::cout <<
"Elapsed time: " << elapsed.count() <<
" s\n";
86 char format_str[] =
"%ld,%s";
87 format_str[3]=delimiter;
91 if (line.size() > 100) {
92 line = line.substr(0, 100);
94 char* linebuf =
new char[line.length()+5];
96 sscanf_s(line.c_str(),
"%ld,%s", &oc, linebuf, line.length()+5);
98 sscanf(line.c_str(), format_str, &oc, linebuf);
107 std::ofstream* exportFile;
109 std::ofstream newFile(filename);
111 exportFile = &newFile;
121 std::ofstream wordlist;
122 wordlist.open(wordlistFileName);
124 int iterationsPerThread = n/threads;
125 int iterationsCarryOver = n%threads;
126 std::vector<std::thread*> threadsV;
127 for(
int i=0;i<threads;i++){
131 for(
int i=0;i<threads;i++){
141 char* res =
new char[maxLen+5];
145 for (
int i = 0; i < n; i++) {
148 *wordlist << res <<
"\n";
149 outputLock->unlock();
154 std::string buffstr(str);
155 std::map<
char, Node<
char > * > *nodes;
156 std::map<
char, Edge<
char > * > *edges;
159 for (
auto const& [repr, node] : *nodes){
161 for (
auto const& [targetrepr, edge] : *edges){
162 if(buffstr.find(targetrepr)!= std::string::npos){
163 if(bDontAdjustSelfLoops && repr==targetrepr)
continue;
164 if(bDontAdjustExtendedLoops){
165 if(buffstr.find(repr)!= std::string::npos){
170 weight = weight*multiplier;