Changeset 875 for trunk/yat/utility
 Timestamp:
 Sep 19, 2007, 2:17:05 AM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/utility/Alignment.cc
r869 r875 101 101 double gap, double open_gap) 102 102 { 103 enum direction { none, right, down, diagonal }; 104 103 105 // Calculating SW matrix 104 matrix m(s.rows()+2,s.columns()+2); 105 for (size_t i=2; i<m.rows(); ++i) 106 for (size_t j=2; j<m.columns(); ++j) 107 m(i,j) = max(0.0, m(i1,j1)+s(i2,j2), 108 m(i1,j)gapopen_gap, m(i2,j)2*gap, 109 m(i,j1)gapopen_gap, m(i,j2)2*gap); 110 106 matrix m(s.rows()+1,s.columns()+1); 107 matrix array(m); 108 for (size_t i=1; i<m.rows(); ++i) 109 for (size_t j=1; j<m.columns(); ++j){ 110 m(i,j)=0; 111 array(i,j) = none; 112 if (m(i1,j1)+s(i1,j1)>m(i,j)){ 113 m(i,j) = m(i1,j1)+s(i1,j1); 114 array(i,j) = diagonal; 115 } 116 if (array(i1,j)==right && m(i1,j)gap > m(i,j)){ 117 m(i,j) = m(i1,j)gap; 118 array(i,j) = right; 119 } 120 if (array(i1,j)!=right && m(i1,j)gapopen_gap > m(i,j)){ 121 m(i,j) = m(i1,j)gapopen_gap; 122 array(i,j) = right; 123 } 124 if (array(i,j1)==down && m(i,j1)gap > m(i,j)){ 125 m(i,j) = m(i,j1)gap; 126 array(i,j) = down; 127 } 128 if (array(i,j1)!=down && m(i,j1)gapopen_gap > m(i,j)){ 129 m(i,j) = m(i,j1)gapopen_gap; 130 array(i,j) = down; 131 } 132 } 111 133 return max(m); 112 134 }
Note: See TracChangeset
for help on using the changeset viewer.