14 template <
typename ordinal_type,
typename value_type>
21 bool limit_integration_order_) :
24 limit_integration_order(limit_integration_order_),
25 pce_sz(pce->basis()->size()),
26 Cijk_matrix(pce_sz,pce_sz),
27 weights(Teuchos::
Copy,
31 lanczos_vecs(pce_sz, p+1),
46 for (
typename Cijk_type::k_iterator k_it = Cijk->k_begin();
47 k_it != Cijk->k_end(); ++k_it) {
49 for (
typename Cijk_type::kj_iterator j_it = Cijk->j_begin(k_it);
50 j_it != Cijk->j_end(k_it); ++j_it) {
53 for (
typename Cijk_type::kji_iterator i_it = Cijk->i_begin(j_it);
54 i_it != Cijk->i_end(j_it); ++i_it) {
69 template <
typename ordinal_type,
typename value_type>
75 template <
typename ordinal_type,
typename value_type>
83 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
93 if (limit_integration_order && quad_order > 2*this->p)
94 quad_order = 2*this->p;
101 if (quad_weights.
size() < num_points) {
103 quad_weights.
resize(num_points);
104 quad_points.
resize(num_points);
105 quad_values.resize(num_points);
108 quad_points[i] = quad_points[0];
109 quad_values[i].
resize(this->p+1);
110 this->evaluateBases(quad_points[i], quad_values[i]);
115 template <
typename ordinal_type,
typename value_type>
125 template <
typename ordinal_type,
typename value_type>
133 template <
typename ordinal_type,
typename value_type>
141 value_type(1.0), lanczos_vecs.values(), pce_sz,
146 out[i] /= pce_norms[i];
149 template <
typename ordinal_type,
typename value_type>
171 lanczos_type::computeNormalized(n, vs, A, u0, *lv, alpha, beta, nrm);
173 lanczos_type::compute(n, vs, A, u0, *lv, alpha, beta, nrm);
199 return this->normalize;
202 template <
typename ordinal_type,
typename value_type>
212 u[i] = (*pce)[i]*pce_norms[i];
216 new_pce[i] /= this->norms[i];
219 template <
typename ordinal_type,
typename value_type>
224 limit_integration_order(basis.limit_integration_order),
225 pce_sz(basis.pce_sz),
226 pce_norms(basis.pce_norms),
227 Cijk_matrix(basis.Cijk_matrix),
228 weights(basis.weights),
230 lanczos_vecs(pce_sz, p+1),
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
value_type getNewCoeffs(ordinal_type i) const
Get new coefficients in this new basis.
matrix_type Cijk_matrix
Triple-product matrix used in generating lanczos vectors.
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.
#define TEUCHOS_FUNC_TIME_MONITOR(FUNCNAME)
virtual void setup()
Setup basis after computing recurrence coefficients.
Implementation of OneDOrthogPolyBasis based on the general three-term recurrence relationship: for ...
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
~LanczosProjPCEBasis()
Destructor.
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)
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.
Teuchos::Array< value_type > pce_norms
Basis norms.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void transformCoeffsFromLanczos(const value_type *in, value_type *out) const
Map expansion coefficients from this basis to original.
vector_type u0
Initial Lanczos vector.
KOKKOS_INLINE_FUNCTION PCE< Storage > ceil(const PCE< Storage > &a)
vector_type weights
Weighting vector used in inner-products.
LanczosProjPCEBasis(ordinal_type p, const Teuchos::RCP< const Stokhos::OrthogPolyApprox< ordinal_type, value_type > > &pce, const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &Cijk, bool normalize, bool limit_integration_order=false)
Constructor.
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.
void resize(size_type new_size, const value_type &x=value_type())
Stokhos::Sparse3Tensor< int, double > Cijk_type
virtual void setup()
Setup basis after computing recurrence coefficients.
ordinal_type pce_sz
Size of PC expansion.
Generates three-term recurrence using the Lanczos procedure applied to a polynomial chaos expansion i...