42 template <
typename ordinal_type,
typename value_type>
53 leftEndPt_(leftEndPt),
54 rightEndPt_(rightEndPt),
66 template <
typename ordinal_type,
typename value_type>
71 scaleFactor(basis.scaleFactor),
72 leftEndPt_(basis.leftEndPt_),
73 rightEndPt_(basis.rightEndPt_),
74 weightFn_(basis.weightFn_)
89 template <
typename ordinal_type,
typename value_type>
95 template <
typename ordinal_type,
typename value_type>
114 value_type oneNorm = expectedValue_J_nsquared(0, alpha, beta);
116 scaleFactor = 1/oneNorm;
124 value_type past_integral = expectedValue_J_nsquared(0, alpha, beta);
125 alpha[0] = expectedValue_tJ_nsquared(0, alpha, beta)/past_integral;
132 integral2 = expectedValue_J_nsquared(
n, alpha, beta);
133 alpha[
n] = expectedValue_tJ_nsquared(
n, alpha, beta)/integral2;
134 beta[
n] = integral2/past_integral;
135 past_integral = integral2;
143 template <
typename ordinal_type,
typename value_type>
148 return (x < leftEndPt_ || x > rightEndPt_) ? 0: scaleFactor*weightFn_(x);
151 template <
typename ordinal_type,
typename value_type>
162 quadIdx < static_cast<ordinal_type>(quad_points.size()); quadIdx++) {
163 value_type x = (rightEndPt_ - leftEndPt_)*.5*quad_points[quadIdx] +
164 (rightEndPt_ + leftEndPt_)*.5;
166 integral += x*val*val*evaluateWeight(x)*quad_weights[quadIdx];
169 return integral*(rightEndPt_ - leftEndPt_);
172 template <
typename ordinal_type,
typename value_type>
183 quadIdx < static_cast<ordinal_type>(quad_points.size()); quadIdx++){
184 value_type x = (rightEndPt_ - leftEndPt_)*.5*quad_points[quadIdx] +
185 (rightEndPt_ + leftEndPt_)*.5;
187 integral += val*val*evaluateWeight(x)*quad_weights[quadIdx];
190 return integral*(rightEndPt_ - leftEndPt_);
193 template <
typename ordinal_type,
typename value_type>
203 quadIdx < static_cast<ordinal_type>(quad_points.size()); quadIdx++){
204 value_type x = (rightEndPt_ - leftEndPt_)*.5*quad_points[quadIdx] +
205 (rightEndPt_ + leftEndPt_)*.5;
206 integral += this->evaluate(x,order1)*this->evaluate(x,order2)*evaluateWeight(x)*quad_weights[quadIdx];
209 return integral*(rightEndPt_ - leftEndPt_);
212 template <
typename ordinal_type,
typename value_type>
229 v2 = (x-alpha[i-1])*v1 - beta[i-1]*v0;
237 template <
typename ordinal_type,
typename value_type>
Teuchos::Array< value_type > delta
Recurrence coefficients.
value_type evaluateWeight(const value_type &x) const
Evaluates the scaled weight function.
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.
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship: for ...
Generates three-term recurrence using the Discretized Stieltjes procedure.
value_type eval_inner_product(const ordinal_type &order1, const ordinal_type &order2) const
Evaluate inner product of two basis functions to test orthogonality.
Teuchos::Array< value_type > beta
Recurrence coefficients.
GrowthPolicy
Enumerated type for determining Smolyak growth policies.
Teuchos::Array< value_type > quad_weights
Quadrature points for discretized stieltjes procedure.
Teuchos::Array< value_type > alpha
Recurrence coefficients.
Teuchos::Array< Teuchos::Array< value_type > > quad_values
Quadrature values for 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.
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.
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.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::Array< value_type > quad_points
Quadrature points for discretized stieltjes procedure.
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.
Legendre polynomial basis.
virtual void setup()
Setup basis after computing recurrence coefficients.
Teuchos::Array< value_type > gamma
Recurrence coefficients.
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.
~DiscretizedStieltjesBasis()
Destructor.