12 #ifndef __RD_MMFFPARAMS_H__ 13 #define __RD_MMFFPARAMS_H__ 22 #include <boost/cstdint.hpp> 25 #define M_PI 3.14159265358979323846 42 return ((x < 1.0e-10) && (x > -1.0e-10));
47 }
else if (x < -1.0) {
177 const boost::uint8_t *aromatic_types = NULL);
183 return ((std::find(d_params.begin(), d_params.end(), atomType) !=
193 std::vector<boost::uint8_t> d_params;
222 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 223 std::map<const unsigned int, MMFFDef>::const_iterator res;
224 res = d_params.find(atomType);
226 return ((res != d_params.end()) ? &((*res).second) : NULL);
228 return ((atomType && (atomType <= d_params.size()))
229 ? &d_params[atomType - 1]
238 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 239 std::map<const unsigned int, MMFFDef> d_params;
241 std::vector<MMFFDef> d_params;
270 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 271 std::map<const unsigned int, MMFFProp>::const_iterator res;
272 res = d_params.find(atomType);
274 return ((res != d_params.end()) ? &((*res).second) : NULL);
276 std::pair<std::vector<boost::uint8_t>::const_iterator,
277 std::vector<boost::uint8_t>::const_iterator> bounds =
278 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), atomType);
280 return ((bounds.first != bounds.second)
281 ? &d_params[bounds.first - d_iAtomType.begin()]
290 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 291 std::map<const unsigned int, MMFFProp> d_params;
293 std::vector<MMFFProp> d_params;
294 std::vector<boost::uint8_t> d_iAtomType;
323 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 324 std::map<const unsigned int, MMFFPBCI>::const_iterator res;
325 res = d_params.find(atomType);
327 return ((res != d_params.end()) ? &((*res).second) : NULL);
329 return ((atomType && (atomType <= d_params.size()))
330 ? &d_params[atomType - 1]
339 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 340 std::map<const unsigned int, MMFFPBCI> d_params;
342 std::vector<MMFFPBCI> d_params;
371 const unsigned int bondType,
const unsigned int iAtomType,
372 const unsigned int jAtomType) {
374 const MMFFChg *mmffChgParams = NULL;
375 unsigned int canIAtomType = iAtomType;
376 unsigned int canJAtomType = jAtomType;
377 if (iAtomType > jAtomType) {
378 canIAtomType = jAtomType;
379 canJAtomType = iAtomType;
382 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 383 std::map<
const unsigned int,
384 std::map<const unsigned int, MMFFChg> >::const_iterator res1;
385 std::map<const unsigned int, MMFFChg>::const_iterator res2;
386 res1 = d_params[bondType].find(canIAtomType);
387 if (res1 != d_params[bondType].end()) {
388 res2 = ((*res1).second).find(canJAtomType);
389 if (res2 != ((*res1).second).end()) {
390 mmffChgParams = &((*res2).second);
394 std::pair<std::vector<boost::uint8_t>::const_iterator,
395 std::vector<boost::uint8_t>::const_iterator> bounds;
398 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canIAtomType);
399 if (bounds.first != bounds.second) {
400 bounds = std::equal_range(
401 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
402 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
404 if (bounds.first != bounds.second) {
405 bounds = std::equal_range(
406 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
407 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
409 if (bounds.first != bounds.second) {
410 mmffChgParams = &d_params[bounds.first - d_bondType.begin()];
416 return std::make_pair(sign, mmffChgParams);
424 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 427 std::map<const unsigned int, std::map<const unsigned int, MMFFChg> > >
430 std::vector<MMFFChg> d_params;
431 std::vector<boost::uint8_t> d_iAtomType;
432 std::vector<boost::uint8_t> d_jAtomType;
433 std::vector<boost::uint8_t> d_bondType;
462 const unsigned int atomType,
463 const unsigned int nbrAtomType) {
464 const MMFFBond *mmffBondParams = NULL;
465 unsigned int canAtomType = atomType;
466 unsigned int canNbrAtomType = nbrAtomType;
467 if (atomType > nbrAtomType) {
468 canAtomType = nbrAtomType;
469 canNbrAtomType = atomType;
471 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 472 std::map<
const unsigned int,
473 std::map<
const unsigned int,
474 std::map<const unsigned int, MMFFBond> > >::const_iterator
476 std::map<
const unsigned int,
477 std::map<const unsigned int, MMFFBond> >::const_iterator res2;
478 std::map<const unsigned int, MMFFBond>::const_iterator res3;
479 res1 = d_params.find(bondType);
480 if (res1 != d_params.end()) {
481 res2 = ((*res1).second).find(canAtomType);
482 if (res2 != ((*res1).second).end()) {
483 res3 = ((*res2).second).find(canNbrAtomType);
484 if (res3 != ((*res2).second).end()) {
485 mmffBondParams = &((*res3).second);
490 std::pair<std::vector<boost::uint8_t>::const_iterator,
491 std::vector<boost::uint8_t>::const_iterator> bounds;
493 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canAtomType);
494 if (bounds.first != bounds.second) {
495 bounds = std::equal_range(
496 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
497 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
499 if (bounds.first != bounds.second) {
500 bounds = std::equal_range(
501 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
502 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
504 if (bounds.first != bounds.second) {
505 mmffBondParams = &d_params[bounds.first - d_bondType.begin()];
511 return mmffBondParams;
518 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 521 std::map<const unsigned int, std::map<const unsigned int, MMFFBond> > >
524 std::vector<MMFFBond> d_params;
525 std::vector<boost::uint8_t> d_iAtomType;
526 std::vector<boost::uint8_t> d_jAtomType;
527 std::vector<boost::uint8_t> d_bondType;
556 const MMFFBond *mmffBndkParams = NULL;
557 unsigned int canAtomicNum = atomicNum;
558 unsigned int canNbrAtomicNum = nbrAtomicNum;
559 if (atomicNum > nbrAtomicNum) {
560 canAtomicNum = nbrAtomicNum;
561 canNbrAtomicNum = atomicNum;
563 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 564 std::map<
const unsigned int,
565 std::map<const unsigned int, MMFFBond> >::const_iterator res1;
566 std::map<const unsigned int, MMFFBond>::const_iterator res2;
567 res1 = d_params.find(canAtomicNum);
568 if (res1 != d_params.end()) {
569 res2 = ((*res1).second).find(canNbrAtomicNum);
570 if (res2 != ((*res1).second).end()) {
571 mmffBndkParams = &((*res2).second);
575 std::pair<std::vector<boost::uint8_t>::const_iterator,
576 std::vector<boost::uint8_t>::const_iterator> bounds;
577 bounds = std::equal_range(d_iAtomicNum.begin(), d_iAtomicNum.end(),
579 if (bounds.first != bounds.second) {
580 bounds = std::equal_range(
581 d_jAtomicNum.begin() + (bounds.first - d_iAtomicNum.begin()),
582 d_jAtomicNum.begin() + (bounds.second - d_iAtomicNum.begin()),
584 if (bounds.first != bounds.second) {
585 mmffBndkParams = &d_params[bounds.first - d_jAtomicNum.begin()];
590 return mmffBndkParams;
597 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 598 std::map<const unsigned int, std::map<const unsigned int, MMFFBond> >
601 std::vector<MMFFBond> d_params;
602 std::vector<boost::uint8_t> d_iAtomicNum;
603 std::vector<boost::uint8_t> d_jAtomicNum;
630 const std::string &mmffHerschbachLaurie =
"");
637 unsigned int canIRow = iRow;
638 unsigned int canJRow = jRow;
643 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 644 std::map<
const unsigned int,
645 std::map<
const unsigned int,
647 std::map<const unsigned int, MMFFHerschbachLaurie>::const_iterator res2;
648 res1 = d_params.find(canIRow);
649 if (res1 != d_params.end()) {
650 res2 = ((*res1).second).find(canJRow);
651 if (res2 != ((*res1).second).end()) {
652 mmffHerschbachLaurieParams = &((*res2).second);
656 std::pair<std::vector<boost::uint8_t>::const_iterator,
657 std::vector<boost::uint8_t>::const_iterator> bounds;
658 bounds = std::equal_range(d_iRow.begin(), d_iRow.end(), canIRow);
659 if (bounds.first != bounds.second) {
660 bounds = std::equal_range(
661 d_jRow.begin() + (bounds.first - d_iRow.begin()),
662 d_jRow.begin() + (bounds.second - d_iRow.begin()), canJRow);
663 if (bounds.first != bounds.second) {
664 mmffHerschbachLaurieParams = &d_params[bounds.first - d_jRow.begin()];
669 return mmffHerschbachLaurieParams;
676 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 677 std::map<
const unsigned int,
678 std::map<const unsigned int, MMFFHerschbachLaurie> >
681 std::vector<MMFFHerschbachLaurie> d_params;
682 std::vector<boost::uint8_t> d_iRow;
683 std::vector<boost::uint8_t> d_jRow;
710 const std::string &mmffCovRadPauEle =
"");
716 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 717 std::map<const unsigned int, MMFFCovRadPauEle>::const_iterator res;
718 res = d_params.find(atomicNum);
720 return ((res != d_params.end()) ? &((*res).second) : NULL);
722 std::pair<std::vector<boost::uint8_t>::const_iterator,
723 std::vector<boost::uint8_t>::const_iterator> bounds =
724 std::equal_range(d_atomicNum.begin(), d_atomicNum.end(), atomicNum);
726 return ((bounds.first != bounds.second)
727 ? &d_params[bounds.first - d_atomicNum.begin()]
736 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 737 std::map<const unsigned int, MMFFCovRadPauEle>
740 std::vector<MMFFCovRadPauEle> d_params;
741 std::vector<boost::uint8_t> d_atomicNum;
770 const unsigned int iAtomType,
771 const unsigned int jAtomType,
772 const unsigned int kAtomType) {
775 unsigned int iter = 0;
781 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 782 std::map<
const unsigned int,
783 std::map<
const unsigned int,
784 std::map<
const unsigned int,
785 std::map<const unsigned int, MMFFAngle> > > >::
787 std::map<
const unsigned int,
788 std::map<
const unsigned int,
789 std::map<const unsigned int, MMFFAngle> > >::
791 std::map<
const unsigned int,
792 std::map<const unsigned int, MMFFAngle> >::const_iterator res3;
793 std::map<const unsigned int, MMFFAngle>::const_iterator res4;
794 while ((iter < 4) && (!mmffAngleParams)) {
795 unsigned int canIAtomType = (*mmffDef)(iAtomType)->
eqLevel[iter];
796 unsigned int canKAtomType = (*mmffDef)(kAtomType)->
eqLevel[iter];
797 if (canIAtomType > canKAtomType) {
798 unsigned int temp = canKAtomType;
799 canKAtomType = canIAtomType;
802 res1 = d_params.find(angleType);
803 if (res1 != d_params.end()) {
804 res2 = ((*res1).second).find(canIAtomType);
805 if (res2 != ((*res1).second).end()) {
806 res3 = ((*res2).second).find(jAtomType);
807 if (res3 != ((*res2).second).end()) {
808 res4 = ((*res3).second).find(canKAtomType);
809 if (res4 != ((*res3).second).end()) {
810 mmffAngleParams = &((*res4).second);
818 std::pair<std::vector<boost::uint8_t>::const_iterator,
819 std::vector<boost::uint8_t>::const_iterator> jBounds =
820 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
821 std::pair<std::vector<boost::uint8_t>::const_iterator,
822 std::vector<boost::uint8_t>::const_iterator> bounds;
823 if (jBounds.first != jBounds.second) {
824 while ((iter < 4) && (!mmffAngleParams)) {
825 unsigned int canIAtomType = (*mmffDef)(iAtomType)->
eqLevel[iter];
826 unsigned int canKAtomType = (*mmffDef)(kAtomType)->
eqLevel[iter];
827 if (canIAtomType > canKAtomType) {
828 unsigned int temp = canKAtomType;
829 canKAtomType = canIAtomType;
832 bounds = std::equal_range(
833 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
834 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
836 if (bounds.first != bounds.second) {
837 bounds = std::equal_range(
838 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
839 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
841 if (bounds.first != bounds.second) {
842 bounds = std::equal_range(
843 d_angleType.begin() + (bounds.first - d_kAtomType.begin()),
844 d_angleType.begin() + (bounds.second - d_kAtomType.begin()),
846 if (bounds.first != bounds.second) {
847 mmffAngleParams = &d_params[bounds.first - d_angleType.begin()];
856 return mmffAngleParams;
863 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 864 std::map<
const unsigned int,
865 std::map<
const unsigned int,
866 std::map<
const unsigned int,
867 std::map<const unsigned int, MMFFAngle> > > >
870 std::vector<MMFFAngle> d_params;
871 std::vector<boost::uint8_t> d_iAtomType;
872 std::vector<boost::uint8_t> d_jAtomType;
873 std::vector<boost::uint8_t> d_kAtomType;
874 std::vector<boost::uint8_t>
904 const unsigned int stretchBendType,
const unsigned int bondType1,
905 const unsigned int bondType2,
const unsigned int iAtomType,
906 const unsigned int jAtomType,
const unsigned int kAtomType) {
907 const MMFFStbn *mmffStbnParams = NULL;
909 unsigned int canIAtomType = iAtomType;
910 unsigned int canKAtomType = kAtomType;
911 unsigned int canStretchBendType = stretchBendType;
912 if (iAtomType > kAtomType) {
913 canIAtomType = kAtomType;
914 canKAtomType = iAtomType;
916 }
else if (iAtomType == kAtomType) {
917 swap = (bondType1 < bondType2);
919 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 920 std::map<
const unsigned int,
921 std::map<
const unsigned int,
922 std::map<
const unsigned int,
923 std::map<const unsigned int, MMFFStbn> > > >::
925 std::map<
const unsigned int,
926 std::map<
const unsigned int,
927 std::map<const unsigned int, MMFFStbn> > >::const_iterator
929 std::map<
const unsigned int,
930 std::map<const unsigned int, MMFFStbn> >::const_iterator res3;
931 std::map<const unsigned int, MMFFStbn>::const_iterator res4;
932 res1 = d_params.find(canStretchBendType);
933 if (res1 != d_params.end()) {
934 res2 = ((*res1).second).find(canIAtomType);
935 if (res2 != ((*res1).second).end()) {
936 res3 = ((*res2).second).find(jAtomType);
937 if (res3 != ((*res2).second).end()) {
938 res4 = ((*res3).second).find(canKAtomType);
939 if (res4 != ((*res3).second).end()) {
940 mmffStbnParams = &((*res4).second);
946 std::pair<std::vector<boost::uint8_t>::const_iterator,
947 std::vector<boost::uint8_t>::const_iterator> jBounds =
948 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
949 std::pair<std::vector<boost::uint8_t>::const_iterator,
950 std::vector<boost::uint8_t>::const_iterator> bounds;
951 if (jBounds.first != jBounds.second) {
952 bounds = std::equal_range(
953 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
954 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
956 if (bounds.first != bounds.second) {
957 bounds = std::equal_range(
958 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
959 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
961 if (bounds.first != bounds.second) {
962 bounds = std::equal_range(
963 d_stretchBendType.begin() + (bounds.first - d_kAtomType.begin()),
964 d_stretchBendType.begin() + (bounds.second - d_kAtomType.begin()),
966 if (bounds.first != bounds.second) {
968 &d_params[bounds.first - d_stretchBendType.begin()];
975 return std::make_pair(swap, mmffStbnParams);
982 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 983 std::map<
const unsigned int,
984 std::map<
const unsigned int,
985 std::map<
const unsigned int,
986 std::map<const unsigned int, MMFFStbn> > > >
989 std::vector<MMFFStbn> d_params;
990 std::vector<boost::uint8_t> d_iAtomType;
991 std::vector<boost::uint8_t> d_jAtomType;
992 std::vector<boost::uint8_t> d_kAtomType;
993 std::vector<boost::uint8_t>
1023 const unsigned int periodicTableRow1,
1024 const unsigned int periodicTableRow2,
1025 const unsigned int periodicTableRow3) {
1026 std::map<
const unsigned int,
1027 std::map<
const unsigned int,
1028 std::map<const unsigned int, MMFFStbn> > >::const_iterator
1030 std::map<
const unsigned int,
1031 std::map<const unsigned int, MMFFStbn> >::const_iterator res2;
1032 std::map<const unsigned int, MMFFStbn>::const_iterator res3;
1033 const MMFFStbn *mmffDfsbParams = NULL;
1035 unsigned int canPeriodicTableRow1 = periodicTableRow1;
1036 unsigned int canPeriodicTableRow3 = periodicTableRow3;
1037 if (periodicTableRow1 > periodicTableRow3) {
1038 canPeriodicTableRow1 = periodicTableRow3;
1039 canPeriodicTableRow3 = periodicTableRow1;
1042 res1 = d_params.find(canPeriodicTableRow1);
1043 if (res1 != d_params.end()) {
1044 res2 = ((*res1).second).find(periodicTableRow2);
1045 if (res2 != ((*res1).second).end()) {
1046 res3 = ((*res2).second).find(canPeriodicTableRow3);
1047 if (res3 != ((*res2).second).end()) {
1048 mmffDfsbParams = &((*res3).second);
1053 return std::make_pair(swap, mmffDfsbParams);
1062 std::map<const unsigned int, std::map<const unsigned int, MMFFStbn> > >
1086 const std::string &mmffOop =
"");
1092 const unsigned int jAtomType,
1093 const unsigned int kAtomType,
1094 const unsigned int lAtomType) {
1096 const MMFFOop *mmffOopParams = NULL;
1097 unsigned int iter = 0;
1098 std::vector<unsigned int> canIKLAtomType(3);
1103 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1104 std::map<
const unsigned int,
1105 std::map<
const unsigned int,
1106 std::map<
const unsigned int,
1107 std::map<const unsigned int, MMFFOop> > > >::
1108 const_iterator res1;
1109 std::map<
const unsigned int,
1110 std::map<
const unsigned int,
1111 std::map<const unsigned int, MMFFOop> > >::const_iterator
1113 std::map<
const unsigned int,
1114 std::map<const unsigned int, MMFFOop> >::const_iterator res3;
1115 std::map<const unsigned int, MMFFOop>::const_iterator res4;
1116 while ((iter < 4) && (!mmffOopParams)) {
1117 canIKLAtomType[0] = (*mmffDef)(iAtomType)->
eqLevel[iter];
1118 unsigned int canJAtomType = jAtomType;
1119 canIKLAtomType[1] = (*mmffDef)(kAtomType)->
eqLevel[iter];
1120 canIKLAtomType[2] = (*mmffDef)(lAtomType)->
eqLevel[iter];
1121 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
1122 res1 = d_params.find(canIKLAtomType[0]);
1123 if (res1 != d_params.end()) {
1124 res2 = ((*res1).second).find(canJAtomType);
1125 if (res2 != ((*res1).second).end()) {
1126 res3 = ((*res2).second).find(canIKLAtomType[1]);
1127 if (res3 != ((*res2).second).end()) {
1128 res4 = ((*res3).second).find(canIKLAtomType[2]);
1129 if (res4 != ((*res3).second).end()) {
1130 mmffOopParams = &((*res4).second);
1138 std::pair<std::vector<boost::uint8_t>::const_iterator,
1139 std::vector<boost::uint8_t>::const_iterator> jBounds =
1140 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
1141 std::pair<std::vector<boost::uint8_t>::const_iterator,
1142 std::vector<boost::uint8_t>::const_iterator> bounds;
1143 if (jBounds.first != jBounds.second) {
1144 while ((iter < 4) && (!mmffOopParams)) {
1145 canIKLAtomType[0] = (*mmffDef)(iAtomType)->
eqLevel[iter];
1146 canIKLAtomType[1] = (*mmffDef)(kAtomType)->
eqLevel[iter];
1147 canIKLAtomType[2] = (*mmffDef)(lAtomType)->
eqLevel[iter];
1148 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
1149 bounds = std::equal_range(
1150 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1151 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1153 if (bounds.first != bounds.second) {
1154 bounds = std::equal_range(
1155 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1156 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1158 if (bounds.first != bounds.second) {
1159 bounds = std::equal_range(
1160 d_lAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1161 d_lAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1163 if (bounds.first != bounds.second) {
1164 mmffOopParams = &d_params[bounds.first - d_lAtomType.begin()];
1173 return mmffOopParams;
1180 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1181 std::map<
const unsigned int,
1182 std::map<
const unsigned int,
1183 std::map<
const unsigned int,
1184 std::map<const unsigned int, MMFFOop> > > >
1187 std::vector<MMFFOop> d_params;
1188 std::vector<boost::uint8_t> d_iAtomType;
1189 std::vector<boost::uint8_t> d_jAtomType;
1190 std::vector<boost::uint8_t> d_kAtomType;
1191 std::vector<boost::uint8_t> d_lAtomType;
1215 const std::string &mmffTor =
"");
1221 const std::pair<unsigned int, unsigned int> torType,
1222 const unsigned int iAtomType,
const unsigned int jAtomType,
1223 const unsigned int kAtomType,
const unsigned int lAtomType) {
1225 const MMFFTor *mmffTorParams = NULL;
1226 unsigned int iter = 0;
1227 unsigned int iWildCard = 0;
1228 unsigned int lWildCard = 0;
1229 unsigned int canTorType = torType.first;
1230 unsigned int maxIter = 5;
1235 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1240 std::map<
const unsigned int,
1241 std::map<
const unsigned int,
1242 std::map<const unsigned int, MMFFTor> > > > >::
1243 const_iterator res1;
1244 std::map<
const unsigned int,
1245 std::map<
const unsigned int,
1246 std::map<
const unsigned int,
1247 std::map<const unsigned int, MMFFTor> > > >::
1248 const_iterator res2;
1249 std::map<
const unsigned int,
1250 std::map<
const unsigned int,
1251 std::map<const unsigned int, MMFFTor> > >::const_iterator
1253 std::map<
const unsigned int,
1254 std::map<const unsigned int, MMFFTor> >::const_iterator res4;
1255 std::map<const unsigned int, MMFFTor>::const_iterator res5;
1257 std::pair<std::vector<boost::uint8_t>::const_iterator,
1258 std::vector<boost::uint8_t>::const_iterator> jBounds;
1259 std::pair<std::vector<boost::uint8_t>::const_iterator,
1260 std::vector<boost::uint8_t>::const_iterator> bounds;
1263 while (((iter < maxIter) && ((!mmffTorParams) || (maxIter == 4))) ||
1264 ((iter == 4) && (torType.first == 5) && torType.second)) {
1270 if ((maxIter == 5) && (iter == 4)) {
1273 canTorType = torType.second;
1280 }
else if (iter == 2) {
1284 unsigned int canIAtomType = (*mmffDef)(iAtomType)->
eqLevel[iWildCard];
1285 unsigned int canJAtomType = jAtomType;
1286 unsigned int canKAtomType = kAtomType;
1287 unsigned int canLAtomType = (*mmffDef)(lAtomType)->
eqLevel[lWildCard];
1288 if (canJAtomType > canKAtomType) {
1289 unsigned int temp = canKAtomType;
1290 canKAtomType = canJAtomType;
1291 canJAtomType = temp;
1292 temp = canLAtomType;
1293 canLAtomType = canIAtomType;
1294 canIAtomType = temp;
1295 }
else if ((canJAtomType == canKAtomType) &&
1296 (canIAtomType > canLAtomType)) {
1297 unsigned int temp = canLAtomType;
1298 canLAtomType = canIAtomType;
1299 canIAtomType = temp;
1301 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1302 res1 = d_params.find(canTorType);
1303 if (res1 != d_params.end()) {
1304 res2 = ((*res1).second).find(canIAtomType);
1305 if (res2 != ((*res1).second).end()) {
1306 res3 = ((*res2).second).find(canJAtomType);
1307 if (res3 != ((*res2).second).end()) {
1308 res4 = ((*res3).second).find(canKAtomType);
1309 if (res4 != ((*res3).second).end()) {
1310 res5 = ((*res4).second).find(canLAtomType);
1311 if (res5 != ((*res4).second).end()) {
1312 mmffTorParams = &((*res5).second);
1322 jBounds = std::equal_range(d_jAtomType.begin(), d_jAtomType.end(),
1324 if (jBounds.first != jBounds.second) {
1325 bounds = std::equal_range(
1326 d_kAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1327 d_kAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1329 if (bounds.first != bounds.second) {
1330 bounds = std::equal_range(
1331 d_iAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1332 d_iAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1334 if (bounds.first != bounds.second) {
1335 bounds = std::equal_range(
1336 d_lAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1337 d_lAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1339 if (bounds.first != bounds.second) {
1340 bounds = std::equal_range(
1341 d_torType.begin() + (bounds.first - d_lAtomType.begin()),
1342 d_torType.begin() + (bounds.second - d_lAtomType.begin()),
1344 if (bounds.first != bounds.second) {
1345 mmffTorParams = &d_params[bounds.first - d_torType.begin()];
1358 return std::make_pair(canTorType, mmffTorParams);
1365 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1366 std::map<
const unsigned int,
1367 std::map<
const unsigned int,
1368 std::map<
const unsigned int,
1369 std::map<
const unsigned int,
1370 std::map<
const unsigned int,
1374 std::vector<MMFFTor> d_params;
1375 std::vector<boost::uint8_t> d_iAtomType;
1376 std::vector<boost::uint8_t> d_jAtomType;
1377 std::vector<boost::uint8_t> d_kAtomType;
1378 std::vector<boost::uint8_t> d_lAtomType;
1379 std::vector<boost::uint8_t>
1414 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1415 std::map<const unsigned int, MMFFVdW>::const_iterator res;
1416 res = d_params.find(atomType);
1418 return (res != d_params.end() ? &((*res).second) : NULL);
1420 std::pair<std::vector<boost::uint8_t>::const_iterator,
1421 std::vector<boost::uint8_t>::const_iterator> bounds =
1422 std::equal_range(d_atomType.begin(), d_atomType.end(), atomType);
1424 return ((bounds.first != bounds.second)
1425 ? &d_params[bounds.first - d_atomType.begin()]
1434 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1435 std::map<const unsigned int, MMFFVdW> d_params;
1437 std::vector<MMFFVdW> d_params;
1438 std::vector<boost::uint8_t> d_atomType;
class to store MMFF parameters for angle bending
const MMFFCovRadPauEle * operator()(const unsigned int atomicNum) const
Looks up the parameters for a particular key and returns them.
static MMFFDefCollection * getMMFFDef(const std::string &mmffDef="")
gets a pointer to the singleton MMFFDefCollection
bool isDoubleZero(const double x)
const MMFFVdW * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
class to store MMFF parameters for non-bonded Van der Waals
double power
gets a pointer to the singleton MMFFVdWCollection
const MMFFHerschbachLaurie * operator()(const int iRow, const int jRow)
Looks up the parameters for a particular key and returns them.
const MMFFOop * operator()(const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType, const unsigned int lAtomType)
Looks up the parameters for a particular key and returns them.
const MMFFBond * operator()(const int atomicNum, const int nbrAtomicNum)
Looks up the parameters for a particular key and returns them.
const std::pair< int, const MMFFChg * > getMMFFChgParams(const unsigned int bondType, const unsigned int iAtomType, const unsigned int jAtomType)
Looks up the parameters for a particular key and returns them.
const double MDYNE_A_TO_KCAL_MOL
bool isMMFFAromatic(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
class to store MMFF parameters for stretch-bending
void clipToOne(double &x)
class to store MMFF parameters for bond stretching
class to store MMFF parameters for out-of-plane bending
boost::uint8_t eqLevel[4]
const MMFFPBCI * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
const std::pair< const unsigned int, const MMFFTor * > getMMFFTorParams(const std::pair< unsigned int, unsigned int > torType, const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType, const unsigned int lAtomType)
Looks up the parameters for a particular key and returns them.
const MMFFProp * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
const MMFFBond * operator()(const unsigned int bondType, const unsigned int atomType, const unsigned int nbrAtomType)
Looks up the parameters for a particular key and returns them.
const MMFFDef * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
const std::pair< bool, const MMFFStbn * > getMMFFDfsbParams(const unsigned int periodicTableRow1, const unsigned int periodicTableRow2, const unsigned int periodicTableRow3)
Looks up the parameters for a particular key and returns them.
const std::pair< bool, const MMFFStbn * > getMMFFStbnParams(const unsigned int stretchBendType, const unsigned int bondType1, const unsigned int bondType2, const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType)
Looks up the parameters for a particular key and returns them.
class to store MMFF parameters for torsions
class to store MMFF atom type equivalence levels
class to store MMFF Partial Bond Charge Increments
const MMFFAngle * operator()(const unsigned int angleType, const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType)
Looks up the parameters for a particular key and returns them.
class to store MMFF Properties