70 template <
typename Storage>
 
   71 KOKKOS_INLINE_FUNCTION
 
   74 standard_deviation()
 const {
 
   77   const_pointer c = this->coeff();
 
   83 template <
typename Storage>
 
   84 KOKKOS_INLINE_FUNCTION
 
   87 two_norm_squared()
 const {
 
   90   const_pointer c = this->coeff();
 
   96 template <
typename Storage>
 
   97 KOKKOS_INLINE_FUNCTION
 
  100 inner_product(
const PCE& x)
 const {
 
  105   const_pointer c = this->coeff();
 
  106   const_pointer xc = x.coeff();
 
  112 template <
typename Storage>
 
  113 KOKKOS_INLINE_FUNCTION
 
  116 isEqualTo(
const PCE& x)
 const {
 
  117   typedef IsEqual<value_type> IE;
 
  119   if (x.size() != sz) 
return false;
 
  122     eq = eq && IE::eval(x.coeff(i), this->coeff(i));
 
  126 template <
typename Storage>
 
  127 KOKKOS_INLINE_FUNCTION
 
  130 isEqualTo(
const PCE& x)
 const volatile {
 
  131   typedef IsEqual<value_type> IE;
 
  133   if (x.size() != sz) 
return false;
 
  136     eq = eq && IE::eval(x.coeff(i), this->coeff(i));
 
  140 template <
typename Storage>
 
  141 KOKKOS_INLINE_FUNCTION
 
  151 template <
typename Storage>
 
  152 KOKKOS_INLINE_FUNCTION
 
  159   return const_cast<PCE&
>(*this);
 
  162 template <
typename Storage>
 
  163 KOKKOS_INLINE_FUNCTION
 
  166 operator=(
const PCE<Storage>& x)
 
  181     if (s_.size() > x.s_.size())
 
  188 template <
typename Storage>
 
  189 KOKKOS_INLINE_FUNCTION
 
  192 operator=(
const volatile PCE<Storage>& x)
 
  196       cijk_ = const_cast<const my_cijk_type&>(x.cijk_);
 
  207     if (s_.size() > x.s_.size())
 
  214 template <
typename Storage>
 
  215 KOKKOS_INLINE_FUNCTION
 
  218 operator=(
const PCE<Storage>& x)
 volatile 
  222       const_cast<my_cijk_type&>(cijk_) = x.cijk_;
 
  233     if (s_.size() > x.s_.size())
 
  237   return const_cast<PCE&
>(*this);
 
  240 template <
typename Storage>
 
  241 KOKKOS_INLINE_FUNCTION
 
  244 operator=(
const volatile PCE<Storage>& x)
 volatile 
  248       const_cast<my_cijk_type&>(cijk_) =
 
  249         const_cast<const my_cijk_type&
>(x.cijk_);
 
  260     if (s_.size() > x.s_.size())
 
  264   return const_cast<PCE&
>(*this);
 
  267 template <
typename Storage>
 
  268 KOKKOS_INLINE_FUNCTION
 
  274   PCE<Storage> x(cijk_, sz);
 
  275   pointer xc = x.coeff();
 
  276   const_pointer cc = this->coeff();
 
  282 template <
typename Storage>
 
  283 KOKKOS_INLINE_FUNCTION
 
  289   PCE<Storage> x(const_cast<const my_cijk_type&>(cijk_), sz);
 
  290   pointer xc = x.coeff();
 
  291   const_volatile_pointer cc = this->coeff();
 
  297 template <
typename Storage>
 
  298 KOKKOS_INLINE_FUNCTION
 
  303   pointer cc = this->coeff();
 
  310 template <
typename Storage>
 
  311 KOKKOS_INLINE_FUNCTION
 
  316   volatile_pointer cc = this->coeff();
 
  320   return const_cast<PCE&
>(*this);
 
  323 template <
typename Storage>
 
  324 KOKKOS_INLINE_FUNCTION
 
  329   pointer cc = this->coeff();
 
  336 template <
typename Storage>
 
  337 KOKKOS_INLINE_FUNCTION
 
  342   volatile pointer cc = this->coeff();
 
  346   return const_cast<PCE&
>(*this);
 
  349 template <
typename Storage>
 
  350 KOKKOS_INLINE_FUNCTION
 
  353 operator+=(
const PCE<Storage>& x)
 
  358     this->reset(x.cijk_, xsz);
 
  360   const_pointer xc = x.coeff();
 
  361   pointer cc = this->coeff();
 
  367 template <
typename Storage>
 
  368 KOKKOS_INLINE_FUNCTION
 
  371 operator-=(
const PCE<Storage>& x)
 
  376     this->reset(x.cijk_, xsz);
 
  378   const_pointer xc = x.coeff();
 
  379   pointer cc = this->coeff();
 
  385 template <
typename Storage>
 
  386 KOKKOS_INLINE_FUNCTION
 
  389 operator*=(
const PCE<Storage>& x)
 
  395 #if !defined(__CUDA_ARCH__) 
  397     sz != xsz && sz != 1 && xsz != 1, std::logic_error,
 
  398     "Sacado::UQ::PCE::operator*=(): input sizes do not match");
 
  401   if (cijk_.is_empty() && !x.cijk_.is_empty())
 
  404 #
if !defined(__CUDA_ARCH__)
 
  406     cijk_.is_empty() && csz != 1, std::logic_error,
 
  407     "Sacado::UQ::PCE::operator*(): empty cijk but expansion size > 1");
 
  413   const_pointer xc = x.coeff();
 
  414   pointer cc = this->coeff();
 
  426     PCE<Storage> y(cijk_, csz);
 
  427     pointer yc = y.coeff();
 
  429       const cijk_size_type num_entry = cijk_.num_entry(i);
 
  430       const cijk_size_type entry_beg = cijk_.entry_begin(i);
 
  431       const cijk_size_type entry_end = entry_beg + num_entry;
 
  433       for (cijk_size_type entry = entry_beg; entry < entry_end; ++entry) {
 
  434         const cijk_size_type 
j = cijk_.coord(entry,0);
 
  435         const cijk_size_type k = cijk_.coord(entry,1);
 
  436         ytmp += cijk_.value(entry) * ( cc[
j] * xc[k] + cc[k] * xc[
j] );
 
  445 template <
typename Storage>
 
  446 KOKKOS_INLINE_FUNCTION
 
  449 operator/=(
const PCE<Storage>& x)
 
  455 #if !defined(__CUDA_ARCH__) 
  457     sz != xsz && sz != 1 && xsz != 1, std::logic_error,
 
  458     "Sacado::UQ::PCE::operator/=(): input sizes do not match");
 
  461   if (cijk_.is_empty() && !x.cijk_.is_empty())
 
  467   const_pointer xc = x.coeff();
 
  468   pointer cc = this->coeff();
 
  470 #if defined(__CUDA_ARCH__) 
  476 #if !defined(__CUDA_ARCH__) 
  484     PCE<Storage> y(cijk_, csz);
 
  494 template <
typename Storage>
 
  495 KOKKOS_INLINE_FUNCTION
 
  504   const ordinal_type asz = a.size();
 
  505   const ordinal_type bsz = b.size();
 
  506   const ordinal_type csz = asz > bsz ? asz : bsz;
 
  507   my_cijk_type c_cijk = asz > bsz ? a.cijk() : b.cijk();
 
  510   const_pointer ac = a.coeff();
 
  511   const_pointer bc = b.coeff();
 
  512   pointer cc = c.coeff();
 
  514     for (ordinal_type i=0; i<bsz; ++i)
 
  515       cc[i] = ac[i] + bc[i];
 
  516     for (ordinal_type i=bsz; i<asz; ++i)
 
  520     for (ordinal_type i=0; i<asz; ++i)
 
  521       cc[i] = ac[i] + bc[i];
 
  522     for (ordinal_type i=asz; i<bsz; ++i)
 
  529 template <
typename Storage>
 
  530 KOKKOS_INLINE_FUNCTION
 
  539   const ordinal_type bsz = b.size();
 
  541   const_pointer bc = b.coeff();
 
  542   pointer cc = c.coeff();
 
  544   for (ordinal_type i=1; i<bsz; ++i)
 
  549 template <
typename Storage>
 
  550 KOKKOS_INLINE_FUNCTION
 
  559   const ordinal_type asz = a.size();
 
  561   const_pointer ac = a.coeff();
 
  562   pointer cc = c.coeff();
 
  564   for (ordinal_type i=1; i<asz; ++i)
 
  569 template <
typename Storage>
 
  570 KOKKOS_INLINE_FUNCTION
 
  579   const ordinal_type asz = a.size();
 
  580   const ordinal_type bsz = b.size();
 
  581   const ordinal_type csz = asz > bsz ? asz : bsz;
 
  582   my_cijk_type c_cijk = asz > bsz ? a.cijk() : b.cijk();
 
  585   const_pointer ac = a.coeff();
 
  586   const_pointer bc = b.coeff();
 
  587   pointer cc = c.coeff();
 
  589     for (ordinal_type i=0; i<bsz; ++i)
 
  590       cc[i] = ac[i] - bc[i];
 
  591     for (ordinal_type i=bsz; i<asz; ++i)
 
  595     for (ordinal_type i=0; i<asz; ++i)
 
  596       cc[i] = ac[i] - bc[i];
 
  597     for (ordinal_type i=asz; i<bsz; ++i)
 
  604 template <
typename Storage>
 
  605 KOKKOS_INLINE_FUNCTION
 
  614   const ordinal_type bsz = b.size();
 
  616   const_pointer bc = b.coeff();
 
  617   pointer cc = c.coeff();
 
  619   for (ordinal_type i=1; i<bsz; ++i)
 
  624 template <
typename Storage>
 
  625 KOKKOS_INLINE_FUNCTION
 
  634   const ordinal_type asz = a.size();
 
  636   const_pointer ac = a.coeff();
 
  637   pointer cc = c.coeff();
 
  639   for (ordinal_type i=1; i<asz; ++i)
 
  644 template <
typename Storage>
 
  645 KOKKOS_INLINE_FUNCTION
 
  654   typedef typename my_cijk_type::size_type cijk_size_type;
 
  656   const ordinal_type asz = a.size();
 
  657   const ordinal_type bsz = b.size();
 
  658   const ordinal_type csz = asz > bsz ? asz : bsz;
 
  660 #if !defined(__CUDA_ARCH__) 
  662     asz != bsz && asz != 1 && bsz != 1, std::logic_error,
 
  663     "Sacado::UQ::PCE::operator*(): input sizes do not match");
 
  666   my_cijk_type c_cijk = a.cijk().is_empty() ? b.cijk() : a.cijk();
 
  668 #if !defined(__CUDA_ARCH__) 
  670     c_cijk.is_empty() && csz != 1, std::logic_error,
 
  671     "Sacado::UQ::PCE::operator*(): empty cijk but expansion size > 1");
 
  675   const_pointer ac = a.coeff();
 
  676   const_pointer bc = b.coeff();
 
  677   pointer cc = c.coeff();
 
  680     const value_type acz = ac[0];
 
  681     for (ordinal_type i=0; i<csz; ++i)
 
  685     const value_type bcz = bc[0];
 
  686     for (ordinal_type i=0; i<csz; ++i)
 
  690     for (ordinal_type i=0; i<csz; ++i) {
 
  691       const cijk_size_type num_entry = c_cijk.num_entry(i);
 
  692       const cijk_size_type entry_beg = c_cijk.entry_begin(i);
 
  693       const cijk_size_type entry_end = entry_beg + num_entry;
 
  695       for (cijk_size_type entry = entry_beg; entry < entry_end; ++entry) {
 
  696         const cijk_size_type 
j = c_cijk.coord(entry,0);
 
  697         const cijk_size_type k = c_cijk.coord(entry,1);
 
  698         ytmp += c_cijk.value(entry) * ( ac[
j] * bc[k] + ac[k] * bc[
j] );
 
  707 template <
typename Storage>
 
  708 KOKKOS_INLINE_FUNCTION
 
  717   const ordinal_type bsz = b.size();
 
  719   const_pointer bc = b.coeff();
 
  720   pointer cc = c.coeff();
 
  721   for (ordinal_type i=0; i<bsz; ++i)
 
  726 template <
typename Storage>
 
  727 KOKKOS_INLINE_FUNCTION
 
  736   const ordinal_type asz = a.size();
 
  738   const_pointer ac = a.coeff();
 
  739   pointer cc = c.coeff();
 
  740   for (ordinal_type i=0; i<asz; ++i)
 
  745 template <
typename Storage>
 
  746 KOKKOS_INLINE_FUNCTION
 
  756   const ordinal_type asz = a.size();
 
  757   const ordinal_type bsz = b.size();
 
  758   const ordinal_type csz = asz > bsz ? asz : bsz;
 
  760 #if !defined(__CUDA_ARCH__) 
  762   asz != bsz && asz != 1 && bsz != 1, std::logic_error,
 
  763   "Sacado::UQ::PCE::operator/(): input sizes do not match");
 
  765   my_cijk_type c_cijk = asz == bsz || asz >1 ? a.cijk() : b.cijk();
 
  769 #if defined(__CUDA_ARCH__) 
  770   const_pointer ac = a.coeff();
 
  771   pointer cc = c.coeff();
 
  772   value_type bcz = b.fastAccessCoeff(0);
 
  773   for (ordinal_type i=0; i<asz; ++i)
 
  777 #if !defined(__CUDA_ARCH__) 
  779     const_pointer ac = a.coeff();
 
  780     const_pointer bc = b.coeff();
 
  781     pointer cc = c.coeff();
 
  782     const value_type bcz = bc[0];
 
  783     for (ordinal_type i=0; i<csz; ++i)
 
  794 template <
typename Storage>
 
  795 KOKKOS_INLINE_FUNCTION
 
  805 template <
typename Storage>
 
  806 KOKKOS_INLINE_FUNCTION
 
  815   const ordinal_type asz = a.size();
 
  817   const_pointer ac = a.coeff();
 
  818   pointer cc = c.coeff();
 
  819   for (ordinal_type i=0; i<asz; ++i)
 
  824 template <
typename Storage>
 
  825 KOKKOS_INLINE_FUNCTION
 
  829 #if !defined(__CUDA_ARCH__) 
  831     a.size() != 1, std::logic_error,
 
  832     "Sacado::UQ::PCE::exp():  argument has size != 1");
 
  836   c.fastAccessCoeff(0) = 
std::exp( a.fastAccessCoeff(0) );
 
  841 template <
typename Storage>
 
  842 KOKKOS_INLINE_FUNCTION
 
  846 #if !defined(__CUDA_ARCH__) 
  848     a.size() != 1, std::logic_error,
 
  849     "Sacado::UQ::PCE::log():  argument has size != 1");
 
  853   c.fastAccessCoeff(0) = 
