Skip to content

Commit

Permalink
seqalign.hpp: add member initializers to AlignmentScoring (C++14)
Browse files Browse the repository at this point in the history
Let's try if the first C++14 feature in the library works for everyone

The initializers were discussed in #302:
#302 (comment)
  • Loading branch information
wojdyr committed Oct 10, 2024
1 parent 047650f commit feadf8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
env:
CC: clang-8
CXX: clang++-8
SKBUILD_CMAKE_ARGS: "-DCMAKE_CXX_STANDARD=11;-DEXTRA_WARNINGS=ON;-DSTANDALONE_PYTHON_MODULE=OFF"
SKBUILD_CMAKE_ARGS: "-DEXTRA_WARNINGS=ON;-DSTANDALONE_PYTHON_MODULE=OFF"
SKBUILD_CMAKE_TARGETS: "all;check"
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ add_library(gemmi::headers ALIAS gemmi_headers)
target_include_directories(gemmi_headers INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_compile_features(gemmi_headers INTERFACE cxx_std_11)
target_compile_features(gemmi_headers INTERFACE cxx_std_14)
set_target_properties(gemmi_headers PROPERTIES EXPORT_NAME headers)

add_library(gemmi_cpp
Expand Down
14 changes: 7 additions & 7 deletions include/gemmi/seqalign.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
namespace gemmi {

struct AlignmentScoring {
int match;
int mismatch;
int gapo; // gap opening penalty
int gape; // gap extension penalty
int match = 1;
int mismatch = -1;
int gapo = -1; // gap opening penalty
int gape = -1; // gap extension penalty
// In a polymer in model, coordinates are used to determine expected gaps.
int good_gapo; // gap opening in expected place in a polymer
int bad_gapo; // gap opening that was not predicted
int good_gapo = 0; // gap opening in expected place in a polymer
int bad_gapo = -2; // gap opening that was not predicted
std::vector<std::int8_t> score_matrix;
std::vector<std::string> matrix_encoding;

static const AlignmentScoring* simple() {
static const AlignmentScoring s = { 1, -1, -1, -1, 0, -2, {}, {} };
static const AlignmentScoring s;
return &s;
}
// Scoring for alignment of partially-modelled polymer to its full sequence
Expand Down

0 comments on commit feadf8b

Please sign in to comment.