SG++-Doxygen-Documentation
sgpp::base::BoundingBox Class Reference

This class implements the boundaries of the sparse grid. More...

#include <BoundingBox.hpp>

Inheritance diagram for sgpp::base::BoundingBox:
sgpp::base::Stretching

Public Member Functions

 BoundingBox (size_t dimension)
 Constructor for BoundingBox. More...
 
 BoundingBox (const std::vector< BoundingBox1D > &boundingBox1Ds)
 Constructor for BoundingBox. More...
 
const BoundingBox1DgetBoundary (size_t d) const
 Returns the left and right boundary for a specific dimension. More...
 
size_t getDimension () const
 Returns the number of dimensions of this bounding box. More...
 
double getIntervalOffset (size_t d) const
 Returns the offset in positive x-direction of the interval in one dimension. More...
 
double getIntervalWidth (size_t d) const
 Calculates the width of the interval in one dimension. More...
 
bool hasDirichletBoundaryLeft (size_t d) const
 Determines if the interval in the specified dimension has left Dirichlet boundary conditions. More...
 
bool hasDirichletBoundaryRight (size_t d) const
 Determines if the interval in the specified dimension has right Dirichlet boundary conditions. More...
 
bool isContainingPoint (DataVector &point) const
 Check whether the BoundingBox contains a given point. More...
 
bool isContainingPoint (size_t d, double point) const
 Check whether the BoundingBox contains a given point in a specific dimension. More...
 
bool isUnitCube () const
 Determine if this bounding box describes the unit cube \([0, 1]^d\). More...
 
virtual std::string serialize (int version=SERIALIZATION_VERSION) const
 Serialize the BoundingBox into a string. More...
 
virtual void serialize (std::ostream &ostream, int version=SERIALIZATION_VERSION) const
 Serialize the BoundingBox into a stream. More...
 
void setBoundary (size_t d, const BoundingBox1D &boundingBox1D)
 Sets left and right boundary for a specific dimension. More...
 
void toString (std::string &text) const
 Converts the BoundingBox to a string. More...
 
std::string toString () const
 Converts the BoundingBox to a string. More...
 
void transformPointsToBoundingBox (DataMatrix &points) const
 Transform points in the unit cube \([0, 1]^d\) to points in the BoundingBox. More...
 
void transformPointsToUnitCube (DataMatrix &points) const
 Transform points in the BoundingBox to points in the unit cube \([0, 1]^d\). More...
 
void transformPointToBoundingBox (DataVector &point) const
 Transform a point in the unit cube \([0, 1]^d\) to a point in the BoundingBox. More...
 
double transformPointToBoundingBox (size_t d, double point) const
 Transform a point in the unit interval \([0, 1]\) to a point in the BoundingBox in 1D. More...
 
void transformPointToUnitCube (DataVector &point) const
 Transform a point in the BoundingBox to a point in the unit cube \([0, 1]^d\). More...
 
double transformPointToUnitCube (size_t d, double point) const
 Transform a point in the BoundingBox to a point in the unit interval \([0, 1]\) in 1D. More...
 
virtual void unserialize (const std::string &istr, int version)
 Unserialize from a string. More...
 
virtual void unserialize (std::istream &istr, int version)
 Unserialize from a stream. More...
 
virtual ~BoundingBox ()
 Destructor. More...
 

Protected Attributes

std::vector< BoundingBox1DboundingBox1Ds
 Array that contains all left boundaries for all dimensions. More...
 
size_t dimension
 the number of dimensions used with the grid More...
 

Detailed Description

This class implements the boundaries of the sparse grid.

Internally the grid is set up on a trivial cube.

This class gives the class gives the opportunity to stretch this cube in every dimension separately.

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

sgpp::base::BoundingBox::BoundingBox ( size_t  dimension)
explicit

Constructor for BoundingBox.

initializes the Bounding with a N-d trivial cube

Parameters
dimensionnumber of the dimensions used with the grid

◆ BoundingBox() [2/2]

sgpp::base::BoundingBox::BoundingBox ( const std::vector< BoundingBox1D > &  boundingBox1Ds)
explicit

Constructor for BoundingBox.

initializes the Bounding with specific values for all dimensions

Parameters
boundingBox1Dsarray that contains all boundaries

◆ ~BoundingBox()

sgpp::base::BoundingBox::~BoundingBox ( )
virtual

Destructor.

Member Function Documentation

◆ getBoundary()

◆ getDimension()

◆ getIntervalOffset()

◆ getIntervalWidth()

double sgpp::base::BoundingBox::getIntervalWidth ( size_t  d) const
inline

Calculates the width of the interval in one dimension.

Parameters
dthe dimension in which the width of the interval should be determined
Returns
width of the interval

Referenced by sgpp::base::OperationQuadratureLinearClenshawCurtis::doQuadrature(), sgpp::base::OperationQuadratureModLinear::doQuadrature(), sgpp::base::OperationQuadratureModLinearClenshawCurtis::doQuadrature(), sgpp::base::OperationQuadratureLinear::doQuadrature(), sgpp::base::OperationQuadratureLinearClenshawCurtisBoundary::doQuadrature(), sgpp::base::OperationQuadratureModPolyClenshawCurtis::doQuadrature(), sgpp::base::OperationQuadraturePolyClenshawCurtis::doQuadrature(), sgpp::base::OperationQuadraturePolyClenshawCurtisBoundary::doQuadrature(), sgpp::base::OperationQuadratureFundamentalSpline::doQuadrature(), sgpp::base::OperationQuadratureBsplineBoundary::doQuadrature(), sgpp::base::OperationQuadratureBsplineClenshawCurtis::doQuadrature(), sgpp::base::OperationQuadratureLinearBoundary::doQuadrature(), sgpp::base::OperationQuadratureModBsplineClenshawCurtis::doQuadrature(), sgpp::base::OperationQuadratureModBspline::doQuadrature(), sgpp::base::OperationQuadratureModFundamentalSpline::doQuadrature(), sgpp::base::OperationQuadraturePolyBoundary::doQuadrature(), sgpp::base::OperationQuadratureBspline::doQuadrature(), sgpp::base::OperationQuadratureModPoly::doQuadrature(), sgpp::base::OperationQuadraturePoly::doQuadrature(), sgpp::base::OperationQuadratureMC::doQuadrature(), sgpp::base::OperationQuadratureMC::doQuadratureFunc(), sgpp::base::OperationQuadratureMC::doQuadratureL2Error(), sgpp::base::OperationEvalGradientWaveletNaive::evalGradient(), sgpp::base::OperationEvalGradientModWaveletNaive::evalGradient(), sgpp::base::OperationEvalGradientWaveletBoundaryNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineNaive::evalGradient(), sgpp::base::OperationEvalGradientFundamentalSplineNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineBoundaryNaive::evalGradient(), sgpp::base::OperationEvalGradientModBsplineNaive::evalGradient(), sgpp::base::OperationEvalGradientModBsplineClenshawCurtisNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineClenshawCurtisNaive::evalGradient(), sgpp::base::OperationEvalGradientModFundamentalSplineNaive::evalGradient(), sgpp::base::OperationEvalHessianModWaveletNaive::evalHessian(), sgpp::base::OperationEvalHessianWaveletNaive::evalHessian(), sgpp::base::OperationEvalHessianWaveletBoundaryNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModBsplineNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineBoundaryNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalHessianFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalPartialDerivativeWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeWaveletBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::HashGridStorage::getCoordinate(), sgpp::pde::PhiPhiDownBBLinear::operator()(), sgpp::pde::PhiPhiUpBBLinear::operator()(), sgpp::pde::PhiPhiUpBBLinearBoundary::operator()(), sgpp::pde::PhiPhiUpBBLinearStretchedBoundary::operator()(), sgpp::pde::PhiPhiDownBBLinearStretchedBoundary::operator()(), sgpp::pde::PhiPhiDownBBLinearBoundary::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinear::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinearBoundary::operator()(), sgpp::pde::UpdPhidPhiBBIterativeLinearBoundary::operator()(), sgpp::pde::UpdPhidPhiBBIterativeLinearStretchedBoundary::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinearStretchedBoundary::operator()(), sgpp::pde::LaplaceEnhancedDownBBLinearBoundary::operator()(), sgpp::pde::LaplaceEnhancedUpBBLinearBoundary::operator()(), sgpp::pde::LaplaceEnhancedUpBBLinear::operator()(), sgpp::pde::LaplaceEnhancedDownBBLinear::operator()(), sgpp::base::GetAffectedBasisFunctions< LinearBoundaryBasis< unsigned int, unsigned int > >::recBB(), sgpp::base::GetAffectedBasisFunctions< PolyBoundaryBasis< unsigned int, unsigned int > >::recBB(), sgpp::base::GetAffectedBasisFunctions< PolyClenshawCurtisBoundaryBasis< unsigned int, unsigned int > >::recBB(), and sgpp::base::GetAffectedBasisFunctions< LinearClenshawCurtisBoundaryBasis< unsigned int, unsigned int > >::recBB().

◆ hasDirichletBoundaryLeft()

◆ hasDirichletBoundaryRight()

bool sgpp::base::BoundingBox::hasDirichletBoundaryRight ( size_t  d) const

◆ isContainingPoint() [1/2]

bool sgpp::base::BoundingBox::isContainingPoint ( DataVector point) const
inline

Check whether the BoundingBox contains a given point.

Parameters
pointpoint to be checked
Returns
whether the point is contained in the BoundingBox

Referenced by sgpp::base::AlgorithmEvaluationTransposed< BASIS >::operator()(), and sgpp::base::AlgorithmEvaluation< BASIS >::operator()().

◆ isContainingPoint() [2/2]

bool sgpp::base::BoundingBox::isContainingPoint ( size_t  d,
double  point 
) const
inline

Check whether the BoundingBox contains a given point in a specific dimension.

Parameters
ddimension to be checked
point1D point to be checked
Returns
whether the point is contained in the BoundingBox in the given dimension

References sgpp::base::BoundingBox1D::leftBoundary, and SERIALIZATION_VERSION.

◆ isUnitCube()

bool sgpp::base::BoundingBox::isUnitCube ( ) const

Determine if this bounding box describes the unit cube \([0, 1]^d\).

Returns
true if this bounding box is the unit cube, otherwise false

References boundingBox1Ds, and dimension.

◆ serialize() [1/2]

◆ serialize() [2/2]

◆ setBoundary()

void sgpp::base::BoundingBox::setBoundary ( size_t  d,
const BoundingBox1D boundingBox1D 
)

Sets left and right boundary for a specific dimension.

Parameters
dthe dimension in which the boundary should be changed
boundingBox1Dreference to a BoundingBox1D object that contains the new boundaries

References boundingBox1Ds.

Referenced by sgpp::base::HashGridStorage::getLevelIndexMaskArraysForModEval().

◆ toString() [1/2]

◆ toString() [2/2]

◆ transformPointsToBoundingBox()

void sgpp::base::BoundingBox::transformPointsToBoundingBox ( DataMatrix points) const
inline

Transform points in the unit cube \([0, 1]^d\) to points in the BoundingBox.

Parameters
[in,out]pointspoints to be transformed in-place

References sgpp::base::DataMatrix::getNrows(), python.statsfileInfo::i, and python.leja::points.

◆ transformPointsToUnitCube()

void sgpp::base::BoundingBox::transformPointsToUnitCube ( DataMatrix points) const
inline

Transform points in the BoundingBox to points in the unit cube \([0, 1]^d\).

Parameters
[in,out]pointspoints to be transformed in-place (row-wise)

References sgpp::base::DataMatrix::getNrows(), python.statsfileInfo::i, and python.leja::points.

