chainBuilder.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: chainBuilder.h,v 1.3.10.2 2007/04/03 13:29:43 bertsch Exp $
00005 //
00006 // Author:
00007 //   Holger Franken
00008 //
00009 
00010 
00011 #ifndef BALL_STRUCTURE_CHAINBUILDER_H
00012 #define BALL_STRUCTURE_CHAINBUILDER_H
00013 
00014 #include <BALL/common.h>
00015 
00016 #include <vector>
00017 
00018 namespace BALL
00019 {
00020   class Atom;
00021   class System;
00022 
00027         class BALL_EXPORT ChainBuilder
00028         {
00029         public:
00030 
00034                 ChainBuilder();
00035 
00039                 ~ChainBuilder();
00040 
00046                 vector<vector<Atom*> > buildChains(System& molecule_sys);
00047 
00053                 static bool compareChains(const vector<Atom*>& x, const vector<Atom*>& y);
00054 
00055         private:
00056 
00062                 vector<vector<Size> > calcAdjMatrix(vector<Atom*>& core_chain_atoms);
00063 
00074                 void visit_c_areas(Size& k, vector<vector<Size> >& adj_matrix, vector<int>& val, Size& nodes, Size& id, vector<Atom*>& core_chain_atoms, vector<Atom*>& chain_area);
00075 
00083                 void findChainAreas(Size& nodes, vector<vector<Size> >& adj_matrix, vector<Atom*>& core_chain_atoms, vector<vector<Atom*> >& chain_areas);
00084 
00089                 void findEdges(vector<Atom*>& chain_area);
00090 
00103                 void visit_chains(Size& k,  vector<vector<Size> >& adj_matrix, vector<int>& val, Size& id, vector<Atom*>& chain_area, Size& end, bool& breaker, Size& t, vector<Atom*>& prev_nodes);
00104 
00113                 vector<Atom*> findPath(Atom*& first_edge, Atom*& second_edge,vector<Atom*>& chain_area, vector<vector<Size> >& adj_matrix);
00114 
00121                 vector<vector<Atom*> > findChains(vector<Atom*>& chain_area, vector<vector<Size> >& adj_matrix);
00122 
00129                 Size getIndex(Atom*& atom, vector<Atom*>& container);
00130 
00131         };
00132 
00133 } // namespace BALL
00134 
00135 #endif // BALL_STRUCTURE_CHAINBUILDER_H