52 #ifdef HAVE_STOKHOS_FORUQTK
63 using namespace Teuchos;
103 for (
int n=0;
n<=nMax;
n++)
105 double nFact = tgamma(
n+1.0);
106 cout <<
"n=" <<
n << endl;
107 for (
double x=-1.0; x<=1.0; x+=0.25)
109 cout << setw(20) << x << setw(20) << basis.
evaluate(x,
n)
112 for (
int m=0; m<=nMax; m++)
115 for (
int q=0; q<qw.
size(); q++)
118 double w = qw[q] *
pow(1-x,alpha)*
pow(1+x,beta);
125 exact =
pow(2.0, alpha+beta+1.0)/(2.0*
n+alpha+beta+1.0)
126 * tgamma(
n+alpha+1.0)*tgamma(
n+beta+1.0)
127 /tgamma(
n+alpha+beta+1.0)/nFact;
128 double err =
fabs(exact - sum);
129 cout << setw(4) <<
n << setw(4) << m
130 << setw(20) << exact << setw(20) << sum << setw(20) << err
138 cout <<
"***** FAIL ******" << endl;
159 for (
double alpha = 0.75; alpha <= 2.0; alpha += 0.25)
161 for (
double beta = 0.75; beta <= alpha; beta += 0.25)
163 cout <<
"alpha=" << setw(20) << alpha
164 <<
" beta=" << setw(20) << beta << endl;
172 cout <<
"Jacobi tests PASSED!" << endl;
173 cout <<
"End Result: TEST PASSED" << endl;
178 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)