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