#include "daal.h"
#include "service.h"
using namespace std;
using namespace daal;
using namespace daal::algorithms;
const string datasetFileName = "../data/online/qr.csv";
const size_t nRowsInBlock = 4000;
int main(int argc, char *argv[])
{
checkArguments(argc, argv, 1, &datasetFileName);
FileDataSource<CSVFeatureManager> dataSource(datasetFileName, DataSource::doAllocateNumericTable,
DataSource::doDictionaryFromContext);
qr::Online<> algorithm;
while(dataSource.loadDataBlock(nRowsInBlock) == nRowsInBlock)
{
algorithm.input.set( qr::data, dataSource.getNumericTable() );
algorithm.compute();
}
algorithm.finalizeCompute();
services::SharedPtr<qr::Result> res = algorithm.getResult();
printNumericTable(res->get(qr::matrixQ), "Orthogonal matrix Q:", 10);
printNumericTable(res->get(qr::matrixR), "Triangular matrix R:");
return 0;
}