00001 // -*- Mode: C++; tab-width: 2: -*- 00002 // vi: set ts=2: 00003 // 00004 // 00005 00006 #ifndef BALL_QSAR_CONNECTIVITYBASE_H 00007 #define BALL_QSAR_CONNECTIVITYBASE_H 00008 00009 #ifndef BALL_COMMON_GLOBAL_H 00010 #include <BALL/COMMON/global.h> 00011 #endif 00012 00013 #ifndef BALL_QSAR_DESCRIPTOR_H 00014 #include <BALL/QSAR/descriptor.h> 00015 #endif 00016 00017 namespace BALL 00018 { 00019 // forward declarations 00020 template <typename Key, typename Value> class HashMap; 00021 00025 class BALL_EXPORT ConnectivityBase 00026 : public Descriptor 00027 { 00028 public: 00029 00035 ConnectivityBase(); 00036 00039 ConnectivityBase(const ConnectivityBase& cb); 00040 00043 ConnectivityBase(const String& name); 00044 00047 ConnectivityBase(const String& name, const String& unit); 00048 00051 virtual ~ConnectivityBase(); 00053 00059 virtual ConnectivityBase& operator = (const ConnectivityBase& cb); 00061 00065 void computeAllDescriptors(AtomContainer& ac); 00067 00068 protected: 00069 00073 bool isValid_(AtomContainer& ac); 00075 00079 void calculate_(AtomContainer& ac); 00080 00081 00083 00084 00085 private: 00086 00087 /*_ @name Accessors 00088 */ 00090 /*_ Dijkstra recursion. Performs a single source shortest path approach 00091 @param distances to the other nodes are stored in referenced vector<double> 00092 @param Atom which acts as source atom 00093 @param indices map, which maps for each atom a index for the dist vector 00094 */ 00095 void recursion_(std::vector<double>& dists, const Atom* source, HashMap<const Atom*, Size>& index_map); 00097 00098 }; 00099 00100 } // namespace BALL 00101 00102 #endif