InChI
 
Loading...
Searching...
No Matches
ichi_bns.h File Reference
#include "incomdef.h"
#include "inpdef.h"
+ Include dependency graph for ichi_bns.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BnsEdge
 
struct  BnsStEdge
 
struct  BnsVertex
 
union  BnsAltPath
 
struct  BalancedNetworkStructure
 
struct  BalancedNetworkData
 
struct  BN_AtomsAtTautGroup
 
struct  tagBNS_FLOW_CHANGES
 
struct  tagNodeSet
 

Macros

#define BN_MAX_ALTP   16
 
#define BNS_EDGE_FORBIDDEN_MASK   1
 
#define BNS_EDGE_FORBIDDEN_TEMP   2
 
#define BNS_EDGE_FORBIDDEN_TEST   4
 
#define BNS_VERT_TYPE_ATOM   0x0001
 
#define BNS_VERT_TYPE_ENDPOINT   0x0002 /* attribute */
 
#define BNS_VERT_TYPE_TGROUP   0x0004
 
#define BNS_VERT_TYPE_C_POINT   0x0008
 
#define BNS_VERT_TYPE_C_GROUP   0x0010
 
#define BNS_VERT_TYPE_SUPER_TGROUP   0x0020
 
#define BNS_VERT_TYPE_TEMP   0x0040
 
#define BNS_VERT_TYPE__AUX   0x0080 /* vertex added to build charge substructures */
 
#define BNS_VERT_TYPE_C_NEGATIVE   0x0100 /* negative charge group; attribute, should be used with BNS_VERT_TYPE_C_GROUP */
 
#define BNS_VERT_TYPE_ACID   0x0200 /* only for this type are allowed paths: t_group-atom-c_group_neg (path_TACN) */
 
#define BNS_VERT_TYPE_CARBON_GR   0x0400 /* charge of carbon atom; should be used with BNS_VT_C_POS, BNS_VT_C_NEG */
 
#define BNS_VERT_TYPE_METAL_GR   0x0800 /* metal atom group; may be used alone or with BNS_VT_M_POS, BNS_VT_M_NEG */
 
#define BNS_VERT_TYPE_ANY_GROUP   (BNS_VERT_TYPE_TGROUP | BNS_VERT_TYPE_C_GROUP | BNS_VERT_TYPE_SUPER_TGROUP)
 
#define BNS_VT_C_POS   BNS_VERT_TYPE_C_GROUP /* positive charge group, heteroat */
 
#define BNS_VT_C_NEG   (BNS_VERT_TYPE_C_GROUP | BNS_VERT_TYPE_C_NEGATIVE) /* negative charge group, heteroat */
 
#define BNS_VT_C_POS_C   (BNS_VT_C_POS | BNS_VERT_TYPE_CARBON_GR) /* positive charge group, C, Si, Ge, Sn */
 
#define BNS_VT_C_NEG_C   (BNS_VT_C_NEG | BNS_VERT_TYPE_CARBON_GR) /* negative charge group, C, Si, Ge, Sn */
 
#define BNS_VT_C_POS_M   (BNS_VT_C_POS | BNS_VERT_TYPE_METAL_GR) /* positive charge group, metal */
 
#define BNS_VT_C_NEG_M   (BNS_VT_C_NEG | BNS_VERT_TYPE_METAL_GR) /* negative charge group, metal */
 
#define BNS_VT_M_GROUP   BNS_VERT_TYPE_METAL_GR /* metal-group, flower vertex */
 
#define BNS_VT_C_POS_ALL   (BNS_VERT_TYPE_SUPER_TGROUP | BNS_VERT_TYPE_C_GROUP) /* supergroup (+) */
 
#define BNS_VT_C_NEG_ALL   (BNS_VT_C_POS_ALL | BNS_VERT_TYPE_C_NEGATIVE) /* supergroup (-) */
 
#define BNS_VT_CHRG_STRUCT   (BNS_VERT_TYPE__AUX | BNS_VERT_TYPE_TEMP) /* ChargeStruct vertex */
 
#define BNS_VT_YVCONNECTOR   BNS_VERT_TYPE__AUX /* group connection */
 
#define IS_BNS_VT_C_OR_CSUPER_GR(X)   ((X) & BNS_VT_C_POS)
 
#define IS_BNS_VT_C_GR(X)   (((X) & BNS_VT_C_POS_ALL) == BNS_VERT_TYPE_C_GROUP)
 
#define IS_BNS_VT_CM_GR(X)   (((X) & BNS_VT_C_POS_M) == BNS_VT_C_POS_M) /* metal charge group */
 
#define IS_BNS_VT_M_GR(X)   ((X) == BNS_VERT_TYPE_METAL_GR ) /* metal flower base or vertices */
 
#define IS_BNS_VT_YVCONNECTOR(X)   (((X) & BNS_VERT_TYPE__AUX) && !((X) & BNS_VERT_TYPE_TEMP))
 
#define IS_BNS_VT_CHRG_STRUCT(X)   (((X) & BNS_VERT_TYPE__AUX) && ((X) & BNS_VERT_TYPE_TEMP))
 
#define IS_BNS_VT_ATOM(X)   ((X) & BNS_VERT_TYPE_ATOM)
 
#define BNS_ADD_SUPER_TGROUP   1 /* reserve one more edge for a t-group to connect to a single super-t-group */
 
#define NUM_KINDS_OF_GROUPS   2 /* 1 accounts for t-group kind, one more 1 accounts for c-group kind */
 
#define BNS_ADD_ATOMS   2 /* max. number of fictitious atoms to add (except t-gtoups) */
 
#define BNS_ADD_EDGES   1 /* max. number of edges to add to each atom (except edges to a t-group or c-group) */
 
