Medusa  1.1
Coordinate Free Mehless Method implementation
mm::RBFBasis< RBFType, vec_t > Class Template Reference

#include <RBFBasis_fwd.hpp>

Detailed Description

template<class RBFType, class vec_t>
class mm::RBFBasis< RBFType, vec_t >

Represents a basis of Radial Basis Functions over a local neighbourhood.

Template Parameters
RBFTypeType of the RBF used. Must satisfy the Radial Basis Function concept.
vec_tVector type used in calculations.

This class satisfies the Basis function concept.

Usage example:

Gaussian<double> g(1.3);
RBFBasis<Gaussian<double>, Vec2d> basis(3, g); // construct
std::cout << basis << std::endl;
Range<Vec2d> support = {{0.1, 2.3}, {0.2, 2.2}, {0.0, 2.25}};
double val = basis.eval(1, 0.05, support); // evaluate
double der = basis.evalOp(1, 0.05, Lap<2>(), support); // evaluate derivative

Definition at line 30 of file RBFBasis_fwd.hpp.

Public Member Functions

 RBFBasis (int basis_size)
 Construct a basis of basis_size with default construction of RBF. More...
 
 RBFBasis (int basis_size, const rbf_t &rbf)
 Construct a basis of basis_size with given RBF. More...
 
int size () const
 Returns basis size. More...
 
const rbf_trbf () const
 Returns underlying RBF object. More...
 
rbf_trbf ()
 Returns modifiable underlying RBF object. More...
 
scalar_t eval (int index, const vector_t &point, const std::vector< vector_t > &support) const
 Evaluates index-th RBF's at point. More...
 
template<typename operator_t >
scalar_t evalOp (int index, const vector_t &point, operator_t op, const std::vector< vector_t > &support, scalar_t scale=1) const
 Apply an operator at a given point. More...
 
scalar_t evalOp (int index, const vector_t &point, Lap< dim > op, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate Laplacian. More...
 
scalar_t evalOp (int index, const vector_t &point, Der1< dim > op, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate 1st derivative. More...
 
scalar_t evalOp (int index, const vector_t &point, Der2< dim > op, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate 2nd derivative. More...
 
scalar_t evalAt0 (int index, const std::vector< vector_t > &support) const
 Evaluate index-th function at zero. More...
 
template<typename operator_t >
scalar_t evalOpAt0 (int index, const operator_t&op, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate general operator op at zero. More...
 
scalar_t evalOpAt0 (int index, const Lap< dim > &lap, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate Laplacian lap at zero. More...
 
scalar_t evalOpAt0 (int index, const Der1< dim > &der1, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate first derivative operator der1 at zero. More...
 
scalar_t evalOpAt0 (int index, const Der2< dim > &der2, const std::vector< vector_t > &support, scalar_t scale=1) const
 Evaluate second derivative operator der2 at zero. More...
 

Public Types

enum  { dim = vec_t::dim }
 Store dimension of the domain. More...
 
typedef RBFType rbf_t
 Radial basis function type. More...
 
typedef vec_t vector_t
 Vector type. More...
 
typedef vector_t::scalar_t scalar_t
 Scalar type. More...
 

Friends

template<typename V , typename R >
std::ostream & operator<< (std::ostream &os, const RBFBasis< V, R > &m)
 Output basic info about given basis. More...
 

Private Attributes

int size_
 Basis size. More...
 
rbf_t rbf_
 RBF function. More...
 

Member Enumeration Documentation

◆ anonymous enum

template<class RBFType , class vec_t >
anonymous enum

Store dimension of the domain.

Enumerator
dim 

Dimensionality of the function domain.

Definition at line 38 of file RBFBasis_fwd.hpp.

Constructor & Destructor Documentation

◆ RBFBasis() [1/2]

template<class RBFType , class vec_t >
mm::RBFBasis< RBFType, vec_t >::RBFBasis ( int  basis_size)
inlineexplicit

Construct a basis of basis_size with default construction of RBF.

Definition at line 46 of file RBFBasis_fwd.hpp.

◆ RBFBasis() [2/2]

template<class RBFType , class vec_t >
mm::RBFBasis< RBFType, vec_t >::RBFBasis ( int  basis_size,
const rbf_t rbf 
)
inline

Construct a basis of basis_size with given RBF.

Definition at line 48 of file RBFBasis_fwd.hpp.

Member Function Documentation

◆ eval()

template<class RBFType , class vec_t >
scalar_t mm::RBFBasis< RBFType, vec_t >::eval ( int  index,
const vector_t point,
const std::vector< vector_t > &  support 
) const

Evaluates index-th RBF's at point.

Parameters
indexA number in [0, size()) specifying the index of RBF to evaluate.
pointPoint in which to evaluate the RBF.
supportPoints in local neighbourhood used as centers for RBFs.
Returns
Value of requested monomial at given point.
Exceptions
Assertionfails if index is out of range or if an invalid derivative is requested.
Note
Derivatives only up to combined order of 2 are currently supported.

◆ evalAt0()

template<class vec_t , class RBFType >
RBFBasis< vec_t, RBFType >::scalar_t mm::RBFBasis< vec_t, RBFType >::evalAt0 ( int  index,
const std::vector< vector_t > &  support 
) const

Evaluate index-th function at zero.

Definition at line 74 of file RBFBasis.hpp.

◆ evalOp() [1/4]

template<class RBFType , class vec_t >
vec_t::scalar_t mm::RBFBasis< RBFType, vec_t >::evalOp ( int  index,
const vector_t point,
Der1< dim op,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Evaluate 1st derivative.

See also
evalOp

Definition at line 45 of file RBFBasis.hpp.

◆ evalOp() [2/4]

template<class RBFType , class vec_t >
vec_t::scalar_t mm::RBFBasis< RBFType, vec_t >::evalOp ( int  index,
const vector_t point,
Der2< dim op,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Evaluate 2nd derivative.

See also
evalOp

Definition at line 57 of file RBFBasis.hpp.

◆ evalOp() [3/4]

template<class RBFType , class vec_t >
vec_t::scalar_t mm::RBFBasis< RBFType, vec_t >::evalOp ( int  index,
const vector_t point,
Lap< dim op,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Evaluate Laplacian.

See also
evalOp

Definition at line 34 of file RBFBasis.hpp.

◆ evalOp() [4/4]

template<class RBFType , class vec_t >
template<typename operator_t >
scalar_t mm::RBFBasis< RBFType, vec_t >::evalOp ( int  index,
const vector_t point,
operator_t  op,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Apply an operator at a given point.

For \(\frac{d}{dx}\), the function computes \( \frac{d}{dx} p_i(x_s), x_s = \frac{x - c}{s} \).

Parameters
indexA number in [0, size()) specifying the index of a monomial to evaluate.
pointTranslated and scaled point \(x_s\) at which the basis function is evaluated.
opThe differential operator.
supportTranslated and scaled values of nodes in the support domain.
scaleThe scaling factor \(s\).
Returns
Value of the operator applied to index-th basis function at point point.
Exceptions
Assertionfails if index is out of range.
See also
Operator, Lap, Der1, Der2

◆ evalOpAt0() [1/4]

template<class RBFType , class vec_t >
vec_t::scalar_t mm::RBFBasis< RBFType, vec_t >::evalOpAt0 ( int  index,
const Der1< dim > &  der1,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Evaluate first derivative operator der1 at zero.

Definition at line 95 of file RBFBasis.hpp.

◆ evalOpAt0() [2/4]

template<class RBFType , class vec_t >
vec_t::scalar_t mm::RBFBasis< RBFType, vec_t >::evalOpAt0 ( int  index,
const Der2< dim > &  der2,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Evaluate second derivative operator der2 at zero.

Definition at line 114 of file RBFBasis.hpp.

◆ evalOpAt0() [3/4]

template<class RBFType , class vec_t >
vec_t::scalar_t mm::RBFBasis< RBFType, vec_t >::evalOpAt0 ( int  index,
const Lap< dim > &  lap,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const

Evaluate Laplacian lap at zero.

Definition at line 85 of file RBFBasis.hpp.

◆ evalOpAt0() [4/4]

template<class RBFType , class vec_t >
template<typename operator_t >
scalar_t mm::RBFBasis< RBFType, vec_t >::evalOpAt0 ( int  index,
const operator_t&  op,
const std::vector< vector_t > &  support,
scalar_t  scale = 1 
) const
inline

Evaluate general operator op at zero.

Parameters
indexA number in [0, size()) specifying the index of RBF to evaluate.
opEvaluated operator.
supportPoints in local neighbourhood used as centers for RBFs.
scaleScaling factor.
Returns
Value of requested monomial at given point.
Exceptions
Assertionfails if index is out of range or if an invalid derivative is requested.

Definition at line 115 of file RBFBasis_fwd.hpp.

◆ rbf() [1/2]

template<class RBFType , class vec_t >
rbf_t& mm::RBFBasis< RBFType, vec_t >::rbf ( )
inline

Returns modifiable underlying RBF object.

Definition at line 57 of file RBFBasis_fwd.hpp.

◆ rbf() [2/2]

template<class RBFType , class vec_t >
const rbf_t& mm::RBFBasis< RBFType, vec_t >::rbf ( ) const
inline

Returns underlying RBF object.

Definition at line 54 of file RBFBasis_fwd.hpp.

◆ size()

template<class RBFType , class vec_t >
int mm::RBFBasis< RBFType, vec_t >::size ( ) const
inline

Returns basis size.

Definition at line 51 of file RBFBasis_fwd.hpp.

Friends And Related Function Documentation

◆ operator<<

template<class RBFType , class vec_t >
template<typename V , typename R >
std::ostream& operator<< ( std::ostream &  os,
const RBFBasis< V, R > &  m 
)
friend

Output basic info about given basis.

Definition at line 139 of file RBFBasis.hpp.

Member Data Documentation

◆ rbf_

template<class RBFType , class vec_t >
rbf_t mm::RBFBasis< RBFType, vec_t >::rbf_
private

RBF function.

Definition at line 42 of file RBFBasis_fwd.hpp.

◆ size_

template<class RBFType , class vec_t >
int mm::RBFBasis< RBFType, vec_t >::size_
private

Basis size.

Definition at line 41 of file RBFBasis_fwd.hpp.


The documentation for this class was generated from the following files:
mm::Vec2d
Vec< double, 2 > Vec2d
Convenience typedef for 2d vector of doubles.
Definition: Vec_fwd.hpp:34