InChI
 
Loading...
Searching...
No Matches
ichimap2.c File Reference
#include <stdlib.h>
#include <string.h>
#include "mode.h"
#include "ichicomn.h"
#include "bcf_s.h"
+ Include dependency graph for ichimap2.c:

Macros

#define MAP_MODE_STD   0 /* Standard approach: switch 2 neighbors */
 
#define MAP_MODE_C2v   1 /* Check for C2v reflection leading to parity inversion */
 
#define MAP_MODE_C2   2 /* Check for C2 rotation preserving parities */
 
#define MAP_MODE_S4   3 /* Check for S4 rotation/reflection leading to parity inversion */
 
#define MAX_OTHER_NEIGH   2
 
#define NEIGH_MODE_RING   1
 
#define NEIGH_MODE_CHAIN   2
 
#define CHECKING_STEREOCENTER   1
 
#define CHECKING_STEREOBOND   2
 
#define COMP_STEREO_SUCCESS   1
 
#define NOT_WELL_DEF_UNKN   2
 
#define NOT_WELL_DEF_UNDF   4
 
#define PARITY_IMPOSSIBLE   999
 

Functions

void DeAllocateForNonStereoRemoval (AT_RANK **nAtomNumberCanon1, AT_RANK **nAtomNumberCanon2, NEIGH_LIST **nl, NEIGH_LIST **nl1, NEIGH_LIST **nl2, AT_RANK **nVisited1, AT_RANK **nVisited2)
 
int AllocateForNonStereoRemoval (sp_ATOM *at, int num_atoms, const AT_RANK *nSymmRank, AT_RANK *nCanonRank, AT_RANK **nAtomNumberCanon1, AT_RANK **nAtomNumberCanon2, NEIGH_LIST **nl, NEIGH_LIST **nl1, NEIGH_LIST **nl2, AT_RANK **nVisited1, AT_RANK **nVisited2)
 
AT_RANK GetMinNewRank (AT_RANK *nAtomRank, AT_RANK *nAtomNumb, AT_RANK nRank1)
 
int BreakNeighborsTie (CANON_GLOBALS *pCG, sp_ATOM *at, int num_atoms, int num_at_tg, int ib, int ia, AT_RANK *neigh_num, int in1, int in2, int mode, AT_RANK **pRankStack1, AT_RANK **pRankStack2, AT_RANK *nTempRank, NEIGH_LIST *NeighList, const AT_RANK *nSymmRank, AT_RANK *nCanonRank, NEIGH_LIST *nl1, NEIGH_LIST *nl2, long *lNumIter)
 
int CheckNextSymmNeighborsAndBonds (sp_ATOM *at, AT_RANK cur1, AT_RANK cur2, AT_RANK n1, AT_RANK n2, AT_RANK *nAvoidCheckAtom, AT_RANK *nVisited1, AT_RANK *nVisited2, AT_RANK *nVisitOrd1, AT_RANK *nVisitOrd2, const AT_RANK *nRank1, const AT_RANK *nRank2)
 
int CreateCheckSymmPaths (sp_ATOM *at, AT_RANK prev1, AT_RANK cur1, AT_RANK prev2, AT_RANK cur2, AT_RANK *nAvoidCheckAtom, AT_RANK *nVisited1, AT_RANK *nVisited2, AT_RANK *nVisitOrd1, AT_RANK *nVisitOrd2, NEIGH_LIST *nl1, NEIGH_LIST *nl2, const AT_RANK *nRank1, const AT_RANK *nRank2, AT_RANK *nCanonRank, AT_RANK *nLength, int *bParitiesInverted, int mode)
 
int CalculatedPathsParitiesAreIdentical (CANON_GLOBALS *pCG, sp_ATOM *at, int num_atoms, const AT_RANK *nSymmRank, AT_RANK *nCanonRank, AT_RANK *nAtomNumberCanon, AT_RANK *nAtomNumberCanon1, AT_RANK *nAtomNumberCanon2, AT_RANK *nVisited1, AT_RANK *nVisited2, AT_RANK prev_sb_neigh, AT_RANK cur, AT_RANK next1, AT_RANK next2, int nNeighMode, int bParitiesInverted, int mode, CANON_STAT *pCS, int vABParityUnknown)
 
