Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Stokhos_PseudoSpectralOrthogPolyExpansionImp.hpp
Go to the documentation of this file.
1// $Id$
2// $Source$
3// @HEADER
4// ***********************************************************************
5//
6// Stokhos Package
7// Copyright (2009) Sandia Corporation
8//
9// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
10// license for use of this work by or on behalf of the U.S. Government.
11//
12// Redistribution and use in source and binary forms, with or without
13// modification, are permitted provided that the following conditions are
14// met:
15//
16// 1. Redistributions of source code must retain the above copyright
17// notice, this list of conditions and the following disclaimer.
18//
19// 2. Redistributions in binary form must reproduce the above copyright
20// notice, this list of conditions and the following disclaimer in the
21// documentation and/or other materials provided with the distribution.
22//
23// 3. Neither the name of the Corporation nor the names of the
24// contributors may be used to endorse or promote products derived from
25// this software without specific prior written permission.
26//
27// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
28// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
31// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38//
39// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
40//
41// ***********************************************************************
42// @HEADER
43
44#include "Teuchos_Assert.hpp"
46#include "Teuchos_TimeMonitor.hpp"
47#include "Teuchos_Tuple.hpp"
48
49template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
52 const Teuchos::RCP<const Stokhos::OrthogPolyBasis<ordinal_type, value_type> >& basis_,
53 const Teuchos::RCP<const Stokhos::Sparse3Tensor<ordinal_type, value_type> >& Cijk_,
54 const Teuchos::RCP<const PseudoSpectralOperator<ordinal_type, value_type, point_compare_type> >& ps_op_,
55 const Teuchos::RCP<Teuchos::ParameterList>& params_) :
56 OrthogPolyExpansionBase<ordinal_type, value_type, node_type>(basis_, Cijk_, params_),
57 ps_op(ps_op_),
58 sz(ps_op->coeff_size()),
59 nqp(ps_op->point_size()),
60 avals(nqp),
61 bvals(nqp),
62 fvals(nqp)
63{
64 Teuchos::RCP<Teuchos::ParameterList> params = params_;
65 if (params == Teuchos::null)
66 params = Teuchos::rcp(new Teuchos::ParameterList);
67 use_quad_for_times = params->get("Use Quadrature for Times", false);
68 use_quad_for_division = params->get("Use Quadrature for Division", true);
69}
70
71template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
72template <typename FuncT>
73void
75unary_op(const FuncT& func,
76 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
77 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a)
78{
79 ordinal_type pa = a.size();
80 ordinal_type pc;
81 if (a.size() == 1)
82 pc = 1;
83 else
84 pc = sz;
85 if (c.size() != pc)
86 c.resize(pc);
87
88 if (pc == 1) {
89 c[0] = func(a[0]);
90 return;
91 }
92
93 {
94#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
95 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- Unary Polynomial Evaluation");
96#endif
97
98 // Evaluate input
99 SDV a_sdv(Teuchos::View, const_cast<value_type*>(a.coeff()), pa);
100 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0, false);
101
102 }
103
104 {
105#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
106 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- Unary Function Evaluation");
107#endif
108
109 // Evaluate function
110 for (ordinal_type qp=0; qp<nqp; qp++) {
111 fvals[qp] = func(avals[qp]);
112 }
113
114 }
115
116 {
117#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
118 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- Unary Polynomial Integration");
119#endif
120
121 // Integrate
122 SDV c_sdv(Teuchos::View, c.coeff(), pc);
123 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0, false);
124
125 }
126}
127
128template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
129template <typename FuncT>
130void
132binary_op(const FuncT& func,
133 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
134 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
135 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b)
136{
137 ordinal_type pa = a.size();
138 ordinal_type pb = b.size();
139 ordinal_type pc;
140 if (pa == 1 && pb == 1)
141 pc = 1;
142 else
143 pc = sz;
144 if (c.size() != pc)
145 c.resize(pc);
146
147 if (pc == 1) {
148 c[0] = func(a[0], b[0]);
149 return;
150 }
151
152 {
153#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
154 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- PP Binary Polynomial Evaluation");
155#endif
156
157 // Evaluate input
158 SDV a_sdv(Teuchos::View, const_cast<value_type*>(a.coeff()), pa);
159 SDV b_sdv(Teuchos::View, const_cast<value_type*>(b.coeff()), pb);
160 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0, false);
161 ps_op->transformPCE2QP(1.0, b_sdv, bvals, 0.0, false);
162
163 }
164
165 {
166#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
167 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- PP Binary Function Evaluation");
168#endif
169
170 // Evaluate function
171 for (ordinal_type qp=0; qp<nqp; qp++)
172 fvals[qp] = func(avals[qp], bvals[qp]);
173
174 }
175
176 {
177#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
178 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- PP Binary Polynomial Integration");
179#endif
180
181 // Integrate
182 SDV c_sdv(Teuchos::View, c.coeff(), pc);
183 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0, false);
184
185 }
186}
187
188template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
189template <typename FuncT>
190void
192binary_op(const FuncT& func,
193 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
194 const value_type& a,
195 const OrthogPolyApprox<ordinal_type, value_type, node_type>& b)
196{
197 ordinal_type pb = b.size();
198 ordinal_type pc;
199 if (pb == 1)
200 pc = 1;
201 else
202 pc = sz;
203 if (c.size() != pc)
204 c.resize(pc);
205
206 if (pc == 1) {
207 c[0] = func(a, b[0]);
208 return;
209 }
210
211 {
212#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
213 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- CP Binary Polynomial Evaluation");
214#endif
215
216 // Evaluate input
217 SDV b_sdv(Teuchos::View, const_cast<value_type*>(b.coeff()), pb);
218 ps_op->transformPCE2QP(1.0, b_sdv, bvals, 0.0, false);
219
220 }
221
222 {
223#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
224 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- CP Binary Function Evaluation");
225#endif
226
227 // Evaluate function
228 for (ordinal_type qp=0; qp<nqp; qp++)
229 fvals[qp] = func(a, bvals[qp]);
230
231 }
232
233 {
234#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
235 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- CP Binary Polynomial Integration");
236#endif
237
238 // Integrate
239 SDV c_sdv(Teuchos::View, c.coeff(), pc);
240 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0, false);
241
242 }
243}
244
245template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
246template <typename FuncT>
247void
249binary_op(const FuncT& func,
250 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
251 const OrthogPolyApprox<ordinal_type, value_type, node_type>& a,
252 const value_type& b)
253{
254 ordinal_type pa = a.size();
255 ordinal_type pc;
256 if (pa == 1)
257 pc = 1;
258 else
259 pc = sz;
260 if (c.size() != pc)
261 c.resize(pc);
262
263 if (pc == 1) {
264 c[0] = func(a[0], b);
265 return;
266 }
267
268 {
269#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
270 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- PC Binary Polynomial Evaluation");
271#endif
272
273 // Evaluate input
274 SDV a_sdv(Teuchos::View, const_cast<value_type*>(a.coeff()), pa);
275 ps_op->transformPCE2QP(1.0, a_sdv, avals, 0.0, false);
276
277 }
278
279 {
280#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
281 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- PC Binary Function Evaluation");
282#endif
283
284 // Evaluate function
285 for (ordinal_type qp=0; qp<nqp; qp++)
286 fvals[qp] = func(avals[qp], b);
287
288 }
289
290 {
291#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
292 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- PC Binary Polynomial Integration");
293#endif
294
295 // Integrate
296 SDV c_sdv(Teuchos::View, c.coeff(), pc);
297 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0, false);
298
299 }
300}
301
302template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
303template <typename FuncT>
304void
306nary_op(const FuncT& func,
307 OrthogPolyApprox<ordinal_type, value_type, node_type>& c,
308 const OrthogPolyApprox<ordinal_type, value_type, node_type>** na)
309{
310 const int N = FuncT::N;
311 bool is_constant = true;
312 for (int i=0; i<N; i++) {
313 if (na[i]->size() > 1) {
314 is_constant = false;
315 break;
316 }
317 }
318 ordinal_type pc;
319 if (is_constant)
320 pc = 1;
321 else
322 pc = sz;
323 if (c.size() != pc)
324 c.resize(pc);
325
326 if (pc == 1) {
327 value_type val[N];
328 for (int i=0; i<N; i++)
329 val[i] = (*na[i])[0];
330 c[0] = func(val);
331 return;
332 }
333
334 if (N >= navals.size())
335 navals.resize(N+1);
336 if (navals[N].size() != N) {
337 navals[N].resize(N);
338 for (int i=0; i<N; i++)
339 navals[N][i].resize(nqp);
340 }
341
342 {
343#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
344 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- N(" << N << ")-ary Polynomial Evaluation");
345#endif
346
347 // Evaluate input
348 for (int i=0; i<N; i++) {
349 SDV sdv(Teuchos::View, const_cast<value_type*>(na[i]->coeff()),
350 na[i]->size());
351 ps_op->transformPCE2QP(1.0, sdv, navals[N][i], 0.0, false);
352 }
353
354 }
355
356 {
357#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
358 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- N(" << N << ")-ary Function Evaluation");
359#endif
360
361 // Evaluate function
362 value_type val[N];
363 for (ordinal_type qp=0; qp<nqp; qp++) {
364 for (int i=0; i<N; i++)
365 val[i] = navals[N][i][qp];
366 fvals[qp] = func(val);
367 }
368
369 }
370
371 {
372#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
373 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::PSExp -- N(" << N << ")-ary Polynomial Integration");
374#endif
375
376 // Integrate
377 SDV c_sdv(Teuchos::View, c.coeff(), pc);
378 ps_op->transformQP2PCE(1.0, fvals, c_sdv, 0.0, false);
379
380 }
381}
382
383template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
384void
392
393template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
394void
402
403template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
404void
415
416template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
417void
422{
423#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
424 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::OrthogPolyExpansionBase::divideEqual(OPA)");
425#endif
426 if (x.size() == 1) {
427 ordinal_type p = c.size();
428 value_type* cc = c.coeff();
429 const value_type* xc = x.coeff();
430 for (ordinal_type i=0; i<p; i++)
431 cc[i] /= xc[0];
432 }
433 else {
434 if (use_quad_for_division)
435 binary_op(div_quad_func(), c, c, x);
436 else
438 }
439}
440
441template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
442void
453
454template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
455void
463
464template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
465void
473
474template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
475void
480{
481#ifdef STOKHOS_TEUCHOS_TIME_MONITOR
482 TEUCHOS_FUNC_TIME_MONITOR("Stokhos::OrthogPolyExpansionBase::divide(OPA,OPA)");
483#endif
484 if (b.size() == 1) {
485 ordinal_type pc = a.size();
486 if (c.size() != pc)
487 c.resize(pc);
488
489 const value_type* ca = a.coeff();
490 const value_type* cb = b.coeff();
491 value_type* cc = c.coeff();
492
493 for (ordinal_type i=0; i<pc; i++)
494 cc[i] = ca[i]/cb[0];
495 }
496 else {
497 if (use_quad_for_division)
498 binary_op(div_quad_func(), c, a, b);
499 else
501 }
502}
503
504template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
505void
516
517template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
518void
526
527template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
528void
535
536template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
537void
544
545template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
546void
553
554template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
555void
562
563template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
564void
571
572template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
573void
581
582template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
583void
591
592template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
593void
601
602template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
603void
610
611template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
612void
619
620template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
621void
628
629template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
630void
637
638template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
639void
646
647template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
648void
655
656template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
657void
664
665template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
666void
673
674template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
675void
682
683template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
684void
692
693template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
694void
702
703template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
704void
712
713template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
714void
721
722template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
723void
730
731template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
732void
739
740template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
741template <typename ExprT1, typename ExprT2>
742value_type
744compute_times_coeff(ordinal_type i, const ExprT1& a, const ExprT2& b) const
745{
746 ordinal_type pa = a.size();
747 ordinal_type pb = b.size();
748
749 if (pa > 1 && pb > 1) {
750 ordinal_type k_lim = pa;
751 ordinal_type j_lim = pb;
752 if (pb < pa) {
753 k_lim = pb;
754 j_lim = pa;
755 }
756 typename Cijk_type::i_iterator i_it = this->Cijk->find_i(i);
757#ifdef STOKHOS_DEBUG
758 TEUCHOS_TEST_FOR_EXCEPTION(i_it == this->Cijk->i_end(), std::logic_error,
759 "Stokhos::PseudoSpectralOrthogPolyExpansion::compute_times_coeff()"
760 << ": Index " << i << " is out of range [0,"
761 << this->Cijk->num_i() << ")!");
762#endif
763 value_type cc = value_type(0);
764 value_type aa, bb, cijk;
765 ordinal_type j, k;
766 for (typename Cijk_type::ik_iterator k_it = this->Cijk->k_begin(i_it);
767 k_it != this->Cijk->k_end(i_it); ++k_it) {
768 k = index(k_it);
769 if (k < k_lim) {
770 if (pa < pb) {
771 if (k == 0)
772 aa = a.val();
773 else
774 aa = a.higher_order_coeff(k);
775 }
776 else {
777 if (k == 0)
778 aa = b.val();
779 else
780 aa = b.higher_order_coeff(k);
781 }
782 for (typename Cijk_type::ikj_iterator j_it = this->Cijk->j_begin(k_it);
783 j_it != this->Cijk->j_end(k_it); ++j_it) {
784 j = index(j_it);
785 cijk = value(j_it);
786 if (j < j_lim) {
787 if (pa < pb) {
788 if (j == 0)
789 bb = b.val();
790 else
791 bb = b.higher_order_coeff(j);
792 }
793 else {
794 if (j == 0)
795 bb = a.val();
796 else
797 bb = a.higher_order_coeff(j);
798 }
799 cc += cijk*aa*bb;
800 }
801 }
802 }
803 }
804 return cc / this->basis->norm_squared(i);
805 }
806 else if (i == 0)
807 return a.val() * b.val();
808 else if (pa > 1) {
809 return a.higher_order_coeff(i)*b.val();
810 }
811 else {
812 return a.val()*b.higher_order_coeff(i);
813 }
814}
815
816template <typename ordinal_type, typename value_type, typename point_compare_type, typename node_type>
817template <typename ExprT1, typename ExprT2>
818value_type
820fast_compute_times_coeff(ordinal_type i, const ExprT1& a, const ExprT2& b) const
821{
822 typename Cijk_type::i_iterator i_it = this->Cijk->find_i(i);
823#ifdef STOKHOS_DEBUG
824 TEUCHOS_TEST_FOR_EXCEPTION(i_it == this->Cijk->i_end(), std::logic_error,
825 "Stokhos::PseudoSpectralOrthogPolyExpansion::fast_ompute_times_coeff()"
826 << ": Index " << i << " is out of range [0,"
827 << this->Cijk->num_i() << ")!");
828#endif
829 value_type cc = value_type(0);
830 value_type aa, bb, cijk;
831 ordinal_type j, k;
832 for (typename Cijk_type::ik_iterator k_it = this->Cijk->k_begin(i_it);
833 k_it != this->Cijk->k_end(i_it); ++k_it) {
834 k = index(k_it);
835 if (k == 0)
836 aa = a.val();
837 else
838 aa = a.higher_order_coeff(k);
839 for (typename Cijk_type::ikj_iterator j_it = this->Cijk->j_begin(k_it);
840 j_it != this->Cijk->j_end(k_it); ++j_it) {
841 j = index(j_it);
842 cijk = value(j_it);
843 if (j == 0)
844 bb = b.val();
845 else
846 bb = b.higher_order_coeff(j);
847 cc += cijk*aa*bb;
848 }
849 }
850
851 return cc / this->basis->norm_squared(i);
852}
expr val()
Kokkos::Serial node_type
Class to store coefficients of a projection onto an orthogonal polynomial basis.
void resize(ordinal_type sz)
Resize coefficient array (coefficients are preserved)
pointer coeff()
Return coefficient array.
ordinal_type size() const
Return size.
Abstract base class for multivariate orthogonal polynomials.
Base class for consolidating common expansion implementations.
void binary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
Nonlinear binary function.
void asinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void asin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
value_type fast_compute_times_coeff(ordinal_type k, const ExprT1 &a, const ExprT2 &b) const
value_type compute_times_coeff(ordinal_type k, const ExprT1 &a, const ExprT2 &b) const
void divideEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void acosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void cos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void tanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void divide(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void times(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void unary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Nonlinear unary function.
void pow(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void nary_op(const FuncT &func, OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > **a)
void sin(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void timesEqual(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const value_type &x)
void cbrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void acos(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void log(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void atan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Teuchos::SerialDenseVector< ordinal_type, value_type > SDV
Short-hand for SerialDenseVector.
void sqrt(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void cosh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void tan(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void atan2(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a, const OrthogPolyApprox< ordinal_type, value_type, node_type > &b)
void atanh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
PseudoSpectralOrthogPolyExpansion(const Teuchos::RCP< const OrthogPolyBasis< ordinal_type, value_type > > &basis, const Teuchos::RCP< const Stokhos::Sparse3Tensor< ordinal_type, value_type > > &Cijk, const Teuchos::RCP< const PseudoSpectralOperator< ordinal_type, value_type, point_compare_type > > &ps_op, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor.
void exp(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void log10(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
void sinh(OrthogPolyApprox< ordinal_type, value_type, node_type > &c, const OrthogPolyApprox< ordinal_type, value_type, node_type > &a)
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
j_sparse_array::const_iterator ikj_iterator
Iterator for looping over j entries given i and k.
ikj_sparse_array::const_iterator i_iterator
Iterator for looping over i entries.
Bi-directional iterator for traversing a sparse array.