SG++-Doxygen-Documentation
|
Class that is used to decompose and store the left-hand-side matrix for the density based classification approach (The classification is divided into two parts: the offline step that does not depend on the actual data and the online step that depends on the data). More...
#include <DBMatOffline.hpp>
Public Member Functions | |
virtual void | buildMatrix (Grid *grid, RegularizationConfiguration ®ularizationConfig) |
Builds the right hand side matrix with or without the regularization term depending on the type of decomposition. More... | |
virtual DBMatOffline * | clone ()=0 |
Interface for the clone idiom. More... | |
DBMatOffline (const std::string &fileName) | |
Constructor Create offline object from serialized offline object. More... | |
DBMatOffline (const DBMatOffline &rhs) | |
Copy Constructor. More... | |
DBMatOffline (DBMatOffline &&rhs)=default | |
Default move constructor. More... | |
virtual void | decomposeMatrix (RegularizationConfiguration ®ularizationConfig, DensityEstimationConfiguration &densityEstimationConfig)=0 |
Decomposes the matrix according to the chosen decomposition type. More... | |
DataMatrix & | getDecomposedMatrix () |
Get a reference to the decomposed matrix. More... | |
virtual sgpp::datadriven::MatrixDecompositionType | getDecompositionType ()=0 |
Returns the decomposition type of the DBMatOffline object. More... | |
virtual size_t | getGridSize () |
Returns the dimensionality of the quadratic lhs matrix (i.e. More... | |
DataMatrix & | getLhsMatrix_ONLY_FOR_TESTING () |
Allows access to lhs matrix, which is meant ONLY FOR TESTING. More... | |
virtual bool | isRefineable ()=0 |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined. More... | |
DBMatOffline & | operator= (const DBMatOffline &rhs) |
Default copy assign operator. More... | |
DBMatOffline & | operator= (DBMatOffline &&rhs)=default |
Default move assign operator. More... | |
void | printMatrix () |
Prints the matrix onto standard output. More... | |
virtual void | store (const std::string &fileName) |
Serialize the DBMatOffline Object. More... | |
virtual | ~DBMatOffline ()=default |
Default virtual destructor. More... | |
Public Attributes | |
std::vector< std::vector< size_t > > | interactions |
Protected Member Functions | |
DBMatOffline () | |
void | parseInter (const std::string &fileName, std::vector< std::vector< size_t >> &interactions) const |
Read the Interactionsterms from a serialized DBMatOfflibe object. More... | |
Protected Attributes | |
bool | isConstructed |
bool | isDecomposed |
DataMatrix | lhsMatrix |
Class that is used to decompose and store the left-hand-side matrix for the density based classification approach (The classification is divided into two parts: the offline step that does not depend on the actual data and the online step that depends on the data).
Uses Gnu Scientific Library (GSL).
|
explicit |
Constructor Create offline object from serialized offline object.
fileName | path to the file that stores serialized offline object |
References interactions, and parseInter().
sgpp::datadriven::DBMatOffline::DBMatOffline | ( | const DBMatOffline & | rhs | ) |
Copy Constructor.
rhs | Object to copy |
|
default |
Default move constructor.
|
virtualdefault |
Default virtual destructor.
|
protected |
References interactions.
|
virtual |
Builds the right hand side matrix with or without the regularization term depending on the type of decomposition.
grid | The grid object the matrix is based on |
regularizationConfig | Configures the regularization which is incorporated into the lhs |
Reimplemented in sgpp::datadriven::DBMatOfflineOrthoAdapt, and sgpp::datadriven::DBMatOfflineGE.
References sgpp::op_factory::createOperationLTwoDotExplicit(), sgpp::base::HashGridStorage::getSize(), sgpp::base::Grid::getStorage(), isConstructed, and lhsMatrix.
Referenced by sgpp::datadriven::DBMatOfflineGE::buildMatrix(), sgpp::datadriven::DBMatOfflineOrthoAdapt::buildMatrix(), sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), and main().
|
pure virtual |
Interface for the clone idiom.
Implemented in sgpp::datadriven::DBMatOfflineChol, sgpp::datadriven::DBMatOfflineDenseIChol, and sgpp::datadriven::DBMatOfflineOrthoAdapt.
|
pure virtual |
Decomposes the matrix according to the chosen decomposition type.
The number of rows of the stored result depends on the decomposition type.
regularizationConfig | the regularization configuration |
densityEstimationConfig | the density estimation configuration |
Implemented in sgpp::datadriven::DBMatOfflineOrthoAdapt, sgpp::datadriven::DBMatOfflineChol, and sgpp::datadriven::DBMatOfflineDenseIChol.
Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), and main().
DataMatrix & sgpp::datadriven::DBMatOffline::getDecomposedMatrix | ( | ) |
Get a reference to the decomposed matrix.
Throws if matrix has not yet been decomposed.
References isDecomposed, and lhsMatrix.
Referenced by sgpp::datadriven::DBMatOnlineDE::computeDensityFunction(), sgpp::datadriven::LearnerSGDEOnOffParallel::computeNewSystemMatrixDecomposition(), sgpp::datadriven::DBMatOnlineDE::DBMatOnlineDE(), and sgpp::datadriven::DBMatOnlineDEChol::solveSLE().
|
pure virtual |
Returns the decomposition type of the DBMatOffline object.
Implemented in sgpp::datadriven::DBMatOfflineChol, sgpp::datadriven::DBMatOfflineDenseIChol, and sgpp::datadriven::DBMatOfflineOrthoAdapt.
Referenced by sgpp::datadriven::DBMatOnlineDEChol::buildCholSolver(), sgpp::datadriven::DBMatOnlineDEFactory::buildDBMatOnlineDE(), sgpp::datadriven::DBMatOnlineDEOrthoAdapt::DBMatOnlineDEOrthoAdapt(), and store().
|
virtual |
Returns the dimensionality of the quadratic lhs matrix (i.e.
the number of rows)
References sgpp::base::DataMatrix::getNrows(), and lhsMatrix.
Referenced by sgpp::datadriven::DBMatOnlineDE::computeDensityFunction(), sgpp::datadriven::DBMatOnlineDEOrthoAdapt::sherman_morrison_adapt(), sgpp::datadriven::DBMatOfflineOrthoAdapt::store(), and sgpp::datadriven::DBMatOnlineDEOrthoAdapt::updateSystemMatrixDecomposition().
sgpp::base::DataMatrix & sgpp::datadriven::DBMatOffline::getLhsMatrix_ONLY_FOR_TESTING | ( | ) |
Allows access to lhs matrix, which is meant ONLY FOR TESTING.
References lhsMatrix.
|
pure virtual |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined.
Implemented in sgpp::datadriven::DBMatOfflineChol, and sgpp::datadriven::DBMatOfflineOrthoAdapt.
DBMatOffline & sgpp::datadriven::DBMatOffline::operator= | ( | const DBMatOffline & | rhs | ) |
Default copy assign operator.
References interactions, isConstructed, isDecomposed, and lhsMatrix.
|
default |
Default move assign operator.
|
protected |
Read the Interactionsterms from a serialized DBMatOfflibe object.
fileName | path of the serialized DBMatOffline object |
interactions | the interactions to populate |
References analyse_erg::file, python.statsfileInfo::i, interactions, python.utils.statsfile2gnuplot::j, analyse_erg::tmp, and sgpp::datadriven::StringTokenizer::tokenize().
Referenced by DBMatOffline().
void sgpp::datadriven::DBMatOffline::printMatrix | ( | ) |
Prints the matrix onto standard output.
References sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), isDecomposed, lhsMatrix, and sgpp::base::DataMatrix::toString().
|
virtual |
Serialize the DBMatOffline Object.
fileName | path where to store the file. |
Reimplemented in sgpp::datadriven::DBMatOfflineOrthoAdapt.
References getDecompositionType(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), python.statsfileInfo::i, interactions, isDecomposed, python.utils.statsfile2gnuplot::j, and lhsMatrix.
Referenced by main(), and sgpp::datadriven::DBMatOfflineOrthoAdapt::store().
std::vector<std::vector <size_t> > sgpp::datadriven::DBMatOffline::interactions |
|
protected |
|
protected |
Referenced by sgpp::datadriven::DBMatOfflineChol::choleskyAddPoint(), sgpp::datadriven::DBMatOfflineChol::choleskyPermutation(), sgpp::datadriven::DBMatOfflineOrthoAdapt::DBMatOfflineOrthoAdapt(), sgpp::datadriven::DBMatOfflineDenseIChol::decomposeMatrix(), sgpp::datadriven::DBMatOfflineChol::decomposeMatrix(), sgpp::datadriven::DBMatOfflineOrthoAdapt::decomposeMatrix(), getDecomposedMatrix(), operator=(), printMatrix(), and store().
|
protected |
Referenced by sgpp::datadriven::DBMatOfflineGE::buildMatrix(), buildMatrix(), sgpp::datadriven::DBMatOfflineChol::choleskyAddPoint(), sgpp::datadriven::DBMatOfflineDenseIChol::choleskyModification(), sgpp::datadriven::DBMatOfflineChol::choleskyModification(), sgpp::datadriven::DBMatOfflineChol::choleskyPermutation(), sgpp::datadriven::DBMatOfflineGE::DBMatOfflineGE(), sgpp::datadriven::DBMatOfflineOrthoAdapt::DBMatOfflineOrthoAdapt(), sgpp::datadriven::DBMatOfflineDenseIChol::decomposeMatrix(), sgpp::datadriven::DBMatOfflineChol::decomposeMatrix(), sgpp::datadriven::DBMatOfflineOrthoAdapt::decomposeMatrix(), getDecomposedMatrix(), getGridSize(), getLhsMatrix_ONLY_FOR_TESTING(), sgpp::datadriven::DBMatOfflineOrthoAdapt::hessenberg_decomposition(), sgpp::datadriven::DBMatOfflineOrthoAdapt::invert_symmetric_tridiag(), operator=(), printMatrix(), and store().