std::log( a.fastAccessCoeff(0) );
 
  858 template <
typename Storage>
 
  859 KOKKOS_INLINE_FUNCTION
 
  863 #if !defined(__CUDA_ARCH__) 
  865     a.size() != 1, std::logic_error,
 
  866     "Sacado::UQ::PCE::log10():  argument has size != 1");
 
  870   c.fastAccessCoeff(0) = 
std::log10( a.fastAccessCoeff(0) );
 
  875 template <
typename Storage>
 
  876 KOKKOS_INLINE_FUNCTION
 
  880 #if !defined(__CUDA_ARCH__) 
  882     a.size() != 1, std::logic_error,
 
  883     "Sacado::UQ::PCE::sqrt():  argument has size != 1");
 
  887   c.fastAccessCoeff(0) = 
std::sqrt( a.fastAccessCoeff(0) );
 
  892 template <
typename Storage>
 
  893 KOKKOS_INLINE_FUNCTION
 
  897 #if !defined(__CUDA_ARCH__) 
  899     a.size() != 1, std::logic_error,
 
  900     "Sacado::UQ::PCE::cbrt():  argument has size != 1");
 
  904   c.fastAccessCoeff(0) = 
std::cbrt( a.fastAccessCoeff(0) );
 
  909 template <
typename Storage>
 
  910 KOKKOS_INLINE_FUNCTION
 
  914 #if !defined(__CUDA_ARCH__) 
  916     a.size() != 1 || b.size() != 1, std::logic_error,
 
  917     "Sacado::UQ::PCE::pow():  arguments have size != 1");
 
  921   c.fastAccessCoeff(0) = 
std::pow(a.fastAccessCoeff(0), b.fastAccessCoeff(0));
 
  926 template <
typename Storage>
 
  927 KOKKOS_INLINE_FUNCTION
 
  932 #if !defined(__CUDA_ARCH__) 
  934     b.size() != 1, std::logic_error,
 
  935     "Sacado::UQ::PCE::pow():  arguments have size != 1");
 
  939   c.fastAccessCoeff(0) = 
std::pow(a, b.fastAccessCoeff(0));
 
  944 template <
typename Storage>
 
  945 KOKKOS_INLINE_FUNCTION
 
  950 #if !defined(__CUDA_ARCH__) 
  952     a.size() != 1, std::logic_error,
 
  953     "Sacado::UQ::PCE::pow():  arguments have size != 1");
 
  957   c.fastAccessCoeff(0) = 
std::pow(a.fastAccessCoeff(0), b);
 
  962 template <
typename Storage>
 
  963 KOKKOS_INLINE_FUNCTION
 
  967 #if !defined(__CUDA_ARCH__) 
  969     a.size() != 1, std::logic_error,
 
  970     "Sacado::UQ::PCE::sin():  argument has size != 1");
 
  974   c.fastAccessCoeff(0) = 
std::sin( a.fastAccessCoeff(0) );
 
  979 template <
