Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

Gauss1D.h

Go to the documentation of this file.
00001 #ifndef GAUSS1D_H
00002 #define GAUSS1D_H
00003 
00004 #include "TSFArray.h"
00005 
00006 namespace Sundance
00007 {
00008   using namespace TSF;
00009 
00010   /**\ingroup Support
00011    * Get abscissas and weights for Gauss-Legendre quadrature.
00012    */
00013 
00014   class Gauss1D
00015     {
00016     public:
00017       /** create an n-point rule on the interval [-1, 1] */
00018       Gauss1D(int n);
00019       /** create an n-point rule on the interval [a, b] */
00020       Gauss1D(int n, double a, double b);
00021 
00022       /** return the number of points in the rule */
00023       int nPoints() const {return nodes_.length();}
00024       /** get the abscissas */
00025       const TSFArray<double>& nodes() const {return nodes_;}
00026       /** get the weights */
00027       const TSFArray<double>& weights() const {return weights_;}
00028 
00029       static bool unitTest();
00030     private:
00031       void computeWeights(int n, double a, double b);
00032 
00033       TSFArray<double> nodes_;
00034       TSFArray<double> weights_;
00035     };
00036 
00037 }
00038 
00039 
00040 #endif
00041 

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by