InChI
 
Loading...
Searching...
No Matches
ichicano.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <sys/timeb.h>
#include <limits.h>
#include "mode.h"
#include "ichicano.h"
#include "ichitime.h"
#include "ichi.h"
#include "ichicomn.h"
#include "bcf_s.h"
+ Include dependency graph for ichicano.c:

Macros

#define tsort   insertions_sort
 
#define INCHI_MSEC(X)   (long)((1000.0/(double)CLOCKS_PER_SEC)*(X))
 
#define INCHI_CLOCK_T(X)   (clock_t)( (double)(X) / 1000.0 * (double)CLOCKS_PER_SEC )
 
#define LOCAL_FREE(X)   do{if(X){inchi_free( X); X=NULL;}}while(0)
 
#define pCS_CALLOC(PTR, TYPE, LEN)   (pCS->PTR=(TYPE*)inchi_calloc( (size_t)(LEN),sizeof(*pCS->PTR)))
 
#define COMPARE_WITH_CT(CT, CTLEN, VALUE, CONDITION)
 
#define COMPARE_WITH_CTVAL(CTVAL, VALUE, CONDITION)
 
#define COMPARE_WITH_CT2(CT, CTLEN, VALUE, CONDITION, OPER)
 

Functions

void FillOutAtomInvariant (sp_ATOM *at, int num_atoms, int num_at_tg, ATOM_INVARIANT *pAtomInvariant, CANON_STAT *pCS)
 
int Canon_INChI1 (int num_atoms, int num_at_tg, sp_ATOM *at, CANON_STAT *pCS, INCHI_MODE nMode)
 
int Canon_INChI2 (int num_atoms, int num_at_tg, sp_ATOM *at, CANON_STAT *pCS, INCHI_MODE nMode)
 
int Canon_INChI3 (INCHI_CLOCK *ic, int num_atoms, int num_at_tg, sp_ATOM *at, CANON_STAT *pCS, CANON_GLOBALS *pCG, INCHI_MODE nMode, int bTautFtcn)
 
static clock_t InchiClock (void)
 
static void FillMaxMinClock (INCHI_CLOCK *ic)
 
void InchiTimeGet (inchiTime *TickEnd)
 
long InchiTimeMsecDiff (INCHI_CLOCK *ic, inchiTime *TickEnd, inchiTime *TickStart)
 
long InchiTimeElapsed (INCHI_CLOCK *ic, inchiTime *TickStart)
 
void InchiTimeAddMsec (INCHI_CLOCK *ic, inchiTime *TickEnd, unsigned long nNumMsec)
 
int bInchiTimeIsOver (INCHI_CLOCK *ic, inchiTime *TickStart)
 
int GetCanonLengths (int num_at, sp_ATOM *at, ATOM_SIZES *s, T_GROUP_INFO *t_group_info)
 
int DeAllocateCS (CANON_STAT *pCS)
 
int AllocateCS (CANON_STAT *pCS, int num_at, int num_at_tg, int nLenCT, int nLenCTAtOnly, int nLenLinearCTStereoDble, int nLenLinearCTIsotopicStereoDble, int nLenLinearCTStereoCarb, int nLenLinearCTIsotopicStereoCarb, int nLenLinearCTTautomer, int nLenLinearCTIsotopicTautomer, int nLenIsotopic, INCHI_MODE nMode, BCN *pBCN)
 
int FillIsotopicAtLinearCT (int num_atoms, sp_ATOM *at, const AT_RANK *nAtomNumber, AT_ISOTOPIC *LinearCTIsotopic, int nMaxLenLinearCTIsotopic, int *pnLenLinearCTIsotopic)
 
int FillTautLinearCT2 (CANON_GLOBALS *pCG, int num_atoms, int num_at_tg, int bIsoTaut, const AT_RANK *nRank, const AT_RANK *nAtomNumber, const AT_RANK *nSymmRank, const AT_RANK *nRankIso, const AT_RANK *nAtomNumberIso, const AT_RANK *nSymmRankIso, AT_TAUTOMER *LinearCTTautomer, int nMaxLenLinearCTTautomer, int *pnLenLinearCTTautomer, AT_ISO_TGROUP *LinearCTIsotopicTautomer, int nMaxLenLinearCTIsotopicTautomer, int *pnLenLinearCTIsotopicTautomer, T_GROUP_INFO *t_group_info)
 
