18 #ifdef HAVE_STOKHOS_FORUQTK
29 using namespace Teuchos;
69 for (
int n=0;
n<=nMax;
n++)
71 double nFact = tgamma(
n+1.0);
72 cout <<
"n=" <<
n << endl;
73 for (
double x=-1.0; x<=1.0; x+=0.25)
75 cout << setw(20) << x << setw(20) << basis.
evaluate(x,
n)
78 for (
int m=0; m<=nMax; m++)
81 for (
int q=0; q<qw.
size(); q++)
84 double w = qw[q] *
pow(1-x,alpha)*
pow(1+x,beta);
91 exact =
pow(2.0, alpha+beta+1.0)/(2.0*
n+alpha+beta+1.0)
92 * tgamma(
n+alpha+1.0)*tgamma(
n+beta+1.0)
93 /tgamma(
n+alpha+beta+1.0)/nFact;
94 double err =
fabs(exact - sum);
95 cout << setw(4) <<
n << setw(4) << m
96 << setw(20) << exact << setw(20) << sum << setw(20) << err
104 cout <<
"***** FAIL ******" << endl;
125 for (
double alpha = 0.75; alpha <= 2.0; alpha += 0.25)
127 for (
double beta = 0.75; beta <= alpha; beta += 0.25)
129 cout <<
"alpha=" << setw(20) << alpha
130 <<
" beta=" << setw(20) << beta << endl;
138 cout <<
"Jacobi tests PASSED!" << endl;
139 cout <<
"End Result: TEST PASSED" << endl;
144 cout <<
"Jacobi tests FAILED ***" << endl;
KOKKOS_INLINE_FUNCTION PCE< Storage > fabs(const PCE< Storage > &a)
RCP< Quadrature< int, double > > quad_
virtual value_type evaluate(const value_type &point, ordinal_type order) const
Evaluate basis polynomial given by order order at given point point.
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
JacobiTester(int quadOrder)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Legendre polynomial basis.
int main(int argc, char **argv)
bool testInnerProduct(double alpha, double beta, int nMax) const
Defines quadrature for a tensor product basis by tensor products of 1-D quadrature rules...
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< RD, RP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type sum(const Kokkos::View< RD, RP...> &r, const Kokkos::View< XD, XP...> &x)