int RemoveCalculatedNonStereoBondParities (CANON_GLOBALS *pCG, sp_ATOM *at, int num_atoms, int num_at_tg, AT_RANK **pRankStack1, AT_RANK **pRankStack2, AT_RANK *nTempRank, NEIGH_LIST *NeighList, AT_RANK *nCanonRank, const AT_RANK *nSymmRank, AT_RANK *nAtomNumberCanon, AT_RANK *nAtomNumberCanon1, AT_RANK *nAtomNumberCanon2, NEIGH_LIST *nl, NEIGH_LIST *nl1, NEIGH_LIST *nl2, AT_RANK *nVisited1, AT_RANK *nVisited2, CANON_STAT *pCS, int vABParityUnknown)
 
int RemoveCalculatedNonStereoCenterParities (CANON_GLOBALS *pCG, sp_ATOM *at, int num_atoms, int num_at_tg, AT_RANK **pRankStack1, AT_RANK **pRankStack2, AT_RANK *nTempRank, NEIGH_LIST *NeighList, AT_RANK *nCanonRank, const AT_RANK *nSymmRank, AT_RANK *nAtomNumberCanon, AT_RANK *nAtomNumberCanon1, AT_RANK *nAtomNumberCanon2, NEIGH_LIST *nl, NEIGH_LIST *nl1, NEIGH_LIST *nl2, AT_RANK *nVisited1, AT_RANK *nVisited2, CANON_STAT *pCS, int vABParityUnknown)
 
int SortNeighLists3 (int num_atoms, AT_RANK *nRank, NEIGH_LIST *NeighList, AT_RANK *nAtomNumber)
 
int SortedEquInfoToRanks (const AT_RANK *nSymmRank, AT_RANK *nRank, const AT_RANK *nAtomNumber, int num_atoms, int *bChanged)
 
int SortedRanksToEquInfo (AT_RANK *nSymmRank, const AT_RANK *nRank, const AT_RANK *nAtomNumber, int num_atoms)
 
void switch_ptrs (AT_RANK **p1, AT_RANK **p2)
 
int SetNewRanksFromNeighLists3 (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, AT_RANK *nRank, AT_RANK *nNewRank, AT_RANK *nAtomNumber)
 
int SetNewRanksFromNeighLists4 (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, AT_RANK *nRank, AT_RANK *nNewRank, AT_RANK *nAtomNumber, AT_RANK nMaxAtRank)
 
int SetNewRanksFromNeighLists (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, AT_RANK *nRank, AT_RANK *nNewRank, AT_RANK *nAtomNumber, int bUseAltSort, int(*comp)(const void *, const void *, void *))
 
void SortNeighListsBySymmAndCanonRank (int num_atoms, NEIGH_LIST *NeighList, const AT_RANK *nSymmRank, const AT_RANK *nCanonRank)
 
int SortNeighLists2 (int num_atoms, AT_RANK *nRank, NEIGH_LIST *NeighList, AT_RANK *nAtomNumber)
 
int DifferentiateRanks2 (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, int nNumCurrRanks, AT_RANK *pnCurrRank, AT_RANK *pnPrevRank, AT_RANK *nAtomNumber, long *lNumIter, int bUseAltSort)
 
int DifferentiateRanks3 (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, int nNumCurrRanks, AT_RANK *pnCurrRank, AT_RANK *pnPrevRank, AT_RANK *nAtomNumber, long *lNumIter)
 
int DifferentiateRanks4 (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, int nNumCurrRanks, AT_RANK *pnCurrRank, AT_RANK *pnPrevRank, AT_RANK *nAtomNumber, AT_RANK nMaxAtRank, long *lNumIter)
 
int DifferentiateRanksBasic (CANON_GLOBALS *pCG, int num_atoms, NEIGH_LIST *NeighList, int nNumCurrRanks, AT_RANK *pnCurrRank, AT_RANK *pnPrevRank, AT_RANK *nAtomNumber, long *lNumIter, int bUseAltSort)
 
int NumberOfTies (AT_RANK **pRankStack1, AT_RANK **pRankStack2, int length, int at_no1, int at_no2, AT_RANK *nNewRank, int *bAddStack, int *bMapped1)
 
int HalfStereoBondParity (sp_ATOM *at, int at_no1, int i_sb_neigh, const AT_RANK *nRank)
 
int parity_of_mapped_half_bond (int from_at, int to_at, int from_neigh, int to_neigh, sp_ATOM *at, EQ_NEIGH *pEN, const AT_RANK *nCanonRankFrom, const AT_RANK *nRankFrom, const AT_RANK *nRankTo)
 
int parity_of_mapped_atom2 (CANON_GLOBALS *pCG, int from_at, int to_at, const sp_ATOM *at, EQ_NEIGH *pEN, const AT_RANK *nCanonRankFrom, const AT_RANK *nRankFrom, const AT_RANK *nRankTo)
 
