13 #ifndef __RD_MMFFPARAMS_H__
14 #define __RD_MMFFPARAMS_H__
27 #define M_PI 3.14159265358979323846
44 return ((x < 1.0e-10) && (x > -1.0e-10));
49 }
else if (x < -1.0) {
57 std::uint8_t eqLevel[4];
165 return ((std::find(d_params.begin(), d_params.end(), atomType) !=
182 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
183 std::map<const unsigned int, MMFFDef>::const_iterator res;
184 res = d_params.find(atomType);
186 return ((res != d_params.end()) ? &((*res).second) : NULL);
188 return ((atomType && (atomType <= d_params.size()))
189 ? &d_params[atomType - 1]
196 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
197 std::map<const unsigned int, MMFFDef> d_params;
210 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
211 std::map<const unsigned int, MMFFProp>::const_iterator res;
212 res = d_params.find(atomType);
214 return ((res != d_params.end()) ? &((*res).second) : NULL);
216 std::pair<std::vector<std::uint8_t>::const_iterator,
217 std::vector<std::uint8_t>::const_iterator>
219 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), atomType);
221 return ((bounds.first != bounds.second)
222 ? &d_params[bounds.first - d_iAtomType.begin()]
228 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
229 std::map<const unsigned int, MMFFProp> d_params;
243 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
244 std::map<const unsigned int, MMFFPBCI>::const_iterator res;
245 res = d_params.find(atomType);
247 return ((res != d_params.end()) ? &((*res).second) : NULL);
249 return ((atomType && (atomType <= d_params.size()))
250 ? &d_params[atomType - 1]
257 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
258 std::map<const unsigned int, MMFFPBCI> d_params;
271 const unsigned int bondType,
const unsigned int iAtomType,
272 const unsigned int jAtomType)
const {
274 const MMFFChg *mmffChgParams =
nullptr;
275 unsigned int canIAtomType = iAtomType;
276 unsigned int canJAtomType = jAtomType;
277 if (iAtomType > jAtomType) {
278 canIAtomType = jAtomType;
279 canJAtomType = iAtomType;
282 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
283 std::map<
const unsigned int,
284 std::map<const unsigned int, MMFFChg>>::const_iterator res1;
285 std::map<const unsigned int, MMFFChg>::const_iterator res2;
286 res1 = d_params[bondType].find(canIAtomType);
287 if (res1 != d_params[bondType].end()) {
288 res2 = ((*res1).second).find(canJAtomType);
289 if (res2 != ((*res1).second).end()) {
290 mmffChgParams = &((*res2).second);
294 std::pair<std::vector<std::uint8_t>::const_iterator,
295 std::vector<std::uint8_t>::const_iterator>
299 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canIAtomType);
300 if (bounds.first != bounds.second) {
301 bounds = std::equal_range(
302 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
303 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
305 if (bounds.first != bounds.second) {
306 bounds = std::equal_range(
307 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
308 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
310 if (bounds.first != bounds.second) {
311 mmffChgParams = &d_params[bounds.first - d_bondType.begin()];
317 return std::make_pair(sign, mmffChgParams);
323 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
324 std::map<
const unsigned int,
325 std::map<const unsigned int, std::map<const unsigned int, MMFFChg>>>
342 const unsigned int atomType,
343 const unsigned int nbrAtomType)
const {
344 const MMFFBond *mmffBondParams =
nullptr;
345 unsigned int canAtomType = atomType;
346 unsigned int canNbrAtomType = nbrAtomType;
347 if (atomType > nbrAtomType) {
348 canAtomType = nbrAtomType;
349 canNbrAtomType = atomType;
351 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
352 std::map<
const unsigned int,
353 std::map<
const unsigned int,
354 std::map<const unsigned int, MMFFBond>>>::const_iterator
356 std::map<
const unsigned int,
357 std::map<const unsigned int, MMFFBond>>::const_iterator res2;
358 std::map<const unsigned int, MMFFBond>::const_iterator res3;
359 res1 = d_params.find(bondType);
360 if (res1 != d_params.end()) {
361 res2 = ((*res1).second).find(canAtomType);
362 if (res2 != ((*res1).second).end()) {
363 res3 = ((*res2).second).find(canNbrAtomType);
364 if (res3 != ((*res2).second).end()) {
365 mmffBondParams = &((*res3).second);
370 std::pair<std::vector<std::uint8_t>::const_iterator,
371 std::vector<std::uint8_t>::const_iterator>
374 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canAtomType);
375 if (bounds.first != bounds.second) {
376 bounds = std::equal_range(
377 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
378 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
380 if (bounds.first != bounds.second) {
381 bounds = std::equal_range(
382 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
383 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
385 if (bounds.first != bounds.second) {
386 mmffBondParams = &d_params[bounds.first - d_bondType.begin()];
392 return mmffBondParams;
396 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
397 std::map<
const unsigned int,
398 std::map<const unsigned int, std::map<const unsigned int, MMFFBond>>>
415 const int nbrAtomicNum)
const {
416 const MMFFBond *mmffBndkParams =
nullptr;
417 unsigned int canAtomicNum = atomicNum;
418 unsigned int canNbrAtomicNum = nbrAtomicNum;
419 if (atomicNum > nbrAtomicNum) {
420 canAtomicNum = nbrAtomicNum;
421 canNbrAtomicNum = atomicNum;
423 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
424 std::map<
const unsigned int,
425 std::map<const unsigned int, MMFFBond>>::const_iterator res1;
426 std::map<const unsigned int, MMFFBond>::const_iterator res2;
427 res1 = d_params.find(canAtomicNum);
428 if (res1 != d_params.end()) {
429 res2 = ((*res1).second).find(canNbrAtomicNum);
430 if (res2 != ((*res1).second).end()) {
431 mmffBndkParams = &((*res2).second);
435 std::pair<std::vector<std::uint8_t>::const_iterator,
436 std::vector<std::uint8_t>::const_iterator>
438 bounds = std::equal_range(d_iAtomicNum.begin(), d_iAtomicNum.end(),
440 if (bounds.first != bounds.second) {
441 bounds = std::equal_range(
442 d_jAtomicNum.begin() + (bounds.first - d_iAtomicNum.begin()),
443 d_jAtomicNum.begin() + (bounds.second - d_iAtomicNum.begin()),
445 if (bounds.first != bounds.second) {
446 mmffBndkParams = &d_params[bounds.first - d_jAtomicNum.begin()];
451 return mmffBndkParams;
455 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
456 std::map<const unsigned int, std::map<const unsigned int, MMFFBond>>
473 unsigned int canIRow = iRow;
474 unsigned int canJRow = jRow;
479 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
480 std::map<
const unsigned int,
481 std::map<const unsigned int, MMFFHerschbachLaurie>>::const_iterator
483 std::map<const unsigned int, MMFFHerschbachLaurie>::const_iterator res2;
484 res1 = d_params.find(canIRow);
485 if (res1 != d_params.end()) {
486 res2 = ((*res1).second).find(canJRow);
487 if (res2 != ((*res1).second).end()) {
488 mmffHerschbachLaurieParams = &((*res2).second);
492 std::pair<std::vector<std::uint8_t>::const_iterator,
493 std::vector<std::uint8_t>::const_iterator>
495 bounds = std::equal_range(d_iRow.begin(), d_iRow.end(), canIRow);
496 if (bounds.first != bounds.second) {
497 bounds = std::equal_range(
498 d_jRow.begin() + (bounds.first - d_iRow.begin()),
499 d_jRow.begin() + (bounds.second - d_iRow.begin()), canJRow);
500 if (bounds.first != bounds.second) {
501 mmffHerschbachLaurieParams = &d_params[bounds.first - d_jRow.begin()];
506 return mmffHerschbachLaurieParams;
511 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
512 std::map<
const unsigned int,
513 std::map<const unsigned int, MMFFHerschbachLaurie>>
529 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
530 std::map<const unsigned int, MMFFCovRadPauEle>::const_iterator res;
531 res = d_params.find(atomicNum);
533 return ((res != d_params.end()) ? &((*res).second) : NULL);
535 std::pair<std::vector<std::uint8_t>::const_iterator,
536 std::vector<std::uint8_t>::const_iterator>
538 std::equal_range(d_atomicNum.begin(), d_atomicNum.end(), atomicNum);
540 return ((bounds.first != bounds.second)
541 ? &d_params[bounds.first - d_atomicNum.begin()]
547 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
548 std::map<const unsigned int, MMFFCovRadPauEle>
563 const unsigned int angleType,
564 const unsigned int iAtomType,
565 const unsigned int jAtomType,
566 const unsigned int kAtomType)
const {
567 const MMFFAngle *mmffAngleParams =
nullptr;
568 unsigned int iter = 0;
574 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
575 std::map<
const unsigned int,
576 std::map<
const unsigned int,
577 std::map<
const unsigned int,
578 std::map<const unsigned int, MMFFAngle>>>>::
580 std::map<
const unsigned int,
581 std::map<
const unsigned int,
582 std::map<const unsigned int, MMFFAngle>>>::const_iterator
584 std::map<
const unsigned int,
585 std::map<const unsigned int, MMFFAngle>>::const_iterator res3;
586 std::map<const unsigned int, MMFFAngle>::const_iterator res4;
587 while ((iter < 4) && (!mmffAngleParams)) {
588 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
589 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
590 if (canIAtomType > canKAtomType) {
591 unsigned int temp = canKAtomType;
592 canKAtomType = canIAtomType;
595 res1 = d_params.find(angleType);
596 if (res1 != d_params.end()) {
597 res2 = ((*res1).second).find(canIAtomType);
598 if (res2 != ((*res1).second).end()) {
599 res3 = ((*res2).second).find(jAtomType);
600 if (res3 != ((*res2).second).end()) {
601 res4 = ((*res3).second).find(canKAtomType);
602 if (res4 != ((*res3).second).end()) {
603 mmffAngleParams = &((*res4).second);
611 std::pair<std::vector<std::uint8_t>::const_iterator,
612 std::vector<std::uint8_t>::const_iterator>
614 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
615 std::pair<std::vector<std::uint8_t>::const_iterator,
616 std::vector<std::uint8_t>::const_iterator>
618 if (jBounds.first != jBounds.second) {
619 while ((iter < 4) && (!mmffAngleParams)) {
620 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
621 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
622 if (canIAtomType > canKAtomType) {
623 unsigned int temp = canKAtomType;
624 canKAtomType = canIAtomType;
627 bounds = std::equal_range(
628 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
629 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
631 if (bounds.first != bounds.second) {
632 bounds = std::equal_range(
633 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
634 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
636 if (bounds.first != bounds.second) {
637 bounds = std::equal_range(
638 d_angleType.begin() + (bounds.first - d_kAtomType.begin()),
639 d_angleType.begin() + (bounds.second - d_kAtomType.begin()),
641 if (bounds.first != bounds.second) {
642 mmffAngleParams = &d_params[bounds.first - d_angleType.begin()];
651 return mmffAngleParams;
655 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
656 std::map<
const unsigned int,
657 std::map<
const unsigned int,
658 std::map<
const unsigned int,
659 std::map<const unsigned int, MMFFAngle>>>>
677 const unsigned int stretchBendType,
const unsigned int bondType1,
678 const unsigned int bondType2,
const unsigned int iAtomType,
679 const unsigned int jAtomType,
const unsigned int kAtomType)
const {
680 const MMFFStbn *mmffStbnParams =
nullptr;
682 unsigned int canIAtomType = iAtomType;
683 unsigned int canKAtomType = kAtomType;
684 unsigned int canStretchBendType = stretchBendType;
685 if (iAtomType > kAtomType) {
686 canIAtomType = kAtomType;
687 canKAtomType = iAtomType;
689 }
else if (iAtomType == kAtomType) {
690 swap = (bondType1 < bondType2);
692 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
693 std::map<
const unsigned int,
694 std::map<
const unsigned int,
695 std::map<
const unsigned int,
696 std::map<const unsigned int, MMFFStbn>>>>::
698 std::map<
const unsigned int,
699 std::map<
const unsigned int,
700 std::map<const unsigned int, MMFFStbn>>>::const_iterator
702 std::map<
const unsigned int,
703 std::map<const unsigned int, MMFFStbn>>::const_iterator res3;
704 std::map<const unsigned int, MMFFStbn>::const_iterator res4;
705 res1 = d_params.find(canStretchBendType);
706 if (res1 != d_params.end()) {
707 res2 = ((*res1).second).find(canIAtomType);
708 if (res2 != ((*res1).second).end()) {
709 res3 = ((*res2).second).find(jAtomType);
710 if (res3 != ((*res2).second).end()) {
711 res4 = ((*res3).second).find(canKAtomType);
712 if (res4 != ((*res3).second).end()) {
713 mmffStbnParams = &((*res4).second);
719 std::pair<std::vector<std::uint8_t>::const_iterator,
720 std::vector<std::uint8_t>::const_iterator>
722 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
723 std::pair<std::vector<std::uint8_t>::const_iterator,
724 std::vector<std::uint8_t>::const_iterator>
726 if (jBounds.first != jBounds.second) {
727 bounds = std::equal_range(
728 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
729 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
731 if (bounds.first != bounds.second) {
732 bounds = std::equal_range(
733 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
734 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
736 if (bounds.first != bounds.second) {
737 bounds = std::equal_range(
738 d_stretchBendType.begin() + (bounds.first - d_kAtomType.begin()),
739 d_stretchBendType.begin() + (bounds.second - d_kAtomType.begin()),
741 if (bounds.first != bounds.second) {
743 &d_params[bounds.first - d_stretchBendType.begin()];
750 return std::make_pair(swap, mmffStbnParams);
754 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
755 std::map<
const unsigned int,
756 std::map<
const unsigned int,
757 std::map<
const unsigned int,
758 std::map<const unsigned int, MMFFStbn>>>>
765 std::vector<std::uint8_t>
777 const unsigned int periodicTableRow1,
778 const unsigned int periodicTableRow2,
779 const unsigned int periodicTableRow3)
const {
780 std::map<
const unsigned int,
781 std::map<
const unsigned int,
782 std::map<const unsigned int, MMFFStbn>>>::const_iterator
784 std::map<
const unsigned int,
785 std::map<const unsigned int, MMFFStbn>>::const_iterator res2;
786 std::map<const unsigned int, MMFFStbn>::const_iterator res3;
787 const MMFFStbn *mmffDfsbParams =
nullptr;
789 unsigned int canPeriodicTableRow1 = periodicTableRow1;
790 unsigned int canPeriodicTableRow3 = periodicTableRow3;
791 if (periodicTableRow1 > periodicTableRow3) {
792 canPeriodicTableRow1 = periodicTableRow3;
793 canPeriodicTableRow3 = periodicTableRow1;
796 res1 = d_params.find(canPeriodicTableRow1);
797 if (res1 != d_params.end()) {
798 res2 = ((*res1).second).find(periodicTableRow2);
799 if (res2 != ((*res1).second).end()) {
800 res3 = ((*res2).second).find(canPeriodicTableRow3);
801 if (res3 != ((*res2).second).end()) {
802 mmffDfsbParams = &((*res3).second);
807 return std::make_pair(swap, mmffDfsbParams);
811 std::map<
const unsigned int,
812 std::map<const unsigned int, std::map<const unsigned int, MMFFStbn>>>
823 const unsigned int iAtomType,
824 const unsigned int jAtomType,
825 const unsigned int kAtomType,
826 const unsigned int lAtomType)
const {
827 const MMFFOop *mmffOopParams =
nullptr;
828 unsigned int iter = 0;
829 std::vector<unsigned int> canIKLAtomType(3);
834 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
835 std::map<
const unsigned int,
836 std::map<
const unsigned int,
837 std::map<
const unsigned int,
838 std::map<const unsigned int, MMFFOop>>>>::
840 std::map<
const unsigned int,
841 std::map<
const unsigned int,
842 std::map<const unsigned int, MMFFOop>>>::const_iterator
844 std::map<
const unsigned int,
845 std::map<const unsigned int, MMFFOop>>::const_iterator res3;
846 std::map<const unsigned int, MMFFOop>::const_iterator res4;
847 while ((iter < 4) && (!mmffOopParams)) {
848 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
849 unsigned int canJAtomType = jAtomType;
850 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
851 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
852 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
853 res1 = d_params.find(canIKLAtomType[0]);
854 if (res1 != d_params.end()) {
855 res2 = ((*res1).second).find(canJAtomType);
856 if (res2 != ((*res1).second).end()) {
857 res3 = ((*res2).second).find(canIKLAtomType[1]);
858 if (res3 != ((*res2).second).end()) {
859 res4 = ((*res3).second).find(canIKLAtomType[2]);
860 if (res4 != ((*res3).second).end()) {
861 mmffOopParams = &((*res4).second);
869 std::pair<std::vector<std::uint8_t>::const_iterator,
870 std::vector<std::uint8_t>::const_iterator>
872 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
873 std::pair<std::vector<std::uint8_t>::const_iterator,
874 std::vector<std::uint8_t>::const_iterator>
876 if (jBounds.first != jBounds.second) {
877 while ((iter < 4) && (!mmffOopParams)) {
878 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
879 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
880 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
881 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
882 bounds = std::equal_range(
883 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
884 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
886 if (bounds.first != bounds.second) {
887 bounds = std::equal_range(
888 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
889 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
891 if (bounds.first != bounds.second) {
892 bounds = std::equal_range(
893 d_lAtomType.begin() + (bounds.first - d_kAtomType.begin()),
894 d_lAtomType.begin() + (bounds.second - d_kAtomType.begin()),
896 if (bounds.first != bounds.second) {
897 mmffOopParams = &d_params[bounds.first - d_lAtomType.begin()];
906 return mmffOopParams;
911 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
912 std::map<
const unsigned int,
913 std::map<
const unsigned int,
914 std::map<
const unsigned int,
915 std::map<const unsigned int, MMFFOop>>>>
934 const std::pair<unsigned int, unsigned int> torType,
935 const unsigned int iAtomType,
const unsigned int jAtomType,
936 const unsigned int kAtomType,
const unsigned int lAtomType)
const {
937 const MMFFTor *mmffTorParams =
nullptr;
938 unsigned int iter = 0;
939 unsigned int iWildCard = 0;
940 unsigned int lWildCard = 0;
941 unsigned int canTorType = torType.first;
942 unsigned int maxIter = 5;
947 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
950 std::map<
const unsigned int,
951 std::map<
const unsigned int,
952 std::map<
const unsigned int,
953 std::map<const unsigned int, MMFFTor>>>>>::
955 std::map<
const unsigned int,
956 std::map<
const unsigned int,
957 std::map<
const unsigned int,
958 std::map<const unsigned int, MMFFTor>>>>::
960 std::map<
const unsigned int,
961 std::map<
const unsigned int,
962 std::map<const unsigned int, MMFFTor>>>::const_iterator
964 std::map<
const unsigned int,
965 std::map<const unsigned int, MMFFTor>>::const_iterator res4;
966 std::map<const unsigned int, MMFFTor>::const_iterator res5;
968 std::pair<std::vector<std::uint8_t>::const_iterator,
969 std::vector<std::uint8_t>::const_iterator>
971 std::pair<std::vector<std::uint8_t>::const_iterator,
972 std::vector<std::uint8_t>::const_iterator>
976 while (((iter < maxIter) && ((!mmffTorParams) || (maxIter == 4))) ||
977 ((iter == 4) && (torType.first == 5) && torType.second)) {
983 if ((maxIter == 5) && (iter == 4)) {
986 canTorType = torType.second;
993 }
else if (iter == 2) {
997 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iWildCard];
998 unsigned int canJAtomType = jAtomType;
999 unsigned int canKAtomType = kAtomType;
1000 unsigned int canLAtomType = (*mmffDef)(lAtomType)->eqLevel[lWildCard];
1001 if (canJAtomType > canKAtomType) {
1002 unsigned int temp = canKAtomType;
1003 canKAtomType = canJAtomType;
1004 canJAtomType = temp;
1005 temp = canLAtomType;
1006 canLAtomType = canIAtomType;
1007 canIAtomType = temp;
1008 }
else if ((canJAtomType == canKAtomType) &&
1009 (canIAtomType > canLAtomType)) {
1010 unsigned int temp = canLAtomType;
1011 canLAtomType = canIAtomType;
1012 canIAtomType = temp;
1014 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1015 res1 = d_params.find(canTorType);
1016 if (res1 != d_params.end()) {
1017 res2 = ((*res1).second).find(canIAtomType);
1018 if (res2 != ((*res1).second).end()) {
1019 res3 = ((*res2).second).find(canJAtomType);
1020 if (res3 != ((*res2).second).end()) {
1021 res4 = ((*res3).second).find(canKAtomType);
1022 if (res4 != ((*res3).second).end()) {
1023 res5 = ((*res4).second).find(canLAtomType);
1024 if (res5 != ((*res4).second).end()) {
1025 mmffTorParams = &((*res5).second);
1035 jBounds = std::equal_range(d_jAtomType.begin(), d_jAtomType.end(),
1037 if (jBounds.first != jBounds.second) {
1038 bounds = std::equal_range(
1039 d_kAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1040 d_kAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1042 if (bounds.first != bounds.second) {
1043 bounds = std::equal_range(
1044 d_iAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1045 d_iAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1047 if (bounds.first != bounds.second) {
1048 bounds = std::equal_range(
1049 d_lAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1050 d_lAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1052 if (bounds.first != bounds.second) {
1053 bounds = std::equal_range(
1054 d_torType.begin() + (bounds.first - d_lAtomType.begin()),
1055 d_torType.begin() + (bounds.second - d_lAtomType.begin()),
1057 if (bounds.first != bounds.second) {
1058 mmffTorParams = &d_params[bounds.first - d_torType.begin()];
1071 return std::make_pair(canTorType, mmffTorParams);
1075 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1080 std::map<
const unsigned int,
1081 std::map<
const unsigned int, std::map<
const unsigned int,
1090 std::vector<std::uint8_t>
1108 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1109 std::map<const unsigned int, MMFFVdW>::const_iterator res;
1110 res = d_params.find(atomType);
1112 return (res != d_params.end() ? &((*res).second) : NULL);
1114 std::pair<std::vector<std::uint8_t>::const_iterator,
1115 std::vector<std::uint8_t>::const_iterator>
1117 std::equal_range(d_atomType.begin(), d_atomType.end(), atomType);
1119 return ((bounds.first != bounds.second)
1120 ? &d_params[bounds.first - d_atomType.begin()]
1126 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1127 std::map<const unsigned int, MMFFVdW> d_params;
const MMFFAngle * operator()(const MMFFDefCollection *mmffDef, const unsigned int angleType, const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFAngle > d_params
the parameter vector
std::vector< std::uint8_t > d_angleType
atom type vector for atom k
MMFFAngleCollection(std::string mmffAngle="")
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom i
std::vector< std::uint8_t > d_iAtomType
class to store MMFF parameters for angle bending
MMFFAromCollection(const std::vector< std::uint8_t > *mmffArom=nullptr)
std::vector< std::uint8_t > d_params
the aromatic type vector
bool isMMFFAromatic(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
MMFFBndkCollection(std::string mmffBndk="")
std::vector< std::uint8_t > d_jAtomicNum
atomic number vector for atom i
std::vector< std::uint8_t > d_iAtomicNum
const MMFFBond * operator()(const int atomicNum, const int nbrAtomicNum) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFBond > d_params
the parameter vector
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom i
std::vector< std::uint8_t > d_bondType
atom type vector for atom j
std::vector< std::uint8_t > d_iAtomType
MMFFBondCollection(std::string mmffBond="")
const MMFFBond * operator()(const unsigned int bondType, const unsigned int atomType, const unsigned int nbrAtomType) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFBond > d_params
the parameter vector
class to store MMFF parameters for bond stretching
std::vector< MMFFChg > d_params
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom i
MMFFChgCollection(std::string mmffChg="")
the parameter 3D-map
const std::pair< int, const MMFFChg * > getMMFFChgParams(const unsigned int bondType, const unsigned int iAtomType, const unsigned int jAtomType) const
Looks up the parameters for a particular key and returns them.
std::vector< std::uint8_t > d_iAtomType
the parameter vector
std::vector< std::uint8_t > d_bondType
atom type vector for atom j
const MMFFCovRadPauEle * operator()(const unsigned int atomicNum) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFCovRadPauEle > d_params
the parameter vector
std::vector< std::uint8_t > d_atomicNum
the atomic number vector
MMFFCovRadPauEleCollection(std::string mmffCovRadPauEle="")
const MMFFDef * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFDef > d_params
the parameter vector
MMFFDefCollection(std::string mmffDef="")
class to store MMFF atom type equivalence levels
MMFFDfsbCollection(std::string mmffDfsb="")
std::map< const unsigned int, std::map< const unsigned int, std::map< const unsigned int, MMFFStbn > > > d_params
the parameter 3D-map
const std::pair< bool, const MMFFStbn * > getMMFFDfsbParams(const unsigned int periodicTableRow1, const unsigned int periodicTableRow2, const unsigned int periodicTableRow3) const
Looks up the parameters for a particular key and returns them.
const MMFFHerschbachLaurie * operator()(const int iRow, const int jRow) const
Looks up the parameters for a particular key and returns them.
std::vector< std::uint8_t > d_iRow
std::vector< std::uint8_t > d_jRow
periodic row number vector for atom i
MMFFHerschbachLaurieCollection(std::string mmffHerschbachLaurie="")
std::vector< MMFFHerschbachLaurie > d_params
the parameter vector
MMFFOopCollection(const bool isMMFFs, std::string mmffOop="")
std::vector< std::uint8_t > d_iAtomType
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom j
std::vector< MMFFOop > d_params
the parameter vector
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom i
const MMFFOop * operator()(const MMFFDefCollection *mmffDef, const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType, const unsigned int lAtomType) const
Looks up the parameters for a particular key and returns them.
std::vector< std::uint8_t > d_lAtomType
atom type vector for atom k
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.
MMFFPBCICollection(std::string mmffPBCI="")
std::vector< MMFFPBCI > d_params
the parameter vector
class to store MMFF Partial Bond Charge Increments
const MMFFProp * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFProp > d_params
MMFFPropCollection(std::string mmffProp="")
std::vector< std::uint8_t > d_iAtomType
the parameter vector
class to store MMFF Properties
MMFFStbnCollection(std::string mmffStbn="")
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom i
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) const
Looks up the parameters for a particular key and returns them.
std::vector< std::uint8_t > d_stretchBendType
atom type vector for atom k
std::vector< MMFFStbn > d_params
the parameter vector
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_iAtomType
class to store MMFF parameters for stretch-bending
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom i
MMFFTorCollection(const bool isMMFFs, std::string mmffTor="")
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_torType
atom type vector for atom l
std::vector< std::uint8_t > d_lAtomType
atom type vector for atom k
const std::pair< const unsigned int, const MMFFTor * > getMMFFTorParams(const MMFFDefCollection *mmffDef, const std::pair< unsigned int, unsigned int > torType, const unsigned int iAtomType, const unsigned int jAtomType, const unsigned int kAtomType, const unsigned int lAtomType) const
Looks up the parameters for a particular key and returns them.
std::vector< MMFFTor > d_params
the parameter vector
std::vector< std::uint8_t > d_iAtomType
class to store MMFF parameters for torsions
double power
gets a pointer to the singleton MMFFVdWCollection
std::vector< MMFFVdW > d_params
the parameter vector
const MMFFVdW * operator()(const unsigned int atomType) const
Looks up the parameters for a particular key and returns them.
MMFFVdWCollection(std::string mmffVdW="")
std::vector< std::uint8_t > d_atomType
class to store MMFF parameters for non-bonded Van der Waals
#define RDKIT_FORCEFIELD_EXPORT
bool isDoubleZero(const double x)
const double MDYNE_A_TO_KCAL_MOL
void clipToOne(double &x)