SG++-Doxygen-Documentation
|
Stretching can be done in different ways: More...
#include <Stretching.hpp>
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_t > | getDiscreteVectorLevel () const |
const Stretching1D & | getStretching1D (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 BoundingBox1D & | getBoundary (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 | 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... | |
Additional Inherited Members | |
Protected Attributes inherited from sgpp::base::BoundingBox | |
std::vector< BoundingBox1D > | boundingBox1Ds |
Array that contains all left boundaries for all dimensions. More... | |
size_t | dimension |
the number of dimensions used with the grid More... | |
Stretching can be done in different ways:
|
explicit |
Constructor for Stretching.
initializes the Stretching with using no stretching
dimension | number 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
boundaries | BoundingBox1D struct to get the boundary values for Stretching |
stretching1Ds | array 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)
dimension | number of the dimensions used with the grid |
coordinates | vector<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.
|
override |
Destructor.
References sgpp::base::BoundingBox::boundingBox1Ds, sgpp::base::BoundingBox::dimension, sgpp::base::ClenshawCurtisTable::getInstance(), sgpp::base::ClenshawCurtisTable::getPoint(), python.statsfileInfo::i, level, sgpp::base::Stretching1D::lookup, LOOKUPMAX, create_dataset::type, sgpp::base::Stretching1D::x_0, and sgpp::base::Stretching1D::xsi.
void sgpp::base::Stretching::calculateNeighborLookup | ( | level_t | maxlevel | ) | const |
References python.statsfileInfo::i.
void sgpp::base::Stretching::getAdjacentPositions | ( | level_t | level, |
index_t | index, | ||
size_t | d, | ||
double & | posc, | ||
double & | posl, | ||
double & | posr | ||
) | const |
References getCoordinate(), python.statsfileInfo::i, level, sgpp::combigrid::log2(), sgpp::base::Stretching1D::lookup, LOOKUPMAX, and sgpp::base::Stretching1D::type.
Referenced by sgpp::pde::DowndPhidPhiBBIterativeLinearStretched::operator()(), sgpp::pde::PhiPhiDownBBLinearStretched::rec(), sgpp::pde::PhiPhiUpBBLinearStretched::rec(), sgpp::base::DehierarchisationLinearStretched::rec(), sgpp::base::HierarchisationLinearStretched::rec(), and sgpp::base::GetAffectedBasisFunctions< LinearStretchedBoundaryBasis< unsigned int, unsigned int > >::recBB().
std::vector< double > * sgpp::base::Stretching::getDiscreteVector | ( | bool | bSort | ) | const |
std::vector< level_t > sgpp::base::Stretching::getDiscreteVectorLevel | ( | ) | const |
|
inline |
References SERIALIZATION_VERSION.
std::string sgpp::base::Stretching::getStretchingMode | ( | ) | const |
Referenced by sgpp::base::HashGridStorage::serialize().
void sgpp::base::Stretching::printLookupTable | ( | ) | const |
References sgpp::base::BoundingBox::dimension, python.utils.statsfile2gnuplot::j, and LOOKUPSIZE.
|
overridevirtual |
Serialize the Stretching into a string.
version | the serialization version of the file |
Reimplemented from sgpp::base::BoundingBox.
Referenced by sgpp::base::HashGridStorage::serialize(), python.utils.GzipSerializer.GzipSerializer::serializeToFile(), python.learner.formatter.LearnerFormatter.LearnerFormatter::serializeToFile(), python.learner.formatter.LearnedKnowledgeFormatter.LearnedKnowledgeFormatter::serializeToFile(), python.learner.formatter.GridFormatter.GridFormatter::serializeToFile(), python.uq.analysis.asgc.ASGCKnowledgeFormatter.ASGCKnowledgeFormatter::serializeToFile(), python.uq.sampler.asgc.ASGCSamplerFormatter.ASGCSamplerFormatter::serializeToFile(), and python.uq.uq_setting.UQSettingFormatter.UQSettingFormatter::serializeToFile().
|
overridevirtual |
Serialize the Stretching into a stream.
ostream | reference to a stream into that all Stretching information is written |
version | the serialization version of the file |
Reimplemented from sgpp::base::BoundingBox.
References sgpp::base::BoundingBox::dimension, getDiscreteVector(), python.statsfileInfo::i, sgpp::base::BoundingBox::serialize(), sgpp::base::Stretching1D::type, sgpp::base::Stretching1D::x_0, and sgpp::base::Stretching1D::xsi.
Referenced by python.utils.GzipSerializer.GzipSerializer::serializeToFile(), python.learner.formatter.LearnerFormatter.LearnerFormatter::serializeToFile(), python.learner.formatter.LearnedKnowledgeFormatter.LearnedKnowledgeFormatter::serializeToFile(), python.learner.formatter.GridFormatter.GridFormatter::serializeToFile(), python.uq.analysis.asgc.ASGCKnowledgeFormatter.ASGCKnowledgeFormatter::serializeToFile(), python.uq.sampler.asgc.ASGCSamplerFormatter.ASGCSamplerFormatter::serializeToFile(), and python.uq.uq_setting.UQSettingFormatter.UQSettingFormatter::serializeToFile().
void sgpp::base::Stretching::unserialize | ( | const std::string & | istr, |
const std::string & | mode, | ||
int | version | ||
) |
Unserialize from a string.
istr | string which contains a serialized Stretching |
mode | stretching mode ("analytic" or "discrete") |
version | the 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.
istr | stream which contains a serialized Stretching |
mode | stretching mode ("analytic" or "discrete") |
version | the serialization version of the file |
References sgpp::base::BoundingBox::boundingBox1Ds, sgpp::base::BoundingBox::dimension, python.statsfileInfo::i, sgpp::combigrid::pow(), sgpp::base::Stretching1D::type, sgpp::base::BoundingBox::unserialize(), sgpp::base::Stretching1D::x_0, and sgpp::base::Stretching1D::xsi.