@@ -105,9 +105,9 @@ void PQEvaluatorBasic::updateValue(
105105 // split outer loop for many atoms. The CPUs should have similar load.
106106 bool chop_outer = (mncpu <= ((cntsites - 1 ) * CPU_LOAD_VARIANCE + 1 ));
107107 bool chop_inner = !chop_outer;
108- bool hasmask = pq.hasMask ();
108+ const bool hasmask = pq.hasMask ();
109109 if (!this ->isParallel ()) chop_outer = chop_inner = false ;
110- bool usefullsum = this ->getFlag (USEFULLSUM);
110+ const bool usefullsum = this ->getFlag (USEFULLSUM);
111111 for (int i0 = 0 ; i0 < cntsites; ++i0)
112112 {
113113 if (chop_outer && (n++ % mncpu)) continue ;
@@ -182,7 +182,7 @@ void PQEvaluatorOptimized::updateValue(
182182 mtypeused = OPTIMIZED;
183183 // revert to normal calculation if there is no structure or
184184 // if PairQuantity uses mask
185- if (pq.ticker () >= mvalue_ticker || !mlast_structure || pq. hasPairMask () )
185+ if (pq.ticker () >= mvalue_ticker || !mlast_structure)
186186 {
187187 return this ->updateValueCompletely (pq, stru);
188188 }
@@ -192,7 +192,7 @@ void PQEvaluatorOptimized::updateValue(
192192 {
193193 return this ->updateValueCompletely (pq, stru);
194194 }
195- if (this ->getFlag (FIXEDSITEINDEX) &&
195+ if (( this ->getFlag (FIXEDSITEINDEX) || pq. hasPairMask () ) &&
196196 sd.diffmethod != StructureDifference::Method::SIDEBYSIDE)
197197 {
198198 return this ->updateValueCompletely (pq, stru);
@@ -219,7 +219,7 @@ void PQEvaluatorOptimized::updateValue(
219219 anchors.end () : (anchors.begin () + sd.pop0 .size ());
220220 SiteIndices::const_iterator ii0;
221221 bool needsreselection = usefullsum;
222- const bool hastypemask = pq.hasTypeMask ();
222+ const bool hasmask = pq.hasMask ();
223223 for (ii0 = anchors.begin (); ii0 != last_anchor; ++ii0)
224224 {
225225 if (n++ % mncpu) continue ;
@@ -237,8 +237,7 @@ void PQEvaluatorOptimized::updateValue(
237237 for (bnds0->rewind (); !bnds0->finished (); bnds0->next ())
238238 {
239239 int i1 = bnds0->site1 ();
240- assert (hastypemask || pq.getPairMask (i0, i1));
241- if (hastypemask && !pq.getPairMask (i0, i1)) continue ;
240+ if (hasmask && !pq.getPairMask (i0, i1)) continue ;
242241 const int summationscale = (usefullsum || i0 == i1) ? -1 : -2 ;
243242 pq.addPairContribution (*bnds0, summationscale);
244243 }
@@ -288,8 +287,7 @@ void PQEvaluatorOptimized::updateValue(
288287 for (bnds1->rewind (); !bnds1->finished (); bnds1->next ())
289288 {
290289 int i1 = bnds1->site1 ();
291- assert (hastypemask || pq.getPairMask (i0, i1));
292- if (hastypemask && !pq.getPairMask (i0, i1)) continue ;
290+ if (hasmask && !pq.getPairMask (i0, i1)) continue ;
293291 const int summationscale = (usefullsum || i0 == i1) ? +1 : +2 ;
294292 pq.addPairContribution (*bnds1, summationscale);
295293 }
0 commit comments