56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#include <fstream>
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
#include <args.hxx>
|
|
|
|
#include "common.hh"
|
|
|
|
|
|
namespace param {
|
|
using namespace ::args;
|
|
|
|
ArgumentParser parser {
|
|
"converter: aprob -> bmap"
|
|
};
|
|
HelpFlag help {
|
|
parser, "help", "display this menu", {'h', "help"},
|
|
};
|
|
|
|
ValueFlag<double> min {
|
|
parser, "0.2", "minimum alter-probability to select", {"min"}, 0.4,
|
|
};
|
|
ValueFlag<double> max {
|
|
parser, "0.6", "maximum alter-probability to select", {"max"}, 0.6,
|
|
};
|
|
|
|
} // namespace param
|
|
|
|
|
|
static void Exec() {
|
|
const auto aprob = ReadMatrix<double>(std::cin);
|
|
|
|
for (auto& probs : aprob) {
|
|
for (size_t i = 0; i < probs.size(); ++i) {
|
|
if (args::get(param::min) <= probs[i] && probs[i] <= args::get(param::max)) {
|
|
std::cout << i << ' ';
|
|
}
|
|
}
|
|
std::cout << '\n';
|
|
}
|
|
}
|
|
|
|
int main(int argc, char** argv)
|
|
try {
|
|
param::parser.ParseCLI(argc, argv);
|
|
Exec();
|
|
return EXIT_SUCCESS;
|
|
} catch (const args::Help&) {
|
|
std::cout << param::parser << std::endl;
|
|
return EXIT_SUCCESS;
|
|
} catch (const std::exception& e) {
|
|
std::cerr << e.what() << std::endl;
|
|
return EXIT_FAILURE;
|
|
}
|
|
|