typename Storage>
 
  980 KOKKOS_INLINE_FUNCTION
 
  984 #if !defined(__CUDA_ARCH__) 
  986     a.size() != 1, std::logic_error,
 
  987     "Sacado::UQ::PCE::cos():  argument has size != 1");
 
  991   c.fastAccessCoeff(0) = 
std::cos( a.fastAccessCoeff(0) );
 
  996 template <
typename Storage>
 
  997 KOKKOS_INLINE_FUNCTION
 
 1001 #if !defined(__CUDA_ARCH__) 
 1003     a.size() != 1, std::logic_error,
 
 1004     "Sacado::UQ::PCE::tan():  argument has size != 1");
 
 1008   c.fastAccessCoeff(0) = 
std::tan( a.fastAccessCoeff(0) );
 
 1013 template <
typename Storage>
 
 1014 KOKKOS_INLINE_FUNCTION
 
 1018 #if !defined(__CUDA_ARCH__) 
 1020     a.size() != 1, std::logic_error,
 
 1021     "Sacado::UQ::PCE::sinh():  argument has size != 1");
 
 1025   c.fastAccessCoeff(0) = 
std::sinh( a.fastAccessCoeff(0) );
 
 1030 template <
typename Storage>
 
 1031 KOKKOS_INLINE_FUNCTION
 
 1035 #if !defined(__CUDA_ARCH__) 
 1037     a.size() != 1, std::logic_error,
 
 1038     "Sacado::UQ::PCE::cosh():  argument has size != 1");
 
 1042   c.fastAccessCoeff(0) = 
