Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_JacobiBasisImp.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>
13  value_type alphaIndex,
14  value_type betaIndex, bool normalize, Stokhos::GrowthPolicy growth) :
15  RecurrenceBasis<ordinal_type, value_type>("Jacobi", p, normalize, growth),
16  alphaIndex_(alphaIndex),
17  betaIndex_(betaIndex)
18 {
19  this->setup();
20 
21 #ifdef HAVE_STOKHOS_DAKOTA
22  this->setSparseGridGrowthRule(webbur::level_to_order_linear_wn);
23 #endif
24 }
25 
26 template <typename ordinal_type, typename value_type>
30  alphaIndex_(basis.alphaIndex_),
31  betaIndex_(basis.betaIndex_)
32 {
33  // Compute coefficients in 3-term recurrsion
34  computeRecurrenceCoefficients(p+1, this->alpha, this->beta, this->delta,
35  this->gamma);
36 
37  // Setup rest of recurrence basis
38  this->setup();
39 }
40 
41 template <typename ordinal_type, typename value_type>
44 {
45 }
46 
47 template <typename ordinal_type, typename value_type>
48 bool
54  Teuchos::Array<value_type>& gamma) const
55 {
56  value_type a = alphaIndex_;
57  value_type b = betaIndex_;
58 
59  if (a==0.0 && b==0.0)
60  {
61  alpha[0] = 0.0;
62  beta[0] = 1.0;
63  delta[0] = 1.0;
64  gamma[0] = 1.0;
65  }
66  else
67  {
68  alpha[0] = getB(0)/getA(0);
69  beta[0] = 1.0;
70  delta[0] = getC(0)/getA(0);
71  gamma[0] = 1.0;
72  }
73  for (ordinal_type i=1; i<n; i++)
74  {
75  alpha[i] = getB(i)/getA(i);
76  beta[i] = getD(i)/getA(i);
77  delta[i] = getC(i)/getA(i);
78  gamma[i] = 1.0;
79  }
80 
81  return false;
82 }
83 
84 
85 template <typename ordinal_type, typename value_type>
87 {
88  return 2*(n+1)*(n+alphaIndex_+betaIndex_+1)*(2*n+alphaIndex_+betaIndex_);
89 }
90 
91 template <typename ordinal_type, typename value_type>
93 {
94  value_type a = alphaIndex_;
95  value_type b = betaIndex_;
96  return -(2*n+a+b+1)*(a*a-b*b);
97 }
98 
99 template <typename ordinal_type, typename value_type>
101 {
102  value_type a = alphaIndex_;
103  value_type b = betaIndex_;
104  return poch3(2*n+a+b);
105 }
106 
107 template <typename ordinal_type, typename value_type>
109 {
110  value_type a = alphaIndex_;
111  value_type b = betaIndex_;
112  return 2*(n+a)*(n+b)*(2*n + a + b + 2);
113 }
114 
115 template <typename ordinal_type, typename value_type>
117 {
118  return (m+2)*(m+1)*m;
119 }
120 
121 template <typename ordinal_type, typename value_type>
125 {
126  return
128 }
Teuchos::Array< value_type > delta
Recurrence coefficients.
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship: for ...
value_type getD(int n) const
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.
Teuchos::Array< value_type > beta
Recurrence coefficients.
GrowthPolicy
Enumerated type for determining Smolyak growth policies.
value_type getB(int n) const
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.
value_type getC(int n) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Jacobi polynomial basis.
value_type poch3(value_type x) const
virtual void setup()
Setup basis after computing recurrence coefficients.
JacobiBasis(ordinal_type p, value_type alphaIndex, value_type betaIndex, bool normalize=false, GrowthPolicy growth=SLOW_GROWTH)
Constructor.
value_type getA(int n) const
Teuchos::Array< value_type > gamma
Recurrence coefficients.
virtual void setSparseGridGrowthRule(LevelToOrderFnPtr ptr)
Set sparse grid rule.