#include "collapseTracklets.h"
#include "Tracklet.h"

#include <iostream>
#include <fstream>


int main(int argc, char** argv) {

        /* read pairs from a file, do the removal, and write the output */
        std::string USAGE("USAGE: removeSubsets <input pairfile> <output pairfile>");
        std::ifstream inFile;
        std::ofstream outFile;
        std::vector <Tracklet> pairsVector;
        std::vector <Tracklet> outputVector;

        if (argc != 3) {
            std::cerr << USAGE << std::endl;
            return 1;
        }

        try {
            inFile.open(argv[1]);
            outFile.open(argv[2]);
            collapseTracklets::populatePairsVectorFromFile(inFile, pairsVector);
        }
        catch(...) {
            std::cerr << USAGE << std::endl;
            return 1;
        }
	outputVector = collapseTracklets::bruteForceRemoveSubsets(&pairsVector);
        collapseTracklets::writeTrackletsToOutFile(&outputVector, outFile);
        return 0;
  

}