int ClearPreviousMappings (AT_RANK **pRankStack1)
 
int map_an_atom2 (CANON_GLOBALS *pCG, int num_atoms, int num_max, int at_no1, int at_no2, AT_RANK *nTempRank, int nNumMappedRanks, int *pnNewNumMappedRanks, CANON_STAT *pCS, NEIGH_LIST *NeighList, AT_RANK **pRankStack1, AT_RANK **pRankStack2, int *bAddStack)
 
int might_change_other_atom_parity (sp_ATOM *at, int num_atoms, int at_no, AT_RANK *nRank2, AT_RANK *nRank1)
 
int RemoveCalculatedNonStereo (CANON_GLOBALS *pCG, sp_ATOM *at, int num_atoms, int num_at_tg, AT_RANK **pRankStack1, AT_RANK **pRankStack2, AT_RANK *nTempRank, NEIGH_LIST *NeighList, const AT_RANK *nSymmRank, AT_RANK *nCanonRank, AT_RANK *nAtomNumberCanon, CANON_STAT *pCS, int vABParityUnknown)
 

Macro Definition Documentation

◆ CHECKING_STEREOBOND

#define CHECKING_STEREOBOND   2

◆ CHECKING_STEREOCENTER

#define CHECKING_STEREOCENTER   1

◆ COMP_STEREO_SUCCESS

#define COMP_STEREO_SUCCESS   1

◆ MAP_MODE_C2

#define MAP_MODE_C2   2 /* Check for C2 rotation preserving parities */

◆ MAP_MODE_C2v

#define MAP_MODE_C2v   1 /* Check for C2v reflection leading to parity inversion */

◆ MAP_MODE_S4

#define MAP_MODE_S4   3 /* Check for S4 rotation/reflection leading to parity inversion */

◆ MAP_MODE_STD

#define MAP_MODE_STD   0 /* Standard approach: switch 2 neighbors */

◆ MAX_OTHER_NEIGH

#define MAX_OTHER_NEIGH   2

◆ NEIGH_MODE_CHAIN

#define NEIGH_MODE_CHAIN   2

◆ NEIGH_MODE_RING

#define NEIGH_MODE_RING   1

◆ NOT_WELL_DEF_UNDF

#define NOT_WELL_DEF_UNDF   4

◆ NOT_WELL_DEF_UNKN

#define NOT_WELL_DEF_UNKN   2

◆ PARITY_IMPOSSIBLE

#define PARITY_IMPOSSIBLE   999

Function Documentation

◆ AllocateForNonStereoRemoval()

