1+ #include " ./dp_cell.hpp"
2+
3+ // MARK: public methods
4+
5+ dp_cell::dp_cell () :
6+ m_s_score(0 ),
7+ m_d_score(0 ),
8+ m_i_score(0 ),
9+ m_s_matches(0 ),
10+ m_d_matches(0 ),
11+ m_i_matches(0 ) {
12+ }
13+
14+ int64_t dp_cell::get_max_score (void ) {
15+ return std::max (this ->m_s_score , std::max (this ->m_d_score , this ->m_i_score ));
16+ }
17+
18+ int32_t dp_cell::get_max_score_matches (void ) {
19+ const int64_t max_score = std::max (this ->m_s_score , std::max (this ->m_d_score , this ->m_i_score ));
20+ if (max_score == this ->m_s_score ) {
21+ return this ->m_s_matches ;
22+ } else if (max_score == this ->m_d_score ) {
23+ return this ->m_d_matches ;
24+ }
25+ return this ->m_i_matches ;
26+ }
27+
28+ void 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" );
30+ }
31+
32+ void dp_cell::reset_cell (void ) {
33+ this ->m_s_score = 0 ;
34+ this ->m_d_score = 0 ;
35+ this ->m_i_score = 0 ;
36+ this ->m_s_matches = 0 ;
37+ this ->m_d_matches = 0 ;
38+ this ->m_i_matches = 0 ;
39+ }
40+
41+ // MARK: getters
42+
43+ int64_t dp_cell::get_s_score (void ) const {
44+ return this ->m_s_score ;
45+ }
46+
47+ int64_t dp_cell::get_d_score (void ) const {
48+ return this ->m_d_score ;
49+ }
50+
51+ int64_t dp_cell::get_i_score (void ) const {
52+ return this ->m_i_score ;
53+ }
54+
55+ int32_t dp_cell::get_s_matches (void ) const {
56+ return this ->m_s_matches ;
57+ }
58+
59+ int32_t dp_cell::get_d_matches (void ) const {
60+ return this ->m_d_matches ;
61+ }
62+
63+ int32_t dp_cell::get_i_matches (void ) const {
64+ return this ->m_i_matches ;
65+ }
66+
67+ // MARK: setters
68+
69+ void dp_cell::set_s_score (int64_t _s_score) {
70+ this ->m_s_score = _s_score;
71+ }
72+
73+ void dp_cell::set_d_score (int64_t _d_score) {
74+ this ->m_d_score = _d_score;
75+ }
76+
77+ void dp_cell::set_i_score (int64_t _i_score) {
78+ this ->m_i_score = _i_score;
79+ }
80+
81+ void dp_cell::set_s_matches (int32_t _s_matches) {
82+ this ->m_s_matches = _s_matches;
83+ }
84+
85+ void dp_cell::set_d_matches (int32_t _d_matches) {
86+ this ->m_d_matches = _d_matches;
87+ }
88+
89+ void dp_cell::set_i_matches (int32_t _i_matches) {
90+ this ->m_i_matches = _i_matches;
91+ }
0 commit comments