File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ func LoadSavedGraph[K cmp.Ordered](path string) (*SavedGraph[K], error) {
300
300
}
301
301
302
302
// Save writes the graph to the file.
303
- func (g * SavedGraph [T ]) Save () error {
303
+ func (g * SavedGraph [K ]) Save () error {
304
304
tmp , err := renameio .TempFile ("" , g .Path )
305
305
if err != nil {
306
306
return err
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ func maxLevel(ml float64, numNodes int) int {
277
277
}
278
278
279
279
// randomLevel generates a random level for a new node.
280
- func (h * Graph [T ]) randomLevel () int {
280
+ func (h * Graph [K ]) randomLevel () int {
281
281
// max avoids having to accept an additional parameter for the maximum level
282
282
// by calculating a probably good one from the size of the base layer.
283
283
max := 1
@@ -301,7 +301,7 @@ func (h *Graph[T]) randomLevel() int {
301
301
return max
302
302
}
303
303
304
- func (g * Graph [T ]) assertDims (n Vector ) {
304
+ func (g * Graph [K ]) assertDims (n Vector ) {
305
305
if len (g .layers ) == 0 {
306
306
return
307
307
}
@@ -313,7 +313,7 @@ func (g *Graph[T]) assertDims(n Vector) {
313
313
314
314
// Dims returns the number of dimensions in the graph, or
315
315
// 0 if the graph is empty.
316
- func (g * Graph [T ]) Dims () int {
316
+ func (g * Graph [K ]) Dims () int {
317
317
if len (g .layers ) == 0 {
318
318
return 0
319
319
}
@@ -447,7 +447,7 @@ func (h *Graph[K]) Search(near Vector, k int) []Node[K] {
447
447
}
448
448
449
449
// Len returns the number of nodes in the graph.
450
- func (h * Graph [T ]) Len () int {
450
+ func (h * Graph [K ]) Len () int {
451
451
if len (h .layers ) == 0 {
452
452
return 0
453
453
}
You can’t perform that action at this time.
0 commit comments