Go::BernsteinTetrahedralPoly Class Reference
[Implicitization]

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

#include <BernsteinTetrahedralPoly.h>

List of all members.

Public Member Functions

 BernsteinTetrahedralPoly ()
 Default constructor.
 BernsteinTetrahedralPoly (int deg, const std::vector< double > &coefs)
 Constructor.
template<typename ForwardIterator>
 BernsteinTetrahedralPoly (int deg, ForwardIterator begin, ForwardIterator end)
 Constructor.
 BernsteinTetrahedralPoly (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, 4 > &u) const
 Evaluation operator, based on the tetrahedral 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 Vector4D &d, BernsteinTetrahedralPoly &btp) const
 Calculates the der'th derivative in the d-direction in terms of a new BernsteinTetrahedralPoly.
template<typename T>
blossom (const std::vector< Array< T, 4 > > &uvec) const
 Evaluates the blossom of the polynomial.
BernsteinPoly pickLine (const Array< double, 4 > &a, const Array< double, 4 > &b) const
 Routine that picks out the line with endpoints a and b as a new BernsteinPoly.
BernsteinTetrahedralPolyoperator *= (const BernsteinTetrahedralPoly &poly)
 Multiplication with another polynomial.
BernsteinTetrahedralPolyoperator *= (double c)
 Multiplication with a scalar.
BernsteinTetrahedralPolyoperator+= (const BernsteinTetrahedralPoly &poly)
 Addition with another polynomial.
BernsteinTetrahedralPolyoperator+= (double c)
 Addition with a scalar.
BernsteinTetrahedralPolyoperator-= (const BernsteinTetrahedralPoly &poly)
 Subtraction with another polynomial.
BernsteinTetrahedralPolyoperator-= (double c)
 Subtraction with a scalar.
BernsteinTetrahedralPolyoperator/= (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 tetrahedron.

The formula for a tetrahedral Bernstein polynomial of degree n is

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

The coefficients $c_{ijk}$ are stored in the following order: $ c_{(n,0,0,0)}, c_{(n-1,1,0,0)}, c_{(n-2,2,0,0)}, \ldots, c_{(0,n,0,0)}, c_{(n-1,0,1,0)}, c_{(n-2, 1, 1,0)}, \ldots, c_{(0,0,0,n)} $. That is, a reverse lexicographical ordering with the most significant index being the last one.

Definition at line 67 of file BernsteinTetrahedralPoly.h.


Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 74 of file BernsteinTetrahedralPoly.h.

template<typename ForwardIterator>
Go::BernsteinTetrahedralPoly::BernsteinTetrahedralPoly ( 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 82 of file BernsteinTetrahedralPoly.h.

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

Constructor for a constant polynomial.

Parameters:
coef the constant value of the polynomial

Definition at line 87 of file BernsteinTetrahedralPoly.h.


Member Function Documentation

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

Get the degree.

Returns:
the degree of the polynomial

Definition at line 92 of file BernsteinTetrahedralPoly.h.

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

Evaluation operator, based on the tetrahedral de Casteljau algorithm.

Generalized 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 108 of file BernsteinTetrahedralPoly.h.

double Go::BernsteinTetrahedralPoly::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 tetrahedron, but is an upper bound for it.

void Go::BernsteinTetrahedralPoly::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::BernsteinTetrahedralPoly::deriv ( int  der,
const Vector4D &  d,
BernsteinTetrahedralPoly btp 
) const

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

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::BernsteinTetrahedralPoly::blossom ( const std::vector< Array< T, 4 > > &  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 168 of file BernsteinTetrahedralPoly.h.

BernsteinPoly Go::BernsteinTetrahedralPoly::pickLine ( const Array< double, 4 > &  a,
const Array< double, 4 > &  b 
) const

Routine that picks out the line with endpoints a and b as a new BernsteinPoly.

The new polynomial is defined on [0,1]. If p is the old bivariate polynomial and q is the new one, q is defined by

\[ q(t) = p((1-t)a_0 + tb_0, (1-t)a_1 + tv_1). \]

The function is implemented by blossoming.

Parameters:
a the starting point of the line in barycentric coordinates
b the endpoint of the line in barycentric coordinates


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