#include "daal.h"
#include "service.h"
using namespace std;
using namespace daal;
using namespace daal::algorithms;
const string dataFileName = "../data/batch/covcormoments_csr.csv";
typedef float algorithmFPType;
int main(int argc, char *argv[])
{
checkArguments(argc, argv, 1, &dataFileName);
CSRNumericTablePtr dataTable(createSparseTable<float>(dataFileName));
pca::Batch<> algorithm;
algorithm.parameter.covariance = services::SharedPtr<covariance::Batch<algorithmFPType, covariance::fastCSR> >
(new covariance::Batch<algorithmFPType, covariance::fastCSR>());
algorithm.input.set(pca::data, dataTable);
algorithm.compute();
pca::ResultPtr result = algorithm.getResult();
printNumericTable(result->get(pca::eigenvalues), "Eigenvalues:");
printNumericTable(result->get(pca::eigenvectors), "Eigenvectors:");
return 0;
}