|
Macaulay2 Engine
|
A straight-line program: a directed acyclic graph of arithmetic gates over a fixed list of inputs and constants. More...
#include <SLP-defs.hpp>
Public Types | |
| enum | GATE_TYPE { Copy , MCopy , Sum , Product , MSum , MProduct , Det , Divide } |
| typedef int | GATE_SIZE |
| typedef int | GATE_POSITION |
Public Member Functions | |
| SLProgram () | |
| virtual | ~SLProgram () |
| GATE_POSITION | addInput () |
| GATE_POSITION | addMSum (const M2_arrayint) |
| GATE_POSITION | addMProduct (const M2_arrayint) |
| GATE_POSITION | addDet (const M2_arrayint) |
| GATE_POSITION | addDivide (const M2_arrayint) |
| void | setOutputPositions (const M2_arrayint) |
| void | text_out (buffer &) const |
Public Attributes | |
| std::vector< GATE_TYPE > | mNodes |
| std::vector< GATE_SIZE > | mNumInputs |
| std::vector< GATE_POSITION > | mInputPositions |
| std::vector< GATE_POSITION > | mOutputPositions |
| int | inputCounter |
A straight-line program: a directed acyclic graph of arithmetic gates over a fixed list of inputs and constants.
The DAG topology is stored in four parallel vectors (mNodes, mNumInputs, mInputPositions, mOutputPositions) that wire each gate to its operand positions. Gate kinds are listed in GATE_TYPE (Copy, MCopy, Sum, Product, MSum, MProduct, Det, Divide). Positions are relative non-negative indices into mNodes for gate references and negative indices for variables and constants, except in mOutputPositions which uses absolute indices. Evaluation against a concrete coefficient ring lives in SLEvaluatorConcrete<RT>.
Definition at line 88 of file SLP-defs.hpp.