#include "CommandlineOptions.hh"
#include "ComputeTriangs.hh"
#include "PointConfiguration.hh"
#include "Symmetry.hh"
#include "Chirotope.hh"
#include "PlacingTriang.hh"
#include "ReverseSearchTriangulations.hh"

int main(const int argc, const char** argv) {
   CommandlineOptions::init(argc, argv);
   ReverseSearchWrapper *r;
   
   PointConfiguration points;
   if(!points.read(std::cin)){
      std::cerr << "Error while reading point configuration." << std::endl;
      return 1;
   }
   Chirotope chiro(points, false);
   
   SymmetryGroup group(points.no());
   if(!group.read(std::cin)){
      std::cerr << "No symmetry group provided." << std::endl;
   }
   r = constructReverseSearch(points, chiro, group);
   
   SimplicialComplex seed;
   if(!seed.read(std::cin)){
      seed = PlacingTriang(chiro);
      std::cerr << "No initial triangulation provided." << std::endl;
   }
   TriangNode initial = r->get_initial_triang(chiro.no(), chiro.rank(), seed);

   r->randomized_bfs(initial);
   
   
   return 0;
}
