encoding

package
v0.9.18 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UndefinedCluster ...
	UndefinedCluster = NewGroup("UndefinedCluster")
	// ExprGraphCluster is the default cluster
	ExprGraphCluster = NewGroup("ExprGraphCluster ")
	// ConstantCluster is the group of nodes that represents constants
	ConstantCluster = NewGroup("Constants ")
	// InputCluster is the group of nodes that are expecting values
	InputCluster = NewGroup("Inputs ")
	// GradientCluster ...
	GradientCluster = NewGroup("Gradients ")
	// StrayCluster ...
	StrayCluster = NewGroup("Undifferentiated nodes ")
)

Functions

This section is empty.

Types

type ByName added in v0.9.11

type ByName []Group

ByName is a sorting for a slice of groups, where the groups are sorted by name

func (ByName) Len added in v0.9.11

func (g ByName) Len() int

func (ByName) Less added in v0.9.11

func (g ByName) Less(i, j int) bool

func (ByName) Swap added in v0.9.11

func (g ByName) Swap(i, j int)

type Group

type Group struct {
	ID        int
	IsPrimary bool
	Name      string
}

Group represent a cluster of elements

func NewGroup

func NewGroup(name string) Group

NewGroup creates a new group with a generated ID

type Grouper

type Grouper interface {
	Groups() Groups
}

Grouper is any object that can claim itself as being part of a group

type Groups

type Groups []Group

Groups is a bag of groups

func (Groups) Have

func (g Groups) Have(grp Group) bool

Have returns true if GroupID is in groups

func (Groups) Len added in v0.9.11

func (g Groups) Len() int

Len returns the length of a bag of groups

func (Groups) Less added in v0.9.11

func (g Groups) Less(i, j int) bool

Less checks if an ID is less than or not

func (Groups) Swap added in v0.9.11

func (g Groups) Swap(i, j int)

Swap swaps the elements

func (Groups) Upsert

func (g Groups) Upsert(grp Group) Groups

Upsert the GroupID in the groups

Jump to

Keyboard shortcuts

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