graph

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EqualWeightPath added in v0.5.0

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

func NewEqualWeightPath added in v0.5.0

func NewEqualWeightPath(names []string, weight unit.Weight) *EqualWeightPath

func (EqualWeightPath) Names added in v0.5.0

func (p EqualWeightPath) Names() []string

func (EqualWeightPath) Weights added in v0.5.0

func (p EqualWeightPath) Weights() []unit.Weight

type FractionalWeightPath added in v0.5.0

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

func NewFractionalWeightPath added in v0.5.0

func NewFractionalWeightPath(names []string, weight unit.Weight) *FractionalWeightPath

func (FractionalWeightPath) Names added in v0.5.0

func (p FractionalWeightPath) Names() []string

func (FractionalWeightPath) Weights added in v0.5.0

func (p FractionalWeightPath) Weights() []unit.Weight

type Graph

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

Graph has named nodes/vertexes

func NewGraph

func NewGraph(indvs []string) *Graph

func NewGraphFromCsvInput

func NewGraphFromCsvInput(in relatedness.CsvInput, maxDist relational.Degree, pars parentage.CsvInput, dems demographics.CsvInput) *Graph

func (*Graph) AddAge added in v0.10.0

func (graph *Graph) AddAge(name string, age demographics.Age)

func (*Graph) AddInfo added in v0.10.0

func (graph *Graph) AddInfo(name string, info Info)

func (*Graph) AddNode

func (graph *Graph) AddNode(n gonumGraph.Node)

func (*Graph) AddNodeNamed added in v0.5.0

func (graph *Graph) AddNodeNamed(name string)

func (*Graph) AddParentage added in v0.10.0

func (graph *Graph) AddParentage(name, dam, sire string)

func (*Graph) AddPath

func (graph *Graph) AddPath(p Path)

func (*Graph) AddSex added in v0.10.0

func (graph *Graph) AddSex(name string, sex demographics.Sex)

func (*Graph) Edge

func (graph *Graph) Edge(uid, vid int64) gonumGraph.Edge

func (*Graph) EdgeBetween added in v0.5.0

func (graph *Graph) EdgeBetween(xid, yid int64) gonumGraph.Edge

func (*Graph) EdgeBetweenNamed added in v0.5.0

func (graph *Graph) EdgeBetweenNamed(n1, n2 string) gonumGraph.Edge

func (*Graph) EdgeNamed added in v0.5.0

func (graph *Graph) EdgeNamed(n1, n2 string) gonumGraph.Edge

func (*Graph) Edges

func (graph *Graph) Edges() gonumGraph.Edges

func (*Graph) From

func (graph *Graph) From(id int64) gonumGraph.Nodes

func (*Graph) FromNamed added in v0.5.0

func (graph *Graph) FromNamed(name string) gonumGraph.Nodes

func (*Graph) HasEdgeBetween added in v0.5.0

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

func (*Graph) HasEdgeBetweenNamed added in v0.5.0

func (graph *Graph) HasEdgeBetweenNamed(n1, n2 string) bool

func (*Graph) IDToName added in v0.5.0

func (graph *Graph) IDToName(id int64) (string, bool)

IDToName converts the id to its corresponding node name Returns false if the node does not exist

func (*Graph) Info added in v0.10.0

func (graph *Graph) Info(name string) Info

func (*Graph) IsKnown added in v0.5.0

func (graph *Graph) IsKnown(name string) bool

func (*Graph) NameToID added in v0.5.0

func (graph *Graph) NameToID(name string) (int64, bool)

NameToID converts the name to its corresponding node ID Returns false if the node does not exist

func (*Graph) NewNode added in v0.5.0

func (graph *Graph) NewNode() gonumGraph.Node

func (*Graph) NewWeightedLine added in v0.5.0

func (graph *Graph) NewWeightedLine(from, to gonumGraph.Node, weight float64) gonumGraph.WeightedLine

func (*Graph) NewWeightedLineNamed added in v0.5.0

func (graph *Graph) NewWeightedLineNamed(n1, n2 string, weight unit.Weight) gonumGraph.WeightedLine

func (*Graph) Node

func (graph *Graph) Node(id int64) gonumGraph.Node

func (*Graph) NodeNamed added in v0.5.0

func (graph *Graph) NodeNamed(name string) gonumGraph.Node

func (*Graph) Nodes

func (graph *Graph) Nodes() gonumGraph.Nodes

func (*Graph) PruneToShortest

func (graph *Graph) PruneToShortest() *Graph

func (*Graph) RemoveNode

func (graph *Graph) RemoveNode(id int64)

func (*Graph) RemoveNodeNamed added in v0.5.0

func (graph *Graph) RemoveNodeNamed(name string)

func (*Graph) RmDisconnected

func (graph *Graph) RmDisconnected()

func (*Graph) SetWeightedLine added in v0.5.0

func (graph *Graph) SetWeightedLine(e gonumGraph.WeightedLine)

func (*Graph) String added in v0.5.0

func (graph *Graph) String() string

func (*Graph) Weight

func (graph *Graph) Weight(xid, yid int64) (w float64, ok bool)

func (*Graph) WeightNamed added in v0.5.0

func (graph *Graph) WeightNamed(n1, n2 string) (w float64, ok bool)

func (*Graph) WeightedEdge

func (graph *Graph) WeightedEdge(uid, vid int64) gonumGraph.WeightedEdge

func (*Graph) WeightedEdgeNamed added in v0.5.0

func (graph *Graph) WeightedEdgeNamed(n1, n2 string) gonumGraph.WeightedEdge

func (*Graph) WeightedEdges

func (graph *Graph) WeightedEdges() gonumGraph.WeightedEdges

type Info added in v0.10.0

type Info struct {
	ID        int64
	Sex       demographics.Sex
	Age       demographics.Age
	Dam, Sire string
}

type Path added in v0.5.0

type Path interface {
	Names() []string
	Weights() []unit.Weight
}

type RelationalWeightPath added in v0.5.0

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

func NewRelationalWeightPath added in v0.5.0

func NewRelationalWeightPath(from, to string, dist relational.Degree, weight unit.Weight) (*RelationalWeightPath, error)

func (RelationalWeightPath) Names added in v0.5.0

func (p RelationalWeightPath) Names() []string

func (RelationalWeightPath) Weights added in v0.5.0

func (p RelationalWeightPath) Weights() []unit.Weight

Jump to

Keyboard shortcuts

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