InChI
 
Loading...
Searching...
No Matches
strutil.c File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdbool.h>
#include <limits.h>
#include "mode.h"
#include "ichinorm.h"
#include "strutil.h"
#include "ichister.h"
#include "ichi_io.h"
#include "ichimain.h"
#include "ichidrp.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
 
#define NUM_ELEMENTS   118 /* Adjust according to the number of elements in the array */
 

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)
 
static int is_only_HDT_neighbors (const inp_ATOM *at, int num_atoms, int metal_idx)
 
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 getElValenceforMolecularInorganics (int nPeriodicNum, int charge, int val_num)
 
int getElTypeforMolecularInorganics (int nPeriodicNum)
 
int MolecularInorganicsIsMetalToDisconnect (inp_ATOM *at, int atom_idx)
 
int shouldBondBeCut (int atom1, int atom2)
 
void updateNeighborListMolecularInorganics (inp_ATOM *at, int atom_idx, int neighbor_idx)
 
int MolecularInorganicsPreprocessing (ORIG_ATOM_DATA *orig_at_data, INPUT_PARMS *ip)
 
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 get_canonical_atom_number (const INChI_Aux *aux, int orig_atom_num)
 Get the canonical atom number from original atom number.
 
int get_parity_idx_from_canonical_atom_number (int canon_atom_num, const AT_NUMB *nNumber, int nof_atoms)
 Get the parity idx from canonical atom number object.
 
int invert_parities (const INChI *inchi, const INChI_Aux *aux, int **list_atoms, int nof_lists, int is_absolute)
 Invert the parities for enhanced stereochemistry t- and m-layers.
 
int set_EnhancedStereo_t_m_layers (const ORIG_ATOM_DATA *orig_inp_data, const INChI *inchi, const INChI_Aux *aux)
 Set the enhanced stereochemistry information for t- and m-layers.
 
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.
 
INChIAlloc_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_AuxAlloc_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.
 
subgrafsubgraf_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_pathfindersubgraf_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.
 

Variables

const MolecularInorganicsElData MolecularInorganicsArray []
 
ElementsMolecularInorganics elementListMolecularInorganics [NUM_ELEMENTS]
 
const int binaryArrayMolecularInorganics [NUM_ELEMENTS][NUM_ELEMENTS]
 

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_ELEMENTS

#define NUM_ELEMENTS   118 /* Adjust according to the number of elements in the array */

◆ 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 
)

Allocate INChI data structure.

Parameters
atPointer to atom array
num_atNumber of atoms
found_num_bondsPointer to number of bonds
found_num_isotopicPointer to number of isotopic atoms
nAllocModeAllocation mode
Returns
INChI* Pointer to allocated INChI
+ 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  bOrigData 
)

Allocate AuxInfo data structure.

Parameters
num_atNumber of atoms
num_isotopic_atomsNumber of isotopic atoms
nAllocModeAllocation mode
bOrigDataFlag indicating if the atom data is original
Returns
INChI_Aux* Pointer to allocated INChI_Aux or NULL if failed
+ 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 
)

Checks whether a hetero atom may have exchangeable isotopic hydrogens.

Parameters
atomPointer to atom list
iatAtom number
Returns
int 2 if atom is hydrogen (?) ,1 if yes, 0 if no
+ 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 
)

Check if atom is a metal salt.

Parameters
atPointer to atom array
iatom index
Returns
int 1 if metal salt, 0 if not
+ 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 
)

Check if metals may be disconnected in the original atom data.

Parameters
orig_inp_dataPointer to original atom data structure
bCheckMetalValenceFlag indicating whether to check metal valence
bTautFlagsDonePointer to tautomeric flags done
Returns
int Status code
+ 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 
)

Check if hetero atoms has isotopic hydrogens.

Parameters
atomPointer to atom array
num_atomsNumber of atoms
Returns
int 2 if isotopic atoms, 1 if isotopic hydrogens, 0 if not
+ 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 
)

Disconnect metals in the original atom data.

Parameters
orig_inp_dataPointer to original atom data structure
bCheckMetalValenceFlag indicating whether to check metal valence
bTautFlagsDonePointer to tautomeric flags done
Returns
int Status code
+ 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 
)

Disconnect salts in the original atom data.

Parameters
orig_inp_dataPointer to original atom data structure
bDisconnectFlag indicating whether to disconnect salts
Returns
int Status code
+ 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 
)

Extract one (connected) component.

Parameters
atPointer to atom array
num_atNumber of atoms
component_numberComponent number
component_atPointer to component atom array
Returns
int Number of extracted atoms
+ 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 
)

Fix odd things in the input atoms.

Parameters
num_atomsNumber of input atoms
atArray of input atoms
bFixBugFlag indicating whether to fix bugs
bFixNonUniformDrawFlag indicating whether to fix non-uniform drawing
Returns
int Status code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Free_INChI()

int Free_INChI ( INChI **  ppINChI)

Free INChI data structure.

Parameters
ppINChIPointer to INChI data structure
Returns
int Returns 0
+ 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)

Free INChI_Aux data structure.

