1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-12-21 00:24:29 +00:00

simplification of IO interface

This commit is contained in:
2014-02-20 23:52:45 +00:00
parent 9ce04cd7d6
commit 157fda5445
15 changed files with 870 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
#include <iostream>
#include <latan/Io.hpp>
#include <latan/AsciiFile.hpp>
using namespace std;
using namespace Latan;
@@ -13,10 +13,9 @@ int main(int argc, char *argv[])
}
string fileName = argv[1];
AsciiFile f(fileName, File::Mode::read);
cout << "-- loading sample from '" << fileName << "'..." << endl;
const DMatSample &s = f.read<DMatSample>();
const DMatSample &s = Io::load<DMatSample, AsciiFile>(fileName);
cout << scientific;
cout << "central value:\n" << s[central] << endl;
cout << "standard deviation:\n" << s.variance().cwiseSqrt() << endl;