Minsky
minsky::Derivative Class Reference

#include <operation.h>

Inheritance diagram for minsky::Derivative:
Inheritance graph
Collaboration diagram for minsky::Derivative:
Collaboration graph

Public Member Functions

Units units (bool) const override
 compute the dimensional units More...
 
- Public Member Functions inherited from minsky::Operation< OperationType::differentiate >
Type type () const override
 
void iconDraw (cairo_t *) const override
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *cairo) const
 visual representation of operation on the canvas More...
 
void iconDraw (cairo_t *) const
 visual representation of operation on the canvas More...
 
std::size_t numPorts () const override
 
 Operation ()
 
 Operation (const Operation &x)
 
 Operation (Operation &&x)
 
Operationoperator= (const Operation &x)
 
Operationoperator= (Operation &&x)
 
std::string classType () const override
 
- Public Member Functions inherited from minsky::ItemT< Operation< T >, OperationBase >
ItemTclone () const override
 
void TCL_obj (classdesc::TCL_obj_t &t, const std::string &d) override
 
void RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) override
 dummy template definition for use with gui executable More...
 
void RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) const override
 
void json_pack (classdesc::json_pack_t &j) const override
 
 ItemT ()=default
 
 ItemT (const ItemT &)=default
 
 ItemT (ItemT &&)=delete
 
ItemToperator= (const ItemT &)=default
 
ItemToperator= (ItemT &&)=delete
 
- Public Member Functions inherited from minsky::OperationBase
const OperationBaseoperationCast () const override
 
OperationBaseoperationCast () override
 
std::string portValues () const
 returns a list of values the ports currently have More...
 
bool multiWire () const
 
virtual void addPorts ()
 
void drawUserFunction (cairo_t *cairo) const
 
void draw (cairo_t *) const override
 draw this item into a cairo context More...
 
void resize (const LassoBox &b) override
 resize this item on the canvas More...
 
float scaleFactor () const override
 factor by which item has been resized More...
 
double value () const override
 current value of output port More...
 
std::vector< std::string > dimensions () const
 return dimension names of tensor object attached to input if binary op, then the union of dimension names is returned More...
 
Units units (bool check=false) const override
 compute the dimensional units More...
 
- Public Member Functions inherited from minsky::BottomRightResizerItem
bool onResizeHandle (float x, float y) const override
 
void drawResizeHandles (cairo_t *cairo) const override
 
virtual Point resizeHandleCoords () const
 returns coordinates of the resizer handle More...
 
- Public Member Functions inherited from minsky::Item
 Item ()
 
virtual std::weak_ptr< Portports (std::size_t i) const
 callback to be run when item deleted from group More...
 
std::size_t portsSize () const
 number of ports More...
 
float portX (std::size_t i)
 
float portY (std::size_t i)
 
virtual bool contains (float xx, float yy) const
 
bool contains (const Point &p) const
 
void updateBoundingBox () override
 
void throw_error (const std::string &) const
 mark item on canvas, then throw More...
 
virtual bool ioVar () const
 indicates this is a group I/O variable More...
 
double rotation () const
 
double rotation (const double &r)
 
std::pair< double, bool > rotationAsRadians () const
 return the rotation as radians, and whether rotation should have additional straight angle added for text that stays upright. More...
 
float iWidth () const
 
float iWidth (const float &w)
 
float iHeight () const
 
float iHeight (const float &h)
 
virtual void flip ()
 rotate icon though 180∘ More...
 
std::string id () const
 return an id uniquely identifying this item More...
 
virtual float x () const
 
virtual float y () const
 
virtual float zoomFactor () const
 
void ensureBBValid () const
 
float width () const
 
float height () const
 
virtual std::vector< Pointcorners () const
 
float left () const
 
float right () const
 
float top () const
 
float bottom () const
 
std::string bookmarkId () const
 Id of bookmark associated with this. More...
 
void adjustBookmark () const override
 adjust bookmark list to reflect current configuration More...
 
float resizeHandleSize () const
 resize handles should be at least a percentage if the icon size (#1025) More...
 
virtual bool inItem (float x, float y) const
 
virtual bool onItem (float x, float y) const
 returns true if (x,y) is on the icon More...
 
virtual void onMouseDown (float x, float y)
 respond to mouse down events More...
 
virtual void onMouseUp (float x, float y)
 respond to mouse up events More...
 
virtual bool onMouseMotion (float x, float y)
 respond to mouse motion events with button pressed More...
 
virtual bool onMouseOver (float x, float y)
 respond to mouse motion events (hover) without button pressed More...
 
virtual void onMouseLeave ()
 respond to mouse leave events (when mouse leaves item) More...
 
virtual bool onKeyPress (int keySym, const std::string &utf8, int state)
 respond to key press events More...
 
virtual void deleteAttachedWires ()
 delete all attached wires More...
 
virtual bool visible () const
 whether this item is visible on the canvas. More...
 
void moveTo (float x, float y)
 
virtual float scaleFactor (const float &sf)
 
void dummyDraw () const
 draw into a dummy cairo context, for purposes of calculating port positions More...
 
virtual void displayTooltip (cairo_t *, const std::string &) const
 display tooltip text, eg on mouseover More...
 
virtual void updateIcon (double t)
 update display after a step() More...
 
 Item (const Item &)=default
 
Itemoperator= (const Item &)=default
 
virtual ~Item ()
 
void drawPorts (cairo_t *cairo) const
 
virtual ClickType::Type clickType (float x, float y) const
 returns the clicktype given a mouse click at x, y. More...
 
virtual std::shared_ptr< PortclosestOutPort (float x, float y) const
 returns closest output port to x,y More...
 
virtual std::shared_ptr< PortclosestInPort (float x, float y) const
 
virtual std::shared_ptr< Itemselect (float x, float y) const
 returns the variable if point (x,y) is within a visible variable icon, null otherwise. More...
 
void RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) override
 runs the RESTProcess descriptor suitable for this type More...
 
