rbf::piecewise_polynomial Class Reference

r^n with n odd More...

#include <rbf.hpp>

Inheritance diagram for rbf::piecewise_polynomial:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 piecewise_polynomial ()
 piecewise_polynomial (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 with n odd

Constructor & Destructor Documentation

rbf::piecewise_polynomial::piecewise_polynomial (  )  [inline]

00117 {};

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

00118 : piecewise_smooth_rbf(c){;};


Member Function Documentation

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

00168                                               {
00169     if(n_new % 2 != 1){ 
00170       badArgument exc;
00171       exc.reason = "Cannot assign an even n to a piecewise polynomial RBF.";
00172       exc.line = __LINE__;
00173       exc.file = __FILE__;
00174       throw exc;
00175     }
00176     piecewise_polynomial::n = n_new;    
00177   }

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

The scalar functions defining each RBF.

Implements rbf::radial_basis_function.

00206                                                        {
00207     if(n == 0){
00208       badArgument exc;
00209       exc.reason = 
00210         "Parameter n not set for piecewise_polynomial. \n"
00211         "Use piecewise_polynomial::set_n before evaluating.";
00212       exc.line = __LINE__;
00213       exc.file = __FILE__;
00214       throw exc;
00215     }
00216     r = fabs(r);
00217 
00218     if(n == 1)
00219       return r;
00220     if(n == 3)
00221       return gsl_pow_3(r);
00222     if(n == 5)
00223       return gsl_pow_5(r);
00224     if(n == 7)
00225       return gsl_pow_7(r);
00226     if(n == 9)
00227       return gsl_pow_9(r);
00228     return pow(r,n);
00229   }

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

The scalar first derivative defining each RBF.

Implements rbf::radial_basis_function.

00231                                                {
00232     if(n == 0){
00233       badArgument exc;
00234       exc.reason = 
00235         "Parameter n not set for piecewise_polynomial. \n"
00236         "Use piecewise_polynomial::set_n before evaluating.";
00237       exc.line = __LINE__;
00238       exc.file = __FILE__;
00239       throw exc;
00240     }
00241     r = fabs(r);
00242     if(n == 1)
00243       return 1;
00244     if(n == 3)
00245       return 3*gsl_pow_2(r);
00246     if(n == 5)
00247       return 5*gsl_pow_4(r);
00248     if(n == 7)
00249       return 7*gsl_pow_6(r);
00250     if(n == 9)
00251       return 9*gsl_pow_8(r);
00252     return n*pow(r,n-1);
00253   }

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

The scalar second derivative defining each RBF.

Implements rbf::radial_basis_function.

00255                                                 {
00256     if(n == 0){
00257       badArgument exc;
00258       exc.reason = 
00259         "Parameter n not set for piecewise_polynomial. \n"
00260         "Use piecewise_polynomial::set_n before evaluating.";
00261       exc.line = __LINE__;
00262       exc.file = __FILE__;
00263       throw exc;
00264     }
00265     r = fabs(r);
00266     if(n == 1)
00267       return 0;
00268     if(n == 3)
00269       return 6*r;
00270     if(n == 5)
00271       return 20*gsl_pow_3(r);
00272     if(n == 7)
00273       return 42*pow(r,5);
00274     if(n == 9)
00275       return 72*gsl_pow_7(r);
00276     return n*(n-1)*pow(r,n-2);
00277   }


Member Data Documentation

size_t rbf::piecewise_polynomial::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