Macaulay2 Engine
Loading...
Searching...
No Matches
SLProgram Class Reference

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_TYPEmNodes
std::vector< GATE_SIZEmNumInputs
std::vector< GATE_POSITIONmInputPositions
std::vector< GATE_POSITIONmOutputPositions
int inputCounter

Detailed Description

A straight-line program: a directed acyclic graph of arithmetic gates over a fixed list of inputs and constants.

Note
AI-generated documentation. Verify against the source before relying on it.

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.


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