#include "daal.h"
#include "service.h"
using namespace std;
using namespace daal;
using namespace daal::algorithms;
const string datasetFileName = "../data/batch/covcormoments_csr.csv";
int main(int argc, char *argv[])
{
checkArguments(argc, argv, 1, &datasetFileName);
CSRNumericTablePtr dataTable(createSparseTable<float>(datasetFileName));
covariance::Batch<float, covariance::fastCSR> algorithm;
algorithm.input.set(covariance::data, dataTable);
algorithm.parameter.outputMatrixType = covariance::correlationMatrix;
algorithm.compute();
covariance::ResultPtr res = algorithm.getResult();
printNumericTable(res->get(covariance::correlation), "Correlation matrix (upper left square 10*10) :", 10, 10);
printNumericTable(res->get(covariance::mean), "Mean vector:", 1, 10);
return 0;
}