File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 11#include " ./dp_cell.hpp"
22
3+ // MARK: scores
4+
5+ const int64_t match_score = 1 ;
6+ const int64_t mismatch_score = -2 ;
7+ const int64_t opening_gap_score = -5 ;
8+ const int64_t gap_extension_score = -1 ;
9+
10+ // MARK: private methods
11+
12+ void dp_cell::score_s (const dp_cell& cell_s) {
13+ throw std::runtime_error (" not implemented" );
14+ }
15+
16+ void dp_cell::score_d (const dp_cell& cell_d) {
17+ throw std::runtime_error (" not implemented" );
18+ }
19+
20+ void dp_cell::score_i (const dp_cell& cell_i) {
21+ throw std::runtime_error (" not implemented" );
22+ }
23+
324// MARK: public methods
425
526dp_cell::dp_cell () :
@@ -11,6 +32,9 @@ dp_cell::dp_cell() :
1132 m_i_matches(0 ) {
1233}
1334
35+ dp_cell::~dp_cell () {
36+ }
37+
1438int64_t dp_cell::get_max_score (void ) const {
1539 return std::max (this ->m_s_score , std::max (this ->m_d_score , this ->m_i_score ));
1640}
@@ -26,7 +50,9 @@ int32_t dp_cell::get_max_score_matches(void) const {
2650}
2751
2852void dp_cell::score_cell (const dp_cell& cell_s, const dp_cell& cell_d, const dp_cell& cell_i) {
29- throw std::runtime_error (" not implemented" );
53+ this ->score_s (cell_s);
54+ this ->score_d (cell_d);
55+ this ->score_i (cell_i);
3056}
3157
3258void dp_cell::reset_cell (void ) {
Original file line number Diff line number Diff line change 55#include < algorithm>
66#include < stdexcept>
77
8+ extern const int64_t match_score;
9+ extern const int64_t mismatch_score;
10+ extern const int64_t opening_gap_score;
11+ extern const int64_t gap_extension_score;
12+
813class dp_cell {
914private:
1015 int64_t m_s_score;
@@ -14,8 +19,13 @@ class dp_cell {
1419 int32_t m_s_matches;
1520 int32_t m_d_matches;
1621 int32_t m_i_matches;
22+
23+ void score_s (const dp_cell& cell_s);
24+ void score_d (const dp_cell& cell_d);
25+ void score_i (const dp_cell& cell_i);
1726public:
1827 dp_cell ();
28+ ~dp_cell ();
1929 int64_t get_max_score (void ) const ;
2030 int32_t get_max_score_matches (void ) const ;
2131 void score_cell (const dp_cell&, const dp_cell&, const dp_cell&);
You can’t perform that action at this time.
0 commit comments