Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_CompletePolynomialBasis.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_COMPLETEPOLYNOMIALBASIS_HPP
11 #define STOKHOS_COMPLETEPOLYNOMIALBASIS_HPP
12 
13 #include "Teuchos_RCP.hpp"
15 
16 #include "Stokhos_ProductBasis.hpp"
17 #include "Stokhos_DerivBasis.hpp"
20 
21 namespace Stokhos {
22 
39  template <typename ordinal_type, typename value_type>
41  public ProductBasis<ordinal_type,value_type>,
42  public DerivBasis<ordinal_type, value_type> {
43  public:
44 
46 
59  value_type> > >& bases,
60  const value_type& sparse_tol = 1.0e-12,
61  bool use_old_cijk_alg = false,
63 
65  virtual ~CompletePolynomialBasis();
66 
68 
69 
71  ordinal_type order() const;
72 
74  ordinal_type dimension() const;
75 
77  virtual ordinal_type size() const;
78 
80 
84  virtual const Teuchos::Array<value_type>& norm_squared() const;
85 
87  virtual const value_type& norm_squared(ordinal_type i) const;
88 
90 
96  virtual
99 
101  virtual
104 
106  virtual value_type evaluateZero(ordinal_type i) const;
107 
109 
113  virtual void evaluateBases(
115  Teuchos::Array<value_type>& basis_vals) const;
116 
118  virtual void print(std::ostream& os) const;
119 
121  virtual const std::string& getName() const;
122 
124 
126 
127 
129 
134  virtual const MultiIndex<ordinal_type>& term(ordinal_type i) const;
135 
137 
141  virtual ordinal_type index(const MultiIndex<ordinal_type>& term) const;
142 
144 
148  value_type> > >
149  getCoordinateBases() const;
150 
152  virtual MultiIndex<ordinal_type> getMaxOrders() const;
153 
155 
157 
158 
169  virtual
174  ) const;
175 
185  virtual
188 
190 
191  protected:
192 
194  virtual
197 
199  virtual
202 
203  private:
204 
205  // Prohibit copying
207 
208  // Prohibit Assignment
210 
211  protected:
212 
214 
216  std::string name;
217 
220 
223 
226 
229 
232 
235 
238 
241 
244 
247 
250 
253 
256 
257  }; // class CompletePolynomialBasis
258 
259 } // Namespace Stokhos
260 
261 // Include template definitions
263 
264 #endif
ordinal_type dimension() const
Return dimension of basis.
CompletePolynomialBasis & operator=(const CompletePolynomialBasis &b)
ordinal_type order() const
Return order of basis.
virtual Teuchos::RCP< Teuchos::SerialDenseMatrix< ordinal_type, value_type > > computeDerivDoubleProductTensor() const
Compute double product tensor where represents the derivative of in the direction ...
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
Abstract base class for multivariate orthogonal polynomials that support computing double and triple ...
CompletePolynomialBasis(const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &bases, const value_type &sparse_tol=1.0e-12, bool use_old_cijk_alg=false, const Teuchos::RCP< Teuchos::Array< value_type > > &deriv_coeffs=Teuchos::null)
Constructor.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
Utilities for indexing a multi-variate complete polynomial basis.
bool use_old_cijk_alg
Use old algorithm for computing Cijk.
Teuchos::Array< ordinal_type > basis_orders
Array storing order of each basis.
ordinal_type d
Total dimension of basis.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > getCoordinateBases() const
Return coordinate bases.
Stokhos::CompletePolynomialBasisUtils< ordinal_type, value_type > CPBUtils
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > bases
Array of bases.
Teuchos::Array< MultiIndex< ordinal_type > > terms
2-D array of basis terms
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensorNew(ordinal_type order) const
Compute triple product tensor using new algorithm.
Teuchos::Array< value_type > norms
Norms.
virtual Teuchos::RCP< Stokhos::Dense3Tensor< ordinal_type, value_type > > computeDerivTripleProductTensor(const Teuchos::RCP< const Teuchos::SerialDenseMatrix< ordinal_type, value_type > > &Bij, const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &Cijk) const
Compute triple product tensor where represents the derivative of in the direction ...
value_type sparse_tol
Tolerance for computing sparse Cijk.
virtual const std::string & getName() const
Return string name of basis.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensorOld(ordinal_type order) const
Compute triple product tensor using old algorithm.
virtual MultiIndex< ordinal_type > getMaxOrders() const
Return maximum order allowable for each coordinate basis.
Stokhos::Sparse3Tensor< ordinal_type, value_type > Cijk_type
Short-hand for Cijk.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
virtual void print(std::ostream &os) const
Print basis to stream os.
Abstract base class for multivariate orthogonal polynomials generated from tensor products of univari...
Multivariate orthogonal polynomial basis generated from a total-order complete-polynomial tensor prod...
virtual ordinal_type index(const MultiIndex< ordinal_type > &term) const
Get index of the multivariate polynomial given orders of each coordinate.
Abstract base class for 1-D orthogonal polynomials.
virtual ordinal_type size() const
Return total size of basis.
virtual const MultiIndex< ordinal_type > & term(ordinal_type i) const
Get orders of each coordinate polynomial given an index i.
Teuchos::RCP< Teuchos::Array< value_type > > deriv_coeffs
Coefficients for derivative.
Teuchos::Array< ordinal_type > num_terms
Number of terms up to each order.
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
Teuchos::Array< Teuchos::Array< value_type > > basis_eval_tmp
Temporary array used in basis evaluation.