<commit_before><commit_msg>Implement the null graph. Closes #13.<commit_after>package gogl

// 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 _ DirectedGraph = nullGraph(false)
var _ SimpleGraph = nullGraph(false)
var _ WeightedGraph = nullGraph(false)
var _ LabeledGraph = nullGraph(false)
var _ DataGraph = nullGraph(false)

func (g nullGraph) EachVertex(f func(v Vertex))                        {}
func (g nullGraph) EachEdge(f func(e Edge))                            {}
func (g nullGraph) EachWeightedEdge(f func(e WeightedEdge))            {}
func (g nullGraph) EachLabeledEdge(f func(e LabeledEdge))              {}
func (g nullGraph) EachDataEdge(f func(e DataEdge))                    {}
func (g nullGraph) EachAdjacent(start Vertex, f func(adjacent Vertex)) {}

func (g nullGraph) HasVertex(v Vertex) bool {
	return false
}

func (g nullGraph) InDegree(Vertex) (degree int, exists bool) {
	return 0, false
}

func (g nullGraph) OutDegree(Vertex) (degree int, exists bool) {
	return 0, false
}

func (g nullGraph) HasEdge(e Edge) 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) Size() int {
	return 0
}

func (g nullGraph) Order() int {
	return 0
}

func (g nullGraph) Density() float64 {
	return 0
}

func (g nullGraph) Transpose() DirectedGraph {
	return g
}

{'fraction_non_alphanumeric': 0.0977751756440281, 'fraction_numerical': 0.005269320843091335, 'mean_word_length': 3.682191780821918, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4161331', 'n_tokens_mistral': 558, 'n_tokens_neox': 546, 'n_words': 188}