42#ifndef STOKHOS_KL_ONE_D_EXPONENTIAL_COVARIANCE_FUNCTION_HPP
43#define STOKHOS_KL_ONE_D_EXPONENTIAL_COVARIANCE_FUNCTION_HPP
47#include "Teuchos_ParameterList.hpp"
48#include "Teuchos_ScalarTraits.hpp"
118 template <
typename value_type>
131 Teuchos::ParameterList& solverParams);
138 const value_type& xp)
const {
139 return std::exp(-std::abs(x-xp)/
L);
157 typedef typename Teuchos::ScalarTraits<value_type>::magnitudeType
magnitude_type;
166 template <
class Func>
167 value_type
newton(
const Func& func,
const value_type& a,
172 template <
class Func>
173 value_type
bisection(
const Func& func,
const value_type& a,
184 value_type
eval(
const value_type& u)
const {
185 return alpha*std::tan(u) + u; }
186 value_type
deriv(
const value_type& u)
const {
187 return alpha/(std::cos(u)*std::cos(u)) + 1.0; }
197 value_type
eval(
const value_type& u)
const {
198 return alpha - u*std::tan(u); }
199 value_type
deriv(
const value_type& u)
const {
200 return -std::tan(u) - u/(std::cos(u)*std::cos(u)); }
Class representing an exponential covariance function and its KL eigevalues/eigenfunctions.
OneDEigenPair< eigen_function_type > eigen_pair_type
value_type bisection(const Func &func, const value_type &a, const value_type &b, magnitude_type tol, int max_num_its)
A basic root finder based on bisection.
Teuchos::Array< eigen_pair_type > eig_pair
Eigenpairs.
value_type L
Correlation length.
value_type evaluateCovariance(const value_type &x, const value_type &xp) const
Evaluate covariance.
ExponentialOneDEigenFunction< value_type > eigen_function_type
const Teuchos::Array< eigen_pair_type > & getEigenPairs() const
Get eigenpairs.
Teuchos::ScalarTraits< value_type >::magnitudeType magnitude_type
OneDExponentialCovarianceFunction(const OneDExponentialCovarianceFunction &)
Prohibit copying.
value_type newton(const Func &func, const value_type &a, const value_type &b, magnitude_type tol, int max_num_its)
A basic root finder based on Newton's method.
~OneDExponentialCovarianceFunction()
Destructor.
OneDExponentialCovarianceFunction & operator=(const OneDExponentialCovarianceFunction &)
Prohibit copying.
OneDExponentialCovarianceFunction(int M, const value_type &a, const value_type &b, const value_type &L, const int dim_name, Teuchos::ParameterList &solverParams)
Constructor.
Top-level namespace for Stokhos classes and functions.
Nonlinear function whose roots define eigenvalues for cos() eigenfunction.
value_type deriv(const value_type &u) const
EigFuncCos(const value_type &alpha_)
value_type eval(const value_type &u) const
Nonlinear function whose roots define eigenvalues for sin() eigenfunction.
EigFuncSin(const value_type &alpha_)
value_type deriv(const value_type &u) const
value_type eval(const value_type &u) const