![]() |
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. | |
std::string & | getBaseDataMatrix (const sgpp::base::GeneralGridConfiguration &gridConfig, const sgpp::base::AdaptivityConfiguration &adaptivityConfig, const sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, const sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig, sgpp::base::GeneralGridConfiguration &baseGridConfig) |
Scans the entire database and returns the first entry that can be permutated to match the configurations. | |
std::string & | getDataMatrix (const sgpp::base::GeneralGridConfiguration &gridConfig, const sgpp::base::AdaptivityConfiguration &adaptivityConfig, const sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, const sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig) |
Scans the entire database and finds the first entry that matches the configurations. | |
bool | hasBaseDataMatrix (const sgpp::base::GeneralGridConfiguration &gridConfig, const sgpp::base::AdaptivityConfiguration &adaptivityConfig, const sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, const sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig) |
Scans the entire database and checks whether there exists an entry that can be permutated to match the configurations. | |
bool | hasDataMatrix (const sgpp::base::GeneralGridConfiguration &gridConfig, const sgpp::base::AdaptivityConfiguration &adaptivityConfig, const sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, const sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig) |
Scans the entire database and checks weather any entry matches the configuration. | |
void | putDataMatrix (const sgpp::base::GeneralGridConfiguration &gridConfig, const sgpp::base::AdaptivityConfiguration &adaptivityConfig, const sgpp::datadriven::RegularizationConfiguration ®ularizationConfig, const sgpp::datadriven::DensityEstimationConfiguration &densityEstimationConfig, const std::string filepath, bool overwriteEntry=false) |
Puts a filepath for a given configuration in the database. | |
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::getBaseDataMatrix | ( | const sgpp::base::GeneralGridConfiguration & | gridConfig, |
const sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
const sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
const sgpp::datadriven::DensityEstimationConfiguration & | densityEstimationConfig, | ||
sgpp::base::GeneralGridConfiguration & | baseGridConfig | ||
) |
Scans the entire database and returns the first entry that can be permutated to match the configurations.
A entry matches if all config properties except the gridConfig's level vector are equal and level vector elements unequal 1 are set equal.
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 |
baseGridConfig | is overriten with the entry's grid config |
References adaptivityConfig, sgpp::base::GeneralGridConfiguration::dim_, json::Node::get(), json::Node::getUInt(), sgpp::datadriven::keyFilepath, sgpp::datadriven::keyGridConfiguration, sgpp::datadriven::keyGridDimension, sgpp::datadriven::keyGridLevel, and sgpp::base::GeneralGridConfiguration::levelVector_.
Referenced by sgpp::datadriven::DBMatPermutationFactory::getPermutedObject().
std::string & sgpp::datadriven::DBMatDatabase::getDataMatrix | ( | const sgpp::base::GeneralGridConfiguration & | gridConfig, |
const sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
const sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
const 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 adaptivityConfig, json::Node::get(), and sgpp::datadriven::keyFilepath.
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::fit(), and sgpp::datadriven::ModelFittingDensityDifferenceEstimationOnOff::fit().
bool sgpp::datadriven::DBMatDatabase::hasBaseDataMatrix | ( | const sgpp::base::GeneralGridConfiguration & | gridConfig, |
const sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
const sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
const sgpp::datadriven::DensityEstimationConfiguration & | densityEstimationConfig | ||
) |
Scans the entire database and checks whether there exists an entry that can be permutated to match the configurations.
A entry matches if all config properties except the gridConfig's level vector are equal and level vector elements unequal 1 are set equal.
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 adaptivityConfig.
Referenced by sgpp::datadriven::DBMatPermutationFactory::getPermutedObject().
bool sgpp::datadriven::DBMatDatabase::hasDataMatrix | ( | const sgpp::base::GeneralGridConfiguration & | gridConfig, |
const sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
const sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
const 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 |
References adaptivityConfig.
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), sgpp::datadriven::ModelFittingDensityEstimationOnOffParallel::fit(), and sgpp::datadriven::ModelFittingDensityDifferenceEstimationOnOff::fit().
void sgpp::datadriven::DBMatDatabase::putDataMatrix | ( | const sgpp::base::GeneralGridConfiguration & | gridConfig, |
const sgpp::base::AdaptivityConfiguration & | adaptivityConfig, | ||
const sgpp::datadriven::RegularizationConfiguration & | regularizationConfig, | ||
const sgpp::datadriven::DensityEstimationConfiguration & | densityEstimationConfig, | ||
const 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 adaptivityConfig, json::DictNode::addDictAttr(), json::ListNode::addDictValue(), json::DictNode::addIDAttr(), json::ListNode::addIdValue(), json::DictNode::addListAttr(), json::DictNode::addTextAttr(), sgpp::base::ComponentGrid, sgpp::datadriven::DensityEstimationConfiguration::decomposition_, sgpp::base::GeneralGridConfiguration::dim_, sgpp::base::GeneralGridConfiguration::generalType_, sgpp::datadriven::keyDecompositionType, sgpp::datadriven::keyDensityEstimationConfiguration, sgpp::datadriven::keyFilepath, sgpp::datadriven::keyGridConfiguration, sgpp::datadriven::keyGridDimension, sgpp::datadriven::keyGridLevel, sgpp::datadriven::keyGridType, sgpp::datadriven::keyRegularizationConfiguration, sgpp::datadriven::keyRegularizationStrength, sgpp::datadriven::RegularizationConfiguration::lambda_, level, sgpp::base::GeneralGridConfiguration::level_, sgpp::base::GeneralGridConfiguration::levelVector_, json::DictNode::replaceTextAttr(), sgpp::datadriven::MatrixDecompositionTypeParser::toString(), and sgpp::base::GeneralGridTypeParser::toString().
Referenced by main().