14 template <
typename ordinal_type,
typename value_type>
21 bool limit_integration_order_) :
25 limit_integration_order(limit_integration_order_),
27 pce_weights(Teuchos::
Copy,
32 lanczos_vecs(nqp, p+1),
38 quad->getQuadPoints();
40 quad->getBasisAtQuadPoints();
42 pce_vals[i] =
pce->evaluate(quad_points[i], basis_values[i]);
50 template <
typename ordinal_type,
typename value_type>
56 template <
typename ordinal_type,
typename value_type>
64 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
74 if (limit_integration_order && quad_order > 2*this->p)
75 quad_order = 2*this->p;
82 if (quad_weights.
size() < num_points) {
84 quad_weights.
resize(num_points);
85 quad_points.
resize(num_points);
86 quad_values.resize(num_points);
89 quad_points[i] = quad_points[0];
90 quad_values[i].
resize(this->p+1);
91 this->evaluateBases(quad_points[i], quad_values[i]);
96 template <
typename ordinal_type,
typename value_type>
105 template <
typename ordinal_type,
typename value_type>
113 template <
typename ordinal_type,
typename value_type>
121 value_type(1.0), fromStieltjesMat.values(), sz,
125 template <
typename ordinal_type,
typename value_type>
147 lanczos_type::computeNormalized(n, vs, A, u0, *lv, alpha, beta, nrm);
149 lanczos_type::compute(n, vs, A, u0, *lv, alpha, beta, nrm);
160 return this->normalize;
163 template <
typename ordinal_type,
typename value_type>
172 fromStieltjesMat.shape(sz, this->p+1);
173 fromStieltjesMat.putScalar(0.0);
175 quad->getBasisAtQuadPoints();
179 fromStieltjesMat(i,
j) +=
180 pce_weights[k]*lanczos_vecs(k,
j)*basis_values[k][i];
181 fromStieltjesMat(i,
j) /= pce->basis()->norm_squared(i);
186 new_pce.
resize(this->p+1);
189 u[i] = (*pce)[i]*pce->basis()->norm_squared(i);
193 new_pce[i] /= this->norms[i];
196 template <
typename ordinal_type,
typename value_type>
202 limit_integration_order(basis.limit_integration_order),
204 pce_weights(basis.pce_weights),
205 pce_vals(basis.pce_vals),
207 lanczos_vecs(nqp, p+1),
vector_type pce_vals
Values of PCE at quadrature points.
#define TEUCHOS_FUNC_TIME_MONITOR(FUNCNAME)
Generates three-term recurrence using the Lanczos procedure applied to a polynomial chaos expansion i...
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship: for ...
void GEMV(ETransp trans, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, const x_type *x, const OrdinalType &incx, const beta_type beta, ScalarType *y, const OrdinalType &incy) const
int multiply(ETransp transa, ETransp transb, ScalarType alpha, const SerialDenseMatrix< OrdinalType, ScalarType > &A, const SerialDenseMatrix< OrdinalType, ScalarType > &B, ScalarType beta)
virtual void getQuadPoints(ordinal_type quad_order, Teuchos::Array< value_type > &points, Teuchos::Array< value_type > &weights, Teuchos::Array< Teuchos::Array< value_type > > &values) const
Compute quadrature points, weights, and values of basis polynomials at given set of points points...
RawPointerConversionTraits< Container >::Ptr_t getRawPtr(const Container &c)
value_type getNewCoeffs(ordinal_type i) const
Get new coefficients in this new basis.
virtual void getQuadPoints(ordinal_type quad_order, Teuchos::Array< value_type > &points, Teuchos::Array< value_type > &weights, Teuchos::Array< Teuchos::Array< value_type > > &values) const
Get Gauss quadrature points, weights, and values of basis at points.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Abstract base class for quadrature methods.
KOKKOS_INLINE_FUNCTION PCE< Storage > ceil(const PCE< Storage > &a)
LanczosPCEBasis(ordinal_type p, const Teuchos::RCP< const Stokhos::OrthogPolyApprox< ordinal_type, value_type > > &pce, const Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > &quad, bool normalize, bool limit_integration_order)
Constructor.
ordinal_type nqp
Number of quadrature points.
void resize(size_type new_size, const value_type &x=value_type())
virtual void setup()
Setup basis after computing recurrence coefficients.
Teuchos::RCP< const Stokhos::OrthogPolyApprox< ordinal_type, value_type > > pce
PCE Lanczos procedure is based on.
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.
vector_type u0
Initial Lanczos vector.
void transformCoeffsFromLanczos(const value_type *in, value_type *out) const
Map expansion coefficients from this basis to original.
~LanczosPCEBasis()
Destructor.
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.
virtual void setup()
Setup basis after computing recurrence coefficients.
Teuchos::RCP< const Stokhos::Quadrature< ordinal_type, value_type > > quad
Quadrature object.