InChI
 
Loading...
Searching...
No Matches
strutil.c File Reference
#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_StereoAlloc_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)
 
int post_fix_odd_things (int num_atoms, inp_ATOM *at)
 
int remove_ion_pairs (int num_atoms, inp_ATOM *at)
 
int bIsMetalSalt (inp_ATOM *at, int i)
 
int DisconnectSalts (ORIG_ATOM_DATA *orig_inp_data, int bDisconnect)
 
int bMayDisconnectMetals (ORIG_ATOM_DATA *orig_inp_data, int bCheckMetalValence, INCHI_MODE *bTautFlagsDone)
 
int DisconnectMetals (ORIG_ATOM_DATA *orig_inp_data, int bCheckMetalValence, INCHI_MODE *bTautFlagsDone)
 
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)
 
int bNumHeterAtomHasIsotopicH (inp_ATOM *atom, int num_atoms)
 
int MarkDisconnectedComponents (ORIG_ATOM_DATA *orig_at_data, int bProcessOldCompNumbers)
 
int ExtractConnectedComponent (inp_ATOM *at, int num_at, int component_number, inp_ATOM *component_at)
 
int SetConnectedComponentNumber (inp_ATOM *at, int num_at, int component_number)
 
int Free_INChI_Stereo (INChI_Stereo *pINChI_Stereo)
 
int Free_INChI (INChI **ppINChI)
 
int Free_INChI_Members (INChI *pINChI)
 
INChIAlloc_INChI (inp_ATOM *at, int num_at, int *found_num_bonds, int *found_num_isotopic, int nAllocMode)
 
int Free_INChI_Aux (INChI_Aux **ppINChI_Aux)
 
INChI_AuxAlloc_INChI_Aux (int num_at, int num_isotopic_atoms, int nAllocMode, int bOrigCoord)
 
void CompAtomData_GetNumMapping (COMP_ATOM_DATA *adata, int *orig_num, int *curr_num)
 
int imat_new (int m, int n, int ***a)
 
void imat_free (int m, int **a)
 
subgrafsubgraf_new (ORIG_ATOM_DATA *orig_inp_data, int nnodes, int *nodes)
 
void subgraf_free (subgraf *sg)
 
void subgraf_debug_trace (subgraf *sg)
 
subgraf_pathfindersubgraf_pathfinder_new (subgraf *sg, ORIG_ATOM_DATA *orig_inp_data, int start, int end)
 
void subgraf_pathfinder_free (subgraf_pathfinder *spf)
 
void subgraf_pathfinder_run (subgraf_pathfinder *spf, int nforbidden, int *forbidden, int *nbonds, int **bonds, int *natoms, int *atoms)
 
int subgraf_pathfinder_collect_all (subgraf_pathfinder *spf, int nforbidden, int *forbidden, int *atnums)
 
void PrintFileName (const char *fmt, FILE *out_file, const char *szFname)
 

Macro Definition Documentation

◆ FIRST_CENTER2

#define FIRST_CENTER2   5

◆ FIRST_NEIGHB2

#define FIRST_NEIGHB2   4

◆ FIX_P_IV_Plus_O_Minus

#define FIX_P_IV_Plus_O_Minus

◆ MAX_BOND_LENGTH

#define MAX_BOND_LENGTH   (1.0e30)

◆ MAX_NEIGH

#define MAX_NEIGH   6

◆ MIN_BOND_LENGTH

#define MIN_BOND_LENGTH   (1.0e-6)

◆ MIN_BOND_LENGTH2

#define MIN_BOND_LENGTH2   (MIN_BOND_LENGTH*MIN_BOND_LENGTH)

◆ MIN_COS

#define MIN_COS   (1.0e-6)

◆ NUM_SEGM

#define NUM_SEGM   20

Typedef Documentation

◆ ION_ATOM_TYPE

◆ tre_ATOM

typedef struct tagTreeAtom tre_ATOM

Enumeration Type Documentation

◆ tagIonAtomType

