SG++-Doxygen-Documentation
sgpp::datadriven::DBMatOffline Class Referenceabstract

Class that is used to decompose and store the left-hand-side matrix for the density based classification approach (The classification is divided into two parts: the offline step that does not depend on the actual data and the online step that depends on the data). More...

#include <DBMatOffline.hpp>

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

Public Member Functions

virtual void buildMatrix (Grid *grid, RegularizationConfiguration &regularizationConfig)
 Builds the right hand side matrix with or without the regularization term depending on the type of decomposition. More...
 
virtual DBMatOfflineclone ()=0
 Interface for the clone idiom. 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...
 
virtual void decomposeMatrix (RegularizationConfiguration &regularizationConfig, DensityEstimationConfiguration &densityEstimationConfig)=0
 Decomposes the matrix according to the chosen decomposition type. More...
 
DataMatrixgetDecomposedMatrix ()
 Get a reference to the decomposed matrix. More...
 
virtual sgpp::datadriven::MatrixDecompositionType getDecompositionType ()=0
 Returns the decomposition type of the DBMatOffline object. More...
 
virtual size_t getGridSize ()
 Returns the dimensionality of the quadratic lhs matrix (i.e. More...
 
DataMatrixgetLhsMatrix_ONLY_FOR_TESTING ()
 Allows access to lhs matrix, which is meant ONLY FOR TESTING. More...
 
virtual bool isRefineable ()=0
 Only Offline objects based on Cholesky decomposition, or orthogonal adaptivity can be refined. 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...
 
virtual void store (const std::string &fileName)
 Serialize the DBMatOffline Object. More...
 
virtual ~DBMatOffline ()=default
 Default virtual destructor. More...
 

Public Attributes

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

Protected Member Functions

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

Protected Attributes

bool isConstructed
 
bool isDecomposed
 
DataMatrix lhsMatrix
 

Detailed Description

Class that is used to decompose and store the left-hand-side matrix for the density based classification approach (The classification is divided into two parts: the offline step that does not depend on the actual data and the online step that depends on the data).

Uses Gnu Scientific Library (GSL).

Constructor & Destructor Documentation

◆ DBMatOffline() [1/4]

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

Constructor Create offline object from serialized offline object.

Parameters
fileNamepath to the file that stores serialized offline object

References interactions, and parseInter().

◆ DBMatOffline() [2/4]

sgpp::datadriven::DBMatOffline::DBMatOffline ( const DBMatOffline rhs)

Copy Constructor.

Parameters
rhsObject to copy

◆ DBMatOffline() [3/4]

sgpp::datadriven::DBMatOffline::DBMatOffline ( DBMatOffline &&  rhs)
default

Default move constructor.

◆ ~DBMatOffline()

virtual sgpp::datadriven::DBMatOffline::~DBMatOffline ( )
virtualdefault

Default virtual destructor.

◆ DBMatOffline() [4/4]

sgpp::datadriven::DBMatOffline::DBMatOffline ( )
protected

References interactions.

Member Function Documentation

◆ buildMatrix()

void sgpp::datadriven::DBMatOffline::buildMatrix ( Grid grid,
RegularizationConfiguration regularizationConfig 
)
virtual

Builds the right hand side matrix with or without the regularization term depending on the type of decomposition.

Parameters
gridThe grid object the matrix is based on
regularizationConfigConfigures the regularization which is incorporated into the lhs

Reimplemented in sgpp::datadriven::DBMatOfflineOrthoAdapt, and sgpp::datadriven::DBMatOfflineGE.

References sgpp::op_factory::createOperationLTwoDotExplicit(), sgpp::base::HashGridStorage::getSize(), sgpp::base::Grid::getStorage(), isConstructed, and lhsMatrix.

Referenced by sgpp::datadriven::DBMatOfflineGE::buildMatrix(), sgpp::datadriven::DBMatOfflineOrthoAdapt::buildMatrix(), sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), and main().

◆ clone()

virtual DBMatOffline* sgpp::datadriven::DBMatOffline::clone ( )
pure 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.

Implemented in sgpp::datadriven::DBMatOfflineChol, sgpp::datadriven::DBMatOfflineDenseIChol, and sgpp::datadriven::DBMatOfflineOrthoAdapt.

◆ decomposeMatrix()

virtual void sgpp::datadriven::DBMatOffline::decomposeMatrix ( RegularizationConfiguration regularizationConfig,
DensityEstimationConfiguration densityEstimationConfig 
)
pure virtual

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

Implemented in sgpp::datadriven::DBMatOfflineOrthoAdapt, sgpp::datadriven::DBMatOfflineChol, and sgpp::datadriven::DBMatOfflineDenseIChol.

Referenced by sgpp::datadriven::ModelFittingDensityEstimationOnOff::fit(), and main().

◆ getDecomposedMatrix()

DataMatrix & sgpp::datadriven::DBMatOffline::getDecomposedMatrix ( )

◆ getDecompositionType()

◆ getGridSize()

size_t sgpp::datadriven::DBMatOffline::getGridSize ( )
virtual

◆ getLhsMatrix_ONLY_FOR_TESTING()

sgpp::base::DataMatrix & sgpp::datadriven::DBMatOffline::getLhsMatrix_ONLY_FOR_TESTING ( )

Allows access to lhs matrix, which is meant ONLY FOR TESTING.

References lhsMatrix.

◆ isRefineable()

virtual bool sgpp::datadriven::DBMatOffline::isRefineable ( )
pure virtual

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

Returns
true if object can be refined, else false;

Implemented in sgpp::datadriven::DBMatOfflineChol, and sgpp::datadriven::DBMatOfflineOrthoAdapt.

◆ operator=() [1/2]

DBMatOffline & sgpp::datadriven::DBMatOffline::operator= ( const DBMatOffline rhs)

Default copy assign operator.

References interactions, isConstructed, isDecomposed, and lhsMatrix.

◆ operator=() [2/2]

DBMatOffline& sgpp::datadriven::DBMatOffline::operator= ( DBMatOffline &&  rhs)
default

Default move assign operator.

◆ parseInter()

void sgpp::datadriven::DBMatOffline::parseInter ( const std::string &  fileName,
std::vector< std::vector< size_t >> &  interactions 
) const
protected

Read the Interactionsterms from a serialized DBMatOfflibe object.

Parameters
fileNamepath of the serialized DBMatOffline object
interactionsthe interactions to populate

References analyse_erg::file, python.statsfileInfo::i, interactions, python.utils.statsfile2gnuplot::j, analyse_erg::tmp, and sgpp::datadriven::StringTokenizer::tokenize().

Referenced by DBMatOffline().

◆ printMatrix()

void sgpp::datadriven::DBMatOffline::printMatrix ( )

◆ store()

void sgpp::datadriven::DBMatOffline::store ( const std::string &  fileName)
virtual

Member Data Documentation

◆ interactions

std::vector<std::vector <size_t> > sgpp::datadriven::DBMatOffline::interactions

◆ isConstructed

◆ isDecomposed

◆ lhsMatrix


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