![]() |
SG++-Doxygen-Documentation
|
#include <DBMatOfflineOrthoAdapt.hpp>
Public Member Functions | |
void | buildMatrix (Grid *grid, const RegularizationConfiguration ®ularizationConfig) override |
Builds the left hand side matrix without the regularization term. | |
DBMatOffline * | clone () const override |
Interface for the clone idiom. | |
void | compute_inverse () override |
void | compute_inverse_parallel (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) override |
parallel/distributed version of compute_inverse() | |
DBMatOfflineOrthoAdapt () | |
Constructor Builds DBMatOfflineOrthoAdapt Object from configuration. | |
DBMatOfflineOrthoAdapt (const std::string &fileName) | |
Constructor Builds object from serialized offline object, stored in file. | |
void | decomposeMatrix (const RegularizationConfiguration ®ularizationConfig, const DensityEstimationConfiguration &densityEstimationConfig) override |
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. | |
void | decomposeMatrixParallel (RegularizationConfiguration ®ularizationConfig, DensityEstimationConfiguration &densityEstimationConfig, std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) override |
The parallel/distributed version of decomposeMatrix(...) | |
sgpp::datadriven::MatrixDecompositionType | getDecompositionType () override |
Returns the decomposition type of the DBMatOffline object. | |
sgpp::base::DataMatrix & | getQ () |
DataMatrixDistributed & | getQDistributed () |
sgpp::base::DataMatrix & | getTinv () |
DataMatrixDistributed & | getTinvDistributed () |
const DataMatrix & | getUnmodifiedR () override |
Get the unmodified (without added lambda) system matrix R. | |
const DataMatrixDistributed & | getUnmodifiedRDistributed (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) override |
Get the unmodified (without added lambda) distributed system matrix R. | |
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_. | |
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. | |
bool | isRefineable () override |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined. | |
void | permuteDecomposition (const sgpp::base::GeneralGridConfiguration &baseGridConfig, const sgpp::base::GeneralGridConfiguration &desiredGridConfig) override |
First permutes the rows of the orthogonal matrix Q. | |
void | store (const std::string &fileName) override |
Serializes the DBMatOfflineOrthoAdapt object. | |
void | syncDistributedDecomposition (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) override |
Override to sync Q and Tinv. | |
void | updateRegularization (double lambda) override |
Modifies the decomposition to update the regularization parameter lambda. | |
void | updateRegularizationParallel (double lambda, std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) override |
Modifies the parallel decomposition to update the regularization parameter lambda. | |
![]() | |
DBMatOfflinePermutable (const std::string &fileName) | |
void | permuteLhsMatrix (const sgpp::base::GeneralGridConfiguration &baseGridConfig, const sgpp::base::GeneralGridConfiguration &desiredGridConfig) |
Applies permutation and blow-up approach to undecomposed left-hand side matrix. | |
![]() | |
void | compute_L2_refine_vectors (DataMatrix *mat_refine, Grid *grid, size_t newPoints) |
computes vectors of L2 products of grid points for refinement | |
DBMatOffline (const DBMatOffline &rhs) | |
Copy Constructor. | |
DBMatOffline (const std::string &fileName) | |
Constructor Create offline object from serialized offline object. | |
DBMatOffline (DBMatOffline &&rhs)=default | |
Default move constructor. | |
DataMatrixDistributed & | getDecomposedInverseDistributed () |
Get a reference to the distributed decomposed matrix, analogously to getDecomposedMatrixDistributed() | |
DataMatrix & | getDecomposedMatrix () |
Get a reference to the decomposed matrix. | |
DataMatrixDistributed & | getDecomposedMatrixDistributed () |
Get a reference to the distributed decomposed matrix. | |
virtual size_t | getGridSize () |
Returns the dimensionality of the quadratic lhs matrix (i.e. | |
DataMatrix & | getInverseMatrix () |
Get a reference to the inverse matrix. | |
DataMatrix & | getLhsMatrix_ONLY_FOR_TESTING () |
Allows access to lhs matrix, which is meant ONLY FOR TESTING. | |
DBMatOffline & | operator= (const DBMatOffline &rhs) |
Default copy assign operator. | |
DBMatOffline & | operator= (DBMatOffline &&rhs)=default |
Default move assign operator. | |
void | printMatrix () |
Prints the matrix onto standard output. | |
virtual void | syncDistributedInverse (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) |
Synchronizes the inverse matrix. | |
virtual | ~DBMatOffline ()=default |
Default virtual destructor. | |
Additional Inherited Members | |
![]() | |
std::set< std::set< size_t > > | interactions |
![]() | |
static const std::set< MatrixDecompositionType > | PermutableDecompositions |
Set that contains all permutable decomposition types. | |
![]() | |
std::vector< size_t > | applyPermutation (std::vector< size_t > vector, std::vector< size_t > permutation) |
Applies a permutation stored in an array to a vector. | |
std::vector< size_t > | computePermutation (std::vector< size_t > baseLevel, std::vector< size_t > desiredLevel) |
Computes a permutation to transfer the desired level vector into the base level vector. | |
DBMatOfflinePermutable () | |
void | dimensionBlowUp (const sgpp::base::GeneralGridConfiguration &baseGridConfig, const sgpp::base::GeneralGridConfiguration &desiredGridConfig, sgpp::base::DataMatrix &baseMatrix, bool matrixIsInverse=false) |
In place application of the blow-up method to a base system matrix. | |
size_t | getMatrixIndexForPoint (std::vector< size_t > level, std::vector< size_t > index, std::vector< size_t > gridLevel, const std::vector< size_t > &preComputations) |
Implementation of the inverse numbering function. | |
void | permuteMatrix (const sgpp::base::GeneralGridConfiguration &baseGridConfig, const sgpp::base::GeneralGridConfiguration &desiredGridConfig, const sgpp::base::DataMatrix &baseMatrix, sgpp::base::DataMatrix &permutedMatrix, bool permuteRowsOrColumns) |
Permutes a given sytem matrix with corresponding grid config baseGridConfig to the system matrix corresponding to desiredGridConfig. | |
std::vector< size_t > | preComputeMatrixIndexForPoint (std::vector< size_t > level) |
Precomputation of the factors for the mapping from level and index vectors to matrix. | |
![]() | |
DBMatOffline () | |
void | parseInter (const std::string &fileName, std::set< std::set< size_t > > &interactions) const |
Read the Interactionsterms from a serialized DBMatOfflibe object. | |
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 fileName, 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::base::StringTokenizer::tokenize().
|
overridevirtual |
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(), grid(), q_ortho_matrix_, sgpp::base::DataMatrix::resizeQuadratic(), and t_tridiag_inv_matrix_.
|
overridevirtual |
Interface for the clone idiom.
Implements sgpp::datadriven::DBMatOffline.
|
overridevirtual |
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), getQ(), getTinv(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsInverse, and sgpp::datadriven::DBMatOffline::lhsMatrix.
|
overridevirtual |
parallel/distributed version of compute_inverse()
processGrid | process grid to distribute the matrix on |
parallelConfig |
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::ParallelConfiguration::columnBlockSize_, sgpp::base::DataMatrix::getNrows(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsDistributedInverse, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::datadriven::DataMatrixDistributed::mult(), q_ortho_matrix_distributed_, sgpp::datadriven::ParallelConfiguration::rowBlockSize_, syncDistributedDecomposition(), and t_tridiag_inv_matrix_distributed_.
|
overridevirtual |
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::copyFrom(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::get(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataVector::getSize(), hessenberg_decomposition(), invert_symmetric_tridiag(), sgpp::datadriven::DBMatOffline::isConstructed, sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::RegularizationConfiguration::lambda_, sgpp::datadriven::DBMatOffline::lhsMatrix, q_ortho_matrix_, sgpp::base::DataVector::set(), sgpp::base::DataMatrix::set(), t_diag_, t_subdiag_, and t_tridiag_inv_matrix_.
|
overridevirtual |
The parallel/distributed version of decomposeMatrix(...)
regularizationConfig | the regularization configuration |
densityEstimationConfig | the density estimation configuration |
processGrid | process grid to distribute the matrix on |
parallelConfig |
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::ParallelConfiguration::columnBlockSize_, sgpp::base::DataVector::copyFrom(), sgpp::datadriven::DataMatrixDistributed::fromSharedData(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::get(), sgpp::datadriven::DataMatrixDistributed::get(), sgpp::datadriven::DataMatrixDistributed::getColumnBlockSize(), sgpp::datadriven::DataMatrixDistributed::getDescriptor(), sgpp::datadriven::DataMatrixDistributed::getGlobalCols(), sgpp::datadriven::DataMatrixDistributed::getGlobalRows(), sgpp::datadriven::DataMatrixDistributed::getLocalPointer(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::base::DataVector::getPointer(), sgpp::datadriven::DataMatrixDistributed::getProcessGrid(), sgpp::datadriven::DataMatrixDistributed::getRowBlockSize(), sgpp::base::DataVector::getSize(), invert_symmetric_tridiag(), sgpp::datadriven::DBMatOffline::isConstructed, sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::RegularizationConfiguration::lambda_, sgpp::datadriven::DBMatOffline::lhsDistributed, lhsDistributedSynced, sgpp::datadriven::DBMatOffline::lhsMatrix, q_ortho_matrix_, q_ortho_matrix_distributed_, sgpp::datadriven::ParallelConfiguration::rowBlockSize_, sgpp::base::DataVector::set(), sgpp::base::DataMatrix::set(), sgpp::datadriven::DataMatrixDistributed::set(), sgpp::base::DataMatrix::setAll(), t_diag_, t_subdiag_, t_tridiag_inv_matrix_, t_tridiag_inv_matrix_distributed_, and sgpp::datadriven::DataMatrixDistributed::transpose().
|
overridevirtual |
Returns the decomposition type of the DBMatOffline object.
Implements sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::OrthoAdapt.
|
inline |
|
inline |
References q_ortho_matrix_distributed_.
Referenced by sgpp::datadriven::DBMatOnlineDEOrthoAdapt::solveSLEParallel().
|
inline |
|
inline |
References t_tridiag_inv_matrix_distributed_.
Referenced by sgpp::datadriven::DBMatOnlineDEOrthoAdapt::solveSLEParallel().
|
overridevirtual |
Get the unmodified (without added lambda) system matrix R.
Implements sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::DBMatOffline::lhsMatrix.
|
overridevirtual |
Get the unmodified (without added lambda) distributed system matrix R.
Implements sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::ParallelConfiguration::columnBlockSize_, sgpp::datadriven::DataMatrixDistributed::fromSharedData(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::datadriven::DBMatOffline::lhsDistributed, lhsDistributedSynced, sgpp::datadriven::DBMatOffline::lhsMatrix, and sgpp::datadriven::ParallelConfiguration::rowBlockSize_.
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::copyFrom(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::base::DataVector::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(), sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::base::DataMatrix::set(), and t_tridiag_inv_matrix_.
Referenced by decomposeMatrix(), decomposeMatrixParallel(), updateRegularization(), and updateRegularizationParallel().
|
overridevirtual |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined.
Implements sgpp::datadriven::DBMatOffline.
|
overridevirtual |
First permutes the rows of the orthogonal matrix Q.
I.e. Q' T (Q')^T = (PQ) T (PQ)^T where P is the permutation matrix obtained from the permutation approach. In the second step, the dimension blow-up factor is multiplied to T^{-1}.
baseGridConfig | Grid configuration of the base object |
desiredGridConfig | Grid configuration of the desired object |
Implements sgpp::datadriven::DBMatOfflinePermutable.
References sgpp::datadriven::PermutationUtil::deleteOnesFromLevelVec(), sgpp::datadriven::DBMatOfflinePermutable::dimensionBlowUp(), sgpp::base::DataMatrix::getNrows(), sgpp::base::GeneralGridConfiguration::levelVector_, sgpp::datadriven::DBMatOfflinePermutable::permuteMatrix(), q_ortho_matrix_, and t_tridiag_inv_matrix_.
|
overridevirtual |
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 fileName, sgpp::datadriven::DBMatOffline::getGridSize(), sgpp::base::DataMatrix::getPointer(), q_ortho_matrix_, sgpp::datadriven::DBMatOffline::store(), and t_tridiag_inv_matrix_.
|
overridevirtual |
Override to sync Q and Tinv.
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::ParallelConfiguration::columnBlockSize_, sgpp::datadriven::DataMatrixDistributed::fromSharedData(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::datadriven::DBMatOffline::isDecomposed, q_ortho_matrix_, q_ortho_matrix_distributed_, sgpp::datadriven::ParallelConfiguration::rowBlockSize_, t_tridiag_inv_matrix_, and t_tridiag_inv_matrix_distributed_.
Referenced by compute_inverse_parallel().
|
overridevirtual |
Modifies the decomposition to update the regularization parameter lambda.
lambda | New lambda value |
Implements sgpp::datadriven::DBMatOffline.
References sgpp::base::DataVector::copyFrom(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataVector::getSize(), invert_symmetric_tridiag(), lambda, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::base::DataVector::set(), t_diag_, and t_subdiag_.
|
overridevirtual |
Modifies the parallel decomposition to update the regularization parameter lambda.
lambda | New lambda value |
processGrid | ScaLAPACK process grid |
parallelConfig | Configuration for ScaLAPACK |
Implements sgpp::datadriven::DBMatOffline.
References sgpp::datadriven::ParallelConfiguration::columnBlockSize_, sgpp::base::DataVector::copyFrom(), sgpp::datadriven::DataMatrixDistributed::fromSharedData(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::base::DataVector::getSize(), invert_symmetric_tridiag(), lambda, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::datadriven::ParallelConfiguration::rowBlockSize_, sgpp::base::DataVector::set(), t_diag_, t_subdiag_, t_tridiag_inv_matrix_, and t_tridiag_inv_matrix_distributed_.
|
protected |
Referenced by decomposeMatrixParallel(), and getUnmodifiedRDistributed().
|
protected |
|
protected |
Referenced by compute_inverse_parallel(), decomposeMatrixParallel(), getQDistributed(), and syncDistributedDecomposition().
|
protected |
Referenced by decomposeMatrix(), decomposeMatrixParallel(), updateRegularization(), and updateRegularizationParallel().
|
protected |
Referenced by decomposeMatrix(), decomposeMatrixParallel(), updateRegularization(), and updateRegularizationParallel().
|
protected |
|
protected |