int UpdateFullLinearCT (int num_atoms, int num_at_tg, sp_ATOM *at, AT_RANK *nRank, AT_RANK *nAtomNumber, CANON_STAT *pCS, CANON_GLOBALS *pCG, int bFirstTime)
 
int FixCanonEquivalenceInfo (CANON_GLOBALS *pCG, int num_at_tg, AT_RANK *nSymmRank, AT_RANK *nCurrRank, AT_RANK *nTempRank, AT_NUMB *nAtomNumber, int *bChanged)
 
int Canon_INChI (INCHI_CLOCK *ic, int num_atoms, int num_at_tg, sp_ATOM *at, CANON_STAT *pCS, CANON_GLOBALS *pCG, INCHI_MODE nMode, int bTautFtcn)
 

Variables

const clock_t FullMaxClock = (clock_t) ( -1 )
 
const clock_t HalfMaxClock = (clock_t) ( -1 ) / 2
 

Macro Definition Documentation

◆ COMPARE_WITH_CT

#define COMPARE_WITH_CT (   CT,
  CTLEN,
  VALUE,
  CONDITION 
)
Value:
if ( CONDITION ) { \
if ( (VALUE) CT_GREATER_THAN (CT)[CTLEN] ) \
return 1; /* not a minimal CT */ \
(CONDITION) = (VALUE) == (CT)[CTLEN]; \
} \
(CT)[CTLEN] = VALUE; \
(CTLEN)++
#define CT_GREATER_THAN
Definition mode.h:838

◆ COMPARE_WITH_CT2

#define COMPARE_WITH_CT2 (   CT,
  CTLEN,
  VALUE,
  CONDITION,
  OPER 
)
Value:
if ( CONDITION ) { \
if ( (VALUE) CT_GREATER_THAN (CT)[CTLEN] ) { \
(OPER); \
return 1; /* not a minimal CT */ \
} \
(CONDITION) = (VALUE) == (CT)[CTLEN]; \
} \
(CT)[CTLEN] = VALUE; \
(CTLEN)++

◆ COMPARE_WITH_CTVAL

#define COMPARE_WITH_CTVAL (   CTVAL,
  VALUE,
  CONDITION 
)
Value:
if ( CONDITION ) { \
if ( (VALUE) CT_GREATER_THAN (CTVAL) ) \
return 1; /* not a minimal CT */ \
(CONDITION) = (VALUE) == (CTVAL); \
} \
(CTVAL) = VALUE

◆ INCHI_CLOCK_T

#define INCHI_CLOCK_T (   X)    (clock_t)( (double)(X) / 1000.0 * (double)CLOCKS_PER_SEC )

◆ INCHI_MSEC

#define INCHI_MSEC (   X)    (long)((1000.0/(double)CLOCKS_PER_SEC)*(X))

◆ LOCAL_FREE

#define LOCAL_FREE (   X)    do{if(X){inchi_free( X); X=NULL;}}while(0)

◆ pCS_CALLOC

#define pCS_CALLOC (   PTR,
  TYPE,
  LEN 
)    (pCS->PTR=(TYPE*)inchi_calloc( (size_t)(LEN),sizeof(*pCS->PTR)))

◆ tsort

#define tsort   insertions_sort

Function Documentation

◆ AllocateCS()

