source: molecuilder/src/molecule.hpp@ 8fc9b6

Last change on this file since 8fc9b6 was f1ef9cc, checked in by Tillmann Crueger <crueger@…>, 16 years ago

Added simple way to retrieve formula of a molecule using caching

  • Property mode set to 100755
File size: 20.8 KB
RevLine 
[f92d00]1/** \file molecule.hpp
[a0bcf1]2 *
[e0c5b1]3 * Class definitions of atom and molecule, element and periodentafel
[a0bcf1]4 */
5
6#ifndef MOLECULES_HPP_
7#define MOLECULES_HPP_
8
9using namespace std;
10
[17b3a5c]11/*********************************************** includes ***********************************/
12
[a0bcf1]13// GSL headers
[32b6dc]14#include <gsl/gsl_eigen.h>
[a0bcf1]15#include <gsl/gsl_heapsort.h>
[c99adf]16#include <gsl/gsl_linalg.h>
17#include <gsl/gsl_matrix.h>
18#include <gsl/gsl_multimin.h>
19#include <gsl/gsl_vector.h>
[556157]20#include <gsl/gsl_randist.h>
[a0bcf1]21
[eb167d]22//// STL headers
[a0bcf1]23#include <map>
24#include <set>
25#include <deque>
[0a08df]26#include <list>
[67f102]27#include <vector>
[a0bcf1]28
[adcdf8]29#include <string>
30
[17b3a5c]31#include "graph.hpp"
[d50d2a]32#include "stackclass.hpp"
[834ff3]33#include "tesselation.hpp"
[6997fa]34#include "Patterns/Observer.hpp"
[f1ef9cc]35#include "Patterns/Cacheable.hpp"
[a0bcf1]36
[17b3a5c]37/****************************************** forward declarations *****************************/
38
39class atom;
40class bond;
[5f697c]41class BondedParticle;
42class BondGraph;
[17b3a5c]43class element;
44class ForceMatrix;
45class LinkedCell;
[a0bcf1]46class molecule;
[4e4940]47class MoleculeLeafClass;
[a0bcf1]48class MoleculeListClass;
[17b3a5c]49class periodentafel;
50class Vector;
[a0bcf1]51
52/******************************** Some definitions for easier reading **********************************/
53
[eb167d]54#define MoleculeList list <molecule *>
55#define MoleculeListTest pair <MoleculeList::iterator, bool>
56
[dfc1c7]57#define DistancePair pair < double, atom* >
58#define DistanceMap multimap < double, atom* >
59#define DistanceTestPair pair < DistanceMap::iterator, bool>
60
[c830e8e]61
[a0bcf1]62/************************************* Class definitions ****************************************/
63
[104cf4]64/** Structure to contain parameters needed for evaluation of constraint potential.
65 */
66struct EvaluatePotential
67{
68 int startstep; //!< start configuration (MDStep in atom::trajectory)
69 int endstep; //!< end configuration (MDStep in atom::trajectory)
70 atom **PermutationMap; //!< gives target ptr for each atom, array of size molecule::AtomCount (this is "x" in \f$ V^{con}(x) \f$ )
71 DistanceMap **DistanceList; //!< distance list of each atom to each atom
72 DistanceMap::iterator *StepList; //!< iterator to ascend through NearestNeighbours \a **DistanceList
73 int *DoubleList; //!< count of which sources want to move to this target, basically the injective measure (>1 -> not injective)
74 DistanceMap::iterator *DistanceIterators; //!< marks which was the last picked target as injective candidate with smallest distance
75 bool IsAngstroem; //!< whether coordinates are in angstroem (true) or bohrradius (false)
76 double *PenaltyConstants; //!< penalty constant in front of each term
77};
[a0bcf1]78
[556157]79#define MaxThermostats 6 //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented
80enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover }; //!< Thermostat names for output
81
82
[a0bcf1]83/** The complete molecule.
84 * Class incorporates number of types
85 */
[adcdf8]86class molecule : public PointCloud , public Observable {
[a048fa]87 public:
88 double cell_size[6];//!< cell size
[df0520]89 const periodentafel * const elemente; //!< periodic table with each element
[a048fa]90 atom *start; //!< start of atom list
91 atom *end; //!< end of atom list
92 bond *first; //!< start of bond list
93 bond *last; //!< end of bond list
94 int MDSteps; //!< The number of MD steps in Trajectories
95 int AtomCount; //!< number of atoms, brought up-to-date by CountAtoms()
96 int BondCount; //!< number of atoms, brought up-to-date by CountBonds()
97 int ElementCount; //!< how many unique elements are therein
98 int ElementsInMolecule[MAX_ELEMENTS]; //!< list whether element (sorted by atomic number) is alread present or not
[df0520]99 mutable int NoNonHydrogen; //!< number of non-hydrogen atoms in molecule
100 mutable int NoNonBonds; //!< number of non-hydrogen bonds in molecule
101 mutable int NoCyclicBonds; //!< number of cyclic bonds in molecule, by DepthFirstSearchAnalysis()
[a048fa]102 double BondDistance; //!< typical bond distance used in CreateAdjacencyList() and furtheron
103 bool ActiveFlag; //!< in a MoleculeListClass used to discern active from inactive molecules
104 Vector Center; //!< Center of molecule in a global box
105 int IndexNr; //!< index of molecule in a MoleculeListClass
[adcdf8]106 char name[MAXSTRINGSIZE]; //!< arbitrary name
[a048fa]107
[f1ef9cc]108 private:
109 Cacheable<string> formula;
110
[adcdf8]111public:
[df0520]112 molecule(const periodentafel * const teil);
[f4a346]113 virtual ~molecule();
[a048fa]114
[adcdf8]115 //getter and setter
116 const std::string getName();
117 void setName(const std::string);
[f1ef9cc]118 const std::string getFormula();
119 std::string calcFormula();
[adcdf8]120
[834ff3]121 // re-definition of virtual functions from PointCloud
[cc9225]122 const char * const GetName() const;
[543ce4]123 Vector *GetCenter() const ;
[a9b2a0a]124 TesselPoint *GetPoint() const ;
125 TesselPoint *GetTerminalPoint() const ;
[ff4611]126 int GetMaxId() const;
[a9b2a0a]127 void GoToNext() const ;
128 void GoToPrevious() const ;
129 void GoToFirst() const ;
130 void GoToLast() const ;
131 bool IsEmpty() const ;
132 bool IsEnd() const ;
[a048fa]133
[4bc937]134 // templates for allowing global manipulation of all vectors
[8ffe32]135 template <typename res> void ActOnAllVectors( res (Vector::*f)() ) const;
[3efb4a]136 template <typename res> void ActOnAllVectors( res (Vector::*f)() const) const;
[8ffe32]137 template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T), T t ) const;
[3efb4a]138 template <typename res, typename T> void ActOnAllVectors( res (Vector::*f)(T) const, T t ) const;
[8ffe32]139 template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U), T t, U u ) const;
[3efb4a]140 template <typename res, typename T, typename U> void ActOnAllVectors( res (Vector::*f)(T, U) const, T t, U u ) const;
[8ffe32]141 template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V), T t, U u, V v) const;
[3efb4a]142 template <typename res, typename T, typename U, typename V> void ActOnAllVectors( res (Vector::*f)(T, U, V) const, T t, U u, V v) const;
[8ffe32]143
144 // templates for allowing global manipulation of molecule with each atom as single argument
145 template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) ) const;
[3efb4a]146 template <typename res> void ActWithEachAtom( res (molecule::*f)(atom *) const) const;
[8ffe32]147
148 // templates for allowing global copying of molecule with each atom as single argument
149 template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) , molecule *copy) const;
[3efb4a]150 template <typename res> void ActOnCopyWithEachAtom( res (molecule::*f)(atom *) const, molecule *copy) const;
[4bc937]151
[f92d00]152 // templates for allowing global manipulation of all atoms
[6b937bd]153 template <typename res, typename typ> void ActOnAllAtoms( res (typ::*f)() ) const;
154 template <typename res, typename typ> void ActOnAllAtoms( res (typ::*f)() const) const;
155 template <typename res, typename typ, typename T> void ActOnAllAtoms( res (typ::*f)(T), T t ) const;
156 template <typename res, typename typ, typename T> void ActOnAllAtoms( res (typ::*f)(T) const, T t ) const;
157 template <typename res, typename typ, typename T, typename U> void ActOnAllAtoms( res (typ::*f)(T, U), T t, U u ) const;
158 template <typename res, typename typ, typename T, typename U> void ActOnAllAtoms( res (typ::*f)(T, U) const, T t, U u ) const;
159 template <typename res, typename typ, typename T, typename U, typename V> void ActOnAllAtoms( res (typ::*f)(T, U, V), T t, U u, V v) const;
160 template <typename res, typename typ, typename T, typename U, typename V> void ActOnAllAtoms( res (typ::*f)(T, U, V) const, T t, U u, V v) const;
161 template <typename res, typename typ, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (typ::*f)(T, U, V, W), T t, U u, V v, W w) const;
162 template <typename res, typename typ, typename T, typename U, typename V, typename W> void ActOnAllAtoms( res (typ::*f)(T, U, V, W) const, T t, U u, V v, W w) const;
[8ffe32]163
164 // templates for allowing conditional global copying of molecule with each atom as single argument
[94d0ad]165 template <typename res> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) () ) const;
166 template <typename res> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) () const ) const;
167 template <typename res> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) () ) const;
168 template <typename res> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) () const ) const;
169 template <typename res, typename T> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T), T t ) const;
170 template <typename res, typename T> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T) const, T t ) const;
171 template <typename res, typename T> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) (T), T t ) const;
172 template <typename res, typename T> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) (T) const, T t ) const;
173 template <typename res, typename T, typename U> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U), T t, U u ) const;
174 template <typename res, typename T, typename U> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U) const, T t, U u ) const;
175 template <typename res, typename T, typename U> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) (T, U), T t, U u ) const;
176 template <typename res, typename T, typename U> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) (T, U) const, T t, U u ) const;
177 template <typename res, typename T, typename U, typename V> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U, V), T t, U u, V v ) const;
178 template <typename res, typename T, typename U, typename V> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) , molecule *copy, bool (atom::*condition) (T, U, V) const, T t, U u, V v ) const;
179 template <typename res, typename T, typename U, typename V> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) (T, U, V), T t, U u, V v ) const;
180 template <typename res, typename T, typename U, typename V> void ActOnCopyWithEachAtomIfTrue( res (molecule::*f)(atom *) const , molecule *copy, bool (atom::*condition) (T, U, V) const, T t, U u, V v ) const;
[8ffe32]181
182 // templates for allowing global manipulation of an array with one entry per atom
[94d0ad]183 void SetIndexedArrayForEachAtomTo ( atom **array, int ParticleInfo::* index) const;
184 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::* index, void (*Setor)(T *, T *)) const;
185 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::* index, void (*Setor)(T *, T *), T t) const;
186 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::* index, void (*Setor)(T *, T *), T *t) const;
187 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::* index, void (*Setor)(T *, T *)) const;
188 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::* index, void (*Setor)(T *, T *), T t) const;
189 template <typename T> void SetIndexedArrayForEachAtomTo ( T *array, int element::* index, void (*Setor)(T *, T *), T *t) const;
190 template <typename T, typename typ> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::*index, T (atom::*Setor)(typ &), typ atom::*value) const;
191 template <typename T, typename typ> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::*index, T (atom::*Setor)(typ &) const, typ atom::*value) const;
192 template <typename T, typename typ> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::*index, T (atom::*Setor)(typ &), typ &vect ) const;
193 template <typename T, typename typ> void SetIndexedArrayForEachAtomTo ( T *array, int ParticleInfo::*index, T (atom::*Setor)(typ &) const, typ &vect ) const;
[f92d00]194
[ff9879]195 // templates for allowing global manipulation of each atom by entries in an array
[94d0ad]196 template <typename T, typename typ, typename typ2> void SetAtomValueToIndexedArray ( T *array, int typ::*index, T typ2::*value ) const;
197 template <typename T, typename typ> void SetAtomValueToValue ( T value, T typ::*ptr ) const;
[6b937bd]198
199 template <typename res, typename typ> res SumPerAtom(res (typ::*f)() ) const;
200 template <typename res, typename typ> res SumPerAtom(res (typ::*f)() const ) const;
201 template <typename res, typename typ, typename T> res SumPerAtom(res (typ::*f)(T) , T t ) const;
202 template <typename res, typename typ, typename T> res SumPerAtom(res (typ::*f)(T) const, T t ) const;
[872b51]203
[a048fa]204 /// remove atoms from molecule.
205 bool AddAtom(atom *pointer);
206 bool RemoveAtom(atom *pointer);
207 bool UnlinkAtom(atom *pointer);
208 bool CleanupMolecule();
209
210 /// Add/remove atoms to/from molecule.
211 atom * AddCopyAtom(atom *pointer);
212 bool AddXYZFile(string filename);
[543ce4]213 bool AddHydrogenReplacementAtom(bond *Bond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem);
[f92d00]214 bond * AddBond(atom *first, atom *second, int degree = 1);
[a048fa]215 bool RemoveBond(bond *pointer);
216 bool RemoveBonds(atom *BondPartner);
217
218 /// Find atoms.
219 atom * FindAtom(int Nr) const;
220 atom * AskAtom(string text);
221
222 /// Count and change present atoms' coordination.
[543ce4]223 void CountAtoms();
[a048fa]224 void CountElements();
225 void CalculateOrbitals(class config &configuration);
[543ce4]226 bool CenterInBox();
227 bool BoundInBox();
228 void CenterEdge(Vector *max);
229 void CenterOrigin();
230 void CenterPeriodic();
231 void CenterAtVector(Vector *newcenter);
[a048fa]232 void Translate(const Vector *x);
233 void TranslatePeriodically(const Vector *trans);
234 void Mirror(const Vector *x);
235 void Align(Vector *n);
[a9b2a0a]236 void Scale(const double ** const factor);
[1b2aa1]237 void DeterminePeriodicCenter(Vector &center);
[543ce4]238 Vector * DetermineCenterOfGravity();
239 Vector * DetermineCenterOfAll() const;
[1b2aa1]240 void SetNameFromFilename(const char *filename);
[a048fa]241 void SetBoxDimension(Vector *dim);
[543ce4]242 void ScanForPeriodicCorrection();
243 bool VerletForceIntegration(char *file, config &configuration);
[556157]244 void Thermostats(config &configuration, double ActualTemp, int Thermostat);
[543ce4]245 void PrincipalAxisSystem(bool DoRotate);
246 double VolumeOfConvexEnvelope(bool IsAngstroem);
[a048fa]247
[543ce4]248 double ConstrainedPotential(struct EvaluatePotential &Params);
249 double MinimiseConstrainedPotential(atom **&permutation, int startstep, int endstep, bool IsAngstroem);
250 void EvaluateConstrainedForces(int startstep, int endstep, atom **PermutationMap, ForceMatrix *Force);
251 bool LinearInterpolationBetweenConfiguration(int startstep, int endstep, const char *prefix, config &configuration, bool MapByIdentity);
[32b6dc]252
[a048fa]253 bool CheckBounds(const Vector *x) const;
254 void GetAlignvector(struct lsq_params * par) const;
255
256 /// Initialising routines in fragmentation
[543ce4]257 void CreateAdjacencyListFromDbondFile(ifstream *output);
258 void CreateAdjacencyList(double bonddistance, bool IsAngstroem, void (BondGraph::*f)(BondedParticle * const , BondedParticle * const , double &, double &, bool), BondGraph *BG = NULL);
259 int CorrectBondDegree() const;
260 void OutputBondsList() const;
[df0520]261 void CyclicBondAnalysis() const;
[543ce4]262 void OutputGraphInfoPerAtom() const;
263 void OutputGraphInfoPerBond() const;
[b0ee98]264
[a048fa]265
266 // Graph analysis
[543ce4]267 MoleculeLeafClass * DepthFirstSearchAnalysis(class StackClass<bond *> *&BackEdgeStack) const;
268 void CyclicStructureAnalysis(class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize) const;
269 bool PickLocalBackEdges(atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack) const;
[df0520]270 bond * FindNextUnused(atom *vertex) const;
271 void SetNextComponentNumber(atom *vertex, int nr) const;
272 void ResetAllBondsToUnused() const;
[543ce4]273 int CountCyclicBonds();
274 bool CheckForConnectedSubgraph(KeySet *Fragment);
[df0520]275 string GetColor(enum Shading color) const;
[872b51]276 bond * CopyBond(atom *left, atom *right, bond *CopyBond);
277
[a048fa]278
279 molecule *CopyMolecule();
[94d0ad]280 molecule* CopyMoleculeFromSubRegion(const Vector offset, const double *parallelepiped) const;
[a048fa]281
282 /// Fragment molecule by two different approaches:
[543ce4]283 int FragmentMolecule(int Order, config *configuration);
284 bool CheckOrderAtSite(bool *AtomMask, Graph *GlobalKeySetList, int Order, int *MinimumRingSize, char *path = NULL);
[6d0fcaa]285 bool StoreBondsToFile(char *path);
[543ce4]286 bool StoreAdjacencyToFile(char *path);
287 bool CheckAdjacencyFileAgainstMolecule(char *path, atom **ListOfAtoms);
288 bool ParseOrderAtSiteFromFile(char *path);
289 bool StoreOrderAtSiteFile(char *path);
290 bool StoreForcesFile(MoleculeListClass *BondFragments, char *path, int *SortIndex);
291 bool CreateMappingLabelsToConfigSequence(int *&SortIndex);
292 void BreadthFirstSearchAdd(molecule *Mol, atom **&AddedAtomList, bond **&AddedBondList, atom *Root, bond *Bond, int BondOrder, bool IsAngstroem);
[a048fa]293 /// -# BOSSANOVA
[543ce4]294 void FragmentBOSSANOVA(Graph *&FragmentList, KeyStack &RootStack, int *MinimumRingSize);
295 int PowerSetGenerator(int Order, struct UniqueFragments &FragmentSearch, KeySet RestrictedKeySet);
296 bool BuildInducedSubgraph(const molecule *Father);
297 molecule * StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem);
298 void SPFragmentGenerator(struct UniqueFragments *FragmentSearch, int RootDistance, bond **BondsSet, int SetDimension, int SubOrder);
299 int LookForRemovalCandidate(KeySet *&Leaf, int *&ShortestPathList);
300 int GuesstimateFragmentCount(int order);
[a048fa]301
302 // Recognize doubly appearing molecules in a list of them
[543ce4]303 int * IsEqualToWithinThreshold(molecule *OtherMolecule, double threshold);
304 int * GetFatherSonAtomicMap(molecule *OtherMolecule);
[a048fa]305
306 // Output routines.
[543ce4]307 bool Output(ofstream * const output);
308 bool OutputTrajectories(ofstream * const output);
309 void OutputListOfBonds() const;
310 bool OutputXYZ(ofstream * const output) const;
311 bool OutputTrajectoriesXYZ(ofstream * const output);
312 bool Checkout(ofstream * const output) const;
313 bool OutputTemperatureFromTrajectories(ofstream * const output, int startstep, int endstep);
[a048fa]314
[f00f02]315 // Manipulation routines
316 void flipActiveFlag();
317
[a048fa]318 private:
319 int last_atom; //!< number given to last atom
[a9b2a0a]320 mutable atom *InternalPointer; //!< internal pointer for PointCloud
[a0bcf1]321};
322
[8ffe32]323#include "molecule_template.hpp"
[4bc937]324
[a0bcf1]325/** A list of \a molecule classes.
326 */
[6997fa]327class MoleculeListClass : public Observable {
[a048fa]328 public:
329 MoleculeList ListOfMolecules; //!< List of the contained molecules
330 int MaxIndex;
331
332 MoleculeListClass();
333 ~MoleculeListClass();
334
[543ce4]335 bool AddHydrogenCorrection(char *path);
336 bool StoreForcesFile(char *path, int *SortIndex);
[1b2aa1]337 void insert(molecule *mol);
[a048fa]338 molecule * ReturnIndex(int index);
[543ce4]339 bool OutputConfigForListOfFragments(config *configuration, int *SortIndex);
[a048fa]340 int NumberOfActiveMolecules();
341 void Enumerate(ofstream *out);
342 void Output(ofstream *out);
[478683]343 void DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration);
[486aa5]344 int CountAllAtoms() const;
[a048fa]345
[f48622]346 // Methods moved here from the menus
347 // TODO: more refactoring needed on these methods
[fab853]348 void flipChosen();
[f48622]349 void createNewMolecule(periodentafel *periode);
350 void loadFromXYZ(periodentafel *periode);
351 void setMoleculeFilename();
352 void parseXYZIntoMolecule();
353 void eraseMolecule();
354
[fab853]355
[a048fa]356 // merging of molecules
[c830e8e]357 bool SimpleMerge(molecule *mol, molecule *srcmol);
358 bool SimpleAdd(molecule *mol, molecule *srcmol);
359 bool SimpleMultiMerge(molecule *mol, int *src, int N);
360 bool SimpleMultiAdd(molecule *mol, int *src, int N);
361 bool ScatterMerge(molecule *mol, int *src, int N);
362 bool EmbedMerge(molecule *mol, molecule *srcmol);
363
[a048fa]364 private:
[a0bcf1]365};
366
367
368/** A leaf for a tree of \a molecule class
369 * Wraps molecules in a tree structure
370 */
371class MoleculeLeafClass {
[a048fa]372 public:
373 molecule *Leaf; //!< molecule of this leaf
374 //MoleculeLeafClass *UpLeaf; //!< Leaf one level up
375 //MoleculeLeafClass *DownLeaf; //!< First leaf one level down
376 MoleculeLeafClass *previous; //!< Previous leaf on this level
377 MoleculeLeafClass *next; //!< Next leaf on this level
378
379 //MoleculeLeafClass(MoleculeLeafClass *Up, MoleculeLeafClass *Previous);
380 MoleculeLeafClass(MoleculeLeafClass *PreviousLeaf);
381 ~MoleculeLeafClass();
382
383 bool AddLeaf(molecule *ptr, MoleculeLeafClass *Previous);
[543ce4]384 bool FillBondStructureFromReference(const molecule * const reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList = false);
385 bool FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter);
386 bool AssignKeySetsToFragment(molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false);
387 bool FillListOfLocalAtoms(atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList);
388 void TranslateIndicesToGlobalIDs(Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph);
[a048fa]389 int Count() const;
[a0bcf1]390};
391
[88b936]392
[a0bcf1]393#endif /*MOLECULES_HPP_*/
394
Note: See TracBrowser for help on using the repository browser.