Skip to content

Commit

Permalink
Merge pull request #70 from cando-developers/hash-table-changes
Browse files Browse the repository at this point in the history
Hash table changes
  • Loading branch information
Bike authored Jan 22, 2025
2 parents e3ce830 + f1407e3 commit a85eea6
Show file tree
Hide file tree
Showing 65 changed files with 140 additions and 145 deletions.
2 changes: 1 addition & 1 deletion include/cando/adapt/indexedObjectBag.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace adapt {

public:
GCPRIVATE:
gc::Nilable<core::HashTableEq_sp> _Bag;
gc::Nilable<core::HashTable_sp> _Bag;
gc::Fixnum _NextIndex;
public:

Expand Down
2 changes: 1 addition & 1 deletion include/cando/adapt/objectSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SMART(ObjectSet);
public:

GCPRIVATE:
HashTableEq_sp _Set;
HashTable_sp _Set;

public:
CL_NAME("CONTAINS");
Expand Down
2 changes: 1 addition & 1 deletion include/cando/adapt/stringList.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SMART(StringList);
void setFromString(const string &s);
string asString();

core::HashTableEqual_sp asStringSet();
core::HashTable_sp asStringSet();

#ifdef USEBOOSTPYTHON
void python_setFromList(boost::python::list res);
Expand Down
2 changes: 1 addition & 1 deletion include/cando/adapt/stringSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SMART(StringSet);
void initialize();

private:
HashTableEqual_sp strs;
HashTable_sp strs;
bool rest;

public:
Expand Down
2 changes: 1 addition & 1 deletion include/cando/adapt/symbolSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ SMART(SymbolSet);
bool fieldsp() const { return true; };
void fields(core::Record_sp node);
GCPRIVATE:
HashTableEq_sp _Symbols;
HashTable_sp _Symbols;

public:
static SymbolSet_sp make(List_sp vals);
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/candoDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CandoDatabase_O : public core::CxxObject_O
core::Symbol_sp _Name;
string _DateCreated;
string _DateUpdated;
core::HashTableEq_sp _Topologys;
core::HashTable_sp _Topologys;

private:
/*! Return true if the entity with the name (name) is recognized and is a subclass of classId
Expand Down
14 changes: 7 additions & 7 deletions include/cando/chem/chemInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ size_t calculate_maxtag(ChemInfoNode_sp node);
bool fieldsp() const { return true; };
void fields(core::Record_sp node);
public:
static ChemInfoMatch_sp make(Root_sp root,size_t maxtag, core::HashTableEql_sp ring);
static ChemInfoMatch_sp make(Root_sp root,size_t maxtag, core::HashTable_sp ring);
public:
bool _Matches;
size_t _MaxTagPlus1;
Root_sp _Root;
core::HashTableEql_sp _RingLookup;
core::HashTable_sp _RingLookup;
core::SimpleVector_sp _TagLookup; // core::StringMap<Atom_O> _TagLookup;
core::List_sp _TagHistory;
public:
Expand All @@ -99,7 +99,7 @@ size_t calculate_maxtag(ChemInfoNode_sp node);
CL_LISPIFY_NAME("tag");
CL_DEFMETHOD chem::Atom_sp tag(core::T_sp tag) { return this->getAtomWithTag(tag);};
CL_DEFMETHOD core::List_sp tag_history() const { return this->_TagHistory; };
core::HashTableEql_sp tags_as_hashtable() const;
core::HashTable_sp tags_as_hashtable() const;
core::Vector_sp tags_as_vector() const;
void forgetAtomTag(core::T_sp tag);

Expand Down Expand Up @@ -134,7 +134,7 @@ CL_DEFMETHOD chem::Atom_sp tag(core::T_sp tag) { return this->getAtomWithTag
bool fieldsp() const { return true; };
void fields(core::Record_sp node);
private:
core::HashTableEqual_sp _AtomWildCards; // core::StringMap<adapt::StringSet_O> _AtomWildCards;
core::HashTable_sp _AtomWildCards; // core::StringMap<adapt::StringSet_O> _AtomWildCards;
public:
void addWildName(core::Symbol_sp wildName);
void addWildNameMap(core::Symbol_sp wildName, core::Symbol_sp elementName );
Expand Down Expand Up @@ -1067,7 +1067,7 @@ class Root_O : public AtomOrBondMatchNode_O
auto obj = gctools::GC<Root_O>::allocate( originalCode, node, maxtag ); // RP_Create<Root_O>(lisp);
return obj;
}
core::HashTableEq_sp lazyTests();
core::HashTable_sp lazyTests();
void setTests(core::List_sp tests);
void addTest(core::Symbol_sp testSymbol, core::Function_sp testCode);
bool evaluateTest(core::Symbol_sp testSym, Atom_sp atom);
Expand Down Expand Up @@ -1220,7 +1220,7 @@ class MoleculeGraph_O : public core::CxxObject_O
public:
void initialize();
public:
core::HashTableEq_sp _nodes_to_index;
core::HashTable_sp _nodes_to_index;
core::ComplexVector_T_sp _nodes;
MoleculeGraphType* _moleculeGraph;
size_t _num_edges;
Expand Down Expand Up @@ -1314,7 +1314,7 @@ class ChemInfoGraph_O : public core::CxxObject_O
void initialize();
public:
Root_sp _Root;
core::HashTableEq_sp _nodes_to_index;
core::HashTable_sp _nodes_to_index;
gctools::Vec0<size_t> _nodeOrder;
gctools::Vec0<ChemInfoNode_sp> _atomNodes;
gctools::Vec0<BondToAtomTest_sp> _bondNodes;
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/chemdraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class CDFragment_O : public core::CxxObject_O
CDBonds _Bonds;
int _LargestId;
gc::Nilable<Molecule_sp> _Molecule;
// core::HashTableEq_sp _Properties;
// core::HashTable_sp _Properties;
public:
void initialize();
public:
Expand Down
8 changes: 4 additions & 4 deletions include/cando/chem/conformationCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ConformationCollectionEntry_O : public core::CxxObject_O
public:
ConformationCollection_sp _WeakConformationCollection;
geom::SimpleVectorCoordinate_sp _AllCoordinates;
core::HashTableEq_sp _Data;
core::HashTable_sp _Data;

public:
void setAllCoordinates(geom::SimpleVectorCoordinate_sp ac);
Expand All @@ -75,7 +75,7 @@ class ConformationCollectionEntry_O : public core::CxxObject_O

CL_DEFMETHOD ConformationCollection_sp getConformationCollection() {_OF(); ASSERTNOTNULL(this->_WeakConformationCollection);return this->_WeakConformationCollection;};
void setConformationCollection(ConformationCollection_sp s);
// core::HashTableEq_sp getData() { return this->_Data; };
// core::HashTable_sp getData() { return this->_Data; };

void translateAllCoordinates(const Vector3& offset);

Expand Down Expand Up @@ -120,15 +120,15 @@ class ConformationCollection_O : public core::CxxObject_O
Matter_sp _Matter;
gctools::Vec0<ConformationCollectionEntry_sp> _Entries;
gctools::SmallOrderedSet<Atom_sp> _AllAtoms;
core::HashTableEq_sp _Data;
core::HashTable_sp _Data;
public:
typedef gctools::Vec0<ConformationCollectionEntry_sp>::iterator entryIterator;
typedef gctools::Vec0<ConformationCollectionEntry_sp>::const_iterator const_entryIterator;
typedef gctools::SmallOrderedSet<Atom_sp>::iterator atomIterator;
public:
geom::SimpleVectorCoordinate_sp _SimpleVectorCoordinate(Matter_sp matter);
public:
core::HashTableEq_sp getData() { return this->_Data;};
core::HashTable_sp getData() { return this->_Data;};

void saveAs(const string& fn);

Expand Down
12 changes: 6 additions & 6 deletions include/cando/chem/conformationExplorer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ConformationExplorerEntryStage_O : public core::CxxObject_O
bool _Complete;
ConformationExplorerEntry_sp _WeakConformationExplorerEntry;
geom::SimpleVectorCoordinate_sp _FinalCoordinates;
core::HashTableEq_sp _Binder;
core::HashTable_sp _Binder;
//! Energy of the conformation in kcal as calculated by the package/model
double _EnergyKCal;
//! ExternalInterfaceName is cando, gamess, gaussian, nwchem etc
Expand Down Expand Up @@ -123,7 +123,7 @@ CL_DEFMETHOD void setComplete(bool b) { this->_Complete = b;};

void setConformationExplorerEntry(ConformationExplorerEntry_sp s);
CL_LISPIFY_NAME("getBinder");
CL_DEFMETHOD core::HashTableEq_sp getBinder() { return this->_Binder; };
CL_DEFMETHOD core::HashTable_sp getBinder() { return this->_Binder; };

void translateFinalCoordinates(const Vector3& offset);

Expand Down Expand Up @@ -180,14 +180,14 @@ class ConformationExplorerEntry_O : public core::CxxObject_O
ConformationExplorerEntryStage_sp _SelectedStage;
/*! Every time an entry is created it gets a new UniqueEntryIndex */
int _UniqueEntryIndex;
core::HashTableEq_sp _Binder;
core::HashTable_sp _Binder;
public:
typedef gctools::Vec0<ConformationExplorerEntryStage_sp>::iterator stageIterator;
public:
CL_LISPIFY_NAME("getConformationExplorer");
CL_DEFMETHOD ConformationExplorer_sp getConformationExplorer() {_OF(); ASSERTNOTNULL(this->_WeakConformationExplorer);return this->_WeakConformationExplorer;};
void setConformationExplorer(ConformationExplorer_sp s);
core::HashTableEq_sp getBinder() { return this->_Binder; };
core::HashTable_sp getBinder() { return this->_Binder; };
public:

stageIterator begin_Stages() { return this->_Stages.begin(); };
Expand Down Expand Up @@ -260,7 +260,7 @@ friend class ConformationExplorerEntryStage_O;
gctools::Vec0<ConformationExplorerEntry_sp> _Entries;
gctools::SmallOrderedSet<Atom_sp> _AllAtoms;
core::ComplexVector_byte32_t_sp _SuperposeAtomIndexes;
core::HashTableEq_sp _Binder;
core::HashTable_sp _Binder;
protected:
Atom_sp _getAtomAtIndex(unsigned i);
public:
Expand Down Expand Up @@ -288,7 +288,7 @@ friend class ConformationExplorerEntryStage_O;

public:
CL_LISPIFY_NAME("getBinder");
CL_DEFMETHOD core::HashTableEq_sp getBinder() { return this->_Binder;};
CL_DEFMETHOD core::HashTable_sp getBinder() { return this->_Binder;};

void saveAs(const string& fn);

Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/elements.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ElementsInfo_O : public core::CxxObject_O
void initialize();
public:
gctools::Vec0<AtomicInfo> _atomicInfo;
core::HashTableEq_sp _elementFromAtomicSymbol;
core::HashTable_sp _elementFromAtomicSymbol;
gctools::Vec0<HybridizationInfo> _hybridizationInfo;
gctools::Vec0<int> _atomicNumberToAtomicInfoIndex;
gctools::Vec0<int> _atomicMassToAtomicInfoIndex;
Expand Down
4 changes: 2 additions & 2 deletions include/cando/chem/energyAtomTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class AtomTable_O : public core::CxxObject_O
void initialize();
public:
gctools::Vec0<EnergyAtom> _Atoms;
core::HashTableEq_sp _AtomTableIndexes; // m a p<Atom_sp,uint> _AtomTableIndexes;
core::HashTable_sp _AtomTableIndexes; // m a p<Atom_sp,uint> _AtomTableIndexes;
core::ComplexVector_int32_t_sp _ResiduePointers;
core::ComplexVector_T_sp _ResidueNames;
//! Store count of atoms in each molecule. The length of this vector is the number of molecules
Expand Down Expand Up @@ -232,7 +232,7 @@ class AtomTable_O : public core::CxxObject_O
//
// Access fields in AtomTable elements directly
//
core::HashTableEq_sp getAtomTableIndexes();
core::HashTable_sp getAtomTableIndexes();
CL_DEFMETHOD MatterName elt_atom_name(int index) { return this->_Atoms[index]._AtomName; };
CL_DEFMETHOD core::Symbol_sp elt_atom_type(int index,core::HashTable_sp atomTypes);
CL_DEFMETHOD Atom_sp elt_atom(int index) { return this->_Atoms[index].atom(); };
Expand Down
6 changes: 3 additions & 3 deletions include/cando/chem/ffBaseDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ class FFParameterBaseDb_O : public FFBaseDb_O {
void fields(core::Record_sp node);
void initialize();
public:
core::HashTableEq_sp _Parameters;
core::HashTable_sp _Parameters;
core::ComplexVector_T_sp _ParameterVector;
public:
virtual void forceFieldMerge(FFBaseDb_sp other);
FFParameterBaseDb_O() : FFBaseDb_O(), _Parameters(unbound<core::HashTableEq_O>()) {};
core::HashTableEq_sp parameters() const;
FFParameterBaseDb_O() : FFBaseDb_O(), _Parameters(unbound<core::HashTable_O>()) {};
core::HashTable_sp parameters() const;
string __repr__() const;
};

Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/ffTypesDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CL_LISPIFY_NAME("FFTypesDb-numberOfRules");
CL_DEFMETHOD int numberOfRules() { return this->_TypeAssignmentRules.size();};
chem::FFTypeRule_sp getRule(uint index);

core::HashTableEq_sp atomTypes(chem::Matter_sp matter);
core::HashTable_sp atomTypes(chem::Matter_sp matter);

core::HashTable_sp assignTypes( chem::Matter_sp matter, core::HashTable_sp atom_types );
core::Symbol_sp assignType( chem::Atom_sp atom );
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/mol2.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ string mol2AtomType(Atom_sp a);

core::HashTable_sp assignSybylTypes(Matter_sp matter);

core::HashTableEql_sp mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTable_sp atom_types );
core::HashTable_sp mol2WriteAggregateStream( Aggregate_sp agg, std::ostream &out, core::HashTable_sp atom_types );
void mol2WriteAggregateToFileName( Aggregate_sp a, core::T_sp sFileName, core::HashTable_sp atom_types );

