mirror of
https://github.com/gonum/gonum.git
synced 2025-10-15 19:50:48 +08:00
graph/path/...: update for int64 IDs
This commit is contained in:
@@ -72,10 +72,10 @@ func navigableSmallWorldUndirected(n, p, q int, r float64) graph.Undirected {
|
||||
|
||||
func coordinatesForID(n graph.Node, c, r int) [2]int {
|
||||
id := n.ID()
|
||||
if id >= c*r {
|
||||
if id >= int64(c*r) {
|
||||
panic("out of range")
|
||||
}
|
||||
return [2]int{id / r, id % r}
|
||||
return [2]int{int(id) / r, int(id) % r}
|
||||
}
|
||||
|
||||
// manhattanBetween returns the Manhattan distance between a and b.
|
||||
|
Reference in New Issue
Block a user