third_party/inchi/INCHI_BASE/src/runichi3.c
int  OAD_PolymerUnit_CompareAtomLists( OAD_PolymerUnit *u1,
                                       OAD_PolymerUnit *u2 )
{
    int i;
    int n1 = u1->na;
    int n2 = u2->na;
    int n = inchi_min( n1, n2 );

    for (i = 0; i < n; i++)
    {
        if (u1->alist[i] < u2->alist[i])
        {
            return -1;
        }
        if (u1->alist[i] > u2->alist[i])
        {
            return 1;
        }
    }

    if (n1 < n2)
    {
        return -1;
    }

    if (n1 > n2)
    {
        return    1;
    }

    return 0;
}
/****************************************************************************
 Compare two polymer units, lexicographic order
****************************************************************************/
Compare two polymer units, lexicographic order
Compare two polymer units lexicographic order
int  OAD_PolymerUnit_CompareAtomLists( OAD_PolymerUnit *u1,
                                       OAD_PolymerUnit *u2 )
{
    int i;
    int n1 = u1->na;
    int n2 = u2->na;
    int n = inchi_min( n1, n2 );
    for (i = 0; i < n; i++)
    {
        if (u1->alist[i] < u2->alist[i])
        {
            return -1;
        }
        if (u1->alist[i] > u2->alist[i])
        {
            return 1;
        }
    }
    if (n1 < n2)
    {
        return -1;
    }
    if (n1 > n2)
    {
        return    1;
    }
    return 0;
}
int OAD_PolymerUnit_CompareAtomLists ( OAD_PolymerUnit * u1 , OAD_PolymerUnit * u2 ) { int i ; int n1 = u1 -> na ; int n2 = u2 -> na ; int n = inchi_min ( n1 , n2 ) ; for ( i = 0 ; i < n ; i ++ ) { if ( u1 -> alist [ i ] < u2 -> alist [ i ] ) { return -1 ; } if ( u1 -> alist [ i ] > u2 -> alist [ i ] ) { return 1 ; } } if ( n1 < n2 ) { return -1 ; } if ( n1 > n2 ) { return 1 ; } return 0 ; }
Compare two polymer units, lexicographic order
Compare two polymer units lexicographic order