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