SG++
BSplineRoutines.hpp File Reference

Functions

sgpp::combigrid::GridFunction BSplineCoefficientGridFunction (sgpp::combigrid::MultiFunction func, sgpp::combigrid::CombiHierarchies::Collection grids, size_t degree)
 Creates the GridFunction that calculates the coefficients of the B-spline interpolation. More...
 
sgpp::combigrid::GridFunction BSplineTensorCoefficientGridFunction (sgpp::combigrid::MultiFunction func, sgpp::combigrid::CombiHierarchies::Collection grids, size_t degree)
 Creates the GridFunction that calculates the coefficients of the B-spline interpolation. More...
 
std::vector< double > createdeg1Knots (std::vector< double > const &xValues)
 Creates the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degree 1 by adding the necessary point outisde [0,1] by mirroring at 0 and 1. More...
 
std::vector< double > createdeg3NakKnots (std::vector< double > const &xValues)
 Creates the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degree 1 by adding the necessary point outisde [0,1] by mirroring at 0 and 1. More...
 
std::vector< double > createdeg5NakKnots (std::vector< double > const &xValues)
 Creates the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degree 1 by adding the necessary point outisde [0,1] by mirroring at 0 and 1. More...
 
std::vector< double > createNakKnots (std::vector< double > const &xValues, size_t const &degree)
 interface for creating the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degrees i n{1,3,5} More...
 
size_t getUniqueIndex (size_t level, size_t index)
 unique index for level index pair More...
 

Function Documentation

sgpp::combigrid::GridFunction BSplineTensorCoefficientGridFunction ( sgpp::combigrid::MultiFunction  func,
sgpp::combigrid::CombiHierarchies::Collection  grids,
size_t  degree 
)

Creates the GridFunction that calculates the coefficients of the B-spline interpolation.

The coefficients for each B-Spline are saved in a TreeStorage encoded by a MultiIndex The Grid Functions coefficients are used as well for quadrature.

Parameters
functhe objective function that shall be interpolated
gridsvector of one dimensional grids
degreedegree of the B spline basis functions

References sgpp::optimization::Printer::getInstance(), sgpp::combigrid::MultiIndexIterator::getMultiIndex(), getUniqueIndex(), grid(), level, sgpp::base::DataMatrix::set(), sgpp::base::DataMatrix::setAll(), sgpp::optimization::Printer::setVerbosity(), sgpp::optimization::sle_solver::Auto::solve(), and sgpp::combigrid::CombiEvaluators::tensorBSplineInterpolation().

Referenced by sgpp::combigrid::CombigridTensorOperation::createExpUniformBoundaryBSplineInterpolation().

std::vector<double> createdeg1Knots ( std::vector< double > const &  xValues)

Creates the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degree 1 by adding the necessary point outisde [0,1] by mirroring at 0 and 1.

Parameters
xValuesgrid points inside [0,1]

Referenced by createNakKnots().

std::vector<double> createdeg3NakKnots ( std::vector< double > const &  xValues)

Creates the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degree 1 by adding the necessary point outisde [0,1] by mirroring at 0 and 1.

For dealing with the boundaries at 0 and 1 not a knot knots are used. In the case of degree 3 this means that the knot directly to the right/left of 0/1 are removed.

Parameters
xValuesgrid points inside [0,1]

Referenced by createNakKnots().

std::vector<double> createdeg5NakKnots ( std::vector< double > const &  xValues)

Creates the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degree 1 by adding the necessary point outisde [0,1] by mirroring at 0 and 1.

For dealing with the boundaries at 0 and 1 not a knot knots are used. In the case of degree 3 this means that the two knots directly to the right/left of 0/1 are removed.

Parameters
xValuesgrid points inside [0,1]

Referenced by createNakKnots().

std::vector<double> createNakKnots ( std::vector< double > const &  xValues,
size_t const &  degree 
)

interface for creating the knot sequence xi needed for the evaluation of B-splines from the evaluation points xValues for B splines of degrees i n{1,3,5}

Parameters
xValuesgrid points inside [0,1]
degreedegree of the B spline basis functions

References createdeg1Knots(), createdeg3NakKnots(), and createdeg5NakKnots().

size_t getUniqueIndex ( size_t  level,
size_t  index 
)

unique index for level index pair

Parameters
level
index
Returns

References sgpp::combigrid::pow().

Referenced by BSplineTensorCoefficientGridFunction(), and sgpp::combigrid::BSplineInterpolationCoefficientEvaluator::setGridPoints().