SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::datadriven::DBMatOfflineChol Class Reference

DBMatOffline specialization that uses a cholesky factorization on a dense matrix. More...

#include <DBMatOfflineChol.hpp>

Inheritance diagram for sgpp::datadriven::DBMatOfflineChol:
sgpp::datadriven::DBMatOfflineGE sgpp::datadriven::DBMatOffline sgpp::datadriven::DBMatOfflineDenseIChol

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.
 
DBMatOfflineclone () const override
 Interface for the clone idiom.
 
void compute_inverse () override
 
void compute_inverse_parallel (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration &parallelConfig) override
 parallel/distributed version of compute_inverse()
 
 DBMatOfflineChol ()
 
 DBMatOfflineChol (const std::string &fileName)
 
void decomposeMatrix (const RegularizationConfiguration &regularizationConfig, const DensityEstimationConfiguration &densityEstimationConfig) override
 Decomposes the matrix according to the chosen decomposition type.
 
void decomposeMatrixParallel (RegularizationConfiguration &regularizationConfig, DensityEstimationConfiguration &densityEstimationConfig, std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration &parallelConfig) override
 The parallel/distributed version of decomposeMatrix(...)
 
sgpp::datadriven::MatrixDecompositionType getDecompositionType () override
 Returns the decomposition type of the DBMatOffline object.
 
const DataMatrixgetUnmodifiedR () override
 Get the unmodified (without added lambda) system matrix R.
 
const DataMatrixDistributedgetUnmodifiedRDistributed (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration &parallelConfig) 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 &parallelConfig) override
 Modifies the parallel decomposition to update the regularization parameter lambda.
 
- Public Member Functions inherited from sgpp::datadriven::DBMatOfflineGE
void buildMatrix (Grid *grid, const RegularizationConfiguration &regularizationConfig) override
 Builds the right hand side matrix with identity regularization term.
 
 DBMatOfflineGE (const std::string &fileName)
 
- Public Member Functions inherited from sgpp::datadriven::DBMatOffline
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.
 
DataMatrixDistributedgetDecomposedInverseDistributed ()
 Get a reference to the distributed decomposed matrix, analogously to getDecomposedMatrixDistributed()
 
DataMatrixgetDecomposedMatrix ()
 Get a reference to the decomposed matrix.
 
DataMatrixDistributedgetDecomposedMatrixDistributed ()
 Get a reference to the distributed decomposed matrix.
 
