@@ -103,20 +103,21 @@ uint32_t extMeasure::computeRes(SEQ* s,
103103 return 0 ;
104104 }
105105
106- Array1D<SEQ *> overlapSeq (16 );
107- getDgOverlap_res (s, _dir, dgContext, &overlapSeq , residueSeq);
106+ Array1D<SEQ *> neighbor_regions (16 );
107+ getDgOverlap_res (s, _dir, dgContext, &neighbor_regions , residueSeq);
108108
109- uint32_t len = 0 ;
110- for (uint32_t jj = 0 ; jj < overlapSeq.getCnt (); jj++) {
111- SEQ * tgt = overlapSeq.get (jj);
112- uint32_t diagDist = calcDist (tgt->_ll , tgt->_ur );
113- uint32_t len1 = getLength (tgt, !_dir);
109+ uint32_t total_neighbors_span = 0 ;
110+ for (uint32_t jj = 0 ; jj < neighbor_regions.getCnt (); jj++) {
111+ SEQ * neighbor_region = neighbor_regions.get (jj);
112+ uint32_t distance_to_neighbor
113+ = calcDist (neighbor_region->_ll , neighbor_region->_ur );
114+ uint32_t neighbor_span = getLength (neighbor_region, !_dir);
114115
115- len += len1 ;
116- calcRes (_rsegSrcId, len1 , _dist, diagDist , _met);
116+ total_neighbors_span += neighbor_span ;
117+ calcRes (_rsegSrcId, neighbor_span , _dist, distance_to_neighbor , _met);
117118 }
118- seq_release (&overlapSeq );
119- return len ;
119+ seq_release (&neighbor_regions );
120+ return total_neighbors_span ;
120121}
121122
122123int extMeasure::getMaxDist (int tgtMet, uint32_t modelIndex)
@@ -236,6 +237,8 @@ extDistRC* extDistRCTable::getComputeRC_res(uint32_t dist1, uint32_t dist2)
236237 return nullptr ;
237238 }
238239
240+ // This represents the first RESOVER table row i.e., the entry
241+ // in which there is no neighboring context effect.
239242 extDistRC* rc1 = measureTableR_[0 ]->geti (0 );
240243 rc1->diag_ = 0.0 ;
241244 if (rc1 == nullptr ) {
@@ -245,9 +248,11 @@ extDistRC* extDistRCTable::getComputeRC_res(uint32_t dist1, uint32_t dist2)
245248 if (dist1 + dist2 == 0 ) { // ASSUMPTION: 0 dist exists as first
246249 return rc1;
247250 }
251+
248252 if (dist1 >= maxDist_ && dist2 >= maxDist_) {
249253 return nullptr ;
250254 }
255+
251256 if (dist2 > maxDist_) {
252257 dist2 = dist1;
253258 dist1 = 0 ;
0 commit comments