Minsky
minsky::EvalOpPtr Struct Reference

#include <evalOp.h>

Inheritance diagram for minsky::EvalOpPtr:
Inheritance graph
Collaboration diagram for minsky::EvalOpPtr:
Collaboration graph

Public Member Functions

 EvalOpPtr ()
 
 EvalOpPtr (EvalOpBase *e)
 
 EvalOpPtr (OperationType::Type op)
 
 EvalOpPtr (OperationType::Type op, const ItemPtr &state, const std::shared_ptr< VariableValue > &to, const VariableValue &from1={}, const VariableValue &from2={})
 to cannot be null More...
 

Additional Inherited Members

- Public Types inherited from minsky::OperationType
enum  Type {
  constant, time, integrate, differentiate,
  data, ravel, euler, pi,
  zero, one, inf, percent,
  add, subtract, multiply, divide,
  min, max, and_, or_,
  log, pow, polygamma, lt,
  le, eq, userFunction, copy,
  sqrt, exp, ln, sin,
  cos, tan, asin, acos,
  atan, sinh, cosh, tanh,
  abs, floor, frac, not_,
  Gamma, fact, sum, product,
  infimum, supremum, any, all,
  infIndex, supIndex, runningSum, runningProduct,
  difference, differencePlus, innerProduct, outerProduct,
  index, gather, meld, merge,
  slice, size, shape, mean,
  median, stdDev, moment, histogram,
  covariance, correlation, linearRegression, numOps
}
 
enum  Group {
  general, constop, binop, function,
  reduction, scan, tensor, statistics
}
 
- Static Public Member Functions inherited from minsky::OperationType
static std::string typeName (int type)
 return the symbolic name of type More...
 
static Group classify (Type t)
 

Detailed Description

Definition at line 155 of file evalOp.h.

Constructor & Destructor Documentation

◆ EvalOpPtr() [1/4]

minsky::EvalOpPtr::EvalOpPtr ( )
inline

Definition at line 158 of file evalOp.h.

158 {}

◆ EvalOpPtr() [2/4]

minsky::EvalOpPtr::EvalOpPtr ( EvalOpBase e)
inline

Definition at line 159 of file evalOp.h.

159 : classdesc::shared_ptr<EvalOpBase>(e) {}

◆ EvalOpPtr() [3/4]

minsky::EvalOpPtr::EvalOpPtr ( OperationType::Type  op)
inline

Definition at line 160 of file evalOp.h.

160  :
161  classdesc::shared_ptr<EvalOpBase>(ScalarEvalOp::create(op,nullptr)) {}
static ScalarEvalOp * create(Type op, const ItemPtr &state)
factory method
Definition: evalOp.cc:617

◆ EvalOpPtr() [4/4]

minsky::EvalOpPtr::EvalOpPtr ( OperationType::Type  op,
const ItemPtr state,
const std::shared_ptr< VariableValue > &  to,
const VariableValue from1 = {},
const VariableValue from2 = {} 
)

to cannot be null

Definition at line 650 of file evalOp.cc.

References f, minsky::VariableValue::idx(), minsky::VariableValue::isFlowVar(), minsky::op, and reset().

653  {
654  assert(to);
655  auto t=ScalarEvalOp::create(op,state);
656  t->result=to;
657  reset(t);
658  assert(t->numArgs()==0 || (from1.idx()>=0 && (t->numArgs()==1 || from2.idx()>=0)));
659 
660  if (auto f=dynamic_cast<UserFunction*>(state.get()))
661  f->compile();
662 
663  if (t->numArgs()>0)
664  t->in1.push_back(from1.idx());
665  if (t->numArgs()>1)
666  t->in2.emplace_back(1,EvalOpBase::Support{1,unsigned(from2.idx())});
667 
668  if (to->idx()==-1) to->allocValue();
669  t->out=to->idx();
670  t->flow1=from1.isFlowVar();
671  t->flow2=from2.isFlowVar();
672 
673  }
function f
Definition: canvas.m:1
static ScalarEvalOp * create(Type op, const ItemPtr &state)
factory method
Definition: evalOp.cc:617
reset
Definition: minsky.tcl:1325
Here is the call graph for this function:

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