Changeset 3194
- Timestamp:
- Apr 22, 2014, 11:24:56 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/utility/Aligner.cc
r2881 r3194 84 84 if (x(i-1, j-1) + score(i-1, j-1) > x(i,j)) { 85 85 x(i,j) = x(i-1, j-1) + score(i-1, j-1); 86 cigar(i, j) = diagonal;86 directions(i, j) = diagonal; 87 87 } 88 88 89 if ( cigar(i, j-1) == right) {89 if (directions(i, j-1) == right) { 90 90 if (x(i, j-1)-horizon_gap_ > x(i,j)) { 91 91 x(i,j) = x(i,j-1) - horizon_gap_; 92 cigar(i,j) = right;92 directions(i,j) = right; 93 93 } 94 94 } 95 95 else if(x(i,j-1)-horizon_gap_-open_horizon_gap_ > x(i,j)) { 96 96 x(i,j) = x(i,j-1) - horizon_gap_ - open_horizon_gap_; 97 cigar(i,j) = right;97 directions(i,j) = right; 98 98 } 99 99 100 if ( cigar(i-1,j) == down) {100 if (directions(i-1,j) == down) { 101 101 if (x(i-1,j) - vertical_gap_ > x(i,j)) { 102 102 x(i,j) = x(i-1,j) - vertical_gap_; 103 cigar(i,j) = down;103 directions(i,j) = down; 104 104 } 105 105 } 106 106 else if (x(i-1,j) - vertical_gap_ - open_vertical_gap_ > x(i,j)) { 107 107 x(i,j) = x(i-1,j) - vertical_gap_ - open_vertical_gap_; 108 cigar(i,j) = down;108 directions(i,j) = down; 109 109 } 110 110 } … … 118 118 119 119 120 Aligner::direction& Aligner:: cigar(size_t i, size_t j)120 Aligner::direction& Aligner::directions(size_t i, size_t j) 121 121 { 122 122 return alignment_[i*columns_ + j]; -
trunk/yat/utility/Aligner.h
r3180 r3194 24 24 */ 25 25 26 #include <boost/cstdint.hpp> 27 26 28 #include <cstddef> 29 #include <iosfwd> 27 30 #include <vector> 28 31 … … 126 129 const direction& alignment(size_t i, size_t j) const; 127 130 131 /** 132 \since new in yat 0.12 133 */ 134 class Cigar 135 { 136 public: 137 void clear(void); 138 void push_back(uint8_t op, uint32_t len=1); 139 void push_front(uint8_t op, uint32_t len=1); 140 void pop_back(void); 141 void pop_front(void); 142 uint8_t op(size_t) const; 143 char opchr(size_t) const; 144 uint32_t oplen(size_t) const; 145 uint32_t operator[](size_t) const; 146 size_t size(void) const; 147 private: 148 // using compiler generated copy 149 // Cigar(const Cigar& other); 150 // Cigar& operator=(const Cigar&); 151 }; 152 153 /** 154 \since new in yat 0.12 155 */ 156 const Cigar cigar(size_t i, size_t j) const; 157 128 158 private: 129 direction& cigar(size_t i, size_t j);159 direction& directions(size_t i, size_t j); 130 160 131 161 size_t columns_; … … 137 167 }; 138 168 169 170 /** 171 */ 172 std::ostream& operator<<(std::ostream& os, const Aligner::Cigar& cigar); 173 139 174 }}} // of namespace utility, yat, and theplu 140 175
Note: See TracChangeset
for help on using the changeset viewer.