SG++
sgpp::base::Stretching Class Reference

Stretching can be done in different ways: More...

#include <Stretching.hpp>

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

Public Member Functions

void calculateNeighborLookup (level_t maxlevel) const
 
void getAdjacentPositions (level_t level, index_t index, size_t d, double &posc, double &posl, double &posr) const
 
double getCoordinate (level_t level, index_t index, size_t d) const
 
std::vector< double > * getDiscreteVector (bool bSort) const
 
std::vector< level_tgetDiscreteVectorLevel () const
 
const Stretching1DgetStretching1D (size_t d) const
 
std::string getStretchingMode () const
 
void printLookupTable () const
 
std::string serialize (int version=SERIALIZATION_VERSION) const override
 Serialize the Stretching into a string. More...
 
void serialize (std::ostream &ostream, int version=SERIALIZATION_VERSION) const override
 Serialize the Stretching into a stream. More...
 
 Stretching (size_t dimension)
 Constructor for Stretching. More...
 
 Stretching (const std::vector< BoundingBox1D > &boundaries, const std::vector< Stretching1D > &stretching1Ds)
 Constructor for Stretching. More...
 
 Stretching (size_t dimension, std::vector< double > *coordinates)
 Constructor for Stretching. More...
 
void unserialize (const std::string &istr, const std::string &mode, int version)
 Unserialize from a string. More...
 
void unserialize (std::istream &istr, const std::string &mode, int version)
 Unserialize from a stream. More...
 
 ~Stretching () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::base::BoundingBox
 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...
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from sgpp::base::BoundingBox
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

Stretching can be done in different ways:

  1. No Stretching operation is done
  2. Clenshaw-Curtis Stretching
  3. Stretching is done via log/exp calculation
  4. Sinh Stretching
  5. Fitob Stretching
  6. Discrete Stretching (No function used, grid points are directly taken)

Constructor & Destructor Documentation

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

Constructor for Stretching.

initializes the Stretching with using no stretching

Parameters
dimensionnumber of the dimensions used with the grid
sgpp::base::Stretching::Stretching ( const std::vector< BoundingBox1D > &  boundaries,
const std::vector< Stretching1D > &  stretching1Ds 
)

Constructor for Stretching.

initializes the Stretching using the boundaries with the input type array given for each dimension

Parameters
boundariesBoundingBox1D struct to get the boundary values for Stretching
stretching1Dsarray to define the stretching type
sgpp::base::Stretching::Stretching ( size_t  dimension,
std::vector< double > *  coordinates 
)

Constructor for Stretching.

initializes the Stretching using the coordinates given. (For Janos' request)

Parameters
dimensionnumber of the dimensions used with the grid
coordinatesvector<double> array to get the boundaries, as well as the coordinates of the specific level the vector defines for each dimension.

References sgpp::base::BoundingBox::boundingBox1Ds, and sgpp::base::BoundingBox::dimension.

Member Function Documentation

void sgpp::base::Stretching::calculateNeighborLookup ( level_t  maxlevel) const
std::vector< double > * sgpp::base::Stretching::getDiscreteVector ( bool  bSort) const
std::vector< level_t > sgpp::base::Stretching::getDiscreteVectorLevel ( ) const
const Stretching1D& sgpp::base::Stretching::getStretching1D ( size_t  d) const
inline

References SERIALIZATION_VERSION.

std::string sgpp::base::Stretching::getStretchingMode ( ) const
void sgpp::base::Stretching::printLookupTable ( ) const
void sgpp::base::Stretching::unserialize ( const std::string &  istr,
const std::string &  mode,
int  version 
)

Unserialize from a string.

Parameters
istrstring which contains a serialized Stretching
modestretching mode ("analytic" or "discrete")
versionthe serialization version of the file

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

void sgpp::base::Stretching::unserialize ( std::istream &  istr,
const std::string &  mode,
int  version 
)

Unserialize from a stream.

Parameters
istrstream which contains a serialized Stretching
modestretching mode ("analytic" or "discrete")
versionthe serialization version of the file

References sgpp::base::BoundingBox::boundingBox1Ds, sgpp::base::BoundingBox::dimension, sgpp::combigrid::pow(), sgpp::base::Stretching1D::type, sgpp::base::BoundingBox::unserialize(), sgpp::base::Stretching1D::x_0, and sgpp::base::Stretching1D::xsi.


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