virtual size_t getGridSize ()
 Returns the dimensionality of the quadratic lhs matrix (i.e.
 
DataMatrixgetInverseMatrix ()
 Get a reference to the inverse matrix.
 
DataMatrixgetLhsMatrix_ONLY_FOR_TESTING ()
 Allows access to lhs matrix, which is meant ONLY FOR TESTING.
 
DBMatOfflineoperator= (const DBMatOffline &rhs)
 Default copy assign operator.
 
DBMatOfflineoperator= (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 &parallelConfig)
 Synchronizes the decomposed matrix.
 
virtual void syncDistributedInverse (std::shared_ptr< BlacsProcessGrid > processGrid, const ParallelConfiguration &parallelConfig)
 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.
 
- Protected Member Functions inherited from sgpp::datadriven::DBMatOfflineGE
 DBMatOfflineGE ()
 
- Protected Member Functions inherited from sgpp::datadriven::DBMatOffline
 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

- Public Attributes inherited from sgpp::datadriven::DBMatOffline
std::set< std::set< size_t > > interactions
 
- Protected Attributes inherited from sgpp::datadriven::DBMatOffline
bool isConstructed
 
bool isDecomposed
 
DataMatrixDistributed lhsDistributed
 
DataMatrixDistributed lhsDistributedInverse
 
DataMatrix lhsInverse
 
DataMatrix lhsMatrix
 

Detailed Description

DBMatOffline specialization that uses a cholesky factorization on a dense matrix.

The resulting factorization can be updated when the grid changes.

Constructor & Destructor Documentation

◆ DBMatOfflineChol() [1/2]

sgpp::datadriven::DBMatOfflineChol::DBMatOfflineChol ( )

◆ DBMatOfflineChol() [2/2]

sgpp::datadriven::DBMatOfflineChol::DBMatOfflineChol ( const std::string &  fileName)
explicit

Member Function Documentation

◆ choleskyAddPoint()

void sgpp::datadriven::DBMatOfflineChol::choleskyAddPoint ( DataVector newCol,
size_t  size 
)
protected

Updates the cholesky factor when a new grid point is added (e.g.

refine)

Parameters
newColDataVector with column to add to the system matrix
sizecolumns/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().

◆ choleskyModification()

void sgpp::datadriven::DBMatOfflineChol::choleskyModification ( Grid grid,
datadriven::DensityEstimationConfiguration densityEstimationConfig,
size_t  newPoints,
std::vector< size_t > &  deletedPoints,
double  lambda 
)
virtual

Updates offline cholesky factorization based on coarsed (deletedPoints) and refined (newPoints) gridPoints.

Parameters
gridthe underlying grid
densityEstimationConfigconfiguration for the density estimation
newPointsamount of refined points
deletedPointslist of indices of last coarsed points
lambdathe 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().

◆ choleskyPermutation()

void sgpp::datadriven::DBMatOfflineChol::choleskyPermutation ( size_t  k,
size_t  l,
size_t  job 
)
protected

Permutes the rows of the cholesky factor based on permutations of the system matrix (e.g.

coarsening)

Parameters
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().

◆ clone()

DBMatOffline * sgpp::datadriven::DBMatOfflineChol::clone ( ) const
overridevirtual

Interface for the clone idiom.

Returns
a copy of this very object as a pointer to a new DBMatOffline object which is owned by the caller.

Implements sgpp::datadriven::DBMatOffline.

Reimplemented in sgpp::datadriven::DBMatOfflineDenseIChol.

◆ compute_inverse()

◆ compute_inverse_parallel()

◆ decomposeMatrix()

void sgpp::datadriven::DBMatOfflineChol::decomposeMatrix ( const RegularizationConfiguration regularizationConfig,
const DensityEstimationConfiguration densityEstimationConfig 
)
overridevirtual

Decomposes the matrix according to the chosen decomposition type.

The number of rows of the stored result depends on the decomposition type.

Parameters
regularizationConfigthe regularization configuration
densityEstimationConfigthe 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().

◆ decomposeMatrixParallel()

void sgpp::datadriven::DBMatOfflineChol::decomposeMatrixParallel ( RegularizationConfiguration regularizationConfig,
DensityEstimationConfiguration densityEstimationConfig,
std::shared_ptr< BlacsProcessGrid processGrid,
const ParallelConfiguration parallelConfig 
)
overridevirtual

◆ getDecompositionType()

sgpp::datadriven::MatrixDecompositionType sgpp::datadriven::DBMatOfflineChol::getDecompositionType ( )
overridevirtual

Returns the decomposition type of the DBMatOffline object.

Returns
the type of matrix decomposition

Implements sgpp::datadriven::DBMatOffline.

Reimplemented in sgpp::datadriven::DBMatOfflineDenseIChol.

References sgpp::datadriven::Chol.

◆ getUnmodifiedR()

const DataMatrix & sgpp::datadriven::DBMatOfflineChol::getUnmodifiedR ( )
inlineoverridevirtual

Get the unmodified (without added lambda) system matrix R.

Returns
Matrix R

Implements sgpp::datadriven::DBMatOffline.

◆ getUnmodifiedRDistributed()

const DataMatrixDistributed & sgpp::datadriven::DBMatOfflineChol::getUnmodifiedRDistributed ( std::shared_ptr< BlacsProcessGrid processGrid,
const ParallelConfiguration parallelConfig 
)
inlineoverridevirtual

Get the unmodified (without added lambda) system matrix R.

Returns
Matrix R

Implements sgpp::datadriven::DBMatOffline.

◆ isRefineable()

bool sgpp::datadriven::DBMatOfflineChol::isRefineable ( )
overridevirtual

Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined.

Returns
true if object can be refined, else false;

Implements sgpp::datadriven::DBMatOffline.

◆ updateRegularization()

void sgpp::datadriven::DBMatOfflineChol::updateRegularization ( double  lambda)
inlineoverridevirtual

Modifies the decomposition to update the regularization parameter lambda.

Parameters
lambdaNew lambda value

Implements sgpp::datadriven::DBMatOffline.

◆ updateRegularizationParallel()

void sgpp::datadriven::DBMatOfflineChol::updateRegularizationParallel ( double  lambda,
std::shared_ptr< BlacsProcessGrid processGrid,
const ParallelConfiguration parallelConfig 
)
inlineoverridevirtual

Modifies the parallel decomposition to update the regularization parameter lambda.

Parameters
lambdaNew lambda value
processGridScaLAPACK process grid
parallelConfigConfiguration for ScaLAPACK

Implements sgpp::datadriven::DBMatOffline.


The documentation for this class was generated from the following files: