Skip to content

atomic lint interpolation

hgratten requested to merge atomic_lint_interpolation into master

this merge request introduces the clang-tidied interpolation chapter

LectureCodes/Interpolation/*

  • removed cmake_minimum_required(VERSION 2.8), since the cmake version is better handled by the global CMakeLists.txt file
  • put functions in header files in a separate namespace if there are using directives, to avoid clutter in the global namespace and clarify dependencies in main files
  • inlined functions in header file to avoid potential ODR (one-definition-rule) violations: since functions are defined directly in the header, including it from multiple translation units would cause multiple definitions, which inlining avoids by duplicating the definition per translation unit
  • reordered includes as good practice (user header first, then system headers, ordered alphabetically
  • wrapped body statement of if-else, for, do while, and while in braces. increases readability and forgetting braces is a common source of bugs for students
  • integer type hygiene (use Eigen::Index for indexing)
  • modernized return statements of e.g. std::pair with brace initialization instead of re-stating the return type to access its constructor
  • introduced const wherever possible
  • explicitly casted integer types to double
  • explicitly casted between integer types (narrowing, different signedness)

LectureCodes/Interpolation/barycentricformula/Eigen/ipvclass.hpp

  • marked single-argument constructors explicit, to avoid accidental implicit conversion of an argument into class object
  • marked function with [[nodiscard]] attribute to throw a warning if result is not used

LectureCodes/Interpolation/pchislopes/Eigen/pchislopes.hpp

  • removed const qualifiers from forward declaration, since they only have an effect on the definition and do not change the signature

Merge request reports

Loading