Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
Stokhos_OrthogPolyExpansion.hpp
Go to the documentation of this file.
1 // $Id$
2 // $Source$
3 // @HEADER
4 // ***********************************************************************
5 //
6 // Stokhos Package
7 // Copyright (2009) Sandia Corporation
8 //
9 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
10 // license for use of this work by or on behalf of the U.S. Government.
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are
14 // met:
15 //
16 // 1. Redistributions of source code must retain the above copyright
17 // notice, this list of conditions and the following disclaimer.
18 //
19 // 2. Redistributions in binary form must reproduce the above copyright
20 // notice, this list of conditions and the following disclaimer in the
21 // documentation and/or other materials provided with the distribution.
22 //
23 // 3. Neither the name of the Corporation nor the names of the
24 // contributors may be used to endorse or promote products derived from
25 // this software without specific prior written permission.
26 //
27 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
28 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
31 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 //
39 // Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
40 //
41 // ***********************************************************************
42 // @HEADER
43 
44 #ifndef STOKHOS_ORTHOGPOLYEXPANSION_HPP
45 #define STOKHOS_ORTHOGPOLYEXPANSION_HPP
46 
47 #include <cmath>
48 #include <algorithm> // for std::min and std::max
49 
52 
53 namespace Stokhos {
54 
56  template <typename ordinal_type, typename value_type,
58  value_type> >
60  public:
61 
64 
67 
69  virtual ~OrthogPolyExpansion() {}
70 
72  virtual ordinal_type size() const = 0;
73 
76  getBasis() const = 0;
77 
80  getTripleProduct() const = 0;
81 
82  // Operations
83  virtual void unaryMinus(
86 
87  virtual void plusEqual(
89  const value_type& x) = 0;
90  virtual void minusEqual(
92  const value_type& x) = 0;
93  virtual void timesEqual(
95  const value_type& x) = 0;
96  virtual void divideEqual(
98  const value_type& x) = 0;
99 
100  virtual void plusEqual(
103  virtual void minusEqual(
106  virtual void timesEqual(
109  virtual void divideEqual(
112 
113  virtual void plus(
117  virtual void plus(
119  const value_type& a,
121  virtual void plus(
124  const value_type& b) = 0;
125  virtual void minus(
129  virtual void minus(
131  const value_type& a,
133  virtual void minus(
136  const value_type& b) = 0;
137  virtual void times(
141  virtual void times(
143  const value_type& a,
145  virtual void times(
148  const value_type& b) = 0;
149  virtual void divide(
153  virtual void divide(
155  const value_type& a,
157  virtual void divide(
160  const value_type& b) = 0;
161 
162  virtual void exp(
165  virtual void log(
168  virtual void log10(
171  virtual void sqrt(
174  virtual void cbrt(
177  virtual void pow(
181  virtual void pow(
183  const value_type& a,
185  virtual void pow(
188  const value_type& b) = 0;
189  virtual void cos(
192  virtual void sin(
195  virtual void tan(
198  virtual void cosh(
201  virtual void sinh(
204  virtual void tanh(
207  virtual void acos(
210  virtual void asin(
213  virtual void atan(
216 // virtual void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
217 // const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
218 // const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
219 // virtual void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
220 // const T& a,
221 // const OrthogPolyApprox<ordinal_type, value_type, node_type>& b) = 0;
222 // virtual void atan2(OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
223 // const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
224 // const T& b) = 0;
225  virtual void acosh(
228  virtual void asinh(
231  virtual void atanh(
234  virtual void abs(
237  virtual void fabs(
240  virtual void max(
244  virtual void max(
246  const value_type& a,
248  virtual void max(
251  const value_type& b) = 0;
252  virtual void min(
256  virtual void min(
258  const value_type& a,
260  virtual void min(
263  const value_type& b) = 0;
264 
265  private:
266 
267  // Prohibit copying
269 
270  // Prohibit Assignment
272 
273  }; // class OrthogPolyExpansion
274 
275 } // namespace Stokhos
276 
277 #endif // STOKHOS_ORTHOGPOLYEXPANSION_HPP
Stokhos::OrthogPolyExpansion::asinh
virtual void asinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::divideEqual
virtual void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
Stokhos::OrthogPolyExpansion::max
virtual void max(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Stokhos::OrthogPolyExpansion::atanh
virtual void atanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::asin
virtual void asin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::sin
virtual void sin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos_OrthogPolyApprox.hpp
Stokhos::OrthogPolyExpansion::~OrthogPolyExpansion
virtual ~OrthogPolyExpansion()
Destructor.
Definition: Stokhos_OrthogPolyExpansion.hpp:69
Stokhos::OrthogPolyExpansion::tanh
virtual void tanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
TotalOrderBasisUnitTest::value_type
double value_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:70
Stokhos::OrthogPolyExpansion::sqrt
virtual void sqrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::log
virtual void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion
Abstract base class for orthogonal polynomial-based expansions.
Definition: Stokhos_OrthogPolyExpansion.hpp:59
node_type
Kokkos::Serial node_type
Definition: Stokhos_SacadoTraitsUnitTest.cpp:59
Stokhos::Sparse3Tensor
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
Definition: Stokhos_Sparse3Tensor.hpp:56
Stokhos::OrthogPolyExpansion::size
virtual ordinal_type size() const =0
Get expansion size.
Teuchos::RCP
Stokhos::OrthogPolyExpansion::abs
virtual void abs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::log10
virtual void log10(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::exp
virtual void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
TotalOrderBasisUnitTest::ordinal_type
int ordinal_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:69
Stokhos::StandardStorage
Definition: Stokhos_StandardStorage.hpp:53
Stokhos::OrthogPolyExpansion::divide
virtual void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Stokhos::OrthogPolyExpansion::unaryMinus
virtual void unaryMinus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::getTripleProduct
virtual Teuchos::RCP< const Sparse3Tensor< ordinal_type, value_type > > getTripleProduct() const =0
Get triple product.
Stokhos::OrthogPolyExpansion::pow
virtual void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Stokhos
Top-level namespace for Stokhos classes and functions.
Definition: Stokhos_AbstractPreconditionerFactory.hpp:48
Stokhos::OrthogPolyExpansion::acos
virtual void acos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::times
virtual void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Stokhos::OrthogPolyExpansion::getBasis
virtual Teuchos::RCP< const OrthogPolyBasis< ordinal_type, value_type > > getBasis() const =0
Get basis.
Stokhos::OrthogPolyExpansion::minus
virtual void minus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Stokhos::OrthogPolyExpansion::acosh
virtual void acosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::sinh
virtual void sinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::cbrt
virtual void cbrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::cosh
virtual void cosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::min
virtual void min(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
cusp::detail::device::x
const IndexType const IndexType const IndexType const IndexType const ValueType const ValueType * x
Definition: csr_vector.h:260
Stokhos::OrthogPolyExpansion::plus
virtual void plus(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)=0
Stokhos::OrthogPolyExpansion::tan
virtual void tan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::timesEqual
virtual void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
Stokhos::OrthogPolyApprox
Class to store coefficients of a projection onto an orthogonal polynomial basis.
Definition: Stokhos_OrthogPolyApprox.hpp:63
Stokhos_OrthogPolyBasis.hpp
Stokhos::OrthogPolyExpansion::atan
virtual void atan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::fabs
virtual void fabs(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::plusEqual
virtual void plusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
Stokhos::OrthogPolyExpansion::cos
virtual void cos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)=0
Stokhos::OrthogPolyExpansion::minusEqual
virtual void minusEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)=0
Stokhos::OrthogPolyExpansion::operator=
OrthogPolyExpansion & operator=(const OrthogPolyExpansion &b)
Stokhos::OrthogPolyExpansion::OrthogPolyExpansion
OrthogPolyExpansion()
Constructor.
Definition: Stokhos_OrthogPolyExpansion.hpp:66
Stokhos::OrthogPolyExpansion::tp_type
Sparse3Tensor< ordinal_type, value_type > tp_type
Typename of TripleProduct tensor.
Definition: Stokhos_OrthogPolyExpansion.hpp:63