Add "segmatch -k"

Signed-off-by: Clifford Wolf <clifford@clifford.at>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
Clifford Wolf 2017-11-17 01:03:43 +01:00 committed by Tim 'mithro' Ansell
parent 913c4104b2
commit 78a0ca0ef7
1 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@ DEFINE_bool(i, false, "add inverted tags");
DEFINE_int32(m, 0, "min number of set/cleared samples each");
DEFINE_int32(M, 0, "min number of set/cleared samples total");
DEFINE_string(o, "", "set output file");
DEFINE_string(k, "", "set output mask file");
using std::map;
using std::tuple;
@ -372,6 +373,14 @@ int main(int argc, char **argv)
printf("avg #of candidates: %.3f\n", avg_candidates);
}
if (!FLAGS_k.empty()) {
f = fopen(FLAGS_k.c_str(), "w");
assert(f != nullptr);
std::sort(bit_ids_r.begin(), bit_ids_r.end());
for (auto bit : bit_ids_r)
fprintf(f, "bit %s\n", bit.c_str());
}
return 0;
}