Skip to content

Conversation

@monkey0722
Copy link
Owner

This pull request introduces a new math module to the project, adding implementations for several number theory algorithms, and enhances the build system by integrating code quality tools. It also makes minor formatting improvements to existing graph and search code for consistency.

New Math Algorithms:

  • Added new math module (src/math/) with implementations for:
    • Extended Euclidean Algorithm (recursive and iterative), GCD, LCM, modular inverse (via Extended GCD), and related utilities in extended_gcd.hpp
    • Fast exponentiation (with and without modulo), modular inverse via Fermat’s Little Theorem in fast_exp.hpp
    • Sieve of Eratosthenes and related prime utilities in sieve.hpp
  • Updated CMakeLists.txt to include new math sources and tests [1] [2]

Build System and Code Quality:

  • Added code quality tooling to CMakeLists.txt:
    • Targets for clang-format (formatting and format-check)
    • Target for clang-tidy (linting)
    • Automatically collects all source and test files for these tools

Code Formatting and Style Consistency:

  • Refactored several methods in graph algorithms (bfs.hpp, dfs.hpp, kruskal.hpp) to use single-line definitions for trivial functions, improving code consistency [1] [2] [3] [4] [5]
  • Improved comment formatting in binary search utilities for readability (binary_search.hpp) [1] [2]

@monkey0722 monkey0722 self-assigned this Dec 29, 2025
@monkey0722 monkey0722 merged commit 85247b3 into main Dec 29, 2025
1 check passed
@monkey0722 monkey0722 deleted the feature/20261229 branch December 29, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants