SG++

#include <DBMatOnlineDEOrthoAdapt.hpp>

## Public Member Functions

Adds new DataVector to list of refined points For testing purposes only. More...

Constructor Builds DBMatOnlineDEOrthoAdapt object from given offline object. More...

sgpp::base::DataMatrixgetB ()
Returns the additive component of the sherman-morrison-formula, which yields all the information about the refined points. More...

std::vector< sgpp::base::DataVector > * getRefinedPointsPointer ()
Gets pointer to the container of refined points, only for testing purposes. More...

void sherman_morrison_adapt (size_t newPoints, bool refine, std::vector< size_t > coarsen_indices={})
Rank-one updates/downdates the system matrix, based on the Sherman-Morrison-formula In the current version of the function, the refinePts already are adapted to the regularization parameter lambda. More...

std::vector< size_t > updateSystemMatrixDecomposition (size_t numAddedGridPoints, std::list< size_t > deletedGridPointIndices, double lambda) override

Public Member Functions inherited from sgpp::datadriven::DBMatOnlineDE
void computeDensityFunction (DataMatrix &m, bool save_b=false, bool do_cv=false, std::list< size_t > *deletedPoints=nullptr, size_t newPoints=0)
Computes the density function for a certain data matrix. More...

DBMatOnlineDE (DBMatOffline &offline, double beta=0.)
Constructor. More...

double eval (const DataVector &p, bool force=false)
Evaluates the density function at a certain point. More...

void eval (DataMatrix &values, DataVector &results, bool force=false)
Evaluates the density function on multiple points. More...

DataVectorgetAlpha ()
Return a reference to alpha. More...

double getBestLambda ()
Returns the last best lamda. More...

double getBeta ()
Returns the current weighting factor. More...

bool isComputed ()
Returns if the surplus has already been computed. More...

double normalize (size_t samples=1000)
Normalize the Density. More...

Normalize the Density using Quadrature. More...

void setBeta (double beta)
Sets the weighting factor. More...

void setCrossValidationParameters (int lambda_step, double lambda_start, double lambda_end, DataMatrix *test, DataMatrix *test_cc, bool logscale)
Sets the crossvalidation parameters. More...

void updateAlpha (std::list< size_t > *deletedPoints, size_t newPoints)
Update alpha vector, i.e. More...

Public Member Functions inherited from sgpp::datadriven::DBMatOnline
DBMatOnline (DBMatOffline &o)
Constructor. More...

DBMatOnline (const DBMatOnline &rhs)=delete

DBMatOnline (DBMatOnline &&rhs)=default

DBMatOfflinegetOfflineObject ()
Returns a reference to the offline object. More...

const DBMatOfflinegetOfflineObject () const

DBMatOnlineoperator= (const DBMatOnline &rhs)=delete

DBMatOnlineoperator= (DBMatOnline &&rhs)=default

void setLambda (double lambda)
Changes the weighting factor for the regularization term, if possible (might depend on the kind of decomposition for classification) More...

virtual ~DBMatOnline ()=default
Destructor. More...

## Protected Member Functions

void solveSLE (sgpp::base::DataVector &b, bool do_cv) override
Solves the system (R + lambda*I) * alpha = b, and obtains alpha The solving is done after offline and online phase and works as follows: (R + lambda*I)^{-1} * b = ((Q*T^{-1}*Q^{t} + B) * b = alpha, where B holds the refine/coarsen information. More...

Protected Member Functions inherited from sgpp::datadriven::DBMatOnlineDE
double computeL2Error ()

double resDensity (DataVector &alpha)

## Protected Attributes

bool b_is_refined

size_t current_refine_index

std::vector< sgpp::base::DataVectorrefined_points_

DataVector alpha

double beta

DataVector bSave

DataVector bTotalPoints

bool canCV

bool cvLogscale

bool functionComputed

double lambda

double lambdaEnd

double lambdaStart

int lambdaStep

double normFactor

size_t oDim

DataMatrixtestMat

DataMatrixtestMatRes

size_t totalPoints

DBMatOfflineofflineObject

## Constructor & Destructor Documentation

 sgpp::datadriven::DBMatOnlineDEOrthoAdapt::DBMatOnlineDEOrthoAdapt ( sgpp::datadriven::DBMatOffline & offline, double beta = 0. )
explicit

Constructor Builds DBMatOnlineDEOrthoAdapt object from given offline object.

Parameters
 offline The offline object beta The initial weighting factor

## Member Function Documentation

inline

Adds new DataVector to list of refined points For testing purposes only.

Parameters

References refined_points_.

inline

Returns the additive component of the sherman-morrison-formula, which yields all the information about the refined points.

inline

Gets pointer to the container of refined points, only for testing purposes.

 void sgpp::datadriven::DBMatOnlineDEOrthoAdapt::sherman_morrison_adapt ( size_t newPoints, bool refine, std::vector< size_t > coarsen_indices = {} )

Rank-one updates/downdates the system matrix, based on the Sherman-Morrison-formula In the current version of the function, the refinePts already are adapted to the regularization parameter lambda.

Parameters
 newPoints number of refined points refine decides: true for refine, false for coarsen coarsen_indices the indices of points to coarsen

overrideprotectedvirtual

Solves the system (R + lambda*I) * alpha = b, and obtains alpha The solving is done after offline and online phase and works as follows: (R + lambda*I)^{-1} * b = ((Q*T^{-1}*Q^{t} + B) * b = alpha, where B holds the refine/coarsen information.

Parameters
 b The right hand side of the system do_cv Specifies, if cross-validation should be done (todo: currently not implemented)

overridevirtual
Parameters
 numAddedGridPoints Number of grid points inserted at the end of the grid storage deletedGridPointIndices Indices of grid points that were deleted lambda The last best lambda value
Returns
list of grid points, that cannot be coarsened

Referenced by getRefinedPointsPointer().