// @HEADER // ***************************************************************************** // Stokhos Package // // Copyright 2009 NTESS and the Stokhos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef SACADO_ETPCE_EXPRESSIONTRAITS_HPP #define SACADO_ETPCE_EXPRESSIONTRAITS_HPP #include "Sacado_Traits.hpp" // Forward declarations namespace Sacado { namespace ETPCE { template class Expr; } } namespace Sacado { // We don't specialize Promote because otherwise we can get ambiguous // partial specializations with the OrthogPoly classes. //! Specialization of %ScalarType to Expr types template struct ScalarType< ETPCE::Expr > { typedef typename ScalarType< typename ETPCE::Expr::value_type >::type type; }; //! Specialization of %ValueType to Expr types template struct ValueType< ETPCE::Expr > { typedef typename ETPCE::Expr::value_type type; }; //! Specialization of %IsADType to Expr types template struct IsADType< ETPCE::Expr > { static const bool value = true; }; //! Specialization of %IsADType to Expr types template struct IsScalarType< ETPCE::Expr > { static const bool value = false; }; //! Specialization of %Value to Expr types template struct Value< ETPCE::Expr > { typedef typename ValueType< ETPCE::Expr >::type value_type; static const value_type& eval(const ETPCE::Expr& x) { return x.val(); } }; //! Specialization of %ScalarValue to Expr types template struct ScalarValue< ETPCE::Expr > { typedef typename ValueType< ETPCE::Expr >::type value_type; typedef typename ScalarType< ETPCE::Expr >::type scalar_type; static const scalar_type& eval(const ETPCE::Expr& x) { return ScalarValue::eval(x.val()); } }; } // namespace Sacado #endif // SACADO_ETPCE_EXPRESSIONTRAITS_HPP