Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_HermiteBasisImp.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 template <typename ordinal_type, typename value_type>
12 HermiteBasis(ordinal_type p, bool normalize, Stokhos::GrowthPolicy growth) :
13  RecurrenceBasis<ordinal_type,value_type>("Hermite", p, normalize, growth)
14 {
15  this->setup();
16 
17 #ifdef HAVE_STOKHOS_DAKOTA
18  this->setSparseGridGrowthRule(webbur::level_to_order_linear_wn);
19 #endif
20 }
21 
22 template <typename ordinal_type, typename value_type>
26 {
27  // Compute coefficients in 3-term recurrsion
28  computeRecurrenceCoefficients(p+1, this->alpha, this->beta, this->delta,
29  this->gamma);
30 
31  // Setup rest of recurrence basis
32  this->setup();
33 }
34 
35 template <typename ordinal_type, typename value_type>
38 {
39 }
40 
41 template <typename ordinal_type, typename value_type>
42 bool
48  Teuchos::Array<value_type>& gamma) const
49 {
50  // Hermite 3 term recurrence:
51  // He_0(x) = 1
52  // He_1(x) = x
53  // He_i(x) = x*He_{i-1}(x) - (i-1)*He_{i-2}(x), i=2,3,...
54  alpha[0] = 0.0;
55  beta[0] = 1.0;
56  delta[0] = 1.0;
57  gamma[0] = 1.0;
58  for (ordinal_type i=1; i<n; i++) {
59  alpha[i] = 0.0;
60  beta[i] = value_type(i);
61  delta[i] = 1.0;
62  gamma[i] = 1.0;
63  }
64 
65  return false;
66 }
67 
68 template <typename ordinal_type, typename value_type>
72 {
73  return
75 }
Teuchos::Array< value_type > delta
Recurrence coefficients.
Hermite polynomial basis.
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship: for ...
Teuchos::Array< value_type > beta
Recurrence coefficients.
GrowthPolicy
Enumerated type for determining Smolyak growth policies.
Teuchos::Array< value_type > alpha
Recurrence coefficients.
virtual Teuchos::RCP< OneDOrthogPolyBasis< ordinal_type, value_type > > cloneWithOrder(ordinal_type p) const
Clone this object with the option of building a higher order basis.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void setup()
Setup basis after computing recurrence coefficients.
Teuchos::Array< value_type > gamma
Recurrence coefficients.
virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr)
Set sparse grid rule.
virtual bool computeRecurrenceCoefficients(ordinal_type n, Teuchos::Array< value_type > &alpha, Teuchos::Array< value_type > &beta, Teuchos::Array< value_type > &delta, Teuchos::Array< value_type > &gamma) const
Compute recurrence coefficients.
HermiteBasis(ordinal_type p, bool normalize=false, GrowthPolicy growth=SLOW_GROWTH)
Constructor.