Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize > Class Template Reference

Represents a function evaluation and its derivatives w.r.t. a run-time specified set of variables. More...

#include <DynamicEvaluation.hpp>

Public Types

typedef ValueT ValueType
 field type More...
 

Public Member Functions

int size () const
 number of derivatives More...
 
 Evaluation ()
 default constructor More...
 
 Evaluation (const Evaluation &other)=default
 copy other function evaluation More...
 
 Evaluation (Evaluation &&other)
 
Evaluationoperator= (Evaluation &&other)
 move assignment More...
 
 Evaluation (int numDerivatives)
 
template<class RhsValueType >
 Evaluation (int numDerivatives, const RhsValueType &c)
 
template<class RhsValueType >
 Evaluation (int nVars, const RhsValueType &c, int varPos)
 
void clearDerivatives ()
 
void print (std::ostream &os=std::cout) const
 
void copyDerivatives (const Evaluation &other)
 
Evaluationoperator+= (const Evaluation &other)
 
template<class RhsValueType >
Evaluationoperator+= (const RhsValueType &other)
 
Evaluationoperator-= (const Evaluation &other)
 
template<class RhsValueType >
Evaluationoperator-= (const RhsValueType &other)
 
Evaluationoperator*= (const Evaluation &other)
 
template<class RhsValueType >
Evaluationoperator*= (const RhsValueType &other)
 
Evaluationoperator/= (const Evaluation &other)
 
template<class RhsValueType >
Evaluationoperator/= (const RhsValueType &other)
 
Evaluation operator+ (const Evaluation &other) const
 
template<class RhsValueType >
Evaluation operator+ (const RhsValueType &other) const
 
Evaluation operator- (const Evaluation &other) const
 
template<class RhsValueType >
Evaluation operator- (const RhsValueType &other) const
 
Evaluation operator- () const
 
Evaluation operator* (const Evaluation &other) const
 
template<class RhsValueType >
Evaluation operator* (const RhsValueType &other) const
 
Evaluation operator/ (const Evaluation &other) const
 
template<class RhsValueType >
Evaluation operator/ (const RhsValueType &other) const
 
template<class RhsValueType >
Evaluationoperator= (const RhsValueType &other)
 
Evaluationoperator= (const Evaluation &other)=default
 
template<class RhsValueType >
bool operator== (const RhsValueType &other) const
 
bool operator== (const Evaluation &other) const
 
bool operator!= (const Evaluation &other) const
 
template<class RhsValueType >
bool operator!= (const RhsValueType &other) const
 
template<class RhsValueType >
bool operator> (RhsValueType other) const
 
bool operator> (const Evaluation &other) const
 
template<class RhsValueType >
bool operator< (RhsValueType other) const
 
bool operator< (const Evaluation &other) const
 
template<class RhsValueType >
bool operator>= (RhsValueType other) const
 
bool operator>= (const Evaluation &other) const
 
template<class RhsValueType >
bool operator<= (RhsValueType other) const
 
bool operator<= (const Evaluation &other) const
 
const ValueTypevalue () const
 
template<class RhsValueType >
void setValue (const RhsValueType &val)
 
const ValueTypederivative (int varIdx) const
 
void setDerivative (int varIdx, const ValueType &derVal)
 

Static Public Member Functions

static Evaluation createBlank (const Evaluation &x)
 
static Evaluation createConstantZero (const Evaluation &x)
 
static Evaluation createConstantOne (const Evaluation &x)
 
template<class RhsValueType >
static Evaluation createVariable (const RhsValueType &, int)
 
template<class RhsValueType >
static Evaluation createVariable (int nVars, const RhsValueType &value, int varPos)
 
template<class RhsValueType >
static Evaluation createVariable (const Evaluation &x, const RhsValueType &value, int varPos)
 
template<class RhsValueType >
static Evaluation createConstant (int nVars, const RhsValueType &value)
 
template<class RhsValueType >
static Evaluation createConstant (const RhsValueType &)
 
template<class RhsValueType >
static Evaluation createConstant (const Evaluation &x, const RhsValueType &value)
 

