#include #include #include #include int main(int argc, char* argv[]) { using namespace std; using namespace Latan; if (argc != 4 and argc != 5) { cout << "Usage: " << argv[0] << " "; cout << "[output filename]" << endl; return -1; } string inFileName = argv[1]; auto row = strTo(argv[2]); auto col = strTo(argv[3]); string outFileName = (argc == 5) ? argv[4] : ""; auto inputData = Io::load(inFileName); cout << scientific; cout << "central value:\n" << inputData[central](row, col) << endl; cout << "standard deviation:\n"; cout << inputData.variance().cwiseSqrt()(row, col) << endl; if (not outFileName.empty()) { DSample outputData(inputData.size()); FOR_STAT_ARRAY(inputData, s) { outputData[s] = inputData[s](row, col); } Io::save(outputData, outFileName); } }