Skip to content

Conversation

@riccardodebenedictis
Copy link
Contributor

No description provided.

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
…unctions; update CMake configuration for conditional builds
…eparate implementations in sha1.hpp and base64.hpp
…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
…arations outside the class for improved organization
@codecov
Copy link

codecov bot commented Nov 15, 2025

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 ☂️

@riccardodebenedictis riccardodebenedictis marked this pull request as draft November 15, 2025 11:12
@riccardodebenedictis riccardodebenedictis marked this pull request as ready for review November 15, 2025 11:13
Copilot finished reviewing on behalf of riccardodebenedictis November 15, 2025 11:13
@riccardodebenedictis riccardodebenedictis merged commit 7856090 into main Nov 15, 2025
21 checks passed
Copy link

Copilot AI left a 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;
Copy link

Copilot AI Nov 15, 2025

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.

Copilot uses AI. Check for mistakes.
class u_ptr
{
template <typename U>
friend class u_ptr; // Allows s_ptr<U> to access s_ptr<T>'s private members
Copy link

Copilot AI Nov 15, 2025

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'.

Suggested change
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

Copilot uses AI. Check for mistakes.
@riccardodebenedictis riccardodebenedictis deleted the memory branch November 15, 2025 11:14
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