Go::BernsteinTriangularPoly Class Reference
[Implicitization]

Class that implements Bernstein polynomials on a triangle. More...

#include <BernsteinTriangularPoly.h>

List of all members.

Public Member Functions

 BernsteinTriangularPoly ()
 Default constructor.
 BernsteinTriangularPoly (int deg, const std::vector< double > &coefs)
 Constructor.
template<typename ForwardIterator>
 BernsteinTriangularPoly (int deg, ForwardIterator begin, ForwardIterator end)
 Constructor.
 BernsteinTriangularPoly (double coef)
 Constructor for a constant polynomial.
int degree () const
 Get the degree.
const double operator[] (int num) const
 Access function for coefficients.
double & operator[] (int num)
 Access function for coefficients.
template<typename T>
operator() (const Array< T, 3 > &u) const
 Evaluation operator, based on the triangular de Casteljau algorithm.
double norm () const
 Calculates the norm of the polynomial, defined as the sum of absolute values of the coefficients divided by the number of coefficients.
void normalize ()
 Normalizes the polynomial by dividing all coefficients with norm(), which is related to (but not identical to) the L1 norm of the polynomial.
void deriv (int der, const Vector3D &d, BernsteinTriangularPoly &btp) const
 Calculates the der'th derivative in the d-direction in terms of a new BernsteinTriangularPoly.
template<typename T>
blossom (const std::vector< Array< T, 3 > > &uvec) const
 Evaluates the blossom of the polynomial.
BernsteinTriangularPolyoperator *= (const BernsteinTriangularPoly &poly)
 Multiplication with another polynomial.
BernsteinTriangularPolyoperator *= (double c)
 Multiplication with a scalar.
BernsteinTriangularPolyoperator+= (const BernsteinTriangularPoly &poly)
 Addition with another polynomial.
BernsteinTriangularPolyoperator+= (double c)
 Addition with a scalar.
BernsteinTriangularPolyoperator-= (const BernsteinTriangularPoly &poly)
 Subtraction with another polynomial.
BernsteinTriangularPolyoperator-= (double c)
 Subtraction with a scalar.
BernsteinTriangularPolyoperator/= (double c)
 Division with a scalar.
void read (std::istream &is)
 Read from an input stream.
void write (std::ostream &os) const
 Write to an output stream.


Detailed Description

Class that implements Bernstein polynomials on a triangle.

The formula for a triangular Bernstein polynomial of degree n is

\[ p(\beta_0, \beta_1, \beta_2) = \sum_{i + j + k = n} \frac{n!}{i!j!k!} \beta_0^i \beta_1^j \beta_2^k c_{(i,j,k)}. \]

The coefficients $c_{ijk}$ are stored in the following order: $ c_{(n,0,0)}, c_{(n-1,1,0)}, c_{(n-2,2,0)}, \ldots, c_{(0,n,0)}, c_{(n-1,0,1)}, c_{(n-2, 1, 1)}, \ldots, c_{(0,0,n)} $.

Definition at line 62 of file BernsteinTriangularPoly.h.


Constructor & Destructor Documentation

Go::BernsteinTriangularPoly::BernsteinTriangularPoly ( int  deg,
const std::vector< double > &  coefs 
) [inline]

Constructor.

Parameters:
deg degree of the polynomial
coefs vector of Bernstein coefficients

Definition at line 69 of file BernsteinTriangularPoly.h.

template<typename ForwardIterator>
Go::BernsteinTriangularPoly::BernsteinTriangularPoly ( int  deg,
ForwardIterator  begin,
ForwardIterator  end 
) [inline]

Constructor.

Parameters:
deg degree of the polynomial
begin iterator to start of vector of Bernstein coefficients
end iterator to end of vector of Bernstein coefficients

Definition at line 77 of file BernsteinTriangularPoly.h.

Go::BernsteinTriangularPoly::BernsteinTriangularPoly ( double  coef  )  [inline, explicit]

Constructor for a constant polynomial.

Parameters:
coef the constant value of the polynomial

Definition at line 82 of file BernsteinTriangularPoly.h.


Member Function Documentation

int Go::BernsteinTriangularPoly::degree (  )  const [inline]

Get the degree.

Returns:
the degree of the polynomial

Definition at line 87 of file BernsteinTriangularPoly.h.

template<typename T>
T Go::BernsteinTriangularPoly::operator() ( const Array< T, 3 > &  u  )  const [inline]

Evaluation operator, based on the triangular de Casteljau algorithm.

Adapted from 'tri_decas' in Farin: "Curves and Surfaces for CAGD".

Parameters:
u parameter point given in barycentric coordinates
Returns:
the value of the polynomial at u

Definition at line 103 of file BernsteinTriangularPoly.h.

double Go::BernsteinTriangularPoly::norm (  )  const

Calculates the norm of the polynomial, defined as the sum of absolute values of the coefficients divided by the number of coefficients.

This norm is not the same as the L1 norm of the polynomial over the triangle, but is an upper bound for it.

void Go::BernsteinTriangularPoly::normalize (  ) 

Normalizes the polynomial by dividing all coefficients with norm(), which is related to (but not identical to) the L1 norm of the polynomial.

See also:
norm()

void Go::BernsteinTriangularPoly::deriv ( int  der,
const Vector3D &  d,
BernsteinTriangularPoly btp 
) const

Calculates the der'th derivative in the d-direction in terms of a new BernsteinTriangularPoly.

The direction is given in barycentric coordinates, so it is a vector whose elements sum to zero.

Parameters:
der order of derivative requested
d direction of derivative
Return values:
btp the derivative polynomial

template<typename T>
T Go::BernsteinTriangularPoly::blossom ( const std::vector< Array< T, 3 > > &  uvec  )  const [inline]

Evaluates the blossom of the polynomial.

The blossom of the polynomial $p$ of degree n is a multi-affine, symmetric n-variate function $B_p$ that satisfies

\[ /// B_p(b, \ldots, b) = p(b). /// \]

Parameters:
uvec the vector of values at which the blossom is evaluated, each value is a domain point given in barycentric coordinates.

Definition at line 160 of file BernsteinTriangularPoly.h.


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 15:13:16 2007 for GoTools Implicitization Library by  doxygen 1.5.1