Parameters
ppINChI_AuxPointer to INChI_Aux data structure
Returns
int Returns 0
+ Here is the caller graph for this function:

◆ Free_INChI_Members()

int Free_INChI_Members ( INChI pINChI)

Free INChI members.

Parameters
pINChIPointer to INChI data structure
Returns
int Returns 0
+ 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)

Free INChI_Stereo data structure.

Parameters
pINChI_StereoPointer to INChI_Stereo
Returns
int Returns 0
+ Here is the caller graph for this function:

◆ get_canonical_atom_number()

int get_canonical_atom_number ( const INChI_Aux aux,
int  orig_atom_num 
)

Get the canonical atom number from original atom number.

Get the canonical atom number object.

Parameters
auxPointer to INChI auxiliary data
orig_atom_numOriginal atom number
Returns
Returns the canonical atom number, or -1 if not found
+ 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:

◆ get_parity_idx_from_canonical_atom_number()

int get_parity_idx_from_canonical_atom_number ( int  canon_atom_num,
const AT_NUMB nNumber,
int  nof_atoms 
)

Get the parity idx from canonical atom number object.

Get the parity index from canonical atom number.

Parameters
canon_atom_numCanonical atom number
nNumberPointer to array of canonical atom numbers
nof_atomsNumber of atoms
Returns
Returns the parity index, or -1 if not found
+ Here is the caller graph for this function:

◆ getElTypeforMolecularInorganics()

int getElTypeforMolecularInorganics ( int  nPeriodicNum)
+ Here is the caller graph for this function:

◆ getElValenceforMolecularInorganics()

int getElValenceforMolecularInorganics ( int  nPeriodicNum,
int  charge,
int  val_num 
)
+ 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 
)

Free integer matrix.

Parameters
mSize of matrix
aPointer to matrix
+ Here is the caller graph for this function:

◆ imat_new()

int imat_new ( int  m,
int  n,
int ***  a 
)

Allocate integer matrix.

Parameters
mSize of matrix
nSize of matrix
aPointer to matrix
Returns
int 1 if success, 0 if failure
+ 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:

◆ invert_parities()

int invert_parities ( const INChI inchi,
const INChI_Aux aux,
int **  list_atoms,
int  nof_lists,
int  is_absolute 
)

Invert the parities for enhanced stereochemistry t- and m-layers.

Parameters
inchiPointer to INChI structure
auxPointer to INChI auxiliary data
list_atomsPointer to list of atom lists for abs, rel or rac information
nof_listsNumber of lists
is_absoluteFlag indicating if processing absolute stereochemistry
Returns
Returns 0 on success, 1 if list_atoms is NULL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_only_HDT_neighbors()

static int is_only_HDT_neighbors ( const inp_ATOM at,
int  num_atoms,
int  metal_idx 
)
static
+ Here is the caller graph for this function:

◆ MarkDisconnectedComponents()

int MarkDisconnectedComponents ( ORIG_ATOM_DATA orig_at_data,
int  bProcessOldCompNumbers 
)

Mark disconnected components in the original atom data.

Parameters
orig_at_dataPointer to original atom data structure
bProcessOldCompNumbersFlag indicating whether to process old component numbers
Returns
int Status code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ max_unsat()

int max_unsat ( int  unsat[])

◆ MolecularInorganicsIsMetalToDisconnect()

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

◆ MolecularInorganicsPreprocessing()

int MolecularInorganicsPreprocessing ( ORIG_ATOM_DATA orig_at_data,
INPUT_PARMS ip 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 
)

Post-fix odd things in the input atoms (does nothing, returns 0)

Parameters
num_atomsNumber of input atoms
atArray of input atoms
Returns
int Status code
+ Here is the caller graph for this function:

◆ PrintFileName()

void PrintFileName ( const char *  fmt,
FILE *  out_file,
const char *  szFname 
)

Print the file name.

Parameters
fmtFormat string
out_fileOutput file pointer
szFnameFile name string
+ 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 
)

Remove ion pairs from the input atoms.

Parameters
num_atomsNumber of input atoms
atArray of input atoms
Returns
int Status code
+ 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 
)

◆ set_EnhancedStereo_t_m_layers()

int set_EnhancedStereo_t_m_layers ( const ORIG_ATOM_DATA orig_inp_data,
const INChI inchi,
const INChI_Aux aux 
)

Set the enhanced stereochemistry information for t- and m-layers.

Set the enhanced stereochemistry for t- and m-layers.

Parameters
orig_inp_dataPointer to original input atom data
inchiPointer to INChI structure
auxPointer to INChI auxiliary data
Returns
Retruns 1 if not V3000, otherwise 0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetConnectedComponentNumber()

int SetConnectedComponentNumber ( inp_ATOM at,
int  num_at,
int  component_number 
)

Set the Connected Component Number object.

Parameters
atPointer to atom array
num_atNumber of atoms
component_numberComponent number
Returns
int Returns 0
+ Here is the caller graph for this function:

◆ shouldBondBeCut()

int shouldBondBeCut ( int  atom1,
int  atom2 
)
+ Here is the caller graph for this function:

◆ subgraf_debug_trace()

