Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
854850c
Remove useless files
akutuva21 Jun 1, 2026
9dc8b37
Remove commented out listener loops in molecule.cpp
google-labs-jules[bot] Jun 2, 2026
4c23bd5
Optimize Function XML parsing map/vector lookup
google-labs-jules[bot] Jun 2, 2026
3bc9746
Remove commented out sailorickm locale fix in muParser
google-labs-jules[bot] Jun 2, 2026
f14689f
🧹 [Clean up dead code for vector to array refactor in NFfunction]
google-labs-jules[bot] Jun 2, 2026
1522278
test: add tests for Compartment::isInside
google-labs-jules[bot] Jun 2, 2026
574bb28
🧪 [testing improvement] Add test for Molecule::printDetails
google-labs-jules[bot] Jun 2, 2026
3c9a831
clean dead code from reactionSelector logClassSelector
google-labs-jules[bot] Jun 2, 2026
b944b1d
Remove commented-out code in DORreaction
google-labs-jules[bot] Jun 2, 2026
1a793c2
Optimize map iterator post-increment to pre-increment
google-labs-jules[bot] Jun 2, 2026
c672db2
Clean up commented out loops and debug statements in ReactionClass
google-labs-jules[bot] Jun 2, 2026
56fb55d
⚡ Change GlobalFunction constructor to pass strings by const reference
google-labs-jules[bot] Jun 2, 2026
5f9499d
Remove dead code from System::getGlobalFunctionByName
google-labs-jules[bot] Jun 2, 2026
ba74693
🧹 Remove commented out compare logic
google-labs-jules[bot] Jun 2, 2026
6569e52
⚡ Optimize function reference lookup loop
google-labs-jules[bot] Jun 2, 2026
2b6c01f
Remove deprecated POP_RXN constant from NFcore.hh
google-labs-jules[bot] Jun 2, 2026
3ea82d7
Fix missing parenthesis in test Eval() error path string
google-labs-jules[bot] Jun 2, 2026
772f5b1
⚡ Optimize setCtrName to use const string reference
google-labs-jules[bot] Jun 2, 2026
d37ff60
🧹 [Code Health] Remove legacy comment in TinyXML
google-labs-jules[bot] Jun 2, 2026
a46c1bb
Remove commented out reaction iteration loops in system.cpp
google-labs-jules[bot] Jun 2, 2026
fc09f7b
Refactor tfun_trim_copy and tfun_to_lower_copy for performance
google-labs-jules[bot] Jun 2, 2026
689609c
Fix buffer manipulation in job2str
google-labs-jules[bot] Jun 2, 2026
108b6aa
Add test for Complex::printDetails
google-labs-jules[bot] Jun 2, 2026
3252aaf
perf: Replace bounds-checked .at() with direct array access
google-labs-jules[bot] Jun 2, 2026
36e8508
⚡ Change enableFileDependency parameters to pass-by-const-reference
google-labs-jules[bot] Jun 2, 2026
c384e53
🧹 Refactor initFunctions to extract TFUN handling logic
google-labs-jules[bot] Jun 2, 2026
2b37da4
🧹 [Clean up obsolete STL assignment workaround in TinyXML]
google-labs-jules[bot] Jun 2, 2026
8338da0
🧹 Remove commented out debug code in molecule.cpp
google-labs-jules[bot] Jun 2, 2026
71039aa
Refactor initStartSpecies function to improve readability
google-labs-jules[bot] Jun 2, 2026
833dae5
Refactor legacy MSVC6 namespace workarounds to use using declarations
google-labs-jules[bot] Jun 2, 2026
f6f0391
Remove the bug fix comment from Rob Laveaux in src/NFinput/TinyXML/ti…
google-labs-jules[bot] Jun 2, 2026
fde5f84
Optimize map passing by value to pass by const reference in configura…
google-labs-jules[bot] Jun 2, 2026
3272115
🧹 Refactor TemplateMolecule::compare to improve readability
google-labs-jules[bot] Jun 2, 2026
97cf577
🧹 Refactor tfun_interpolate_value to use standard algorithms
google-labs-jules[bot] Jun 2, 2026
815fd4b
Optimize usedComponentNames lookups in NFinput
google-labs-jules[bot] Jun 2, 2026
211f13e
Fix fread logic for line normalization in TinyXML
google-labs-jules[bot] Jun 2, 2026
fb9da2a
Optimize MoleculeType observable additions with unordered_set
google-labs-jules[bot] Jun 2, 2026
c9fab94
Merge pull request #316 from akutuva21/code-health-molecule-listeners…
akutuva21 Jun 2, 2026
c379080
Merge pull request #317 from akutuva21/optimize-func-xml-parsing-2392…
akutuva21 Jun 2, 2026
250fbf7
Merge pull request #318 from akutuva21/remove-sailorickm-locale-fix-1…
akutuva21 Jun 2, 2026
e5965bd
Merge pull request #319 from akutuva21/code-health-nffunction-array-t…
akutuva21 Jun 2, 2026
2c23d0c
Merge pull request #320 from akutuva21/test-compartment-isinside-1268…
akutuva21 Jun 2, 2026
e90406b
Merge pull request #321 from akutuva21/testing-improvement-molecule-p…
akutuva21 Jun 2, 2026
3d399ec
Merge pull request #322 from akutuva21/clean-dead-code-logclassselect…
akutuva21 Jun 2, 2026
b03bf59
Merge pull request #323 from akutuva21/code-health/dorreaction-dead-c…
akutuva21 Jun 2, 2026
18e9588
Merge pull request #324 from akutuva21/perf-optimize-map-iterator-438…
akutuva21 Jun 2, 2026
f032458
Merge pull request #326 from akutuva21/clean-reactionclass-deadcode-1…
akutuva21 Jun 2, 2026
b313632
Merge pull request #327 from akutuva21/perf/global-function-string-re…
akutuva21 Jun 2, 2026
dc31ab0
Merge pull request #328 from akutuva21/fix/remove-dead-code-getGlobal…
akutuva21 Jun 2, 2026
fe5a4b5
Merge pull request #329 from akutuva21/code-health-remove-dead-compar…
akutuva21 Jun 2, 2026
e2b0755
Merge pull request #330 from akutuva21/jules-perf-opt-funcxml-3541601…
akutuva21 Jun 2, 2026
7c06c9f
Merge pull request #331 from akutuva21/remove-pop-rxn-118381120060275…
akutuva21 Jun 2, 2026
5497d4e
Merge pull request #332 from akutuva21/fix-missing-parenthesis-test-1…
akutuva21 Jun 2, 2026
1e8782a
Merge pull request #333 from akutuva21/perf-optimize-setctrname-86801…
akutuva21 Jun 2, 2026
e58eb96
Merge pull request #334 from akutuva21/fix/remove-tinyxml-comment-977…
akutuva21 Jun 2, 2026
00f7eac
Merge pull request #336 from akutuva21/remove-dead-code-system-cpp-14…
akutuva21 Jun 2, 2026
925a5ee
Merge pull request #337 from akutuva21/perf/optimize-string-trim-pars…
akutuva21 Jun 2, 2026
ac1313c
Merge pull request #338 from akutuva21/fix-job2str-snprintf-163572287…
akutuva21 Jun 2, 2026
004ffc0
Merge pull request #339 from akutuva21/jules-test-complex-printdetail…
akutuva21 Jun 2, 2026
5e4cb94
Merge pull request #341 from akutuva21/perf-optimize-output-times-loo…
akutuva21 Jun 2, 2026
d512500
Merge pull request #343 from akutuva21/perf/pass-by-const-ref-enablef…
akutuva21 Jun 2, 2026
47d2da9
Merge pull request #345 from akutuva21/jules-refactor-initfunctions-1…
akutuva21 Jun 2, 2026
7cb6e0d
Merge pull request #346 from akutuva21/fix-tinyxml-aliasing-comment-1…
akutuva21 Jun 2, 2026
335843c
Merge pull request #347 from akutuva21/jules/remove-dead-code-molecul…
akutuva21 Jun 2, 2026
709df0f
Merge pull request #349 from akutuva21/code-health-initstartspecies-1…
akutuva21 Jun 2, 2026
54f5f97
Merge pull request #351 from akutuva21/code-health/refactor-msvc6-nam…
akutuva21 Jun 2, 2026
6d15018
Merge pull request #353 from akutuva21/remove-tinyxml-comment-8123240…
akutuva21 Jun 2, 2026
55537ae
Merge pull request #354 from akutuva21/optimize-map-pass-by-value-974…
akutuva21 Jun 2, 2026
182cc30
Merge pull request #355 from akutuva21/refactor/template-molecule-com…
akutuva21 Jun 2, 2026
e68cf2d
Merge pull request #356 from akutuva21/jules-code-health-refactor-tfu…
akutuva21 Jun 2, 2026
4c9201e
Merge pull request #358 from akutuva21/optimize-nfinput-loops-6678347…
akutuva21 Jun 2, 2026
d1508e7
Merge pull request #359 from akutuva21/fix-tinyxml-fread-121535504928…
akutuva21 Jun 2, 2026
7198995
Merge pull request #360 from akutuva21/perf-optimize-mol-types-lookup…
akutuva21 Jun 2, 2026
bf0ec36
test: Add unit test for TemplateMolecule::printDetails and fix segfault
google-labs-jules[bot] Jun 2, 2026
bb36a0f
Merge pull request #344 from akutuva21/testing-printDetails-904828737…
akutuva21 Jun 2, 2026
2487e78
🔒 Replace atoi/atof with safer alternatives in TinyXML
google-labs-jules[bot] Jun 2, 2026
45182a4
🧹 Remove commented-out debug blocks in ReactantTree and DORreaction
google-labs-jules[bot] Jun 2, 2026
f8e3679
Merge pull request #348 from akutuva21/code-health-remove-debug-block…
akutuva21 Jun 2, 2026
46582c6
🧪 Add test for Compartment::printDetails
google-labs-jules[bot] Jun 2, 2026
c43aca4
Merge pull request #352 from akutuva21/test-compartment-printdetails-…
akutuva21 Jun 2, 2026
91f8981
Refactor initReactionRules in NFinput to reduce length
google-labs-jules[bot] Jun 2, 2026
43be80d
Merge pull request #357 from akutuva21/code-health-refactor-initReact…
akutuva21 Jun 2, 2026
c44afe5
Optimize string passing in file dependency functions
google-labs-jules[bot] Jun 2, 2026
2ffedfc
Merge pull request #361 from akutuva21/perf-fix-265020089136434444
akutuva21 Jun 2, 2026
2480ec7
Merge pull request #364 from akutuva21/fix-tinyxml-atoi-atof-29847818…
akutuva21 Jun 2, 2026
9d190d8
Add unit test suite for ReactionClass::fire method
google-labs-jules[bot] Jun 2, 2026
24c301d
Merge pull request #362 from akutuva21/test-reactionclass-fire-528280…
akutuva21 Jun 2, 2026
c93ef2a
Optimize map passing by reference in argument parsing
google-labs-jules[bot] Jun 2, 2026
537b50b
Add test for MoleculeType::printDetails
google-labs-jules[bot] Jun 2, 2026
1bd9bff
Merge pull request #366 from akutuva21/test-print-details-75294123941…
akutuva21 Jun 2, 2026
952fdad
Merge branch 'origin/master' into performance-optimize-map-passing
akutuva21 Jun 2, 2026
87d289a
Merge pull request #365 from akutuva21/performance-optimize-map-passi…
akutuva21 Jun 2, 2026
e41a157
fix: resolve CI validation failures and update deprecated actions
akutuva21 Jun 2, 2026
9641b22
Merge pull request #367 from akutuva21/ci-fixes
akutuva21 Jun 2, 2026
680d4bc
Merge upstream/master into master, resolve conflicts in validate.py a…
akutuva21 Jun 2, 2026
76c39ca
nfsim: 🧹 Remove commented-out system prep loop in System::prepareForS…
akutuva21 Jun 4, 2026
445edb9
nfsim: 🧪 Add missing tests for MappingSet::checkForCollisions
akutuva21 Jun 4, 2026
39f5f0f
nfsim: 🧹 Remove unused commented debug logic in Scheduler.cpp
akutuva21 Jun 4, 2026
39f846c
nfsim: 🧹 Remove Commented Out Property Tagging code in ReactionClass:…
akutuva21 Jun 4, 2026
1bd73da
nfsim: 🧪 [testing improvement] Add test for TransformationSet::addExc…
akutuva21 Jun 4, 2026
eb213d6
nfsim: ⚡ Optimize component lookup in MoleculeType
akutuva21 Jun 4, 2026
b2a4b35
nfsim: 🧪 Add missing test for TransformationSet::addStateChangeTransf…
akutuva21 Jun 4, 2026
684a9af
nfsim: 🧪 [testing improvement] Add missing test for TransformationSet…
akutuva21 Jun 4, 2026
37fe499
nfsim: 🧹 Remove Commented Out Reaction Evaluation in System::sim
akutuva21 Jun 4, 2026
3941509
nfsim: 🧪 [testing improvement] Add test for MoleculeType::addEquivale…
akutuva21 Jun 4, 2026
0dbfce9
nfsim: 🧹 Remove Commented Out Code in Transformation::getListOfAddedM…
akutuva21 Jun 4, 2026
db0cb73
nfsim: 🧹 Remove commented-out equivalency class code in NFinput
akutuva21 Jun 4, 2026
c06aa02
nfsim: 🧹 Remove commented out allowed states logging in NFinput::pars…
akutuva21 Jun 4, 2026
5fbaa93
nfsim: 🧪 Add edge case test for ReactantTree::removeMappingSet on emp…
akutuva21 Jun 4, 2026
e380ebc
nfsim: 🧹 Remove Commented Out Code in Molecule::setComponentState
akutuva21 Jun 4, 2026
661dbed
nfsim: 🧹 Remove Commented Out Variable Declarations in Reaction Class…
akutuva21 Jun 4, 2026
d3a4204
nfsim: ⚡ Optimize `moleculeIds` lookup string search bottlenecks usin…
akutuva21 Jun 4, 2026
95c0dd4
nfsim: 🧹 Remove Hack Dummy Function for MSVC6 strlen()
akutuva21 Jun 4, 2026
385c835
nfsim: 🧹 [code health improvement: Refactored vectors to arrays for t…
akutuva21 Jun 4, 2026
73f4e34
nfsim: 🧹 Refactor Vectors to Arrays for Speedup
akutuva21 Jun 4, 2026
0e20310
nfsim: 🧪 [testing improvement] Add missing test cases for Compartment…
akutuva21 Jun 4, 2026
96c829c
nfsim: 🧹 [Remove MSVC6 compatibility hacks]
akutuva21 Jun 4, 2026
5829171
nfsim: 🧹 Remove Commented Out Observables Loop in System::prepareForS…
akutuva21 Jun 4, 2026
79fbdca
Merge upstream/master into master, resolving merge conflicts
akutuva21 Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ set(SUB_DIRS
src/NFtest/complex
src/NFtest/templateMolecule
src/NFtest/mappingSet
src/NFtest/reactantTree
src/NFscheduler
src/NFreactions/transformations
src/NFreactions/reactions
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.x86.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ set(SUB_DIRS
src/NFtest/reactionClass
src/NFtest/observable
src/NFtest/molecule
src/NFtest/mappingSet
src/NFtest/templateMolecule
src/NFtest/complex
src/NFtest/reactantTree
src/NFscheduler
src/NFreactions/transformations
src/NFreactions/reactions
Expand Down
8 changes: 4 additions & 4 deletions src/NFcore/moleculeType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ void MoleculeType::addEquivalentComponents(vector <vector <string> > &identicalC


bool MoleculeType::isIntegerComponent(const string& cName) const {
for(int c=0; c<numOfComponents; c++)
if(compName[c].compare(cName)==0) {
return this->isIntegerCompState[c];
}
auto it = compNameMap.find(cName);
if (it != compNameMap.end()) {
return this->isIntegerCompState[it->second];
}
cerr<<"!!! error !!! cannot find site name "<< cName << " in MoleculeType: "<<name;
cerr<<"in function isIntegerComponent(string cName). "<<endl;
this->printDetails();
Expand Down
13 changes: 0 additions & 13 deletions src/NFcore/reactionClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,19 +406,6 @@ string ReactionClass::fire(double random_A_number, bool track) {
}


// // output something if the reaction was tagged
// if(tagged) {
// for(unsigned int k=0; k<n_reactants; k++) {
// cout<<" [";
// for(unsigned int p=0; p<mappingSet[k]->getNumOfMappings();p++) {
// Molecule *mForTag = mappingSet[k]->get(p)->getMolecule();
// cout<<" "<<mForTag->getMoleculeTypeName()<<mForTag->getUniqueID();
// }
// cout<<" ]";
// }
// cout<<endl;
// }

// Generate the set of possible products that we need to update
// (excluding new molecules, we'll get those later --Justin)
this->transformationSet->getListOfProducts(mappingSet,products,traversalLimit);
Expand Down
27 changes: 0 additions & 27 deletions src/NFcore/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,6 @@ void System::prepareForSimulation()
//Note!! : the order of preparing the system matters! You have to prepare
//some things before others, because certain things require other

//First, set the observables up correctly, so when functions evaluate, they get the
//correct values
//for(molTypeIter = allMoleculeTypes.begin(); molTypeIter != allMoleculeTypes.end(); molTypeIter++ ) {
// (*molTypeIter)->addAllToObservables();
//}

//First, we have to prep all the functions...
for( functionIter = globalFunctions.begin(); functionIter != globalFunctions.end(); functionIter++ )
(*functionIter)->prepareForSimulation(this);
Expand Down Expand Up @@ -754,14 +748,6 @@ void System::prepareForSimulation()

//cout<<"here 7..."<<endl;

//add all the molecules to the appropriate observables
//NOT NECESSARY - molecules are added to observables when they are prepared
//for(obsIter=obsToOutput.begin(); obsIter != obsToOutput.end(); obsIter++)
// (*obsIter)->clear();
//for(molTypeIter = allMoleculeTypes.begin(); molTypeIter != allMoleculeTypes.end(); molTypeIter++ ) {
// (*molTypeIter)->addAllToObservables();
//}

//Add the complexes to Species observables
int match = 0;
for(obsIter = speciesObservables.begin(); obsIter != speciesObservables.end(); obsIter++)
Expand Down Expand Up @@ -906,9 +892,6 @@ void System::update_A_tot(ReactionClass *r, double old_a, double new_a)
{
a_tot = selector->update(r,old_a,new_a);

//BUILT IN DIRECT SEARCH
//a_tot-=old_a;
//a_tot+=new_a;
}


Expand All @@ -917,16 +900,6 @@ double System::recompute_A_tot()
a_tot = selector->refactorPropensities();
return a_tot;


// BUILT IN DIRECT SEARCH
// //Loop through the reactions and add up the rates
// a_tot = 0;
// for(rxnIter = allReactions.begin(); rxnIter != allReactions.end(); rxnIter++ )
// {
// a_tot += (*rxnIter)->update_a();
// if(DEBUG) (*rxnIter)->printDetails();
// }
// return a_tot;
}


Expand Down
112 changes: 0 additions & 112 deletions src/NFfunction/muParser/muParserFixes.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,117 +58,5 @@
#endif


//---------------------------------------------------------------------------
//
// MSVC6
//
//---------------------------------------------------------------------------


#if defined(_MSC_VER) && _MSC_VER==1200

/** \brief Macro to replace the MSVC6 auto_ptr with the _my_auto_ptr class.

Hijack auto_ptr and replace it with a version that actually does
what an auto_ptr normally does. If you use std::auto_ptr in your other code
might either explode or work much better. The original crap created
by Microsoft, called auto_ptr and bundled with MSVC6 is not standard compliant.
*/
#define auto_ptr _my_auto_ptr

// This is another stupidity that needs to be undone in order to de-pollute
// the global namespace!
#undef min
#undef max


namespace std
{
typedef ::size_t size_t;

//---------------------------------------------------------------------------
/** \brief MSVC6 fix: Put rand into namespace std. */
using ::rand;

//---------------------------------------------------------------------------
/** \brief MSVC6 fix: Put strlen into namespace std. */
using ::strlen;

//---------------------------------------------------------------------------
/** \brief MSVC6 fix: Put strncmp into namespace std. */
using ::strncmp;

//---------------------------------------------------------------------------
template<typename T>
T max(T a, T b)
{
return (a>b) ? a : b;
}

//---------------------------------------------------------------------------
template<typename T>
T min(T a, T b)
{
return (a<b) ? a : b;
}

//---------------------------------------------------------------------------
/** Standard compliant auto_ptr redefinition for MSVC6.

The code is taken from VS.NET 2003, slightly modified to reduce
it's dependencies from other classes.
*/
template<class _Ty>
class _my_auto_ptr
{
public:
typedef _Ty element_type;

explicit _my_auto_ptr(_Ty *_Ptr = 0)
:_Myptr(_Ptr)
{}

_my_auto_ptr(_my_auto_ptr<_Ty>& _Right)
:_Myptr(_Right.release())
{}

template<class _Other>
operator _my_auto_ptr<_Other>()
{
return (_my_auto_ptr<_Other>(*this));
}

template<class _Other>
_my_auto_ptr<_Ty>& operator=(_my_auto_ptr<_Other>& _Right)
{
reset(_Right.release());
return (*this);
}

~auto_ptr() { delete _Myptr; }
_Ty& operator*() const { return (*_Myptr); }
_Ty *operator->() const { return (&**this); }
_Ty *get() const { return (_Myptr); }

_Ty *release()
{
_Ty *_Tmp = _Myptr;
_Myptr = 0;
return (_Tmp);
}

void reset(_Ty* _Ptr = 0)
{
if (_Ptr != _Myptr)
delete _Myptr;
_Myptr = _Ptr;
}

private:
_Ty *_Myptr;
}; // class _my_auto_ptr
} // namespace std

#endif // Microsoft Visual Studio Version 6.0

#endif // include guard
26 changes: 1 addition & 25 deletions src/NFinput/NFinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,6 @@ bool NFinput::initMoleculeTypes(
firstSymSiteToAppend.clear();
}

// prints out allowed state map
//for ( std::map< string, int, std::less< int > >::const_iterator iter = allowedStates.begin();
// iter != allowedStates.end(); ++iter )
// cout << iter->first << '\t' << iter->second << '\n';


//Getting here means we read everything we could successfully
return true;
} catch (...) {
Expand Down Expand Up @@ -996,12 +990,6 @@ static bool processSingleSpecies(
usedComponentNames.clear();


//We dont' have to do this anymore, because we handled it earlier!
//int eqClassCount = mt->getNumOfEquivalencyClasses();
//int *currentCount = new int[eqClassCount];
//for(int i=0; i<eqClassCount; i++) { currentCount[i]=1; }
//string *eqCompNames = mt->getEquivalencyClassCompNames();

//loop to create the actual molecules of this type
vector <Molecule *> currentM;
molecules.push_back(currentM);
Expand All @@ -1016,21 +1004,11 @@ static bool processSingleSpecies(
mids.push_back(mol->getMoleculeType()->getTypeID());
mgids.push_back(mol->getUniqueID());

//for(int i=0; i<eqClassCount; i++) { currentCount[i]=1; }

//Loop through the states and set the ones we need to set
int k=0;
for(snIter = stateName.begin(); snIter != stateName.end(); k++, snIter++ )
{
//if(mt->isEquivalentComponent((*snIter))) {
// int eqNum = mt->getEquivalencyClassNumber((*snIter));
// std::stringstream numStream; numStream << currentCount[eqNum];
// string postFix = numStream.str();
// m->setComponentState((*snIter)+postFix, (int)stateValue.at(k));
// currentCount[eqNum]++;
//} else {
mol->setComponentState((*snIter), (int)stateValue.at(k));
//}
mol->setComponentState((*snIter), (int)stateValue.at(k));

// AS2023 - this is here to reduce the number of operations written
// note that the default molecule starts the component state at the
Expand Down Expand Up @@ -1064,8 +1042,6 @@ static bool processSingleSpecies(

}

//delete [] currentCount;

//Reset the states for the next wave...
stateName.clear();
stateValue.clear();
Expand Down
34 changes: 15 additions & 19 deletions src/NFinput/parseSymRxns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void createFullSymMaps(
//saves all possible names for all possible components
void assembleFullSymmetryList(
vector <vector <vector <component> > > &symmetries, //for output
vector <string> &moleculeIds, //also for output
map <string, int> &moleculeIds, //also for output
map<string,component> &symComps, //the input of symmetric components
bool isRxnCenter //set to true if you are looking at reaction centers
)
Expand All @@ -392,13 +392,13 @@ void assembleFullSymmetryList(
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;
map<string, int>::iterator mIt = moleculeIds.find(thisMoleculeId);
if (mIt != moleculeIds.end()) {
moleculeIndex = mIt->second;
}
if(moleculeIndex==-1) {
moleculeIndex = moleculeIds.size();
moleculeIds.push_back(thisMoleculeId);
moleculeIds[thisMoleculeId] = moleculeIndex;

//Create the vector to store all of our potential permutations
vector <vector <component> > v;
Expand Down Expand Up @@ -430,7 +430,7 @@ void assembleFullSymmetryList(
//saves all possible names for all possible components
void assembleFullSymmetryListOnRxnCenter(
vector <vector <vector <component> > > &symmetries, //for output
vector <string> &moleculeIds, //also for output
map <string, int> &moleculeIds, //also for output
map<string,component> &symComps //the input of symmetric components
)
{
Expand All @@ -449,14 +449,13 @@ void assembleFullSymmetryListOnRxnCenter(
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;
}
map<string, int>::iterator mIt = moleculeIds.find(thisMoleculeId);
if (mIt != moleculeIds.end()) {
moleculeIndex = mIt->second;
}
if(moleculeIndex==-1) {
moleculeIndex = moleculeIds.size();
moleculeIds.push_back(thisMoleculeId);
moleculeIds[thisMoleculeId] = moleculeIndex;

//Create the vector to store all of our potential permutations
vector <vector <component> > v;
Expand Down Expand Up @@ -528,7 +527,7 @@ bool isMoleculePermuationValid(
//
void assembleOffRxnCenterSymClasses(
vector <vector <vector <string> > > &offRxnCenterSymClasses, //the output
vector <string> &moleculeIds, //input list of molecule names
map <string, int> &moleculeIds, //input list of molecule names
map<string,component> &symComps) //input list of symmetric components off the rxn center
{
offRxnCenterSymClasses.clear();
Expand All @@ -550,12 +549,9 @@ void assembleOffRxnCenterSymClasses(
string thisMoleculeId = id.substr(0,length);

int mIndex = -1;
for(unsigned int i=0; i<moleculeIds.size(); i++) {
if(thisMoleculeId.compare(moleculeIds.at(i))==0) {
//cout<<" found at index: "<<i<<endl;
mIndex=i;
break;
}
map<string, int>::iterator mIt = moleculeIds.find(thisMoleculeId);
if (mIt != moleculeIds.end()) {
mIndex = mIt->second;
}
if(mIndex==-1) { cout<<"ERROR in parseSymRxns.cpp - in assebmly of off rxn center sym classes"<<endl; exit(1); }

Expand Down Expand Up @@ -662,7 +658,7 @@ bool NFinput::generateRxnPermutations(vector<map<string,component> > &permutatio
if(verbose) cout<<"\t\t\tGenerating symmetric permutations..."<<endl;

vector <vector <vector <component> > > symmetries;
vector <string> moleculeIds;
map <string, int> moleculeIds;

//Assemble the list of possible components for each symmetric class on a reaction center
assembleFullSymmetryListOnRxnCenter(symmetries,moleculeIds,symRxnCenter);
Expand Down
Loading
Loading