// // Created by joe on 5/13/15. // #include #include #include "tools/dataProvider.h" #include "tools/fileDataProvider.h" #include #include INITIALIZE_EASYLOGGINGPP using namespace std; namespace po = boost::program_options; po::variables_map vm; int outputRid(vector a,int fsize,string fname) { ofstream fout(fname.c_str()); fout<qid; for (int j=0;jfeature(j); fout<(), "take number") ("take,a", po::value(), "set output rid file 1(taken)") ("left,b", po::value(), "set output rid file 2(left)") ("input,i", po::value(), "set input Rid file"); po::store(po::parse_command_line(argc, argv, desc), vm); po::notify(vm); // Print help if necessary if (vm.count("help")) { cout << desc; return 0; } if (vm.count("query")){ RidFileDP dp(vm["input"].as().c_str()); dp.open(); cout<().c_str()); vector a; vector b; dp.open(); if (vm.count("shuffle")) { dp.getRidVector(a); dp.shuffle(a); outputRid(a, dp.getfSize(), vm["take"].as()); } else { dp.take(vm["count"].as(), a, b); outputRid(a, dp.getfSize(), vm["take"].as()); outputRid(b, dp.getfSize(), vm["left"].as()); } dp.close(); return 0; }