Files Classes Functions Hierarchy
#include <bernstein.h>
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. | |
Defined as (n,i)*t^i*(1-t)^(n-i).
Definition at line 12 of file bernstein.h.
| bernsteinPoly::bernsteinPoly | ( | ) | [inline] |
| 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 }
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 }
| double bernsteinPoly::coeff |
1.5.8