Static Public Attributes

static const int numVars = DynamicSize
 

Protected Member Functions

int length_ () const
 length of internal data vector More...
 
constexpr int valuepos_ () const
 position index for value More...
 
constexpr int dstart_ () const
 start index for derivatives More...
 
int dend_ () const
 end+1 index for derivatives More...
 
void checkDefined_ () const
 

Detailed Description

template<class ValueT, unsigned staticSize>
class Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >

Represents a function evaluation and its derivatives w.r.t. a run-time specified set of variables.

Member Typedef Documentation

◆ ValueType

template<class ValueT , unsigned staticSize>
typedef ValueT Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::ValueType

field type

Constructor & Destructor Documentation

◆ Evaluation() [1/6]

template<class ValueT , unsigned staticSize>
Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::Evaluation ( )
inline

default constructor

◆ Evaluation() [2/6]

template<class ValueT , unsigned staticSize>
Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::Evaluation ( const Evaluation< ValueT, DynamicSize, staticSize > &  other)
default

copy other function evaluation

◆ Evaluation() [3/6]

template<class ValueT , unsigned staticSize>
Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::Evaluation ( Evaluation< ValueT, DynamicSize, staticSize > &&  other)
inline

move other function evaluation (this only makes sense for dynamically allocated Evaluations)

◆ Evaluation() [4/6]

template<class ValueT , unsigned staticSize>
Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::Evaluation ( int  numDerivatives)
inlineexplicit

◆ Evaluation() [5/6]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::Evaluation ( int  numDerivatives,
const RhsValueType &  c 
)
inline

◆ Evaluation() [6/6]

Member Function Documentation

◆ checkDefined_()

template<class ValueT , unsigned staticSize>
void Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::checkDefined_ ( ) const
inlineprotected

instruct valgrind to check that the value and all derivatives of the Evaluation object are well-defined.

References Opm::Valgrind::CheckDefined(), Opm::DenseAd::Evaluation< ValueT, numDerivs, staticSize >::dend_(), and Opm::DenseAd::Evaluation< ValueT, numDerivs, staticSize >::dstart_().

◆ clearDerivatives()

template<class ValueT , unsigned staticSize>
void Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::clearDerivatives ( )
inline

◆ copyDerivatives()

◆ createBlank()

template<class ValueT , unsigned staticSize>
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createBlank ( const Evaluation< ValueT, DynamicSize, staticSize > &  x)
inlinestatic

