MCPcopy Create free account
hub / github.com/gonum/plot / subgraph

Method subgraph

plotter/johnson.go:246–258  ·  view source on GitHub ↗

subgraph returns a subgraph of g induced by {s, s+1, ... , n}. The subgraph is destructively generated in g.

(s int)

Source from the content-addressed store, hash-verified

244// subgraph returns a subgraph of g induced by {s, s+1, ... , n}. The
245// subgraph is destructively generated in g.
246func (g graph) subgraph(s int) graph {
247 for u := range g[:s] {
248 g[u] = nil
249 }
250 for u, e := range g[s:] {
251 for v := range e {
252 if v < s {
253 delete(g[u+s], v)
254 }
255 }
256 }
257 return g
258}
259
260// clone returns a deep copy of the graph g.
261func (g graph) clone() graph {

Callers 1

cyclesInFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected