Skip to content

Commit

Permalink
Dont use Parameters as tmp vars
Browse files Browse the repository at this point in the history
  • Loading branch information
T3C42 committed Dec 3, 2024
1 parent 7a8a6b3 commit 0bb98a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mt-kahypar/dynamic/dynamic_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace mt_kahypar::dyn {

void generateErrorFile(Context& context, DynamicStrategy* strategy, std::exception& e) {
std::string filename = context.dynamic.output_path;
std::ofstream file(filename);
std::ofstream file(filename + ".error");
if (!file.is_open()) {
throw std::runtime_error("Could not open file: " + filename);
}
Expand Down
5 changes: 3 additions & 2 deletions mt-kahypar/dynamic/dynamic_partitioner.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace mt_kahypar::dyn {

ds::StaticHypergraph& hypergraph_s = utils::cast<ds::StaticHypergraph>(hypergraph);

if (context.dynamic.max_changes == -1) context.dynamic.max_changes = changes.size();
// If the number of changes is not specified or is greater than the number of changes in the file, we process all the changes
size_t changes_size = context.dynamic.max_changes == -1 ? changes.size() : std::min((size_t) context.dynamic.max_changes, changes.size());

DynamicStrategy* strategy;

Expand All @@ -36,7 +37,7 @@ namespace mt_kahypar::dyn {

std::cout << "Processing " << context.dynamic.max_changes << " changes" << std::endl;

for (size_t i = 0; i < context.dynamic.max_changes; ++i) {
for (size_t i = 0; i < changes_size; ++i) {
Change& change = changes[i];
strategy->partition(hypergraph_s, context, change);
if (!context.dynamic.server && *(&strategy->history.back().valid)) {
Expand Down

0 comments on commit 0bb98a5

Please sign in to comment.