#define ALTP_PATH_LEN(altp)   (altp)[iALTP_PATH_LEN].number /* number of bonds = number of atoms-1*/
 
#define ALTP_END_ATOM(altp)   (altp)[iALTP_END_ATOM].number
 
#define ALTP_START_ATOM(altp)   (altp)[iALTP_START_ATOM].number
 
#define ALTP_THIS_ATOM_NEIGHBOR(altp, X)   (altp)[iALTP_NEIGHBOR+(X)].ineigh[0] /* 0 <= X < path_len */
 
#define ALTP_NEXT_ATOM_NEIGHBOR(altp, X)   (altp)[iALTP_NEIGHBOR+(X)].ineigh[1]
 
#define ALTP_CUR_THIS_ATOM_NEIGHBOR(altp)   (altp)[iALTP_NEIGHBOR+ALTP_PATH_LEN(altp)].ineigh[0] /* 0 <= X < path_len */
 
#define ALTP_CUR_NEXT_ATOM_NEIGHBOR(altp)   (altp)[iALTP_NEIGHBOR+ALTP_PATH_LEN(altp)].ineigh[1]
 
#define ALTP_NEXT(altp)   (++ALTP_PATH_LEN(altp))
 
#define ALTP_PREV(altp)   (--ALTP_PATH_LEN(altp))
 
#define ALTP_MAY_ADD(altp)   (iALTP_NEIGHBOR + (altp)[iALTP_PATH_LEN].number < (altp)[iALTP_MAX_LEN].number)
 
#define ALTP_ALLOCATED_LEN(altp)   (altp)[iALTP_MAX_LEN].number
 
#define ALTP_DELTA(altp)   (altp)[iALTP_FLOW].flow[0]
 
#define ALTP_OVERFLOW(altp)   (altp)[iALTP_FLOW].flow[1]
 
#define Vertex_s   0
 
#define Vertex_t   1
 
#define NO_VERTEX   -2
 
#define BLOSSOM_BASE   -1
 
#define ADD_CAPACITY_RADICAL   1 /* add capacity to radical */
 
#define MAX_BOND_EDGE_CAP   2 /* triple bond */
 
#define AROM_BOND_EDGE_CAP   1
 
#define MAX_TGROUP_EDGE_CAP   2 /* -NH2 provides max. capacity */
 
#define EDGE_FLOW_ST_MASK   0x3fff /* mask for flow */
 
#define EDGE_FLOW_ST_PATH   0x4000 /* mark: the edge belongs to the augmenting path */
 
#define EDGE_FLOW_MASK   0x3fff /* mask for flow */
 
#define EDGE_FLOW_PATH   0x4000 /* mark: the edge belongs to the augmenting path */
 
#define MAX_AT_FLOW(X)
 
#define MAX_ALT_AATG_ARRAY_LEN   127
 
#define AATG_MARK_IN_PATH   1 /* atom in path detected by the BNS */
 
#define AATG_MARK_WAS_IN_PATH   2 /* found to be in path before next level */
 
#define AATG_MARK_MAIN_TYPE   4 /* atom O-"salt" */
 
#define AATG_MARK_OTHER_TYPE   8 /* other atom to be tested */
 
#define ALT_PATH_MODE_TAUTOM   1
 
#define ALT_PATH_MODE_CHARGE   2
 
#define ALT_PATH_MODE_4_SALT   3 /* mark alt bonds along the path */
 
#define ALT_PATH_MODE_4_SALT2   4 /* mark alt bonds along the path, path to taut. group fict. vertex if exists */
 
#define ALT_PATH_MODE_REM2H_CHG   5 /* remove 2 H along alt. path AH-=-BH => A=-=B and change bonds to alternating */
 
#define ALT_PATH_MODE_ADD2H_CHG   6 /* add 2 H along alt. path A=-=B => AH-=-BH and change bonds to alternating */
 
#define ALT_PATH_MODE_REM2H_TST   7 /* test-remove 2 H along alt. path AH-=-BH => A=-=B; restore changed bonds */
 
#define ALT_PATH_MODE_ADD2H_TST   8 /* test-add 2 H along alt. path A=-=B => AH-=-BH; restore changed bonds */
 
#define ALT_PATH_MODE_REM_PROTON   9 /* remove proton, adjust bonds, charges, H-counts 2004-03-05 */
 
#define ALT_PATH_MODE_TAUTOM_KET   10 /* same as ALT_PATH_MODE_TAUTOM, applies to C=-OH or CH-=O; H may be (-) */
 
#define ALT_PATH_MODE_TAUTOM_PT_22_00   11
 
#define ALT_PATH_MODE_TAUTOM_PT_16_00   12
 
#define ALT_PATH_MODE_TAUTOM_PT_06_00   13
 
#define ALT_PATH_MODE_TAUTOM_PT_39_00   14
 
#define ALT_PATH_MODE_TAUTOM_PT_13_00   15
 
#define ALT_PATH_MODE_TAUTOM_PT_18_00   16
 
#define BIT_WORD_MASK   ((bitWord)~0)
 
#define BNS_EF_CHNG_FLOW   1 /* change Balanced Network (BN) flow inside the BNS search */
 
#define BNS_EF_RSTR_FLOW   2 /* undo BN flow changes after BNS */
 
#define BNS_EF_CHNG_RSTR   (BNS_EF_CHNG_FLOW | BNS_EF_RSTR_FLOW)
 
#define BNS_EF_CHNG_BONDS   4 /* change bonds in the structure according to the BN flow */
 
#define BNS_EF_ALTR_BONDS   8 /* make altern. bonds in the structure if the flow has changed */
 
#define BNS_EF_UPD_RAD_ORI
 
#define BNS_EF_SET_NOSTEREO
 
#define BNS_EF_UPD_H_CHARGE   64 /* update charges and H-counts according to change flow to c- and t-group vertices */
 
