Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
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 
47 namespace 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 
89  const ordinal_type& order2) const;
90 
102 
103  protected:
104 
106 
107 
109  virtual bool
115 
117 
122  const Teuchos::Array<value_type>& beta) const;
123 
125  value_type evaluateWeight(const value_type& x) const;
126 
128  value_type
131  const Teuchos::Array<value_type>& beta) const;
132 
134  value_type
137  const Teuchos::Array<value_type>& beta) const;
138 
139  protected:
140 
143  const DiscretizedStieltjesBasis& basis);
144 
145  private:
146 
147  // Prohibit copying
149 
150  // Prohibit Assignment
152 
153  protected:
154 
157 
160 
163 
166 
169 
172 
175 
176  }; // class DiscretizedStieltjesBasis
177 
178 } // Namespace Stokhos
179 
180 // Include template definitions
181 
183 #endif
Stokhos::DiscretizedStieltjesBasis::cloneWithOrder
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.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:240
Stokhos::DiscretizedStieltjesBasis::evaluateRecurrence
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.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:215
Stokhos::DiscretizedStieltjesBasis::evaluateWeight
value_type evaluateWeight(const value_type &x) const
Evaluates the scaled weight function.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:146
Stokhos::DiscretizedStieltjesBasis::weightFn_
value_type(* weightFn_)(const value_type &)
Weight function.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:165
Stokhos::RecurrenceBasis::p
ordinal_type p
Order of basis.
Definition: Stokhos_RecurrenceBasis.hpp:307
Stokhos::DiscretizedStieltjesBasis::quad_points
Teuchos::Array< value_type > quad_points
Quadrature points for discretized stieltjes procedure.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:168
Stokhos::RecurrenceBasis::name
std::string name
Name of basis.
Definition: Stokhos_RecurrenceBasis.hpp:304
Stokhos::DiscretizedStieltjesBasis
Generates three-term recurrence using the Discretized Stieltjes procedure.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:63
Stokhos::DiscretizedStieltjesBasis::computeRecurrenceCoefficients
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.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:98
Stokhos::DiscretizedStieltjesBasis::eval_inner_product
value_type eval_inner_product(const ordinal_type &order1, const ordinal_type &order2) const
Evaluate inner product of two basis functions to test orthogonality.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:196
Stokhos_DiscretizedStieltjesBasisImp.hpp
Stokhos::DiscretizedStieltjesBasis::rightEndPt_
const value_type rightEndPt_
Right end point of domain.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:162
Stokhos::DiscretizedStieltjesBasis::~DiscretizedStieltjesBasis
~DiscretizedStieltjesBasis()
Destructor.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:91
TotalOrderBasisUnitTest::value_type
double value_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:70
Stokhos::GrowthPolicy
GrowthPolicy
Enumerated type for determining Smolyak growth policies.
Definition: Stokhos_RecurrenceBasis.hpp:50
Stokhos::RecurrenceBasis::normalize
bool normalize
Normalize basis.
Definition: Stokhos_RecurrenceBasis.hpp:310
Teuchos::RCP
Stokhos::RecurrenceBasis::growth
GrowthPolicy growth
Smolyak growth policy.
Definition: Stokhos_RecurrenceBasis.hpp:313
Stokhos::SLOW_GROWTH
Definition: Stokhos_RecurrenceBasis.hpp:51
Teuchos::Array< value_type >
TotalOrderBasisUnitTest::ordinal_type
int ordinal_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:69
Stokhos::DiscretizedStieltjesBasis::quad_weights
Teuchos::Array< value_type > quad_weights
Quadrature points for discretized stieltjes procedure.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:171
Stokhos::RecurrenceBasis
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship:
Definition: Stokhos_RecurrenceBasis.hpp:85
Stokhos
Top-level namespace for Stokhos classes and functions.
Definition: Stokhos_AbstractPreconditionerFactory.hpp:48
Stokhos::DiscretizedStieltjesBasis::scaleFactor
value_type scaleFactor
Scale for the weight.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:156
Stokhos::DiscretizedStieltjesBasis::expectedValue_tJ_nsquared
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.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:154
Stokhos::RecurrenceBasis::gamma
Teuchos::Array< value_type > gamma
Recurrence coefficients.
Definition: Stokhos_RecurrenceBasis.hpp:331
Stokhos::DiscretizedStieltjesBasis::leftEndPt_
const value_type leftEndPt_
Left end point of domain.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:159
Stokhos::RecurrenceBasis::alpha
Teuchos::Array< value_type > alpha
Recurrence coefficients.
Definition: Stokhos_RecurrenceBasis.hpp:322
Stokhos::RecurrenceBasis::order
virtual ordinal_type order() const
Return order of basis (largest monomial degree ).
Definition: Stokhos_RecurrenceBasisImp.hpp:115
Stokhos::RecurrenceBasis::delta
Teuchos::Array< value_type > delta
Recurrence coefficients.
Definition: Stokhos_RecurrenceBasis.hpp:328
Stokhos::DiscretizedStieltjesBasis::quad_values
Teuchos::Array< Teuchos::Array< value_type > > quad_values
Quadrature values for discretized stieltjes procedure.
Definition: Stokhos_DiscretizedStieltjesBasis.hpp:174
cusp::detail::device::x
const IndexType const IndexType const IndexType const IndexType const ValueType const ValueType * x
Definition: csr_vector.h:260
Stokhos_RecurrenceBasis.hpp
Stokhos::DiscretizedStieltjesBasis::expectedValue_J_nsquared
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.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:175
Stokhos::RecurrenceBasis::beta
Teuchos::Array< value_type > beta
Recurrence coefficients.
Definition: Stokhos_RecurrenceBasis.hpp:325
Stokhos::DiscretizedStieltjesBasis::operator=
DiscretizedStieltjesBasis & operator=(const DiscretizedStieltjesBasis &b)
n
int n
Stokhos::DiscretizedStieltjesBasis::DiscretizedStieltjesBasis
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.
Definition: Stokhos_DiscretizedStieltjesBasisImp.hpp:44