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) !=
180#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
181 std::map<const unsigned int, MMFFDef>::const_iterator res;
182 res = d_params.find(atomType);
184 return ((res != d_params.end()) ? &((*res).second) : NULL);
186 return ((atomType && (atomType <= d_params.size()))
187 ? &d_params[atomType - 1]
194#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
195 std::map<const unsigned int, MMFFDef> d_params;
208#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
209 std::map<const unsigned int, MMFFProp>::const_iterator res;
210 res = d_params.find(atomType);
212 return ((res != d_params.end()) ? &((*res).second) : NULL);
214 std::pair<std::vector<std::uint8_t>::const_iterator,
215 std::vector<std::uint8_t>::const_iterator>
217 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), atomType);
219 return ((bounds.first != bounds.second)
220 ? &d_params[bounds.first - d_iAtomType.begin()]
226#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
227 std::map<const unsigned int, MMFFProp> d_params;
241#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
242 std::map<const unsigned int, MMFFPBCI>::const_iterator res;
243 res = d_params.find(atomType);
245 return ((res != d_params.end()) ? &((*res).second) : NULL);
247 return ((atomType && (atomType <= d_params.size()))
248 ? &d_params[atomType - 1]
255#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
256 std::map<const unsigned int, MMFFPBCI> d_params;
269 const unsigned int bondType,
const unsigned int iAtomType,
270 const unsigned int jAtomType)
const {
272 const MMFFChg *mmffChgParams =
nullptr;
273 unsigned int canIAtomType = iAtomType;
274 unsigned int canJAtomType = jAtomType;
275 if (iAtomType > jAtomType) {
276 canIAtomType = jAtomType;
277 canJAtomType = iAtomType;
280#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
281 std::map<
const unsigned int,
282 std::map<const unsigned int, MMFFChg>>::const_iterator res1;
283 std::map<const unsigned int, MMFFChg>::const_iterator res2;
284 res1 = d_params[bondType].find(canIAtomType);
285 if (res1 != d_params[bondType].end()) {
286 res2 = ((*res1).second).find(canJAtomType);
287 if (res2 != ((*res1).second).end()) {
288 mmffChgParams = &((*res2).second);
292 std::pair<std::vector<std::uint8_t>::const_iterator,
293 std::vector<std::uint8_t>::const_iterator>
297 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canIAtomType);
298 if (bounds.first != bounds.second) {
299 bounds = std::equal_range(
300 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
301 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
303 if (bounds.first != bounds.second) {
304 bounds = std::equal_range(
305 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
306 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
308 if (bounds.first != bounds.second) {
309 mmffChgParams = &d_params[bounds.first - d_bondType.begin()];
315 return std::make_pair(sign, mmffChgParams);
321#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
322 std::map<
const unsigned int,
323 std::map<const unsigned int, std::map<const unsigned int, MMFFChg>>>
340 const unsigned int atomType,
341 const unsigned int nbrAtomType)
const {
342 const MMFFBond *mmffBondParams =
nullptr;
343 unsigned int canAtomType = atomType;
344 unsigned int canNbrAtomType = nbrAtomType;
345 if (atomType > nbrAtomType) {
346 canAtomType = nbrAtomType;
347 canNbrAtomType = atomType;
349#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
350 std::map<
const unsigned int,
351 std::map<
const unsigned int,
352 std::map<const unsigned int, MMFFBond>>>::const_iterator
354 std::map<
const unsigned int,
355 std::map<const unsigned int, MMFFBond>>::const_iterator res2;
356 std::map<const unsigned int, MMFFBond>::const_iterator res3;
357 res1 = d_params.find(bondType);
358 if (res1 != d_params.end()) {
359 res2 = ((*res1).second).find(canAtomType);
360 if (res2 != ((*res1).second).end()) {
361 res3 = ((*res2).second).find(canNbrAtomType);
362 if (res3 != ((*res2).second).end()) {
363 mmffBondParams = &((*res3).second);
368 std::pair<std::vector<std::uint8_t>::const_iterator,
369 std::vector<std::uint8_t>::const_iterator>
372 std::equal_range(d_iAtomType.begin(), d_iAtomType.end(), canAtomType);
373 if (bounds.first != bounds.second) {
374 bounds = std::equal_range(
375 d_jAtomType.begin() + (bounds.first - d_iAtomType.begin()),
376 d_jAtomType.begin() + (bounds.second - d_iAtomType.begin()),
378 if (bounds.first != bounds.second) {
379 bounds = std::equal_range(
380 d_bondType.begin() + (bounds.first - d_jAtomType.begin()),
381 d_bondType.begin() + (bounds.second - d_jAtomType.begin()),
383 if (bounds.first != bounds.second) {
384 mmffBondParams = &d_params[bounds.first - d_bondType.begin()];
390 return mmffBondParams;
394#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
395 std::map<
const unsigned int,
396 std::map<const unsigned int, std::map<const unsigned int, MMFFBond>>>
413 const int nbrAtomicNum)
const {
414 const MMFFBond *mmffBndkParams =
nullptr;
415 unsigned int canAtomicNum = atomicNum;
416 unsigned int canNbrAtomicNum = nbrAtomicNum;
417 if (atomicNum > nbrAtomicNum) {
418 canAtomicNum = nbrAtomicNum;
419 canNbrAtomicNum = atomicNum;
421#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
422 std::map<
const unsigned int,
423 std::map<const unsigned int, MMFFBond>>::const_iterator res1;
424 std::map<const unsigned int, MMFFBond>::const_iterator res2;
425 res1 = d_params.find(canAtomicNum);
426 if (res1 != d_params.end()) {
427 res2 = ((*res1).second).find(canNbrAtomicNum);
428 if (res2 != ((*res1).second).end()) {
429 mmffBndkParams = &((*res2).second);
433 std::pair<std::vector<std::uint8_t>::const_iterator,
434 std::vector<std::uint8_t>::const_iterator>
436 bounds = std::equal_range(d_iAtomicNum.begin(), d_iAtomicNum.end(),
438 if (bounds.first != bounds.second) {
439 bounds = std::equal_range(
440 d_jAtomicNum.begin() + (bounds.first - d_iAtomicNum.begin()),
441 d_jAtomicNum.begin() + (bounds.second - d_iAtomicNum.begin()),
443 if (bounds.first != bounds.second) {
444 mmffBndkParams = &d_params[bounds.first - d_jAtomicNum.begin()];
449 return mmffBndkParams;
453#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
454 std::map<const unsigned int, std::map<const unsigned int, MMFFBond>>
471 unsigned int canIRow = iRow;
472 unsigned int canJRow = jRow;
477#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
478 std::map<
const unsigned int,
479 std::map<const unsigned int, MMFFHerschbachLaurie>>::const_iterator
481 std::map<const unsigned int, MMFFHerschbachLaurie>::const_iterator res2;
482 res1 = d_params.find(canIRow);
483 if (res1 != d_params.end()) {
484 res2 = ((*res1).second).find(canJRow);
485 if (res2 != ((*res1).second).end()) {
486 mmffHerschbachLaurieParams = &((*res2).second);
490 std::pair<std::vector<std::uint8_t>::const_iterator,
491 std::vector<std::uint8_t>::const_iterator>
493 bounds = std::equal_range(d_iRow.begin(), d_iRow.end(), canIRow);
494 if (bounds.first != bounds.second) {
495 bounds = std::equal_range(
496 d_jRow.begin() + (bounds.first - d_iRow.begin()),
497 d_jRow.begin() + (bounds.second - d_iRow.begin()), canJRow);
498 if (bounds.first != bounds.second) {
499 mmffHerschbachLaurieParams = &d_params[bounds.first - d_jRow.begin()];
504 return mmffHerschbachLaurieParams;
509#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
510 std::map<
const unsigned int,
511 std::map<const unsigned int, MMFFHerschbachLaurie>>
527#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
528 std::map<const unsigned int, MMFFCovRadPauEle>::const_iterator res;
529 res = d_params.find(atomicNum);
531 return ((res != d_params.end()) ? &((*res).second) : NULL);
533 std::pair<std::vector<std::uint8_t>::const_iterator,
534 std::vector<std::uint8_t>::const_iterator>
536 std::equal_range(d_atomicNum.begin(), d_atomicNum.end(), atomicNum);
538 return ((bounds.first != bounds.second)
539 ? &d_params[bounds.first - d_atomicNum.begin()]
545#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
546 std::map<const unsigned int, MMFFCovRadPauEle>
561 const unsigned int angleType,
562 const unsigned int iAtomType,
563 const unsigned int jAtomType,
564 const unsigned int kAtomType)
const {
565 const MMFFAngle *mmffAngleParams =
nullptr;
566 unsigned int iter = 0;
572#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
573 std::map<
const unsigned int,
574 std::map<
const unsigned int,
575 std::map<
const unsigned int,
576 std::map<const unsigned int, MMFFAngle>>>>::
578 std::map<
const unsigned int,
579 std::map<
const unsigned int,
580 std::map<const unsigned int, MMFFAngle>>>::const_iterator
582 std::map<
const unsigned int,
583 std::map<const unsigned int, MMFFAngle>>::const_iterator res3;
584 std::map<const unsigned int, MMFFAngle>::const_iterator res4;
585 while ((iter < 4) && (!mmffAngleParams)) {
586 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
587 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
588 if (canIAtomType > canKAtomType) {
589 unsigned int temp = canKAtomType;
590 canKAtomType = canIAtomType;
593 res1 = d_params.find(angleType);
594 if (res1 != d_params.end()) {
595 res2 = ((*res1).second).find(canIAtomType);
596 if (res2 != ((*res1).second).end()) {
597 res3 = ((*res2).second).find(jAtomType);
598 if (res3 != ((*res2).second).end()) {
599 res4 = ((*res3).second).find(canKAtomType);
600 if (res4 != ((*res3).second).end()) {
601 mmffAngleParams = &((*res4).second);
609 std::pair<std::vector<std::uint8_t>::const_iterator,
610 std::vector<std::uint8_t>::const_iterator>
612 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
613 std::pair<std::vector<std::uint8_t>::const_iterator,
614 std::vector<std::uint8_t>::const_iterator>
616 if (jBounds.first != jBounds.second) {
617 while ((iter < 4) && (!mmffAngleParams)) {
618 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
619 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
620 if (canIAtomType > canKAtomType) {
621 unsigned int temp = canKAtomType;
622 canKAtomType = canIAtomType;
625 bounds = std::equal_range(
626 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
627 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
629 if (bounds.first != bounds.second) {
630 bounds = std::equal_range(
631 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
632 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
634 if (bounds.first != bounds.second) {
635 bounds = std::equal_range(
636 d_angleType.begin() + (bounds.first - d_kAtomType.begin()),
637 d_angleType.begin() + (bounds.second - d_kAtomType.begin()),
639 if (bounds.first != bounds.second) {
640 mmffAngleParams = &d_params[bounds.first - d_angleType.begin()];
649 return mmffAngleParams;
653#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
654 std::map<
const unsigned int,
655 std::map<
const unsigned int,
656 std::map<
const unsigned int,
657 std::map<const unsigned int, MMFFAngle>>>>
675 const unsigned int stretchBendType,
const unsigned int bondType1,
676 const unsigned int bondType2,
const unsigned int iAtomType,
677 const unsigned int jAtomType,
const unsigned int kAtomType)
const {
678 const MMFFStbn *mmffStbnParams =
nullptr;
680 unsigned int canIAtomType = iAtomType;
681 unsigned int canKAtomType = kAtomType;
682 unsigned int canStretchBendType = stretchBendType;
683 if (iAtomType > kAtomType) {
684 canIAtomType = kAtomType;
685 canKAtomType = iAtomType;
687 }
else if (iAtomType == kAtomType) {
688 swap = (bondType1 < bondType2);
690#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
691 std::map<
const unsigned int,
692 std::map<
const unsigned int,
693 std::map<
const unsigned int,
694 std::map<const unsigned int, MMFFStbn>>>>::
696 std::map<
const unsigned int,
697 std::map<
const unsigned int,
698 std::map<const unsigned int, MMFFStbn>>>::const_iterator
700 std::map<
const unsigned int,
701 std::map<const unsigned int, MMFFStbn>>::const_iterator res3;
702 std::map<const unsigned int, MMFFStbn>::const_iterator res4;
703 res1 = d_params.find(canStretchBendType);
704 if (res1 != d_params.end()) {
705 res2 = ((*res1).second).find(canIAtomType);
706 if (res2 != ((*res1).second).end()) {
707 res3 = ((*res2).second).find(jAtomType);
708 if (res3 != ((*res2).second).end()) {
709 res4 = ((*res3).second).find(canKAtomType);
710 if (res4 != ((*res3).second).end()) {
711 mmffStbnParams = &((*res4).second);
717 std::pair<std::vector<std::uint8_t>::const_iterator,
718 std::vector<std::uint8_t>::const_iterator>
720 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
721 std::pair<std::vector<std::uint8_t>::const_iterator,
722 std::vector<std::uint8_t>::const_iterator>
724 if (jBounds.first != jBounds.second) {
725 bounds = std::equal_range(
726 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
727 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
729 if (bounds.first != bounds.second) {
730 bounds = std::equal_range(
731 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
732 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
734 if (bounds.first != bounds.second) {
735 bounds = std::equal_range(
736 d_stretchBendType.begin() + (bounds.first - d_kAtomType.begin()),
737 d_stretchBendType.begin() + (bounds.second - d_kAtomType.begin()),
739 if (bounds.first != bounds.second) {
741 &d_params[bounds.first - d_stretchBendType.begin()];
748 return std::make_pair(swap, mmffStbnParams);
752#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
753 std::map<
const unsigned int,
754 std::map<
const unsigned int,
755 std::map<
const unsigned int,
756 std::map<const unsigned int, MMFFStbn>>>>
763 std::vector<std::uint8_t>
775 const unsigned int periodicTableRow1,
776 const unsigned int periodicTableRow2,
777 const unsigned int periodicTableRow3)
const {
778 std::map<
const unsigned int,
779 std::map<
const unsigned int,
780 std::map<const unsigned int, MMFFStbn>>>::const_iterator
782 std::map<
const unsigned int,
783 std::map<const unsigned int, MMFFStbn>>::const_iterator res2;
784 std::map<const unsigned int, MMFFStbn>::const_iterator res3;
785 const MMFFStbn *mmffDfsbParams =
nullptr;
787 unsigned int canPeriodicTableRow1 = periodicTableRow1;
788 unsigned int canPeriodicTableRow3 = periodicTableRow3;
789 if (periodicTableRow1 > periodicTableRow3) {
790 canPeriodicTableRow1 = periodicTableRow3;
791 canPeriodicTableRow3 = periodicTableRow1;
794 res1 = d_params.find(canPeriodicTableRow1);
795 if (res1 != d_params.end()) {
796 res2 = ((*res1).second).find(periodicTableRow2);
797 if (res2 != ((*res1).second).end()) {
798 res3 = ((*res2).second).find(canPeriodicTableRow3);
799 if (res3 != ((*res2).second).end()) {
800 mmffDfsbParams = &((*res3).second);
805 return std::make_pair(swap, mmffDfsbParams);
809 std::map<
const unsigned int,
810 std::map<const unsigned int, std::map<const unsigned int, MMFFStbn>>>
821 const unsigned int iAtomType,
822 const unsigned int jAtomType,
823 const unsigned int kAtomType,
824 const unsigned int lAtomType)
const {
825 const MMFFOop *mmffOopParams =
nullptr;
826 unsigned int iter = 0;
827 std::vector<unsigned int> canIKLAtomType(3);
832#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
833 std::map<
const unsigned int,
834 std::map<
const unsigned int,
835 std::map<
const unsigned int,
836 std::map<const unsigned int, MMFFOop>>>>::
838 std::map<
const unsigned int,
839 std::map<
const unsigned int,
840 std::map<const unsigned int, MMFFOop>>>::const_iterator
842 std::map<
const unsigned int,
843 std::map<const unsigned int, MMFFOop>>::const_iterator res3;
844 std::map<const unsigned int, MMFFOop>::const_iterator res4;
845 while ((iter < 4) && (!mmffOopParams)) {
846 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
847 unsigned int canJAtomType = jAtomType;
848 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
849 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
850 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
851 res1 = d_params.find(canIKLAtomType[0]);
852 if (res1 != d_params.end()) {
853 res2 = ((*res1).second).find(canJAtomType);
854 if (res2 != ((*res1).second).end()) {
855 res3 = ((*res2).second).find(canIKLAtomType[1]);
856 if (res3 != ((*res2).second).end()) {
857 res4 = ((*res3).second).find(canIKLAtomType[2]);
858 if (res4 != ((*res3).second).end()) {
859 mmffOopParams = &((*res4).second);
867 std::pair<std::vector<std::uint8_t>::const_iterator,
868 std::vector<std::uint8_t>::const_iterator>
870 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
871 std::pair<std::vector<std::uint8_t>::const_iterator,
872 std::vector<std::uint8_t>::const_iterator>
874 if (jBounds.first != jBounds.second) {
875 while ((iter < 4) && (!mmffOopParams)) {
876 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
877 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
878 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
879 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
880 bounds = std::equal_range(
881 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
882 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
884 if (bounds.first != bounds.second) {
885 bounds = std::equal_range(
886 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
887 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
889 if (bounds.first != bounds.second) {
890 bounds = std::equal_range(
891 d_lAtomType.begin() + (bounds.first - d_kAtomType.begin()),
892 d_lAtomType.begin() + (bounds.second - d_kAtomType.begin()),
894 if (bounds.first != bounds.second) {
895 mmffOopParams = &d_params[bounds.first - d_lAtomType.begin()];
904 return mmffOopParams;
909#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
910 std::map<
const unsigned int,
911 std::map<
const unsigned int,
912 std::map<
const unsigned int,
913 std::map<const unsigned int, MMFFOop>>>>
932 const std::pair<unsigned int, unsigned int> torType,
933 const unsigned int iAtomType,
const unsigned int jAtomType,
934 const unsigned int kAtomType,
const unsigned int lAtomType)
const {
935 const MMFFTor *mmffTorParams =
nullptr;
936 unsigned int iter = 0;
937 unsigned int iWildCard = 0;
938 unsigned int lWildCard = 0;
939 unsigned int canTorType = torType.first;
940 unsigned int maxIter = 5;
945#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
948 std::map<
const unsigned int,
949 std::map<
const unsigned int,
950 std::map<
const unsigned int,
951 std::map<const unsigned int, MMFFTor>>>>>::
953 std::map<
const unsigned int,
954 std::map<
const unsigned int,
955 std::map<
const unsigned int,
956 std::map<const unsigned int, MMFFTor>>>>::
958 std::map<
const unsigned int,
959 std::map<
const unsigned int,
960 std::map<const unsigned int, MMFFTor>>>::const_iterator
962 std::map<
const unsigned int,
963 std::map<const unsigned int, MMFFTor>>::const_iterator res4;
964 std::map<const unsigned int, MMFFTor>::const_iterator res5;
966 std::pair<std::vector<std::uint8_t>::const_iterator,
967 std::vector<std::uint8_t>::const_iterator>
969 std::pair<std::vector<std::uint8_t>::const_iterator,
970 std::vector<std::uint8_t>::const_iterator>
974 while (((iter < maxIter) && ((!mmffTorParams) || (maxIter == 4))) ||
975 ((iter == 4) && (torType.first == 5) && torType.second)) {
981 if ((maxIter == 5) && (iter == 4)) {
984 canTorType = torType.second;
991 }
else if (iter == 2) {
995 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iWildCard];
996 unsigned int canJAtomType = jAtomType;
997 unsigned int canKAtomType = kAtomType;
998 unsigned int canLAtomType = (*mmffDef)(lAtomType)->eqLevel[lWildCard];
999 if (canJAtomType > canKAtomType) {
1000 unsigned int temp = canKAtomType;
1001 canKAtomType = canJAtomType;
1002 canJAtomType = temp;
1003 temp = canLAtomType;
1004 canLAtomType = canIAtomType;
1005 canIAtomType = temp;
1006 }
else if ((canJAtomType == canKAtomType) &&
1007 (canIAtomType > canLAtomType)) {
1008 unsigned int temp = canLAtomType;
1009 canLAtomType = canIAtomType;
1010 canIAtomType = temp;
1012#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1013 res1 = d_params.find(canTorType);
1014 if (res1 != d_params.end()) {
1015 res2 = ((*res1).second).find(canIAtomType);
1016 if (res2 != ((*res1).second).end()) {
1017 res3 = ((*res2).second).find(canJAtomType);
1018 if (res3 != ((*res2).second).end()) {
1019 res4 = ((*res3).second).find(canKAtomType);
1020 if (res4 != ((*res3).second).end()) {
1021 res5 = ((*res4).second).find(canLAtomType);
1022 if (res5 != ((*res4).second).end()) {
1023 mmffTorParams = &((*res5).second);
1033 jBounds = std::equal_range(d_jAtomType.begin(), d_jAtomType.end(),
1035 if (jBounds.first != jBounds.second) {
1036 bounds = std::equal_range(
1037 d_kAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1038 d_kAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1040 if (bounds.first != bounds.second) {
1041 bounds = std::equal_range(
1042 d_iAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1043 d_iAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1045 if (bounds.first != bounds.second) {
1046 bounds = std::equal_range(
1047 d_lAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1048 d_lAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1050 if (bounds.first != bounds.second) {
1051 bounds = std::equal_range(
1052 d_torType.begin() + (bounds.first - d_lAtomType.begin()),
1053 d_torType.begin() + (bounds.second - d_lAtomType.begin()),
1055 if (bounds.first != bounds.second) {
1056 mmffTorParams = &d_params[bounds.first - d_torType.begin()];
1069 return std::make_pair(canTorType, mmffTorParams);
1073#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1078 std::map<
const unsigned int,
1079 std::map<
const unsigned int, std::map<
const unsigned int,
1088 std::vector<std::uint8_t>
1106#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1107 std::map<const unsigned int, MMFFVdW>::const_iterator res;
1108 res = d_params.find(atomType);
1110 return (res != d_params.end() ? &((*res).second) : NULL);
1112 std::pair<std::vector<std::uint8_t>::const_iterator,
1113 std::vector<std::uint8_t>::const_iterator>
1115 std::equal_range(d_atomType.begin(), d_atomType.end(), atomType);
1117 return ((bounds.first != bounds.second)
1118 ? &d_params[bounds.first - d_atomType.begin()]
1124#ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1125 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
angle type vector for angle i-j-k
MMFFAngleCollection(std::string mmffAngle="")
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom k
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_iAtomType
atom type vector for atom i
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 j
std::vector< std::uint8_t > d_iAtomicNum
atomic number vector for atom i
std::vector< MMFFBond > d_params
the parameter vector
const MMFFBond * operator()(const int atomicNum, const int nbrAtomicNum) const
Looks up the parameters for a particular key and returns them.
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_bondType
bond type vector for bond i-j
std::vector< std::uint8_t > d_iAtomType
atom type vector for atom i
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
the parameter vector
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom j
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
atom type vector for atom i
std::vector< std::uint8_t > d_bondType
bond type vector for bond i-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
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.
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 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
periodic row number vector for atom i
std::vector< std::uint8_t > d_jRow
periodic row number vector for atom j
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
atom type vector for atom i
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom k
std::vector< MMFFOop > d_params
the parameter vector
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_jAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_lAtomType
atom type vector for atom l
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
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.
MMFFStbnCollection(std::string mmffStbn="")
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom j
std::vector< std::uint8_t > d_stretchBendType
stretch-bend type vector for angle i-j-k
std::vector< MMFFStbn > d_params
the parameter vector
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom k
std::vector< std::uint8_t > d_iAtomType
atom type vector for atom i
class to store MMFF parameters for stretch-bending
std::vector< std::uint8_t > d_jAtomType
atom type vector for atom j
MMFFTorCollection(const bool isMMFFs, std::string mmffTor="")
std::vector< std::uint8_t > d_kAtomType
atom type vector for atom k
std::vector< std::uint8_t > d_torType
torsion type vector for angle i-j-k-l
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< std::uint8_t > d_lAtomType
atom type vector for atom l
std::vector< MMFFTor > d_params
the parameter vector
std::vector< std::uint8_t > d_iAtomType
atom type vector for atom i
class to store MMFF parameters for torsions
double power
gets a pointer to the singleton MMFFVdWCollection
std::vector< MMFFVdW > d_params
the parameter vector
MMFFVdWCollection(std::string mmffVdW="")
std::vector< std::uint8_t > d_atomType
atom type vector
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
#define RDKIT_FORCEFIELD_EXPORT
bool isDoubleZero(const double x)
const double MDYNE_A_TO_KCAL_MOL
void clipToOne(double &x)