#define BNS_EF_SAVE_ALL   (BNS_EF_CHNG_FLOW | BNS_EF_CHNG_BONDS | BNS_EF_UPD_RAD_ORI)
 
#define BNS_EF_ALTR_NS   (BNS_EF_ALTR_BONDS | BNS_EF_SET_NOSTEREO)
 
#define BNS_EF_RAD_SRCH   128 /* search for rafical paths closures */
 

Typedefs

typedef int Vertex
 
typedef int EdgeIndex
 
typedef int Edge[2]
 
typedef int BNS_IEDGE
 
typedef int EdgeFlow
 
typedef int VertexFlow
 
typedef enum tagAltPathConst ALT_CONST
 
typedef struct BnsEdge BNS_EDGE
 
typedef struct BnsStEdge BNS_ST_EDGE
 
typedef struct BnsVertex BNS_VERTEX
 
typedef union BnsAltPath BNS_ALT_PATH
 
typedef struct BalancedNetworkStructure BN_STRUCT
 
typedef enum tagBnsRadSrchMode BRS_MODE
 
typedef struct BalancedNetworkData BN_DATA
 
typedef struct BN_AtomsAtTautGroup BN_AATG
 
typedef struct tagBNS_FLOW_CHANGES BNS_FLOW_CHANGES
 
typedef U_SHORT bitWord
 
typedef struct tagNodeSet NodeSet
 

Enumerations

enum  tagAltPathConst {
  iALTP_MAX_LEN , iALTP_FLOW , iALTP_PATH_LEN , iALTP_START_ATOM ,
  iALTP_END_ATOM , iALTP_NEIGHBOR , iALTP_HDR_LEN = iALTP_NEIGHBOR
}
 
enum  tagBnsRadSrchMode { RAD_SRCH_NORM = 0 , RAD_SRCH_FROM_FICT = 1 }
 

Functions

int NodeSetCreate (struct tagCANON_GLOBALS *pCG, NodeSet *pSet, int n, int L)
 
void NodeSetFree (struct tagCANON_GLOBALS *pCG, NodeSet *pSet)
 
int IsNodeSetEmpty (NodeSet *cur_nodes, int k)
 
int DoNodeSetsIntersect (NodeSet *cur_nodes, int k1, int k2)
 
void AddNodeSet2ToNodeSet1 (NodeSet *cur_nodes, int k1, int k2)
 
void NodeSetFromRadEndpoints (struct tagCANON_GLOBALS *pCG, NodeSet *cur_nodes, int k, Vertex RadEndpoints[], int num_v)
 
void RemoveFromNodeSet (struct tagCANON_GLOBALS *pCG, NodeSet *cur_nodes, int k, Vertex v[], int num_v)
 
int AddNodesToRadEndpoints (struct tagCANON_GLOBALS *pCG, NodeSet *cur_nodes, int k, Vertex RadEndpoints[], Vertex vRad, int nStart, int nLen)
 
int nExists2AtMoveAltPath (struct BalancedNetworkStructure *pBNS, struct BalancedNetworkData *pBD, struct BN_AtomsAtTautGroup *pAATG, inp_ATOM *at, int num_atoms, int jj2, int jj1, struct tagSaltChargeCandidate *s_candidate, int nNumCandidates, AT_NUMB *nForbiddenAtom, int nNumForbiddenAtoms)
 
int bExistsAltPath (struct tagCANON_GLOBALS *pCG, struct BalancedNetworkStructure *pBNS, struct BalancedNetworkData *pBD, struct BN_AtomsAtTautGroup *pAATG, inp_ATOM *at, int num_atoms, int nVertDoubleBond, int nVertSingleBond, int path_type)
 
int bExistsAnyAltPath (struct tagCANON_GLOBALS *pCG, struct BalancedNetworkStructure *pBNS, struct BalancedNetworkData *pBD, inp_ATOM *at, int num_atoms, int nVertDoubleBond, int nVertSingleBond, int path_type)
 
int AddTGroups2BnStruct (struct tagCANON_GLOBALS *pCG, struct BalancedNetworkStructure *pBNS, inp_ATOM *at, int num_atoms, struct tagTautomerGroupsInfo *tgi)
 
int AddSuperTGroup2BnStruct (struct BalancedNetworkStructure *pBNS, inp_ATOM *at, int num_atoms, struct tagTautomerGroupsInfo *tgi)
 
int AddCGroups2BnStruct (struct tagCANON_GLOBALS *pCG, struct BalancedNetworkStructure *pBNS, inp_ATOM *at, int num_atoms, struct tagChargeGroupsInfo *cgi)
 
int ReInitBnStruct (struct BalancedNetworkStructure *pBNS, inp_ATOM *at, int num_at, int bRemoveGroupsFromAtoms)
 
int ReInitBnStructAddGroups (struct tagCANON_GLOBALS *pCG, struct BalancedNetworkStructure *pBNS, inp_ATOM *at, int num_atoms, struct tagTautomerGroupsInfo *tgi, struct tagChargeGroupsInfo *cgi)
 
int DisconnectTestAtomFromTGroup (struct BalancedNetworkStructure *pBNS, int v1, int *pv2, BNS_FLOW_CHANGES *fcd)
 
int DisconnectTGroupFromSuperTGroup (struct BalancedNetworkStructure *pBNS, int v1, int *pv1, int *pv2, BNS_FLOW_CHANGES *fcd)
 
int ReconnectTestAtomToTGroup (struct BalancedNetworkStructure *pBNS, int v1, int v2, int ie, BNS_FLOW_CHANGES *fcd)
 
int bIsHardRemHCandidate (inp_ATOM *at, int i, int *cSubType)
 
int RunBalancedNetworkSearch (BN_STRUCT *pBNS, BN_DATA *pBD, int bChangeFlow)
 
