third_party/inchi/INCHI_BASE/src/runichi3.c
void OAD_CollectBackboneBonds(ORIG_ATOM_DATA  *at_data,
                              int na, 
                              int *alist,
                              int end_atom1,
                              int end_atom2,
                              int *nbkbonds,
                              int **bkbonds,
                              int *err,
                              char *pStrErr )
{
    int start = 0, end = 0, dummy;
    subgraf *sg = NULL;
    subgraf_pathfinder *spf = NULL;
    /* Establish subgraph for na atoms of the alist */
    *nbkbonds = 0;
    sg = subgraf_new( at_data, na, alist );
    if (!sg)
    {
        TREAT_ERR( *err, 9037, "Not enough memory (polymers)" );
        /* unit->cyclizable = CLOSING_SRU_NOT_APPLICABLE; */
        return;
    }
    start = sg->orig2node[end_atom1]; 
    end = sg->orig2node[end_atom2];
#if 0
    if (start > end)
    {
        int tmp = end;
        end = start;
        start = tmp;
    }
#endif
    spf = subgraf_pathfinder_new( sg, at_data, start, end );
    if (!spf)
    {
        TREAT_ERR( *err, 9039, "Not enough memory (polymers)" );
        /*unit->cyclizable = CLOSING_SRU_NOT_APPLICABLE;*/
        return;
    }
    spf->seen[0] = spf->start; 
    spf->nseen = 1;    
    *nbkbonds = 0;
    subgraf_pathfinder_run( spf, 0, NULL,
                            nbkbonds,
                            bkbonds, /* we will collect backbone CRU bonds here */
                            &dummy,
                            NULL );

    subgraf_free( sg );
    subgraf_pathfinder_free( spf );
    *err = 0;

    return;
}
/****************************************************************************
 Collect all backbone bonds - of main chain(s), side chains being ignored
 (for polymer CRU, these are the bonds potentially involved in frame shift)
****************************************************************************/
Collect all backbone bonds - of main chain(s), side chains being ignored
(for polymer CRU, these are the bonds potentially involved in frame shift)
Collect all backbone bonds - of main chain ( s ) side chains being ignored ( for polymer CRU these are the bonds potentially involved in frame shift )
void OAD_CollectBackboneBonds(ORIG_ATOM_DATA  *at_data,
                              int na, 
                              int *alist,
                              int end_atom1,
                              int end_atom2,
                              int *nbkbonds,
                              int **bkbonds,
                              int *err,
                              char *pStrErr )
{
    int start = 0, end = 0, dummy;
    subgraf *sg = NULL;
    subgraf_pathfinder *spf = NULL;
    *nbkbonds = 0;
    sg = subgraf_new( at_data, na, alist );
    if (!sg)
    {
        TREAT_ERR( *err, 9037, "Not enough memory (polymers)" );
        return;
    }
    start = sg->orig2node[end_atom1]; 
    end = sg->orig2node[end_atom2];
#if 0
    if (start > end)
    {
        int tmp = end;
        end = start;
        start = tmp;
    }
#endif
    spf = subgraf_pathfinder_new( sg, at_data, start, end );
    if (!spf)
    {
        TREAT_ERR( *err, 9039, "Not enough memory (polymers)" );
        return;
    }
    spf->seen[0] = spf->start; 
    spf->nseen = 1;    
    *nbkbonds = 0;
    subgraf_pathfinder_run( spf, 0, NULL,
                            nbkbonds,
                            bkbonds, 
                            &dummy,
                            NULL );
    subgraf_free( sg );
    subgraf_pathfinder_free( spf );
    *err = 0;
    return;
}
void OAD_CollectBackboneBonds ( ORIG_ATOM_DATA * at_data , int na , int * alist , int end_atom1 , int end_atom2 , int * nbkbonds , int * * bkbonds , int * err , char * pStrErr ) { int start = 0 , end = 0 , dummy ; subgraf * sg = NULL ; subgraf_pathfinder * spf = NULL ; * nbkbonds = 0 ; sg = subgraf_new ( at_data , na , alist ) ; if ( ! sg ) { TREAT_ERR ( * err , 9037 , " " ) ; return ; } start = sg -> orig2node [ end_atom1 ] ; end = sg -> orig2node [ end_atom2 ] ; #if 0 if ( start > end ) { int tmp = end ; end = start ; start = tmp ; } #endif spf = subgraf_pathfinder_new ( sg , at_data , start , end ) ; if ( ! spf ) { TREAT_ERR ( * err , 9039 , " " ) ; return ; } spf -> seen [ 0 ] = spf -> start ; spf -> nseen = 1 ; * nbkbonds = 0 ; subgraf_pathfinder_run ( spf , 0 , NULL , nbkbonds , bkbonds , & dummy , NULL ) ; subgraf_free ( sg ) ; subgraf_pathfinder_free ( spf ) ; * err = 0 ; return ; }
Collect all backbone bonds - of main chain(s), side chains being ignored
(for polymer CRU, these are the bonds potentially involved in frame shift)
Collect all backbone bonds - of main chain ( s ) side chains being ignored ( for polymer CRU these are the bonds potentially involved in frame shift )
/* Establish subgraph for na atoms of the alist */ /* unit->cyclizable = CLOSING_SRU_NOT_APPLICABLE; */ /*unit->cyclizable = CLOSING_SRU_NOT_APPLICABLE;*/ /* we will collect backbone CRU bonds here */