mirror of
https://github.com/gonum/gonum.git
synced 2025-10-17 20:51:06 +08:00
graph: imported graph as a subtree
This commit is contained in:
33
graph/network/network_test.go
Normal file
33
graph/network/network_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// Copyright ©2015 The gonum Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package network
|
||||
|
||||
const (
|
||||
A = iota
|
||||
B
|
||||
C
|
||||
D
|
||||
E
|
||||
F
|
||||
G
|
||||
H
|
||||
I
|
||||
J
|
||||
K
|
||||
)
|
||||
|
||||
// set is an integer set.
|
||||
type set map[int]struct{}
|
||||
|
||||
func linksTo(i ...int) set {
|
||||
if len(i) == 0 {
|
||||
return nil
|
||||
}
|
||||
s := make(set)
|
||||
for _, v := range i {
|
||||
s[v] = struct{}{}
|
||||
}
|
||||
return s
|
||||
}
|
Reference in New Issue
Block a user