src/listmerger/utilities.cc
void
splitTwoSets(vector<Array<unsigned>*> *longLists,
             vector<Array<unsigned>*> *shortLists,
             const unsigned threshold,
             const vector<Array<unsigned>*> &originalLists,
             unsigned sortedIndex[],
             unsigned longListsSize)
{

    unsigned originalListSize = originalLists.size();

    for (unsigned i = 0; i < originalListSize; i++) {
        if (i < longListsSize)
            longLists->push_back(originalLists.at(sortedIndex[originalListSize - i - 1]));
        else
            shortLists->push_back(originalLists.at(sortedIndex[originalListSize - i - 1]));

    }//end for

}
/*

This function is for DividedSkip algorithm
Seperate to long and short lists sets.
For short lists, use binarySearch;
For long lists, use hash to search.

 */
This function is for DividedSkip algorithm
Seperate to long and short lists sets.
For short lists, use binarySearch;
For long lists, use hash to search.
This function is for DividedSkip algorithm Seperate to long and short lists sets . For short lists use binarySearch ; For long lists use hash to search .
void
splitTwoSets(vector<Array<unsigned>*> *longLists,
             vector<Array<unsigned>*> *shortLists,
             const unsigned threshold,
             const vector<Array<unsigned>*> &originalLists,
             unsigned sortedIndex[],
             unsigned longListsSize)
{
    unsigned originalListSize = originalLists.size();
    for (unsigned i = 0; i < originalListSize; i++) {
        if (i < longListsSize)
            longLists->push_back(originalLists.at(sortedIndex[originalListSize - i - 1]));
        else
            shortLists->push_back(originalLists.at(sortedIndex[originalListSize - i - 1]));
    }
}
void splitTwoSets ( vector < Array < unsigned > * > * longLists , vector < Array < unsigned > * > * shortLists , const unsigned threshold , const vector < Array < unsigned > * > & originalLists , unsigned sortedIndex [ ] , unsigned longListsSize ) { unsigned originalListSize = originalLists . size ( ) ; for ( unsigned i = 0 ; i < originalListSize ; i ++ ) { if ( i < longListsSize ) longLists -> push_back ( originalLists . at ( sortedIndex [ originalListSize - i - 1 ] ) ) ; else shortLists -> push_back ( originalLists . at ( sortedIndex [ originalListSize - i - 1 ] ) ) ; } }
This function is for DividedSkip algorithm
Seperate to long and short lists sets.
This function is for DividedSkip algorithm Seperate to long and short lists sets .
//end for