1 /*  _______________________________________________________________________
2 
3     PECOS: Parallel Environment for Creation Of Stochastics
4     Copyright (c) 2011, Sandia National Laboratories.
5     This software is distributed under the GNU Lesser General Public License.
6     For more information, see the README file in the top Pecos directory.
7     _______________________________________________________________________ */
8 
9 //- Class:        HermiteOrthogPolynomial
10 //- Description:  Class for Hermite Orthogonal Polynomial
11 //-
12 //- Owner:        Mike Eldred, Sandia National Laboratories
13 
14 #ifndef HERMITE_ORTHOG_POLYNOMIAL_HPP
15 #define HERMITE_ORTHOG_POLYNOMIAL_HPP
16 
17 #include "OrthogonalPolynomial.hpp"
18 #include "pecos_global_defs.hpp"
19 
20 
21 namespace Pecos {
22 
23 /// Derived orthogonal polynomial class for Hermite polynomials
24 
25 /** The HermiteOrthogPolynomial class evaluates a univariate Hermite
26     polynomial of a particular order.  It uses the "probabilist's"
27     formulation for which the polynomials are orthogonal with respect
28     to the weight function 1/std::sqrt(2*PI) exp(-x^2/2) when integrated
29     over the support range of [-infinity,+infinity].  It enables
30     (mixed) multidimensional orthogonal polynomial basis functions
31     within OrthogPolyApproximation. */
32 
33 class HermiteOrthogPolynomial: public OrthogonalPolynomial
34 {
35 public:
36 
37   //
38   //- Heading: Constructor and destructor
39   //
40 
41   HermiteOrthogPolynomial(short colloc_rule); ///< extended constructor
42   HermiteOrthogPolynomial();                  ///< default constructor
43   ~HermiteOrthogPolynomial();                 ///< destructor
44 
45 protected:
46 
47   //
48   //- Heading: Virtual function redefinitions
49   //
50 
51   Real type1_value(Real x, unsigned short order);
52   Real type1_gradient(Real x, unsigned short order);
53   Real type1_hessian(Real x, unsigned short order);
54   Real norm_squared(unsigned short order);
55 
56   const RealArray& collocation_points(unsigned short order);
57   const RealArray& type1_collocation_weights(unsigned short order);
58 
59   Real length_scale() const;
60 
61 private:
62 
63   //
64   //- Heading: Data
65   //
66 
67 };
68 
69 
HermiteOrthogPolynomial(short colloc_rule)70 inline HermiteOrthogPolynomial::HermiteOrthogPolynomial(short colloc_rule)
71 {
72   collocRule = colloc_rule;
73   ptFactor   = std::sqrt(2.);
74   wtFactor   = 1./std::sqrt(PI);
75 }
76 
77 
HermiteOrthogPolynomial()78 inline HermiteOrthogPolynomial::HermiteOrthogPolynomial()
79 {
80   collocRule = GAUSS_HERMITE;
81   ptFactor   = std::sqrt(2.);
82   wtFactor   = 1./std::sqrt(PI);
83 }
84 
85 
~HermiteOrthogPolynomial()86 inline HermiteOrthogPolynomial::~HermiteOrthogPolynomial()
87 { }
88 
89 
90 /** mean is zero; return std deviation = 1. */
length_scale() const91 inline Real HermiteOrthogPolynomial::length_scale() const
92 { return 1.; }
93 
94 } // namespace Pecos
95 
96 #endif
97