BN_STRUCTAllocateAndInitBnStruct (inp_ATOM *at, int num_atoms, int nMaxAddAtoms, int nMaxAddEdges, int max_altp, int *num_changed_bonds)
 
BN_STRUCTDeAllocateBnStruct (BN_STRUCT *pBNS)
 
int ReInitBnStructAltPaths (BN_STRUCT *pBNS)
 
int ReInitBnStructForMoveableAltBondTest (BN_STRUCT *pBNS, inp_ATOM *at, int num_atoms)
 
void ClearAllBnDataVertices (Vertex *v, Vertex value, int size)
 
void ClearAllBnDataEdges (Edge *e, Vertex value, int size)
 
BN_DATADeAllocateBnData (BN_DATA *pBD)
 
BN_DATAAllocateAndInitBnData (int max_num_vertices)
 
int ReInitBnData (BN_DATA *pBD)
 
int SetForbiddenEdges (BN_STRUCT *pBNS, inp_ATOM *at, int num_atoms, int edge_forbidden_mask, int nebend, int *ebend)
 
int BalancedNetworkSearch (BN_STRUCT *pBNS, BN_DATA *pBD, int bChangeFlow)
 
int SetRadEndpoints (BN_STRUCT *pBNS, BN_DATA *pBD, BRS_MODE bRadSrchMode)
 
int SetRadEndpoints2 (struct tagCANON_GLOBALS *pCG, BN_STRUCT *pBNS, BN_DATA *pBD, BRS_MODE bRadSrchMode)
 
int RemoveRadEndpoints (BN_STRUCT *pBNS, BN_DATA *pBD, inp_ATOM *at)
 
int AddRemoveProtonsRestr (inp_ATOM *at, int num_atoms, int *num_protons_to_add, int nNumProtAddedByRestr, INCHI_MODE bNormalizationFlags, int num_tg, int nChargeRevrs, int nChargeInChI)
 
int AddRemoveIsoProtonsRestr (inp_ATOM *at, int num_atoms, NUM_H num_protons_to_add[], int num_tg)
 

Macro Definition Documentation

◆ AATG_MARK_IN_PATH

#define AATG_MARK_IN_PATH   1 /* atom in path detected by the BNS */

◆ AATG_MARK_MAIN_TYPE

#define AATG_MARK_MAIN_TYPE   4 /* atom O-"salt" */

◆ AATG_MARK_OTHER_TYPE

#define AATG_MARK_OTHER_TYPE   8 /* other atom to be tested */

◆ AATG_MARK_WAS_IN_PATH

#define AATG_MARK_WAS_IN_PATH   2 /* found to be in path before next level */

◆ ADD_CAPACITY_RADICAL

#define ADD_CAPACITY_RADICAL   1 /* add capacity to radical */

◆ ALT_PATH_MODE_4_SALT

#define ALT_PATH_MODE_4_SALT   3 /* mark alt bonds along the path */

◆ ALT_PATH_MODE_4_SALT2

#define ALT_PATH_MODE_4_SALT2   4 /* mark alt bonds along the path, path to taut. group fict. vertex if exists */

◆ ALT_PATH_MODE_ADD2H_CHG

#define ALT_PATH_MODE_ADD2H_CHG   6 /* add 2 H along alt. path A=-=B => AH-=-BH and change bonds to alternating */

◆ ALT_PATH_MODE_ADD2H_TST

#define ALT_PATH_MODE_ADD2H_TST   8 /* test-add 2 H along alt. path A=-=B => AH-=-BH; restore changed bonds */

◆ ALT_PATH_MODE_CHARGE

#define ALT_PATH_MODE_CHARGE   2

◆ ALT_PATH_MODE_REM2H_CHG

#define ALT_PATH_MODE_REM2H_CHG   5 /* remove 2 H along alt. path AH-=-BH => A=-=B and change bonds to alternating */

◆ ALT_PATH_MODE_REM2H_TST

#define ALT_PATH_MODE_REM2H_TST   7 /* test-remove 2 H along alt. path AH-=-BH => A=-=B; restore changed bonds */

◆ ALT_PATH_MODE_REM_PROTON

#define ALT_PATH_MODE_REM_PROTON   9 /* remove proton, adjust bonds, charges, H-counts 2004-03-05 */

◆ ALT_PATH_MODE_TAUTOM

#define ALT_PATH_MODE_TAUTOM   1

◆ ALT_PATH_MODE_TAUTOM_KET

#define ALT_PATH_MODE_TAUTOM_KET   10 /* same as ALT_PATH_MODE_TAUTOM, applies to C=-OH or CH-=O; H may be (-) */

◆ ALT_PATH_MODE_TAUTOM_PT_06_00

#define ALT_PATH_MODE_TAUTOM_PT_06_00   13

◆ ALT_PATH_MODE_TAUTOM_PT_13_00

#define ALT_PATH_MODE_TAUTOM_PT_13_00   15

◆ ALT_PATH_MODE_TAUTOM_PT_16_00

#define ALT_PATH_MODE_TAUTOM_PT_16_00   12

◆ ALT_PATH_MODE_TAUTOM_PT_18_00

#define ALT_PATH_MODE_TAUTOM_PT_18_00   16

◆ ALT_PATH_MODE_TAUTOM_PT_22_00

#define ALT_PATH_MODE_TAUTOM_PT_22_00   11

◆ ALT_PATH_MODE_TAUTOM_PT_39_00

#define ALT_PATH_MODE_TAUTOM_PT_39_00   14

◆ ALTP_ALLOCATED_LEN

#define ALTP_ALLOCATED_LEN (   altp)    (altp)[iALTP_MAX_LEN].number

◆ ALTP_CUR_NEXT_ATOM_NEIGHBOR

