Minsky
minsky::TensorVarValBase< VV, I > Struct Template Reference

#include <minskyTensorOps.h>

Inheritance diagram for minsky::TensorVarValBase< VV, I >:
Inheritance graph
Collaboration diagram for minsky::TensorVarValBase< VV, I >:
Collaboration graph

Public Member Functions

int idx () const
 
ITensor::Timestamp timestamp () const override
 
double operator[] (std::size_t i) const override
 
 TensorVarValBase (const std::shared_ptr< VV > &vv, const shared_ptr< EvalCommon > &ev)
 
const Hypercube & hypercube () const override
 
const Index & index () const override
 
std::size_t size () const override
 
double dFlow (std::size_t ti, std::size_t fi) const override
 partial derivative of tensor component ti wrt flow variable fi More...
 
double dStock (std::size_t ti, std::size_t si) const override
 partial derivative of tensor component ti wrt stock variable si More...
 

Public Attributes

std::shared_ptr< VV > value
 
shared_ptr< EvalCommonev
 reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo More...
 

Detailed Description

template<class VV = const VariableValue, class I = ITensor>
struct minsky::TensorVarValBase< VV, I >

Definition at line 96 of file minskyTensorOps.h.

Constructor & Destructor Documentation

◆ TensorVarValBase()

template<class VV = const VariableValue, class I = ITensor>
minsky::TensorVarValBase< VV, I >::TensorVarValBase ( const std::shared_ptr< VV > &  vv,
const shared_ptr< EvalCommon > &  ev 
)
inline

Definition at line 110 of file minskyTensorOps.h.

110  :
111  value(vv), ev(ev) {}
shared_ptr< EvalCommon > ev
reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo
std::shared_ptr< VV > value

Member Function Documentation

◆ dFlow()

template<class VV = const VariableValue, class I = ITensor>
double minsky::TensorVarValBase< VV, I >::dFlow ( std::size_t  ti,
std::size_t  fi 
) const
inlineoverridevirtual

partial derivative of tensor component ti wrt flow variable fi

Implements minsky::DerivativeMixin.

Definition at line 117 of file minskyTensorOps.h.

118  {return value->isFlowVar() && fi==ti+value->idx();}
std::shared_ptr< VV > value

◆ dStock()

template<class VV = const VariableValue, class I = ITensor>
double minsky::TensorVarValBase< VV, I >::dStock ( std::size_t  ti,
std::size_t  si 
) const
inlineoverridevirtual

partial derivative of tensor component ti wrt stock variable si

Implements minsky::DerivativeMixin.

Definition at line 119 of file minskyTensorOps.h.

120  {return !value->isFlowVar() && si==ti+value->idx();}
std::shared_ptr< VV > value

◆ hypercube()

template<class VV = const VariableValue, class I = ITensor>
const Hypercube& minsky::TensorVarValBase< VV, I >::hypercube ( ) const
inlineoverride

Definition at line 112 of file minskyTensorOps.h.

112 {return value->hypercube();}
std::shared_ptr< VV > value

◆ idx()

template<class VV = const VariableValue, class I = ITensor>
int minsky::TensorVarValBase< VV, I >::idx ( ) const
inline

Definition at line 103 of file minskyTensorOps.h.

Referenced by minsky::TensorEval::deriv(), minsky::TensorEval::eval(), and minsky::TensorEval::TensorEval().

103 {return value->idx();}
std::shared_ptr< VV > value
Here is the caller graph for this function:

◆ index()

template<class VV = const VariableValue, class I = ITensor>
const Index& minsky::TensorVarValBase< VV, I >::index ( ) const
inlineoverride

Definition at line 113 of file minskyTensorOps.h.

113 {return value->index();}
std::shared_ptr< VV > value

◆ operator[]()

template<class VV = const VariableValue, class I = ITensor>
double minsky::TensorVarValBase< VV, I >::operator[] ( std::size_t  i) const
inlineoverride

Definition at line 107 of file minskyTensorOps.h.

107  {
108  return value->isFlowVar()? ev->flowVars()[value->idx()+i]: ev->stockVars()[value->idx()+i];
109  }
shared_ptr< EvalCommon > ev
reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo
std::shared_ptr< VV > value

◆ size()

template<class VV = const VariableValue, class I = ITensor>
std::size_t minsky::TensorVarValBase< VV, I >::size ( ) const
inlineoverride

Definition at line 115 of file minskyTensorOps.h.

Referenced by minsky::TensorEval::deriv(), minsky::TensorEval::eval(), and minsky::TensorEval::TensorEval().

115 {return value->size();}
std::shared_ptr< VV > value
Here is the caller graph for this function:

◆ timestamp()

template<class VV = const VariableValue, class I = ITensor>
ITensor::Timestamp minsky::TensorVarValBase< VV, I >::timestamp ( ) const
inlineoverride

Definition at line 106 of file minskyTensorOps.h.

106 {return ev->timestamp();}
shared_ptr< EvalCommon > ev
reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo

Member Data Documentation

◆ ev

template<class VV = const VariableValue, class I = ITensor>
shared_ptr<EvalCommon> minsky::TensorVarValBase< VV, I >::ev

reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo

Definition at line 101 of file minskyTensorOps.h.

Referenced by minsky::TensorEval::deriv(), minsky::TensorEval::eval(), and minsky::TensorEval::TensorEval().

◆ value

template<class VV = const VariableValue, class I = ITensor>
std::shared_ptr<VV> minsky::TensorVarValBase< VV, I >::value

Definition at line 98 of file minskyTensorOps.h.


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