Macaulay2 » Documentation
Packages » SLPexpressions :: Gate
next | previous | forward | backward | up | index | toc

Gate -- node types for straight-line programs

Description

Expressions in an SLP are represented by directed acyclic graphs whose nodes are instances of subclasses of Gate.

These gates are assembled into GateMatrix objects and eventually compiled into straight-line programs.

i1 : declareVariable \ {x,y}

o1 = {x, y}

o1 : List
i2 : f = (x+2*y)^2/(3*x-y)

     ((x + (2 * y)) * (x + (2 * y)))
o2 = -------------------------------
           ((3 * x) + (-1 * y))

o2 : DivideGate
i3 : class f

o3 = DivideGate

o3 : Type
i4 : support f

o4 = {x, y}

o4 : List
i5 : constants f -- shows all constants used in the expression.

o5 = {2, 3, -1}

o5 : List

Types of Gate:

  • DetGate
  • DivideGate
  • InputGate
  • ProductGate
  • SumGate

Methods that use an object of class Gate:

For the programmer

The object Gate is a type, with ancestor classes HashTable < Thing.


The source of this document is in /build/reproducible-path/macaulay2-1.26.06+ds/M2/Macaulay2/packages/SLPexpressions/doc.m2:64:0.