void subgraf_debug_trace ( subgraf sg)

Debug graph data structure.

Parameters
sgPointer to graph

◆ subgraf_free()

void subgraf_free ( subgraf sg)

Free graph data structure.

Parameters
sgPointer to graph
Returns
void Returns NULL (?)
+ Here is the caller graph for this function:

◆ subgraf_new()

subgraf * subgraf_new ( ORIG_ATOM_DATA orig_inp_data,
int  nnodes,
int *  nodes 
)

Create graph from atom data.

Parameters
orig_inp_dataPointer to original atom data
nnodesNumber of nodes
nodesPointer to nodes
Returns
subgraf* NULL if error, a new graph otherwise
+ 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 
)

Collects atom numbers along path.

Parameters
spfPointer to graph pathfinder data structure
nforbiddenNumber of edges forbidden for traversal
forbiddenPointer to forbidden edges
atnumsPointer to atom numbers
Returns
* int
+ 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)

Frees subgraph pathfinder data structure.

Parameters
spfPointer to graph pathfinder data structure
Returns
* void
+ 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 
)

Allocate new graph pathfinder data structure.

Parameters
sgPointer to graph
orig_inp_dataPointer to original atom data
startStarting node
endEnd node
Returns
subgraf_pathfinder* Returns pointer to graph pathfinder data structure
+ Here is the caller graph for this function:

◆ subgraf_pathfinder_run()

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)

Parameters
spfPointer to graph pathfinder data structure
nforbiddenNumber of forbidden edges
forbidden_origPointer forbidden edges
nbondsNumber of bonds
bondsPointer to bonds
natomsNumber of atoms
atomsPointer to 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[])

◆ updateNeighborListMolecularInorganics()

void updateNeighborListMolecularInorganics ( inp_ATOM at,
int  atom_idx,
int  neighbor_idx 
)
+ Here is the caller graph for this function:

Variable Documentation

◆ binaryArrayMolecularInorganics

const int binaryArrayMolecularInorganics[NUM_ELEMENTS][NUM_ELEMENTS]

◆ elementListMolecularInorganics

ElementsMolecularInorganics elementListMolecularInorganics[NUM_ELEMENTS]
Initial value:
=
{
{1, "H"}, {2, "He"}, {3, "Li"}, {4, "Be"}, {5, "B"}, {6, "C"}, {7, "N"}, {8, "O"}, {9, "F"}, {10, "Ne"}, {11, "Na"}, {12, "Mg"}, {13, "Al"}, {14, "Si"}, {15, "P"}, {16, "S"}, {17, "Cl"}, {18, "Ar"}, {19, "K"}, {20, "Ca"}, {21, "Sc"}, {22, "Ti"}, {23, "V"}, {24, "Cr"}, {25, "Mn"}, {26, "Fe"}, {27, "Co"}, {28, "Ni"}, {29, "Cu"}, {30, "Zn"}, {31, "Ga"}, {32, "Ge"}, {33, "As"}, {34, "Se"}, {35, "Br"}, {36, "Kr"}, {37, "Rb"}, {38, "Sr"}, {39, "Y"}, {40, "Zr"}, {41, "Nb"}, {42, "Mo"}, {43, "Tc"}, {44, "Ru"}, {45, "Rh"}, {46, "Pd"}, {47, "Ag"}, {48, "Cd"}, {49, "In"}, {50, "Sn"}, {51, "Sb"}, {52, "Te"}, {53, "I"}, {54, "Xe"}, {55, "Cs"}, {56, "Ba"}, {57, "La"}, {58, "Ce"}, {59, "Pr"}, {60, "Nd"}, {61, "Pm"}, {62, "Sm"}, {63, "Eu"}, {64, "Gd"}, {65, "Tb"}, {66, "Dy"}, {67, "Ho"}, {68, "Er"}, {69, "Tm"}, {70, "Yb"}, {71, "Lu"}, {72, "Hf"}, {73, "Ta"}, {74, "W"}, {75, "Re"}, {76, "Os"}, {77, "Ir"}, {78, "Pt"}, {79, "Au"}, {80, "Hg"}, {81, "Tl"}, {82, "Pb"}, {83, "Bi"}, {84, "Po"}, {85, "At"}, {86, "Rn"}, {87, "Fr"}, {88, "Ra"}, {89, "Ac"}, {90, "Th"}, {91, "Pa"}, {92, "U"}, {93, "Np"}, {94, "Pu"}, {95, "Am"}, {96, "Cm"}, {97, "Bk"}, {98, "Cf"}, {99, "Es"}, {100, "Fm"}, {101, "Md"}, {102, "No"}, {103, "Lr"}, {104, "Rf"}, {105, "Db"}, {106, "Sg"}, {107, "Bh"}, {108, "Hs"}, {109, "Mt"}, {110, "Ds"}, {111, "Rg"}, {112, "Cn"}, {113, "Nh"}, {114, "Fl"}, {115, "Mc"}, {116, "Lv"}, {117, "Ts"}, {118, "Og"}}

◆ MolecularInorganicsArray

const MolecularInorganicsElData MolecularInorganicsArray[]