forked from sdboyer/gogl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
null.go
73 lines (57 loc) · 1.77 KB
/
null.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package gogl
import (
"math"
)
// The null graph is a graph without any edges or vertices. It implements all possible (non-mutable) graph interfaces.
//
// In effect, it is the zero-value of all possible graph types.
const NullGraph = nullGraph(false)
type nullGraph bool
var _ Graph = nullGraph(false)
var _ Digraph = nullGraph(false)
var _ SimpleGraph = nullGraph(false)
var _ WeightedGraph = nullGraph(false)
var _ LabeledGraph = nullGraph(false)
var _ DataGraph = nullGraph(false)
func (g nullGraph) Vertices(f VertexStep) {}
func (g nullGraph) Edges(f EdgeStep) {}
func (g nullGraph) Arcs(f ArcStep) {}
func (g nullGraph) IncidentTo(Vertex, EdgeStep) {}
func (g nullGraph) ArcsFrom(Vertex, ArcStep) {}
func (g nullGraph) PredecessorsOf(Vertex, VertexStep) {}
func (g nullGraph) ArcsTo(Vertex, ArcStep) {}
func (g nullGraph) SuccessorsOf(Vertex, VertexStep) {}
func (g nullGraph) AdjacentTo(start Vertex, f VertexStep) {}
func (g nullGraph) HasVertex(v Vertex) bool {
return false
}
func (g nullGraph) InDegreeOf(Vertex) (degree int, exists bool) {
return 0, false
}
func (g nullGraph) OutDegreeOf(Vertex) (degree int, exists bool) {
return 0, false
}
func (g nullGraph) DegreeOf(Vertex) (degree int, exists bool) {
return 0, false
}
func (g nullGraph) HasEdge(e Edge) bool {
return false
}
func (g nullGraph) HasArc(e Arc) bool {
return false
}
func (g nullGraph) HasWeightedEdge(e WeightedEdge) bool {
return false
}
func (g nullGraph) HasLabeledEdge(e LabeledEdge) bool {
return false
}
func (g nullGraph) HasDataEdge(e DataEdge) bool {
return false
}
func (g nullGraph) Density() float64 {
return math.NaN()
}
func (g nullGraph) Transpose() Digraph {
return g
}