// @HEADER // ***************************************************************************** // Sacado Package // // Copyright 2006 NTESS and the Sacado contributors. // SPDX-License-Identifier: LGPL-2.1-or-later // // *********************************************************************** // // The forward-mode AD classes in Sacado are a derivative work of the // expression template classes in the Fad package by Nicolas Di Cesare. // The following banner is included in the original Fad source code: // // ************ DO NOT REMOVE THIS BANNER **************** // // Nicolas Di Cesare // http://www.ann.jussieu.fr/~dicesare // // CEMRACS 98 : C++ courses, // templates : new C++ techniques // for scientific computing // //******************************************************** // // NumericalTraits class to illustrate TRAITS // //******************************************************** // @HEADER #ifndef SACADO_ELRFAD_VIEWFADTRAITS_HPP #define SACADO_ELRFAD_VIEWFADTRAITS_HPP #include "Sacado_Traits.hpp" // Forward declarations namespace Sacado { namespace ELRFad { template class ViewFad; } } namespace Sacado { //! Specialization of %Promote to ViewFad types SACADO_VFAD_PROMOTE_SPEC( ELRFad ) //! Specialization of %ScalarType to ViewFad types template struct ScalarType< ELRFad::ViewFad > { typedef typename ELRFad::ViewFad::ScalarT type; }; //! Specialization of %ValueType to ViewFad types template struct ValueType< ELRFad::ViewFad > { typedef ValueT type; }; //! Specialization of %IsADType to ViewFad types template struct IsADType< ELRFad::ViewFad > { static const bool value = true; }; //! Specialization of %IsADType to ViewFad types template struct IsScalarType< ELRFad::ViewFad > { static const bool value = false; }; //! Specialization of %Value to ViewFad types template struct Value< ELRFad::ViewFad > { typedef typename ValueType< ELRFad::ViewFad >::type value_type; SACADO_INLINE_FUNCTION static const value_type& eval(const ELRFad::ViewFad& x) { return x.val(); } }; //! Specialization of %ScalarValue to ViewFad types template struct ScalarValue< ELRFad::ViewFad > { typedef typename ValueType< ELRFad::ViewFad >::type value_type; typedef typename ScalarType< ELRFad::ViewFad >::type scalar_type; SACADO_INLINE_FUNCTION static const scalar_type& eval(const ELRFad::ViewFad& x) { return ScalarValue::eval(x.val()); } }; //! Specialization of %StringName to ViewFad types template struct StringName< ELRFad::ViewFad > { static std::string eval() { return std::string("Sacado::ELRFad::ViewFad< ") + StringName::eval() + " >"; } }; //! Specialization of %IsEqual to ViewFad types template struct IsEqual< ELRFad::ViewFad > { SACADO_INLINE_FUNCTION static bool eval(const ELRFad::ViewFad& x, const ELRFad::ViewFad& y) { return x.isEqualTo(y); } }; //! Specialization of %IsStaticallySized to ViewFad types template struct IsStaticallySized< ELRFad::ViewFad > { static const bool value = false; }; } // namespace Sacado // ViewFad is not a proper scalar type, so we don't define any of the // Teuchos traits classes #endif // SACADO_ELRFAD_VIEWFADTRAITS_HPP