SG++-Doxygen-Documentation
|
A database class to store and retrieve online matrix decompositions for the sparse grid density estimation. More...
#include <DBMatDatabase.hpp>
Public Member Functions | |
DBMatDatabase (const std::string &filepath) | |
Initializes the database from a json filepath. More... | |
std::string & | getDataMatrix (sgpp::base::GeneralGridConfiguration &gridConfig, sgpp::base::AdaptivityConfiguration &adaptivityConfig, sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig) |
Scans the entire database and finds the first entry that matches the configurations. More... | |
bool | hasDataMatrix (sgpp::base::GeneralGridConfiguration &gridConfig, sgpp::base::AdaptivityConfiguration &adaptivityConfig, sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig) |
Scans the entire database and checks weather any entry matches the configuration. More... | |
void | putDataMatrix (sgpp::base::GeneralGridConfiguration &gridConfig, sgpp::base::AdaptivityConfiguration &adaptivityConfig, sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig, std::string filepath, bool overwriteEntry=false) |
Puts a filepath for a given configuration in the database. More... | |
virtual | ~DBMatDatabase ()=default |
A database class to store and retrieve online matrix decompositions for the sparse grid density estimation.
The class works on a json file.
|
explicit |
Initializes the database from a json filepath.
filepath | the path to the json database |
|
virtualdefault |
std::string & sgpp::datadriven::DBMatDatabase::getDataMatrix | ( | sgpp::base::GeneralGridConfiguration & | gridConfig, |
sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
sgpp::datadriven::DensityEstimationConfiguration & | densityEstimationConfig | ||
) |
Scans the entire database and finds the first entry that matches the configurations.
gridConfig | the grid configuration the matrix must match |
adaptivityConfig | the adaptivity configuration the matrix must match |
regularizationConfig | the regularization configuration the matrix must match |
densityEstimationConfig | the density estimation configuration the matrix must match |
References json::Node::get(), and sgpp::datadriven::keyFilepath.
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), and main().
bool sgpp::datadriven::DBMatDatabase::hasDataMatrix | ( | sgpp::base::GeneralGridConfiguration & | gridConfig, |
sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
sgpp::datadriven::DensityEstimationConfiguration & | densityEstimationConfig | ||
) |
Scans the entire database and checks weather any entry matches the configuration.
gridConfig | the grid configuration the matrix must match |
adaptivityConfig | the adaptivity configuration the matrix must match |
regularizationConfig | the regularization configuration the matrix must match |
densityEstimationConfig | the density estimation configuration the matrix must match |
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit().
void sgpp::datadriven::DBMatDatabase::putDataMatrix | ( | sgpp::base::GeneralGridConfiguration & | gridConfig, |
sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
sgpp::datadriven::DensityEstimationConfiguration & | densityEstimationConfig, | ||
std::string | filepath, | ||
bool | overwriteEntry = false |
||
) |
Puts a filepath for a given configuration in the database.
The filepath refers to the matrix file. If for this configuration a filepath is already present in the database the filepath is updated if and only if the overwriteEntry parameter is set (default = false).
gridConfig | the grid configuration the matrix matches |
adaptivityConfig | the adaptivity configuration the matrix matches |
regularizationConfig | the regularization configuration the matrix matches |
densityEstimationConfig | the density estimation configuration the matrix matches |
filepath | the path where the matrix decomposition is located at |
overwriteEntry | replaces existing entries with the same configuration if and only if this parameter is set |
References json::DictNode::addDictAttr(), json::ListNode::addDictValue(), json::DictNode::addIDAttr(), json::DictNode::addTextAttr(), sgpp::base::ComponentGrid, json::DictNode::contains(), sgpp::datadriven::DensityEstimationConfiguration::decomposition_, sgpp::base::GeneralGridConfiguration::dim_, sgpp::base::GeneralGridConfiguration::generalType_, json::Node::getInt(), python.statsfileInfo::i, sgpp::datadriven::keyDecompositionType, sgpp::datadriven::keyDensityEstimationConfiguration, sgpp::datadriven::keyGridConfiguration, sgpp::datadriven::keyGridDimension, sgpp::datadriven::keyGridLevel, sgpp::datadriven::keyGridType, sgpp::datadriven::keyRegularizationConfiguration, sgpp::datadriven::keyRegularizationStrength, lambda, sgpp::datadriven::RegularizationConfiguration::lambda_, sgpp::base::GeneralGridConfiguration::level_, sgpp::base::CombiGridConfiguration::levels, sgpp::datadriven::GeneralGridTypeParser::parse(), sgpp::datadriven::MatrixDecompositionTypeParser::parse(), json::DictNode::replaceTextAttr(), json::ListNode::size(), sgpp::datadriven::GeneralGridTypeParser::toString(), and sgpp::datadriven::MatrixDecompositionTypeParser::toString().
Referenced by main().