Symbols#

Symbols are a model’s decision variables, intermediate variables, constants, and mathematical operations.

Model Symbols#

Some of the methods for these symbols (e.g., file operations) are intended mostly for package developers.

Absolute

Absolute value element-wise on a symbol.

Add

Addition element-wise of two symbols.

All

Tests whether all elements evaluate to True.

And

Boolean AND element-wise between two symbols.

AdvancedIndexing

Advanced indexing.

BasicIndexing

Basic indexing.

BinaryVariable

Binary decision-variable symbol.

Constant

Constant symbol.

DisjointBitSets

Disjoint-sets decision-variable symbol.

DisjointBitSet

Disjoint-sets successor symbol.

DisjointLists

Disjoint-lists decision-variable symbol.

DisjointList

Disjoint-lists successor symbol.

Equal

Equality comparison element-wise between two symbols.

IntegerVariable

Integer decision-variable symbol.

LessEqual

Smaller-or-equal comparison element-wise between two symbols.

ListVariable

List decision-variable symbol.

Max

Maximum value in the elements of a symbol.

Maximum

Maximum values in an element-wise comparison of two symbols.

Min

Minimum value in the elements of a symbol.

Minimum

Minimum values in an element-wise comparison of two symbols.

Multiply

Multiplication element-wise between two symbols.

NaryAdd

Addition element-wise of N symbols.

NaryMaximum

Maximum values in an element-wise comparison of N symbols.

NaryMinimum

Minimum values in an element-wise comparison of N symbols.

NaryMultiply

Multiplication element-wise between N symbols.

Negative

Numerical negative element-wise on a symbol.

Or

Boolean OR element-wise between two symbols.

Permutation

Permutation of the elements of a symbol.

Prod

Product of the elements of a symbol.

QuadraticModel

Quadratic model.

Reshape

Reshaped symbol.

Subtract

Subtraction element-wise of two symbols.

SetVariable

Set decision-variable symbol.

Square

Squares element-wise of a symbol.

Sum

Sum of the elements of a symbol.

Inherited Methods#

class ArraySymbol#

Base class for symbols that can be interpreted as an array.

The following ArraySymbol methods are inherited by the model symbols.

all()

Create an All symbol.

has_state([index])

Return the initialization status of the indexed state.

max()

Create a Max symbol.

maybe_equals(other)

Compare to another symbol.

min()

Create a Min symbol.

ndim()

Return the number of dimensions for a symbol.

prod()

Create a Prod symbol.

reshape(*shape)

Create a Reshape symbol.

sum()

Create a Sum symbol.

shape()

Return the shape of the symbol.

size()

Return the number of elements in the symbol.

state([index, copy])

Return the state of the node.

state_size()

Return an estimated byte-size of the state.

strides()

Return the stride length, in bytes, for traversing a symbol.

class Symbol#

Base class for symbols.

Each symbol corresponds to a node in the directed acyclic graph representing the problem.

The following Symbol methods are inherited by the ArraySymbol class and model symbols.

equals(other)

Compare whether two nodes are identical.

has_state([index])

Return the initialization status of the indexed state.

iter_predecessors()

Iterate over a node's predecessors in the model.

iter_successors()

Iterate over a node's successors in the model.

maybe_equals(other)

Compare to another node.

reset_state(index)

Reset the state of a node and any successor symbols.

shares_memory(other)

Determine if two symbols share memory.

state_size()

Return an estimated size, in bytes, of the node's state.

topological_index()

Topological index of the node.