Enumerator
IAT_H 
IAT_C 
IAT_N 
IAT_P 
IAT_O 
IAT_S 
IAT_Se 
IAT_Te 
IAT_F 
IAT_Cl 
IAT_Br 
IAT_I 
IAT_MAX 

Function Documentation

◆ add_bond_if_unseen()

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:

◆ add_DT_to_num_H()

int add_DT_to_num_H ( int  num_atoms,
inp_ATOM at 
)
+ Here is the caller graph for this function:

◆ Alloc_INChI()

INChI * Alloc_INChI ( inp_ATOM at,
int  num_at,
int *  found_num_bonds,
int *  found_num_isotopic,
int  nAllocMode 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Alloc_INChI_Aux()

INChI_Aux * Alloc_INChI_Aux ( int  num_at,
int  num_isotopic_atoms,
int  nAllocMode,
int  bOrigCoord 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Alloc_INChI_Stereo()

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:

◆ bHeteroAtomMayHaveXchgIsoH()

int bHeteroAtomMayHaveXchgIsoH ( inp_ATOM atom,
int  iat 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bIsAmmoniumSalt()

int bIsAmmoniumSalt ( inp_ATOM at,
int  i,
int *  piO,
int *  pk,
S_CHAR num_explicit_H 
)
+ Here is the caller graph for this function:

◆ bIsMetalSalt()

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

◆ bIsMetalToDisconnect()

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:

◆ bMayDisconnectMetals()

int bMayDisconnectMetals ( ORIG_ATOM_DATA orig_inp_data,
int  bCheckMetalValence,
INCHI_MODE bTautFlagsDone 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bNumHeterAtomHasIsotopicH()

int bNumHeterAtomHasIsotopicH ( inp_ATOM atom,
int  num_atoms 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cmp_components()

int cmp_components ( const void *  a1,
const void *  a2 
)
+ Here is the caller graph for this function:

◆ cmp_iso_atw_diff_component_no()

int cmp_iso_atw_diff_component_no ( const void *  a1,
const void *  a2 
)
+ Here is the caller graph for this function:

◆ CompAtomData_GetNumMapping()

void CompAtomData_GetNumMapping ( COMP_ATOM_DATA adata,
int *  orig_num,
int *  curr_num 
)
+ Here is the caller graph for this function:

◆ DisconnectAmmoniumSalt()

int DisconnectAmmoniumSalt ( inp_ATOM at,
int  i,
int  iO,
int  k,
S_CHAR num_explicit_H 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DisconnectInpAtBond()

int DisconnectInpAtBond ( inp_ATOM at,
AT_NUMB nOldCompNumber,
int  iat,
int  neigh_ord 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DisconnectMetals()

int DisconnectMetals ( ORIG_ATOM_DATA orig_inp_data,
int  bCheckMetalValence,
INCHI_MODE bTautFlagsDone 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DisconnectMetalSalt()

int DisconnectMetalSalt ( inp_ATOM at,
int  i 
)
+ Here is the caller graph for this function:

◆ DisconnectOneLigand()

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:

◆ DisconnectSalts()

int DisconnectSalts ( ORIG_ATOM_DATA orig_inp_data,
int  bDisconnect 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dist2D()

double dist2D ( inp_ATOM at1,
inp_ATOM at2 
)

◆ dist3D()

double dist3D ( inp_ATOM at1,
inp_ATOM at2 
)
+ Here is the caller graph for this function:

◆ dist_from_segm()

double dist_from_segm ( double  x,
double  y,
double  x1,
double  y1,
double  x2,
double  y2 
)

◆ ExtractConnectedComponent()

int ExtractConnectedComponent ( inp_ATOM at,
int  num_at,
int  component_number,
inp_ATOM component_at 
)
+ Here is the caller graph for this function:

◆ fix_non_uniform_drawn_amidiniums()

int fix_non_uniform_drawn_amidiniums ( int  num_atoms,
inp_ATOM at,
int *  num_changes 
)
+ Here is the caller graph for this function:

◆ fix_non_uniform_drawn_oxoanions()

int fix_non_uniform_drawn_oxoanions ( int  num_atoms,
inp_ATOM at,
int *  num_changes 
)
+ Here is the caller graph for this function:

◆ fix_odd_things()

int fix_odd_things ( int  num_atoms,
inp_ATOM at,
int  bFixBug,
int  bFixNonUniformDraw 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free_INChI()

int Free_INChI ( INChI **  ppINChI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free_INChI_Aux()

int Free_INChI_Aux ( INChI_Aux **  ppINChI_Aux)
+ Here is the caller graph for this function:

◆ Free_INChI_Members()

int Free_INChI_Members ( INChI pINChI)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free_INChI_Stereo()

int Free_INChI_Stereo ( INChI_Stereo pINChI_Stereo)
+ Here is the caller graph for this function:

◆ get_iat_number()

int get_iat_number ( int  el_number)
+ Here is the caller graph for this function:

◆ GetMinDistDistribution()

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:

◆ imat_free()

void imat_free ( int  m,
int **  a 
)
+ Here is the caller graph for this function:

◆ imat_new()

int imat_new ( int  m,
int  n,
int ***  a 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertions_sort_AT_RANK()

int insertions_sort_AT_RANK ( AT_RANK base,
int  num 
)
+ Here is the caller graph for this function:

◆ MarkDisconnectedComponents()

int MarkDisconnectedComponents ( ORIG_ATOM_DATA orig_at_data,
int  bProcessOldCompNumbers 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ max_unsat()

int max_unsat ( int  unsat[])

◆ move_explicit_Hcation()

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:

◆ nFindOneOM()

int nFindOneOM ( inp_ATOM at,
int  at_no,
int  ord_OM[],
int  num_OM 
)
+ Here is the caller graph for this function:

◆ post_fix_odd_things()

int post_fix_odd_things ( int  num_atoms,
inp_ATOM at 
)
+ Here is the caller graph for this function:

◆ PrintFileName()

void PrintFileName ( const char *  fmt,
FILE *  out_file,
const char *  szFname 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_ion_pairs()

int remove_ion_pairs ( int  num_atoms,
inp_ATOM at 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_terminal_HDT()

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:

◆ RemoveInpAtBond()

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:

◆ segments_intersect()

int segments_intersect ( double  x11,
double  y11,
double  x12,
double  y12,
double  x21,
double  y21,
double  x22,
double  y22 
)

◆ SetConnectedComponentNumber()

int SetConnectedComponentNumber ( inp_ATOM at,
int  num_at,
int  component_number 
)
+ Here is the caller graph for this function:

◆ subgraf_debug_trace()

void subgraf_debug_trace ( subgraf sg)

◆ subgraf_free()

void subgraf_free ( subgraf sg)
+ Here is the caller graph for this function:

◆ subgraf_new()

subgraf * subgraf_new ( ORIG_ATOM_DATA orig_inp_data,
int  nnodes,
int *  nodes 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_collect_all()

int subgraf_pathfinder_collect_all ( subgraf_pathfinder spf,
int  nforbidden,
int *  forbidden,
int *  atnums 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_free()

void subgraf_pathfinder_free ( subgraf_pathfinder spf)
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_new()

subgraf_pathfinder * subgraf_pathfinder_new ( subgraf sg,
ORIG_ATOM_DATA orig_inp_data,
int  start,
int  end 
)
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_run()

void subgraf_pathfinder_run ( subgraf_pathfinder spf,
int  nforbidden,
int *  forbidden,
int *  nbonds,
int **  bonds,
int *  natoms,
int *  atoms 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ the_only_doublet_neigh()

int the_only_doublet_neigh ( inp_ATOM at,
int  i1,
int *  ineigh1,
int *  ineigh2 
)
+ Here is the caller graph for this function:

◆ tot_unsat()

int tot_unsat ( int  unsat[])