46 #define UQ_PREP_F77 F77_FUNC_(uq_prep,UQ_PREP)
47 #define UQ_PROD2_F77 F77_FUNC_(uq_prod2,UQ_PROD2)
48 #define UQ_DIV_F77 F77_FUNC_(uq_div,UQ_DIV)
49 #define UQ_EXP_F77 F77_FUNC_(uq_exp,UQ_EXP)
50 #define UQ_LOG_F77 F77_FUNC_(uq_log,UQ_LOG)
51 #define UQ_SQRT_F77 F77_FUNC_(uq_sqrt,UQ_SQRT)
52 #define UQ_EXP_INT_F77 F77_FUNC_(uq_exp_int,UQ_EXP)
53 #define UQ_LOG_INT_F77 F77_FUNC_(uq_log_int,UQ_LOG)
57 void UQ_PROD2_F77(
const double*,
const double*,
double*,
int*);
58 void UQ_DIV_F77(
const double*,
const double*,
double*,
int*);
59 void UQ_EXP_F77(
const double*,
double*,
int*,
int*,
double*,
int*);
60 void UQ_LOG_F77(
const double*,
double*,
int*,
int*,
double*,
int*);
61 void UQ_SQRT_F77(
const double*,
double*,
int*,
int*);
66 template <
typename ordinal_type,
typename value_type>
67 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
68 ForUQTKOrthogPolyExpansion(
71 EXPANSION_METHOD method_,
77 order = this->basis->order();
78 dim = this->basis->dimension();
84 template <
typename ordinal_type,
typename value_type>
86 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
90 OrthogPolyExpansionBase<ordinal_type, value_type, node_type>::timesEqual(c,val);
93 template <
typename ordinal_type,
typename value_type>
95 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
99 OrthogPolyExpansionBase<ordinal_type, value_type, node_type>::divideEqual(c,val);
102 template <
typename ordinal_type,
typename value_type>
104 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
117 "Stokhos::ForUQTKOrthogPolyExpansion::timesEqual()" <<
118 ": Expansion size (" << sz <<
119 ") is too small for computation.");
126 if (p > 1 && xp > 1) {
128 "Stokhos::ForUQTKOrthogPolyExpansion::timesEqual()"
129 <<
": Arguments have incompatible sizes: "
130 <<
"x.size() = " << xp <<
", c.size() = " << pc <<
".");
153 template <
typename ordinal_type,
typename value_type>
155 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
157 const OrthogPolyApprox<ordinal_type, value_type, node_type>& x)
167 "Stokhos::ForUQTKOrthogPolyExpansion::divideEqual()" <<
168 ": Expansion size (" << sz <<
169 ") is too small for computation.");
178 "Stokhos::ForUQTKOrthogPolyExpansion::divideEqual()"
179 <<
": Arguments have incompatible sizes: "
180 <<
"x.size() = " << xp <<
", c.size() = " << pc <<
".");
195 template <
typename ordinal_type,
typename value_type>
197 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
205 if (pa > 1 && pb > 1)
210 "Stokhos::ForUQTKOrthogPolyExpansion::times()" <<
211 ": Expansion size (" << sz <<
212 ") is too small for computation.");
220 if (pa > 1 && pb > 1) {
222 "Stokhos::ForUQTKOrthogPolyExpansion::times()"
223 <<
": Arguments have incompatible sizes: "
224 <<
"a.size() = " << pa <<
", b.size() = " << pb
225 <<
", required size = " << pc <<
".");
243 template <
typename ordinal_type,
typename value_type>
245 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
250 OrthogPolyExpansionBase<ordinal_type, value_type, node_type>::times(c,a,b);
253 template <
typename ordinal_type,
typename value_type>
255 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
260 OrthogPolyExpansionBase<ordinal_type, value_type, node_type>::times(c,a,b);
263 template <
typename ordinal_type,
typename value_type>
265 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
278 "Stokhos::ForUQTKOrthogPolyExpansion::divide()" <<
279 ": Expansion size (" << sz <<
280 ") is too small for computation.");
290 "Stokhos::ForUQTKOrthogPolyExpansion::divide()"
291 <<
": Arguments have incompatible sizes: "
292 <<
"a.size() = " << pa <<
", b.size() = " << pb
293 <<
", required size = " << pc <<
".");
304 template <
typename ordinal_type,
typename value_type>
306 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
325 "Stokhos::ForUQTKOrthogPolyExpansion::divide()"
326 <<
": Arguments have incompatible sizes: "
327 <<
"b.size() = " << pb
328 <<
", required size = " << pc <<
".");
339 template <
typename ordinal_type,
typename value_type>
341 Stokhos::ForUQTKOrthogPolyExpansion<ordinal_type, value_type>::
346 OrthogPolyExpansionBase<ordinal_type, value_type, node_type>::divide(c,a,b);
349 template <
typename ordinal_type,
typename value_type>
369 "Stokhos::ForUQTKOrthogPolyExpansion::exp()"
370 <<
": Arguments have incompatible sizes: "
371 <<
"a.size() = " << pa <<
", c.size() = " << pc
374 if (method == TAYLOR) {
385 template <
typename ordinal_type,
typename value_type>
405 "Stokhos::ForUQTKOrthogPolyExpansion::log()"
406 <<
": Arguments have incompatible sizes: "
407 <<
"a.size() = " << pa <<
", c.size() = " << pc
410 if (method == TAYLOR) {
421 template <
typename ordinal_type,
typename value_type>
438 template <
typename ordinal_type,
typename value_type>
458 "Stokhos::ForUQTKOrthogPolyExpansion::sqrt()"
459 <<
": Arguments have incompatible sizes: "
460 <<
"a.size() = " << pa <<
", c.size() = " << pc
470 template <
typename ordinal_type,
typename value_type>
488 template <
typename ordinal_type,
typename value_type>
507 template <
typename ordinal_type,
typename value_type>
525 template <
typename ordinal_type,
typename value_type>
544 template <
typename ordinal_type,
typename value_type>
557 "Stokhos::ForUQTKOrthogPolyExpansion::sin()"
558 <<
": Method not implemented!");
561 template <
typename ordinal_type,
typename value_type>
574 "Stokhos::ForUQTKOrthogPolyExpansion::cos()"
575 <<
": Method not implemented!");
578 template <
typename ordinal_type,
typename value_type>
591 "Stokhos::ForUQTKOrthogPolyExpansion::tan()"
592 <<
": Method not implemented!");
595 template <
typename ordinal_type,
typename value_type>
607 this->minusEqual(s, t);
617 template <
typename ordinal_type,
typename value_type>
629 this->plusEqual(c, t);
639 template <
typename ordinal_type,
typename value_type>
652 this->minus(t, c, s);
653 this->plusEqual(c, s);
663 template <
typename ordinal_type,
typename value_type>
676 "Stokhos::ForUQTKOrthogPolyExpansion::acos()"
677 <<
": Method not implemented!");
680 template <
typename ordinal_type,
typename value_type>
693 "Stokhos::ForUQTKOrthogPolyExpansion::asin()"
694 <<
": Method not implemented!");
697 template <
typename ordinal_type,
typename value_type>
710 "Stokhos::ForUQTKOrthogPolyExpansion::atan()"
711 <<
": Method not implemented!");
714 template <
typename ordinal_type,
typename value_type>
721 if (a.
size() == 1 && b.
size() == 1) {
728 "Stokhos::ForUQTKOrthogPolyExpansion::atan2()"
729 <<
": Method not implemented!");
732 template <
typename ordinal_type,
typename value_type>
746 "Stokhos::ForUQTKOrthogPolyExpansion::atan2()"
747 <<
": Method not implemented!");
750 template <
typename ordinal_type,
typename value_type>
764 "Stokhos::ForUQTKOrthogPolyExpansion::atan2()"
765 <<
": Method not implemented!");
768 template <
typename ordinal_type,
typename value_type>
781 "Stokhos::ForUQTKOrthogPolyExpansion::acosh()"
782 <<
": Method not implemented!");
785 template <
typename ordinal_type,
typename value_type>
798 "Stokhos::ForUQTKOrthogPolyExpansion::asinh()"
799 <<
": Method not implemented!");
802 template <
typename ordinal_type,
typename value_type>
815 "Stokhos::ForUQTKOrthogPolyExpansion::atanh()"
816 <<
": Method not implemented!");
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > tan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > sinh(const PCE< Storage > &a)
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
pointer coeff()
Return coefficient array.
KOKKOS_INLINE_FUNCTION PCE< Storage > tanh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
static T * get_and_fill(int sz)
Get memory for new array of length sz and fill with zeros.
KOKKOS_INLINE_FUNCTION PCE< Storage > acos(const PCE< Storage > &a)
atan2(expr1.val(), expr2.val())
Abstract base class for multivariate orthogonal polynomials.
KOKKOS_INLINE_FUNCTION PCE< Storage > cosh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > atan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
Class to store coefficients of a projection onto an orthogonal polynomial basis.
static void copy(const T *src, T *dest, int sz)
Copy array from src to dest of length sz.
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
ordinal_type size() const
Return size.
KOKKOS_INLINE_FUNCTION PCE< Storage > log(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log10(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > asin(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cos(const PCE< Storage > &a)