compatible

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package compatible implements a wrapper around graph.Graph which is compatible with gonum/graph.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	// contains filtered or unexported fields
}

Edge implements gonum/graph.Edge.

Note that as this wrapper uses MustSink() and MustSource(), it may panic if From() or To() are called inappropriately.

func (*Edge) From

func (e *Edge) From() ggraph.Node

From implements gonum/graph.Edge.

func (*Edge) ReversedEdge

func (e *Edge) ReversedEdge() ggraph.Edge

ReversedEdge implements gonum/graph.Edge.

Note that edge reversal is not supported, because it would mutate the graph. Per the gonum/graph.Edge documentation, this simply returns the receiver unaltered.

func (*Edge) To

func (e *Edge) To() ggraph.Node

To implements gonum/graph.Edge.

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

Graph implements gonum/graph.Graph It is based on a backing instance of graph.Graph. Note that care is needed - leaving gonum with dangling references to graph nodes or edges may cause issues if they are later deleted. It is recommended that the underlying graph.Graph not be mutated during any gonum usage of the graph structure.

func NewGraph

func NewGraph(g *graph.Graph) *Graph

NewGraph instantiates a gonum/graph.Graph compatible graph from an existing graph.Graph instance.

func (*Graph) Edge

func (g *Graph) Edge(uid, vid int64) ggraph.Edge

Edge implements gonum/graph.Graph.

func (*Graph) EdgeBetween

func (g *Graph) EdgeBetween(xid, yid int64) ggraph.Edge

EdgeBetween implements gonum/graph.Undirected

func (*Graph) From

func (g *Graph) From(id int64) ggraph.Nodes

From implements gonum/graph.Graph.

func (*Graph) HasEdgeBetween

func (g *Graph) HasEdgeBetween(xid, yid int64) bool

HasEdgeBetween implements gonum/graph.Graph.

func (*Graph) Node

func (g *Graph) Node(id int64) ggraph.Node

Node implements gonum/graph.Graph.

func (*Graph) Nodes

func (g *Graph) Nodes() ggraph.Nodes

Nodes implements gonum/graph.Graph.

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node wraps graph.Node to be gonum/graph.Node compatible.

func (*Node) ID

func (n *Node) ID() int64

ID implements gonum/graph.Node.

type Nodes

type Nodes struct {
	// contains filtered or unexported fields
}

Nodes implements gonum/graph.Nodes.

func (*Nodes) Len

func (n *Nodes) Len() int

Len implements gonum/graph.Iterator

func (*Nodes) Next

func (n *Nodes) Next() bool

Next implements gonum/graph.Iterator

func (*Nodes) Node

func (n *Nodes) Node() ggraph.Node

Node implements gonum/graph.Nodes

func (*Nodes) Reset

func (n *Nodes) Reset()

Reset implements gonum/graph.Iterator

Jump to

Keyboard shortcuts

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