42 #include "Teuchos_Assert.hpp"
43 #include "Teuchos_BLAS.hpp"
44 #include "Teuchos_TimeMonitor.hpp"
46 template <
typename ordinal_type,
typename value_type>
52 bool limit_integration_order_) :
54 limit_integration_order(limit_integration_order_),
55 pce_sz(pce.basis()->size()),
58 basis_vecs(pce_sz, p+1),
71 for (
typename Cijk_type::k_iterator k_it = Cijk.
k_begin();
72 k_it != Cijk.
k_end(); ++k_it) {
74 for (
typename Cijk_type::kj_iterator j_it = Cijk.
j_begin(k_it);
75 j_it != Cijk.
j_end(k_it); ++j_it) {
78 for (
typename Cijk_type::kji_iterator i_it = Cijk.
i_begin(j_it);
79 i_it != Cijk.
i_end(j_it); ++i_it) {
92 Teuchos::Array<value_type> tau(
pce_sz-1);
93 lapack.SYTRD(
'L',
pce_sz+1, A.values(), A.stride(), &
a[0], &
b[0], &tau[0],
94 &ws_size_query, -1, &info);
95 TEUCHOS_TEST_FOR_EXCEPTION(info != 0, std::logic_error,
96 "SYTRD returned value " << info);
98 Teuchos::Array<value_type> work(ws_size);
99 lapack.SYTRD(
'L',
pce_sz+1, A.values(), A.stride(), &
a[0], &
b[0], &tau[0],
100 &work[0], ws_size, &info);
101 TEUCHOS_TEST_FOR_EXCEPTION(info != 0, std::logic_error,
102 "SYTRD returned value " << info);
110 &ws_size_query, -1, &info);
111 TEUCHOS_TEST_FOR_EXCEPTION(info != 0, std::logic_error,
112 "ORGQR returned value " << info);
114 work.resize(ws_size);
116 &work[0], ws_size, &info);
117 TEUCHOS_TEST_FOR_EXCEPTION(info != 0, std::logic_error,
118 "ORGQR returned value " << info);
137 std::cout <<
new_pce << std::endl;
145 std::cout <<
"orthogonalization error = " << prod.normInf() << std::endl;
149 template <
typename ordinal_type,
typename value_type>
155 template <
typename ordinal_type,
typename value_type>
159 Teuchos::Array<value_type>& quad_points,
160 Teuchos::Array<value_type>& quad_weights,
161 Teuchos::Array< Teuchos::Array<value_type> >& quad_values)
const
163 #ifdef STOKHOS_TEUCHOS_TIME_MONITOR
164 TEUCHOS_FUNC_TIME_MONITOR(
"Stokhos::LanczosPCEBasis -- compute Gauss points");
169 static_cast<ordinal_type>(std::ceil((quad_order+1)/2.0));
173 if (limit_integration_order && quad_order > 2*this->p)
174 quad_order = 2*this->p;
181 if (quad_weights.size() < num_points) {
183 quad_weights.resize(num_points);
184 quad_points.resize(num_points);
185 quad_values.resize(num_points);
188 quad_points[i] = quad_points[0];
189 quad_values[i].resize(this->p+1);
190 evaluateBases(quad_points[i], quad_values[i]);
195 template <
typename ordinal_type,
typename value_type>
196 Teuchos::RCP<Stokhos::OneDOrthogPolyBasis<ordinal_type,value_type> >
205 template <
typename ordinal_type,
typename value_type>
213 template <
typename ordinal_type,
typename value_type>
218 blas.GEMV(Teuchos::NO_TRANS, pce_sz, this->p+1,
222 out[i] /= pce_norms[i];
225 template <
typename ordinal_type,
typename value_type>
229 Teuchos::Array<value_type>& alpha,
230 Teuchos::Array<value_type>& beta,
231 Teuchos::Array<value_type>& delta,
232 Teuchos::Array<value_type>& gamma)
const
241 std::cout <<
"i = " << i <<
" alpha = " << alpha[i] <<
" beta = " << beta[i]
242 <<
" gamma = " << gamma[i] << std::endl;
248 template <
typename ordinal_type,
typename value_type>
252 limit_integration_order(basis.limit_integration_order),
253 pce_sz(basis.pce_sz),
256 basis_vecs(basis.basis_vecs),
257 new_pce(basis.new_pce)