SG++
sgpp::combigrid Namespace Reference

Classes

class  AbstractCombigridStorage
 Abstract base class for storage storing a float_t for each level-index-pair. More...
 
class  AbstractEvaluator
 Abstract base class for one-dimensional numerical evaluation methods. More...
 
class  AbstractFullGridEvaluationStrategy
 
class  AbstractFullGridEvaluator
 Abstract class for doing an evaluation on a full grid, yielding a value of the template type V. More...
 
class  AbstractFullGridSummationStrategy
 
class  AbstractGrowthStrategy
 Defines a converter from a level to a number of points, i. More...
 
class  AbstractInfiniteFunctionBasis1D
 
class  AbstractLevelEvaluator
 This class abstracts a lot of methods of CombigridEvaluator for classes that do not want to carry around its template parameter, e. More...
 
class  AbstractLinearEvaluator
 See also AbstractEvaluator. More...
 
class  AbstractMultiStorage
 Interface for storage classes which store values of type T. More...
 
class  AbstractMultiStorageIterator
 Abstract base class for iterators iterating over (existing or maybe also non-existing) entries of an AbstractMultiStorage. More...
 
class  AbstractPermutationIterator
 Iterates over the elements of a permutation. More...
 
class  AbstractPointDistribution
 An abstract point distribution provides a set of n one-dimensional grid points for each value of n. More...
 
class  AbstractPointHierarchy
 Contains all the necessary information about a family of one-dimensional grids: More...
 
class  AbstractPointOrdering
 An AbstractPointOrdering may (via convertIndex()) define a reordering of the points so that the same points in different levels have the same indices. More...
 
class  AbstractSerializationStrategy
 This is an abstract base class for strategies converting between an object of type T (template parameter) and std::string for serialization and deserialization. More...
 
class  AbstractTreeStorageNode
 Interface class for TreeStorage-nodes. More...
 
class  AdaptiveRefinementStrategy
 This class is a helper class to configure some adaptive refinement methods. More...
 
class  ArrayEvaluator
 This class takes a 1D linear evaluator operating on scalars (which is given through the template type ScalarEvaluator) and uses multiple instances of it for doing multi-evaluation. More...
 
struct  AtanBeta
 
struct  AtanUniform
 
class  AveragingLevelManager
 This is a simple LevelManager implementation that does level norm prediction for adaptive refinement by averaging the norms of predecessor levels divided by their number of new points. More...
 
class  BinaryHeap
 Implements a max heap using a binary heap. More...
 
class  BoundedSumMultiIndexIterator
 This class can be used to generate multi-indices with bounded 1-norm. More...
 
class  BSplineInterpolationCoefficientEvaluator
 
class  BSplineInterpolationEvaluator
 This evaluator calculates the B spline evaluations b_i(evaluatioinPoint) for B splines b_i of degree 'degree' and saves these in basisValues. More...
 
class  BSplineQuadratureEvaluator
 This evaluator calculates the integrals int b_i(x) dx for B splines b_i. More...
 
class  BSplineScalarProductEvaluator
 This evaluator calculates the scalar products int b_i(x) b_j(x) dx for B splines b_i and b_j. More...
 
class  BsplineStochasticCollocation
 
class  ChebyshevDistribution
 Provides Chebyshev grid points, that is, the points 0.5 - 0.5*cos((2k + 1)*pi/(2n)) for k = 0, ..., n-1. More...
 
class  ClenshawCurtisDistribution
 Provides Clenshaw-Curtis grid points, that is, the points 0.5 - 0.5 cos(k*pi/(n-1)) for k = 0, ..., n or 0.5, if n = 1. More...
 
struct  CO2
 
class  CombiEvaluators
 This class provides standard configurations of 1D-evaluators (single- and multi-evaluation). More...
 
class  CombigridEvaluator
 The CombigridEvaluator class evaluates a numerical method on different full grids and combines them using the combination technique. More...
 
class  CombigridMultiOperation
 Interface class for simple usage of the combigrid module. More...
 
class  CombigridMultiOperationImpl
 
class  CombigridOperation
 Interface class for simple usage of the combigrid module. More...
 
class  CombigridOperationImpl
 
class  CombigridSurrogateModel
 
class  CombigridSurrogateModelConfiguration
 
class  CombigridTensorOperation
 
class  CombigridTensorOperationImpl
 
class  CombigridTreeStorage
 Implementation of the AbstractCombigridStorage using TreeStorage<TreeStorage<float_t>>. More...
 
class  CombigridTreeStorageImpl
 
class  CombiHierarchies
 This class provides standard configurations of point hierarchies. More...
 
class  CubicSplineInterpolationEvaluator
 
class  CustomGrowthStrategy
 The level-numPoints-mapping can be customized with a function. More...
 
class  DataVectorEqualTo
 Helper class used internally as an equality predicate. More...
 
class  DataVectorHash
 Helper class used internally as a hash function for DataVector objects. More...
 
struct  Debugfct
 
class  DefaultSerializationStrategy
 This serialization strategy uses the operators << and >> on streams that are overloaded for many standard types. More...
 
struct  EvaluatorConfiguration
 
class  ExponentialChebyshevPermutationIterator
 Sorted-permutation-iterator for ExponentialChebyshevPointOrdering. More...
 
