63 return exp(-1/(1-
pow(2*(x+2),2)));
64 }
else if(2*
fabs(x-2)<1){
65 return exp(-1/(1-
pow(2*(x-2),2)));
75 const double leftEndPt = -3;
76 const double rightEndPt = 3;
86 norm_sq = basis->norm_squared();
87 basis->getRecurrenceCoefficients(alpha, beta, delta, gamma);
90 for(
int i = 0; i<p; i++){
91 std::cout <<
"alpha[" << i <<
"]= " << alpha[i] <<
" beta[" << i <<
"]= " << beta[i] <<
" gamma[" << i <<
"]= " << gamma[i] <<
"\n";
94 for(
int i = 0; i<=p; i++){
95 std::cout <<
"E(P_"<<i<<
"^2) = "<< norm_sq[i] <<
"\n";
101 basis->getQuadPoints(20, quad_points, quad_weights, quad_values);
102 for(
int i = 0; i<quad_points.
size(); i++){
103 std::cout <<
"x_i = "<<quad_points[i]<<
" w_i = "<< quad_weights[i] <<
" " << i <<
" / " << quad_points.
size()<<
"\n";
106 double maxOffDiag = 0;
107 double currentInnerProduct;
108 for(
int i = 0; i<=p; i++){
109 for(
int j = 0;
j<i;
j++){
110 currentInnerProduct =
fabs(basis->eval_inner_product(i,
j));
111 if(currentInnerProduct > maxOffDiag){
112 maxOffDiag = currentInnerProduct;
116 std::cout<<
"Maximum Off Diagonal Inner Product is: " << maxOffDiag <<
"\n";
119 catch (std::exception& e) {
120 std::cout << e.what() << std::endl;
KOKKOS_INLINE_FUNCTION PCE< Storage > fabs(const PCE< Storage > &a)
Generates three-term recurrence using the Discretized Stieltjes procedure.
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
double weightFunction(const double &x)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
int main(int argc, char **argv)