Referenced by sgpp::base::OperationMultipleEvalBsplineBoundaryNaive::mult(), sgpp::base::OperationMultipleEvalLinearClenshawCurtisBoundaryNaive::mult(), sgpp::base::OperationMultipleEvalModLinearClenshawCurtisNaive::mult(), sgpp::base::OperationMultipleEvalLinearClenshawCurtisNaive::mult(), sgpp::base::OperationMultipleEvalModPolyClenshawCurtisNaive::mult(), sgpp::base::OperationMultipleEvalPolyBoundaryNaive::mult(), sgpp::base::OperationMultipleEvalBsplineClenshawCurtisNaive::mult(), sgpp::base::OperationMultipleEvalLinearNaive::mult(), sgpp::base::OperationMultipleEvalPolyClenshawCurtisNaive::mult(), sgpp::base::OperationMultipleEvalLinearBoundaryNaive::mult(), sgpp::base::OperationMultipleEvalPolyNaive::mult(), sgpp::base::OperationMultipleEvalModBsplineClenshawCurtisNaive::mult(), sgpp::base::OperationMultipleEvalModBsplineNaive::mult(), sgpp::base::OperationMultipleEvalBsplineNaive::mult(), sgpp::base::OperationMultipleEvalPolyClenshawCurtisBoundaryNaive::mult(), sgpp::base::OperationMultipleEvalPolyNaive::multTranspose(), sgpp::base::OperationMultipleEvalModPolyClenshawCurtisNaive::multTranspose(), sgpp::base::OperationMultipleEvalBsplineBoundaryNaive::multTranspose(), sgpp::base::OperationMultipleEvalModBsplineClenshawCurtisNaive::multTranspose(), sgpp::base::OperationMultipleEvalLinearBoundaryNaive::multTranspose(), sgpp::base::OperationMultipleEvalPolyClenshawCurtisNaive::multTranspose(), sgpp::base::OperationMultipleEvalLinearNaive::multTranspose(), sgpp::base::OperationMultipleEvalBsplineClenshawCurtisNaive::multTranspose(), sgpp::base::OperationMultipleEvalLinearClenshawCurtisNaive::multTranspose(), sgpp::base::OperationMultipleEvalLinearClenshawCurtisBoundaryNaive::multTranspose(), sgpp::base::OperationMultipleEvalPolyBoundaryNaive::multTranspose(), sgpp::base::OperationMultipleEvalModLinearClenshawCurtisNaive::multTranspose(), sgpp::base::OperationMultipleEvalBsplineNaive::multTranspose(), sgpp::base::OperationMultipleEvalModBsplineNaive::multTranspose(), and sgpp::base::OperationMultipleEvalPolyClenshawCurtisBoundaryNaive::multTranspose().

◆ transformPointToBoundingBox() [1/2]

void sgpp::base::BoundingBox::transformPointToBoundingBox ( DataVector point) const
inline

Transform a point in the unit cube \([0, 1]^d\) to a point in the BoundingBox.

Parameters
[in,out]pointpoint to be transformed in-place

Referenced by sgpp::base::OperationQuadratureMC::doQuadrature(), sgpp::base::OperationQuadratureMC::doQuadratureFunc(), and sgpp::base::OperationQuadratureMC::doQuadratureL2Error().

◆ transformPointToBoundingBox() [2/2]

double sgpp::base::BoundingBox::transformPointToBoundingBox ( size_t  d,
double  point 
) const
inline

Transform a point in the unit interval \([0, 1]\) to a point in the BoundingBox in 1D.

Parameters
ddimension
point1D point in unit interval
Returns
transformed 1D point in the BoundingBox

References chess::point.

◆ transformPointToUnitCube() [1/2]

void sgpp::base::BoundingBox::transformPointToUnitCube ( DataVector point) const
inline

Transform a point in the BoundingBox to a point in the unit cube \([0, 1]^d\).

Parameters
[in,out]pointpoint to be transformed in-place

Referenced by sgpp::base::OperationEvalLinearClenshawCurtisNaive::eval(), sgpp::base::OperationEvalModLinearClenshawCurtisNaive::eval(), sgpp::base::OperationEvalModPolyClenshawCurtisNaive::eval(), sgpp::base::OperationEvalPolyClenshawCurtisNaive::eval(), sgpp::base::OperationEvalModPolyNaive::eval(), sgpp::base::OperationEvalLinearClenshawCurtisBoundaryNaive::eval(), sgpp::base::OperationEvalPolyClenshawCurtisBoundaryNaive::eval(), sgpp::base::OperationEvalPolyBoundaryNaive::eval(), sgpp::base::OperationEvalPolyNaive::eval(), sgpp::base::OperationEvalModLinearNaive::eval(), sgpp::base::OperationEvalLinearBoundaryNaive::eval(), sgpp::base::OperationEvalLinearNaive::eval(), sgpp::base::OperationEvalWaveletBoundaryNaive::eval(), sgpp::base::OperationEvalModWaveletNaive::eval(), sgpp::base::OperationEvalNakBsplineBoundaryCombigridNaive::eval(), sgpp::base::OperationEvalWaveletNaive::eval(), sgpp::base::OperationEvalModBsplineNaive::eval(), sgpp::base::OperationEvalModFundamentalSplineNaive::eval(), sgpp::base::OperationEvalBsplineClenshawCurtisNaive::eval(), sgpp::base::OperationEvalFundamentalSplineNaive::eval(), sgpp::base::OperationEvalBsplineBoundaryNaive::eval(), sgpp::base::OperationEvalModBsplineClenshawCurtisNaive::eval(), sgpp::base::OperationEvalBsplineNaive::eval(), sgpp::base::OperationEvalGradientWaveletNaive::evalGradient(), sgpp::base::OperationEvalGradientWaveletBoundaryNaive::evalGradient(), sgpp::base::OperationEvalGradientModWaveletNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineBoundaryNaive::evalGradient(), sgpp::base::OperationEvalGradientFundamentalSplineNaive::evalGradient(), sgpp::base::OperationEvalGradientModBsplineNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineClenshawCurtisNaive::evalGradient(), sgpp::base::OperationEvalGradientModFundamentalSplineNaive::evalGradient(), sgpp::base::OperationEvalGradientModBsplineClenshawCurtisNaive::evalGradient(), sgpp::base::OperationEvalHessianWaveletNaive::evalHessian(), sgpp::base::OperationEvalHessianModWaveletNaive::evalHessian(), sgpp::base::OperationEvalHessianWaveletBoundaryNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModBsplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineBoundaryNaive::evalHessian(), sgpp::base::OperationEvalHessianFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalHessianModBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalPartialDerivativeModWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeWaveletBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::HashGridStorage::getUnitCoordinate(), sgpp::base::AlgorithmEvaluationTransposed< BASIS >::operator()(), and sgpp::base::AlgorithmEvaluation< BASIS >::operator()().

◆ transformPointToUnitCube() [2/2]

double sgpp::base::BoundingBox::transformPointToUnitCube ( size_t  d,
double  point 
) const
inline

Transform a point in the BoundingBox to a point in the unit interval \([0, 1]\) in 1D.

Parameters
ddimension
point1D point in the BoundingBox
Returns
transformed 1D point in the unit interval

◆ unserialize() [1/2]

void sgpp::base::BoundingBox::unserialize ( const std::string &  istr,
int  version 
)
virtual

Unserialize from a string.

Parameters
istrstring which contains a serialized BoundingBox
versionthe serialization version of the file

Referenced by sgpp::base::HashGridStorage::getLevelIndexMaskArraysForModEval(), and sgpp::base::Stretching::unserialize().

◆ unserialize() [2/2]

void sgpp::base::BoundingBox::unserialize ( std::istream &  istr,
int  version 
)
virtual

Unserialize from a stream.

Parameters
istrstream which contains a serialized BoundingBox
versionthe serialization version of the file

References sgpp::base::BoundingBox1D::bDirichletLeft, sgpp::base::BoundingBox1D::bDirichletRight, boundingBox1Ds, dimension, sgpp::base::BoundingBox1D::leftBoundary, and sgpp::base::BoundingBox1D::rightBoundary.

Member Data Documentation

◆ boundingBox1Ds

◆ dimension


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