#define ALTP_CUR_NEXT_ATOM_NEIGHBOR (   altp)    (altp)[iALTP_NEIGHBOR+ALTP_PATH_LEN(altp)].ineigh[1]

◆ ALTP_CUR_THIS_ATOM_NEIGHBOR

#define ALTP_CUR_THIS_ATOM_NEIGHBOR (   altp)    (altp)[iALTP_NEIGHBOR+ALTP_PATH_LEN(altp)].ineigh[0] /* 0 <= X < path_len */

◆ ALTP_DELTA

#define ALTP_DELTA (   altp)    (altp)[iALTP_FLOW].flow[0]

◆ ALTP_END_ATOM

#define ALTP_END_ATOM (   altp)    (altp)[iALTP_END_ATOM].number

◆ ALTP_MAY_ADD

#define ALTP_MAY_ADD (   altp)    (iALTP_NEIGHBOR + (altp)[iALTP_PATH_LEN].number < (altp)[iALTP_MAX_LEN].number)

◆ ALTP_NEXT

#define ALTP_NEXT (   altp)    (++ALTP_PATH_LEN(altp))

◆ ALTP_NEXT_ATOM_NEIGHBOR

#define ALTP_NEXT_ATOM_NEIGHBOR (   altp,
 
)    (altp)[iALTP_NEIGHBOR+(X)].ineigh[1]

◆ ALTP_OVERFLOW

#define ALTP_OVERFLOW (   altp)    (altp)[iALTP_FLOW].flow[1]

◆ ALTP_PATH_LEN

#define ALTP_PATH_LEN (   altp)    (altp)[iALTP_PATH_LEN].number /* number of bonds = number of atoms-1*/

◆ ALTP_PREV

#define ALTP_PREV (   altp)    (--ALTP_PATH_LEN(altp))

◆ ALTP_START_ATOM

#define ALTP_START_ATOM (   altp)    (altp)[iALTP_START_ATOM].number

◆ ALTP_THIS_ATOM_NEIGHBOR

#define ALTP_THIS_ATOM_NEIGHBOR (   altp,
 
)    (altp)[iALTP_NEIGHBOR+(X)].ineigh[0] /* 0 <= X < path_len */

◆ AROM_BOND_EDGE_CAP

#define AROM_BOND_EDGE_CAP   1

◆ BIT_WORD_MASK

#define BIT_WORD_MASK   ((bitWord)~0)

◆ BLOSSOM_BASE

#define BLOSSOM_BASE   -1

◆ BN_MAX_ALTP

#define BN_MAX_ALTP   16

◆ BNS_ADD_ATOMS

#define BNS_ADD_ATOMS   2 /* max. number of fictitious atoms to add (except t-gtoups) */

◆ BNS_ADD_EDGES

#define BNS_ADD_EDGES   1 /* max. number of edges to add to each atom (except edges to a t-group or c-group) */

◆ BNS_ADD_SUPER_TGROUP

#define BNS_ADD_SUPER_TGROUP   1 /* reserve one more edge for a t-group to connect to a single super-t-group */

◆ BNS_EDGE_FORBIDDEN_MASK

#define BNS_EDGE_FORBIDDEN_MASK   1

◆ BNS_EDGE_FORBIDDEN_TEMP

#define BNS_EDGE_FORBIDDEN_TEMP   2

◆ BNS_EDGE_FORBIDDEN_TEST

#define BNS_EDGE_FORBIDDEN_TEST   4

◆ BNS_EF_ALTR_BONDS

#define BNS_EF_ALTR_BONDS   8 /* make altern. bonds in the structure if the flow has changed */

◆ BNS_EF_ALTR_NS

#define BNS_EF_ALTR_NS   (BNS_EF_ALTR_BONDS | BNS_EF_SET_NOSTEREO)

◆ BNS_EF_CHNG_BONDS

#define BNS_EF_CHNG_BONDS   4 /* change bonds in the structure according to the BN flow */

◆ BNS_EF_CHNG_FLOW

#define BNS_EF_CHNG_FLOW   1 /* change Balanced Network (BN) flow inside the BNS search */

◆ BNS_EF_CHNG_RSTR

#define BNS_EF_CHNG_RSTR   (BNS_EF_CHNG_FLOW | BNS_EF_RSTR_FLOW)

◆ BNS_EF_RAD_SRCH

#define BNS_EF_RAD_SRCH   128 /* search for rafical paths closures */

◆ BNS_EF_RSTR_FLOW

#define BNS_EF_RSTR_FLOW   2 /* undo BN flow changes after BNS */

◆ BNS_EF_SAVE_ALL

#define BNS_EF_SAVE_ALL   (BNS_EF_CHNG_FLOW | BNS_EF_CHNG_BONDS | BNS_EF_UPD_RAD_ORI)

◆ BNS_EF_SET_NOSTEREO

#define BNS_EF_SET_NOSTEREO
Value:
32 /* in combination with BNS_EF_ALTR_BONDS only:
ALT12 bond cannot be stereogenic */

◆ BNS_EF_UPD_H_CHARGE

#define BNS_EF_UPD_H_CHARGE   64 /* update charges and H-counts according to change flow to c- and t-group vertices */

◆ BNS_EF_UPD_RAD_ORI

#define BNS_EF_UPD_RAD_ORI
Value:
16 /* update BN flow0 & Atom radical values:
flow0 := flow, radical:=st_cap - st_flow */

◆ BNS_VERT_TYPE__AUX

#define BNS_VERT_TYPE__AUX   0x0080 /* vertex added to build charge substructures */

◆ BNS_VERT_TYPE_ACID

#define BNS_VERT_TYPE_ACID   0x0200 /* only for this type are allowed paths: t_group-atom-c_group_neg (path_TACN) */

◆ BNS_VERT_TYPE_ANY_GROUP

