42#ifndef STOKHOS_KL_PRODUCT_EIGENPAIR_HPP
43#define STOKHOS_KL_PRODUCT_EIGENPAIR_HPP
45#include "Teuchos_Array.hpp"
52 template <
typename eigen_function_type,
typename ExecutionSpace>
55 typedef typename eigen_function_type::value_type
value_type;
83 void set(
const Teuchos::Array<one_d_eigen_pair_type>& ep) {
87 for (std::size_t i=0; i<sz; i++)
92 template <
typename po
int_type>
93 KOKKOS_INLINE_FUNCTION
97 for (std::size_t i=0; i<sz; i++)
98 result *=
eig_pairs[i].eig_func.evaluate(x[i]);
103 void print(std::ostream& os)
const {
106 for (std::size_t i=0; i<sz-1; i++) {
117 template <
typename E,
typename D>
119 operator << (std::ostream& os,
const ProductEigenPair<E,D>&
f) {
125 template <
typename E,
typename D>
127 public std::binary_function<ProductEigenPair<E,D>,
128 ProductEigenPair<E,D>,
131 const ProductEigenPair<E,D>& b) {
132 return a.eig_val > b.eig_val;
ScalarType f(const Teuchos::Array< ScalarType > &x, double a, double b)
std::ostream & operator<<(std::ostream &os, const ProductEigenPair< E, D > &f)
Top-level namespace for Stokhos classes and functions.
Predicate class for sorting product eigenfunctions based on eigenvalue.
bool operator()(const ProductEigenPair< E, D > &a, const ProductEigenPair< E, D > &b)
Container for multi-dimensional product of 1-D eigenfunctions/values.
void set(const Teuchos::Array< one_d_eigen_pair_type > &ep)
Set eigen pairs.
ProductEigenPair & operator=(const ProductEigenPair &ep)
Assignment.
ProductEigenPair(const ProductEigenPair &ep)
Copy constructor.
ExecutionSpace execution_space
value_type eig_val
Product eigenvalue.
ProductEigenPair()
Default constructor.
eig_pair_type eig_pairs
Eigenpairs for each dimension.
KOKKOS_INLINE_FUNCTION value_type evalEigenfunction(const point_type &x) const
Evaluate eigenfunction at a given point.
eigen_function_type::value_type value_type
OneDEigenPair< eigen_function_type > one_d_eigen_pair_type
void print(std::ostream &os) const
Print eigenpair.
Teuchos::Array< one_d_eigen_pair_type > eig_pair_type