diff --git a/encode.go b/encode.go index e4aaf9b..de3cf83 100644 --- a/encode.go +++ b/encode.go @@ -300,7 +300,7 @@ func LoadSavedGraph[K cmp.Ordered](path string) (*SavedGraph[K], error) { } // Save writes the graph to the file. -func (g *SavedGraph[T]) Save() error { +func (g *SavedGraph[K]) Save() error { tmp, err := renameio.TempFile("", g.Path) if err != nil { return err diff --git a/graph.go b/graph.go index 4cfe82a..88fdeba 100644 --- a/graph.go +++ b/graph.go @@ -277,7 +277,7 @@ func maxLevel(ml float64, numNodes int) int { } // randomLevel generates a random level for a new node. -func (h *Graph[T]) randomLevel() int { +func (h *Graph[K]) randomLevel() int { // max avoids having to accept an additional parameter for the maximum level // by calculating a probably good one from the size of the base layer. max := 1 @@ -301,7 +301,7 @@ func (h *Graph[T]) randomLevel() int { return max } -func (g *Graph[T]) assertDims(n Vector) { +func (g *Graph[K]) assertDims(n Vector) { if len(g.layers) == 0 { return } @@ -313,7 +313,7 @@ func (g *Graph[T]) assertDims(n Vector) { // Dims returns the number of dimensions in the graph, or // 0 if the graph is empty. -func (g *Graph[T]) Dims() int { +func (g *Graph[K]) Dims() int { if len(g.layers) == 0 { return 0 } @@ -447,7 +447,7 @@ func (h *Graph[K]) Search(near Vector, k int) []Node[K] { } // Len returns the number of nodes in the graph. -func (h *Graph[T]) Len() int { +func (h *Graph[K]) Len() int { if len(h.layers) == 0 { return 0 }