SG++

#include <DBMatOfflineOrthoAdapt.hpp>

## Public Member Functions

void buildMatrix ()
Builds the left hand side matrix without the regularization term. More...

DBMatOfflineclone ()
Interface for the clone idiom. More...

Constructor Builds DBMatOfflineOrthoAdapt Object from configuration. More...

Constructor Builds object from serialized offline object, stored in file. More...

void decomposeMatrix ()
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...

size_t & getDimA ()

double getLambda ()

sgpp::base::DataMatrixgetQ ()

sgpp::base::DataMatrixgetTinv ()

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)

Public Member Functions inherited from sgpp::datadriven::DBMatOffline
Constructor Build DBMatOffline Object from configuration. 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...

Get a reference to the grid adaptivity configuration object. More...

DataMatrixgetDecomposedMatrix ()
Get a reference to the decomposed matrix. More...

Get a reference to the matrix decomposition configuration object. More...

GridgetGrid ()
Returns a reference to the sparse grid. More...

sgpp::base::RegularGridConfigurationgetGridConfig ()
Get a reference to the grid configuration object. More...

DataMatrixgetLhsMatrix_ONLY_FOR_TESTING ()
Allows access to lhs matrix, which is meant ONLY FOR TESTING. More...

Get a reference to the grid regularization configuration object. More...

DBMatOfflineoperator= (const DBMatOffline &rhs)
Default copy assign operator. More...

DBMatOfflineoperator= (DBMatOffline &&rhs)=default
Default move assign operator. More...

void printMatrix ()
Prints the matrix onto standard output. More...

void setInter (std::vector< std::vector< size_t >> interactions)
Sets interaction Term. More...

virtual ~DBMatOffline ()=default
Default virtual destructor. More...

## Protected Attributes

size_t dim_a

double lambda

sgpp::base::DataMatrix q_ortho_matrix_

sgpp::base::DataMatrix t_tridiag_inv_matrix_

std::unique_ptr< Gridgrid
An offline object works on a hierarchical basis grid. More...

sgpp::base::RegularGridConfiguration gridConfig

bool isConstructed

bool isDecomposed

DataMatrix lhsMatrix

std::vector< std::vector< size_t > > interactions

Protected Member Functions inherited from sgpp::datadriven::DBMatOffline
DBMatOffline ()

void InitializeGrid ()
Build the initial sparse grid. More...

Read the configuration from a serialized DBMatOffline object. More...

void parseInter (const std::string &fileName, std::vector< std::vector< size_t >> &interactions) const
Read the Interactionsterms from a serialized DBMatOfflibe object. More...

## Constructor & Destructor Documentation

explicit

Constructor Builds DBMatOfflineOrthoAdapt Object from configuration.

Parameters
 gridConfig The configuration of the grid adaptivityConfig The configuration of the grid adaptivity regularizationConfig The configuration of the grid regularization densityEstimationConfig The configuration of the matrix decomposition
explicit

Constructor Builds object from serialized offline object, stored in file.

Parameters
 fileName path to the file storing object

## Member Function Documentation

virtual

Builds the left hand side matrix without the regularization term.

virtual

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.

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

inline

References dim_a.

inline

References lambda.

inline
inline

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

Parameters
 diag Diagonal entries of T subdiag Sub- and superdiagonal entries of T (symmetric)

Referenced by decomposeMatrix().

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.

Parameters
 diag Diagonal entries of T subdiag Sub- and superdiagonal entries of T (symmetric)

Referenced by decomposeMatrix().

overridevirtual

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

Returns
true if object can be refined, else false;

virtual

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

Parameters
 fileName path where to store the file