SG++-Doxygen-Documentation
|
#include <DBMatOfflineOrthoAdapt.hpp>
Public Member Functions | |
void | buildMatrix (Grid *grid, RegularizationConfiguration ®ularizationConfig) |
Builds the left hand side matrix without the regularization term. More... | |
DBMatOffline * | clone () |
Interface for the clone idiom. More... | |
DBMatOfflineOrthoAdapt () | |
Constructor Builds DBMatOfflineOrthoAdapt Object from configuration. More... | |
DBMatOfflineOrthoAdapt (const std::string &fileName) | |
Constructor Builds object from serialized offline object, stored in file. More... | |
void | decomposeMatrix (RegularizationConfiguration ®ularizationConfig, DensityEstimationConfiguration &densityEstimationConfig) |
Decomposes and inverts the lhsMatrix of the offline object (lhs + lambda*I)^{-1} = Q * (T + lambda*I)^{-1} * Q^t = Q * T_inv * Q^t. More... | |
sgpp::datadriven::MatrixDecompositionType | getDecompositionType () override |
Returns the decomposition type of the DBMatOffline object. More... | |
sgpp::base::DataMatrix & | getQ () |
sgpp::base::DataMatrix & | getTinv () |
void | hessenberg_decomposition (sgpp::base::DataVector &diag, sgpp::base::DataVector &subdiag) |
Decomposes the lhsMatrix into lhs = Q * T * Q^t and stores the orthogonal matrix Q into the member q_ortho_matrix_. More... | |
void | invert_symmetric_tridiag (sgpp::base::DataVector &diag, sgpp::base::DataVector &subdiag) |
Inverts a symmetric tridiagonal matrix T, which is given in the form of its diagonal and subdiagonal vectors. More... | |
bool | isRefineable () override |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined. More... | |
void | store (const std::string &fileName) |
Serializes the DBMatOfflineOrthoAdapt object. More... | |
Public Member Functions inherited from sgpp::datadriven::DBMatOffline | |
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... | |
DataMatrix & | getDecomposedMatrix () |
Get a reference to the decomposed matrix. 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... | |
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 | ~DBMatOffline ()=default |
Default virtual destructor. More... | |
Protected Attributes | |
sgpp::base::DataMatrix | q_ortho_matrix_ |
sgpp::base::DataMatrix | t_tridiag_inv_matrix_ |
Protected Attributes inherited from sgpp::datadriven::DBMatOffline | |
bool | isConstructed |
bool | isDecomposed |
DataMatrix | lhsMatrix |
Additional Inherited Members | |
Public Attributes inherited from sgpp::datadriven::DBMatOffline | |
std::vector< std::vector< size_t > > | interactions |
Protected Member Functions inherited from sgpp::datadriven::DBMatOffline | |
DBMatOffline () | |
void | parseInter (const std::string &fileName, std::vector< std::vector< size_t >> &interactions) const |
Read the Interactionsterms from a serialized DBMatOfflibe object. More... | |
sgpp::datadriven::DBMatOfflineOrthoAdapt::DBMatOfflineOrthoAdapt | ( | ) |
Constructor Builds DBMatOfflineOrthoAdapt Object from configuration.
References q_ortho_matrix_, and t_tridiag_inv_matrix_.
|
explicit |
Constructor Builds object from serialized offline object, stored in file.
fileName | path to the file storing object |
References analyse_erg::file, sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::isConstructed, sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsMatrix, q_ortho_matrix_, t_tridiag_inv_matrix_, and sgpp::datadriven::StringTokenizer::tokenize().
|
virtual |
Builds the left hand side matrix without the regularization term.
grid | the underlying grid |
regularizationConfig | configuaration for the regularization employed |
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::DBMatOffline::buildMatrix(), sgpp::base::HashGridStorage::getSize(), sgpp::base::Grid::getStorage(), q_ortho_matrix_, sgpp::base::DataMatrix::resizeQuadratic(), and t_tridiag_inv_matrix_.
|
virtual |
Interface for the clone idiom.
Implements sgpp::datadriven::DBMatOffline.
|
virtual |
Decomposes and inverts the lhsMatrix of the offline object (lhs + lambda*I)^{-1} = Q * (T + lambda*I)^{-1} * Q^t = Q * T_inv * Q^t.
The matrix lhsMatrix of the parent object will be altered during the process
regularizationConfig | the regularization configuration |
densityEstimationConfig | the density estimation configuration |
Implements sgpp::datadriven::DBMatOffline.
References sgpp::base::DataVector::get(), sgpp::base::DataMatrix::getNrows(), hessenberg_decomposition(), python.statsfileInfo::i, invert_symmetric_tridiag(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::RegularizationConfiguration::lambda_, sgpp::datadriven::DBMatOffline::lhsMatrix, and sgpp::base::DataVector::set().
|
overridevirtual |
Returns the decomposition type of the DBMatOffline object.
Implements sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::OrthoAdapt.
|
inline |
References q_ortho_matrix_.
Referenced by sgpp::datadriven::DBMatOnlineDEOrthoAdapt::sherman_morrison_adapt(), and sgpp::datadriven::DBMatOnlineDEOrthoAdapt::solveSLE().
|
inline |
void sgpp::datadriven::DBMatOfflineOrthoAdapt::hessenberg_decomposition | ( | sgpp::base::DataVector & | diag, |
sgpp::base::DataVector & | subdiag | ||
) |
Decomposes the lhsMatrix into lhs = Q * T * Q^t and stores the orthogonal matrix Q into the member q_ortho_matrix_.
The information to reconstruct T is written into diag and subdiag
diag | Diagonal entries of T |
subdiag | Sub- and superdiagonal entries of T (symmetric) |
References sgpp::base::DataMatrix::getNrows(), sgpp::base::DataVector::getPointer(), sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::lhsMatrix, and q_ortho_matrix_.
Referenced by decomposeMatrix().
void sgpp::datadriven::DBMatOfflineOrthoAdapt::invert_symmetric_tridiag | ( | sgpp::base::DataVector & | diag, |
sgpp::base::DataVector & | subdiag | ||
) |
Inverts a symmetric tridiagonal matrix T, which is given in the form of its diagonal and subdiagonal vectors.
When finished, diag and subdiag no longer hold their initial values.
diag | Diagonal entries of T |
subdiag | Sub- and superdiagonal entries of T (symmetric) |
References sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataVector::getPointer(), sgpp::base::DataVector::getSize(), python.statsfileInfo::i, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::base::DataMatrix::set(), and t_tridiag_inv_matrix_.
Referenced by decomposeMatrix().
|
overridevirtual |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined.
Implements sgpp::datadriven::DBMatOffline.
|
virtual |
Serializes the DBMatOfflineOrthoAdapt object.
q_ortho_matrix_ and t_inv_tridiag_ are stored into the specified file, which is the explicit representation of the decomposition needed for the online phase
fileName | path where to store the file |
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::DBMatOffline::getGridSize(), sgpp::base::DataMatrix::getPointer(), q_ortho_matrix_, sgpp::datadriven::DBMatOffline::store(), and t_tridiag_inv_matrix_.
|
protected |
Referenced by buildMatrix(), DBMatOfflineOrthoAdapt(), getQ(), hessenberg_decomposition(), and store().
|
protected |
Referenced by buildMatrix(), DBMatOfflineOrthoAdapt(), getTinv(), invert_symmetric_tridiag(), and store().