![]() |
SG++-Doxygen-Documentation
|
DBMatOffline specialization that uses a cholesky factorization on a dense matrix. More...
#include <DBMatOfflineChol.hpp>
Public Member Functions | |
virtual void | choleskyModification (Grid &grid, datadriven::DensityEstimationConfiguration &densityEstimationConfig, size_t newPoints, std::vector< size_t > &deletedPoints, double lambda) |
Updates offline cholesky factorization based on coarsed (deletedPoints) and refined (newPoints) gridPoints. | |
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() | |
DBMatOfflineChol () | |
DBMatOfflineChol (const std::string &fileName) | |
void | decomposeMatrix (const RegularizationConfiguration ®ularizationConfig, const DensityEstimationConfiguration &densityEstimationConfig) override |
Decomposes the matrix according to the chosen decomposition type. | |
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. | |
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) system matrix R. | |
bool | isRefineable () override |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined. | |
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. | |
![]() | |
void | buildMatrix (Grid *grid, const RegularizationConfiguration ®ularizationConfig) override |
Builds the right hand side matrix with identity regularization term. | |
DBMatOfflineGE (const std::string &fileName) | |
![]() | |
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 | store (const std::string &fileName) |
Serialize the DBMatOffline Object. | |
virtual void | syncDistributedDecomposition (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) |
Synchronizes the decomposed matrix. | |
virtual void | syncDistributedInverse (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration ¶llelConfig) |
Synchronizes the inverse matrix. | |
virtual | ~DBMatOffline ()=default |
Default virtual destructor. | |
Protected Member Functions | |
void | choleskyAddPoint (DataVector &newCol, size_t size) |
Updates the cholesky factor when a new grid point is added (e.g. | |
void | choleskyPermutation (size_t k, size_t l, size_t job) |
Permutes the rows of the cholesky factor based on permutations of the system matrix (e.g. | |
![]() | |
DBMatOfflineGE () | |
![]() | |
DBMatOffline () | |
void | parseInter (const std::string &fileName, std::set< std::set< size_t > > &interactions) const |
Read the Interactionsterms from a serialized DBMatOfflibe object. | |
Additional Inherited Members | |
![]() | |
std::set< std::set< size_t > > | interactions |
![]() | |
bool | isConstructed |
bool | isDecomposed |
DataMatrixDistributed | lhsDistributed |
DataMatrixDistributed | lhsDistributedInverse |
DataMatrix | lhsInverse |
DataMatrix | lhsMatrix |
DBMatOffline specialization that uses a cholesky factorization on a dense matrix.
The resulting factorization can be updated when the grid changes.
sgpp::datadriven::DBMatOfflineChol::DBMatOfflineChol | ( | ) |
|
explicit |
|
protected |
Updates the cholesky factor when a new grid point is added (e.g.
refine)
newCol | DataVector with column to add to the system matrix |
size | columns/rows of current Cholesky factor, necessary since the allocated memory is increased before the Cholesky factor is modified |
References sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::base::DataVector::getPointer(), sgpp::base::DataVector::getSize(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsMatrix, m, sgpp::base::DataVector::resizeZero(), sgpp::base::DataVector::set(), sgpp::base::DataMatrix::setColumn(), and sgpp::base::DataMatrix::setRow().
Referenced by choleskyModification().
|
virtual |
Updates offline cholesky factorization based on coarsed (deletedPoints) and refined (newPoints) gridPoints.
grid | the underlying grid |
densityEstimationConfig | configuration for the density estimation |
newPoints | amount of refined points |
deletedPoints | list of indices of last coarsed points |
lambda | the regularization parameter |
Reimplemented in sgpp::datadriven::DBMatOfflineDenseIChol.
References choleskyAddPoint(), choleskyPermutation(), sgpp::datadriven::DBMatDMSChol::choleskyUpdate(), sgpp::datadriven::DBMatOffline::compute_L2_refine_vectors(), sgpp::base::DataMatrix::copyFrom(), sgpp::base::DataMatrix::get(), sgpp::base::DataMatrix::getColumn(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getSize(), grid(), lambda, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::base::DataMatrix::resizeQuadratic(), sgpp::base::DataMatrix::resizeToSubMatrix(), sgpp::base::DataVector::resizeZero(), and sgpp::base::DataMatrix::set().
|
protected |
Permutes the rows of the cholesky factor based on permutations of the system matrix (e.g.
coarsening)
k | "left" column to permutate |
l | "right" column to permutate |
job | = 2 => left circular shift 1,...,k-1,k,k+1, ..., l-1,l,l+1, ..,size => 1,...,k-1,k+1, ..., l-1,l,k,l+1,..., size job = 1 => right circular shift 1,...,k-1,k,k+1, ..., l-1,l,l+1,...size => 1,...,k-1,l,k,k+1, ..., l-1,l+1,...size |
References sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsMatrix, and m.
Referenced by choleskyModification().
|
overridevirtual |
Interface for the clone idiom.
Implements sgpp::datadriven::DBMatOffline.
Reimplemented in sgpp::datadriven::DBMatOfflineDenseIChol.
|
overridevirtual |
Reimplemented from sgpp::datadriven::DBMatOffline.
References sgpp::base::DataMatrix::copyFrom(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsInverse, sgpp::datadriven::DBMatOffline::lhsMatrix, and m.
|
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::datadriven::DataMatrixDistributed::fromSharedData(), sgpp::datadriven::DataMatrixDistributed::get(), sgpp::datadriven::DataMatrixDistributed::getGlobalCols(), sgpp::datadriven::DataMatrixDistributed::getGlobalRows(), sgpp::datadriven::DataMatrixDistributed::getLocalPointer(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsDistributedInverse, sgpp::datadriven::DBMatOffline::lhsInverse, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::datadriven::ParallelConfiguration::rowBlockSize_, sgpp::datadriven::DataMatrixDistributed::set(), sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrix(), and sgpp::datadriven::DataMatrixDistributed::transpose().
|
overridevirtual |
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 |
Implements sgpp::datadriven::DBMatOffline.
Reimplemented in sgpp::datadriven::DBMatOfflineDenseIChol.
References sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::isConstructed, sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsMatrix, m, and sgpp::base::DataMatrix::set().
|
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::datadriven::DataMatrixDistributed::fromSharedData(), sgpp::datadriven::DataMatrixDistributed::getLocalPointer(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getPointer(), sgpp::datadriven::DBMatOffline::isConstructed, sgpp::datadriven::DBMatOffline::isDecomposed, sgpp::datadriven::DBMatOffline::lhsDistributed, sgpp::datadriven::DBMatOffline::lhsMatrix, sgpp::datadriven::ParallelConfiguration::rowBlockSize_, sgpp::datadriven::DataMatrixDistributed::toLocalDataMatrixBroadcast(), and sgpp::datadriven::DataMatrixDistributed::transpose().
|
overridevirtual |
Returns the decomposition type of the DBMatOffline object.
Implements sgpp::datadriven::DBMatOffline.
Reimplemented in sgpp::datadriven::DBMatOfflineDenseIChol.
References sgpp::datadriven::Chol.
|
inlineoverridevirtual |
Get the unmodified (without added lambda) system matrix R.
Implements sgpp::datadriven::DBMatOffline.
|
inlineoverridevirtual |
Get the unmodified (without added lambda) system matrix R.
Implements sgpp::datadriven::DBMatOffline.
|
overridevirtual |
Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined.
Implements sgpp::datadriven::DBMatOffline.
|
inlineoverridevirtual |
Modifies the decomposition to update the regularization parameter lambda.
lambda | New lambda value |
Implements sgpp::datadriven::DBMatOffline.
|
inlineoverridevirtual |
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.