Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_DiscretizedStieltjesBasis.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Stokhos Package
5// Copyright (2009) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38//
39// ***********************************************************************
40// @HEADER
41
42#ifndef STOKHOS_DISCRETIZEDSTIELTJESBASIS_HPP
43#define STOKHOS_DISCRETIZEDSTIELTJESBASIS_HPP
44
46
47namespace Stokhos {
48
50
62 template <typename ordinal_type, typename value_type>
64 public RecurrenceBasis<ordinal_type, value_type> {
65 public:
66
68
77 const std::string& name, const ordinal_type& p,
78 value_type (*weightFn)(const value_type&),
79 const value_type& leftEndPt,
80 const value_type& rightEndPt,
81 bool normalize,
83
86
88 value_type eval_inner_product(const ordinal_type& order1,
89 const ordinal_type& order2) const;
90
101 virtual Teuchos::RCP<OneDOrthogPolyBasis<ordinal_type,value_type> > cloneWithOrder(ordinal_type p) const;
102
103 protected:
104
106
107
109 virtual bool
110 computeRecurrenceCoefficients(ordinal_type n,
111 Teuchos::Array<value_type>& alpha,
112 Teuchos::Array<value_type>& beta,
113 Teuchos::Array<value_type>& delta,
114 Teuchos::Array<value_type>& gamma) const;
115
117
119 value_type evaluateRecurrence(const value_type& point,
120 ordinal_type order,
121 const Teuchos::Array<value_type>& alpha,
122 const Teuchos::Array<value_type>& beta) const;
123
125 value_type evaluateWeight(const value_type& x) const;
126
128 value_type
129 expectedValue_tJ_nsquared(const ordinal_type& order,
130 const Teuchos::Array<value_type>& alpha,
131 const Teuchos::Array<value_type>& beta) const;
132
134 value_type
135 expectedValue_J_nsquared(const ordinal_type& order,
136 const Teuchos::Array<value_type>& alpha,
137 const Teuchos::Array<value_type>& beta) const;
138
139 protected:
140
142 DiscretizedStieltjesBasis(const ordinal_type& p,
143 const DiscretizedStieltjesBasis& basis);
144
145 private:
146
147 // Prohibit copying
149
150 // Prohibit Assignment
152
153 protected:
154
156 mutable value_type scaleFactor;
157
159 const value_type leftEndPt_;
160
162 const value_type rightEndPt_;
163
165 value_type (*weightFn_)(const value_type&);
166
168 Teuchos::Array<value_type> quad_points;
169
171 Teuchos::Array<value_type> quad_weights;
172
174 Teuchos::Array<Teuchos::Array< value_type > > quad_values;
175
176 }; // class DiscretizedStieltjesBasis
177
178} // Namespace Stokhos
179
180// Include template definitions
181
183#endif
Generates three-term recurrence using the Discretized Stieltjes procedure.
value_type expectedValue_tJ_nsquared(const ordinal_type &order, const Teuchos::Array< value_type > &alpha, const Teuchos::Array< value_type > &beta) const
Approximates where = order.
const value_type leftEndPt_
Left end point of domain.
Teuchos::Array< value_type > quad_weights
Quadrature points for discretized stieltjes procedure.
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< Teuchos::Array< value_type > > quad_values
Quadrature values for discretized stieltjes procedure.
Teuchos::Array< value_type > quad_points
Quadrature points for discretized stieltjes procedure.
DiscretizedStieltjesBasis(const std::string &name, const ordinal_type &p, value_type(*weightFn)(const value_type &), const value_type &leftEndPt, const value_type &rightEndPt, bool normalize, GrowthPolicy growth=SLOW_GROWTH)
Constructor.
value_type eval_inner_product(const ordinal_type &order1, const ordinal_type &order2) const
Evaluate inner product of two basis functions to test orthogonality.
value_type evaluateWeight(const value_type &x) const
Evaluates the scaled weight function.
value_type evaluateRecurrence(const value_type &point, ordinal_type order, const Teuchos::Array< value_type > &alpha, const Teuchos::Array< value_type > &beta) const
Evaluate 3-term recurrence formula using supplied coefficients.
value_type(* weightFn_)(const value_type &)
Weight function.
DiscretizedStieltjesBasis(const DiscretizedStieltjesBasis &)
value_type expectedValue_J_nsquared(const ordinal_type &order, const Teuchos::Array< value_type > &alpha, const Teuchos::Array< value_type > &beta) const
Approximates where = order.
DiscretizedStieltjesBasis & operator=(const DiscretizedStieltjesBasis &b)
const value_type rightEndPt_
Right end point of domain.
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.
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship:
virtual ordinal_type order() const
Return order of basis (largest monomial degree ).
GrowthPolicy growth
Smolyak growth policy.
Teuchos::Array< value_type > alpha
Recurrence coefficients.
Teuchos::Array< value_type > beta
Recurrence coefficients.
ordinal_type p
Order of basis.
Teuchos::Array< value_type > gamma
Recurrence coefficients.
Teuchos::Array< value_type > delta
Recurrence coefficients.
std::string name
Name of basis.
Top-level namespace for Stokhos classes and functions.
GrowthPolicy
Enumerated type for determining Smolyak growth policies.