#include <stdlib.h>
#include <string.h>
#include "mode.h"
#include "ichitime.h"
#include "ichirvrs.h"
#include "ichicant.h"
#include "ichi_io.h"
#include "ichimain.h"
#include "inpdef.h"
#include "bcf_s.h"
Data Structures | |
struct | tagVertexFlow |
Macros | |
#define | cnListIndexMe (17) /* index of {cnMe, cn_bits_Me,... } element of cnList[] */ |
#define | MIN_ATOM_CHARGE (-2) |
#define | MAX_ATOM_CHARGE 2 |
#define | NEUTRAL_STATE (-MIN_ATOM_CHARGE) |
#define | NUM_ATOM_CHARGES (MAX_ATOM_CHARGE - MIN_ATOM_CHARGE + 1) |
#define | MAX_NUM_VALENCES 5 /* max. number + 1 to provide zero termination */ |
#define | ANY_VERT_TYPE(X) |
#define | GRP_VERT_TYPE(X) |
#define | NUM_VF 3 |
#define | VF_USED_IN 1 |
#define | VF_USED_OUT 2 |
#define | VF_USED_ALL (VF_USED_IN | VF_USED_OUT) |
Typedefs | |
typedef struct tagVertexFlow | VF |
Functions | |
void | clear_t_group_info (T_GROUP_INFO *ti) |
int | GetTgroupInfoFromInChI (T_GROUP_INFO *ti, inp_ATOM *at, AT_NUMB *endpoint, INChI *pInChI) |
int | FillOutpStructEndpointFromInChI (INChI *pInChI, AT_NUMB **pEndpoint) |
int | cmp_charge_val (const void *a1, const void *a2, void *p) |
int | bMayBeACationInMobileHLayer (inp_ATOM *at, VAL_AT *pVA, int iat, int bMobileH) |
int | clean_charge_val (struct tagCANON_GLOBALS *pCG, CHARGE_VAL *pChargeVal, int len, inp_ATOM *atom, VAL_AT *pVA, int iat, int bIsMetal, int bMobileH, AT_NUMB *endpoint) |
int | GetAtomRestoreInfo (struct tagCANON_GLOBALS *pCG, inp_ATOM *atom, int iat, VAL_AT *pVArray, ICHICONST SRM *pSrm, int bMobileH, AT_NUMB *endpoint) |
int | get_sp_element_type (int nPeriodicNumber, int *nRow) |
int | ReallocTCGroups (ALL_TC_GROUPS *pTCGroups, int nAdd) |
int | RegisterTCGroup (ALL_TC_GROUPS *pTCGroups, int nGroupType, int nGroupOrdNum, int nVertexCap, int nVertexFlow, int nEdgeCap, int nEdgeFlow, int nNumEdges) |
int | nTautEndpointEdgeCap (inp_ATOM *at, VAL_AT *pVA, int i) |
int | BondFlowMaxcapMinorder (inp_ATOM *atom, VAL_AT *pVA, ICHICONST SRM *pSrm, int iat, int ineigh, int *pnMaxcap, int *pnMinorder, int *pbNeedsFlower) |
int | AtomStcapStflow (inp_ATOM *atom, VAL_AT *pVA, ICHICONST SRM *pSrm, int iat, int *pnStcap, int *pnStflow, EdgeFlow *pnMGroupEdgeCap, EdgeFlow *pnMGroupEdgeFlow) |
int | nCountBnsSizes (inp_ATOM *at, int num_at, int nAddEdges2eachAtom, int nAddVertices, T_GROUP_INFO *ti, VAL_AT *pVA, ICHICONST SRM *pSrm, ALL_TC_GROUPS *pTCGroups) |
int | nAddSuperCGroups (ALL_TC_GROUPS *pTCGroups) |
int | AddTGroups2TCGBnStruct (BN_STRUCT *pBNS, StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int nMaxAddEdges) |
int | ConnectTwoVertices (BNS_VERTEX *p1, BNS_VERTEX *p2, BNS_EDGE *e, BN_STRUCT *pBNS, int bClearEdge) |
int | AddRadicalToMetal (int *tot_st_cap, int *tot_st_flow, ICHICONST SRM *pSrm, BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups) |
int | ConnectMetalFlower (int *pcur_num_vertices, int *pcur_num_edges, int *tot_st_cap, int *tot_st_flow, ICHICONST SRM *pSrm, BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups) |
void | SetEdgeCapFlow (BNS_EDGE *e, int edge_cap, int edge_flow) |
int | AddEdgeFlow (int edge_cap, int edge_flow, BNS_EDGE *e01, BNS_VERTEX *pSrc, BNS_VERTEX *pDst, int *tot_st_cap, int *tot_st_flow) |
int | ConnectSuperCGroup (int nSuperCGroup, int nAddGroups[], int num_add, int *pcur_num_vertices, int *pcur_num_edges, int *tot_st_cap, int *tot_st_flow, BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups) |
void | AddStCapFlow (BNS_VERTEX *vert_ficpoint, int *tot_st_flow, int *tot_st_cap, int cap, int flow) |
void | SetStCapFlow (BNS_VERTEX *vert_ficpoint, int *tot_st_flow, int *tot_st_cap, int cap, int flow) |
int | AddCGroups2TCGBnStruct (BN_STRUCT *pBNS, StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int nMaxAddEdges) |
int | nNumEdgesToCnVertex (MY_CONST C_NODE *pCN, int len, int v) |
BN_STRUCT * | AllocateAndInitTCGBnStruct (StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int nMaxAddAtoms, int nMaxAddEdges, int max_altp, int *pNum_changed_bonds) |
void | IncrZeroBondsAndClearEndpts (inp_ATOM *at, int num_at, int iComponent) |
void | IncrZeroBonds (inp_ATOM *at, int num_at, int iComponent) |
void | ClearEndpts (inp_ATOM *at, int num_at) |
int | GetDeltaChargeFromVF (BN_STRUCT *pBNS, VAL_AT *pVA, VF *vf) |
int | EvaluateChargeChanges (BN_STRUCT *pBNS, VAL_AT *pVA, int *pnDeltaH, int *pnDeltaCharge, int *pnNumVisitedAtoms) |
int | RunBnsTestOnce (BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, Vertex *pvFirst, Vertex *pvLast, int *pPathLen, int *pnDeltaH, int *pnDeltaCharge, int *pnNumVisitedAtoms) |
int | RunBnsRestoreOnce (BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups) |
int | comp_cc_cand (const void *a1, const void *a2) |
int | get_pVA_atom_type (VAL_AT *pVA, inp_ATOM *at, int iat, int bond_type) |
int | AllocEdgeList (EDGE_LIST *pEdges, int nLen) |
int | AddToEdgeList (EDGE_LIST *pEdges, int iedge, int nAddLen) |
int | RemoveFromEdgeListByIndex (EDGE_LIST *pEdges, int index) |
int | FindInEdgeList (EDGE_LIST *pEdges, int iedge) |
int | RemoveFromEdgeListByValue (EDGE_LIST *pEdges, int iedge) |
int | AllocBfsQueue (BFS_Q *pQ, int num_at, int min_ring_size) |
void | RemoveForbiddenEdgeMask (BN_STRUCT *pBNS, EDGE_LIST *pEdges, int forbidden_edge_mask) |
void | SetForbiddenEdgeMask (BN_STRUCT *pBNS, EDGE_LIST *pEdges, int forbidden_edge_mask) |
void | RemoveForbiddenBondFlowBits (BN_STRUCT *pBNS, int forbidden_edge_mask_int) |
int | GetChargeFlowerUpperEdge (BN_STRUCT *pBNS, VAL_AT *pVA, int nChargeEdge) |
int | MakeOneInChIOutOfStrFromINChI2 (struct tagCANON_GLOBALS *pCG, INCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip_inp, STRUCT_DATA *sd_inp, BN_STRUCT *pBNS, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **t_group_info, inp_ATOM **at_norm, inp_ATOM **at_prep) |
int | MakeOneInChIOutOfStrFromINChI (struct tagCANON_GLOBALS *pCG, INCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, StrFromINChI *pStruct, inp_ATOM *at2, inp_ATOM *at3, ALL_TC_GROUPS *pTCGroups) |
int | ConnectDisconnectedH (inp_ATOM *at, int num_atoms, int num_deleted_H) |
int | DisconnectedConnectedH (inp_ATOM *at, int num_atoms, int num_deleted_H) |
int | MakeInChIOutOfStrFromINChI2 (INCHI_CLOCK *ic, CANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip_inp, STRUCT_DATA *sd_inp, StrFromINChI *pStruct, int iComponent, int iAtNoOffset, long num_inp) |
int | OutputInChIOutOfStrFromINChI (struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip_inp, STRUCT_DATA *sd_inp, long num_inp, int bINChIOutputOptions, INCHI_IOSTREAM *pout, INCHI_IOSTREAM *plog, InpInChI *pOneInput, int bHasSomeFixedH, unsigned char save_opt_bits) |
Variables | |
MY_CONST C_NODE | cnMe [5] |
MY_CONST C_NODE | cnPNPN [5] |
MY_CONST C_NODE | cnNPNP [5] |
MY_CONST C_NODE | cnNPN [5] |
MY_CONST C_NODE | cnPNP [5] |
MY_CONST C_NODE | cnMNP [3] |
MY_CONST C_NODE | cnPNM [4] |
MY_CONST C_NODE | cnEN [6] |
MY_CONST C_NODE | cnNMN [5] |
MY_CONST C_NODE | cnNE [5] |
MY_CONST C_NODE | cnNEN [6] |
MY_CONST C_NODE | cnNP [2] |
MY_CONST C_NODE | cnPN [3] |
MY_CONST C_NODE | cnNM [3] |
MY_CONST C_NODE | cnMN [2] |
MY_CONST C_NODE | cnP_ [2] |
MY_CONST C_NODE | cnM_ [1] |
MY_CONST C_NODE | cnN_ [1] |
MY_CONST CN_LIST | cnList [] |
const int | cnListNumEl = (int) ( sizeof( cnList ) / sizeof( cnList[0] ) ) |
#define ANY_VERT_TYPE | ( | X | ) |
#define cnListIndexMe (17) /* index of {cnMe, cn_bits_Me,... } element of cnList[] */ |
#define GRP_VERT_TYPE | ( | X | ) |
#define MAX_ATOM_CHARGE 2 |
#define MAX_NUM_VALENCES 5 /* max. number + 1 to provide zero termination */ |
#define MIN_ATOM_CHARGE (-2) |
#define NEUTRAL_STATE (-MIN_ATOM_CHARGE) |
#define NUM_ATOM_CHARGES (MAX_ATOM_CHARGE - MIN_ATOM_CHARGE + 1) |
#define NUM_VF 3 |
#define VF_USED_ALL (VF_USED_IN | VF_USED_OUT) |
#define VF_USED_IN 1 |
#define VF_USED_OUT 2 |
typedef struct tagVertexFlow VF |
int AddCGroups2TCGBnStruct | ( | BN_STRUCT * | pBNS, |
StrFromINChI * | pStruct, | ||
VAL_AT * | pVA, | ||
ALL_TC_GROUPS * | pTCGroups, | ||
int | nMaxAddEdges | ||
) |
int AddEdgeFlow | ( | int | edge_cap, |
int | edge_flow, | ||
BNS_EDGE * | e01, | ||
BNS_VERTEX * | pSrc, | ||
BNS_VERTEX * | pDst, | ||
int * | tot_st_cap, | ||
int * | tot_st_flow | ||
) |
int AddRadicalToMetal | ( | int * | tot_st_cap, |
int * | tot_st_flow, | ||
ICHICONST SRM * | pSrm, | ||
BN_STRUCT * | pBNS, | ||
ALL_TC_GROUPS * | pTCGroups | ||
) |
void AddStCapFlow | ( | BNS_VERTEX * | vert_ficpoint, |
int * | tot_st_flow, | ||
int * | tot_st_cap, | ||
int | cap, | ||
int | flow | ||
) |
int AddTGroups2TCGBnStruct | ( | BN_STRUCT * | pBNS, |
StrFromINChI * | pStruct, | ||
VAL_AT * | pVA, | ||
ALL_TC_GROUPS * | pTCGroups, | ||
int | nMaxAddEdges | ||
) |
int AddToEdgeList | ( | EDGE_LIST * | pEdges, |
int | iedge, | ||
int | nAddLen | ||
) |
BN_STRUCT * AllocateAndInitTCGBnStruct | ( | StrFromINChI * | pStruct, |
VAL_AT * | pVA, | ||
ALL_TC_GROUPS * | pTCGroups, | ||
int | nMaxAddAtoms, | ||
int | nMaxAddEdges, | ||
int | max_altp, | ||
int * | pNum_changed_bonds | ||
) |
int AllocBfsQueue | ( | BFS_Q * | pQ, |
int | num_at, | ||
int | min_ring_size | ||
) |
int AllocEdgeList | ( | EDGE_LIST * | pEdges, |
int | nLen | ||
) |
int AtomStcapStflow | ( | inp_ATOM * | atom, |
VAL_AT * | pVA, | ||
ICHICONST SRM * | pSrm, | ||
int | iat, | ||
int * | pnStcap, | ||
int * | pnStflow, | ||
EdgeFlow * | pnMGroupEdgeCap, | ||
EdgeFlow * | pnMGroupEdgeFlow | ||
) |
int BondFlowMaxcapMinorder | ( | inp_ATOM * | atom, |
VAL_AT * | pVA, | ||
ICHICONST SRM * | pSrm, | ||
int | iat, | ||
int | ineigh, | ||
int * | pnMaxcap, | ||
int * | pnMinorder, | ||
int * | pbNeedsFlower | ||
) |
int clean_charge_val | ( | struct tagCANON_GLOBALS * | pCG, |
CHARGE_VAL * | pChargeVal, | ||
int | len, | ||
inp_ATOM * | atom, | ||
VAL_AT * | pVA, | ||
int | iat, | ||
int | bIsMetal, | ||
int | bMobileH, | ||
AT_NUMB * | endpoint | ||
) |
void clear_t_group_info | ( | T_GROUP_INFO * | ti | ) |
void ClearEndpts | ( | inp_ATOM * | at, |
int | num_at | ||
) |
int cmp_charge_val | ( | const void * | a1, |
const void * | a2, | ||
void * | p | ||
) |
int comp_cc_cand | ( | const void * | a1, |
const void * | a2 | ||
) |
int ConnectDisconnectedH | ( | inp_ATOM * | at, |
int | num_atoms, | ||
int | num_deleted_H | ||
) |
int ConnectMetalFlower | ( | int * | pcur_num_vertices, |
int * | pcur_num_edges, | ||
int * | tot_st_cap, | ||
int * | tot_st_flow, | ||
ICHICONST SRM * | pSrm, | ||
BN_STRUCT * | pBNS, | ||
ALL_TC_GROUPS * | pTCGroups | ||
) |
int ConnectSuperCGroup | ( | int | nSuperCGroup, |
int | nAddGroups[], | ||
int | num_add, | ||
int * | pcur_num_vertices, | ||
int * | pcur_num_edges, | ||
int * | tot_st_cap, | ||
int * | tot_st_flow, | ||
BN_STRUCT * | pBNS, | ||
ALL_TC_GROUPS * | pTCGroups | ||
) |
int ConnectTwoVertices | ( | BNS_VERTEX * | p1, |
BNS_VERTEX * | p2, | ||
BNS_EDGE * | e, | ||
BN_STRUCT * | pBNS, | ||
int | bClearEdge | ||
) |
int DisconnectedConnectedH | ( | inp_ATOM * | at, |
int | num_atoms, | ||
int | num_deleted_H | ||
) |
int EvaluateChargeChanges | ( | BN_STRUCT * | pBNS, |
VAL_AT * | pVA, | ||
int * | pnDeltaH, | ||
int * | pnDeltaCharge, | ||
int * | pnNumVisitedAtoms | ||
) |
int FindInEdgeList | ( | EDGE_LIST * | pEdges, |
int | iedge | ||
) |
int get_sp_element_type | ( | int | nPeriodicNumber, |
int * | nRow | ||
) |
int GetAtomRestoreInfo | ( | struct tagCANON_GLOBALS * | pCG, |
inp_ATOM * | atom, | ||
int | iat, | ||
VAL_AT * | pVArray, | ||
ICHICONST SRM * | pSrm, | ||
int | bMobileH, | ||
AT_NUMB * | endpoint | ||
) |
int GetTgroupInfoFromInChI | ( | T_GROUP_INFO * | ti, |
inp_ATOM * | at, | ||
AT_NUMB * | endpoint, | ||
INChI * | pInChI | ||
) |
void IncrZeroBonds | ( | inp_ATOM * | at, |
int | num_at, | ||
int | iComponent | ||
) |
void IncrZeroBondsAndClearEndpts | ( | inp_ATOM * | at, |
int | num_at, | ||
int | iComponent | ||
) |
int MakeInChIOutOfStrFromINChI2 | ( | INCHI_CLOCK * | ic, |
CANON_GLOBALS * | pCG, | ||
ICHICONST INPUT_PARMS * | ip_inp, | ||
STRUCT_DATA * | sd_inp, | ||
StrFromINChI * | pStruct, | ||
int | iComponent, | ||
int | iAtNoOffset, | ||
long | num_inp | ||
) |
int MakeOneInChIOutOfStrFromINChI | ( | struct tagCANON_GLOBALS * | pCG, |
INCHI_CLOCK * | ic, | ||
ICHICONST INPUT_PARMS * | ip, | ||
STRUCT_DATA * | sd, | ||
StrFromINChI * | pStruct, | ||
inp_ATOM * | at2, | ||
inp_ATOM * | at3, | ||
ALL_TC_GROUPS * | pTCGroups | ||
) |
int MakeOneInChIOutOfStrFromINChI2 | ( | struct tagCANON_GLOBALS * | pCG, |
INCHI_CLOCK * | ic, | ||
ICHICONST INPUT_PARMS * | ip_inp, | ||
STRUCT_DATA * | sd_inp, | ||
BN_STRUCT * | pBNS, | ||
StrFromINChI * | pStruct, | ||
inp_ATOM * | at, | ||
inp_ATOM * | at2, | ||
inp_ATOM * | at3, | ||
VAL_AT * | pVA, | ||
ALL_TC_GROUPS * | pTCGroups, | ||
T_GROUP_INFO ** | t_group_info, | ||
inp_ATOM ** | at_norm, | ||
inp_ATOM ** | at_prep | ||
) |
int nAddSuperCGroups | ( | ALL_TC_GROUPS * | pTCGroups | ) |
int nCountBnsSizes | ( | inp_ATOM * | at, |
int | num_at, | ||
int | nAddEdges2eachAtom, | ||
int | nAddVertices, | ||
T_GROUP_INFO * | ti, | ||
VAL_AT * | pVA, | ||
ICHICONST SRM * | pSrm, | ||
ALL_TC_GROUPS * | pTCGroups | ||
) |
int OutputInChIOutOfStrFromINChI | ( | struct tagINCHI_CLOCK * | ic, |
struct tagCANON_GLOBALS * | pCG, | ||
ICHICONST INPUT_PARMS * | ip_inp, | ||
STRUCT_DATA * | sd_inp, | ||
long | num_inp, | ||
int | bINChIOutputOptions, | ||
INCHI_IOSTREAM * | pout, | ||
INCHI_IOSTREAM * | plog, | ||
InpInChI * | pOneInput, | ||
int | bHasSomeFixedH, | ||
unsigned char | save_opt_bits | ||
) |
int ReallocTCGroups | ( | ALL_TC_GROUPS * | pTCGroups, |
int | nAdd | ||
) |
int RegisterTCGroup | ( | ALL_TC_GROUPS * | pTCGroups, |
int | nGroupType, | ||
int | nGroupOrdNum, | ||
int | nVertexCap, | ||
int | nVertexFlow, | ||
int | nEdgeCap, | ||
int | nEdgeFlow, | ||
int | nNumEdges | ||
) |
void RemoveForbiddenBondFlowBits | ( | BN_STRUCT * | pBNS, |
int | forbidden_edge_mask_int | ||
) |
int RemoveFromEdgeListByIndex | ( | EDGE_LIST * | pEdges, |
int | index | ||
) |
int RemoveFromEdgeListByValue | ( | EDGE_LIST * | pEdges, |
int | iedge | ||
) |
int RunBnsRestoreOnce | ( | BN_STRUCT * | pBNS, |
BN_DATA * | pBD, | ||
VAL_AT * | pVA, | ||
ALL_TC_GROUPS * | pTCGroups | ||
) |
int RunBnsTestOnce | ( | BN_STRUCT * | pBNS, |
BN_DATA * | pBD, | ||
VAL_AT * | pVA, | ||
Vertex * | pvFirst, | ||
Vertex * | pvLast, | ||
int * | pPathLen, | ||
int * | pnDeltaH, | ||
int * | pnDeltaCharge, | ||
int * | pnNumVisitedAtoms | ||
) |
void SetEdgeCapFlow | ( | BNS_EDGE * | e, |
int | edge_cap, | ||
int | edge_flow | ||
) |
void SetStCapFlow | ( | BNS_VERTEX * | vert_ficpoint, |
int * | tot_st_flow, | ||
int * | tot_st_cap, | ||
int | cap, | ||
int | flow | ||
) |