Minsky
minsky::TensorVarVal Struct Reference

#include <minskyTensorOps.h>

Inheritance diagram for minsky::TensorVarVal:
Inheritance graph
Collaboration diagram for minsky::TensorVarVal:
Collaboration graph

Public Member Functions

 TensorVarVal (const std::shared_ptr< VariableValue > &vv, const shared_ptr< EvalCommon > &ev)
 
const Index & index (Index &&x) override
 
const Index & index () const override
 
const Hypercube & hypercube (const Hypercube &hc) override
 
const Hypercube & hypercube (Hypercube &&hc) override
 
const Hypercube & hypercube () const override
 
double & operator[] (std::size_t i) override
 
TensorVarValoperator= (const ITensor &t) override
 
- Public Member Functions inherited from minsky::TensorVarValBase< VariableValue, ITensorVal >
int idx () const
 
ITensor::Timestamp timestamp () const override
 
double operator[] (std::size_t i) const override
 
 TensorVarValBase (const std::shared_ptr< VariableValue > &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...
 

Additional Inherited Members

- Public Attributes inherited from minsky::TensorVarValBase< VariableValue, ITensorVal >
std::shared_ptr< VariableValuevalue
 
shared_ptr< EvalCommonev
 reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo More...
 

Detailed Description

Definition at line 125 of file minskyTensorOps.h.

Constructor & Destructor Documentation

◆ TensorVarVal()

minsky::TensorVarVal::TensorVarVal ( const std::shared_ptr< VariableValue > &  vv,
const shared_ptr< EvalCommon > &  ev 
)
inline

Definition at line 127 of file minskyTensorOps.h.

127  :
128  TensorVarValBase<VariableValue,ITensorVal>(vv,ev) {}
shared_ptr< EvalCommon > ev
reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo

Member Function Documentation

◆ hypercube() [1/3]

const Hypercube& minsky::TensorVarVal::hypercube ( const Hypercube &  hc)
inlineoverride

Definition at line 132 of file minskyTensorOps.h.

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

132 {return value->hypercube(hc);}
Here is the caller graph for this function:

◆ hypercube() [2/3]

const Hypercube& minsky::TensorVarVal::hypercube ( Hypercube &&  hc)
inlineoverride

Definition at line 133 of file minskyTensorOps.h.

133 {return value->hypercube(std::move(hc));}

◆ hypercube() [3/3]

const Hypercube& minsky::TensorVarVal::hypercube ( ) const
inlineoverride

Definition at line 134 of file minskyTensorOps.h.

134 {return value->hypercube();}

◆ index() [1/2]

const Index& minsky::TensorVarVal::index ( Index &&  x)
inlineoverride

Definition at line 130 of file minskyTensorOps.h.

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

130 {return value->index(std::move(x));}
Here is the caller graph for this function:

◆ index() [2/2]

const Index& minsky::TensorVarVal::index ( ) const
inlineoverride

Definition at line 131 of file minskyTensorOps.h.

131 {return value->index();}

◆ operator=()

TensorVarVal& minsky::TensorVarVal::operator= ( const ITensor t)
inlineoverride

Definition at line 144 of file minskyTensorOps.h.

References civita::ITensor::hypercube(), and civita::ITensor::index().

144  {
145  index(t.index());
146  hypercube(t.hypercube());
147  for (size_t i=0; i<size(); ++i)
148  operator[](i)=t[i];
149  // update timestamp
150  ev->update(ev->flowVars(), ev->fvSize(), ev->stockVars());
151  return *this;
152  }
shared_ptr< EvalCommon > ev
reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo
virtual const Hypercube & hypercube() const
information describing the axes, types and labels of this tensor
virtual const Index & index() const
the index vector - assumed to be ordered and unique
const Index & index() const override
const Hypercube & hypercube() const override
Here is the call graph for this function:

◆ operator[]()

double& minsky::TensorVarVal::operator[] ( std::size_t  i)
inlineoverride

Definition at line 136 of file minskyTensorOps.h.

References minsky::ValueVector::flowVars.

136  {
137  assert(value->isFlowVar());
138  assert(
139  (ev->flowVars()==ValueVector::flowVars.data() &&
140  value->idx()+i<ValueVector::flowVars.size())
141  || value->idx()+i<ev->fvSize());
142  return ev->flowVars()[value->idx()+i];
143  }
shared_ptr< EvalCommon > ev
reference to EvalOpVector owning this value, to extract flowVar and stockVarinfo
static std::vector< double, CIVITA_ALLOCATOR< double > > flowVars
variables defined as a simple function of the stock variables, also known as lhs variables. These variables appear in the body of the Godley table

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