src/HSLib/GenOp.cc
/* Aside for providing basic tests as to whether to operators are equvalent or
   not, these operators are necessary if any STL container classes are to
   be used based on operators (e.g. list<gen_op> or vector<gen_op>)          */
Aside for providing basic tests as to whether to operators are equvalent or
not, these operators are necessary if any STL container classes are to
be used based on operators
Aside for providing basic tests as to whether to operators are equvalent or not these operators are necessary if any STL container classes are to be used based on operators
bool gen_op::operator== (const gen_op& Op) const
  {
  if(!WBR) return (!Op.WBR);		
  if(!Op.WBR) return false;		
  const genoprep* REP = NULL;		
  const genoprep* PTR = Op.ObeginC();	
  std::vector<genoprep>::const_iterator item;
  item = Op.begin();
  while(item != Op.end())		
    {
    PTR = &(*item);
    REP = FindRep(PTR->RepBs);		
    if(REP)				
      return(PTR->RepMx == REP->RepMx); 
    item++;
    }
  basis thisbs = WBR->RepBs; 		
  basis Opbs   = Op.WBR->RepBs; 	
  set_DBR();				
  Op.set_DBR();				
  bool TF=(DBR->RepMx == Op.DBR->RepMx);
  return TF;				
  }
bool gen_op :: operator == ( const gen_op & Op ) const { if ( ! WBR ) return ( ! Op . WBR ) ; if ( ! Op . WBR ) return false ; const genoprep * REP = NULL ; const genoprep * PTR = Op . ObeginC ( ) ; std :: vector < genoprep > :: const_iterator item ; item = Op . begin ( ) ; while ( item != Op . end ( ) ) { PTR = & ( * item ) ; REP = FindRep ( PTR -> RepBs ) ; if ( REP ) return ( PTR -> RepMx == REP -> RepMx ) ; item ++ ; } basis thisbs = WBR -> RepBs ; basis Opbs = Op . WBR -> RepBs ; set_DBR ( ) ; Op . set_DBR ( ) ; bool TF = ( DBR -> RepMx == Op . DBR -> RepMx ) ; return TF ; }
Aside for providing basic tests as to whether to operators are equvalent or
not, these operators are necessary if any STL container classes are to
be used based on operators (e.g.
Aside for providing basic tests as to whether to operators are equvalent or not these operators are necessary if any STL container classes are to be used based on operators ( e . g .
// Return TRUE if both NULL // Return FALSE if Op NULL & not Op // Don't know if any OpRep's match // Begin with 1st OpRep of Op // Iterator into list // Loop through OpReps of Op // Look for OpRep in Op with same basis // If we have found match, then the Ops // are equal if their matrices match // No matching OpReps, so as a last  // resort we must see if DBR's match // So, store initial bases, set both // into teir DBR, compare, then reset // them back into their original bases // before returning the result