Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_TensorProductBasis.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_TENSOR_PRODUCT_BASIS_HPP
11 #define STOKHOS_TENSOR_PRODUCT_BASIS_HPP
12 
13 #include "Teuchos_RCP.hpp"
14 
15 #include "Stokhos_ProductBasis.hpp"
18 
19 namespace Stokhos {
20 
34  template <typename ordinal_type, typename value_type,
35  typename coeff_compare_type =
36  TotalOrderLess<MultiIndex<ordinal_type> > >
38  public ProductBasis<ordinal_type,value_type> {
39  public:
40 
42 
49  value_type> > >& bases,
50  const value_type& sparse_tol = 1.0e-12,
52  const coeff_compare_type& coeff_compare = coeff_compare_type());
53 
55  virtual ~TensorProductBasis();
56 
58 
59 
61  ordinal_type order() const;
62 
64  ordinal_type dimension() const;
65 
67  virtual ordinal_type size() const;
68 
70 
74  virtual const Teuchos::Array<value_type>& norm_squared() const;
75 
77  virtual const value_type& norm_squared(ordinal_type i) const;
78 
80 
86  virtual
89 
91  virtual
94 
96  virtual value_type evaluateZero(ordinal_type i) const;
97 
99 
103  virtual void evaluateBases(
105  Teuchos::Array<value_type>& basis_vals) const;
106 
108  virtual void print(std::ostream& os) const;
109 
111  virtual const std::string& getName() const;
112 
114 
116 
117 
119 
124  virtual const MultiIndex<ordinal_type>& term(ordinal_type i) const;
125 
127 
131  virtual ordinal_type index(const MultiIndex<ordinal_type>& term) const;
132 
134 
138  value_type> > >
139  getCoordinateBases() const;
140 
142  virtual MultiIndex<ordinal_type> getMaxOrders() const;
143 
145 
146  private:
147 
148  // Prohibit copying
150 
151  // Prohibit Assignment
153 
154  protected:
155 
157  typedef std::map<coeff_type,ordinal_type,coeff_compare_type> coeff_set_type;
159 
161  std::string name;
162 
165 
168 
171 
174 
177 
180 
183 
186 
189 
192 
193  }; // class TensorProductBasis
194 
195 } // Namespace Stokhos
196 
197 // Include template definitions
199 
200 #endif
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const
Compute linear triple product tensor where k = 0,1,..,d.
ordinal_type order() const
Return order of basis.
coeff_type max_orders
Maximum orders for each dimension.
virtual value_type evaluateZero(ordinal_type i) const
Evaluate basis polynomial i at zero.
value_type sparse_tol
Tolerance for computing sparse Cijk.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > getCoordinateBases() const
Return coordinate bases.
Teuchos::Array< Teuchos::Array< value_type > > basis_eval_tmp
Temporary array used in basis evaluation.
virtual const MultiIndex< ordinal_type > & term(ordinal_type i) const
Get orders of each coordinate polynomial given an index i.
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const
Compute triple product tensor.
virtual const std::string & getName() const
Return string name of basis.
ordinal_type sz
Total size of basis.
TensorProductBasis & operator=(const TensorProductBasis &b)
Teuchos::Array< value_type > norms
Norms.
std::map< coeff_type, ordinal_type, coeff_compare_type > coeff_set_type
virtual const Teuchos::Array< value_type > & norm_squared() const
Return array storing norm-squared of each basis polynomial.
Abstract base class for multivariate orthogonal polynomials generated from tensor products of univari...
virtual void evaluateBases(const Teuchos::ArrayView< const value_type > &point, Teuchos::Array< value_type > &basis_vals) const
Evaluate basis polynomials at given point point.
Multivariate orthogonal polynomial basis generated from a tensor product of univariate polynomials...
ordinal_type dimension() const
Return dimension of basis.
Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > bases
Array of bases.
Abstract base class for 1-D orthogonal polynomials.
ordinal_type d
Total dimension of basis.
virtual ordinal_type size() const
Return total size of basis.
MultiIndex< ordinal_type > coeff_type
ordinal_type p
Total order of basis.
TensorProductBasis(const Teuchos::Array< Teuchos::RCP< const OneDOrthogPolyBasis< ordinal_type, value_type > > > &bases, const value_type &sparse_tol=1.0e-12, const MultiIndex< ordinal_type > &index=MultiIndex< ordinal_type >(), const coeff_compare_type &coeff_compare=coeff_compare_type())
Constructor.
virtual void print(std::ostream &os) const
Print basis to stream os.
virtual ordinal_type index(const MultiIndex< ordinal_type > &term) const
Get index of the multivariate polynomial given orders of each coordinate.
Teuchos::Array< coeff_type > coeff_map_type
virtual MultiIndex< ordinal_type > getMaxOrders() const
Return maximum order allowable for each coordinate basis.