Skip to content

the input output parts are improved, refactoring, adding csv reader#3

Merged
rostam merged 1 commit intomasterfrom
feature/improve_input_to_alg2
Aug 2, 2025
Merged

the input output parts are improved, refactoring, adding csv reader#3
rostam merged 1 commit intomasterfrom
feature/improve_input_to_alg2

Conversation

@rostam
Copy link
Owner

@rostam rostam commented Aug 2, 2025

PR Type

Enhancement


Description

  • Modernize C++ code with ranges and auto keywords

  • Replace iterator loops with range-based alternatives

  • Update algorithm calls to use std::ranges namespace

  • Fix minor typos and improve code consistency


Diagram Walkthrough

flowchart LR
  A["Legacy C++ Code"] --> B["std::ranges Migration"]
  B --> C["Auto Type Deduction"]
  C --> D["Modernized Codebase"]
  B --> E["Iterator Simplification"]
  E --> D
Loading

File Walkthrough

Relevant files
Enhancement
13 files
GreedyColoringLimitedMaxColor.cpp
Add const qualifier to lambda parameter                                   
+1/-1     
GreedyColoringSimpleGraph.cpp
Replace find_if with std::ranges::find_if                               
+4/-5     
ISet.hpp
Modernize iterators and use std::ranges::find                       
+4/-15   
ISetRestricted.hpp
Add override and modernize iterator usage                               
+13/-24 
kClique.hpp
Simplify iterator declarations with auto                                 
+6/-9     
MatrixMarket.cpp
Use std::ranges::sort and fix typos                                           
+8/-9     
OneSidedD2ColorNonReqDiag.h
Replace algorithms with std::ranges equivalents                   
+3/-3     
OneSidedD2ColoringNonReq.h
Modernize with std::ranges::for_each and find_if                 
+5/-5     
OneSidedD2ColoringNonReqBalanced.h
Use std::ranges throughout and fix header guard                   
+9/-13   
exact_coloring.h
Add pragma once and use ranges::for_each                                 
+4/-4     
LargestFirstOrderingDegrees.h
Add override and modernize iterator usage                               
+3/-2     
SLO.h
Replace min_element with std::ranges version                         
+14/-24 
WeightOptimumOrdering.h
Add override specifier to virtual function                             
+2/-1     
Configuration changes
1 files
CMakeLists.txt
Update minimum CMake version requirement                                 
+1/-1     
Documentation
1 files
InputFile
Fix typo in comment section                                                           
+1/-1     

@qodo-code-review
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Parameter Type

Lambda parameter type changed from int to const int which may affect function signature compatibility with existing code that expects non-const parameter.

ForEachNeighbor(GraphInstance, v, [&](const int n) {
    int c = boost::get(vertex_color, GraphInstance, n);
Missing Override

The compute() method signature was changed but the override keyword was added without showing the base class declaration, which could indicate a breaking change in the inheritance hierarchy.

vector<int> compute() override
{
Logic Error

The function now returns false instead of 0, but the return type and expected behavior should be validated to ensure this change doesn't break calling code.

    return false;
}

@qodo-code-review
Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

@rostam rostam merged commit 2a42b22 into master Aug 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant