#include <stdlib.h>#include <string.h>#include <ctype.h>#include <math.h>#include "mode.h"#include "strutil.h"#include "ichister.h"#include "ichi_io.h"#include "ichimain.h"#include "bcf_s.h"
Include dependency graph for strutil.c:Data Structures | |
| struct | tagTreeAtom |
Macros | |
| #define | FIX_P_IV_Plus_O_Minus |
| #define | FIRST_NEIGHB2 4 |
| #define | FIRST_CENTER2 5 |
| #define | MAX_NEIGH 6 |
| #define | MIN_BOND_LENGTH (1.0e-6) |
| #define | MIN_COS (1.0e-6) |
| #define | MIN_BOND_LENGTH2 (MIN_BOND_LENGTH*MIN_BOND_LENGTH) |
| #define | MAX_BOND_LENGTH (1.0e30) |
| #define | NUM_SEGM 20 |
Typedefs | |
| typedef struct tagTreeAtom | tre_ATOM |
| typedef enum tagIonAtomType | ION_ATOM_TYPE |
Enumerations | |
| enum | tagIonAtomType { IAT_H = 0 , IAT_C , IAT_N , IAT_P , IAT_O , IAT_S , IAT_Se , IAT_Te , IAT_F , IAT_Cl , IAT_Br , IAT_I , IAT_MAX = 12 } |
Functions | |
| int | insertions_sort_AT_RANK (AT_RANK *base, int num) |
| int | cmp_iso_atw_diff_component_no (const void *a1, const void *a2) |
| int | cmp_components (const void *a1, const void *a2) |
| INChI_Stereo * | Alloc_INChI_Stereo (int num_at, int num_bonds) |
| int | RemoveInpAtBond (inp_ATOM *at, int iat, int k) |
| int | DisconnectInpAtBond (inp_ATOM *at, AT_NUMB *nOldCompNumber, int iat, int neigh_ord) |
| int | move_explicit_Hcation (inp_ATOM *at, int num_at, int iat, int iat_H, int bInAllComponents) |
| int | DisconnectOneLigand (inp_ATOM *at, AT_NUMB *nOldCompNumber, S_CHAR *bMetal, char *elnumber_Heteroat, int num_halogens, int num_atoms, int iMetal, int jLigand, INCHI_MODE *bTautFlagsDone) |
| int | bIsAmmoniumSalt (inp_ATOM *at, int i, int *piO, int *pk, S_CHAR *num_explicit_H) |
| int | DisconnectAmmoniumSalt (inp_ATOM *at, int i, int iO, int k, S_CHAR *num_explicit_H) |
| int | DisconnectMetalSalt (inp_ATOM *at, int i) |
| int | bIsMetalToDisconnect (inp_ATOM *at, int i, int bCheckMetalValence) |
| int | get_iat_number (int el_number) |
| int | tot_unsat (int unsat[]) |
| int | max_unsat (int unsat[]) |
| double | dist3D (inp_ATOM *at1, inp_ATOM *at2) |
| double | dist2D (inp_ATOM *at1, inp_ATOM *at2) |
| double | dist_from_segm (double x, double y, double x1, double y1, double x2, double y2) |
| int | segments_intersect (double x11, double y11, double x12, double y12, double x21, double y21, double x22, double y22) |
| double | GetMinDistDistribution (inp_ATOM *at, int num_at, int iat, int iat_H, int bInAllComponents, double min_dist[], int num_segm) |
| int | nFindOneOM (inp_ATOM *at, int at_no, int ord_OM[], int num_OM) |
| int | the_only_doublet_neigh (inp_ATOM *at, int i1, int *ineigh1, int *ineigh2) |
| int | fix_non_uniform_drawn_oxoanions (int num_atoms, inp_ATOM *at, int *num_changes) |
| int | fix_non_uniform_drawn_amidiniums (int num_atoms, inp_ATOM *at, int *num_changes) |
| void | add_bond_if_unseen (subgraf_pathfinder *spf, int node0, int node, int *nbonds, int **bonds) |
| int | fix_odd_things (int num_atoms, inp_ATOM *at, int bFixBug, int bFixNonUniformDraw) |
| Fix odd things in the input atoms. | |
| int | post_fix_odd_things (int num_atoms, inp_ATOM *at) |
| Post-fix odd things in the input atoms (does nothing, returns 0) | |
| int | remove_ion_pairs (int num_atoms, inp_ATOM *at) |
| Remove ion pairs from the input atoms. | |
| int | bIsMetalSalt (inp_ATOM *at, int i) |
| Check if atom is a metal salt. | |
| int | DisconnectSalts (ORIG_ATOM_DATA *orig_inp_data, int bDisconnect) |
| Disconnect salts in the original atom data. | |
| int | bMayDisconnectMetals (ORIG_ATOM_DATA *orig_inp_data, int bCheckMetalValence, INCHI_MODE *bTautFlagsDone) |
| Check if metals may be disconnected in the original atom data. | |
| int | DisconnectMetals (ORIG_ATOM_DATA *orig_inp_data, int bCheckMetalValence, INCHI_MODE *bTautFlagsDone) |
| Disconnect metals in the original atom data. | |
| int | add_DT_to_num_H (int num_atoms, inp_ATOM *at) |
| int | remove_terminal_HDT (int num_atoms, inp_ATOM *at, int bFixTermHChrg) |
| int | bHeteroAtomMayHaveXchgIsoH (inp_ATOM *atom, int iat) |
| Checks whether a hetero atom may have exchangeable isotopic hydrogens. | |
| int | bNumHeterAtomHasIsotopicH (inp_ATOM *atom, int num_atoms) |
| Check if hetero atoms has isotopic hydrogens. | |
| int | MarkDisconnectedComponents (ORIG_ATOM_DATA *orig_at_data, int bProcessOldCompNumbers) |
| Mark disconnected components in the original atom data. | |
| int | ExtractConnectedComponent (inp_ATOM *at, int num_at, int component_number, inp_ATOM *component_at) |
| Extract one (connected) component. | |
| int | SetConnectedComponentNumber (inp_ATOM *at, int num_at, int component_number) |
| Set the Connected Component Number object. | |
| int | Free_INChI_Stereo (INChI_Stereo *pINChI_Stereo) |
| Free INChI_Stereo data structure. | |
| int | Free_INChI (INChI **ppINChI) |
| Free INChI data structure. | |
| int | Free_INChI_Members (INChI *pINChI) |
| Free INChI members. | |
| INChI * | Alloc_INChI (inp_ATOM *at, int num_at, int *found_num_bonds, int *found_num_isotopic, int nAllocMode) |
| Allocate INChI data structure. | |
| int | Free_INChI_Aux (INChI_Aux **ppINChI_Aux) |
| Free INChI_Aux data structure. | |
| INChI_Aux * | Alloc_INChI_Aux (int num_at, int num_isotopic_atoms, int nAllocMode, int bOrigCoord) |
| Allocate AuxInfo data structure. | |
| void | CompAtomData_GetNumMapping (COMP_ATOM_DATA *adata, int *orig_num, int *curr_num) |
| int | imat_new (int m, int n, int ***a) |
| Allocate integer matrix. | |
| void | imat_free (int m, int **a) |
| Free integer matrix. | |
| subgraf * | subgraf_new (ORIG_ATOM_DATA *orig_inp_data, int nnodes, int *nodes) |
| Create graph from atom data. | |
| void | subgraf_free (subgraf *sg) |
| Free graph data structure. | |
| void | subgraf_debug_trace (subgraf *sg) |
| Debug graph data structure. | |
| subgraf_pathfinder * | subgraf_pathfinder_new (subgraf *sg, ORIG_ATOM_DATA *orig_inp_data, int start, int end) |
| Allocate new graph pathfinder data structure. | |
| void | subgraf_pathfinder_free (subgraf_pathfinder *spf) |
| Frees subgraph pathfinder data structure. | |
| void | subgraf_pathfinder_run (subgraf_pathfinder *spf, int nforbidden, int *forbidden, int *nbonds, int **bonds, int *natoms, int *atoms) |
| Find path(s) from subgraf node spf->start to spf->end and fill bonds[nbonds] and atoms[natoms]. Does not traverse through supplied forbidden edges (if not zero/NULL) | |
| int | subgraf_pathfinder_collect_all (subgraf_pathfinder *spf, int nforbidden, int *forbidden, int *atnums) |
| Collects atom numbers along path. | |
| void | PrintFileName (const char *fmt, FILE *out_file, const char *szFname) |
| Print the file name. | |
| #define FIRST_CENTER2 5 |
| #define FIRST_NEIGHB2 4 |
| #define FIX_P_IV_Plus_O_Minus |
| #define MAX_BOND_LENGTH (1.0e30) |
| #define MAX_NEIGH 6 |
| #define MIN_BOND_LENGTH (1.0e-6) |
| #define MIN_BOND_LENGTH2 (MIN_BOND_LENGTH*MIN_BOND_LENGTH) |
| #define MIN_COS (1.0e-6) |
| #define NUM_SEGM 20 |
| typedef enum tagIonAtomType ION_ATOM_TYPE |
| typedef struct tagTreeAtom tre_ATOM |
| enum tagIonAtomType |
| void add_bond_if_unseen | ( | subgraf_pathfinder * | spf, |
| int | node0, | ||
| int | node, | ||
| int * | nbonds, | ||
| int ** | bonds | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int add_DT_to_num_H | ( | int | num_atoms, |
| inp_ATOM * | at | ||
| ) |
Here is the caller graph for this function:| INChI * Alloc_INChI | ( | inp_ATOM * | at, |
| int | num_at, | ||
| int * | found_num_bonds, | ||
| int * | found_num_isotopic, | ||
| int | nAllocMode | ||
| ) |
Allocate INChI data structure.
| at | Pointer to atom array |
| num_at | Number of atoms |
| found_num_bonds | Pointer to number of bonds |
| found_num_isotopic | Pointer to number of isotopic atoms |
| nAllocMode | Allocation mode |
Here is the call graph for this function:
Here is the caller graph for this function:| INChI_Aux * Alloc_INChI_Aux | ( | int | num_at, |
| int | num_isotopic_atoms, | ||
| int | nAllocMode, | ||
| int | bOrigData | ||
| ) |
Allocate AuxInfo data structure.
| num_at | Number of atoms |
| num_isotopic_atoms | Number of isotopic atoms |
| nAllocMode | Allocation mode |
| bOrigData | Flag indicating if the atom data is original |
Here is the call graph for this function:
Here is the caller graph for this function:| INChI_Stereo * Alloc_INChI_Stereo | ( | int | num_at, |
| int | num_bonds | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int bHeteroAtomMayHaveXchgIsoH | ( | inp_ATOM * | atom, |
| int | iat | ||
| ) |
Checks whether a hetero atom may have exchangeable isotopic hydrogens.
| atom | Pointer to atom list |
| iat | Atom number |
Here is the call graph for this function:
Here is the caller graph for this function:
Here is the caller graph for this function:| int bIsMetalSalt | ( | inp_ATOM * | at, |
| int | i | ||
| ) |
Check if atom is a metal salt.
| at | Pointer to atom array |
| i | atom index |
Here is the call graph for this function:
Here is the caller graph for this function:| int bIsMetalToDisconnect | ( | inp_ATOM * | at, |
| int | i, | ||
| int | bCheckMetalValence | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int bMayDisconnectMetals | ( | ORIG_ATOM_DATA * | orig_inp_data, |
| int | bCheckMetalValence, | ||
| INCHI_MODE * | bTautFlagsDone | ||
| ) |
Check if metals may be disconnected in the original atom data.
| orig_inp_data | Pointer to original atom data structure |
| bCheckMetalValence | Flag indicating whether to check metal valence |
| bTautFlagsDone | Pointer to tautomeric flags done |
Here is the call graph for this function:
Here is the caller graph for this function:| int bNumHeterAtomHasIsotopicH | ( | inp_ATOM * | atom, |
| int | num_atoms | ||
| ) |
Check if hetero atoms has isotopic hydrogens.
| atom | Pointer to atom array |
| num_atoms | Number of atoms |
Here is the call graph for this function:
Here is the caller graph for this function:| int cmp_components | ( | const void * | a1, |
| const void * | a2 | ||
| ) |
Here is the caller graph for this function:| int cmp_iso_atw_diff_component_no | ( | const void * | a1, |
| const void * | a2 | ||
| ) |
Here is the caller graph for this function:| void CompAtomData_GetNumMapping | ( | COMP_ATOM_DATA * | adata, |
| int * | orig_num, | ||
| int * | curr_num | ||
| ) |
Here is the caller graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:
Here is the call graph for this function:
Here is the caller graph for this function:| int DisconnectMetals | ( | ORIG_ATOM_DATA * | orig_inp_data, |
| int | bCheckMetalValence, | ||
| INCHI_MODE * | bTautFlagsDone | ||
| ) |
Disconnect metals in the original atom data.
| orig_inp_data | Pointer to original atom data structure |
| bCheckMetalValence | Flag indicating whether to check metal valence |
| bTautFlagsDone | Pointer to tautomeric flags done |
Here is the call graph for this function:
Here is the caller graph for this function:| int DisconnectMetalSalt | ( | inp_ATOM * | at, |
| int | i | ||
| ) |
Here is the caller graph for this function:| int DisconnectOneLigand | ( | inp_ATOM * | at, |
| AT_NUMB * | nOldCompNumber, | ||
| S_CHAR * | bMetal, | ||
| char * | elnumber_Heteroat, | ||
| int | num_halogens, | ||
| int | num_atoms, | ||
| int | iMetal, | ||
| int | jLigand, | ||
| INCHI_MODE * | bTautFlagsDone | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int DisconnectSalts | ( | ORIG_ATOM_DATA * | orig_inp_data, |
| int | bDisconnect | ||
| ) |
Disconnect salts in the original atom data.
| orig_inp_data | Pointer to original atom data structure |
| bDisconnect | Flag indicating whether to disconnect salts |
Here is the call graph for this function:
Here is the caller graph for this function:| double dist_from_segm | ( | double | x, |
| double | y, | ||
| double | x1, | ||
| double | y1, | ||
| double | x2, | ||
| double | y2 | ||
| ) |
| int ExtractConnectedComponent | ( | inp_ATOM * | at, |
| int | num_at, | ||
| int | component_number, | ||
| inp_ATOM * | component_at | ||
| ) |
Extract one (connected) component.
| at | Pointer to atom array |
| num_at | Number of atoms |
| component_number | Component number |
| component_at | Pointer to component atom array |
Here is the caller graph for this function:| int fix_non_uniform_drawn_amidiniums | ( | int | num_atoms, |
| inp_ATOM * | at, | ||
| int * | num_changes | ||
| ) |
Here is the caller graph for this function:| int fix_non_uniform_drawn_oxoanions | ( | int | num_atoms, |
| inp_ATOM * | at, | ||
| int * | num_changes | ||
| ) |
Here is the caller graph for this function:| int fix_odd_things | ( | int | num_atoms, |
| inp_ATOM * | at, | ||
| int | bFixBug, | ||
| int | bFixNonUniformDraw | ||
| ) |
Fix odd things in the input atoms.
| num_atoms | Number of input atoms |
| at | Array of input atoms |
| bFixBug | Flag indicating whether to fix bugs |
| bFixNonUniformDraw | Flag indicating whether to fix non-uniform drawing |
Here is the call graph for this function:
Here is the caller graph for this function:| int Free_INChI | ( | INChI ** | ppINChI | ) |
Free INChI data structure.
| ppINChI | Pointer to INChI data structure |
Here is the call graph for this function:
Here is the caller graph for this function:| int Free_INChI_Aux | ( | INChI_Aux ** | ppINChI_Aux | ) |
Free INChI_Aux data structure.
| ppINChI_Aux | Pointer to INChI_Aux data structure |
Here is the caller graph for this function:| int Free_INChI_Members | ( | INChI * | pINChI | ) |
Free INChI members.
| pINChI | Pointer to INChI data structure |
Here is the call graph for this function:
Here is the caller graph for this function:| int Free_INChI_Stereo | ( | INChI_Stereo * | pINChI_Stereo | ) |
Free INChI_Stereo data structure.
| pINChI_Stereo | Pointer to INChI_Stereo |
Here is the caller graph for this function:| int get_iat_number | ( | int | el_number | ) |
Here is the caller graph for this function:| double GetMinDistDistribution | ( | inp_ATOM * | at, |
| int | num_at, | ||
| int | iat, | ||
| int | iat_H, | ||
| int | bInAllComponents, | ||
| double | min_dist[], | ||
| int | num_segm | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| void imat_free | ( | int | m, |
| int ** | a | ||
| ) |
Free integer matrix.
| m | Size of matrix |
| a | Pointer to matrix |
Here is the caller graph for this function:| int imat_new | ( | int | m, |
| int | n, | ||
| int *** | a | ||
| ) |
Allocate integer matrix.
| m | Size of matrix |
| n | Size of matrix |
| a | Pointer to matrix |
Here is the call graph for this function:
Here is the caller graph for this function:| int insertions_sort_AT_RANK | ( | AT_RANK * | base, |
| int | num | ||
| ) |
Here is the caller graph for this function:| int MarkDisconnectedComponents | ( | ORIG_ATOM_DATA * | orig_at_data, |
| int | bProcessOldCompNumbers | ||
| ) |
Mark disconnected components in the original atom data.
| orig_at_data | Pointer to original atom data structure |
| bProcessOldCompNumbers | Flag indicating whether to process old component numbers |
Here is the call graph for this function:
Here is the caller graph for this function:| int max_unsat | ( | int | unsat[] | ) |
| int move_explicit_Hcation | ( | inp_ATOM * | at, |
| int | num_at, | ||
| int | iat, | ||
| int | iat_H, | ||
| int | bInAllComponents | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int nFindOneOM | ( | inp_ATOM * | at, |
| int | at_no, | ||
| int | ord_OM[], | ||
| int | num_OM | ||
| ) |
Here is the caller graph for this function:| int post_fix_odd_things | ( | int | num_atoms, |
| inp_ATOM * | at | ||
| ) |
Post-fix odd things in the input atoms (does nothing, returns 0)
| num_atoms | Number of input atoms |
| at | Array of input atoms |
Here is the caller graph for this function:| void PrintFileName | ( | const char * | fmt, |
| FILE * | out_file, | ||
| const char * | szFname | ||
| ) |
Print the file name.
| fmt | Format string |
| out_file | Output file pointer |
| szFname | File name string |
Here is the call graph for this function:
Here is the caller graph for this function:| int remove_ion_pairs | ( | int | num_atoms, |
| inp_ATOM * | at | ||
| ) |
Remove ion pairs from the input atoms.
| num_atoms | Number of input atoms |
| at | Array of input atoms |
Here is the call graph for this function:
Here is the caller graph for this function:| int remove_terminal_HDT | ( | int | num_atoms, |
| inp_ATOM * | at, | ||
| int | bFixTermHChrg | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int RemoveInpAtBond | ( | inp_ATOM * | at, |
| int | iat, | ||
| int | k | ||
| ) |
Here is the call graph for this function:
Here is the caller graph for this function:| int segments_intersect | ( | double | x11, |
| double | y11, | ||
| double | x12, | ||
| double | y12, | ||
| double | x21, | ||
| double | y21, | ||
| double | x22, | ||
| double | y22 | ||
| ) |
| int SetConnectedComponentNumber | ( | inp_ATOM * | at, |
| int | num_at, | ||
| int | component_number | ||
| ) |
Set the Connected Component Number object.
| at | Pointer to atom array |
| num_at | Number of atoms |
| component_number | Component number |
Here is the caller graph for this function:| void subgraf_debug_trace | ( | subgraf * | sg | ) |
Debug graph data structure.
| sg | Pointer to graph |
| void subgraf_free | ( | subgraf * | sg | ) |
Free graph data structure.
| sg | Pointer to graph |
Here is the caller graph for this function:| subgraf * subgraf_new | ( | ORIG_ATOM_DATA * | orig_inp_data, |
| int | nnodes, | ||
| int * | nodes | ||
| ) |
Create graph from atom data.
| orig_inp_data | Pointer to original atom data |
| nnodes | Number of nodes |
| nodes | Pointer to nodes |
Here is the call graph for this function:
Here is the caller graph for this function:| int subgraf_pathfinder_collect_all | ( | subgraf_pathfinder * | spf, |
| int | nforbidden, | ||
| int * | forbidden, | ||
| int * | atnums | ||
| ) |
Collects atom numbers along path.
| spf | Pointer to graph pathfinder data structure |
| nforbidden | Number of edges forbidden for traversal |
| forbidden | Pointer to forbidden edges |
| atnums | Pointer to atom numbers |
Here is the call graph for this function:
Here is the caller graph for this function:| void subgraf_pathfinder_free | ( | subgraf_pathfinder * | spf | ) |
Frees subgraph pathfinder data structure.
| spf | Pointer to graph pathfinder data structure |
Here is the caller graph for this function:| subgraf_pathfinder * subgraf_pathfinder_new | ( | subgraf * | sg, |
| ORIG_ATOM_DATA * | orig_inp_data, | ||
| int | start, | ||
| int | end | ||
| ) |
Allocate new graph pathfinder data structure.
| sg | Pointer to graph |
| orig_inp_data | Pointer to original atom data |
| start | Starting node |
| end | End node |
Here is the caller graph for this function:| void subgraf_pathfinder_run | ( | subgraf_pathfinder * | spf, |
| int | nforbidden, | ||
| int * | forbidden_orig, | ||
| int * | nbonds, | ||
| int ** | bonds, | ||
| int * | natoms, | ||
| int * | atoms | ||
| ) |
Find path(s) from subgraf node spf->start to spf->end and fill bonds[nbonds] and atoms[natoms]. Does not traverse through supplied forbidden edges (if not zero/NULL)
| spf | Pointer to graph pathfinder data structure |
| nforbidden | Number of forbidden edges |
| forbidden_orig | Pointer forbidden edges |
| nbonds | Number of bonds |
| bonds | Pointer to bonds |
| natoms | Number of atoms |
| atoms | Pointer to atoms |
Here is the call graph for this function:
Here is the caller graph for this function:| int the_only_doublet_neigh | ( | inp_ATOM * | at, |
| int | i1, | ||
| int * | ineigh1, | ||
| int * | ineigh2 | ||
| ) |
Here is the caller graph for this function:| int tot_unsat | ( | int | unsat[] | ) |