◆ createConstant() [1/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createConstant ( const Evaluation< ValueT, DynamicSize, staticSize > &  x,
const RhsValueType &  value 
)
inlinestatic

◆ createConstant() [2/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createConstant ( const RhsValueType &  )
inlinestatic

◆ createConstant() [3/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createConstant ( int  nVars,
const RhsValueType &  value 
)
inlinestatic

◆ createConstantOne()

template<class ValueT , unsigned staticSize>
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createConstantOne ( const Evaluation< ValueT, DynamicSize, staticSize > &  x)
inlinestatic

◆ createConstantZero()

template<class ValueT , unsigned staticSize>
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createConstantZero ( const Evaluation< ValueT, DynamicSize, staticSize > &  x)
inlinestatic

◆ createVariable() [1/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createVariable ( const Evaluation< ValueT, DynamicSize, staticSize > &  x,
const RhsValueType &  value,
int  varPos 
)
inlinestatic

◆ createVariable() [2/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createVariable ( const RhsValueType &  ,
int   
)
inlinestatic

◆ createVariable() [3/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
static Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::createVariable ( int  nVars,
const RhsValueType &  value,
int  varPos 
)
inlinestatic

◆ dend_()

template<class ValueT , unsigned staticSize>
int Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::dend_ ( ) const
inlineprotected

◆ derivative()

template<class ValueT , unsigned staticSize>
const ValueType & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::derivative ( int  varIdx) const
inline

◆ dstart_()

template<class ValueT , unsigned staticSize>
constexpr int Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::dstart_ ( ) const
inlineconstexprprotected

start index for derivatives

◆ length_()

template<class ValueT , unsigned staticSize>
int Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::length_ ( ) const
inlineprotected

length of internal data vector

◆ operator!=() [1/2]

template<class ValueT , unsigned staticSize>
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator!= ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator!=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator!= ( const RhsValueType &  other) const
inline

◆ operator*() [1/2]

template<class ValueT , unsigned staticSize>
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator* ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator*() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator* ( const RhsValueType &  other) const
inline

◆ operator*=() [1/2]

◆ operator*=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator*= ( const RhsValueType &  other)
inline

◆ operator+() [1/2]

template<class ValueT , unsigned staticSize>
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator+ ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator+() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator+ ( const RhsValueType &  other) const
inline

◆ operator+=() [1/2]

template<class ValueT , unsigned staticSize>
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator+= ( const Evaluation< ValueT, DynamicSize, staticSize > &  other)
inline

◆ operator+=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator+= ( const RhsValueType &  other)
inline

◆ operator-() [1/3]

template<class ValueT , unsigned staticSize>
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator- ( ) const
inline

◆ operator-() [2/3]

template<class ValueT , unsigned staticSize>
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator- ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator-() [3/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator- ( const RhsValueType &  other) const
inline

◆ operator-=() [1/2]

template<class ValueT , unsigned staticSize>
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator-= ( const Evaluation< ValueT, DynamicSize, staticSize > &  other)
inline

◆ operator-=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator-= ( const RhsValueType &  other)
inline

◆ operator/() [1/2]

template<class ValueT , unsigned staticSize>
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator/ ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator/() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator/ ( const RhsValueType &  other) const
inline

◆ operator/=() [1/2]

◆ operator/=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator/= ( const RhsValueType &  other)
inline

◆ operator<() [1/2]

template<class ValueT , unsigned staticSize>
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator< ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator<() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator< ( RhsValueType  other) const
inline

◆ operator<=() [1/2]

template<class ValueT , unsigned staticSize>
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator<= ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator<=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator<= ( RhsValueType  other) const
inline

◆ operator=() [1/3]

template<class ValueT , unsigned staticSize>
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator= ( const Evaluation< ValueT, DynamicSize, staticSize > &  other)
default

◆ operator=() [2/3]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator= ( const RhsValueType &  other)
inline

◆ operator=() [3/3]

template<class ValueT , unsigned staticSize>
Evaluation & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator= ( Evaluation< ValueT, DynamicSize, staticSize > &&  other)
inline

move assignment

◆ operator==() [1/2]

template<class ValueT , unsigned staticSize>
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator== ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator==() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator== ( const RhsValueType &  other) const
inline

◆ operator>() [1/2]

template<class ValueT , unsigned staticSize>
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator> ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator>() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator> ( RhsValueType  other) const
inline

◆ operator>=() [1/2]

template<class ValueT , unsigned staticSize>
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator>= ( const Evaluation< ValueT, DynamicSize, staticSize > &  other) const
inline

◆ operator>=() [2/2]

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
bool Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::operator>= ( RhsValueType  other) const
inline

◆ print()

◆ setDerivative()

template<class ValueT , unsigned staticSize>
void Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::setDerivative ( int  varIdx,
const ValueType derVal 
)
inline

◆ setValue()

template<class ValueT , unsigned staticSize>
template<class RhsValueType >
void Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::setValue ( const RhsValueType &  val)
inline

◆ size()

template<class ValueT , unsigned staticSize>
int Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::size ( ) const
inline

number of derivatives

◆ value()

template<class ValueT , unsigned staticSize>
const ValueType & Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::value ( ) const
inline

◆ valuepos_()

template<class ValueT , unsigned staticSize>
constexpr int Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::valuepos_ ( ) const
inlineconstexprprotected

position index for value

Member Data Documentation

◆ numVars

template<class ValueT , unsigned staticSize>
const int Opm::DenseAd::Evaluation< ValueT, DynamicSize, staticSize >::numVars = DynamicSize
static

the template argument which specifies the number of derivatives (-1 == "DynamicSize" means runtime determined)


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