rbf::thin_plate_spline Class Reference

r^n log(r) with n even More...

#include <rbf.hpp>

Inheritance diagram for rbf::thin_plate_spline:

Inheritance graph
[legend]
Collaboration diagram for rbf::thin_plate_spline:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 thin_plate_spline ()
 thin_plate_spline (const point &c)

Static Public Member Functions

static void set_n (size_t new_n)

Private Member Functions

double operator() (double r) const
 The scalar functions defining each RBF.
double d (double r) const
 The scalar first derivative defining each RBF.
double d2 (double r) const
 The scalar second derivative defining each RBF.

Static Private Attributes

static size_t n = 0
 Shape parameter.


Detailed Description

r^n log(r) with n even

Constructor & Destructor Documentation

rbf::thin_plate_spline::thin_plate_spline (  )  [inline]

00145 {};

rbf::thin_plate_spline::thin_plate_spline ( const point c  )  [inline]

00146 : piecewise_smooth_rbf(c){;};


Member Function Documentation

void rbf::thin_plate_spline::set_n ( size_t  new_n  )  [static]

00179                                            {
00180     if(n_new % 2 != 0){ 
00181       badArgument exc;
00182       exc.reason = "Cannot assign an odd n to a thin-plate spline RBF.";
00183       exc.line = __LINE__;
00184       exc.file = __FILE__;
00185       throw exc;
00186     }
00187     thin_plate_spline::n = n_new;    
00188   }  

double rbf::thin_plate_spline::operator() ( double  r  )  const [private, virtual]

The scalar functions defining each RBF.

Implements rbf::radial_basis_function.

00284                                                      {
00285     if(n == 0){
00286       badArgument exc;
00287       exc.reason = 
00288         "Parameter n not set for thin_plate_spline. \n"
00289         "Use thin_plate_spline::set_n before evaluating.";
00290       exc.line = __LINE__;
00291       exc.file = __FILE__;
00292       throw exc;
00293     }
00294     r = fabs(r);
00295     if(r == 0)
00296       return 0;
00297     if(n == 2)
00298       return gsl_pow_2(r)*log(r);
00299     if(n == 4)
00300       return gsl_pow_4(r)*log(r);
00301     if(n == 6)
00302       return gsl_pow_6(r)*log(r);
00303     if(n == 8)
00304       return gsl_pow_8(r)*log(r);
00305     
00306     return pow(r,n)*log(r);
00307   }

double rbf::thin_plate_spline::d ( double  r  )  const [private, virtual]

The scalar first derivative defining each RBF.

Implements rbf::radial_basis_function.

00310                                             {
00311     if(n == 0){
00312       badArgument exc;
00313       exc.reason = 
00314         "Parameter n not set for thin_plate_spline. \n"
00315         "Use thin_plate_spline::set_n before evaluating.";
00316       exc.line = __LINE__;
00317       exc.file = __FILE__;
00318       throw exc;
00319     }
00320     r = fabs(r);
00321     if(r == 0)
00322       return 0;
00323     if(n == 2)
00324       return r*(2*log(r) + 1);
00325     if(n == 4)
00326       return gsl_pow_3(r)*(4*log(r) + 1);
00327     if(n == 6)
00328       return gsl_pow_5(r)*(6*log(r) + 1);
00329     if(n == 8)
00330       return gsl_pow_7(r)*(8*log(r) + 1);
00331     
00332     return pow(r,n-1)*(n*log(r) + 1);
00333   }

double rbf::thin_plate_spline::d2 ( double  r  )  const [private, virtual]

The scalar second derivative defining each RBF.

Implements rbf::radial_basis_function.

00335                                              {
00336     if(n == 0){
00337       badArgument exc;
00338       exc.reason = 
00339         "Parameter n not set for thin_plate_spline. \n"
00340         "Use thin_plate_spline::set_n before evaluating.";
00341       exc.line = __LINE__;
00342       exc.file = __FILE__;
00343       throw exc;
00344     }
00345     if (n == 2 and r == 0){
00346       badDomain exc;
00347       exc.reason = 
00348         "For n = 2, thin-plate splines do no have a derivative at zero.";
00349       exc.line = __LINE__;
00350       exc.file = __FILE__;
00351       throw exc;
00352     }
00353     if(r == 0)
00354       return 0;
00355 
00356     if(n == 2)
00357       return 2*log(r) + 3;
00358     if(n == 4)
00359       return gsl_pow_2(r)*(12*log(r) + 7);
00360     if(n == 6)
00361       return gsl_pow_4(r)*(30*log(r) + 11);
00362     if(n == 8)
00363       return gsl_pow_6(r)*(56*log(r) + 15);
00364 
00365     return pow(r,n-2)*((n*n - n)*log(r) + 2*n - 1);
00366   }


Member Data Documentation

size_t rbf::thin_plate_spline::n = 0 [static, private]

Shape parameter.


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

Generated on Fri Jun 6 17:28:30 2008 by  doxygen 1.5.6