12 template <
typename ordinal_type,
typename value_type>
15 const Teuchos::RCP<
const OrthogPolyBasis<ordinal_type,value_type> >& basis_,
19 name(
"Gram Schmidt Basis"),
22 sparse_tol(sparse_tol_),
24 d(basis->dimension()),
35 basis->evaluateBases(points[k], values[k]);
40 inner_product.putScalar(0.0);
45 t += weights[k]*values[k][i]*values[k][
j];
46 inner_product(i,
j) = t;
64 t += gs_mat(
j,k)*inner_product(i,k);
69 gs_mat(i,k) -= t*gs_mat(
j,k);
76 nrm += gs_mat(i,
j)*gs_mat(i,k)*inner_product(
j,k);
78 nrm += gs_mat(i,
j)*gs_mat(i,k)*inner_product(k,
j);
84 basis_values.resize(nqp);
86 basis_values[k].resize(sz);
90 t += gs_mat(i,
j)*values[k][
j];
91 basis_values[k][i] = t;
96 template <
typename ordinal_type,
typename value_type>
102 template <
typename ordinal_type,
typename value_type>
110 template <
typename ordinal_type,
typename value_type>
118 template <
typename ordinal_type,
typename value_type>
126 template <
typename ordinal_type,
typename value_type>
134 template <
typename ordinal_type,
typename value_type>
142 template <
typename ordinal_type,
typename value_type>
148 Teuchos::rcp(
new Sparse3Tensor<ordinal_type, value_type>);
156 weights[l]*basis_values[l][i]*basis_values[l][
j]*basis_values[l][k];
158 Cijk->add_term(i,
j,k,t);
163 Cijk->fillComplete();
168 template <
typename ordinal_type,
typename value_type>
174 Teuchos::rcp(
new Sparse3Tensor<ordinal_type, value_type>);
182 weights[l]*basis_values[l][i]*basis_values[l][
j]*basis_values[l][k];
184 Cijk->add_term(i,
j,k,t);
189 Cijk->fillComplete();
194 template <
typename ordinal_type,
typename value_type>
201 z += gs_mat(i,
j)*basis->evaluateZero(
j);
206 template <
typename ordinal_type,
typename value_type>
212 basis->evaluateBases(point, basis_vals_tmp);
216 t += gs_mat(i,
j)*basis_vals_tmp[
j];
221 template <
typename ordinal_type,
typename value_type>
224 print(std::ostream& os)
const
226 os <<
"Gram-Schmidt basis of order " << p <<
", dimension " << d
227 <<
", and size " << sz <<
". Matrix coefficients:\n";
228 os <<
printMat(gs_mat) << std::endl;
229 os <<
"Basis vector norms (squared):\n\t";
231 os << norms[i] <<
" ";
233 os <<
"Underlying basis:\n";
237 template <
typename ordinal_type,
typename value_type>
245 template <
typename ordinal_type,
typename value_type>
void TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const OrdinalType &m, const OrdinalType &n, const alpha_type alpha, const A_type *A, const OrdinalType &lda, ScalarType *B, const OrdinalType &ldb) const
SerialBandDenseMatrixPrinter< OrdinalType, ScalarType > printMat(const SerialBandDenseMatrix< OrdinalType, ScalarType > &obj)
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const =0
Compute triple product tensor.
virtual ordinal_type order() const =0
Return order of basis.
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const =0
Evaluate basis polynomials at given point point.
virtual ordinal_type dimension() const =0
Return dimension of basis.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual value_type evaluateZero(ordinal_type i) const =0
Evaluate basis polynomial i at zero.
Transforms a non-orthogonal multivariate basis to an orthogonal one using the Gram-Schmit procedure...
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)
virtual const Teuchos::Array< value_type > & norm_squared() const =0
Return array storing norm-squared of each basis polynomial.
virtual void print(std::ostream &os) const =0
Print basis to stream os.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const =0
Compute linear triple product tensor where k = 0,1.
virtual ordinal_type size() const =0
Return total size of basis.
virtual const std::string & getName() const =0
Return string name of basis.