#define BNS_VERT_TYPE_ANY_GROUP   (BNS_VERT_TYPE_TGROUP | BNS_VERT_TYPE_C_GROUP | BNS_VERT_TYPE_SUPER_TGROUP)

◆ BNS_VERT_TYPE_ATOM

#define BNS_VERT_TYPE_ATOM   0x0001

◆ BNS_VERT_TYPE_C_GROUP

#define BNS_VERT_TYPE_C_GROUP   0x0010

◆ BNS_VERT_TYPE_C_NEGATIVE

#define BNS_VERT_TYPE_C_NEGATIVE   0x0100 /* negative charge group; attribute, should be used with BNS_VERT_TYPE_C_GROUP */

◆ BNS_VERT_TYPE_C_POINT

#define BNS_VERT_TYPE_C_POINT   0x0008

◆ BNS_VERT_TYPE_CARBON_GR

#define BNS_VERT_TYPE_CARBON_GR   0x0400 /* charge of carbon atom; should be used with BNS_VT_C_POS, BNS_VT_C_NEG */

◆ BNS_VERT_TYPE_ENDPOINT

#define BNS_VERT_TYPE_ENDPOINT   0x0002 /* attribute */

◆ BNS_VERT_TYPE_METAL_GR

#define BNS_VERT_TYPE_METAL_GR   0x0800 /* metal atom group; may be used alone or with BNS_VT_M_POS, BNS_VT_M_NEG */

◆ BNS_VERT_TYPE_SUPER_TGROUP

#define BNS_VERT_TYPE_SUPER_TGROUP   0x0020

◆ BNS_VERT_TYPE_TEMP

#define BNS_VERT_TYPE_TEMP   0x0040

◆ BNS_VERT_TYPE_TGROUP

#define BNS_VERT_TYPE_TGROUP   0x0004

◆ BNS_VT_C_NEG

#define BNS_VT_C_NEG   (BNS_VERT_TYPE_C_GROUP | BNS_VERT_TYPE_C_NEGATIVE) /* negative charge group, heteroat */

◆ BNS_VT_C_NEG_ALL

#define BNS_VT_C_NEG_ALL   (BNS_VT_C_POS_ALL | BNS_VERT_TYPE_C_NEGATIVE) /* supergroup (-) */

◆ BNS_VT_C_NEG_C

#define BNS_VT_C_NEG_C   (BNS_VT_C_NEG | BNS_VERT_TYPE_CARBON_GR) /* negative charge group, C, Si, Ge, Sn */

◆ BNS_VT_C_NEG_M

#define BNS_VT_C_NEG_M   (BNS_VT_C_NEG | BNS_VERT_TYPE_METAL_GR) /* negative charge group, metal */

◆ BNS_VT_C_POS

#define BNS_VT_C_POS   BNS_VERT_TYPE_C_GROUP /* positive charge group, heteroat */

◆ BNS_VT_C_POS_ALL

#define BNS_VT_C_POS_ALL   (BNS_VERT_TYPE_SUPER_TGROUP | BNS_VERT_TYPE_C_GROUP) /* supergroup (+) */

◆ BNS_VT_C_POS_C

#define BNS_VT_C_POS_C   (BNS_VT_C_POS | BNS_VERT_TYPE_CARBON_GR) /* positive charge group, C, Si, Ge, Sn */

◆ BNS_VT_C_POS_M

#define BNS_VT_C_POS_M   (BNS_VT_C_POS | BNS_VERT_TYPE_METAL_GR) /* positive charge group, metal */

◆ BNS_VT_CHRG_STRUCT

#define BNS_VT_CHRG_STRUCT   (BNS_VERT_TYPE__AUX | BNS_VERT_TYPE_TEMP) /* ChargeStruct vertex */

◆ BNS_VT_M_GROUP

#define BNS_VT_M_GROUP   BNS_VERT_TYPE_METAL_GR /* metal-group, flower vertex */

◆ BNS_VT_YVCONNECTOR

#define BNS_VT_YVCONNECTOR   BNS_VERT_TYPE__AUX /* group connection */

◆ EDGE_FLOW_MASK

#define EDGE_FLOW_MASK   0x3fff /* mask for flow */

◆ EDGE_FLOW_PATH

#define EDGE_FLOW_PATH   0x4000 /* mark: the edge belongs to the augmenting path */

◆ EDGE_FLOW_ST_MASK

#define EDGE_FLOW_ST_MASK   0x3fff /* mask for flow */

◆ EDGE_FLOW_ST_PATH

#define EDGE_FLOW_ST_PATH   0x4000 /* mark: the edge belongs to the augmenting path */

◆ IS_BNS_VT_ATOM

#define IS_BNS_VT_ATOM (   X)    ((X) & BNS_VERT_TYPE_ATOM)

◆ IS_BNS_VT_C_GR

#define IS_BNS_VT_C_GR (   X)    (((X) & BNS_VT_C_POS_ALL) == BNS_VERT_TYPE_C_GROUP)

◆ IS_BNS_VT_C_OR_CSUPER_GR

#define IS_BNS_VT_C_OR_CSUPER_GR (   X)    ((X) & BNS_VT_C_POS)

◆ IS_BNS_VT_CHRG_STRUCT

#define IS_BNS_VT_CHRG_STRUCT (   X)    (((X) & BNS_VERT_TYPE__AUX) && ((X) & BNS_VERT_TYPE_TEMP))

◆ IS_BNS_VT_CM_GR

#define IS_BNS_VT_CM_GR (   X)    (((X) & BNS_VT_C_POS_M) == BNS_VT_C_POS_M) /* metal charge group */

◆ IS_BNS_VT_M_GR

#define IS_BNS_VT_M_GR (   X)    ((X) == BNS_VERT_TYPE_METAL_GR ) /* metal flower base or vertices */

◆ IS_BNS_VT_YVCONNECTOR

#define IS_BNS_VT_YVCONNECTOR (   X)    (((X) & BNS_VERT_TYPE__AUX) && !((X) & BNS_VERT_TYPE_TEMP))

◆ MAX_ALT_AATG_ARRAY_LEN

#define MAX_ALT_AATG_ARRAY_LEN   127

◆ MAX_AT_FLOW

#define MAX_AT_FLOW (   X)
Value:
(((X).chem_bonds_valence - (X).valence)+\
((is_centerpoint_elem((X).el_number)||get_endpoint_valence((X).el_number))?\
(((X).radical==RADICAL_DOUBLET)/*+2*((X).radical==RADICAL_TRIPLET)*/):0))
int is_centerpoint_elem(U_CHAR el_number)
Definition ichitaut.c:157
#define RADICAL_DOUBLET
Definition incomdef.h:111
int get_endpoint_valence(U_CHAR el_number)
Definition util.c:1463

◆ MAX_BOND_EDGE_CAP

#define MAX_BOND_EDGE_CAP   2 /* triple bond */

◆ MAX_TGROUP_EDGE_CAP

#define MAX_TGROUP_EDGE_CAP   2 /* -NH2 provides max. capacity */

◆ NO_VERTEX

#define NO_VERTEX   -2

◆ NUM_KINDS_OF_GROUPS

#define NUM_KINDS_OF_GROUPS   2 /* 1 accounts for t-group kind, one more 1 accounts for c-group kind */

◆ Vertex_s

#define Vertex_s   0

◆ Vertex_t

#define Vertex_t   1

Typedef Documentation

◆ ALT_CONST

typedef enum tagAltPathConst ALT_CONST

◆ bitWord

typedef U_SHORT bitWord

◆ BN_AATG

typedef struct BN_AtomsAtTautGroup BN_AATG

◆ BN_DATA

typedef struct BalancedNetworkData BN_DATA

◆ BN_STRUCT

◆ BNS_ALT_PATH

typedef union BnsAltPath BNS_ALT_PATH

◆ BNS_EDGE

typedef struct BnsEdge BNS_EDGE

◆ BNS_FLOW_CHANGES

◆ BNS_IEDGE

typedef int BNS_IEDGE

◆ BNS_ST_EDGE

typedef struct BnsStEdge BNS_ST_EDGE

◆ BNS_VERTEX

typedef struct BnsVertex BNS_VERTEX

◆ BRS_MODE

◆ Edge

typedef int Edge[2]

◆ EdgeFlow

typedef int EdgeFlow

◆ EdgeIndex

typedef int EdgeIndex

◆ NodeSet

typedef struct tagNodeSet NodeSet

◆ Vertex

typedef int Vertex

◆ VertexFlow

typedef int VertexFlow

Enumeration Type Documentation

◆ tagAltPathConst

Enumerator
iALTP_MAX_LEN 
iALTP_FLOW 
iALTP_PATH_LEN 
iALTP_START_ATOM 
iALTP_END_ATOM 
iALTP_NEIGHBOR 
iALTP_HDR_LEN 

◆ tagBnsRadSrchMode

Enumerator
RAD_SRCH_NORM 
RAD_SRCH_FROM_FICT 

Function Documentation

◆ AddCGroups2BnStruct()

