SG++
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 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

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
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
sgpp::base::BoundingBox::~BoundingBox ( )
virtual

Destructor.

Member Function Documentation

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::OperationQuadratureLinear::doQuadrature(), sgpp::base::OperationQuadratureLinearBoundary::doQuadrature(), sgpp::base::OperationQuadraturePolyBoundary::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::OperationEvalGradientModBsplineNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineBoundaryNaive::evalGradient(), sgpp::base::OperationEvalGradientFundamentalSplineNaive::evalGradient(), sgpp::base::OperationEvalGradientBsplineClenshawCurtisNaive::evalGradient(), sgpp::base::OperationEvalGradientModBsplineClenshawCurtisNaive::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::OperationEvalHessianFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineBoundaryNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalHessianModBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalPartialDerivativeWaveletBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::HashGridStorage::getCoordinate(), sgpp::pde::PhiPhiUpBBLinearBoundary::operator()(), sgpp::pde::PhiPhiUpBBLinearStretchedBoundary::operator()(), sgpp::pde::PhiPhiUpBBLinear::operator()(), sgpp::pde::PhiPhiDownBBLinear::operator()(), sgpp::pde::PhiPhiDownBBLinearStretchedBoundary::operator()(), sgpp::pde::PhiPhiDownBBLinearBoundary::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinearBoundary::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinearStretchedBoundary::operator()(), sgpp::pde::UpdPhidPhiBBIterativeLinearStretchedBoundary::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinear::operator()(), sgpp::pde::UpdPhidPhiBBIterativeLinearBoundary::operator()(), sgpp::pde::LaplaceEnhancedUpBBLinearBoundary::operator()(), sgpp::pde::LaplaceEnhancedDownBBLinearBoundary::operator()(), sgpp::pde::LaplaceEnhancedUpBBLinear::operator()(), sgpp::pde::LaplaceEnhancedDownBBLinear::operator()(), sgpp::base::GetAffectedBasisFunctions< LinearBoundaryBasis< unsigned int, unsigned int > >::recBB(), and sgpp::base::GetAffectedBasisFunctions< PolyBoundaryBasis< unsigned int, unsigned int > >::recBB().

bool sgpp::base::BoundingBox::hasDirichletBoundaryRight ( size_t  d) const
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()().

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.

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.

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

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

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
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::OperationEvalModPolyNaive::eval(), sgpp::base::OperationEvalPolyBoundaryNaive::eval(), sgpp::base::OperationEvalPolyNaive::eval(), sgpp::base::OperationEvalLinearBoundaryNaive::eval(), sgpp::base::OperationEvalModLinearNaive::eval(), sgpp::base::OperationEvalLinearClenshawCurtisNaive::eval(), sgpp::base::OperationEvalLinearNaive::eval(), sgpp::base::OperationEvalModWaveletNaive::eval(), sgpp::base::OperationEvalNakBsplineBoundaryCombigridNaive::eval(), sgpp::base::OperationEvalWaveletNaive::eval(), sgpp::base::OperationEvalWaveletBoundaryNaive::eval(), sgpp::base::OperationEvalBsplineClenshawCurtisNaive::eval(), sgpp::base::OperationEvalModBsplineNaive::eval(), sgpp::base::OperationEvalModFundamentalSplineNaive::eval(), sgpp::base::OperationEvalFundamentalSplineNaive::eval(), sgpp::base::OperationEvalBsplineBoundaryNaive::eval(), sgpp::base::OperationEvalBsplineNaive::eval(), sgpp::base::OperationEvalModBsplineClenshawCurtisNaive::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::OperationEvalGradientModBsplineClenshawCurtisNaive::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::OperationEvalHessianBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalHessianFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianModFundamentalSplineNaive::evalHessian(), sgpp::base::OperationEvalHessianBsplineBoundaryNaive::evalHessian(), sgpp::base::OperationEvalHessianModBsplineClenshawCurtisNaive::evalHessian(), sgpp::base::OperationEvalPartialDerivativeModWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeWaveletBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeWaveletNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineBoundaryNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeFundamentalSplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineNaive::evalPartialDerivative(), sgpp::base::OperationEvalPartialDerivativeModBsplineClenshawCurtisNaive::evalPartialDerivative(), sgpp::base::HashGridStorage::getUnitCoordinate(), sgpp::base::AlgorithmEvaluationTransposed< BASIS >::operator()(), and sgpp::base::AlgorithmEvaluation< BASIS >::operator()().

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

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


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