SG++
CholBenchmark.cpp

This example can be found under datadriven/examples/CholBenchmark.cpp.

/*
* CholBenchmark.cpp
*
* Created on: Apr 25, 2017
* Author: milettri
*/
// Copyright (C) 2008-today The SG++ project
// This file is part of the SG++ project. For conditions of distribution and
// use, please see the copyright notice provided with SG++ or at
// sgpp.sparsegrids.org
#ifdef USE_GSL
#include <chrono>
#include <string>
#endif /* USE_GSL */
int main() {
#ifdef USE_GSL
gridConfig.dim_ = 4;
gridConfig.level_ = 5;
regularizationConfig.lambda_ = 0;
densityEstimationConfig.iCholSweepsDecompose_ = 2;
auto decompType = "Incomplete Cholesky decomposition on Dense Matrix";
std::cout << "Decomposition type: " << decompType << std::endl;
sgpp::datadriven::DBMatOfflineDenseIChol offline(gridConfig, adaptConfig,
regularizationConfig, densityEstimationConfig);
// sgpp::datadriven::DBMatOfflineChol offline(gridConfig, adaptConfig,
// regularizationConfig, densityEstimationConfig);
offline.buildMatrix();
auto begin = std::chrono::high_resolution_clock::now();
offline.decomposeMatrix();
auto end = std::chrono::high_resolution_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count() << "ms"
<< std::endl;
#endif /* USE_GSL */
}