std::cosh( a.fastAccessCoeff(0) );
 
 1047 template <
typename Storage>
 
 1048 KOKKOS_INLINE_FUNCTION
 
 1052 #if !defined(__CUDA_ARCH__) 
 1054     a.size() != 1, std::logic_error,
 
 1055     "Sacado::UQ::PCE::tanh():  argument has size != 1");
 
 1059   c.fastAccessCoeff(0) = 
std::tanh( a.fastAccessCoeff(0) );
 
 1064 template <
typename Storage>
 
 1065 KOKKOS_INLINE_FUNCTION
 
 1069 #if !defined(__CUDA_ARCH__) 
 1071     a.size() != 1, std::logic_error,
 
 1072     "Sacado::UQ::PCE::acos():  argument has size != 1");
 
 1076   c.fastAccessCoeff(0) = 
std::acos( a.fastAccessCoeff(0) );
 
 1081 template <
typename Storage>
 
 1082 KOKKOS_INLINE_FUNCTION
 
 1086 #if !defined(__CUDA_ARCH__) 
 1088     a.size() != 1, std::logic_error,
 
 1089     "Sacado::UQ::PCE::asin():  argument has size != 1");
 
 1093   c.fastAccessCoeff(0) = 
std::asin( a.fastAccessCoeff(0) );
 
 1098 template <
typename Storage>
 
 1099 KOKKOS_INLINE_FUNCTION
 
 1103 #if !defined(__CUDA_ARCH__) 
 1105     a.size() != 1, std::logic_error,
 
 1106     "Sacado::UQ::PCE::atan():  argument has size != 1");
 
 1110   c.fastAccessCoeff(0) = 
std::atan( a.fastAccessCoeff(0) );
 
 1168 template <
typename Storage>
 
 1169 KOKKOS_INLINE_FUNCTION
 
 1174   c.fastAccessCoeff(0) = a.two_norm();
 
 1178 template <
typename Storage>
 
 1179 KOKKOS_INLINE_FUNCTION
 
 1184   c.fastAccessCoeff(0) = a.two_norm();
 
 1188 template <
typename Storage>
 
 1189 KOKKOS_INLINE_FUNCTION
 
 1194   c.fastAccessCoeff(0) = 
std::ceil( a.fastAccessCoeff(0) );
 
 1208 template <
typename Storage>
 
 1209 KOKKOS_INLINE_FUNCTION
 
 1214   if (a >= b.two_norm()) {
 
 1216     c.fastAccessCoeff(0) = a;
 
 1222 template <
typename Storage>
 
 1227   if (a.two_norm() >= b)
 
 1230   c.fastAccessCoeff(0) = b;
 
 1244 template <
typename Storage>
 
 1245 KOKKOS_INLINE_FUNCTION
 
 1250   if (a <= b.two_norm()) {
 
 1252     c.fastAccessCoeff(0) = a;
 
 1258 template <
typename Storage>
 
 1259 KOKKOS_INLINE_FUNCTION
 
 1264   if (a.two_norm() <= b)
 
 1267   c.fastAccessCoeff(0) = b;
 
 1271 template <
typename Storage>
 
 1272 KOKKOS_INLINE_FUNCTION
 
 1277   const ordinal_type asz = a.size();
 
 1278   const ordinal_type bsz = b.size();
 
 1279   const ordinal_type n = asz > bsz ? asz : bsz;
 
 1280   for (ordinal_type i=0; i<n; i++)
 
 1281     if (a.coeff(i) != b.coeff(i))
 
 1286 template <
typename Storage>
 
 1287 KOKKOS_INLINE_FUNCTION
 
 1293   const ordinal_type n = b.size();
 
 1294   if (a != b.coeff(0))
 
 1296   for (ordinal_type i=1; i<n; i++)
 
 1302 template <
typename Storage>
 
 1303 KOKKOS_INLINE_FUNCTION
 
 1309   const ordinal_type n = a.size();
 
 1310   if (a.coeff(0) != b)
 
 1312   for (ordinal_type i=1; i<n; i++)
 
 1318 template <
typename Storage>
 
 1319 KOKKOS_INLINE_FUNCTION
 
 1326 template <
typename Storage>
 
 1327 KOKKOS_INLINE_FUNCTION
 
 1335 template <
typename Storage>
 
 1336 KOKKOS_INLINE_FUNCTION
 
 1344 template <
typename Storage>
 
 1345 KOKKOS_INLINE_FUNCTION
 
 1349   return a.two_norm() <= b.two_norm();
 
 1352 template <
typename Storage>
 
 1353 KOKKOS_INLINE_FUNCTION
 
 1358   return a <= b.two_norm();
 
 1361 template <
typename Storage>
 
 1362 KOKKOS_INLINE_FUNCTION
 
 1364 operator<=(const PCE<Storage>& a,
 
 1367   return a.two_norm() <= b;
 
 1370 template <
typename Storage>
 
 1371 KOKKOS_INLINE_FUNCTION
 
 1375   return a.two_norm() >= b.two_norm();
 
 1378 template <
typename Storage>
 
 1379 KOKKOS_INLINE_FUNCTION
 
 1384   return a >= b.two_norm();
 
 1387 template <
typename Storage>
 
 1388 KOKKOS_INLINE_FUNCTION
 
 1393   return a.two_norm() >= b;
 
 1396 template <
typename Storage>
 
 1397 KOKKOS_INLINE_FUNCTION
 
 1401   return a.two_norm() < b.two_norm();
 
 1404 template <
typename Storage>
 
 1405 KOKKOS_INLINE_FUNCTION
 
 1410   return a < b.two_norm();
 
 1413 template <
typename Storage>
 
 1414 KOKKOS_INLINE_FUNCTION
 
 1416 operator<(const PCE<Storage>& a,
 
 1419   return a.two_norm() < b;
 
 1422 template <
typename Storage>
 
 1423 KOKKOS_INLINE_FUNCTION
 
 1427   return a.two_norm() > b.two_norm();
 
 1430 template <
typename Storage>
 
 1431 KOKKOS_INLINE_FUNCTION
 
 1436   return a > b.two_norm();
 
 1439 template <
typename Storage>
 
 1440 KOKKOS_INLINE_FUNCTION
 
 1445   return a.two_norm() > b;
 
 1448 template <
typename Storage>
 
 1449 KOKKOS_INLINE_FUNCTION
 
 1452   bool is_zero = 
true;
 
 1453   const ordinal_type sz = x.size();
 
 1454   for (ordinal_type i=0; i<sz; i++)
 
 1455     is_zero = is_zero && (x.fastAccessCoeff(i) == 0.0);
 
 1459 template <
typename Storage>
 
 1460 KOKKOS_INLINE_FUNCTION
 
 1467 template <
typename Storage>
 
 1468 KOKKOS_INLINE_FUNCTION
 
 1476 template <
typename Storage>
 
 1477 KOKKOS_INLINE_FUNCTION
 
 1485 template <
typename Storage>
 
 1486 KOKKOS_INLINE_FUNCTION
 
 1493 template <
typename Storage>
 
 1494 KOKKOS_INLINE_FUNCTION
 
 1502 template <
typename Storage>
 
 1503 KOKKOS_INLINE_FUNCTION
 
 1511 template <
typename Storage>
 
 1513 operator << (std::ostream& os, const PCE<Storage>& a)
 
 1519   for (ordinal_type i=0; i<a.size(); i++) {
 
 1520     os << a.coeff(i) << 
" ";
 
 1527 template <
typename Storage>
 
 1537   for (ordinal_type i=0; i<a.size(); i++) {
 
 1538     is >> a.fastAccessCoeff(i);
 
 1547 template <
typename Storage>
 
 1553     const ordinal_type size = c.size();
 
 1556     value_type alpha, beta, rTz, rTz_old, resid;
 
 1568     resid = r.two_norm();
 
 1570     rTz = r.inner_product(z);
 
 1572     value_type tol = 1e-6;
 
 1573     while ( resid > tol && k < 100){
 
 1576       alpha = rTz/p.inner_product(bp);
 
 1582       resid = r.two_norm();
 
 1585       rTz = r.inner_product(z);
 
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > fabs(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > tan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION bool operator||(const PCE< Storage > &x1, const PCE< Storage > &x2)
KOKKOS_INLINE_FUNCTION PCE< Storage > sinh(const PCE< Storage > &a)
OrthogPoly< T, Storage > operator-(const OrthogPoly< T, Storage > &a, const OrthogPoly< T, Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
KOKKOS_INLINE_FUNCTION bool operator&&(const PCE< Storage > &x1, const PCE< Storage > &x2)
KOKKOS_INLINE_FUNCTION PCE< Storage > tanh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION bool operator!=(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > acos(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > min(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION bool operator>(const PCE< Storage > &a, const PCE< Storage > &b)
std::istream & operator>>(std::istream &is, PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > operator/(const PCE< Storage > &a, const PCE< Storage > &b)
void CG_divide(const PCE< Storage > &a, const PCE< Storage > &b, PCE< Storage > &c)
KOKKOS_INLINE_FUNCTION PCE< Storage > ceil(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > operator-(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION bool operator>=(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > max(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > cosh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION bool is_constant(const T &x)
KOKKOS_INLINE_FUNCTION bool operator==(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > atan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > operator+(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > operator*(const PCE< Storage > &a, const PCE< Storage > &b)
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)
KOKKOS_INLINE_FUNCTION bool toBool(const PCE< Storage > &x)