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 = NULL;
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 = NULL;
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 MMFFBond *mmffBndkParams = NULL;
416 unsigned int canAtomicNum = atomicNum;
417 unsigned int canNbrAtomicNum = nbrAtomicNum;
418 if (atomicNum > nbrAtomicNum) {
419 canAtomicNum = nbrAtomicNum;
420 canNbrAtomicNum = atomicNum;
422 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
423 std::map<
const unsigned int,
424 std::map<const unsigned int, MMFFBond>>::const_iterator res1;
425 std::map<const unsigned int, MMFFBond>::const_iterator res2;
426 res1 = d_params.find(canAtomicNum);
427 if (res1 != d_params.end()) {
428 res2 = ((*res1).second).find(canNbrAtomicNum);
429 if (res2 != ((*res1).second).end()) {
430 mmffBndkParams = &((*res2).second);
434 std::pair<std::vector<std::uint8_t>::const_iterator,
435 std::vector<std::uint8_t>::const_iterator>
437 bounds = std::equal_range(d_iAtomicNum.begin(), d_iAtomicNum.end(),
439 if (bounds.first != bounds.second) {
440 bounds = std::equal_range(
441 d_jAtomicNum.begin() + (bounds.first - d_iAtomicNum.begin()),
442 d_jAtomicNum.begin() + (bounds.second - d_iAtomicNum.begin()),
444 if (bounds.first != bounds.second) {
445 mmffBndkParams = &d_params[bounds.first - d_jAtomicNum.begin()];
450 return mmffBndkParams;
454 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
455 std::map<const unsigned int, std::map<const unsigned int, MMFFBond>>
472 unsigned int canIRow = iRow;
473 unsigned int canJRow = jRow;
478 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
479 std::map<
const unsigned int,
480 std::map<const unsigned int, MMFFHerschbachLaurie>>::const_iterator
482 std::map<const unsigned int, MMFFHerschbachLaurie>::const_iterator res2;
483 res1 = d_params.find(canIRow);
484 if (res1 != d_params.end()) {
485 res2 = ((*res1).second).find(canJRow);
486 if (res2 != ((*res1).second).end()) {
487 mmffHerschbachLaurieParams = &((*res2).second);
491 std::pair<std::vector<std::uint8_t>::const_iterator,
492 std::vector<std::uint8_t>::const_iterator>
494 bounds = std::equal_range(d_iRow.begin(), d_iRow.end(), canIRow);
495 if (bounds.first != bounds.second) {
496 bounds = std::equal_range(
497 d_jRow.begin() + (bounds.first - d_iRow.begin()),
498 d_jRow.begin() + (bounds.second - d_iRow.begin()), canJRow);
499 if (bounds.first != bounds.second) {
500 mmffHerschbachLaurieParams = &d_params[bounds.first - d_jRow.begin()];
505 return mmffHerschbachLaurieParams;
510 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
511 std::map<
const unsigned int,
512 std::map<const unsigned int, MMFFHerschbachLaurie>>
528 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
529 std::map<const unsigned int, MMFFCovRadPauEle>::const_iterator res;
530 res = d_params.find(atomicNum);
532 return ((res != d_params.end()) ? &((*res).second) : NULL);
534 std::pair<std::vector<std::uint8_t>::const_iterator,
535 std::vector<std::uint8_t>::const_iterator>
537 std::equal_range(d_atomicNum.begin(), d_atomicNum.end(), atomicNum);
539 return ((bounds.first != bounds.second)
540 ? &d_params[bounds.first - d_atomicNum.begin()]
546 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
547 std::map<const unsigned int, MMFFCovRadPauEle>
562 const unsigned int angleType,
563 const unsigned int iAtomType,
564 const unsigned int jAtomType,
565 const unsigned int kAtomType)
const {
567 unsigned int iter = 0;
573 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
574 std::map<
const unsigned int,
575 std::map<
const unsigned int,
576 std::map<
const unsigned int,
577 std::map<const unsigned int, MMFFAngle>>>>::
579 std::map<
const unsigned int,
580 std::map<
const unsigned int,
581 std::map<const unsigned int, MMFFAngle>>>::const_iterator
583 std::map<
const unsigned int,
584 std::map<const unsigned int, MMFFAngle>>::const_iterator res3;
585 std::map<const unsigned int, MMFFAngle>::const_iterator res4;
586 while ((iter < 4) && (!mmffAngleParams)) {
587 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
588 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
589 if (canIAtomType > canKAtomType) {
590 unsigned int temp = canKAtomType;
591 canKAtomType = canIAtomType;
594 res1 = d_params.find(angleType);
595 if (res1 != d_params.end()) {
596 res2 = ((*res1).second).find(canIAtomType);
597 if (res2 != ((*res1).second).end()) {
598 res3 = ((*res2).second).find(jAtomType);
599 if (res3 != ((*res2).second).end()) {
600 res4 = ((*res3).second).find(canKAtomType);
601 if (res4 != ((*res3).second).end()) {
602 mmffAngleParams = &((*res4).second);
610 std::pair<std::vector<std::uint8_t>::const_iterator,
611 std::vector<std::uint8_t>::const_iterator>
613 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
614 std::pair<std::vector<std::uint8_t>::const_iterator,
615 std::vector<std::uint8_t>::const_iterator>
617 if (jBounds.first != jBounds.second) {
618 while ((iter < 4) && (!mmffAngleParams)) {
619 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iter];
620 unsigned int canKAtomType = (*mmffDef)(kAtomType)->eqLevel[iter];
621 if (canIAtomType > canKAtomType) {
622 unsigned int temp = canKAtomType;
623 canKAtomType = canIAtomType;
626 bounds = std::equal_range(
627 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
628 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
630 if (bounds.first != bounds.second) {
631 bounds = std::equal_range(
632 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
633 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
635 if (bounds.first != bounds.second) {
636 bounds = std::equal_range(
637 d_angleType.begin() + (bounds.first - d_kAtomType.begin()),
638 d_angleType.begin() + (bounds.second - d_kAtomType.begin()),
640 if (bounds.first != bounds.second) {
641 mmffAngleParams = &d_params[bounds.first - d_angleType.begin()];
650 return mmffAngleParams;
654 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
655 std::map<
const unsigned int,
656 std::map<
const unsigned int,
657 std::map<
const unsigned int,
658 std::map<const unsigned int, MMFFAngle>>>>
676 const unsigned int stretchBendType,
const unsigned int bondType1,
677 const unsigned int bondType2,
const unsigned int iAtomType,
678 const unsigned int jAtomType,
const unsigned int kAtomType)
const {
679 const MMFFStbn *mmffStbnParams = NULL;
681 unsigned int canIAtomType = iAtomType;
682 unsigned int canKAtomType = kAtomType;
683 unsigned int canStretchBendType = stretchBendType;
684 if (iAtomType > kAtomType) {
685 canIAtomType = kAtomType;
686 canKAtomType = iAtomType;
688 }
else if (iAtomType == kAtomType) {
689 swap = (bondType1 < bondType2);
691 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
692 std::map<
const unsigned int,
693 std::map<
const unsigned int,
694 std::map<
const unsigned int,
695 std::map<const unsigned int, MMFFStbn>>>>::
697 std::map<
const unsigned int,
698 std::map<
const unsigned int,
699 std::map<const unsigned int, MMFFStbn>>>::const_iterator
701 std::map<
const unsigned int,
702 std::map<const unsigned int, MMFFStbn>>::const_iterator res3;
703 std::map<const unsigned int, MMFFStbn>::const_iterator res4;
704 res1 = d_params.find(canStretchBendType);
705 if (res1 != d_params.end()) {
706 res2 = ((*res1).second).find(canIAtomType);
707 if (res2 != ((*res1).second).end()) {
708 res3 = ((*res2).second).find(jAtomType);
709 if (res3 != ((*res2).second).end()) {
710 res4 = ((*res3).second).find(canKAtomType);
711 if (res4 != ((*res3).second).end()) {
712 mmffStbnParams = &((*res4).second);
718 std::pair<std::vector<std::uint8_t>::const_iterator,
719 std::vector<std::uint8_t>::const_iterator>
721 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
722 std::pair<std::vector<std::uint8_t>::const_iterator,
723 std::vector<std::uint8_t>::const_iterator>
725 if (jBounds.first != jBounds.second) {
726 bounds = std::equal_range(
727 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
728 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
730 if (bounds.first != bounds.second) {
731 bounds = std::equal_range(
732 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
733 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
735 if (bounds.first != bounds.second) {
736 bounds = std::equal_range(
737 d_stretchBendType.begin() + (bounds.first - d_kAtomType.begin()),
738 d_stretchBendType.begin() + (bounds.second - d_kAtomType.begin()),
740 if (bounds.first != bounds.second) {
742 &d_params[bounds.first - d_stretchBendType.begin()];
749 return std::make_pair(swap, mmffStbnParams);
753 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
754 std::map<
const unsigned int,
755 std::map<
const unsigned int,
756 std::map<
const unsigned int,
757 std::map<const unsigned int, MMFFStbn>>>>
764 std::vector<std::uint8_t>
776 const unsigned int periodicTableRow1,
777 const unsigned int periodicTableRow2,
778 const unsigned int periodicTableRow3)
const {
779 std::map<
const unsigned int,
780 std::map<
const unsigned int,
781 std::map<const unsigned int, MMFFStbn>>>::const_iterator
783 std::map<
const unsigned int,
784 std::map<const unsigned int, MMFFStbn>>::const_iterator res2;
785 std::map<const unsigned int, MMFFStbn>::const_iterator res3;
786 const MMFFStbn *mmffDfsbParams = NULL;
788 unsigned int canPeriodicTableRow1 = periodicTableRow1;
789 unsigned int canPeriodicTableRow3 = periodicTableRow3;
790 if (periodicTableRow1 > periodicTableRow3) {
791 canPeriodicTableRow1 = periodicTableRow3;
792 canPeriodicTableRow3 = periodicTableRow1;
795 res1 = d_params.find(canPeriodicTableRow1);
796 if (res1 != d_params.end()) {
797 res2 = ((*res1).second).find(periodicTableRow2);
798 if (res2 != ((*res1).second).end()) {
799 res3 = ((*res2).second).find(canPeriodicTableRow3);
800 if (res3 != ((*res2).second).end()) {
801 mmffDfsbParams = &((*res3).second);
806 return std::make_pair(swap, mmffDfsbParams);
810 std::map<
const unsigned int,
811 std::map<const unsigned int, std::map<const unsigned int, MMFFStbn>>>
822 const unsigned int iAtomType,
823 const unsigned int jAtomType,
824 const unsigned int kAtomType,
825 const unsigned int lAtomType)
const {
826 const MMFFOop *mmffOopParams = NULL;
827 unsigned int iter = 0;
828 std::vector<unsigned int> canIKLAtomType(3);
833 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
834 std::map<
const unsigned int,
835 std::map<
const unsigned int,
836 std::map<
const unsigned int,
837 std::map<const unsigned int, MMFFOop>>>>::
839 std::map<
const unsigned int,
840 std::map<
const unsigned int,
841 std::map<const unsigned int, MMFFOop>>>::const_iterator
843 std::map<
const unsigned int,
844 std::map<const unsigned int, MMFFOop>>::const_iterator res3;
845 std::map<const unsigned int, MMFFOop>::const_iterator res4;
846 while ((iter < 4) && (!mmffOopParams)) {
847 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
848 unsigned int canJAtomType = jAtomType;
849 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
850 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
851 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
852 res1 = d_params.find(canIKLAtomType[0]);
853 if (res1 != d_params.end()) {
854 res2 = ((*res1).second).find(canJAtomType);
855 if (res2 != ((*res1).second).end()) {
856 res3 = ((*res2).second).find(canIKLAtomType[1]);
857 if (res3 != ((*res2).second).end()) {
858 res4 = ((*res3).second).find(canIKLAtomType[2]);
859 if (res4 != ((*res3).second).end()) {
860 mmffOopParams = &((*res4).second);
868 std::pair<std::vector<std::uint8_t>::const_iterator,
869 std::vector<std::uint8_t>::const_iterator>
871 std::equal_range(d_jAtomType.begin(), d_jAtomType.end(), jAtomType);
872 std::pair<std::vector<std::uint8_t>::const_iterator,
873 std::vector<std::uint8_t>::const_iterator>
875 if (jBounds.first != jBounds.second) {
876 while ((iter < 4) && (!mmffOopParams)) {
877 canIKLAtomType[0] = (*mmffDef)(iAtomType)->eqLevel[iter];
878 canIKLAtomType[1] = (*mmffDef)(kAtomType)->eqLevel[iter];
879 canIKLAtomType[2] = (*mmffDef)(lAtomType)->eqLevel[iter];
880 std::sort(canIKLAtomType.begin(), canIKLAtomType.end());
881 bounds = std::equal_range(
882 d_iAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
883 d_iAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
885 if (bounds.first != bounds.second) {
886 bounds = std::equal_range(
887 d_kAtomType.begin() + (bounds.first - d_iAtomType.begin()),
888 d_kAtomType.begin() + (bounds.second - d_iAtomType.begin()),
890 if (bounds.first != bounds.second) {
891 bounds = std::equal_range(
892 d_lAtomType.begin() + (bounds.first - d_kAtomType.begin()),
893 d_lAtomType.begin() + (bounds.second - d_kAtomType.begin()),
895 if (bounds.first != bounds.second) {
896 mmffOopParams = &d_params[bounds.first - d_lAtomType.begin()];
905 return mmffOopParams;
910 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
911 std::map<
const unsigned int,
912 std::map<
const unsigned int,
913 std::map<
const unsigned int,
914 std::map<const unsigned int, MMFFOop>>>>
933 const std::pair<unsigned int, unsigned int> torType,
934 const unsigned int iAtomType,
const unsigned int jAtomType,
935 const unsigned int kAtomType,
const unsigned int lAtomType)
const {
936 const MMFFTor *mmffTorParams = NULL;
937 unsigned int iter = 0;
938 unsigned int iWildCard = 0;
939 unsigned int lWildCard = 0;
940 unsigned int canTorType = torType.first;
941 unsigned int maxIter = 5;
946 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
949 std::map<
const unsigned int,
950 std::map<
const unsigned int,
951 std::map<
const unsigned int,
952 std::map<const unsigned int, MMFFTor>>>>>::
954 std::map<
const unsigned int,
955 std::map<
const unsigned int,
956 std::map<
const unsigned int,
957 std::map<const unsigned int, MMFFTor>>>>::
959 std::map<
const unsigned int,
960 std::map<
const unsigned int,
961 std::map<const unsigned int, MMFFTor>>>::const_iterator
963 std::map<
const unsigned int,
964 std::map<const unsigned int, MMFFTor>>::const_iterator res4;
965 std::map<const unsigned int, MMFFTor>::const_iterator res5;
967 std::pair<std::vector<std::uint8_t>::const_iterator,
968 std::vector<std::uint8_t>::const_iterator>
970 std::pair<std::vector<std::uint8_t>::const_iterator,
971 std::vector<std::uint8_t>::const_iterator>
975 while (((iter < maxIter) && ((!mmffTorParams) || (maxIter == 4))) ||
976 ((iter == 4) && (torType.first == 5) && torType.second)) {
982 if ((maxIter == 5) && (iter == 4)) {
985 canTorType = torType.second;
992 }
else if (iter == 2) {
996 unsigned int canIAtomType = (*mmffDef)(iAtomType)->eqLevel[iWildCard];
997 unsigned int canJAtomType = jAtomType;
998 unsigned int canKAtomType = kAtomType;
999 unsigned int canLAtomType = (*mmffDef)(lAtomType)->eqLevel[lWildCard];
1000 if (canJAtomType > canKAtomType) {
1001 unsigned int temp = canKAtomType;
1002 canKAtomType = canJAtomType;
1003 canJAtomType = temp;
1004 temp = canLAtomType;
1005 canLAtomType = canIAtomType;
1006 canIAtomType = temp;
1007 }
else if ((canJAtomType == canKAtomType) &&
1008 (canIAtomType > canLAtomType)) {
1009 unsigned int temp = canLAtomType;
1010 canLAtomType = canIAtomType;
1011 canIAtomType = temp;
1013 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1014 res1 = d_params.find(canTorType);
1015 if (res1 != d_params.end()) {
1016 res2 = ((*res1).second).find(canIAtomType);
1017 if (res2 != ((*res1).second).end()) {
1018 res3 = ((*res2).second).find(canJAtomType);
1019 if (res3 != ((*res2).second).end()) {
1020 res4 = ((*res3).second).find(canKAtomType);
1021 if (res4 != ((*res3).second).end()) {
1022 res5 = ((*res4).second).find(canLAtomType);
1023 if (res5 != ((*res4).second).end()) {
1024 mmffTorParams = &((*res5).second);
1034 jBounds = std::equal_range(d_jAtomType.begin(), d_jAtomType.end(),
1036 if (jBounds.first != jBounds.second) {
1037 bounds = std::equal_range(
1038 d_kAtomType.begin() + (jBounds.first - d_jAtomType.begin()),
1039 d_kAtomType.begin() + (jBounds.second - d_jAtomType.begin()),
1041 if (bounds.first != bounds.second) {
1042 bounds = std::equal_range(
1043 d_iAtomType.begin() + (bounds.first - d_kAtomType.begin()),
1044 d_iAtomType.begin() + (bounds.second - d_kAtomType.begin()),
1046 if (bounds.first != bounds.second) {
1047 bounds = std::equal_range(
1048 d_lAtomType.begin() + (bounds.first - d_iAtomType.begin()),
1049 d_lAtomType.begin() + (bounds.second - d_iAtomType.begin()),
1051 if (bounds.first != bounds.second) {
1052 bounds = std::equal_range(
1053 d_torType.begin() + (bounds.first - d_lAtomType.begin()),
1054 d_torType.begin() + (bounds.second - d_lAtomType.begin()),
1056 if (bounds.first != bounds.second) {
1057 mmffTorParams = &d_params[bounds.first - d_torType.begin()];
1070 return std::make_pair(canTorType, mmffTorParams);
1074 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1079 std::map<
const unsigned int,
1080 std::map<
const unsigned int, std::map<
const unsigned int,
1089 std::vector<std::uint8_t>
1107 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1108 std::map<const unsigned int, MMFFVdW>::const_iterator res;
1109 res = d_params.find(atomType);
1111 return (res != d_params.end() ? &((*res).second) : NULL);
1113 std::pair<std::vector<std::uint8_t>::const_iterator,
1114 std::vector<std::uint8_t>::const_iterator>
1116 std::equal_range(d_atomType.begin(), d_atomType.end(), atomType);
1118 return ((bounds.first != bounds.second)
1119 ? &d_params[bounds.first - d_atomType.begin()]
1125 #ifdef RDKIT_MMFF_PARAMS_USE_STD_MAP
1126 std::map<const unsigned int, MMFFVdW> d_params;