MathTL
 All Classes Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | Protected Attributes
MathTL::QuadratureRule< DIM > Class Template Reference

#include <quadrature.h>

Inheritance diagram for MathTL::QuadratureRule< DIM >:
MathTL::CompositeRule< DIM >

List of all members.

Public Types

typedef QuadratureRule< DIM-1 > SubQuadratureRule

Public Member Functions

 QuadratureRule ()
 QuadratureRule (const QuadratureRule< DIM > &Q)
 QuadratureRule (const SubQuadratureRule &Q, const QuadratureRule< 1 > &Q1)
virtual ~QuadratureRule ()
unsigned int get_N () const
void get_points (Array1D< Point< DIM > > &points) const
void get_weights (Array1D< double > &weights) const
double integrate (const Function< DIM, double > &f) const
double integrate (const Function< DIM, double > &f, const Point< DIM > &a, const Point< DIM > &b) const
template<>
 QuadratureRule (const QuadratureRule< 0 > &Q, const QuadratureRule< 1 > &Q1)

Protected Attributes

Array1D< Point< DIM > > points_
Array1D< double > weights_

Detailed Description

template<unsigned int DIM>
class MathTL::QuadratureRule< DIM >

A base class for N-point quadrature rules in DIM space dimensions on a box spanned by a,b R^{DIM} Q(f) = {k=1}^N w_k f(x_k) with nodes x_k and weights w_k. Internally, we store the nodes and weights for quadrature on [0,1]^{DIM} and scale the nodes appropriately when quadrature has to be performed

(this class is _not_ intended to be used in practice, please use derived special versions below instead!)


Member Typedef Documentation

template<unsigned int DIM>
typedef QuadratureRule<DIM-1> MathTL::QuadratureRule< DIM >::SubQuadratureRule

typedef for lower-dimensional quadrature rule


Constructor & Destructor Documentation

template<unsigned int DIM>
MathTL::QuadratureRule< DIM >::QuadratureRule ( )

default constructor: yields empty quadrature rule

template<unsigned int DIM>
MathTL::QuadratureRule< DIM >::QuadratureRule ( const QuadratureRule< DIM > &  Q)

copy constructor: copy points and weights

template<unsigned int DIM>
MathTL::QuadratureRule< DIM >::QuadratureRule ( const SubQuadratureRule< DIM > &  Q,
const QuadratureRule< 1 > &  Q1 
)

construct quadrature rule as a tensor product from a lower dimensional one and a one-dimensional one

template<unsigned int DIM>
MathTL::QuadratureRule< DIM >::~QuadratureRule ( ) [virtual]

virtual destructor


Member Function Documentation

template<unsigned int DIM>
unsigned int MathTL::QuadratureRule< DIM >::get_N ( ) const [inline]

return number of quadrature points

template<unsigned int DIM>
void MathTL::QuadratureRule< DIM >::get_points ( Array1D< Point< DIM > > &  points) const [inline]

return all quadrature points

template<unsigned int DIM>
void MathTL::QuadratureRule< DIM >::get_weights ( Array1D< double > &  weights) const [inline]

return quadrature weights

template<unsigned int DIM>
double MathTL::QuadratureRule< DIM >::integrate ( const Function< DIM, double > &  f) const

evaluate quadrature rule on [0,1]^{DIM} (we assume that the function is real-valued)

template<unsigned int DIM>
double MathTL::QuadratureRule< DIM >::integrate ( const Function< DIM, double > &  f,
const Point< DIM > &  a,
const Point< DIM > &  b 
) const

Evaluate quadrature rule on [a,b] where a,b are points in R^d. We do so by rescaling the integral to one over [0,1]^{DIM} (we assume that the function is real-valued)


Member Data Documentation

template<unsigned int DIM>
Array1D<Point<DIM> > MathTL::QuadratureRule< DIM >::points_ [protected]

nodes of the quadrature rule

template<unsigned int DIM>
Array1D<double> MathTL::QuadratureRule< DIM >::weights_ [protected]

weights of the quadrature rule


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations