src/NFinput/parseSymRxns.cpp
//Build an extended vector object called symmetries that
//saves all possible names for all possible components
Build an extended vector object called symmetries that
saves all possible names for all possible components
Build an extended vector object called symmetries that saves all possible names for all possible components
void assembleFullSymmetryList(
		vector <vector <vector <component> > > &symmetries, 
		vector <string> &moleculeIds,    
		map<string,component> &symComps, 
		bool isRxnCenter  
		)
{
		map<string, component>::iterator it;
		for ( it=symComps.begin() ; it != symComps.end(); it++)
		{
			string id = it->first;
			component c = (*it).second;
			int length = id.find_last_not_of("_")-2;
			string thisMoleculeId = id.substr(0,length);
			int moleculeIndex = -1;
			for(unsigned int i=0; i<moleculeIds.size(); i++) {
				if(moleculeIds.at(i).compare(thisMoleculeId)==0)
					moleculeIndex = i; break;
			}
			if(moleculeIndex==-1) {
				moleculeIndex = moleculeIds.size();
				moleculeIds.push_back(thisMoleculeId);
				vector <vector <component> > v;
				vector <component> symRxnCenterComp;
				vector <component> symNonRxnCenterComp;
				v.push_back(symRxnCenterComp);
				v.push_back(symNonRxnCenterComp);
				symmetries.push_back(v);
			}
			int *eq; int n_eq; 
			c.mt->getEquivalencyClass(eq,n_eq, c.name);
			for(int e=0; e<n_eq; e++) {
				component newSymComp(c.mt, c.name);
				string name(c.mt->getComponentName(eq[e]));
				newSymComp.symPermutationName=name;
				newSymComp.uniqueId = id;
				if(isRxnCenter) symmetries.at(moleculeIndex).at(0).push_back(newSymComp);
				else  symmetries.at(moleculeIndex).at(1).push_back(newSymComp);
			}
		}
}
void assembleFullSymmetryList ( vector < vector < vector < component > > > & symmetries , vector < string > & moleculeIds , map < string , component > & symComps , bool isRxnCenter ) { map < string , component > :: iterator it ; for ( it = symComps . begin ( ) ; it != symComps . end ( ) ; it ++ ) { string id = it -> first ; component c = ( * it ) . second ; int length = id . find_last_not_of ( " " ) - 2 ; string thisMoleculeId = id . substr ( 0 , length ) ; int moleculeIndex = -1 ; for ( unsigned int i = 0 ; i < moleculeIds . size ( ) ; i ++ ) { if ( moleculeIds . at ( i ) . compare ( thisMoleculeId ) == 0 ) moleculeIndex = i ; break ; } if ( moleculeIndex == -1 ) { moleculeIndex = moleculeIds . size ( ) ; moleculeIds . push_back ( thisMoleculeId ) ; vector < vector < component > > v ; vector < component > symRxnCenterComp ; vector < component > symNonRxnCenterComp ; v . push_back ( symRxnCenterComp ) ; v . push_back ( symNonRxnCenterComp ) ; symmetries . push_back ( v ) ; } int * eq ; int n_eq ; c . mt -> getEquivalencyClass ( eq , n_eq , c . name ) ; for ( int e = 0 ; e < n_eq ; e ++ ) { component newSymComp ( c . mt , c . name ) ; string name ( c . mt -> getComponentName ( eq [ e ] ) ) ; newSymComp . symPermutationName = name ; newSymComp . uniqueId = id ; if ( isRxnCenter ) symmetries . at ( moleculeIndex ) . at ( 0 ) . push_back ( newSymComp ) ; else symmetries . at ( moleculeIndex ) . at ( 1 ) . push_back ( newSymComp ) ; } } }
Build an extended vector object called symmetries that
saves all possible names for all possible components
Build an extended vector object called symmetries that saves all possible names for all possible components
//for output //also for output //the input of symmetric components //set to true if you are looking at reaction centers //cout<<"\n\nreaction centers: "<<endl; //cout<<it->first<<"   "<<it->second.name<<endl; //First, get the information about this symmetric component //Next, identify if this component is in a molecule we haven't yet considered... //Create the vector to store all of our potential permutations //Get the list of equivalent components, and loop over them //to remember them in our new vector we are constructing //here we get the number of equivalent sites