-
Notifications
You must be signed in to change notification settings - Fork 0
Memory #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory #1
Conversation
Add validation for user input Refactor code for better performance Update README with new instructions Fix formatting issues in CSS Add error handling for database connection Update dependencies to latest versions Remove unused code Fix broken links in navigation Improve error messages for better user experience
… combinations.hpp, cartesian_product.hpp, and lin.hpp
…tor for improved performance
…unctions; update CMake configuration for conditional builds
…eparate implementations in sha1.hpp and base64.hpp
…encoding with [[nodiscard]]
…es; enhance string representation logic
…t classes to remove explicit keyword for default constructors Add new constructor in lin class to support initializer list for variable-coefficient pairs Enhance test for lin class to validate new constructor functionality
…one with 0 and 1 for clarity
…ss and enhance documentation for clarity
… the class for improved organization
…arations outside the class for improved organization
…ed organization and clarity
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR performs a major refactoring of the utils library, migrating from .h to .hpp headers and modernizing the codebase. The changes include renaming type aliases (I → INT_TYPE), converting constants from UPPERCASE to lowercase naming, refactoring memory management utilities, and adding new features including cryptography support, linear algebra utilities, and improved testing infrastructure.
Key changes:
- Type system modernization with INT_TYPE and improved rational/integer classes
- Memory management refactoring with new smart pointer implementations
- Addition of new utilities: SHA1, Base64, Floyd-Warshall, linear expressions, tableau
- Build system modernization with sanitizers and improved CI/CD
Reviewed Changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_utils.cpp | Complete rewrite of test suite with new test functions for literals, rationals, linear expressions, tableau, matrix, and loss functions |
| tests/test_pointers.cpp | New test file for smart pointer implementations (u_ptr, s_ptr, ref_wrapper) |
| tests/test_floyd_warshall.cpp | New test file for Floyd-Warshall shortest path algorithm |
| tests/test_crypto.cpp | New test file for cryptographic functions (SHA1, Base64) |
| tests/CMakeLists.txt | Updated build configuration with sanitizer support and new test executables |
| src/rational.cpp | Refactored with INT_TYPE, lowercase constants, removed UTILS_EXPORT, added floor/ceil functions |
| src/lin.cpp | New implementation for linear expression arithmetic |
| src/integer.cpp | New implementation for extended integer type with infinity support |
| src/inf_rational.cpp | Extracted implementation from header, separated to_string function |
| src/crypto.cpp | New cryptographic utilities (password encoding, RS256 signing, key extraction) |
| src/tableau.cpp | New tableau implementation for simplex algorithm support |
| src/timer.cpp | New periodic timer implementation with thread support |
| include/rational.hpp | Migrated from .h with INT_TYPE, floor/ceil functions, [[nodiscard]] attributes |
| include/memory.hpp | Complete rewrite with u_ptr, s_ptr, ref_wrapper replacing c_ptr |
| include/integer.hpp | New header defining extended integer class |
| include/inf_rational.hpp | Migrated from .h with updated constructors and type system |
| include/logging.hpp | Enhanced logging system with multiple log levels |
| include/lit.hpp | New header for propositional literals |
| include/lin.hpp | New header for linear expressions |
| include/tableau.hpp | New header for tableau data structure |
| include/timer.hpp | New header for periodic timer |
| include/sha1.hpp | New SHA1 hash implementation |
| include/loss.hpp | New loss functions (MSE, MAE) for ML |
| include/matrix.hpp | New matrix operations (transpose, multiply) |
| include/floyd_warshall.hpp | New Floyd-Warshall algorithm implementation |
| include/crypto.hpp | New cryptography function declarations |
| include/base64.hpp | New Base64 encoding utilities |
| include/bool.hpp | Migrated from .h with added helper functions |
| include/differentiable.hpp | New abstract base class for differentiable functions |
| include/enum.hpp | Minor formatting update and removed default constructor |
| include/combinations.hpp | Added [[nodiscard]] and emplace_back optimizations |
| include/cartesian_product.hpp | Added [[nodiscard]] and emplace_back optimizations |
| CMakeLists.txt | Major modernization with CMake 3.21, sanitizer support, INT_TYPE configuration |
| cmake/Modules/Sanitizers.cmake | New module for configuring address/memory/undefined behavior sanitizers |
| .github/workflows/cmake.yml | New CI/CD workflow with multiple platform testing and coverage |
| README.md | Updated with badges and new utility descriptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static const rational negative_infinite; | ||
|
|
||
| rational() noexcept; | ||
| rational(INT_TYPE n) noexcept; |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INT_TYPE is used throughout the codebase but is never defined as a type alias. According to CMakeLists.txt line 48, INT_TYPE is set as a compile definition (e.g., INT_TYPE=long), which makes it a macro that expands to the raw type name. However, for this to work correctly as a type, it should either be: (1) wrapped in a using declaration in a common header, or (2) the compile definition should define it as using INT_TYPE = long;. Currently, this will likely cause compilation errors.
| class u_ptr | ||
| { | ||
| template <typename U> | ||
| friend class u_ptr; // Allows s_ptr<U> to access s_ptr<T>'s private members |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment incorrectly states 's_ptr' but should say 'u_ptr' since this is in the u_ptr class definition. The comment should read: 'Allows u_ptr to access u_ptr's private members'.
| friend class u_ptr; // Allows s_ptr<U> to access s_ptr<T>'s private members | |
| friend class u_ptr; // Allows u_ptr<U> to access u_ptr<T>'s private members |
No description provided.