int AllocateForNonStereoRemoval ( sp_ATOM at,
int  num_atoms,
const AT_RANK nSymmRank,
AT_RANK nCanonRank,
AT_RANK **  nAtomNumberCanon1,
AT_RANK **  nAtomNumberCanon2,
NEIGH_LIST **  nl,
NEIGH_LIST **  nl1,
NEIGH_LIST **  nl2,
AT_RANK **  nVisited1,
AT_RANK **  nVisited2 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BreakNeighborsTie()

int BreakNeighborsTie ( CANON_GLOBALS pCG,
sp_ATOM at,
int  num_atoms,
int  num_at_tg,
int  ib,
int  ia,
AT_RANK neigh_num,
int  in1,
int  in2,
int  mode,
AT_RANK **  pRankStack1,
AT_RANK **  pRankStack2,
AT_RANK nTempRank,
NEIGH_LIST NeighList,
const AT_RANK nSymmRank,
AT_RANK nCanonRank,
NEIGH_LIST nl1,
NEIGH_LIST nl2,
long *  lNumIter 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatedPathsParitiesAreIdentical()

int CalculatedPathsParitiesAreIdentical ( CANON_GLOBALS pCG,
sp_ATOM at,
int  num_atoms,
const AT_RANK nSymmRank,
AT_RANK nCanonRank,
AT_RANK nAtomNumberCanon,
AT_RANK nAtomNumberCanon1,
AT_RANK nAtomNumberCanon2,
AT_RANK nVisited1,
AT_RANK nVisited2,
AT_RANK  prev_sb_neigh,
AT_RANK  cur,
AT_RANK  next1,
AT_RANK  next2,
int  nNeighMode,
int  bParitiesInverted,
int  mode,
CANON_STAT pCS,
int  vABParityUnknown 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckNextSymmNeighborsAndBonds()

int CheckNextSymmNeighborsAndBonds ( sp_ATOM at,
AT_RANK  cur1,
AT_RANK  cur2,
AT_RANK  n1,
AT_RANK  n2,
AT_RANK nAvoidCheckAtom,
AT_RANK nVisited1,
AT_RANK nVisited2,
AT_RANK nVisitOrd1,
AT_RANK nVisitOrd2,
const AT_RANK nRank1,
const AT_RANK nRank2 
)
+ Here is the caller graph for this function:

◆ ClearPreviousMappings()

int ClearPreviousMappings ( AT_RANK **  pRankStack1)
+ Here is the caller graph for this function:

◆ CreateCheckSymmPaths()

int CreateCheckSymmPaths ( sp_ATOM at,
AT_RANK  prev1,
AT_RANK  cur1,
AT_RANK  prev2,
AT_RANK  cur2,
AT_RANK nAvoidCheckAtom,
AT_RANK nVisited1,
AT_RANK nVisited2,
AT_RANK nVisitOrd1,
AT_RANK nVisitOrd2,
NEIGH_LIST nl1,
NEIGH_LIST nl2,
const AT_RANK nRank1,
const AT_RANK nRank2,
AT_RANK nCanonRank,
AT_RANK nLength,
int *  bParitiesInverted,
int  mode 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeAllocateForNonStereoRemoval()

void DeAllocateForNonStereoRemoval ( AT_RANK **  nAtomNumberCanon1,
AT_RANK **  nAtomNumberCanon2,
NEIGH_LIST **  nl,
NEIGH_LIST **  nl1,
NEIGH_LIST **  nl2,
AT_RANK **  nVisited1,
AT_RANK **  nVisited2 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DifferentiateRanks2()

int DifferentiateRanks2 ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
int  nNumCurrRanks,
AT_RANK pnCurrRank,
AT_RANK pnPrevRank,
AT_RANK nAtomNumber,
long *  lNumIter,
int  bUseAltSort 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DifferentiateRanks3()

int DifferentiateRanks3 ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
int  nNumCurrRanks,
AT_RANK pnCurrRank,
AT_RANK pnPrevRank,
AT_RANK nAtomNumber,
long *  lNumIter 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DifferentiateRanks4()

int DifferentiateRanks4 ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
int  nNumCurrRanks,
AT_RANK pnCurrRank,
AT_RANK pnPrevRank,
AT_RANK nAtomNumber,
AT_RANK  nMaxAtRank,
long *  lNumIter 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DifferentiateRanksBasic()

int DifferentiateRanksBasic ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
int  nNumCurrRanks,
AT_RANK pnCurrRank,
AT_RANK pnPrevRank,
AT_RANK nAtomNumber,
long *  lNumIter,
int  bUseAltSort 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMinNewRank()

AT_RANK GetMinNewRank ( AT_RANK nAtomRank,
AT_RANK nAtomNumb,
AT_RANK  nRank1 
)
+ Here is the caller graph for this function:

◆ HalfStereoBondParity()

int HalfStereoBondParity ( sp_ATOM at,
int  at_no1,
int  i_sb_neigh,
const AT_RANK nRank 
)
+ Here is the caller graph for this function:

◆ map_an_atom2()

int map_an_atom2 ( CANON_GLOBALS pCG,
int  num_atoms,
int  num_max,
int  at_no1,
int  at_no2,
AT_RANK nTempRank,
int  nNumMappedRanks,
int *  pnNewNumMappedRanks,
CANON_STAT pCS,
NEIGH_LIST NeighList,
AT_RANK **  pRankStack1,
AT_RANK **  pRankStack2,
int *  bAddStack 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ might_change_other_atom_parity()

int might_change_other_atom_parity ( sp_ATOM at,
int  num_atoms,
int  at_no,
AT_RANK nRank2,
AT_RANK nRank1 
)
+ Here is the caller graph for this function:

◆ NumberOfTies()

int NumberOfTies ( AT_RANK **  pRankStack1,
AT_RANK **  pRankStack2,
int  length,
int  at_no1,
int  at_no2,
AT_RANK nNewRank,
int *  bAddStack,
int *  bMapped1 
)
+ Here is the caller graph for this function:

◆ parity_of_mapped_atom2()

int parity_of_mapped_atom2 ( CANON_GLOBALS pCG,
int  from_at,
int  to_at,
const sp_ATOM at,
EQ_NEIGH pEN,
const AT_RANK nCanonRankFrom,
const AT_RANK nRankFrom,
const AT_RANK nRankTo 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parity_of_mapped_half_bond()

int parity_of_mapped_half_bond ( int  from_at,
int  to_at,
int  from_neigh,
int  to_neigh,
sp_ATOM at,
EQ_NEIGH pEN,
const AT_RANK nCanonRankFrom,
const AT_RANK nRankFrom,
const AT_RANK nRankTo 
)
+ Here is the caller graph for this function:

◆ RemoveCalculatedNonStereo()

int RemoveCalculatedNonStereo ( CANON_GLOBALS pCG,
sp_ATOM at,
int  num_atoms,
int  num_at_tg,
AT_RANK **  pRankStack1,
AT_RANK **  pRankStack2,
AT_RANK nTempRank,
NEIGH_LIST NeighList,
const AT_RANK nSymmRank,
AT_RANK nCanonRank,
AT_RANK nAtomNumberCanon,
CANON_STAT pCS,
int  vABParityUnknown 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveCalculatedNonStereoBondParities()

int RemoveCalculatedNonStereoBondParities ( CANON_GLOBALS pCG,
sp_ATOM at,
int  num_atoms,
int  num_at_tg,
AT_RANK **  pRankStack1,
AT_RANK **  pRankStack2,
AT_RANK nTempRank,
NEIGH_LIST NeighList,
AT_RANK nCanonRank,
const AT_RANK nSymmRank,
AT_RANK nAtomNumberCanon,
AT_RANK nAtomNumberCanon1,
AT_RANK nAtomNumberCanon2,
NEIGH_LIST nl,
NEIGH_LIST nl1,
NEIGH_LIST nl2,
AT_RANK nVisited1,
AT_RANK nVisited2,
CANON_STAT pCS,
int  vABParityUnknown 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveCalculatedNonStereoCenterParities()

int RemoveCalculatedNonStereoCenterParities ( CANON_GLOBALS pCG,
sp_ATOM at,
int  num_atoms,
int  num_at_tg,
AT_RANK **  pRankStack1,
AT_RANK **  pRankStack2,
AT_RANK nTempRank,
NEIGH_LIST NeighList,
AT_RANK nCanonRank,
const AT_RANK nSymmRank,
AT_RANK nAtomNumberCanon,
AT_RANK nAtomNumberCanon1,
AT_RANK nAtomNumberCanon2,
NEIGH_LIST nl,
NEIGH_LIST nl1,
NEIGH_LIST nl2,
AT_RANK nVisited1,
AT_RANK nVisited2,
CANON_STAT pCS,
int  vABParityUnknown 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetNewRanksFromNeighLists()

int SetNewRanksFromNeighLists ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
AT_RANK nRank,
AT_RANK nNewRank,
AT_RANK nAtomNumber,
int  bUseAltSort,
int(*)(const void *, const void *, void *)  comp 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetNewRanksFromNeighLists3()

int SetNewRanksFromNeighLists3 ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
AT_RANK nRank,
AT_RANK nNewRank,
AT_RANK nAtomNumber 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetNewRanksFromNeighLists4()

int SetNewRanksFromNeighLists4 ( CANON_GLOBALS pCG,
int  num_atoms,
NEIGH_LIST NeighList,
AT_RANK nRank,
AT_RANK nNewRank,
AT_RANK nAtomNumber,
AT_RANK  nMaxAtRank 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SortedEquInfoToRanks()

int SortedEquInfoToRanks ( const AT_RANK nSymmRank,
AT_RANK nRank,
const AT_RANK nAtomNumber,
int  num_atoms,
int *  bChanged 
)
+ Here is the caller graph for this function:

◆ SortedRanksToEquInfo()

int SortedRanksToEquInfo ( AT_RANK nSymmRank,
const AT_RANK nRank,
const AT_RANK nAtomNumber,
int  num_atoms 
)
+ Here is the caller graph for this function:

◆ SortNeighLists2()

int SortNeighLists2 ( int  num_atoms,
AT_RANK nRank,
NEIGH_LIST NeighList,
AT_RANK nAtomNumber 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SortNeighLists3()

int SortNeighLists3 ( int  num_atoms,
AT_RANK nRank,
NEIGH_LIST NeighList,
AT_RANK nAtomNumber 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SortNeighListsBySymmAndCanonRank()

void SortNeighListsBySymmAndCanonRank ( int  num_atoms,
NEIGH_LIST NeighList,
const AT_RANK nSymmRank,
const AT_RANK nCanonRank 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switch_ptrs()

void switch_ptrs ( AT_RANK **  p1,
AT_RANK **  p2 
)
+ Here is the caller graph for this function: