Add clang-tidy conf

This commit is contained in:
Ricardo Montañana Gómez 2023-07-20 23:55:01 +02:00
parent f519003766
commit 48bfa02e1d
Signed by: rmontanana
GPG Key ID: 46064262FD9A7ADE
4 changed files with 21 additions and 4 deletions

17
.clang-tidy Normal file
View File

@ -0,0 +1,17 @@
---
Checks: '-*,
clang-*,
bugprone-*,
cppcoreguidelines-*,
modernize-*,
performance-*,
-cppcoreguidelines-pro-type-vararg,
-modernize-use-trailing-return-type,
-bugprone-exception-escape'
HeaderFilterRegex: 'src/*'
AnalyzeTemporaryDtors: false
WarningsAsErrors: ''
FormatStyle: file
FormatStyleOptions: ''
...

View File

@ -97,7 +97,8 @@
"future": "cpp",
"queue": "cpp",
"typeindex": "cpp",
"shared_mutex": "cpp"
"shared_mutex": "cpp",
"*.ipp": "cpp"
},
"cmake.configureOnOpen": false,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"

View File

@ -23,7 +23,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
# Options
# -------
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." ON)
option(ENABLE_TESTING "Unit testing build" ON)
option(CODE_COVERAGE "Collect coverage from test library" ON)
@ -71,4 +71,4 @@ if (ENABLE_TESTING)
include(CTest)
#include(Catch)
add_subdirectory(tests)
endif (ENABLE_TESTING)
endif (ENABLE_TESTING)

View File

@ -83,7 +83,6 @@ namespace bayesnet {
for (auto father : getParents()) {
dimensions.push_back(father->getNumStates());
}
auto length = dimensions.size();
// Create a tensor of zeros with the dimensions of the CPT
cpTable = torch::zeros(dimensions, torch::kFloat) + laplaceSmoothing;
// Fill table with counts