int AddCGroups2BnStruct ( struct tagCANON_GLOBALS pCG,
struct BalancedNetworkStructure pBNS,
inp_ATOM at,
int  num_atoms,
struct tagChargeGroupsInfo cgi 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddNodeSet2ToNodeSet1()

void AddNodeSet2ToNodeSet1 ( NodeSet cur_nodes,
int  k1,
int  k2 
)
+ Here is the caller graph for this function:

◆ AddNodesToRadEndpoints()

int AddNodesToRadEndpoints ( struct tagCANON_GLOBALS pCG,
NodeSet cur_nodes,
int  k,
Vertex  RadEndpoints[],
Vertex  vRad,
int  nStart,
int  nLen 
)
+ Here is the caller graph for this function:

◆ AddRemoveIsoProtonsRestr()

int AddRemoveIsoProtonsRestr ( inp_ATOM at,
int  num_atoms,
NUM_H  num_protons_to_add[],
int  num_tg 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddRemoveProtonsRestr()

int AddRemoveProtonsRestr ( inp_ATOM at,
int  num_atoms,
int *  num_protons_to_add,
int  nNumProtAddedByRestr,
INCHI_MODE  bNormalizationFlags,
int  num_tg,
int  nChargeRevrs,
int  nChargeInChI 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddSuperTGroup2BnStruct()

int AddSuperTGroup2BnStruct ( struct BalancedNetworkStructure pBNS,
inp_ATOM at,
int  num_atoms,
struct tagTautomerGroupsInfo tgi 
)

◆ AddTGroups2BnStruct()

int AddTGroups2BnStruct ( struct tagCANON_GLOBALS pCG,
struct BalancedNetworkStructure pBNS,
inp_ATOM at,
int  num_atoms,
struct tagTautomerGroupsInfo tgi 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AllocateAndInitBnData()

BN_DATA * AllocateAndInitBnData ( int  max_num_vertices)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AllocateAndInitBnStruct()

BN_STRUCT * AllocateAndInitBnStruct ( inp_ATOM at,
int  num_atoms,
int  nMaxAddAtoms,
int  nMaxAddEdges,
int  max_altp,
int *  num_changed_bonds 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BalancedNetworkSearch()

int BalancedNetworkSearch ( BN_STRUCT pBNS,
BN_DATA pBD,
int  bChangeFlow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bExistsAltPath()

int bExistsAltPath ( struct tagCANON_GLOBALS pCG,
struct BalancedNetworkStructure pBNS,
struct BalancedNetworkData pBD,
struct BN_AtomsAtTautGroup pAATG,
inp_ATOM at,
int  num_atoms,
int  nVertDoubleBond,
int  nVertSingleBond,
int  path_type 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bExistsAnyAltPath()

int bExistsAnyAltPath ( struct tagCANON_GLOBALS pCG,
struct BalancedNetworkStructure pBNS,
struct BalancedNetworkData pBD,
inp_ATOM at,
int  num_atoms,
int  nVertDoubleBond,
int  nVertSingleBond,
int  path_type 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bIsHardRemHCandidate()

int bIsHardRemHCandidate ( inp_ATOM at,
int  i,
int *  cSubType 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearAllBnDataEdges()

void ClearAllBnDataEdges ( Edge e,
Vertex  value,
int  size 
)
+ Here is the caller graph for this function:

◆ ClearAllBnDataVertices()

void ClearAllBnDataVertices ( Vertex v,
Vertex  value,
int  size 
)
+ Here is the caller graph for this function:

◆ DeAllocateBnData()

BN_DATA * DeAllocateBnData ( BN_DATA pBD)
+ Here is the caller graph for this function:

◆ DeAllocateBnStruct()

BN_STRUCT * DeAllocateBnStruct ( BN_STRUCT pBNS)
+ Here is the caller graph for this function:

◆ DisconnectTestAtomFromTGroup()

int DisconnectTestAtomFromTGroup ( struct BalancedNetworkStructure pBNS,
int  v1,
int *  pv2,
BNS_FLOW_CHANGES fcd 
)

◆ DisconnectTGroupFromSuperTGroup()

int DisconnectTGroupFromSuperTGroup ( struct BalancedNetworkStructure pBNS,
int  v1,
int *  pv1,
int *  pv2,
BNS_FLOW_CHANGES fcd 
)

◆ DoNodeSetsIntersect()

int DoNodeSetsIntersect ( NodeSet cur_nodes,
int  k1,
int  k2 
)
+ Here is the caller graph for this function:

◆ IsNodeSetEmpty()

int IsNodeSetEmpty ( NodeSet cur_nodes,
int  k 
)
+ Here is the caller graph for this function:

◆ nExists2AtMoveAltPath()

int nExists2AtMoveAltPath ( struct BalancedNetworkStructure pBNS,
struct BalancedNetworkData pBD,
struct BN_AtomsAtTautGroup pAATG,
inp_ATOM at,
int  num_atoms,
int  jj2,
int  jj1,
struct tagSaltChargeCandidate s_candidate,
int  nNumCandidates,
AT_NUMB nForbiddenAtom,
int  nNumForbiddenAtoms 
)

◆ NodeSetCreate()

int NodeSetCreate ( struct tagCANON_GLOBALS pCG,
NodeSet pSet,
int  n,
int  L 
)
+ Here is the caller graph for this function:

◆ NodeSetFree()

void NodeSetFree ( struct tagCANON_GLOBALS pCG,
NodeSet pSet 
)
+ Here is the caller graph for this function:

◆ NodeSetFromRadEndpoints()

void NodeSetFromRadEndpoints ( struct tagCANON_GLOBALS pCG,
NodeSet cur_nodes,
int  k,
Vertex  RadEndpoints[],
int  num_v 
)
+ Here is the caller graph for this function:

◆ ReconnectTestAtomToTGroup()

int ReconnectTestAtomToTGroup ( struct BalancedNetworkStructure pBNS,
int  v1,
int  v2,
int  ie,
BNS_FLOW_CHANGES fcd 
)

◆ ReInitBnData()

int ReInitBnData ( BN_DATA pBD)
+ Here is the caller graph for this function:

◆ ReInitBnStruct()

int ReInitBnStruct ( struct BalancedNetworkStructure pBNS,
inp_ATOM at,
int  num_at,
int  bRemoveGroupsFromAtoms 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReInitBnStructAddGroups()

int ReInitBnStructAddGroups ( struct tagCANON_GLOBALS pCG,
struct BalancedNetworkStructure pBNS,
inp_ATOM at,
int  num_atoms,
struct tagTautomerGroupsInfo tgi,
struct tagChargeGroupsInfo cgi 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReInitBnStructAltPaths()

int ReInitBnStructAltPaths ( BN_STRUCT pBNS)
+ Here is the caller graph for this function:

◆ ReInitBnStructForMoveableAltBondTest()

int ReInitBnStructForMoveableAltBondTest ( BN_STRUCT pBNS,
inp_ATOM at,
int  num_atoms 
)

◆ RemoveFromNodeSet()

void RemoveFromNodeSet ( struct tagCANON_GLOBALS pCG,
NodeSet cur_nodes,
int  k,
Vertex  v[],
int  num_v 
)
+ Here is the caller graph for this function:

◆ RemoveRadEndpoints()

int RemoveRadEndpoints ( BN_STRUCT pBNS,
BN_DATA pBD,
inp_ATOM at 
)
+ Here is the caller graph for this function:

◆ RunBalancedNetworkSearch()

int RunBalancedNetworkSearch ( BN_STRUCT pBNS,
BN_DATA pBD,
int  bChangeFlow 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetForbiddenEdges()

int SetForbiddenEdges ( BN_STRUCT pBNS,
inp_ATOM at,
int  num_atoms,
int  edge_forbidden_mask,
int  nebend,
int *  ebend 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRadEndpoints()

int SetRadEndpoints ( BN_STRUCT pBNS,
BN_DATA pBD,
BRS_MODE  bRadSrchMode 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetRadEndpoints2()

int SetRadEndpoints2 ( struct tagCANON_GLOBALS pCG,
BN_STRUCT pBNS,
BN_DATA pBD,
BRS_MODE  bRadSrchMode 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: