proj home

Files   Classes   Functions   Hierarchy  

bernsteinPoly Class Reference

Bernstein Polynomial. More...

#include <bernstein.h>

Collaboration diagram for bernsteinPoly:

List of all members.

Public Member Functions

void construct ()
 Realizes the function with the current values of n and i.
void construct (uintc n_, uintc i_)
 Construct the function.
 bernsteinPoly ()
 Dummy constructor, call construct() later.
 bernsteinPoly (uintc n_, uintc i_)
 Construct the function.
void eval (double &res, doublec t) const
 Evaluate the function at t.
doublec eval (doublec t) const
 Evaluate the function at t.

Public Attributes

double coeff
 The leading coefficient.
uint n
 The degree.
uint i
 Which polynomial 0.


Detailed Description

Bernstein Polynomial.

Defined as (n,i)*t^i*(1-t)^(n-i).

Definition at line 12 of file bernstein.h.


Constructor & Destructor Documentation

bernsteinPoly::bernsteinPoly (  )  [inline]

Dummy constructor, call construct() later.

Definition at line 30 of file bernstein.h.

00030 : coeff(0.0), n(0), i(0) {}

bernsteinPoly::bernsteinPoly ( uintc  n_,
uintc  i_ 
)

Construct the function.

Definition at line 22 of file bernstein.cpp.

00026   : n(n_), i(i_)
00027 {
00028   construct();
00029 }


Member Function Documentation

void bernsteinPoly::construct ( uintc  n_,
uintc  i_ 
)

Construct the function.

Definition at line 11 of file bernstein.cpp.

00015 {
00016   n = n_;
00017   i = i_;
00018   construct();
00019 }

void bernsteinPoly::construct (  ) 

Realizes the function with the current values of n and i.

Definition at line 31 of file bernstein.cpp.

References coeff, i, mathcombination(), and n.

Referenced by bernsteinPolyProd::construct().

00032 {
00033   mathcombination(coeff,n,i);
00034 }

doublec bernsteinPoly::eval ( doublec  t  )  const [inline]

Evaluate the function at t.

Definition at line 38 of file bernstein.h.

References eval().

Referenced by eval().

00039     { double res; eval(res,t); return res; }

void bernsteinPoly::eval ( double &  res,
doublec  t 
) const

Evaluate the function at t.

Definition at line 37 of file bernstein.cpp.

Referenced by bernsteintest::test01().

00041 {
00042   doublec a1(1.0-t);
00043   res = coeff * pow(t,(double)i) * pow(a1,(double)(n-i));
00044 }


Member Data Documentation

The leading coefficient.

Definition at line 16 of file bernstein.h.

Referenced by construct().

Which polynomial 0.

.n

Definition at line 21 of file bernstein.h.

Referenced by construct().

The degree.

Definition at line 19 of file bernstein.h.

Referenced by construct().


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

Generated on Fri Mar 4 00:49:50 2011 for Chelton Evans Source by  doxygen 1.5.8