44#ifndef STOKHOS_MEAN_BASED_DIVISION_EXPANSION_STRATEGY_HPP
45#define STOKHOS_MEAN_BASED_DIVISION_EXPANSION_STRATEGY_HPP
48#include "Teuchos_TimeMonitor.hpp"
56 template <
typename ordinal_type,
typename value_type,
typename node_type>
70 const value_type& alpha,
73 const value_type& beta);
89template <
typename ordinal_type,
typename value_type,
typename node_type>
93 const value_type& alpha,
96 const value_type& beta)
98#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
99 TEUCHOS_FUNC_TIME_MONITOR(
"Stokhos::MeanBasedDivisionStrategy::divide()");
101 ordinal_type pc = a.
size();
105 const value_type* ca = a.
coeff();
106 const value_type* cb = b.
coeff();
107 value_type* cc = c.
coeff();
109 for (ordinal_type i=0; i<pc; i++)
110 cc[i] = alpha*ca[i]/cb[0] + beta*cc[i];
Strategy interface for computing PCE of a/b.
Strategy interface for computing PCE of a/b using only b[0].
virtual ~MeanBasedDivisionExpansionStrategy()
Destructor.
MeanBasedDivisionExpansionStrategy()
Constructor.
virtual void divide(Stokhos::OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &alpha, const Stokhos::OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const Stokhos::OrthogPolyApprox< ordinal_type, value_type, node_type > &b, const value_type &beta)
MeanBasedDivisionExpansionStrategy & operator=(const MeanBasedDivisionExpansionStrategy &b)
MeanBasedDivisionExpansionStrategy(const MeanBasedDivisionExpansionStrategy &)
Class to store coefficients of a projection onto an orthogonal polynomial basis.
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
pointer coeff()
Return coefficient array.
ordinal_type size() const
Return size.
Top-level namespace for Stokhos classes and functions.