Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _RD_GASTEIGERPARAMS_H
00011 #define _RD_GASTEIGERPARAMS_H
00012
00013 #include <RDGeneral/types.h>
00014 #include <string>
00015 #include <map>
00016
00017 namespace RDKit {
00018 extern std::string paramData;
00019
00020
00021
00022 const double IONXH = 20.02;
00023
00024 const double DAMP_SCALE = 0.5;
00025 const double DAMP = 0.5;
00026
00027 class GasteigerParams {
00028
00029
00030
00031
00032
00033
00034
00035
00036 public:
00037
00038 static GasteigerParams *getParams();
00039
00040 ~GasteigerParams() {
00041 d_paramMap.clear();
00042 }
00043
00044 DOUBLE_VECT getParams(std::string elem, std::string mode,bool throwOnFailure=false) {
00045 std::pair<std::string, std::string> query(elem, mode);
00046 if (d_paramMap.find(query) != d_paramMap.end()) {
00047 return d_paramMap[query];
00048 }
00049 else {
00050 if(throwOnFailure){
00051 std::string message = "ERROR: No Gasteiger Partial Charge parameters for Element: ";
00052 message += elem;
00053 message += " Mode: ";
00054 message += mode;
00055 throw message.c_str();
00056 } else {
00057 return d_paramMap[std::make_pair<std::string,std::string>("X","*")];
00058 }
00059 }
00060 }
00061
00062 private:
00063 GasteigerParams();
00064 std::map<std::pair<std::string, std::string>, DOUBLE_VECT> d_paramMap;
00065
00066 static class GasteigerParams *ds_instance;
00067 };
00068 };
00069
00070 #endif