void mol2WriteDumbAggregateToFileName( Aggregate_O& a, core::T_sp sFileName, core::HashTable_sp atom_types );
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/monomerContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class MonomerContext_O : public core::CxxObject_O
* recognizes. This is done by expanding all
* group names to monomer names.
*/
core::HashTableEqual_sp getAllSpecificKeys();
core::HashTable_sp getAllSpecificKeys();
//! Return the first specific key
core::Symbol_sp getFirstSpecificKey();

Expand Down
4 changes: 2 additions & 2 deletions include/cando/chem/octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class AddIonOctree_O : public core::CxxObject_O {
gctools::Vec0<double> PdHalfEdges;
gctools::Vec0<double> PdHalfDiagonals;
gctools::Vec0<Atom_sp> vaAtoms;
core::HashTableEq_sp atomsToResidues;
core::HashTableEq_sp residuesToMolecules;
core::HashTable_sp atomsToResidues;
core::HashTable_sp residuesToMolecules;
OctNode_sp onHead;

public:
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/oligomer.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Oligomer_O : public core::CxxObject_O
void checkMonomersAndNeighborsForErrors(CandoDatabase_sp bdb, gctools::SmallOrderedSet<Monomer_sp>& monomers ); // s e t<Monomer_sp> monomers);
void checkMonomersAndNotNeighborsForErrors(CandoDatabase_sp bdb, gctools::SmallOrderedSet<Monomer_sp>& monomers ); // s e t<Monomer_sp> monomers);
void signal_monomerContentsChanged();
core::HashTableEqual_sp allAliases();
core::HashTable_sp allAliases();

public:
// Atomic oligomer modifying routines
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/ringFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class RingFinder_O : public core::CxxObject_O
private:
core::HashTable_sp _vertices;
gctools::Vec0<AGEdge_sp> _edges;
core::HashTableEql_sp _rings; // m a p<uint,core::List_sp> _rings;
core::HashTable_sp _rings; // m a p<uint,core::List_sp> _rings;
gctools::Vec0<PathMessage_sp> _finalRings;
gctools::Vec0<core::SimpleBitVector_sp> _gaussian;
public:
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/spanningLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace chem {
AtomFlags fVisibleFlagsOn;
AtomFlags fVisibleFlagsOff;
int iTempInt;
core::HashTableEq_sp _BackSpan;
core::HashTable_sp _BackSpan;

void clearAtomIndexes();
core::T_sp next(core::T_sp funcDesig);
Expand Down
8 changes: 4 additions & 4 deletions include/cando/chem/structureList.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static Structure_Old_ListEntry_sp create(Structure_Old_List_sp s);
Structure_Old_List_sp _WeakStructureList;
geom::SimpleVectorCoordinate_sp _AllCoordinates;
geom::SimpleVectorCoordinate_sp _SuperposeCoordinates;
core::HashTableEq_sp _Data;
core::HashTable_sp _Data;
uint _Members;

public:
Expand All @@ -87,7 +87,7 @@ static Structure_Old_ListEntry_sp create(Structure_Old_List_sp s);

void translateAllCoordinates(const Vector3& offset);

core::HashTableEq_sp getData() { return this->_Data;};
core::HashTable_sp getData() { return this->_Data;};

void setAllCoordinates(geom::SimpleVectorCoordinate_sp ac);
geom::SimpleVectorCoordinate_sp getAllCoordinates() { return this->_AllCoordinates; }
Expand Down Expand Up @@ -126,15 +126,15 @@ class Structure_Old_List_O : public core::CxxObject_O
gctools::SmallOrderedSet<Atom_sp> _AllAtoms;
gctools::SmallOrderedSet<Atom_sp> _SuperposeAtoms;
double _RmsCutOff;
core::HashTableEq_sp _Data;
core::HashTable_sp _Data;
protected:

public:
// static Structure_Old_List_sp open_StructureList(const string& fn);

public:

core::HashTableEq_sp getData() { return this->_Data;};
core::HashTable_sp getData() { return this->_Data;};
typedef gctools::Vec0<Structure_Old_ListEntry_sp>::iterator entryIterator;

void saveAs(const string& fn);
Expand Down
2 changes: 1 addition & 1 deletion include/cando/chem/trajectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Trajectory_O : public core::CxxObject_O
Matter_sp _Matter;
gctools::Vec0<Atom_sp> _AtomList;
gctools::Vec0<TrajectoryFrame_sp> _Frames;
core::HashTableEq_sp _Namespace;
core::HashTable_sp _Namespace;

public:
bool fieldsp() const { return true; };
Expand Down
2 changes: 1 addition & 1 deletion include/cando/kinematics/old/chainNode.fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace kinematics
{
FORWARD(ChainNode);

typedef core::HashTableEq_sp RingClosingMonomerMap;
typedef core::HashTable_sp RingClosingMonomerMap;


}; /* kinematics */
Expand Down
1 change: 0 additions & 1 deletion src/adapt/adaptPackage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ This is an open source license for the CANDO software from Temple University, bu
#include <clasp/core/symbolToEnumConverter.h>
#include <clasp/core/symbol.h>
#include <clasp/core/lispList.h>
#include <clasp/core/weakHashTable.h>
#include <clasp/core/weakPointer.h>
#include <clasp/core/wrappedPointer.h>
#include <clasp/llvmo/llvmoExpose.h>
Expand Down
2 changes: 1 addition & 1 deletion src/adapt/indexedObjectBag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace adapt {
using namespace core;

void IndexedObjectBag_O::initialize() {
this->_Bag = HashTableEq_O::create_default();
this->_Bag = HashTable_O::createEq();
}

CL_LISPIFY_NAME("set_next_available_entry");
Expand Down
2 changes: 1 addition & 1 deletion src/adapt/objectSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace adapt {

void ObjectSet_O::initialize() {
this->Base::initialize();
this->_Set = HashTableEq_O::create_default();
this->_Set = HashTable_O::createEq();
}

CL_LISPIFY_NAME("addObjects");
Expand Down
Loading

0 comments on commit a85eea6

Please sign in to comment.