void RESTProcess (classdesc::RESTProcess_t &rp, const std::string &d) const override
 
virtual void displayDelayedTooltip (float x, float y)
 enable extended tooltip help message appropriate for mouse at (x,y) More...
 
virtual void disableDelayedTooltip ()
 
virtual bool editorMode () const
 some items have an editor mode attribute More...
 
virtual void toggleEditorMode ()
 
Units checkUnits () const
 perform units consistency checks More...
 
ItemPtr itemPtrFromThis () const
 return a shared_ptr to this More...
 
virtual void destroyFrame ()
 destroy any popup windows associated with this More...
 
- Public Member Functions inherited from minsky::NoteBase
virtual std::string const & detailedText () const
 
virtual std::string const & detailedText (const std::string &x)
 
virtual std::string const & tooltip () const
 
virtual std::string const & tooltip (const std::string &x)
 
virtual ~NoteBase ()=default
 

Additional Inherited Members

- Public Types inherited from minsky::Operation< OperationType::differentiate >
typedef OperationType::Type Type
 
- Public Types inherited from minsky::OperationBase
typedef OperationType::Type Type
 
- 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::OperationBase
static OperationBasecreate (Type type)
 factory method. More...
 
- Static Public Member Functions inherited from minsky::Item
static void drawSelected (cairo_t *cairo)
 
- 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)
 
- Public Attributes inherited from minsky::OperationBase
double arg =1
 operation argument. For example, the offset used in a difference operator, or binsize in a binning op More...
 
std::string axis
 axis selector in tensor operations More...
 
- Public Attributes inherited from minsky::Item
float m_x =0
 
float m_y =0
 position in canvas, or within group More...
 
float m_sf =1
 scale factor of item on canvas, or within group More...
 
bool onResizeHandles =false
 set to true to indicate mouse is ovcaler resize handles More...
 
bool onBorder =false
 true to indicate mouse hovering over border More...
 
std::string deleteCallback
 
BoundingBox bb
 canvas bounding box. More...
 
- Public Attributes inherited from minsky::NoteBase
bool mouseFocus =false
 true if target of a mouseover More...
 
bool selected =false
 true if selected for cut, copy or group operation More...
 
bool bookmark =false
 Is this item also a bookmark? More...
 
- Static Public Attributes inherited from minsky::OperationBase
static constexpr float l =-8
 
static constexpr float h =12
 
static constexpr float r =12
 
- Protected Member Functions inherited from minsky::OperationBase
void setCachedText (cairo_t *, const std::string &, double) const
 check if cachedPango is up to date, and if not recreate More...
 
- Static Protected Member Functions inherited from minsky::Item
static void drawResizeHandle (cairo_t *cairo, double x, double y, double sf, double angle)
 
- Protected Attributes inherited from minsky::OperationBase
classdesc::Exclude< std::shared_ptr< ecolab::Pango > > cachedPango
 
- Protected Attributes inherited from minsky::Item
double m_width =10
 
double m_height =10
 
ItemPortVector m_ports
 
minsky::Item::MemoisedRotator memoisedRotator
 

Detailed Description

Definition at line 88 of file operation.h.

Member Function Documentation

◆ units()

Units minsky::Derivative::units ( bool  check) const
overridevirtual

compute the dimensional units

Parameters
check- if true, then perform consistency checks
Exceptions
ifcheck=true and dimensions inconsistent

Reimplemented from minsky::Item.

Definition at line 532 of file operation.cc.

References minsky::cminsky(), minsky::Units::normalise(), minsky::Simulation::timeUnit, and minsky::timeUnit.

532  {
533  Units r=m_ports[1]->units(check);
534  if (!cminsky().timeUnit.empty())
535  r[cminsky().timeUnit]--;
536  r.normalise();
537  return r;
538  }
std::string timeUnit
Definition: simulation.h:35
const Minsky & cminsky()
const version to help in const correctness
Definition: minsky.h:549
ItemPortVector m_ports
Definition: item.h:156
static constexpr float r
Definition: operationBase.h:58
UnitsExpressionWalker timeUnit
Here is the call graph for this function:

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