class  ExponentialChebyshevPointOrdering
 PointOrdering class with the slowest growth (n = 3^l) possible in order to make Chebyshev points nested. More...
 
class  ExponentialGrowthStrategy
 numPoints = (l == 0) ? 1 : 2^l + 1 Yields nested points for e. More...
 
class  ExponentialLevelorderPermutationIterator
 Sorted-permutation-iterator class for ExponentialLevelorderPointOrdering. More...
 
class  ExponentialLevelorderPointOrdering
 PointOrdering class with the slowest possible growth (n = (l == 1) ? 1 : 2^l + 1) to make Clenshaw-Curtis-points / uniform points with boundary nested. More...
 
class  ExponentialNoBoundaryPermutationIterator
 Sorted-permutation-iterator for ExponentialNoBoundaryPointOrdering. More...
 
class  ExponentialNoBoundaryPointOrdering
 Point ordering class with the slowest possible growth (n = 2^(l+1) - 1) that makes uniform points without boundary nested. More...
 
class  FirstMomentNormStrategy
 
class  FloatArrayVector
 This class models a vector of scalars supporting operations such as addition, scalar multiplication and componentwise muliplication. More...
 
class  FloatScalarVector
 This class models a single scalar supporting operations such as addition, scalar multiplication and componentwise muliplication. More...
 
class  FloatSerializationStrategy
 This class provides a serialization strategy for floating-point types (float, double), though not particularly well-compressed (roughly 70 characters per float will be used). More...
 
class  FloatTensorVector
 
class  FullGridCallbackEvaluator
 Implementation of the AbstractFullGridLinearEvaluator class using a callback function that takes a single point and returns a function value at that point. More...
 
class  FullGridGridBasedEvaluator
 Implementation of the AbstractFullGridLinearEvaluator class using a callback function that If you want to be able to use different function values at the same point in different levels (for example because you are implementing a PDE solver), set exploitNesting to false in the constructor of CombigridTreeStorage. More...
 
class  FullGridLinearSummationStrategy
 
class  FullGridOptimizedPCESummationStrategy
 This is an experimental class using an alternative basis change for PCE. More...
 
class  FullGridPCESummationStrategy
 This is an experimental class using an alternative basis change for PCE. More...
 
class  FullGridQuadraticSummationStrategy
 
class  FullGridTensorVarianceSummationStrategy
 
class  FullGridVarianceSummationStrategy
 
class  FunctionLookupTable
 This class wraps a MultiFunction and stores computed values using a hashtable to avoid reevaluating a function at points where it already has been evaluated. More...
 
struct  FunctionLookupTableImpl
 Helper to realize the PIMPL pattern. More...
 
class  GaussLegendreQuadrature
 Uses Gauss-Legendre quadrature to approximate the integral of a function on the domain [0, 1]. More...
 
class  GeneralFunction
 Wrapper for std::function<Out(In)>. More...
 
class  GeneralFunction1
 
class  GeneralFunctionDirector
 This is a helper class used internally to wrap python functions into GeneralFunction objects. More...
 
class  GeneralFunctionDirector1
 
struct  Genz
 
class  GFDirWrapper
 This is a protected helper class used internally to wrap python functions into MultiFunction objects. More...
 
class  GFDirWrapper1
 
class  IdentityPointOrdering
 Point ordering class that uses the identity mapping to compute a level-independent index (i.e. More...
 
class  InternalTreeStorageNode
 Each inner node of the storage contains a vector of other nodes. More...
 
class  InterpolationCoefficientEvaluator
 
struct  Ishigami
 
class  IterationPolicy
 With the IterationPolicy class, an AbstractMultiStorage can be configured to traverse its entries in a different order than the identity order. More...
 
class  KahanAdder
 Kahan adder (a numerically more precise method to add many numbers). More...
 
class  L2LejaPointDistribution
 
class  LagrangePolynom
 Class for a LagrangePolynom, used to eval it. More...
 
class  LejaPointDistribution
 Provides Leja points (which are nested, i. More...
 
class  LevelInfo
 Stores necessary information about the computation status of a level. More...
 
class  LevelInfos
 
class  LevelManager
 This class provides functionality to conveniently add levels to a CombigridEvaluator. More...
 
class  LinearGrowthStrategy
 Calculation: numPoints := 1 + factor * level, where factor is a parameter passed to the class. More...
 
class  LinearInterpolationEvaluator
 This evaluator does linear interpolation on the given grid points. More...
 
class  LowestTreeStorageNode
 The Tree does not contain single elements of T in its leafs. More...
 
class  LTwoScalarProductHashMapNakBsplineBoundaryCombigrid
 
class  MCIntegrator
 Monte-Carlo-Quadrature for testing issues. More...
 
class  MixedOptimizer
 
class  MonomialFunctionBasis1D
 
class  MultiIndexIterator
 Iterates over a hypercube of multi-indices. More...
 
class  NestedPointHierarchy
 PointHierarchy class for nested point hierarchies (computes the nested points only once), see also AbstractPointHierarchy. More...
 
class  NewtonOptimizer
 
class  NonNestedPointHierarchy
 PointHierarchy class for point hierarchies that are not fully nested (see also AbstractPointHierarchy). More...
 
class  NormalAdder
 Standard adder with the same interface as the Kahan adder. More...
 
class  NormStrategy
 
class  OptimizationGuess
 
class  OrthogonalBasisFunctionsCollection
 
class  OrthogonalPolynomialBasis1D
 
class  OrthogonalPolynomialBasis1DConfiguration
 
struct  OrthogonalPolynomialBasis1DParameters
 
struct  Parabola
 
struct  Parabola_uniform
 
class  PolynomialChaosExpansion
 
class  PolynomialInterpolationEvaluator
 This evaluator does polynomial interpolation (using the barycentric approach) on the given grid points. More...
 
class  PolynomialQuadratureEvaluator
 This evaluator does quadrature based on the given grid points. More...
 
class  PolynomialScalarProductEvaluator
 This evaluator calculates the scalar products \(\int b_i b_j\). More...
 
class  PolynomialStochasticCollocation
 
class  ProbabilityDensityFunction1D
 
class  ProbabilityDensityFunction1DConfiguration
 
struct  ProbabilityDensityFunctionParameters
 
class  PtrGuard
 Helper class implementing a lock guard for std::shared_ptr<mutex> that does not lock a mutex if it is nullptr. More...
 
class  QueueComparator
 This class is a comparator to compare objects of type QueueEntry. More...
 
class  QueueEntry
 This is a header containing helper classes for the implementation of LevelManager. More...
 
class  RegularLevelManager
 This class provides an adaption strategy that is equivalent to adding levels regularly. More...
 
class  SecondMomentNormStrategy
 
class  SortedPermutationIterator
 Sorted-permutation-iterator (e.g. More...
 
class  Stopwatch
 Simple stopwatch implementation. More...
 
class  TensorGrid
 
class  ThreadPool
 This implements a thread-pool with a pre-specified number of threads that process a list of tasks. More...
 
class  TreeStorage
 The TreeStorage class is an optimized implementation of a storage that stores values addressed by MultiIndex-objects. More...
 
class  TreeStorageContext
 Context for the TreeStorage class. More...
 
class  TreeStorageGuidedIterator
 Iterator class that travels "along" a MultiIndexIterator through a TreeStorage. More...
 
class  TreeStorageSerializationStrategy
 This class provides a serialization strategy for TreeStorage<T>-objects (though not particularly well-compressed). More...
 
class  TreeStorageStoredDataIterator
 Iterator for the TreeStorage class that only traverses entries stored in the storage. More...
 
class  TrisectionOptimizer
 
class  UniformBoundaryPointDistribution
 provides uniform points, i. More...
 
class  UniformPointDistribution
 provides uniform points, i. More...
 
class  VarianceNormStrategy
 
class  WeightedRatioLevelManager
 This refinement criterion implements the one proposed by ┬┤Gerstner and Griebel: Dimension-adaptive Tensor-Product Quadrature, p. More...
 
class  WeightFunctionsCollection
 

Typedefs

typedef GeneralFunction< std::shared_ptr< TreeStorage< double > >, std::shared_ptr< TensorGrid > > GridFunction
 currently two evaluation strategies are suppoted: linear: uses the eval function of AbstractFullGridLinearEvaluator, i.e. More...
 
typedef GeneralFunction< double, base::DataVector const & > MultiFunction
 
typedef std::vector< size_t > MultiIndex
 
typedef sgpp::combigrid::BinaryHeap< QueueEntry, QueueComparatorMultiIndexQueue
 use custom binary heap class because std::priority_queue does not provide methods to change an element's priority. More...
 
typedef std::vector< std::map< MultiIndex, LevelInfo > > RefinementInfosPerStep
 Storage for meta information on the levels during adaptive refinement. More...
 
typedef GeneralFunction< double, double > SingleFunction
 

Enumerations

enum  CombiEvaluatorTypes {
  CombiEvaluatorTypes::NO_TYPE, CombiEvaluatorTypes::Scalar_PolynomialInterpolation, CombiEvaluatorTypes::Scalar_LinearInterpolation, CombiEvaluatorTypes::Scalar_CubicSplineInterpolation,
  CombiEvaluatorTypes::Scalar_BSplineInterpolation, CombiEvaluatorTypes::Multi_PolynomialInterpolation, CombiEvaluatorTypes::Multi_LinearInterpolation, CombiEvaluatorTypes::Multi_CubicSplineInterpolation,
  CombiEvaluatorTypes::Multi_BSplineInterpolation, CombiEvaluatorTypes::Scalar_PolynomialQuadrature, CombiEvaluatorTypes::Scalar_BSplineQuadrature, CombiEvaluatorTypes::Multi_PolynomialQuadrature,
  CombiEvaluatorTypes::Multi_BSplineQuadrature, CombiEvaluatorTypes::Multi_BSplineScalarProduct, CombiEvaluatorTypes::Multi_PolynomialScalarProduct, CombiEvaluatorTypes::Tensor_PolynomialInterpolation,
  CombiEvaluatorTypes::Tensor_BSplineInterpolation
}
 
enum  CombigridSurrogateModelsType { CombigridSurrogateModelsType::POLYNOMIAL_CHAOS_EXPANSION, CombigridSurrogateModelsType::POLYNOMIAL_STOCHASTIC_COLLOCATION, CombigridSurrogateModelsType::BSPLINE_STOCHASTIC_COLLOCATION }
 
enum  ComputationStage { ComputationStage::NOT_STARTED, ComputationStage::STARTED, ComputationStage::TERMINATED, ComputationStage::COMPLETED }
 Started: the computation of function values has been started Terminated: the computation of function values has terminated Completed: addLevel() has been called (can be later than termination if previous levels are not terminated yet). More...
 
enum  FullGridSummationStrategyType {
  FullGridSummationStrategyType::LINEAR, FullGridSummationStrategyType::QUADRATIC, FullGridSummationStrategyType::VARIANCE, FullGridSummationStrategyType::TENSORVARIANCE,
  FullGridSummationStrategyType::FULLSUBSPACEDPCE, FullGridSummationStrategyType::ONEDSUBSPACEPCE
}
 
enum  GridConversionTypes { GridConversionTypes::ALLSUBSPACES, GridConversionTypes::COMPLETESUBSPACES }
 
enum  OrthogonalPolynomialBasisType {
  OrthogonalPolynomialBasisType::LEGENDRE, OrthogonalPolynomialBasisType::JACOBI, OrthogonalPolynomialBasisType::HERMITE, OrthogonalPolynomialBasisType::BOUNDED_NORMAL,
  OrthogonalPolynomialBasisType::BOUNDED_LOGNORMAL
}
 
enum  ProbabilityDensityFunctionType {
  ProbabilityDensityFunctionType::UNIFORM, ProbabilityDensityFunctionType::NORMAL, ProbabilityDensityFunctionType::BETA, ProbabilityDensityFunctionType::BOUNDED_NORMAL,
  ProbabilityDensityFunctionType::BOUNDED_LOGNORMAL
}
 
enum  StorageStatus : uint8_t { StorageStatus::NOT_STORED = 0, StorageStatus::REQUESTED, StorageStatus::STORED }
 

Functions

std::shared_ptr< TreeStorage< uint8_t > > allStorageLevels (base::HashGridStorage &storage)
 Creates a level structure from all levels that occur in the HashGridStorage. More...
 
std::int64_t binom (std::int64_t n, std::int64_t k)
 Returns the binomial coefficient n over k. More...
 
sgpp::base::DataVector calculateInterpolationCoefficientsForConvertedExpUniformBoundaryCombigird (std::shared_ptr< sgpp::base::Grid > &grid, sgpp::base::GridStorage &gridStorage, std::shared_ptr< sgpp::combigrid::CombigridMultiOperation > &combigridInterpolationOperation, std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &levelStructure)
 after a combigrid has been converted to a hierarchical sparse grid via convertCombigridToHierarchicalSparseGrid with this operation the coefficients for the hierarchical sparse grid interpolation can be calculated More...
 
std::shared_ptr< TreeStorage< uint8_t > > completeStorageLevels (base::HashGridStorage &storage)
 Creates a level structure from all levels of which all points occur in the HashGridStorage. More...
 
template<typename In , typename Out >
std::function< Out(In)> constantFunction (Out fixedValue=Out())
 Returns a constant function with the given value. More...
 
void convertCombigridToHierarchicalSparseGrid (std::shared_ptr< TreeStorage< uint8_t >> levelStructure, base::HashGridStorage &storage)
 Takes the levels from levelStructure and stores its point in the given HashGridStorage (points without boundary) More...
 
void convertexpUniformBoundaryCombigridToHierarchicalSparseGrid (std::shared_ptr< TreeStorage< uint8_t >> levelStructure, base::HashGridStorage &storage)
 Takes the levels from levelStructure and stores its point in the given HashGridStorage (points with boundary) More...
 
std::shared_ptr< TreeStorage< uint8_t > > convertHierarchicalSparseGridToCombigrid (base::HashGridStorage &storage, GridConversionTypes conversionType)
 Creates a level structure for the levels that occur in the HashGridStorage. More...
 
sgpp::base::DataMatrix convertLevelStructureToGridPoints (std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &levelStructure, size_t numDimensions)
 converts a given level structure from the combigrid module into a matrix containing all grid points from these levels More...
 
std::shared_ptr< CombigridSurrogateModelcreateCombigridSurrogateModel (CombigridSurrogateModelConfiguration &config)
 
std::string escape (std::string str, char escapeCharacter, std::string avoidCharacters, std::string replaceCharacters)
 Escapes in str each occurrence of a character in avoidCharacters with the escape character and the corresponding character in replaceCharacters. More...
 
double expUniformNakBspline (double const &x, size_t const &degree, size_t i, std::vector< double > const &points)
 Nodal Not-a-Knot B spline basis always constant on level 0 degree 1 : hats from level 1 onwards degree 3 : polynomials on level 1, Not-a-Knot B-splines from level 2 onwards degree 5 : polynomials on level 1,2, Not-a-KNot B-Splines from level 3 onwards. More...
 
size_t getGridLevelForExpUniformBoundaryGrid (size_t numGridPoints)
 
std::string join (std::vector< std::string > const &elements, std::string const &separator)
 Concatenates the strings in elements and inserts the separator at the concatenation points. More...
 
double LagrangePolynomial (double const &x, std::vector< double > const &xValues, size_t const &k)
 evaluates the Lagrange polynomial given by its index and the knot sequence it is defined on in x More...
 
size_t log2 (size_t n)
 log 2 for size_t types More...
 
template<typename Out >
std::function< Out(MultiIndex const &)> multiIndexToDefaultValue (Out fixedValue=Out())
 Returns a constant function with the given value and input type (MultiIndex const &). More...
 
double nonUniformBSpline (double const &x, size_t const &deg, size_t const &index, std::vector< double > const &xi)
 evaluates a Bspline given by its degree, index and the knot sequence it is defined on in x More...
 
bool operator< (const OptimizationGuess &first, const OptimizationGuess &second)
 
std::ostream & operator<< (std::ostream &stream, FloatScalarVector v)
 
bool operator> (const OptimizationGuess &first, const OptimizationGuess &second)
 
std::istream & operator>> (std::istream &stream, FloatScalarVector &v)
 
template<typename T >
pow (T base, size_t exponent)
 Exponentiation function for integer types with exact precision. More...
 
std::string readFromFile (std::string filename)
 Reads a file into a string (without advanced error-handling). More...
 
std::vector< std::string > split (std::string str, std::string separator)
 Splits the string str at every occurrence of separator and returns the parts (without the separator) in a vector. More...
 
std::string unescape (std::string str, char escapeCharacter, std::string avoidCharacters, std::string replaceCharacters)
 Reverses the effect of the function escape(). More...
 
void writeToFile (std::string filename, std::string value)
 Writes a string into a file, overwriting currently saved data if the file already exists (without advanced error-handling). More...
 

Typedef Documentation

typedef GeneralFunction<std::shared_ptr<TreeStorage<double> >, std::shared_ptr<TensorGrid> > sgpp::combigrid::GridFunction

currently two evaluation strategies are suppoted: linear: uses the eval function of AbstractFullGridLinearEvaluator, i.e.

evaluation in every point individually grid_based: uses a gridFunction to evaluate in all grid points at once

You decide which one to use simply by calling the constructor with or without a gridFunction

typedef std::vector<size_t> sgpp::combigrid::MultiIndex

use custom binary heap class because std::priority_queue does not provide methods to change an element's priority.

We could use boost, but that would introduce an additional dependency

Storage for meta information on the levels during adaptive refinement.

Enumeration Type Documentation

Enumerator
NO_TYPE 
Scalar_PolynomialInterpolation 
Scalar_LinearInterpolation 
Scalar_CubicSplineInterpolation 
Scalar_BSplineInterpolation 
Multi_PolynomialInterpolation 
Multi_LinearInterpolation 
Multi_CubicSplineInterpolation 
Multi_BSplineInterpolation 
Scalar_PolynomialQuadrature 
Scalar_BSplineQuadrature 
Multi_PolynomialQuadrature 
Multi_BSplineQuadrature 
Multi_BSplineScalarProduct 
Multi_PolynomialScalarProduct 
Tensor_PolynomialInterpolation 
Tensor_BSplineInterpolation 
Enumerator
POLYNOMIAL_CHAOS_EXPANSION 
POLYNOMIAL_STOCHASTIC_COLLOCATION 
BSPLINE_STOCHASTIC_COLLOCATION 

Started: the computation of function values has been started Terminated: the computation of function values has terminated Completed: addLevel() has been called (can be later than termination if previous levels are not terminated yet).

Enumerator
NOT_STARTED 
STARTED 
TERMINATED 
COMPLETED 
Enumerator
LINEAR 
QUADRATIC 
VARIANCE 
TENSORVARIANCE 
FULLSUBSPACEDPCE 
ONEDSUBSPACEPCE 
Enumerator
ALLSUBSPACES 
COMPLETESUBSPACES 
Enumerator
LEGENDRE 
JACOBI 
HERMITE 
BOUNDED_NORMAL 
BOUNDED_LOGNORMAL 
Enumerator
UNIFORM 
NORMAL 
BETA 
BOUNDED_NORMAL 
BOUNDED_LOGNORMAL 
enum sgpp::combigrid::StorageStatus : uint8_t
strong
Enumerator
NOT_STORED 
REQUESTED 
STORED 

Function Documentation

std::shared_ptr< TreeStorage< uint8_t > > sgpp::combigrid::allStorageLevels ( base::HashGridStorage storage)

Creates a level structure from all levels that occur in the HashGridStorage.

Parameters
storagehash map of sparse grid points
Returns
level structure of anisotropic full grids for CombigridOperations

References sgpp::base::HashGridStorage::begin(), sgpp::base::HashGridStorage::end(), sgpp::base::HashGridStorage::getDimension(), and level.

Referenced by convertHierarchicalSparseGridToCombigrid().

std::int64_t sgpp::combigrid::binom ( std::int64_t  n,
std::int64_t  k 
)

Returns the binomial coefficient n over k.

Referenced by pow().

sgpp::base::DataVector sgpp::combigrid::calculateInterpolationCoefficientsForConvertedExpUniformBoundaryCombigird ( std::shared_ptr< sgpp::base::Grid > &  grid,
sgpp::base::GridStorage gridStorage,
std::shared_ptr< sgpp::combigrid::CombigridMultiOperation > &  combigridInterpolationOperation,
std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &  levelStructure 
)

after a combigrid has been converted to a hierarchical sparse grid via convertCombigridToHierarchicalSparseGrid with this operation the coefficients for the hierarchical sparse grid interpolation can be calculated

Parameters
gridthe newly created hierarchical sparse grid
gridStoragethe gridStorage of the newly created hierarchical sparse grid
combigridInterpolationOperationan interpolation operation on the comigrid used to obtain the right hand side for the interpolation SLE
levelStructurethe level structure of the combigrid
Returns
the coefficients for the hierarchical sparse grid interpolant

References alpha, sgpp::base::HashGridStorage::getDimension(), sgpp::optimization::Printer::getInstance(), sgpp::base::HashGridStorage::getPoint(), sgpp::base::HashGridStorage::getSize(), sgpp::base::HashGridPoint::getStandardCoordinate(), sgpp::optimization::Printer::setVerbosity(), and sgpp::optimization::sle_solver::Auto::solve().

Referenced by sgpp::combigrid::BsplineStochasticCollocation::mean().

std::shared_ptr< TreeStorage< uint8_t > > sgpp::combigrid::completeStorageLevels ( base::HashGridStorage storage)

Creates a level structure from all levels of which all points occur in the HashGridStorage.

This assumes that at a full level (l_1, ..., l_n), there are 2^(l_1 + ... + l_n) points in the HashGridStorage.

Parameters
storagehash map of sparse grid points
Returns
level structure of anisotropic full grids for CombigridOperations

References sgpp::base::HashGridStorage::begin(), sgpp::base::HashGridStorage::end(), sgpp::base::HashGridStorage::getDimension(), and level.

Referenced by convertHierarchicalSparseGridToCombigrid().

template<typename In , typename Out >
std::function<Out(In)> sgpp::combigrid::constantFunction ( Out  fixedValue = Out())

Returns a constant function with the given value.

If no value is specified, the default-constructed value is taken. The template-parameter In corresponding to the input parameter type of the returned constant function has to be specified. If no fixed value is given, the output type also has to be specified.

void sgpp::combigrid::convertCombigridToHierarchicalSparseGrid ( std::shared_ptr< TreeStorage< uint8_t >>  levelStructure,
base::HashGridStorage storage 
)

Takes the levels from levelStructure and stores its point in the given HashGridStorage (points without boundary)

Parameters
levelStructurelevel structure of anisotropic full grids of combination technique
storagehash map of sparse grid points

References sgpp::combigrid::MultiIndexIterator::getMultiIndex(), sgpp::base::HashGridStorage::insert(), sgpp::combigrid::MultiIndexIterator::isValid(), sgpp::combigrid::MultiIndexIterator::moveToNext(), sgpp::base::HashGridPoint::push(), and sgpp::base::HashGridStorage::recalcLeafProperty().

void sgpp::combigrid::convertexpUniformBoundaryCombigridToHierarchicalSparseGrid ( std::shared_ptr< TreeStorage< uint8_t >>  levelStructure,
base::HashGridStorage storage 
)

Takes the levels from levelStructure and stores its point in the given HashGridStorage (points with boundary)

Parameters
levelStructurelevel structure of anisotropic full grids of combination technique
storagehash map of sparse grid points

References sgpp::combigrid::MultiIndexIterator::getMultiIndex(), sgpp::base::HashGridStorage::insert(), sgpp::base::HashGridStorage::isContaining(), sgpp::combigrid::MultiIndexIterator::isValid(), sgpp::combigrid::MultiIndexIterator::moveToNext(), sgpp::base::HashGridPoint::push(), sgpp::base::HashGridStorage::recalcLeafProperty(), and sgpp::base::HashGridPoint::rehash().

Referenced by convertLevelStructureToGridPoints(), and sgpp::combigrid::BsplineStochasticCollocation::mean().

std::shared_ptr< TreeStorage< uint8_t > > sgpp::combigrid::convertHierarchicalSparseGridToCombigrid ( base::HashGridStorage storage,
GridConversionTypes  conversionType 
)

Creates a level structure for the levels that occur in the HashGridStorage.

Depending on the conversion type, it considers all available subspaces or just the complete ones.

Parameters
storage
conversionType
Returns
level structure of anisotropic full grids of combination technique

References allStorageLevels(), ALLSUBSPACES, completeStorageLevels(), and COMPLETESUBSPACES.

sgpp::base::DataMatrix sgpp::combigrid::convertLevelStructureToGridPoints ( std::shared_ptr< sgpp::combigrid::TreeStorage< uint8_t >> const &  levelStructure,
size_t  numDimensions 
)

converts a given level structure from the combigrid module into a matrix containing all grid points from these levels

Parameters
levelStructurethe level structure
numDimensionsnumber of dimensions
Returns
matrix containing the grid points

References sgpp::base::DataMatrix::appendRow(), convertexpUniformBoundaryCombigridToHierarchicalSparseGrid(), sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridStorage::getPoint(), and sgpp::base::HashGridStorage::getSize().

std::string sgpp::combigrid::escape ( std::string  str,
char  escapeCharacter,
std::string  avoidCharacters,
std::string  replaceCharacters 
)

Escapes in str each occurrence of a character in avoidCharacters with the escape character and the corresponding character in replaceCharacters.

avoidCharacters and replaceCharacters must have the same length and use disjoint sets of characters. The escapeCharacter is replaced with twice itself. The escape character must differ from all characters in avoidCharacters and in replaceCharacters. The resulting string will not contain any of the characters in avoidCharacters, which can be useful for serialization.

Referenced by pow(), and sgpp::combigrid::TreeStorageSerializationStrategy< T >::serialize().

double sgpp::combigrid::expUniformNakBspline ( double const &  x,
size_t const &  degree,
size_t  i,
std::vector< double > const &  points 
)

Nodal Not-a-Knot B spline basis always constant on level 0 degree 1 : hats from level 1 onwards degree 3 : polynomials on level 1, Not-a-Knot B-splines from level 2 onwards degree 5 : polynomials on level 1,2, Not-a-KNot B-Splines from level 3 onwards.

evaluates a not a knot Bspline on an expUnifromGrid, given by its degree, index and the knot sequence it is defined on in x.

the level is determined by the length of the points vector containing the grid points

This routine is much faster than the general nonUniformBSpline.

Parameters
xevaluation point
degreeB-spline degree
iindex of B-spline
pointspoints of the 1D grid
Returns
value of non-uniform B-spline in x

References sgpp::base::BsplineBasis< LT, IT >::eval(), and log2().

Referenced by sgpp::combigrid::BSplineInterpolationEvaluator::setGridPoints().

size_t sgpp::combigrid::getGridLevelForExpUniformBoundaryGrid ( size_t  numGridPoints)
double sgpp::combigrid::LagrangePolynomial ( double const &  x,
std::vector< double > const &  xValues,
size_t const &  k 
)

evaluates the Lagrange polynomial given by its index and the knot sequence it is defined on in x

Parameters
xevaluation point
xValues
kindex in the knot sequence
Returns
value of Lagrange polynomial in x

References m.

size_t sgpp::combigrid::log2 ( size_t  n)

log 2 for size_t types

Parameters
nsize_t number
Returns
log2 of the parameter as size_t

Referenced by expUniformNakBspline(), sgpp::base::Stretching::getAdjacentPositions(), and getGridLevelForExpUniformBoundaryGrid().

template<typename Out >
std::function<Out(MultiIndex const&)> sgpp::combigrid::multiIndexToDefaultValue ( Out  fixedValue = Out())

Returns a constant function with the given value and input type (MultiIndex const &).

If no value is specified, the default-constructed value is taken. If no fixed value is given, the output type also has to be specified.

double sgpp::combigrid::nonUniformBSpline ( double const &  x,
size_t const &  deg,
size_t const &  index,
std::vector< double > const &  xi 
)

evaluates a Bspline given by its degree, index and the knot sequence it is defined on in x

Parameters
xevaluation point
degB-spline degree
indexindex of B-spline in the knot sequence
xivector containing the B-Splines knots
Returns
value of non-uniform B-spline in x
bool sgpp::combigrid::operator< ( const OptimizationGuess first,
const OptimizationGuess second 
)
std::ostream & sgpp::combigrid::operator<< ( std::ostream &  stream,
FloatScalarVector  v 
)
bool sgpp::combigrid::operator> ( const OptimizationGuess first,
const OptimizationGuess second 
)
std::istream & sgpp::combigrid::operator>> ( std::istream &  stream,
FloatScalarVector v 
)
template<typename T >
T sgpp::combigrid::pow ( base,
size_t  exponent 
)

Exponentiation function for integer types with exact precision.

Uses square-and-multiply.

References binom(), escape(), join(), readFromFile(), split(), unescape(), and writeToFile().

Referenced by sgpp::datadriven::BatchLearner::applyWeight(), sgpp::datadriven::CrossValidation::calculateScore(), sgpp::combigrid::ExponentialChebyshevPointOrdering::convertIndex(), sgpp::combigrid::ExponentialNoBoundaryPointOrdering::convertIndex(), sgpp::datadriven::AlgorithmAdaBoostBase::doAdaBoostR2(), sgpp::datadriven::OperationDensityConditionalLinear::doConditional(), sgpp::datadriven::OperationDensityMarginalizeLinear::doMarginalize(), sgpp::base::OperationQuadratureLinear::doQuadrature(), sgpp::base::OperationSecondMomentLinear::doQuadrature(), sgpp::base::OperationQuadratureLinearBoundary::doQuadrature(), sgpp::base::OperationFirstMomentLinear::doQuadrature(), sgpp::base::OperationQuadratureMC::doQuadratureL2Error(), sgpp::quadrature::OperationQuadratureMCAdvanced::doQuadratureL2Error(), sgpp::combigrid::AtanUniform::eval(), sgpp::combigrid::AtanBeta::eval(), sgpp::combigrid::MonomialFunctionBasis1D::evaluate(), sgpp::optimization::test_problems::G06Objective::evalUndisplaced(), sgpp::optimization::test_problems::G11Objective::evalUndisplaced(), sgpp::optimization::test_problems::G12Objective::evalUndisplaced(), sgpp::optimization::test_problems::AbsoluteValueObjective::evalUndisplaced(), sgpp::optimization::test_problems::MichalewiczObjective::evalUndisplaced(), sgpp::optimization::test_problems::G05Objective::evalUndisplaced(), sgpp::optimization::test_problems::G08Objective::evalUndisplaced(), sgpp::optimization::test_problems::G09Objective::evalUndisplaced(), sgpp::optimization::test_problems::IncreasingPowerObjective::evalUndisplaced(), sgpp::optimization::test_problems::PermObjective::evalUndisplaced(), sgpp::optimization::test_problems::G12InequalityConstraint::evalUndisplaced(), sgpp::optimization::test_problems::G06InequalityConstraint::evalUndisplaced(), sgpp::optimization::test_problems::G08InequalityConstraint::evalUndisplaced(), sgpp::optimization::test_problems::G09InequalityConstraint::evalUndisplaced(), sgpp::optimization::test_problems::SolandEqualityConstraint::evalUndisplaced(), sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::combigrid::AdaptiveRefinementStrategy::geometricMeanStrategy(), sgpp::datadriven::LearnerSGD::getBatchError(), sgpp::base::MultipleClassPoint::getBorderScore(), sgpp::base::HashGridStorage::getLevelForIntegral(), sgpp::optimization::test_problems::AbsoluteValue::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::IncreasingPower::getOptimalPointUndisplaced(), sgpp::optimization::test_problems::G03::getOptimalPointUndisplaced(), getUniqueIndex(), sgpp::datadriven::OperationRegularizationDiagonalLinearBoundary::initH0HkLaplace(), sgpp::datadriven::OperationRegularizationDiagonalLinearBoundary::initHkmix(), sgpp::datadriven::DataBasedRefinementFunctor::isWithinSupport(), main(), sgpp::combigrid::Parabola_uniform::mean(), sgpp::base::OperationDiagonal::mult(), sgpp::solver::StepsizeControlMC::nextTimestep(), sgpp::solver::StepsizeControlBDF::nextTimestep(), sgpp::solver::VarTimestep::nextTimestep(), sgpp::base::BsplineModifiedClenshawCurtisBasis< unsigned int, unsigned int >::nonUniformBSpline(), sgpp::base::BsplineModifiedClenshawCurtisBasis< unsigned int, unsigned int >::nonUniformBSplineDx(), sgpp::base::BsplineModifiedClenshawCurtisBasis< unsigned int, unsigned int >::nonUniformBSplineDxDx(), sgpp::combigrid::ExponentialChebyshevPointOrdering::numPoints(), sgpp::combigrid::ExponentialNoBoundaryPointOrdering::numPoints(), sgpp::base::SurplusVolumeRefinementFunctor::operator()(), sgpp::base::SurplusVolumeCoarseningFunctor::operator()(), sgpp::datadriven::MultipleClassRefinementFunctor::operator()(), sgpp::datadriven::GridPointBasedRefinementFunctor::operator()(), sgpp::datadriven::ZeroCrossingRefinementFunctor::operator()(), sgpp::datadriven::DataBasedRefinementFunctor::operator()(), sgpp::pde::DowndPhidPhiBBIterativeLinearStretchedBoundary::operator()(), sgpp::base::ForwardSelectorRefinementIndicator::operator()(), sgpp::base::ImpurityRefinementIndicator::operator()(), sgpp::optimization::optimizer::CMAES::optimize(), sgpp::optimization::optimizer::LevenbergMarquardt::optimize(), sgpp::optimization::optimizer::AdaptiveNewton::optimize(), sgpp::optimization::optimizer::Newton::optimize(), sgpp::datadriven::PiecewiseConstantSmoothedRegressionMetaLearner::optimizeLambdaLog(), sgpp::pde::PhiPhiUpModLinear::rec(), sgpp::pde::PhiPhiDownModLinear::rec(), sgpp::pde::dPhidPhiUpModLinear::rec(), sgpp::pde::dPhidPhiDownModLinear::rec(), sgpp::optimization::IterativeGridGeneratorSOO::setAdaptivity(), sgpp::datadriven::LearnerSGD::train(), sgpp::base::Stretching::unserialize(), sgpp::combigrid::ExponentialChebyshevPermutationIterator::value(), sgpp::combigrid::ExponentialNoBoundaryPermutationIterator::value(), sgpp::combigrid::PolynomialChaosExpansion::variance(), sgpp::datadriven::GaussianKDE::variance(), sgpp::combigrid::Parabola_uniform::variance(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().

std::string sgpp::combigrid::readFromFile ( std::string  filename)

Reads a file into a string (without advanced error-handling).

References analyse_erg::file.

Referenced by pow().

std::string sgpp::combigrid::unescape ( std::string  str,
char  escapeCharacter,
std::string  avoidCharacters,
std::string  replaceCharacters 
)

Reverses the effect of the function escape().

The parameters have to fulfill the same requirements as in escape() and the string str should have been generated with escape().

Referenced by sgpp::combigrid::TreeStorageSerializationStrategy< T >::deserialize(), and pow().

void sgpp::combigrid::writeToFile ( std::string  filename,
std::string  value 
)

Writes a string into a file, overwriting currently saved data if the file already exists (without advanced error-handling).

References analyse_erg::file.

Referenced by pow().