13 #ifndef __RD_MMFFPARAMS_H__ 14 #define __RD_MMFFPARAMS_H__ 23 #include <boost/cstdint.hpp> 26 #define M_PI 3.14159265358979323846 43 return ((x < 1.0e-10) && (x > -1.0e-10));
48 }
else if (x < -1.0) {
56 boost::uint8_t eqLevel[4];
178 const boost::uint8_t *aromatic_types = NULL);
184 return ((std::find(d_params.begin(), d_params.end(), atomType) !=
194 std::vector<boost::uint8_t> d_params;
223 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 224 std::map<const unsigned int, MMFFDef>::const_iterator res;
225 res = d_params.find(atomType);
227 return ((res != d_params.end()) ? &((*res).second) : NULL);
229 return ((atomType && (atomType <= d_params.size()))
230 ? &d_params[atomType - 1]
239 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 240 std::map<const unsigned int, MMFFDef> d_params;
242 std::vector<MMFFDef> d_params;
271 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 272 std::map<const unsigned int, MMFFProp>::const_iterator res;
273 res = d_params.find(atomType);
275 return ((res != d_params.end()) ? &((*res).second) : NULL);
277 std::pair<std::vector<boost::uint8_t>::const_iterator,
278 std::vector<boost::uint8_t>::const_iterator> bounds =
279 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), atomType);
281 return ((bounds.first != bounds.second)
282 ? &d_params[bounds.first - d_iAtomType.begin()]
291 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 292 std::map<const unsigned int, MMFFProp> d_params;
294 std::vector<MMFFProp> d_params;
295 std::vector<boost::uint8_t> d_iAtomType;
324 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 325 std::map<const unsigned int, MMFFPBCI>::const_iterator res;
326 res = d_params.find(atomType);
328 return ((res != d_params.end()) ? &((*res).second) : NULL);
330 return ((atomType && (atomType <= d_params.size()))
331 ? &d_params[atomType - 1]
340 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 341 std::map<const unsigned int, MMFFPBCI> d_params;
343 std::vector<MMFFPBCI> d_params;
372 const unsigned int bondType,
const unsigned int iAtomType,
373 const unsigned int jAtomType) {
375 const MMFFChg *mmffChgParams = NULL;
376 unsigned int canIAtomType = iAtomType;
377 unsigned int canJAtomType = jAtomType;
378 if (iAtomType > jAtomType) {
379 canIAtomType = jAtomType;
380 canJAtomType = iAtomType;
383 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 384 std::map<
const unsigned int,
385 std::map<const unsigned int, MMFFChg> >::const_iterator res1;
386 std::map<const unsigned int, MMFFChg>::const_iterator res2;
387 res1 = d_params[bondType].find(canIAtomType);
388 if (res1 != d_params[bondType].end()) {
389 res2 = ((*res1).second).find(canJAtomType);
390 if (res2 != ((*res1).second).end()) {
391 mmffChgParams = &((*res2).second);
395 std::pair<std::vector<boost::uint8_t>::const_iterator,
396 std::vector<boost::uint8_t>::const_iterator> bounds;
399 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canIAtomType);
400 if (bounds.first != bounds.second) {
401 bounds = std::equal_range(
402 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
403 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
405 if (bounds.first != bounds.second) {
406 bounds = std::equal_range(
407 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
408 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
410 if (bounds.first != bounds.second) {
411 mmffChgParams = &d_params[bounds.first - d_bondType.begin()];
417 return std::make_pair(sign, mmffChgParams);
425 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 428 std::map<const unsigned int, std::map<const unsigned int, MMFFChg> > >
431 std::vector<MMFFChg> d_params;
432 std::vector<boost::uint8_t> d_iAtomType;
433 std::vector<boost::uint8_t> d_jAtomType;
434 std::vector<boost::uint8_t> d_bondType;
463 const unsigned int atomType,
464 const unsigned int nbrAtomType) {
465 const MMFFBond *mmffBondParams = NULL;
466 unsigned int canAtomType = atomType;
467 unsigned int canNbrAtomType = nbrAtomType;
468 if (atomType > nbrAtomType) {
469 canAtomType = nbrAtomType;
470 canNbrAtomType = atomType;
472 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 473 std::map<
const unsigned int,
474 std::map<
const unsigned int,
475 std::map<const unsigned int, MMFFBond> > >::const_iterator
477 std::map<
const unsigned int,
478 std::map<const unsigned int, MMFFBond> >::const_iterator res2;
479 std::map<const unsigned int, MMFFBond>::const_iterator res3;
480 res1 = d_params.find(bondType);
481 if (res1 != d_params.end()) {
482 res2 = ((*res1).second).find(canAtomType);
483 if (res2 != ((*res1).second).end()) {
484 res3 = ((*res2).second).find(canNbrAtomType);
485 if (res3 != ((*res2).second).end()) {
486 mmffBondParams = &((*res3).second);
491 std::pair<std::vector<boost::uint8_t>::const_iterator,
492 std::vector<boost::uint8_t>::const_iterator> bounds;
494 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canAtomType);
495 if (bounds.first != bounds.second) {
496 bounds = std::equal_range(
497 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
498 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
500 if (bounds.first != bounds.second) {
501 bounds = std::equal_range(
502 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
503 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
505 if (bounds.first != bounds.second) {
506 mmffBondParams = &d_params[bounds.first - d_bondType.begin()];
512 return mmffBondParams;
519 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 522 std::map<const unsigned int, std::map<const unsigned int, MMFFBond> > >
525 std::vector<MMFFBond> d_params;
526 std::vector<boost::uint8_t> d_iAtomType;
527 std::vector<boost::uint8_t> d_jAtomType;
528 std::vector<boost::uint8_t> d_bondType;
557 const MMFFBond *mmffBndkParams = NULL;
558 unsigned int canAtomicNum = atomicNum;
559 unsigned int canNbrAtomicNum = nbrAtomicNum;
560 if (atomicNum > nbrAtomicNum) {
561 canAtomicNum = nbrAtomicNum;
562 canNbrAtomicNum = atomicNum;
564 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 565 std::map<
const unsigned int,
566 std::map<const unsigned int, MMFFBond> >::const_iterator res1;
567 std::map<const unsigned int, MMFFBond>::const_iterator res2;
568 res1 = d_params.find(canAtomicNum);
569 if (res1 != d_params.end()) {
570 res2 = ((*res1).second).find(canNbrAtomicNum);
571 if (res2 != ((*res1).second).end()) {
572 mmffBndkParams = &((*res2).second);
576 std::pair<std::vector<boost::uint8_t>::const_iterator,
577 std::vector<boost::uint8_t>::const_iterator> bounds;
578 bounds = std::equal_range(d_iAtomicNum.begin(), d_iAtomicNum.end(),
580 if (bounds.first != bounds.second) {
581 bounds = std::equal_range(
582 d_jAtomicNum.begin() + (bounds.first - d_iAtomicNum.begin()),
583 d_jAtomicNum.begin() + (bounds.second - d_iAtomicNum.begin()),
585 if (bounds.first != bounds.second) {
586 mmffBndkParams = &d_params[bounds.first - d_jAtomicNum.begin()];
591 return mmffBndkParams;
598 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 599 std::map<const unsigned int, std::map<const unsigned int, MMFFBond> >
602 std::vector<MMFFBond> d_params;
603 std::vector<boost::uint8_t> d_iAtomicNum;
604 std::vector<boost::uint8_t> d_jAtomicNum;
631 const std::string &mmffHerschbachLaurie =
"");
638 unsigned int canIRow = iRow;
639 unsigned int canJRow = jRow;
644 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 645 std::map<
const unsigned int,
646 std::map<
const unsigned int,
648 std::map<const unsigned int, MMFFHerschbachLaurie>::const_iterator res2;
649 res1 = d_params.find(canIRow);
650 if (res1 != d_params.end()) {
651 res2 = ((*res1).second).find(canJRow);
652 if (res2 != ((*res1).second).end()) {
653 mmffHerschbachLaurieParams = &((*res2).second);
657 std::pair<std::vector<boost::uint8_t>::const_iterator,
658 std::vector<boost::uint8_t>::const_iterator> bounds;
659 bounds = std::equal_range(d_iRow.begin(), d_iRow.end(), canIRow);
660 if (bounds.first != bounds.second) {
661 bounds = std::equal_range(
662 d_jRow.begin() + (bounds.first - d_iRow.begin()),
663 d_jRow.begin() + (bounds.second - d_iRow.begin()), canJRow);
664 if (bounds.first != bounds.second) {
665 mmffHerschbachLaurieParams = &d_params[bounds.first - d_jRow.begin()];
670 return mmffHerschbachLaurieParams;
677 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 678 std::map<
const unsigned int,
679 std::map<const unsigned int, MMFFHerschbachLaurie> >
682 std::vector<MMFFHerschbachLaurie> d_params;
683 std::vector<boost::uint8_t> d_iRow;
684 std::vector<boost::uint8_t> d_jRow;
711 const std::string &mmffCovRadPauEle =
"");
717 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 718 std::map<const unsigned int, MMFFCovRadPauEle>::const_iterator res;
719 res = d_params.find(atomicNum);
721 return ((res != d_params.end()) ? &((*res).second) : NULL);
723 std::pair<std::vector<boost::uint8_t>::const_iterator,
724 std::vector<boost::uint8_t>::const_iterator> bounds =
725 std::equal_range(d_atomicNum.begin(), d_atomicNum.end(), atomicNum);
727 return ((bounds.first != bounds.second)
728 ? &d_params[bounds.first - d_atomicNum.begin()]
737 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 738 std::map<const unsigned int, MMFFCovRadPauEle>
741 std::vector<MMFFCovRadPauEle> d_params;
742 std::vector<boost::uint8_t> d_atomicNum;
771 const unsigned int iAtomType,
772 const unsigned int jAtomType,
773 const unsigned int kAtomType) {
776 unsigned int iter = 0;
782 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 783 std::map<
const unsigned int,
784 std::map<
const unsigned int,
785 std::map<
const unsigned int,
786 std::map<const unsigned int, MMFFAngle> > > >::
788 std::map<
const unsigned int,
789 std::map<
const unsigned int,
790 std::map<const unsigned int, MMFFAngle> > >::
792 std::map<
const unsigned int,
793 std::map<const unsigned int, MMFFAngle> >::const_iterator res3;
794 std::map<const unsigned int, MMFFAngle>::const_iterator res4;
795 while ((iter < 4) && (!mmffAngleParams)) {
796 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
797 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
798 if (canIAtomType > canKAtomType) {
799 unsigned int temp = canKAtomType;
800 canKAtomType = canIAtomType;
803 res1 = d_params.find(angleType);
804 if (res1 != d_params.end()) {
805 res2 = ((*res1).second).find(canIAtomType);
806 if (res2 != ((*res1).second).end()) {
807 res3 = ((*res2).second).find(jAtomType);
808 if (res3 != ((*res2).second).end()) {
809 res4 = ((*res3).second).find(canKAtomType);
810 if (res4 != ((*res3).second).end()) {
811 mmffAngleParams = &((*res4).second);
819 std::pair<std::vector<boost::uint8_t>::const_iterator,
820 std::vector<boost::uint8_t>::const_iterator> jBounds =
821 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
822 std::pair<std::vector<boost::uint8_t>::const_iterator,
823 std::vector<boost::uint8_t>::const_iterator> bounds;
824 if (jBounds.first != jBounds.second) {
825 while ((iter < 4) && (!mmffAngleParams)) {
826 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
827 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
828 if (canIAtomType > canKAtomType) {
829 unsigned int temp = canKAtomType;
830 canKAtomType = canIAtomType;
833 bounds = std::equal_range(
834 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
835 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
837 if (bounds.first != bounds.second) {
838 bounds = std::equal_range(
839 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
840 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
842 if (bounds.first != bounds.second) {
843 bounds = std::equal_range(
844 d_angleType.begin() + (bounds.first - d_kAtomType.begin()),
845 d_angleType.begin() + (bounds.second - d_kAtomType.begin()),
847 if (bounds.first != bounds.second) {
848 mmffAngleParams = &d_params[bounds.first - d_angleType.begin()];
857 return mmffAngleParams;
864 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 865 std::map<
const unsigned int,
866 std::map<
const unsigned int,
867 std::map<
const unsigned int,
868 std::map<const unsigned int, MMFFAngle> > > >
871 std::vector<MMFFAngle> d_params;
872 std::vector<boost::uint8_t> d_iAtomType;
873 std::vector<boost::uint8_t> d_jAtomType;
874 std::vector<boost::uint8_t> d_kAtomType;
875 std::vector<boost::uint8_t>
905 const unsigned int stretchBendType,
const unsigned int bondType1,
906 const unsigned int bondType2,
const unsigned int iAtomType,
907 const unsigned int jAtomType,
const unsigned int kAtomType) {
908 const MMFFStbn *mmffStbnParams = NULL;
910 unsigned int canIAtomType = iAtomType;
911 unsigned int canKAtomType = kAtomType;
912 unsigned int canStretchBendType = stretchBendType;
913 if (iAtomType > kAtomType) {
914 canIAtomType = kAtomType;
915 canKAtomType = iAtomType;
917 }
else if (iAtomType == kAtomType) {
918 swap = (bondType1 < bondType2);
920 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 921 std::map<
const unsigned int,
922 std::map<
const unsigned int,
923 std::map<
const unsigned int,
924 std::map<const unsigned int, MMFFStbn> > > >::
926 std::map<
const unsigned int,
927 std::map<
const unsigned int,
928 std::map<const unsigned int, MMFFStbn> > >::const_iterator
930 std::map<
const unsigned int,
931 std::map<const unsigned int, MMFFStbn> >::const_iterator res3;
932 std::map<const unsigned int, MMFFStbn>::const_iterator res4;
933 res1 = d_params.find(canStretchBendType);
934 if (res1 != d_params.end()) {
935 res2 = ((*res1).second).find(canIAtomType);
936 if (res2 != ((*res1).second).end()) {
937 res3 = ((*res2).second).find(jAtomType);
938 if (res3 != ((*res2).second).end()) {
939 res4 = ((*res3).second).find(canKAtomType);
940 if (res4 != ((*res3).second).end()) {
941 mmffStbnParams = &((*res4).second);
947 std::pair<std::vector<boost::uint8_t>::const_iterator,
948 std::vector<boost::uint8_t>::const_iterator> jBounds =
949 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
950 std::pair<std::vector<boost::uint8_t>::const_iterator,
951 std::vector<boost::uint8_t>::const_iterator> bounds;
952 if (jBounds.first != jBounds.second) {
953 bounds = std::equal_range(
954 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
955 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
957 if (bounds.first != bounds.second) {
958 bounds = std::equal_range(
959 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
960 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
962 if (bounds.first != bounds.second) {
963 bounds = std::equal_range(
964 d_stretchBendType.begin() + (bounds.first - d_kAtomType.begin()),
965 d_stretchBendType.begin() + (bounds.second - d_kAtomType.begin()),
967 if (bounds.first != bounds.second) {
969 &d_params[bounds.first - d_stretchBendType.begin()];
976 return std::make_pair(swap, mmffStbnParams);
983 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 984 std::map<
const unsigned int,
985 std::map<
const unsigned int,
986 std::map<
const unsigned int,
987 std::map<const unsigned int, MMFFStbn> > > >
990 std::vector<MMFFStbn> d_params;
991 std::vector<boost::uint8_t> d_iAtomType;
992 std::vector<boost::uint8_t> d_jAtomType;
993 std::vector<boost::uint8_t> d_kAtomType;
994 std::vector<boost::uint8_t>
1024 const unsigned int periodicTableRow1,
1025 const unsigned int periodicTableRow2,
1026 const unsigned int periodicTableRow3) {
1027 std::map<
const unsigned int,
1028 std::map<
const unsigned int,
1029 std::map<const unsigned int, MMFFStbn> > >::const_iterator
1031 std::map<
const unsigned int,
1032 std::map<const unsigned int, MMFFStbn> >::const_iterator res2;
1033 std::map<const unsigned int, MMFFStbn>::const_iterator res3;
1034 const MMFFStbn *mmffDfsbParams = NULL;
1036 unsigned int canPeriodicTableRow1 = periodicTableRow1;
1037 unsigned int canPeriodicTableRow3 = periodicTableRow3;
1038 if (periodicTableRow1 > periodicTableRow3) {
1039 canPeriodicTableRow1 = periodicTableRow3;
1040 canPeriodicTableRow3 = periodicTableRow1;
1043 res1 = d_params.find(canPeriodicTableRow1);
1044 if (res1 != d_params.end()) {
1045 res2 = ((*res1).second).find(periodicTableRow2);
1046 if (res2 != ((*res1).second).end()) {
1047 res3 = ((*res2).second).find(canPeriodicTableRow3);
1048 if (res3 != ((*res2).second).end()) {
1049 mmffDfsbParams = &((*res3).second);
1054 return std::make_pair(swap, mmffDfsbParams);
1063 std::map<const unsigned int, std::map<const unsigned int, MMFFStbn> > >
1087 const std::string &mmffOop =
"");
1093 const unsigned int jAtomType,
1094 const unsigned int kAtomType,
1095 const unsigned int lAtomType) {
1097 const MMFFOop *mmffOopParams = NULL;
1098 unsigned int iter = 0;
1099 std::vector<unsigned int> canIKLAtomType(3);
1104 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1105 std::map<
const unsigned int,
1106 std::map<
const unsigned int,
1107 std::map<
const unsigned int,
1108 std::map<const unsigned int, MMFFOop> > > >::
1109 const_iterator res1;
1110 std::map<
const unsigned int,
1111 std::map<
const unsigned int,
1112 std::map<const unsigned int, MMFFOop> > >::const_iterator
1114 std::map<
const unsigned int,
1115 std::map<const unsigned int, MMFFOop> >::const_iterator res3;
1116 std::map<const unsigned int, MMFFOop>::const_iterator res4;
1117 while ((iter < 4) && (!mmffOopParams)) {
1118 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
1119 unsigned int canJAtomType = jAtomType;
1120 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
1121 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
1122 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
1123 res1 = d_params.find(canIKLAtomType[0]);
1124 if (res1 != d_params.end()) {
1125 res2 = ((*res1).second).find(canJAtomType);
1126 if (res2 != ((*res1).second).end()) {
1127 res3 = ((*res2).second).find(canIKLAtomType[1]);
1128 if (res3 != ((*res2).second).end()) {
1129 res4 = ((*res3).second).find(canIKLAtomType[2]);
1130 if (res4 != ((*res3).second).end()) {
1131 mmffOopParams = &((*res4).second);
1139 std::pair<std::vector<boost::uint8_t>::const_iterator,
1140 std::vector<boost::uint8_t>::const_iterator> jBounds =
1141 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
1142 std::pair<std::vector<boost::uint8_t>::const_iterator,
1143 std::vector<boost::uint8_t>::const_iterator> bounds;
1144 if (jBounds.first != jBounds.second) {
1145 while ((iter < 4) && (!mmffOopParams)) {
1146 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
1147 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
1148 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
1149 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
1150 bounds = std::equal_range(
1151 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1152 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1154 if (bounds.first != bounds.second) {
1155 bounds = std::equal_range(
1156 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1157 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1159 if (bounds.first != bounds.second) {
1160 bounds = std::equal_range(
1161 d_lAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1162 d_lAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1164 if (bounds.first != bounds.second) {
1165 mmffOopParams = &d_params[bounds.first - d_lAtomType.begin()];
1174 return mmffOopParams;
1181 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1182 std::map<
const unsigned int,
1183 std::map<
const unsigned int,
1184 std::map<
const unsigned int,
1185 std::map<const unsigned int, MMFFOop> > > >
1188 std::vector<MMFFOop> d_params;
1189 std::vector<boost::uint8_t> d_iAtomType;
1190 std::vector<boost::uint8_t> d_jAtomType;
1191 std::vector<boost::uint8_t> d_kAtomType;
1192 std::vector<boost::uint8_t> d_lAtomType;
1216 const std::string &mmffTor =
"");
1222 const std::pair<unsigned int, unsigned int> torType,
1223 const unsigned int iAtomType,
const unsigned int jAtomType,
1224 const unsigned int kAtomType,
const unsigned int lAtomType) {
1226 const MMFFTor *mmffTorParams = NULL;
1227 unsigned int iter = 0;
1228 unsigned int iWildCard = 0;
1229 unsigned int lWildCard = 0;
1230 unsigned int canTorType = torType.first;
1231 unsigned int maxIter = 5;
1236 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1241 std::map<
const unsigned int,
1242 std::map<
const unsigned int,
1243 std::map<const unsigned int, MMFFTor> > > > >::
1244 const_iterator res1;
1245 std::map<
const unsigned int,
1246 std::map<
const unsigned int,
1247 std::map<
const unsigned int,
1248 std::map<const unsigned int, MMFFTor> > > >::
1249 const_iterator res2;
1250 std::map<
const unsigned int,
1251 std::map<
const unsigned int,
1252 std::map<const unsigned int, MMFFTor> > >::const_iterator
1254 std::map<
const unsigned int,
1255 std::map<const unsigned int, MMFFTor> >::const_iterator res4;
1256 std::map<const unsigned int, MMFFTor>::const_iterator res5;
1258 std::pair<std::vector<boost::uint8_t>::const_iterator,
1259 std::vector<boost::uint8_t>::const_iterator> jBounds;
1260 std::pair<std::vector<boost::uint8_t>::const_iterator,
1261 std::vector<boost::uint8_t>::const_iterator> bounds;
1264 while (((iter < maxIter) && ((!mmffTorParams) || (maxIter == 4))) ||
1265 ((iter == 4) && (torType.first == 5) && torType.second)) {
1271 if ((maxIter == 5) && (iter == 4)) {
1274 canTorType = torType.second;
1281 }
else if (iter == 2) {
1285 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iWildCard];
1286 unsigned int canJAtomType = jAtomType;
1287 unsigned int canKAtomType = kAtomType;
1288 unsigned int canLAtomType = (*mmffDef)(lAtomType)->eqLevel[lWildCard];
1289 if (canJAtomType > canKAtomType) {
1290 unsigned int temp = canKAtomType;
1291 canKAtomType = canJAtomType;
1292 canJAtomType = temp;
1293 temp = canLAtomType;
1294 canLAtomType = canIAtomType;
1295 canIAtomType = temp;
1296 }
else if ((canJAtomType == canKAtomType) &&
1297 (canIAtomType > canLAtomType)) {
1298 unsigned int temp = canLAtomType;
1299 canLAtomType = canIAtomType;
1300 canIAtomType = temp;
1302 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1303 res1 = d_params.find(canTorType);
1304 if (res1 != d_params.end()) {
1305 res2 = ((*res1).second).find(canIAtomType);
1306 if (res2 != ((*res1).second).end()) {
1307 res3 = ((*res2).second).find(canJAtomType);
1308 if (res3 != ((*res2).second).end()) {
1309 res4 = ((*res3).second).find(canKAtomType);
1310 if (res4 != ((*res3).second).end()) {
1311 res5 = ((*res4).second).find(canLAtomType);
1312 if (res5 != ((*res4).second).end()) {
1313 mmffTorParams = &((*res5).second);
1323 jBounds = std::equal_range(d_jAtomType.begin(), d_jAtomType.end(),
1325 if (jBounds.first != jBounds.second) {
1326 bounds = std::equal_range(
1327 d_kAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1328 d_kAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1330 if (bounds.first != bounds.second) {
1331 bounds = std::equal_range(
1332 d_iAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1333 d_iAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1335 if (bounds.first != bounds.second) {
1336 bounds = std::equal_range(
1337 d_lAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1338 d_lAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1340 if (bounds.first != bounds.second) {
1341 bounds = std::equal_range(
1342 d_torType.begin() + (bounds.first - d_lAtomType.begin()),
1343 d_torType.begin() + (bounds.second - d_lAtomType.begin()),
1345 if (bounds.first != bounds.second) {
1346 mmffTorParams = &d_params[bounds.first - d_torType.begin()];
1359 return std::make_pair(canTorType, mmffTorParams);
1366 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1367 std::map<
const unsigned int,
1368 std::map<
const unsigned int,
1369 std::map<
const unsigned int,
1370 std::map<
const unsigned int,
1371 std::map<
const unsigned int,
1375 std::vector<MMFFTor> d_params;
1376 std::vector<boost::uint8_t> d_iAtomType;
1377 std::vector<boost::uint8_t> d_jAtomType;
1378 std::vector<boost::uint8_t> d_kAtomType;
1379 std::vector<boost::uint8_t> d_lAtomType;
1380 std::vector<boost::uint8_t>
1415 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1416 std::map<const unsigned int, MMFFVdW>::const_iterator res;
1417 res = d_params.find(atomType);
1419 return (res != d_params.end() ? &((*res).second) : NULL);
1421 std::pair<std::vector<boost::uint8_t>::const_iterator,
1422 std::vector<boost::uint8_t>::const_iterator> bounds =
1423 std::equal_range(d_atomType.begin(), d_atomType.end(), atomType);
1425 return ((bounds.first != bounds.second)
1426 ? &d_params[bounds.first - d_atomType.begin()]
1435 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP 1436 std::map<const unsigned int, MMFFVdW> d_params;
1438 std::vector<MMFFVdW> d_params;
1439 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
#define RDKIT_FORCEFIELD_EXPORT
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
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