SG++

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>

## Public Member Functions

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

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...

virtual void decomposeMatrix ()=0
Decomposes the matrix according to the chosen decomposition type. 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...

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...

void setInter (std::vector< std::vector< size_t >> interactions)
Sets interaction Term. 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 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...

## Protected Attributes

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

sgpp::base::RegularGridConfiguration gridConfig

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

explicit

Constructor Build DBMatOffline 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

References interactions.

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

Constructor Create offline object from serialized offline object.

Parameters
 fileName path to the file that stores serialized offline object
 sgpp::datadriven::DBMatOffline::DBMatOffline ( const DBMatOffline & rhs )

Copy Constructor.

Parameters
 rhs Object to copy

References grid.

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

Default move constructor.

virtualdefault

Default virtual destructor.

protected

References interactions.

## Member Function Documentation

virtual

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

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.
pure virtual

Decomposes the matrix according to the chosen decomposition type.

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

Get a reference to the grid adaptivity configuration object.

Returns

Get a reference to the decomposed matrix.

Throws if matrix has not yet been decomposed.

Returns
decomposed matrix

References isDecomposed, and lhsMatrix.

Get a reference to the matrix decomposition configuration object.

Returns
Matrix decomposition configuration object

References densityEstimationConfig.

Get a reference to the grid configuration object.

Returns
Grid configuration object

References gridConfig.

References lhsMatrix.

Get a reference to the grid regularization configuration object.

Returns
Grid regularization configuration object

References regularizationConfig.

protected

Build the initial sparse grid.

Referenced by buildMatrix(), and DBMatOffline().

pure virtual

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

Returns
true if object can be refined, else false;

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

Default copy assign operator.

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

Default move assign operator.

protected

Read the configuration from a serialized DBMatOffline object.

Parameters
 fileName path of the serialized DBMatOffline object gridConfig The configuration of the grid of the file to populate adaptivityConfig The configuration of the grid adaptivity of the file to populate regularizationConfig The configuration of the grid regularization of the file to populate densityEstimationConfig The configuration of the matrix decomposition of the file to populate

Referenced by DBMatOffline().

 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
 fileName path of the serialized DBMatOffline object interactions the interactions to populate

Referenced by DBMatOffline().

Prints the matrix onto standard output.

 void sgpp::datadriven::DBMatOffline::setInter ( std::vector< std::vector< size_t >> interactions )

Sets interaction Term.

Parameters
 interactions Interaction terms used for geometrically aware grids

References interactions.

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

Serialize the DBMatOffline Object.

Parameters
 fileName path where to store the file.

protected
protected