int Context::score(bool positive, const char* intent) const{ int score = 0; int n = len(positive); for(int i = 0; i < n; i++){ score += check_inclusion(positive, i, intent) ? 1 : 0; } return score; }
bool Context::check_any_inclusion(bool positive, const char* intent) const{ int n = len(positive); for(int i = 0; i < n; i++){ if(check_inclusion(positive, i, intent)){ return true; } } return false; }
int main(int argc, char **argv) { std::cout.sync_with_stdio(false); std::cout.precision(10); ArgParser args(argc, argv); std::vector < std::string > filenames = args.get_filenames(); std::vector < int > tasks = args.get_tasks(); for (int t: tasks) { switch (t) { case 0: { show_help(); } case 1: { check_zero_mass(filenames, args.get_eps()); break; } case 2: { check_no_peaks_scans(filenames, args.get_evalue_border()); break; } case 3: { check_inclusion(filenames, args.get_evalue_border(), args.get_eps()); break; } case 4: { check_same_mass(filenames, args.get_evalue_border(), args.get_eps()); break; } case 5: { check_finding(filenames, args.get_eps()); break; } case 6: { calc_mass_parts(filenames); break; } case 7: { check_thermo_scans_for_ratio(filenames, args.get_eps()); break; } } } std::cin.clear(); std::cin.sync(); std::cin.get(); return 0; }
bool Context::check_negative_inclusion(const int index, const char* intent) const { return check_inclusion(false, index, intent); }
bool Context::check_positive_inclusion(const int index, const char* intent) const { return check_inclusion(true, index, intent); }