Skip to content

atomic lint eigen tutorial

hgratten requested to merge atomic_lint_eigen_tutorial into master

this merge request introduces the clang-tidied EigenTutorial chapter

LectureCodes/EigenTutorial/* + backwards-compatible dependency Utils/timetable.hpp:

  • removed "using namespace", since it clutters the translation unit
  • introduced const wherever possible
  • wrapped body statement of for, do while, and while in braces. increases readability and forgetting braces is a common source of bugs for students.
  • explicitly casted integer types to double
  • explicitly casted between integer types (narrowing, different signedness)
  • replaced c-style cast with static cast (C++ style casts are checked by the compiler. C style casts aren't and can fail at runtime.)
  • removed unused main argc, argv
  • removed old code (main.cpp)
  • integer type hygiene (use Eigen::Index for indexing)
  • removed multiple declarations in a single line for readability
  • avoided static mutable variables (aka globals)
  • avoided pointer arithmetic, instead used span, which is safe to index

Merge request reports

Loading