int AllocateCS ( CANON_STAT pCS,
int  num_at,
int  num_at_tg,
int  nLenCT,
int  nLenCTAtOnly,
int  nLenLinearCTStereoDble,
int  nLenLinearCTIsotopicStereoDble,
int  nLenLinearCTStereoCarb,
int  nLenLinearCTIsotopicStereoCarb,
int  nLenLinearCTTautomer,
int  nLenLinearCTIsotopicTautomer,
int  nLenIsotopic,
INCHI_MODE  nMode,
BCN pBCN 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bInchiTimeIsOver()

int bInchiTimeIsOver ( INCHI_CLOCK ic,
inchiTime TickStart 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Canon_INChI()

int Canon_INChI ( INCHI_CLOCK ic,
int  num_atoms,
int  num_at_tg,
sp_ATOM at,
CANON_STAT pCS,
CANON_GLOBALS pCG,
INCHI_MODE  nMode,
int  bTautFtcn 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Canon_INChI1()

int Canon_INChI1 ( int  num_atoms,
int  num_at_tg,
sp_ATOM at,
CANON_STAT pCS,
INCHI_MODE  nMode 
)

◆ Canon_INChI2()

int Canon_INChI2 ( int  num_atoms,
int  num_at_tg,
sp_ATOM at,
CANON_STAT pCS,
INCHI_MODE  nMode 
)

◆ Canon_INChI3()

int Canon_INChI3 ( INCHI_CLOCK ic,
int  num_atoms,
int  num_at_tg,
sp_ATOM at,
CANON_STAT pCS,
CANON_GLOBALS pCG,
INCHI_MODE  nMode,
int  bTautFtcn 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeAllocateCS()

int DeAllocateCS ( CANON_STAT pCS)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillIsotopicAtLinearCT()

int FillIsotopicAtLinearCT ( int  num_atoms,
sp_ATOM at,
const AT_RANK nAtomNumber,
AT_ISOTOPIC LinearCTIsotopic,
int  nMaxLenLinearCTIsotopic,
int *  pnLenLinearCTIsotopic 
)
+ Here is the caller graph for this function:

◆ FillMaxMinClock()

static void FillMaxMinClock ( INCHI_CLOCK ic)
static
+ Here is the caller graph for this function:

◆ FillOutAtomInvariant()

void FillOutAtomInvariant ( sp_ATOM at,
int  num_atoms,
int  num_at_tg,
ATOM_INVARIANT pAtomInvariant,
CANON_STAT pCS 
)

◆ FillTautLinearCT2()

int FillTautLinearCT2 ( CANON_GLOBALS pCG,
int  num_atoms,
int  num_at_tg,
int  bIsoTaut,
const AT_RANK nRank,
const AT_RANK nAtomNumber,
const AT_RANK nSymmRank,
const AT_RANK nRankIso,
const AT_RANK nAtomNumberIso,
const AT_RANK nSymmRankIso,
AT_TAUTOMER LinearCTTautomer,
int  nMaxLenLinearCTTautomer,
int *  pnLenLinearCTTautomer,
AT_ISO_TGROUP LinearCTIsotopicTautomer,
int  nMaxLenLinearCTIsotopicTautomer,
int *  pnLenLinearCTIsotopicTautomer,
T_GROUP_INFO t_group_info 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FixCanonEquivalenceInfo()

int FixCanonEquivalenceInfo ( CANON_GLOBALS pCG,
int  num_at_tg,
AT_RANK nSymmRank,
AT_RANK nCurrRank,
AT_RANK nTempRank,
AT_NUMB nAtomNumber,
int *  bChanged 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCanonLengths()

int GetCanonLengths ( int  num_at,
sp_ATOM at,
ATOM_SIZES s,
T_GROUP_INFO t_group_info 
)
+ Here is the caller graph for this function:

◆ InchiClock()

static clock_t InchiClock ( void  )
static
+ Here is the caller graph for this function:

◆ InchiTimeAddMsec()

void InchiTimeAddMsec ( INCHI_CLOCK ic,
inchiTime TickEnd,
unsigned long  nNumMsec 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InchiTimeElapsed()

long InchiTimeElapsed ( INCHI_CLOCK ic,
inchiTime TickStart 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InchiTimeGet()

void InchiTimeGet ( inchiTime TickEnd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InchiTimeMsecDiff()

long InchiTimeMsecDiff ( INCHI_CLOCK ic,
inchiTime TickEnd,
inchiTime TickStart 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateFullLinearCT()

int UpdateFullLinearCT ( int  num_atoms,
int  num_at_tg,
sp_ATOM at,
AT_RANK nRank,
AT_RANK nAtomNumber,
CANON_STAT pCS,
CANON_GLOBALS pCG,
int  bFirstTime 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ FullMaxClock

const clock_t FullMaxClock = (clock_t) ( -1 )

◆ HalfMaxClock

const clock_t HalfMaxClock = (clock_t) ( -1 ) / 2