MAST3
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
MAST::Base::ScalarConstant< ScalarType > Class Template Reference

Detailed Description

template<typename ScalarType>
class MAST::Base::ScalarConstant< ScalarType >

Definition at line 27 of file scalar_constant.hpp.

#include <scalar_constant.hpp>

Inheritance diagram for MAST::Base::ScalarConstant< ScalarType >:

Public Types

using scalar_t = ScalarType
 

Public Member Functions

 ScalarConstant (ScalarType v=0.)
 
virtual ~ScalarConstant ()
 
template<typename ContextType , typename ScalarFieldType >
ScalarType derivative (ContextType &c, const ScalarFieldType &f) const
 
template<typename ContextType , typename ScalarFieldType >
void derivative (ContextType &c, const ScalarFieldType &f, ScalarType &v) const
 
ScalarType & operator() ()
 
ScalarType operator() () const
 
ScalarType & operator= (const ScalarType &v)
 
template<typename ContextType >
ScalarType value (ContextType &c) const
 
template<typename ContextType >
void value (ContextType &c, ScalarType &v) const
 

Private Attributes

ScalarType _v
 

Member Typedef Documentation

◆ scalar_t

template<typename ScalarType >
using MAST::Base::ScalarConstant< ScalarType >::scalar_t = ScalarType

Definition at line 31 of file scalar_constant.hpp.

Constructor & Destructor Documentation

◆ ScalarConstant()

template<typename ScalarType >
MAST::Base::ScalarConstant< ScalarType >::ScalarConstant ( ScalarType  v = 0.)
inline

Definition at line 33 of file scalar_constant.hpp.

33  :
34  _v (v)
35  { }

◆ ~ScalarConstant()

template<typename ScalarType >
virtual MAST::Base::ScalarConstant< ScalarType >::~ScalarConstant ( )
inlinevirtual

Definition at line 37 of file scalar_constant.hpp.

37 {}

Member Function Documentation

◆ derivative() [1/2]

template<typename ScalarType >
template<typename ContextType , typename ScalarFieldType >
ScalarType MAST::Base::ScalarConstant< ScalarType >::derivative ( ContextType &  c,
const ScalarFieldType &  f 
) const
inline

Definition at line 63 of file scalar_constant.hpp.

64  {
65  return &f==this?1.:0.;
66  }

◆ derivative() [2/2]

template<typename ScalarType >
template<typename ContextType , typename ScalarFieldType >
void MAST::Base::ScalarConstant< ScalarType >::derivative ( ContextType &  c,
const ScalarFieldType &  f,
ScalarType &  v 
) const
inline

Definition at line 69 of file scalar_constant.hpp.

71  {
72  v = &f==this?1.:0.;
73  }

◆ operator()() [1/2]

template<typename ScalarType >
ScalarType& MAST::Base::ScalarConstant< ScalarType >::operator() ( )
inline

Definition at line 44 of file scalar_constant.hpp.

44  {
45  return _v;
46  }

◆ operator()() [2/2]

template<typename ScalarType >
ScalarType MAST::Base::ScalarConstant< ScalarType >::operator() ( ) const
inline

Definition at line 48 of file scalar_constant.hpp.

48  {
49  return _v;
50  }

◆ operator=()

template<typename ScalarType >
ScalarType& MAST::Base::ScalarConstant< ScalarType >::operator= ( const ScalarType &  v)
inline

Definition at line 39 of file scalar_constant.hpp.

39  {
40  _v = v;
41  return _v;
42  }

◆ value() [1/2]

template<typename ScalarType >
template<typename ContextType >
ScalarType MAST::Base::ScalarConstant< ScalarType >::value ( ContextType &  c) const
inline

Definition at line 53 of file scalar_constant.hpp.

53  {
54  return _v;
55  }

◆ value() [2/2]

template<typename ScalarType >
template<typename ContextType >
void MAST::Base::ScalarConstant< ScalarType >::value ( ContextType &  c,
ScalarType &  v 
) const
inline

Definition at line 58 of file scalar_constant.hpp.

58  {
59  v = _v;
60  }

Member Data Documentation

◆ _v

template<typename ScalarType >
ScalarType MAST::Base::ScalarConstant< ScalarType >::_v
private

Definition at line 77 of file scalar_constant.hpp.


The documentation for this class was generated from the following file: