expr

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinearExpression

type LinearExpression []Term

func NewLinearExpression

func NewLinearExpression(vID int, cID constraint.Element) LinearExpression

NewLinearExpression helper to initialize a linear expression with one term

func (LinearExpression) Clone

func (LinearExpression) Equal

Equals returns true if both SORTED expressions are the same

pre conditions: l and o are sorted

func (LinearExpression) HashCode

func (l LinearExpression) HashCode() uint64

HashCode returns a fast-to-compute but NOT collision resistant hash code identifier for the linear expression

func (LinearExpression) Len

func (l LinearExpression) Len() int

Len return the length of the Variable (implements Sort interface)

func (LinearExpression) Less

func (l LinearExpression) Less(i, j int) bool

Less returns true if variableID for term at i is less than variableID for term at j (implements Sort interface)

func (LinearExpression) Swap

func (l LinearExpression) Swap(i, j int)

Swap swaps terms in the Variable (implements Sort interface)

type Term

type Term struct {
	VID   int
	Coeff constraint.Element
}

func NewTerm

func NewTerm(vID int, cID constraint.Element) Term

func (Term) HashCode

func (t Term) HashCode() uint64

func (*Term) SetCoeff

func (t *Term) SetCoeff(c constraint.Element)

func (Term) WireID

func (t Term) WireID() int

TODO @gbotrel make that return a uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL