// @HEADER // ***************************************************************************** // Stokhos Package // // Copyright 2009 NTESS and the Stokhos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef SACADO_ETPCE_ORTHOGPOLYTRAITS_HPP #define SACADO_ETPCE_ORTHOGPOLYTRAITS_HPP #include "Sacado_Traits.hpp" // Forward declarations namespace Sacado { namespace ETPCE { template class OrthogPoly; } } namespace Sacado { //! Specialization of %Promote to OrthogPoly types SACADO_AD_PROMOTE_SPEC2( ETPCE, OrthogPoly ) //! Specialization of %ScalarType to OrthogPoly types template struct ScalarType< ETPCE::OrthogPoly > { typedef typename ScalarType::value_type>::type type; }; //! Specialization of %ValueType to OrthogPoly types template struct ValueType< ETPCE::OrthogPoly > { typedef typename ETPCE::OrthogPoly::value_type type; }; //! Specialization of %IsADType to OrthogPoly types template struct IsADType< ETPCE::OrthogPoly > { static const bool value = true; }; //! Specialization of %IsADType to OrthogPoly types template struct IsScalarType< ETPCE::OrthogPoly > { static const bool value = false; }; //! Specialization of %Value to OrthogPoly types template struct Value< ETPCE::OrthogPoly > { typedef typename ValueType< ETPCE::OrthogPoly >::type value_type; static const value_type& eval(const ETPCE::OrthogPoly& x) { return x.val(); } }; //! Specialization of %ScalarValue to OrthogPoly types template struct ScalarValue< ETPCE::OrthogPoly > { typedef typename ValueType< ETPCE::OrthogPoly >::type value_type; typedef typename ScalarType< ETPCE::OrthogPoly >::type scalar_type; static const scalar_type& eval(const ETPCE::OrthogPoly& x) { return ScalarValue::eval(x.val()); } }; //! Specialization of %StringName to OrthogPoly types template struct StringName< ETPCE::OrthogPoly > { static std::string eval() { return std::string("Sacado::ETPCE::OrthogPoly< ") + StringName::eval() + " >"; } }; //! Specialization of %IsEqual to OrthogPoly types template struct IsEqual< ETPCE::OrthogPoly > { static bool eval(const ETPCE::OrthogPoly& x, const ETPCE::OrthogPoly& y) { return x.isEqualTo(y); } }; //! Specialization of %IsStaticallySized to OrthogPoly types template struct IsStaticallySized< ETPCE::OrthogPoly > { static const bool value = false; }; } // namespace Sacado // Define Teuchos traits classes // Note Stokhos has required dependency on all Teuchos sub-packages #include "Teuchos_PromotionTraits.hpp" #include "Teuchos_ScalarTraits.hpp" #include "Sacado_PCE_ScalarTraitsImp.hpp" #include "Teuchos_SerializationTraits.hpp" namespace Teuchos { //! Specialization of %Teuchos::PromotionTraits to DFad types template struct PromotionTraits< Sacado::ETPCE::OrthogPoly, Sacado::ETPCE::OrthogPoly > { typedef typename Sacado::Promote< Sacado::ETPCE::OrthogPoly, Sacado::ETPCE::OrthogPoly >::type promote; }; //! Specialization of %Teuchos::PromotionTraits to DFad types template struct PromotionTraits< Sacado::ETPCE::OrthogPoly, R > { typedef typename Sacado::Promote< Sacado::ETPCE::OrthogPoly, R >::type promote; }; //! Specialization of %Teuchos::PromotionTraits to DFad types template struct PromotionTraits< L, Sacado::ETPCE::OrthogPoly > { public: typedef typename Sacado::Promote< L, Sacado::ETPCE::OrthogPoly >::type promote; }; //! Specializtion of %Teuchos::ScalarTraits template struct ScalarTraits< Sacado::ETPCE::OrthogPoly > : public Sacado::PCE::ScalarTraitsImp< Sacado::ETPCE::OrthogPoly > {}; //! Specialization of %Teuchos::SerializationTraits template struct SerializationTraits > : public Sacado::PCE::SerializationTraitsImp< Ordinal, Sacado::ETPCE::OrthogPoly > {}; //! Specialization of %Teuchos::ValueTypeSerializer template struct ValueTypeSerializer > : public Sacado::PCE::SerializerImp< Ordinal, Sacado::ETPCE::OrthogPoly, ValueTypeSerializer > { typedef Sacado::ETPCE::OrthogPoly PCEType; typedef ValueTypeSerializer ValueSerializer; typedef Sacado::PCE::SerializerImp< Ordinal,PCEType,ValueSerializer> Base; typedef typename Base::expansion_type expansion_type; ValueTypeSerializer(const Teuchos::RCP& expansion, const Teuchos::RCP& vs) : Base(expansion,vs) {} }; } #endif // SACADO_ETPCE_ORTHOGPOLYTRAITS_HPP