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 ConnectivityBase& operator = (const ConnectivityBase& cb); 00060 00061 protected: 00062 00066 bool isValid_(AtomContainer& ac); 00068 00072 void calculate_(AtomContainer& ac); 00074 00075 00076 private: 00077 00078 /*_ @name Accessors 00079 */ 00081 /*_ Dijkstra recursion. Performs a single source shortest path approach 00082 @param distances to the other nodes are stored in referenced vector<double> 00083 @param Atom which acts as source atom 00084 @param indices map, which maps for each atom a index for the dist vector 00085 */ 00086 void recursion_(std::vector<double>& dists, const Atom* source, HashMap<const Atom*, Size>& index_map); 00088 00089 }; 00090 00091 } // namespace BALL 00092 00093 #endif