third_party/inchi/INCHI_BASE/src/runichi3.c
int  OAD_PolymerUnit_CompareAtomListsMod( OAD_PolymerUnit *u1,
                                          OAD_PolymerUnit *u2 )
{
    int i;
    int n1 = u1->na;
    int n2 = u2->na;
    int n = n1;
    if (n1 < n2)    return -1;
    if (n1 > n2)    return 1;
    /* n1 == n2 == n */
    for (i = 0; i < n; i++)
    {
        if (u1->alist[i] < u2->alist[i])    return -1;
        if (u1->alist[i] > u2->alist[i])    return    1;
    }

    return 0;
}
/****************************************************************************
 Compare two polymer units, modified lexicographic order
    Modification: unit with smaller alist always go first
****************************************************************************/
Compare two polymer units, modified lexicographic order
Modification: unit with smaller alist always go first
Compare two polymer units modified lexicographic order Modification : unit with smaller alist always go first
int  OAD_PolymerUnit_CompareAtomListsMod( OAD_PolymerUnit *u1,
                                          OAD_PolymerUnit *u2 )
{
    int i;
    int n1 = u1->na;
    int n2 = u2->na;
    int n = n1;
    if (n1 < n2)    return -1;
    if (n1 > n2)    return 1;
    for (i = 0; i < n; i++)
    {
        if (u1->alist[i] < u2->alist[i])    return -1;
        if (u1->alist[i] > u2->alist[i])    return    1;
    }
    return 0;
}
int OAD_PolymerUnit_CompareAtomListsMod ( OAD_PolymerUnit * u1 , OAD_PolymerUnit * u2 ) { int i ; int n1 = u1 -> na ; int n2 = u2 -> na ; int n = n1 ; if ( n1 < n2 ) return -1 ; if ( n1 > n2 ) return 1 ; for ( i = 0 ; i < n ; i ++ ) { if ( u1 -> alist [ i ] < u2 -> alist [ i ] ) return -1 ; if ( u1 -> alist [ i ] > u2 -> alist [ i ] ) return 1 ; } return 0 ; }
Compare two polymer units, modified lexicographic order
Modification: unit with smaller alist always go first
Compare two polymer units modified lexicographic order Modification : unit with smaller alist always go first
/* n1 == n2 == n */